query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Add To Shared Preference
@Override public void addPreferenceAndUpdateWidget(Context context, Pastry pastry) { IngredientSharedPreference.setIngredientListPreference(context, pastry.getIngredientsList()); IngredientSharedPreference.setRecipeNamePreference(pastry.getName(), context); updateWidget(context); }
{ "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 }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.pref);\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n //onSharedPreferenceChanged(sharedPreferences, getString(R.string.language_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.difficulty_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.word_category_key));\n }", "public void add(String key, Object value) {\n Object oldValue = null;\n if (value instanceof String) {\n editor.putString(key, (String) value);\n oldValue = get(key, \"\");\n } else if (value instanceof Boolean) {\n editor.putBoolean(key, (Boolean) value);\n oldValue = get(key, false);\n } else if (value instanceof Integer) {\n editor.putInt(key, (Integer) value);\n oldValue = get(key, -1);\n } else if (value instanceof Long) {\n editor.putLong(key, (Long) value);\n oldValue = get(key, -1l);\n } else {\n if (value != null)\n Log.e(TAG, \"Value not inserted, Type \" + value.getClass() + \" not supported\");\n else\n Log.e(TAG, \"Cannot insert null values in sharedprefs\");\n }\n editor.apply();\n\n //notifying the observers\n notifyObservers(key, oldValue, value);\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.preferences);\n }", "public static void saveToSharedPreference(String key, String value) {\n\n appSharePreference.edit().putString(key.toString(), value.toString()).apply();\n }", "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "private void changePreferences (String prefItem, String prefValue){\n SharedPreferences.Editor prefEditor = sharedPreferences.edit();\n //store the cards array and append the deck id\n prefEditor.putString(prefItem, prefValue);\n prefEditor.apply();\n }", "private void savePrefsData() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\"myPrefs\", MODE_PRIVATE);\n SharedPreferences.Editor editor = pref.edit();\n editor.putBoolean(\"isIntroOpnend\", true);\n editor.commit();\n }", "@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 void saveDataToSharedPreference(View view) {\n email = emailEditText.getText().toString();\n name = nameEditText.getText().toString();\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n editor.putString(\"name\",name);\n editor.putString(\"email\",email);\n editor.apply();\n\n Toast.makeText(context, \"Data saved successfully into SharedPreferences!\", Toast.LENGTH_SHORT).show();\n clearText();\n }", "public void updatePreferences() {\n\n Toast.makeText(this, \"enter your data\", Toast.LENGTH_SHORT).show();\n startActivity(new Intent(this, SipSettingsActivity.class));\n\n }", "protected void SavePreferences(String key, String value) {\n SharedPreferences data = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = data.edit();\n editor.putString(key, value);\n editor.commit();\n\n\n }", "public void setPrefrence(String key, String value) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n SharedPreferences.Editor editor = prefrence.edit();\n editor.putString(key, value);\n editor.commit();\n }", "public void setPrefrence(String key, String value) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n SharedPreferences.Editor editor = prefrence.edit();\n editor.putString(key, value);\n editor.commit();\n }", "private void savePreferences(String key, String value) {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(c);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key, value);\n editor.apply();\n }", "protected void addStaticPreferences(PreferenceScreen screen) {\n }", "private void savePreferences(String key, String value) {\n\t\tSharedPreferences sp = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tEditor edit = sp.edit();\n\t\tedit.putString(key, value);\n\t\tedit.commit();\n\t}", "public void setPreference(View v){\n SharedPreferences.Editor editor = settings.edit();\n String prefValue = cHelpers.getText(this, R.id.editText);\n editor.putString(\"key1\",prefValue);\n editor.commit();\n cHelpers.show_toast(this, \"Preference Saved\");\n }", "public static void saveToPrefs(Context context,String key, String value) {\n SharedPreferences prefs = getSettings();\n final SharedPreferences.Editor editor = prefs.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public void saveSettings(View v) {\n SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); // get shared preferences\n SharedPreferences.Editor editor = sharedPref.edit();\n int seconds_rec = Integer.parseInt(time_recording.getText().toString());\n int notif_occ = Integer.parseInt(time_occurance.getText().toString());\n\n editor.putInt(getString(R.string.time_recording_seconds), seconds_rec); // save values to a sp\n editor.putInt(getString(R.string.time_notification_minutes), notif_occ);\n editor.commit(); // commit the differences\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "protected void makePref(){\n //Creates a shared pref called MyPref and 0-> MODE_PRIVATE\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //so the pref can be edit\n edit = sharedPref.edit();\n}", "private void preferences() {\n\tstartActivity (new Intent(getApplicationContext(), PushPreferencesActivity.class));\n}", "public void setSharedPreference(Activity activity,String key,String value){\n SharedPreferences sharedPreferences=activity.getSharedPreferences(activity.getPackageName(), Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key,value);\n editor.apply();\n }", "public void putBoolean(String key, boolean value){\n\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n\n editor.putBoolean(key, value);\n\n editor.apply();\n }", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "@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 }", "private void saveSharedPrefs(String a, boolean b) {\n SharedPreferences.Editor editor = sp.edit();\n if (b) editor.putString(\"searchField\", a);\n else editor.putString(\"ingredientsField\", a);\n editor.commit();\n }", "private void savePreferenceData(String role){\n if (getIntent()!=null){\n SharedPreferences preferences = getSharedPreferences(detailPreference, MODE_PRIVATE);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(preferenceKey, role);\n editor.apply();\n }\n }", "public void saveString(String key,String value)\n {\n preference.edit().putString(key,value).apply();\n }", "public void writeUserInro(String name,String key){\n SharedPreferences user = context.getSharedPreferences(\"user_info\",0);\n SharedPreferences.Editor mydata = user.edit();\n mydata.putString(\"uName\" ,name);\n mydata.putString(\"uKey\",key);\n mydata.commit();\n }", "protected static void addEntryInList(String key, String entry) {\n if (hasEntryInList(key, entry))\n return ;\n\n String entries = getSPreference(key);\n if (TextUtils.isEmpty(entries))\n entries = entry;\n else\n entries = entries + \":\" + entry;\n\n setPreference(key, entries);\n }", "public void storePreferences(String userid, String token, JSONArray settings) throws JSONException {\n SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(\"ca.gc.inspection.scoop\", Context.MODE_PRIVATE);\n\n JSONObject setting = settings.getJSONObject(0);\n Iterator<String> keys = setting.keys();\n while(keys.hasNext()){\n String settingKey = keys.next();\n if (settingKey.equals(useridStr)){ continue;}\n sharedPreferences.edit().putString(settingKey, setting.getString(settingKey)).apply();\n }\n\n // storing the token into shared preferences\n sharedPreferences.edit().putString(\"token\", token).apply();\n Config.token = token;\n\n // storing the user id into shared preferences\n sharedPreferences.edit().putString(useridStr, userid).apply();\n Config.currentUser = userid;\n\n // change activities once register is successful\n if(Config.token != null && Config.currentUser != null) registerSuccess();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tPreferenceManager prefMgr = getPreferenceManager();\n\t\tprefMgr.setSharedPreferencesName(\"appPreferences\");\n\t\t\n\t\taddPreferencesFromResource(R.xml.mappreference);\n\t}", "public void savingPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n\n //tao doi tuong editer\n SharedPreferences.Editor editor = sharedPreferences.edit();\n String user = txtUserName.getText().toString();\n String pass = txtPassWord.getText().toString();\n\n boolean bchk = chkSave.isChecked();\n\n\n if(!bchk)\n {\n //xoa du lieu luu truoc do\n editor.clear();\n }\n else\n {\n editor.putString(\"user\",user);\n editor.putString(\"pass\",pass);\n editor.putBoolean(\"checked\",bchk);\n }\n\n editor.commit();\n\n\n }", "public void setPreference(String key, String value) {\n\t SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(myContext);\n\t \n\t SharedPreferences.Editor editor = prefs.edit();\n\t editor.putString(key, value);\n\t editor.commit(); // important! Don't forget!\n\t}", "private void savePreference() {\n\t\tString myEmail = ((TextView) findViewById(R.id.myEmail)).getText().toString();\n\t\tString myPassword = ((TextView) findViewById(R.id.myPassword)).getText().toString();\n\t\t\n\t\tEditor editor = sharedPreferences.edit();\n\t\teditor.putString(\"myEmail\", myEmail);\n\t\teditor.putString(\"myPassword\", myPassword);\n\t\teditor.putString(\"readOPtion\", Constants.READ_OPTION_SUBJECT_ONLY);\n\t\teditor.putInt(\"increment\", 10);\n\t\teditor.putString(\"bodyDoneFlag\", bodyDoneFlag);\n\t\teditor.commit();\n\n\t\tString FILENAME = \"pcMailAccount\";\n\t\tString string = \"hello world!\";\n\t\tString del = \"_____\";\n\t\t\n\t\tFile folder = new File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DCIM + \"/VoiceMail\");\n\t\tif (!folder.isDirectory()) {\n\t\t\tfolder.mkdirs();\n\t\t}\n \n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfolder.createNewFile();\n//\t\t\tfos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\t fos = new FileOutputStream(new File(folder, FILENAME));\n\t string = \"myEmail:\" + myEmail + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"myPassword:\" + myPassword + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"bodyDoneFlag:\" + bodyDoneFlag + del;\n\t\t\tfos.write(string.getBytes());\n\t\t\t\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.framework_setting);\n SharedPreferences sharedPreferences = this.getPreferenceManager().getSharedPreferences();\n String preference_smartbar_default_type = getResources().getString(R.string.preference_smartbar_default_type);\n final ListPreference listPreference = (ListPreference) findPreference(preference_smartbar_default_type);\n //修改Smartbar类型\n String smart_type = sharedPreferences.getString(preference_smartbar_default_type, null);\n int index = listPreference.findIndexOfValue(String.valueOf(smart_type));\n if (index != -1) {\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n }\n if (listPreference != null) {\n listPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object newValue) {\n int index = listPreference.findIndexOfValue(newValue.toString());\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n return true;\n }\n });\n }\n }", "public void update_storage( ) {\n SharedPreferences sp_file = getPreferences(Context.MODE_PRIVATE); //make shared preferences object\n SharedPreferences.Editor editor = sp_file.edit(); //make editor object\n editor.putInt(\"alarm_set\", alarm_set);\n editor.apply();\n }", "public void saveData(){\n SharedPreferences sharedPreferences = getSharedPreferences(\"SHARED_PREFS\",MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"email_pref\",email.getText().toString());\n editor.putString(\"password_pref\",uPassword.getText().toString());\n editor.apply();\n }", "SharedPreferences mo117960a();", "public void shareData(){\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n //now get Editor\n SharedPreferences.Editor editor = sharedPref.edit();\n //put your value\n editor.putInt(\"score3\", points);\n\n //commits your edits\n editor.commit();\n }", "private void storeKeyWord(String keyWord) {\n SharedPrefsUtils.setStringPreference(application.getApplicationContext(),\"KEY\",keyWord);\n }", "public void writeUserLog(String name){\n SharedPreferences user = context.getSharedPreferences(\"user_info\",0);\n SharedPreferences.Editor mydata = user.edit();\n mydata.putString(\"userlist\" ,name);\n mydata.commit();\n }", "public void putRoleValue(String key, String value){\n SharedPreferences sharedPreference = context.getSharedPreferences(LOGIN, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreference.edit();\n editor.putString(key,value);\n editor.apply();\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "public void writeEncounterNumPreferences(long encounterNum){\n mSharedPreference = mContext.getSharedPreferences(mContext.getString(\n R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=mSharedPreference.edit();\n editor.putLong(mContext.getString(R.string.encounter),encounterNum);\n editor.commit();\n}", "void addGameScoreToMainScore(){\n sharedPreferences= PreferenceManager.getDefaultSharedPreferences(this);\n editor=sharedPreferences.edit();\n int score=sharedPreferences.getInt(\"gameScore\",0);\n score=score+userCoins;\n editor.putInt(\"gameScore\",score);\n editor.commit();\n\n }", "private void setPreferences(String sw, boolean checked) {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(sw,checked);\n editor.apply();\n\n }", "public void saveString(int prefKey, String value) {\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(getResources().getString(prefKey), value);\n editor.apply();\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.settings_main);\n\n Preference orderBy = findPreference(getString(R.string.settings_order_by_key));\n bindPreferenceSummaryToValue(orderBy);\n\n Preference filterByCompany = findPreference(getString(R.string.settings_filter_by_company_key));\n bindPreferenceSummaryToValue(filterByCompany);\n\n Preference filterBySection = findPreference(getString(R.string.settings_filter_by_section_key));\n bindPreferenceSummaryToValue(filterBySection);\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.settings);\n }", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userinfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n\n editor.apply();\n Toast.makeText(this,\"Saved!\",Toast.LENGTH_LONG).show();\n }", "public static void setPrefStringData(Context context, String key, String value) {\n SharedPreferences appInstallInfoSharedPref = context.\n getSharedPreferences(APP_CONFIG_PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor appInstallInfoEditor = appInstallInfoSharedPref.edit();\n appInstallInfoEditor.putString(key, value);\n appInstallInfoEditor.apply();\n }", "public static void savePreference(SharedPreferences prefs, String key, Boolean value) {\n Editor e = prefs.edit();\n e.putBoolean(key, value);\n e.commit();\n }", "public void putBooleanValue(String key, boolean value){\n SharedPreferences sharedPreference = context.getSharedPreferences(LOGIN,Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreference.edit();\n editor.putBoolean(key,value);\n editor.apply();\n }", "@Override\n public void onCreate() {\n\n SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS);\n addHelper(PREFS_BACKUP_KEY, helper);\n }", "public static void savePreferences(Context context, String strKey, String strValue) {\n try {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(strKey, strValue);\n editor.commit();\n } catch (Exception e) {\n e.toString();\n\n }\n }", "public void saveInPreference(String name, String content) {\n\t\tSharedPreferences preferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tSharedPreferences.Editor editor = preferences.edit();\n\t\teditor.putString(name, content);\n\t\teditor.commit();\n\t}", "public static void setPrefBooleanData(Context context, String key, boolean value) {\n SharedPreferences appInstallInfoSharedPref = context.\n getSharedPreferences(APP_CONFIG_PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor appInstallInfoEditor = appInstallInfoSharedPref.edit();\n appInstallInfoEditor.putBoolean(key, value);\n appInstallInfoEditor.apply();\n }", "public static void savePreferences(Context context, String strKey, Boolean blnValue) {\n try {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(strKey, blnValue);\n editor.commit();\n } catch (Exception e) {\n e.toString();\n }\n }", "public void save() {\n savePrefs();\n }", "@Override\n public void saveBoolean(String key, boolean value) {\n SharedPreferences.Editor prefs = mSharedPreferences.edit();\n prefs.putBoolean(key, value);\n prefs.commit();\n }", "public void save () {\n preference.putBoolean(\"sound effect\", hasSoundOn);\n preference.putBoolean(\"background music\", hasMusicOn);\n preference.putFloat(\"sound volume\", soundVolume);\n preference.putFloat(\"music volume\", musicVolume);\n preference.flush(); //this is called to write the changed data into the file\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n String aaString = sharedPreferences.getString(getString(R.string.pref_antalAktier_key), getString(R.string.pref_antalAktier_default));\n// float aaFloat = Float.parseFloat(aaString);\n editTextAntalAktier.setText(aaString);\n\n String kk = sharedPreferences.getString(getString(R.string.pref_koebskurs_key), getString(R.string.pref_koebskurs__default));\n editTextKoebskurs.setText(kk);\n\n String k = sharedPreferences.getString(getString(R.string.pref_kurtage_key), getString(R.string.pref_kurtage_default));\n editTextKurtage.setText(k);\n\n// float minSize = Float.parseFloat(sharedPreferences.getString(getString(R.string.pref_size_key),\n// getString(R.string.pref_size_default)));\n// mVisualizerView.setMinSizeScale(minSize);\n\n // Register the listener\n sharedPreferences.registerOnSharedPreferenceChangeListener(this);\n }", "private void saveData() {\n\n SharedPreferences sharedPreferences=getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n\n editor.putString(\"name\",name.getText().toString());\n editor.putString(\"regnum\",regnum.getText().toString());\n editor.putInt(\"count\", count);\n editor.apply();\n\n }", "@Override\r\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\r\n getPreferenceManager().setSharedPreferencesName(PreferManager.PPEFER_FILE);\r\n addPreferencesFromResource(R.xml.preference);\r\n }", "protected void storeSharedPrefs(String un2, String pwd2) {\n \teditor.putString(\"username\", un2);\n \teditor.putString(\"password\", pwd2); \t\n\t\teditor.commit(); //Commiting changes\n\t}", "public void shared() {\n\n String Email = editTextEmail.getText().toString();\n String Password = editTextPassword.getText().toString();\n String username = userstring;\n\n SharedPreferences sharedlog = getSharedPreferences(\"usernamelast\" , MODE_PRIVATE);\n SharedPreferences.Editor editorlogin = sharedlog.edit();\n editorlogin.putString(\"usernamelast\", username);\n editorlogin.apply();\n\n SharedPreferences sharedPref = getSharedPreferences(\"email\", MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"email\", Email);\n editor.apply();\n //Los estados los podemos setear en la siguiente actividad\n SharedPreferences sharedPref2 = getSharedPreferences(\"password\", MODE_PRIVATE);\n SharedPreferences.Editor editor2 = sharedPref2.edit();\n editor2.putString(\"password\", Password);\n editor2.apply();\n\n\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t\tthis.prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t/*\n\t\t * Each app has its own shared preferences available to all components\n\t\t * of the app and this loads the default preferences that are saved on\n\t\t * the phone\n\t\t */\n\t\tthis.prefs.registerOnSharedPreferenceChangeListener(this);\n\t\t/*\n\t\t * Each user can change preferences. So this listener is a mechanism to\n\t\t * notify this activity that the old values are stale\n\t\t */\n\t}", "@Override \r\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState); \r\n addPreferencesFromResource(R.xml.preference);\r\n initPreferenceCategory(\"pref_key_allow_typedefine_commond\");\r\n }", "public void addRecentVisited(int position) {\n SharedPreferences sharedPref1 = getContext().getSharedPreferences(\"recentVisited\", Context.MODE_PRIVATE);\n Boolean removeOld=false;\n int toRemove=0;\n Log.d(\"size\", userName.size()+\"\");\n int count = sharedPref1.getInt(\"size\",0);\n for(int i=0;i<count+1;i++){\n\n // checks if user is in shared preferences.\n if(Objects.equals(sharedPref1.getString(\"uid_\" + i, \"null\"), uid.get(position))){\n toRemove=i;\n removeOld=true;\n }\n }\n SharedPreferences.Editor editor = sharedPref1.edit();\n if(removeOld){\n editor.remove(\"uid_\"+toRemove);\n editor.remove(\"name_\"+toRemove);\n }\n editor.putInt(\"size\",(count+1));\n editor.putString(\"name_\" + (count+1), userName.get(position));\n editor.putString(\"uid_\" + (count+1), uid.get(position));\n\n editor.apply();\n\n }", "public void writeToSharedPreference(int value){\n SharedPreferences sharedPreferences = getActivity().getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putInt(\"NUMBER OF ITEMS\",value);\n editor.commit();\n\n }", "public void savePreferences(SharedPreferences preferences){\r\n\t\tSharedPreferences.Editor editor = preferences.edit();\r\n editor.putBoolean(\"initialSetupped\", initialSetuped);\r\n editor.putString(\"username\", userName);\r\n editor.putString(\"useremail\", userEmail);\r\n editor.putString(\"recipientemail\", recipientEmail);\r\n editor.putBoolean(\"option\", option.isPound());\r\n\r\n // Commit the edits!\r\n editor.commit();\r\n\t}", "public void addMarkerToPref(Marker marker){\n parseClient.pushFavLoc(marker);\n latLngs.add(marker.getPosition());\n locationNames.add(marker.getTitle());\n saveMarkerPrefs();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.settings_main);\n // Find the preference we’re interested in and then bind the current preference value to be displayed\n // Use its findPreference() method to get the Preference object. To help us with binding the value that’s in SharedPreferences to what will show up in the preference summary, we’ll create a help method and call it\n Preference minNews = findPreference(getString(R.string.settings_number_of_news_key));\n // in order to update the preference summary when the settings activity is launched we setup the bindPreferenceSummaryToValue() helper method and which we used in onCreate()\n bindPreferenceSummaryToValue(minNews);\n\n Preference orderBy = findPreference(getString(R.string.settings_order_by_key));\n bindPreferenceSummaryToValue(orderBy);\n\n }", "public void UpdatePrefs()\r\n {\r\n \t\r\n \t// Data from the first name field is being stored into persistent storage\r\n \teditor.putString\r\n \t(\"name\", \r\n \tfNameField.getText()\r\n \t.toString());\r\n \t\r\n \t// Data from the last name field is being stored into persistent storage\r\n editor.putString\r\n (\"lName\",\r\n lNameField.getText()\r\n .toString());\r\n \r\n // Data from the phone number field is being stored into persistent storage\r\n editor.putString\r\n (\"phoneNum\"\r\n , phoneNumField.getText()\r\n .toString());\r\n \r\n // Data from the address field is being stored into persistent storage\r\n editor.putString\r\n (\"address\"\r\n , homeAddressField.getText()\r\n .toString());\r\n \r\n // Push all fields data to persistent storage forever\r\n editor.commit();\r\n }", "@Override\n public boolean onPreferenceClick(Preference preference) {\n Intent shortcutIntent = new Intent(getActivity(), VendorActivity.class);\n shortcutIntent.putExtra(\"vendor_id\", vendorDetailsObject.vendorId);\n// SharedPreferences example = getActivity().getSharedPreferences(\"USER\", 0);\n// SharedPreferences.Editor editor = example.edit();\n// editor.putString(\"latitude\", Home.lat+\"\");\n// editor.putString(\"longitude\", Home.longi+\"\");\n// editor.apply();\n MainApplication.getInstance().data.userMain.latitude = MainApplication.getInstance().location.getLatitude() + \"\";\n MainApplication.getInstance().data.userMain.longitude = MainApplication.getInstance().location.getLongitude() + \"\";\n MainApplication.getInstance().data.userMain.saveUserDataLocally();\n\n shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n Intent addIntent = new Intent();\n\n ImageView image = VendorActivity.logoView;\n Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();\n\n\n addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, vendorDetailsObject.name);\n addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON, bitmap);\n addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);\n addIntent.setAction(\"com.android.launcher.action.INSTALL_SHORTCUT\");\n getActivity().sendBroadcast(addIntent);\n Toast.makeText(getActivity(), \"Pinned To Home Screen\", Toast.LENGTH_SHORT).show();\n return true;\n }", "@Override\n public void onPause() {\n \t\t//Save settings Enabled, Alarm Hour, Alarm Minute\n SharedPreferences settings = getSharedPreferences(MainActivity.PREFS_NAME, 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putBoolean(MainActivity.ALARM_ENABLED, AlarmEnabled);\n editor.putInt(MainActivity.SNOOZE_MINUTE, SnoozeMin);\n \n //Commit the edits\n editor.commit();\n \n super.onPause();\n }", "public static void setPreference(String key, String value) {\n editor = sharedPreferences.edit();\n\n editor.putString(key, value);\n editor.apply();\n }", "public boolean saveuser_details(String skey, String svalue){\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(user_details, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(skey, svalue);\n editor.apply();\n return true;\n }", "private void saveOption() {\n SharedPreferences filterSetting = getSharedPreferences(\"filterSetting\",0);\n SharedPreferences.Editor editor = filterSetting.edit();\n editor.putBoolean(\"myMostRecent\",myMostRecentWeekCheckbox.isChecked());\n editor.putBoolean(\"myDisplayAll\",myDisplayAllCheckbox.isChecked());\n editor.putBoolean(\"foMostRecent\",foMostRecentWeekCheckbox.isChecked());\n editor.putBoolean(\"foDisplayAll\",foDisplayAllCheckbox.isChecked());\n editor.putString(\"myReason\",myReasonEditText.getText().toString());\n editor.putString(\"foReason\",foReasonEditText.getText().toString());\n editor.putInt(\"mySpinner\",myEmotionalStateSpinner.getSelectedItemPosition());\n editor.putInt(\"foSpinner\",foEmotionalStateSpinner.getSelectedItemPosition());\n\n editor.commit();\n }", "private void savePreferences() {\n SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(\" \", \"\");\n\n SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0);\n SharedPreferences.Editor editer = sharedPref.edit();\n editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr);\n editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr);\n editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr);\n editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr);\n\n // The commit runs faster.\n editer.apply();\n\n // Run this every time we're building a query.\n SharedPrefStatic.buildUriQuery();\n SharedPrefStatic.mEditIntentSaved = true;\n }", "private void setupSimplePreferencesScreen() {\n\n addPreferencesFromResource(R.xml.pref_weight);\n\n final Activity activity = getActivity();\n\n CustomPreferenceCategory fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader.setTitle(R.string.pref_header_about);\n getPreferenceScreen().addPreference(fakeHeader);\n addPreferencesFromResource(R.xml.pref_about);\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_units_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_plate_style_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_bar_weight_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_formula_key)));\n\n Preference aboutButton = (Preference)findPreference(getString(R.string.pref_about_button));\n aboutButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n AboutDialog aboutDialog = new AboutDialog();\n aboutDialog.show(getFragmentManager(), \"AboutDialog\");\n return true;\n }\n });\n\n Preference rateButton = (Preference)findPreference(getString(R.string.pref_rate_button));\n rateButton .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Uri uri = Uri.parse(\"market://details?id=\" + activity.getPackageName());\n Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);\n try {\n startActivity(goToMarket);\n } catch (ActivityNotFoundException e) {\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\"http://play.google.com/store/apps/details?id=\" + activity.getPackageName())));\n }\n return true;\n }\n });\n\n final RepCheckPreferenceFragment repCheckPreferenceFragment = this;\n\n Preference resetButton = (Preference)findPreference(getString(R.string.pref_reset_button));\n resetButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n DialogFragment saveAsNewDialog = ConfirmResetDialog.newInstance(new ResetResponseHandler(repCheckPreferenceFragment));\n saveAsNewDialog.show(activity.getFragmentManager(), \"RenameSetDialog\");\n return true;\n }\n });\n }", "@Override\n public void onResume() {\n super.onResume();\n\n getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);\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 }", "private void studentRoleAction(){\n savePreferenceData(\"student\");\n Intent intent = new Intent(this, StudentMainActivity.class);\n startActivity(intent);\n }", "private void registerPrefsListener() {\n if (userSharedPreferences == null) {\n userSharedPreferences = Util.getUserSharedPreferences();\n }\n userPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {\n @Override\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n switch (key) {\n case HPIApp.Prefs.SHARED_KEY_TOTAL_STEPS:\n int steps = sharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_TOTAL_STEPS, 0);\n txtViewStepsCountToday.setText(String.valueOf(steps));\n break;\n case HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY:\n int milestones = sharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY, 0);\n txtViewMilestonesCountToday.setText(String.valueOf(milestones));\n case HPIApp.Prefs.SHARED_KEY_RUN_SERVICE:\n boolean runService = sharedPreferences.getBoolean(HPIApp.Prefs.SHARED_KEY_RUN_SERVICE, false);\n if (runService) {\n HPIApp.getAppContext().startService(new Intent(HPIApp.getAppContext(), StepService.class));\n } else {\n HPIApp.getAppContext().stopService(new Intent(HPIApp.getAppContext(), StepService.class));\n }\n default:\n break;\n }\n }\n };\n\n userSharedPreferences.registerOnSharedPreferenceChangeListener(userPreferenceChangeListener);\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 createNewUserPreference(Context context) {\r\n\t\tString newUserId = generateNewUserId();\r\n\t\tString userConfigKey = getUserConfigFileNameKey(newUserId);\r\n\t\tString userDbKey = getUserDatabaseFileNameKey(newUserId);\r\n\t\tString userConfigFileName = getUserConfigFileName(context, newUserId);\r\n\t\tString userDbFileName = getUserDatabaseFileName(context, newUserId);\r\n\r\n\t\tSharedPreferences prefs = PreferenceManager\r\n\t\t\t\t.getDefaultSharedPreferences(context);\r\n\t\tif (prefs != null) {\r\n\t\t\tEditor editor = prefs.edit();\r\n\t\t\tif (editor != null) {\r\n\t\t\t\teditor.putString(\"user-\" + newUserId, newUserId);\r\n\t\t\t\teditor.putString(userConfigKey, userConfigFileName);\r\n\t\t\t\teditor.putString(userDbKey, userDbFileName);\r\n\t\t\t}\r\n\r\n\t\t\teditor.commit();\r\n\t\t}\r\n\t}", "@Override\n\tprotected void onPause() {\n\t\tSharedPreferences.Editor editor = myprefs.edit();\n\t\teditor.putString(\"userN\", userName);\n\t\teditor.putString(\"name\",person_name);\n\t\teditor.commit();\n\t\tsuper.onPause();\n\t}", "public synchronized boolean storeBoolean(String key, boolean value) {\n mEditor = mSharedPreferences.edit();\n mEditor.putBoolean(key, value);\n\n return mEditor.commit();\n }", "protected void addSetting(String text) {\n // Get the key and value from the string\n String[] parts = text.split(\":\");\n \n // Get the setting name\n String name = parts[0];\n \n // Get the value\n String value = String.join(\":\", Arrays.copyOfRange(parts, 1, parts.length));\n \n // Store the setting\n settings.put(name, value);\n }", "UserSettings store(String key, String value);", "public void retrieveDataFromSharedPreference(View view) {\n\n name = sharedPreferences.getString(\"name\",\"no data\");\n email = sharedPreferences.getString(\"email\",\"no data\");\n\n nameEditText.setText(name);\n emailEditText.setText(email);\n\n }", "void saveInPreferences(NetworkCallInformation userInfo);", "@Override\n\t@SuppressWarnings(\"deprecation\")\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tgetPreferenceScreen().getSharedPreferences()\n\t\t\t\t.registerOnSharedPreferenceChangeListener(this);\n\n\t}", "public final void mo32362c() {\n Editor edit = PreferenceManager.getDefaultSharedPreferences(C13499h.m39721g()).edit();\n edit.putString(\"com.facebook.appevents.SourceApplicationInfo.callingApplicationPackage\", this.f34929a);\n edit.putBoolean(\"com.facebook.appevents.SourceApplicationInfo.openedByApplink\", this.f34930b);\n edit.apply();\n }", "@SuppressLint(\"CommitPrefEdits\")\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if(id==R.id.action_settings) {\n SignUpActivity.editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();\n SignUpActivity.editor.putBoolean(\"is_logedin\", false);\n SignUpActivity.editor.apply();\n Intent myIntent = new Intent(HomeActivity.this, SignUpActivity.class);\n HomeActivity.this.startActivity(myIntent);\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "public void setPreference() {\n prefs = Preferences.userRoot().node(this.getClass().getName());\n String ID1 = \"Test1\";\n String ID2 = \"Test2\";\n String ID3 = \"Test3\";\n// First we will get the values\n// Define a boolean value\n System.out.println(prefs.getBoolean(ID1, true));\n// Define a string with default \"Hello World\n System.out.println(prefs.get(ID2, \"Hello World\"));\n// Define a integer with default 50\n System.out.println(prefs.getInt(ID3, 50));\n// Now set the values\n prefs.putBoolean(ID1, false);\n prefs.put(ID2, \"Hello Europa\");\n prefs.putInt(ID3, 45);\n\t\t\n prefs.remove(ID1);// Delete the preference settings for the first value\n }" ]
[ "0.6800727", "0.67911994", "0.66843385", "0.65692383", "0.65594286", "0.6523677", "0.64975613", "0.6494933", "0.64408726", "0.640715", "0.6387119", "0.6372107", "0.6371772", "0.6371772", "0.6331255", "0.62864643", "0.6255032", "0.62096757", "0.6182666", "0.61805594", "0.6173982", "0.6172076", "0.6148343", "0.61316925", "0.6125455", "0.6116722", "0.61132437", "0.61048776", "0.60966593", "0.6092336", "0.60689116", "0.60667366", "0.6064371", "0.60438514", "0.60357106", "0.6026664", "0.6023721", "0.60184145", "0.6005316", "0.6001756", "0.59703547", "0.5968624", "0.5954707", "0.5947012", "0.5938345", "0.5938345", "0.59341127", "0.59273934", "0.5927056", "0.59227926", "0.59227544", "0.591107", "0.5908376", "0.59021306", "0.5901559", "0.5888956", "0.5882595", "0.588117", "0.5877412", "0.5877013", "0.5870365", "0.5844186", "0.58337194", "0.5816486", "0.5815668", "0.58007526", "0.57995486", "0.5796382", "0.57849544", "0.57716846", "0.5770315", "0.5768328", "0.5767392", "0.57646316", "0.57500345", "0.5744363", "0.5734672", "0.5734467", "0.573377", "0.5733526", "0.57321185", "0.5731459", "0.57267433", "0.5725667", "0.5718099", "0.5698963", "0.5695523", "0.5690257", "0.56853306", "0.5682585", "0.56781644", "0.567277", "0.56699896", "0.56656444", "0.5652673", "0.56412464", "0.56290257", "0.5603755", "0.5603281", "0.55991" ]
0.58666307
61
Removes Preference and Updated Widget to default Values
@Override public void removePreferenceAndUpdateWidget(Context ctx) { IngredientSharedPreference.removePreferences(ctx); updateWidget(ctx); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void reset() {\n if (mPreference == null)\n return ;\n\n Editor editor = mPreference.edit();\n editor.clear();\n editor.commit();\n }", "public static void clear(){\n preferences.edit().clear().apply();\n }", "public void clearAllPreference() {\n editor.clear();\n editor.apply();\n }", "public static void reset() {\n prefs().edit()\n .remove(PREFKEY_USER_ID)\n .remove(PREFKEY_READER_TAG)\n .remove(PREFKEY_READER_RECOMMENDED_OFFSET)\n .remove(PREFKEY_READER_SUBS_PAGE_TITLE)\n .commit();\n }", "protected void uninstallDefaults() {\n spinner.setLayout(null); }", "protected void clear() {\r\n setValue(getDefault());\r\n }", "public void clearAllPreferenceData() {\n sharedPreferences.edit().clear().apply();\n }", "public void clearPrefs() {\n getSharedPreferencesEditor().clear().apply();\n }", "public static void clearDecoratorPrefs() {\n getUIStore().setValue(IPerforceUIConstants.PREF_FILE_OPEN_ICON, 0);\n getUIStore().setValue(IPerforceUIConstants.PREF_FILE_SYNC_ICON, 0);\n getUIStore().setValue(IPerforceUIConstants.PREF_FILE_SYNC2_ICON, 0);\n getUIStore()\n .setValue(IPerforceUIConstants.PREF_FILE_UNRESOLVED_ICON, 0);\n getUIStore().setValue(IPerforceUIConstants.PREF_FILE_LOCK_ICON, 0);\n getUIStore().setValue(IPerforceUIConstants.PREF_FILE_OTHER_ICON, 0);\n }", "@Override\n public void onSettingChanged(ListPreference pref) {\n }", "private void resetSharedPreferences(){\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(getString(R.string.pref_genre_key), getString(R.string.pref_genre_any_value));\n editor.putString(getString(R.string.pref_earliest_year_key), getString(R.string.pref_earliest_year_default));\n editor.putString(getString(R.string.pref_latest_year_key), getString(R.string.pref_latest_year_default));\n // Commit the edits\n editor.apply();\n }", "void setDefaultPreference(String preferenceName, String value) throws OntimizeJEERuntimeException;", "public void deinitPreference() {\n mContext.unregisterReceiver(mIntentReceiver);\n }", "public void onClick(DialogInterface dialog, int which) {\n SharedPreferences sp = getDefaultSharedPreferences(getApplicationContext());\n\n // save the preferences that must be kept\n boolean firstUse = sp.getBoolean(getString(R.string.KEY_FIRST_USE), false);\n int askForRate = sp.getInt(getString(R.string.KEY_ASK_FOR_RATE), getResources().getInteger(R.integer.askForRate_max_value));\n\n SharedPreferences.Editor editor = sp.edit();\n editor.clear();\n editor.putBoolean(getString(R.string.KEY_FIRST_USE), firstUse);\n editor.putInt(getString(R.string.KEY_ASK_FOR_RATE), askForRate);\n editor.apply();\n PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.preferences, true);\n\n // Delete the old fragment and replace with a new one. This will update the summaries\n // (I couldn't find a smarter way to do that...)\n getFragmentManager().beginTransaction()\n .replace(android.R.id.content, new SettingsFragment(), fragment_tag)\n .commit();\n dialog.dismiss();\n }", "@Override\n public void onPositive(MaterialDialog materialDialog) {\n sharedPrefs.edit()\n .remove(pref.key)\n .putString(pref.key, \"\" + values[numberPicker.getValue()])\n .apply();\n pref.pref.setSummary(values[numberPicker.getValue()]);\n materialDialog.dismiss();\n }", "@Override\n public void clearSharedPrefs() {\n\n }", "@Override\n public void dispose()\n {\n ShellPreference.removeListener(this);\n super.dispose();\n }", "public void clearForTesting() {\n mPreferences.edit().clear().apply();\n }", "public void setPreference() {\n prefs = Preferences.userRoot().node(this.getClass().getName());\n String ID1 = \"Test1\";\n String ID2 = \"Test2\";\n String ID3 = \"Test3\";\n// First we will get the values\n// Define a boolean value\n System.out.println(prefs.getBoolean(ID1, true));\n// Define a string with default \"Hello World\n System.out.println(prefs.get(ID2, \"Hello World\"));\n// Define a integer with default 50\n System.out.println(prefs.getInt(ID3, 50));\n// Now set the values\n prefs.putBoolean(ID1, false);\n prefs.put(ID2, \"Hello Europa\");\n prefs.putInt(ID3, 45);\n\t\t\n prefs.remove(ID1);// Delete the preference settings for the first value\n }", "@Override\n public void onClick(View view) {\n getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n\n collectValuesForSettings();\n updateSettings();\n dismiss();\n }", "protected void uninstallDefaults() {\n }", "private void loadDefaultValues() {\n for (Map.Entry<EditText, Integer> e : mPrefKeys.entrySet()) {\n e.getKey().setText(Pref.getDefault(this, e.getValue()));\n }\n }", "@Override\n\tpublic void clear() {\n\n\t\tDisplay.findDisplay(uiThread).syncExec(new Runnable() {\n\n\t\t\tpublic void run() {\n\t\t\t\tclearInputs();\n\t\t\t\tsetDefaultValues();\n\t\t\t}\n\t\t});\n\n\t}", "public Builder clearPredefinedValues() {\n if (predefinedValuesBuilder_ == null) {\n predefinedValues_ = null;\n onChanged();\n } else {\n predefinedValues_ = null;\n predefinedValuesBuilder_ = null;\n }\n\n return this;\n }", "@Override\n \tpublic void onSharedPreferenceChanged(SharedPreferences sharedPreferences,\n \t\t\tString key) {\n \t\ttwitter = null;\n \t}", "protected void restorePrefs ()\n {\n final String p = getConfigKey();\n\n // restore/bind window bounds\n _eprefs.bindWindowBounds(p, this);\n\n // restore/bind the location of the divider\n _eprefs.bindDividerLocation(p + \"div\", _split);\n\n // restore/bind the selected group\n String cat = _prefs.get(p + \"group\", null);\n for (int tab = _tabs.getComponentCount() - 1; tab >= 0; tab--) {\n final JComboBox gbox = ((ManagerPanel)_tabs.getComponentAt(tab)).gbox;\n if (cat != null) {\n for (int ii = 0, nn = gbox.getItemCount(); ii < nn; ii++) {\n if (cat.equals(String.valueOf(gbox.getItemAt(ii)))) {\n gbox.setSelectedIndex(ii);\n break;\n }\n }\n }\n gbox.addActionListener(new ActionListener() {\n public void actionPerformed (ActionEvent event) {\n _prefs.put(p + \"group\", String.valueOf(gbox.getSelectedItem()));\n }\n });\n }\n\n // restore color\n setBackground(((ConfigEditorPrefs)_eprefs).getBackgroundColor());\n }", "public void clearDefault() {\r\n \tfor (DisplayResolveInfo info : mList) {\r\n \t\tif (true == info.bDefault) {\r\n \t\t\tmPm.clearPackagePreferredActivities(info.ri.activityInfo.packageName);\r\n \t\t\tinfo.bDefault = false;\r\n \t\t} // End of if\r\n \t} // End of for \t\r\n }", "public void reloadFromPreference() {\n if (mEmergencyContactsPreferenceCategory != null) {\n mEmergencyContactsPreferenceCategory.reloadFromPreference();\n }\n }", "public void resetValues() {\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(CUREDIFFICULTY, null);\n editor.putInt(CURETARGETSCORE, 0);\n editor.putInt(CURRSCOREFINDCURE, 0);\n editor.apply();\n System.out.println(sharedPreferences.getAll());\n\n }", "private void reset() {\n \t\tif (currentSuggestion != null) {\n \t\t\tsetPromptingOff(currentSuggestion.getReplacementString());\n \t\t} else {\n \t\t\tif (focused) {\n \t\t\t\tsetPromptingOff(\"\");\n \t\t\t} else {\n \t\t\t\tsetPromptingOn();\n \t\t\t}\n \t\t}\n \t\thideSuggestions();\n \t\tLogger.getLogger(VSuggestFieldWidget.class.getName()).info(\"Reset\");\n \t}", "public void flushSettings() {\n prefs.putBoolean(\"noWalls\", noWalls);\n prefs.putBoolean(\"noGrid\", noGrid);\n\n prefs.flush();\n }", "@Override\n\tpublic void onDestroyView() {\n\t\tsuper.onDestroyView();\n\t\tSharedPreferences pref = getActivity().getSharedPreferences(\"myPrefs\", Context.MODE_WORLD_READABLE);\n\t\tSharedPreferences.Editor editor = pref.edit();\n\t\teditor.putString(\"custom_garden_id\", \"none\");\n\t\teditor.commit();\n\n\t}", "public void setDefaultSettings() {\n boolean shouldRecord = sharedPreferences.getBoolean(record,true);\n if (shouldRecord) {\n radioOption.check(R.id.radioRecord);\n radioOptionButton = (RadioButton)findViewById(R.id.radioRecord);\n radioOptionButton.setEnabled(true);\n } else {\n radioOption.check(R.id.radioRecognize);\n radioOptionButton = (RadioButton)findViewById(R.id.radioRecognize);\n radioOptionButton.setEnabled(true);\n }\n\n // Set timer to previous value set by user\n int minuteValue = sharedPreferences.getInt(minuteTime, 0)/60000;\n minutePicker.setValue(minuteValue);\n\n int secondValue = sharedPreferences.getInt(secondTime, 5000)/1000;\n secondPicker.setValue(secondValue);\n }", "public void reset() {\n this.displayHasContent = false;\n this.obscured = false;\n this.syswin = false;\n this.preferredRefreshRate = 0.0f;\n this.preferredModeId = 0;\n }", "private void restoreSettings() {\n getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n getWindow().getDecorView().setSystemUiVisibility(systemUiVisibilitySetting);\n\n }", "protected void updatePreferences() {\n boolean theme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.prefTheme), false);\n\n if (theme) {\n\n // Set to light mode.\n AppCompatDelegate.setDefaultNightMode(\n AppCompatDelegate.MODE_NIGHT_NO);\n } else {\n\n // Set to dark mode.\n AppCompatDelegate.setDefaultNightMode(\n AppCompatDelegate.MODE_NIGHT_YES);\n }\n }", "public void newGamePreference() {\r\n\t\tboard.dispose();\r\n\t\tgameAlive = false;\r\n\t\topponentScoreLable.setVisible(false);\r\n\t\tplayerScoreLable.setVisible(false);\r\n\t\tplayerScore.setVisible(false);\r\n\t\topponentScore.setVisible(false);\r\n\t}", "@Override\n public void removeAllValues() {\n Map<String, ?> map = preferences.getAll();\n Iterator<String> iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n removeValue(iterator.next());\n }\n }", "public static void initPrefs(){\n prefs = context.getSharedPreferences(PREFS_FILE, 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.remove(Constants.IS_FIRST_RUN);\n editor.putBoolean(Constants.ACTIVITY_SENSE_SETTING,false);\n editor.commit();\n }", "public static void clear() {\n SharedPrefWrapper sharedPref = SharedPrefWrapper.getInstance();\n sharedPref.clearWeiboPref();\n }", "protected void restoreDefaultsToComponents() {\r\n periodTimeComponent.setValue( new Long( DEFAULT_PERIOD_TIME ) );\r\n maxNumberOfPlayersComponent.setValue( new Integer( DEFAULT_MAX_NUMBER_OF_PLAYERS ) );\r\n mapWidthComponent.setSelectedItem( Integer.toString( DEFAULT_MAP_WIDTH ) );\r\n mapHeightComponent.setValue( new Integer( DEFAULT_MAP_HEIGHT ) );\r\n welcomeMessageComponent.setText( DEFAULT_WELCOME_MESSAGE );\r\n gameTypeComponent.setSelectedIndex( DEFAULT_GAME_TYPE );\r\n isKillLimitComponent.setSelected( DEFAULT_IS_KILL_LIMIT );\r\n killLimitComponent.setValue( new Integer( DEFAULT_KILL_LIMIT ) );\r\n isTimeLimitComponent.setSelected( DEFAULT_IS_TIME_LIMIT );\r\n timeLimitComponent.setValue( new Integer( DEFAULT_TIME_LIMIT ) );\r\n passwordComponent.setText( DEFAULT_PASSWORD );\r\n amountOfWallRubblesComponent.setValue( new Integer( DEFAULT_AMOUNT_OF_WALL_RUBBLES ) );\r\n amountOfBloodComponent.setValue( new Integer( DEFAULT_AMOUNT_OF_BLOOD ) );\r\n amountOfWallComponent.setValue( new Integer( DEFAULT_AMOUNT_OF_WALL ) );\r\n amountOfStoneComponent.setValue( new Integer( DEFAULT_AMOUNT_OF_STONE ) );\r\n amountOfWaterComponent.setValue( new Integer( DEFAULT_AMOUNT_OF_WATER ) );\r\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.framework_setting);\n SharedPreferences sharedPreferences = this.getPreferenceManager().getSharedPreferences();\n String preference_smartbar_default_type = getResources().getString(R.string.preference_smartbar_default_type);\n final ListPreference listPreference = (ListPreference) findPreference(preference_smartbar_default_type);\n //修改Smartbar类型\n String smart_type = sharedPreferences.getString(preference_smartbar_default_type, null);\n int index = listPreference.findIndexOfValue(String.valueOf(smart_type));\n if (index != -1) {\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n }\n if (listPreference != null) {\n listPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object newValue) {\n int index = listPreference.findIndexOfValue(newValue.toString());\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n return true;\n }\n });\n }\n }", "private void clearSharedPreference() {\n //Instantiate SharedPreferences\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n //clears all saved data in SharedPreferences with tag sm_tag\n editor.clear();\n editor.apply();\n }", "public void clear() {\n super.clear();\n locationToWidget.clear();\n widgetToCaptionWrapper.clear();\n }", "protected void actionPerformedReset ()\n {\n try\n {\n OpenMarkovPreferences.setDefaultPreferences ();\n this.jTableEdition.repaint ();\n this.jTreePreferences.repaint ();\n this.repaint ();\n }\n catch (Exception ex)\n {\n // ExceptionsHandler.handleException(\n // ex, \"Error reseting Preferences\", false );\n logger.error (\"Error reseting Preferences\");\n }\n }", "private static void clear() {\n Context context = Leanplum.getContext();\n if (context != null) {\n SharedPreferences.Editor editor = context.getSharedPreferences(\n \"__leanplum__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n\n editor = context.getSharedPreferences(\"__leanplum_push__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n }\n }", "public void dangXuat(View view) {\n SharedPreferences.Editor editor = mPreferences.edit();\n editor.clear();\n editor.apply();\n\n //Quay ve Activity Dang nhap???\n }", "public void resetToDefault() {\n if (_option != null) {\n setValue(_option.getDefault());\n notifyChangeListeners();\n }\n }", "public static void resetGuiData()\n\t{\n\t\tpriorityCombo.select(0);\n\t\telectrodeCombo.select(0);\n\t\tcustomerList.removeAll();\n\t\tcustomerText.setText(\"\");\n\t\tcommentText.setText(\"\");\n\t\tsensorText.setText(\"\");\n\t\tmeasureText.setText(\"\");\n\t\tmeasurTaskText.setText(\"\");\n\t\tsensorTaskText.setText(\"\");\n\n\t}", "void unsetValue();", "void unsetValue();", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "private void restoreSavedValues() {\n // Find previous times and put them into the layout\n populateTimes();\n fromExisting = preferences.getBoolean(\"fromExisting\", false);\n // If there is a saved comment, put it into the EditText box\n selectedTimeSetId = preferences.getInt(\"SelectedTimeSet\", -1);\n if (selectedTimeSetId != -1) {\n commentBox.setText(DBQueries.getCommentFromTimeset(selectedTimeSetId, database));\n }\n }", "public final void restoreValueDefault(){\n wChanged = false;\n //T xValueDefault = getValueDefault();\n try {\n wValue = this.getValueDefault(); //xValueDefault;\n wValueOriginal = wValue;\n setMessage(null);\n\t\t} catch (Exception xE) {\n\t\t\twLogger.error(xE);\n\t\t}\n }", "public void resetToCurrent() {\n if (_option != null) {\n setValue(DrJava.getConfig().getSetting(_option));\n }\n }", "public void onSettingChanged(ListPreference pref) {\n\t\tLog.v(\"yang\", \"+++ onSettingChanged: \" + pref.getKey() + \" +++ \");\n\t\tif (notSame(pref, CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL,\n\t\t\t\tmActivity.getString(R.string.pref_video_time_lapse_frame_interval_default))) {\n\t\t\tListPreference hfrPref = mPreferenceGroup.findPreference(CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE);\n\t\t\tif (hfrPref != null && !\"off\".equals(hfrPref.getValue())) {\n\t\t\t\tRotateTextToast.makeText(mActivity, R.string.error_app_unsupported_hfr_selection,Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\tsetPreference(CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE, \"off\");\n\t\t}\n\t\tif (notSame(pref, CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE, \"off\")) {\n\t\t\tString defaultValue = mActivity.getString(R.string.pref_video_time_lapse_frame_interval_default);\n\t\t\tListPreference lapsePref = mPreferenceGroup.findPreference(CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL);\n\t\t\tif (lapsePref != null && !defaultValue.equals(lapsePref.getValue())) {\n\t\t\t\tRotateTextToast.makeText(mActivity, R.string.error_app_unsupported_hfr_selection,Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\tsetPreference(CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL, defaultValue);\n\t\t}\n\t\tif (notSame(pref, CameraSettings.KEY_RECORD_LOCATION, \"off\")) {\n\t\t\tmActivity.requestLocationPermission();\n\t\t}\n\t\tsuper.onSettingChanged(pref);\t// call VideoModule's CameraPreference.OnPreferenceChangedListener\n\t\tLog.v(\"yang\", \"--- onSettingChanged: \" + pref.getKey() + \" --- \" );\n\t}", "public void restore() {\n this.prefs.edit().putBoolean(PREFKEY_IS_KIOSK, tempIsKiosk).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_TABLET, tempIsTablet).apply();\n this.prefs.edit().putBoolean(PREFKEY_HTTP_SSL, tempSSL).apply();\n this.prefs.edit().putBoolean(PREFKEY_RES_FETCHED, tempFetched).apply();\n this.prefs.edit().putString(PREFKEY_HTTP_PORT, tempHttpPort).apply();\n this.prefs.edit().putString(PREFKEY_HTTP_HOST, tempHttpHost).apply();\n this.prefs.edit().putString(PREFKEY_PASSWORD, temppassword).apply();\n this.prefs.edit().putString(PREFKEY_USERNAME, tempUsername).apply();\n this.prefs.edit().putString(PREFKEY_BOOTSTRAP, tempBootstrap).apply();\n this.prefs.edit().putString(PREFKEY_ROOM_SELECTED, roomSelected).apply();\n this.prefs.edit().putString(PREFKEY_TO_IGNORE, toIgnore).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_IMAGE_DOWNLOADED, isImageDownloaded).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_IMAGE_LAN, isImageLan).apply();\n }", "private void restoreSettings() {\n PublicationRecognitionStructure prs =\n PreferencesManager.getPublicationRecognitionStructure();\n luminanceThresholdSpinner.setValue(new Integer(prs.getLuminanceCutOff()));\n markThresholdSpinner.setValue(new Integer(prs.getMarkThreshold()));\n fragmentPaddingSpinner.setValue(new Integer(prs.getFragmentPadding()));\n deskewThresholdSpinner.setValue(new Double(prs.getDeskewThreshold()));\n performDeskewCheckBox.setSelected(prs.isPerformDeskew());\n\n // restore the fieldname duplicate presets\n FieldnameDuplicatePresets fdp = PreferencesManager.getFieldnameDupliatePresets();\n defaultFieldnamePrefixTextField.setText(fdp.getFieldname());\n fieldnameCounterSpinner.setValue(fdp.getCounterStart());\n horizontalDuplicatesSpinner.setValue(fdp.getHorizontalDuplicates());\n verticalDuplicatesSpinner.setValue(fdp.getVerticalDuplicates());\n horizontalSpacingSpinner.setValue(fdp.getHorizontalSpacing());\n verticalSpacingSpinner.setValue(fdp.getVerticalSpacing());\n\n if (fdp.getNamingDirection()\n == FieldnameDuplicatePresets.DIRECTION_TOP_TO_BOTTOM_LEFT_TO_RIGHT) {\n lrtbButton.setSelected(false);\n tblrButton.setSelected(true);\n }\n\n if (fdp.getNamingDirection()\n == FieldnameDuplicatePresets.DIRECTION_LEFT_TO_RIGHT_TOP_TO_BOTTOM) {\n tblrButton.setSelected(false);\n lrtbButton.setSelected(true);\n }\n\n }", "private void syncSliderInput()\n {\n pickerSlider.valueProperty().removeListener(this::onColourSliderChange);\n pickerSlider.setStyle(\"-fx-background-color: linear-gradient(to top, #000000, \" + colourToRgb(toolColour) + \", #FFFFFF);\");\n pickerSlider.setValue(0.0);\n pickerSlider.valueProperty().addListener(this::onColourSliderChange);\n }", "private void reset(){\n getPrefs().setEasyHighScore(new HighScore(\"Player\", 99 * 60 + 59));\n getPrefs().setMediumHighScore(new HighScore(\"Player\", 99 * 60 + 59));\n getPrefs().setHardHighScore(new HighScore(\"Player\", 99 * 60 + 59));\n easyData.setText(formatHighScore(getPrefs().getEasyHighScore()));\n mediumData.setText(formatHighScore(getPrefs().getMediumHighScore()));\n hardData.setText(formatHighScore(getPrefs().getHardHighScore()));\n }", "public void handlePreferences() {\n displayPrefs ();\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n\n //begin zhixiong.liu.hz for XR 6107743 2018/3/14 \n //begin zhixiong.liu.hz remove useless code defect 7169297 20181130\n //if (!getResources().getBoolean(R.bool.def_settings_custom_build_version_enable)) {\n // removePreference(KEY_CUSTOM_BUILD_VERSION);\n //} else {\n // setValueSummary(KEY_CUSTOM_BUILD_VERSION, PROPERTY_CUSTOM_BUILD_VERSION);\n //} \n //end zhixiong.liu.hz remove useless code defect 7169297 20181130\n if (!getResources().getBoolean(R.bool.def_Settings_buildnum_display_enable)) {\n removePreference(KEY_BUILD_NUMBER);\n }\n\n if (!getResources().getBoolean(R.bool.def_Settings_typecode_enable)) {\n removePreference(KEY_TYPE_CODE);\n }else{\n findPreference(KEY_TYPE_CODE).setSummary(getResources().getString(R.string.def_Settings_typecode));\n }\n //end zhixiong.liu.hz for XR 6107743 2018/3/14\n \n //Begin added by miaoliu for XR6172796 on 2018/4/8\n if(!checkPackageExist(getActivity(), \"com.tct.gdpr\")){\n removePreference(\"policy\");\n }\n //End added by miaoliu for XR6172796 on 2018/4/8\n //begin zhixiong.liu.hz for defect 6272377 2018/4/29\n if(!getResources().getBoolean(R.bool.def_settings_baseband_show)){\n removePreference(KEY_BASEBAND_VERSION);\n }\n //end zhixiong.liu.hz for defect 6272377 2018/4/29 \n\n }", "public void reset() {\n\t\t//set everything back to normal\n\t\tHashMap<String, Component> components = gui.getConversionSettingsComponents();\n\t\tfor (String key: components.keySet()) {\n\t\t\tComponent component = components.get(key);\n\t\t\tcomponent.setEnabled(true);\n\t\t}\n\t}", "public final void updateGUIFromPrefs() {\n try {\n angleStepSizeSpinner_.setValue(Double.parseDouble(prefs_.get(PrefUtils.ANGLESTEPSIZE, \"0.0\")));\n startAngleField_.setText(prefs_.get(PrefUtils.STARTANGLE, \"\"));\n doubleZeroCheckBox_.setSelected(Boolean.parseBoolean(prefs_.get(PrefUtils.DOUBLEZERO, \"\")));\n saveImagesCheckBox_.setSelected(Boolean.parseBoolean(prefs_.get(PrefUtils.ACQSAVEIMAGES, \"\")));\n acqdirRootField_.setText(prefs_.get(PrefUtils.ACQDIRROOT, \"\"));\n acqnamePrefixField_.setText(prefs_.get(PrefUtils.ACQNAMEPREFIX, \"\"));\n String channelGroup = core_.getChannelGroup();\n prefs_.put(PrefUtils.CHANNEL, channelGroup + \": \" + core_.getCurrentConfig(channelGroup));\n coeff3Field_.setText(PrefUtils.parseCal(3, prefs_, gui_));\n coeff2Field_.setText(PrefUtils.parseCal(2, prefs_, gui_));\n coeff1Field_.setText(PrefUtils.parseCal(1, prefs_, gui_));\n coeff0Field_.setText(PrefUtils.parseCal(0, prefs_, gui_));\n channelField_.setText(prefs_.get(PrefUtils.CHANNEL,\"\"));\n } catch (Exception ex) {\n Logger.getLogger(AcquisitionPanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void refreshTimeSettings()\n\t{\n\t\tIntent i = new Intent(this, MyTimeSettings.class);\n\t\ti.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\ti.putExtra(MyTimeSettingsFragment.EXTRA_REFRSH_AND_CLOSE, true);\n\t\tthis.startActivity(i);\n\t\t\n\t}", "private void setupSimplePreferencesScreen() {\n\n addPreferencesFromResource(R.xml.pref_weight);\n\n final Activity activity = getActivity();\n\n CustomPreferenceCategory fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader = new CustomPreferenceCategory(activity);\n fakeHeader.setTitle(R.string.pref_header_about);\n getPreferenceScreen().addPreference(fakeHeader);\n addPreferencesFromResource(R.xml.pref_about);\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_units_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_plate_style_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_bar_weight_key)));\n bindPreferenceSummaryToValue(findPreference(getResources().getString(R.string.pref_formula_key)));\n\n Preference aboutButton = (Preference)findPreference(getString(R.string.pref_about_button));\n aboutButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n AboutDialog aboutDialog = new AboutDialog();\n aboutDialog.show(getFragmentManager(), \"AboutDialog\");\n return true;\n }\n });\n\n Preference rateButton = (Preference)findPreference(getString(R.string.pref_rate_button));\n rateButton .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Uri uri = Uri.parse(\"market://details?id=\" + activity.getPackageName());\n Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);\n try {\n startActivity(goToMarket);\n } catch (ActivityNotFoundException e) {\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\"http://play.google.com/store/apps/details?id=\" + activity.getPackageName())));\n }\n return true;\n }\n });\n\n final RepCheckPreferenceFragment repCheckPreferenceFragment = this;\n\n Preference resetButton = (Preference)findPreference(getString(R.string.pref_reset_button));\n resetButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n DialogFragment saveAsNewDialog = ConfirmResetDialog.newInstance(new ResetResponseHandler(repCheckPreferenceFragment));\n saveAsNewDialog.show(activity.getFragmentManager(), \"RenameSetDialog\");\n return true;\n }\n });\n }", "@Override\n \tpublic void onSharedPreferenceChanged(SharedPreferences prefs, String key) {\n \t\tcheckDefaults();\n \t}", "@Override\n public void overrideSettings(final String... keyvalues) {\n super.overrideSettings(keyvalues);\n if (mListMenuContainer == null || mListMenu == null) { // frankie, \n initializePopup();\n } else {\n overridePreferenceAccessibility();\n }\n mListMenu.overrideSettings(keyvalues);\n\n\t\t// frankie, 2017.08.15, add start \n\t\tif(AGlobalConfig.config_module_VIDEO_MODULE_use_new_settings_en) {\n\t if(mChusSettingsFragment == null) {\n\t createSettingFragment(); // fm.commitAllowingStateLoss -> __lifeCycleCallback.onCreate -> overridePreferenceAccessibility_i\n\t }\n\t\t\telse {\n\t\t\t\toverridePreferenceAccessibility_i();\n\t\t\t}\n\t\t\tif(mChusSettingsFragment != null) {\n\t\t\t\tmChusSettingsFragment.overrideSettings(keyvalues);\n\t\t\t}\n\t\t}\n\t\t// frankie, 2017.08.15, add end\n\t\t\n }", "private void DefaultValues(){\n txtCategoryNo.setText(\"\");\n txtCategoryName.setText(\"\");\n }", "protected void uninstallDefaults() {\n\t\tLookAndFeel.uninstallBorder(this.controlPanel);\n\t}", "@FXML\n\tprivate void onResetBtn() {\n\t\truleBox.setValue(\"Standard\");\n\t\twallBox.setValue(10);\n\t\tboardBox.setValue(\"9x9\");\n\t\ttileBox.setValue(50);\n\t\tindicateLabel.setSelected(true);\n\t\t//ghostTrail.setSelected(false);\n\t\tSettings.getSingleton().reset();\n\t}", "private void resetUI() {\n \t\t\n \t\tString mValue = null;\n \t\t\n \t\t// reset the temperature UI component\n \t\tif(temperatureFormat.equals(\"c\")) {\n \t\t\tmValue = getString(R.string.readings_ui_lbl_temperature_default_celsius);\n \t\t} else if(temperatureFormat.equals(\"f\")) {\n \t\t\tmValue = getString(R.string.readings_ui_lbl_temperature_default_fahrenheit);\n \t\t} else {\n \t\t\tmValue = getString(R.string.readings_ui_lbl_temperature_default_kelvin);\n \t\t}\n \t\t\n temperatureValueView.setText(mValue);\n \n // reset the humidity ui component\n mValue = getString(R.string.readings_ui_lbl_humidity_default);\n humidityValueView.setText(mValue);\n \n // reset the time ui component\n readingTimeView.setText(R.string.readings_ui_lbl_reading_time_default);\n \t}", "public void clearPrefAddress() {\n\t\tsetPrefAddress( \"\" );\n\t}", "@Override\n protected void onPause() {\n getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);\n \n super.onPause();\n }", "protected void uninstallDefaults() {\n LookAndFeel.uninstallBorder(this.controlPanel);\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);\n }", "public void checkDefaults(){\n \t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(Options.this);\n \t\tboolean defaultOn = prefs.getBoolean(\"checkbox_default\", true);\n \t\t//Toast.makeText(this, \"Default: \" + defaultOn, Toast.LENGTH_SHORT).show();\n \t\tif(defaultOn){\n \t\t\t//Code Here\n \t\t\ttry{\n \t\t\t\tPreferenceCategory aCategory = (PreferenceCategory)findPreference(\"category_appearance\");\n \t\t\t\tPreferenceScreen tScreen = (PreferenceScreen)findPreference(\"pref_screen_transactions\");\n \t\t\t\tPreferenceScreen aScreen = (PreferenceScreen)findPreference(\"pref_screen_accounts\");\n \t\t\t\taCategory.setSelectable(false);\n \t\t\t\taCategory.setEnabled(false);\n \t\t\t\ttScreen.setEnabled(false);\n \t\t\t\ttScreen.setSelectable(false);\n \t\t\t\taScreen.setEnabled(false);\n \t\t\t\taScreen.setSelectable(false);\n \t\t\t}\n \t\t\tcatch(Exception e){\n \t\t\t\tToast.makeText(Options.this, \"ERROR PREFERENCES\\n\" + e.toString(), Toast.LENGTH_LONG).show();\n \t\t\t}\n \t\t}\n \t\telse{\n \t\t\t//Code Here\n \t\t\ttry{\n \t\t\t\tPreferenceCategory aCategory = (PreferenceCategory)findPreference(\"category_appearance\");\n \t\t\t\tPreferenceScreen tScreen = (PreferenceScreen)findPreference(\"pref_screen_transactions\");\n \t\t\t\tPreferenceScreen aScreen = (PreferenceScreen)findPreference(\"pref_screen_accounts\");\n \t\t\t\taCategory.setSelectable(true);\n \t\t\t\taCategory.setEnabled(true);\n \t\t\t\ttScreen.setEnabled(true);\n \t\t\t\ttScreen.setSelectable(true);\n \t\t\t\taScreen.setEnabled(true);\n \t\t\t\taScreen.setSelectable(true);\n \t\t\t}\n \t\t\tcatch(Exception e){\n \t\t\t\tToast.makeText(Options.this, \"ERROR PREFERENCES\\n\" + e.toString(), Toast.LENGTH_LONG).show();\n \t\t\t}\n \t\t}\n \n \t}", "@Override\n public void removeValue(String key) {\n SharedPreferences.Editor editor = preferences.edit();\n editor.remove(key);\n editor.apply();\n }", "private void saveCurrentPreferences() {\n\t\toldUnitType = preferences.getInt(\"displayUnit\", UnitType.FOOTINCH.getId());\n\t\toldPrecision = preferences.getInt(\"precision\", 16);\n\t\toldRounding = preferences.getBoolean(\"roundUp\", true);\n\t\toldDisplayOptions = preferences.getString(\"displayOptions\", context.getString(R.string.displayAutomatic));\n\t}", "@VisibleForTesting\n static void removePreviousSearchEngineType() {\n SharedPreferencesManager.getInstance().removeKey(\n ChromePreferenceKeys.SEARCH_ENGINE_CHOICE_DEFAULT_TYPE_BEFORE);\n }", "public void clearProperties(){\n\t\tcbDataType.setSelectedIndex(DT_INDEX_NONE);\n\t\tchkVisible.setValue(false);\n\t\tchkEnabled.setValue(false);\n\t\tchkLocked.setValue(false);\n\t\tchkRequired.setValue(false);\n\t\ttxtDefaultValue.setText(null);\n\t\ttxtHelpText.setText(null);\n\t\ttxtText.setText(null);\n\t\ttxtBinding.setText(null);\n\t\ttxtDescTemplate.setText(null);\n\t\ttxtCalculation.setText(null);\n\t\ttxtFormKey.setText(null);\n\t}", "public void applySettings(View v) {\n // start connection to firebase\n db = new FirebaseHelper(userPreferences.getString(\"username\", null));\n\n // get settingsPreferences editor\n settingsEditor = settingsPreferences.edit();\n\n String pH_min_text = pHMin.getText().toString();\n float pH_min;\n if (!pH_min_text.isEmpty()) {\n pH_min = Float.parseFloat(pH_min_text);\n db.setPref(\"pH_min\", pH_min, getCompletionListener(\"pH_min\", pH_min));\n }\n else {\n db.removePref(\"pH_min\");\n settingsEditor.remove(\"pH_min\");\n settingsEditor.apply();\n }\n String pH_max_text = pHMax.getText().toString();\n float pH_max;\n if (!pH_max_text.isEmpty()) {\n pH_max = Float.parseFloat(pH_max_text);\n db.setPref(\"pH_max\", pH_max, getCompletionListener(\"pH_max\", pH_max));\n }\n else {\n db.removePref(\"pH_max\");\n settingsEditor.remove(\"pH_max\");\n settingsEditor.apply();\n }\n\n String orp_min_text = orpMin.getText().toString();\n int orp_min;\n if (!orp_min_text.isEmpty()) {\n orp_min = Integer.parseInt(orp_min_text);\n db.setPref(\"orp_min\", orp_min, getCompletionListener(\"orp_min\", orp_min));\n }\n else {\n db.removePref(\"orp_min\");\n settingsEditor.remove(\"orp_min\");\n settingsEditor.apply();\n }\n String orp_max_text = orpMax.getText().toString();\n int orp_max;\n if (!orp_max_text.isEmpty()) {\n orp_max = Integer.parseInt(orp_max_text);\n db.setPref(\"orp_max\", orp_max, getCompletionListener(\"orp_max\", orp_max));\n }\n else {\n db.removePref(\"orp_max\");\n settingsEditor.remove(\"orp_max\");\n settingsEditor.apply();\n }\n\n String turbidity_min_text = turbidityMin.getText().toString();\n float turbidity_min;\n if (!turbidity_min_text.isEmpty()) {\n turbidity_min = Float.parseFloat(turbidity_min_text);\n db.setPref(\"turbidity_min\", turbidity_min, getCompletionListener(\"turbidity_min\", turbidity_min));\n }\n else {\n db.removePref(\"turbidity_min\");\n settingsEditor.remove(\"turbidity_min\");\n settingsEditor.apply();\n }\n String turbidity_max_text = turbidityMax.getText().toString();\n float turbidity_max;\n if (!turbidity_max_text.isEmpty()) {\n turbidity_max = Float.parseFloat(turbidity_max_text);\n db.setPref(\"turbidity_max\", turbidity_max, getCompletionListener(\"turbidity_max\", turbidity_max));\n }\n else {\n db.removePref(\"turbidity_max\");\n settingsEditor.remove(\"turbidity_max\");\n settingsEditor.apply();\n }\n\n String temperature_min_text = temperatureMin.getText().toString();\n float temperature_min;\n if (!temperature_min_text.isEmpty()) {\n temperature_min = Float.parseFloat(temperature_min_text);\n db.setPref(\"temperature_min\", temperature_min, getCompletionListener(\"temperature_min\", temperature_min));\n }\n else {\n db.removePref(\"temperature_min\");\n settingsEditor.remove(\"temperature_min\");\n settingsEditor.apply();\n }\n String temperature_max_text = temperatureMax.getText().toString();\n float temperature_max;\n if (!temperature_max_text.isEmpty()) {\n temperature_max = Float.parseFloat(temperature_max_text);\n db.setPref(\"temperature_max\", temperature_max, getCompletionListener(\"temperature_max\", temperature_max));\n }\n else {\n db.removePref(\"temperature_max\");\n settingsEditor.remove(\"temperature_max\");\n settingsEditor.apply();\n }\n finish();\n }", "public void onLogout(){\n\t\tString userid = prefs.getString(ctx.getString(R.string.prefs_username),\"\" );\n\t\t\n\t\tif (! userid.equals(\"\"))\n\t\t{\n\t\t\tString firstname = \"\";\n\t\t\tString lastname =\"\" ;\n\t\t\t\n\t\t\tif (! prefs.getString(ctx.getString(R.string.prefs_display_name),\"\").isEmpty()) {\n\t\t\t\tString displayname = prefs.getString(ctx.getString(R.string.prefs_display_name),\"\");\n\t\t\t\tString[] name = displayname.split(\" \");\n\t\t\t\tif (name.length > 0) {\n\t\t\t\t\tfirstname = name[0];\n\t\t\t\t\tlastname = name[1];\n\t\t\t\t} else {\n\t\t\t\t\tfirstname = displayname;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint points = prefs.getInt(ctx.getString(R.string.prefs_points),0);\n\t\t\tint badges = prefs.getInt(ctx.getString(R.string.prefs_badges),0);\t\t\t\n\t\t\tboolean scoring = prefs.getBoolean(ctx.getString(R.string.prefs_scoring_enabled),true);\n\n\t\t\tupdateUser(userid, prefs.getString(ctx.getString(R.string.prefs_api_key),\"\"), firstname, lastname, points, badges, scoring);\n\t\t}\n\t\t\n\t\t\n\t\t// Reset preferences\n\t\tEditor editor = prefs.edit();\n \teditor.putString(ctx.getString(R.string.prefs_username), \"\");\n \teditor.putString(ctx.getString(R.string.prefs_api_key), \"\");\n \teditor.putString(ctx.getString(R.string.prefs_display_name),\"\");\n \teditor.putInt(ctx.getString(R.string.prefs_points), 0);\n \teditor.putInt(ctx.getString(R.string.prefs_badges), 0);\n \teditor.putBoolean(ctx.getString(R.string.prefs_scoring_enabled), false);\n \teditor.commit();\n\t}", "public void setUserPreferences (int outdoorPref, int nightlifePref, int hotelPref, int shoppingPref, int restaurantPref) {\n\t\tpreferences.clear(); \n\t\tpreferences.add(outdoorPref); \n\t\tpreferences.add(nightlifePref); \n\t\tpreferences.add(hotelPref); \n\t\tpreferences.add(shoppingPref); \n\t\tpreferences.add(restaurantPref); \n\t}", "private void resetApp() {\n\t\tthis.panelTags.setVisible(false);\n\t\tthis.panelMenu.setVisible(true);\n\t\tthis.model.clear();\n\t\tthis.btnClearAll.doClick(0);\n\t\t// textDestination jest czyszczony osobno, po JOptionPane\n\t\t// this.textDestination.setText(null);\n\t\tthis.btnDeleteAll.setEnabled(false);\n\t\tthis.btnDelete.setEnabled(false);\n\t}", "@Override\n\tpublic synchronized void onSharedPreferenceChanged(SharedPreferences prefs,\n\t\t\tString key) {\n\t\tthis.twitter = null;\n\t\tLog.d(TAG, \"Twitter object invalidated\");\n\t}", "@Override\n public void onDeleted(Context context, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n DesktopWidgetConfigureActivity.deleteTitlePref(context, appWidgetId);\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(null);\n setContentView(R.layout.activity_setting);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n //set up pref listener\n if (fragment == null) {\n fragment = new SettingFragment();\n getFragmentManager()\n .beginTransaction()\n .replace(android.R.id.content, fragment)\n .commit();\n getFragmentManager().executePendingTransactions();\n }\n sharedP = PreferenceManager\n .getDefaultSharedPreferences(SettingActivity.this);\n final boolean pref_use_map = sharedP.getBoolean(\"pref_use_map\", false);\n final int pref_upload = Integer.parseInt(sharedP.getString(\"pref_upload_mode\", \"0\"));\n final boolean pref_in_team = sharedP.getBoolean(\"pref_in_team\", false);\n hideIfNotInTeam(pref_in_team);\n hideIfUsingMap(pref_use_map);\n hideIfManual(pref_upload);\n if (sharedPreferenceChangeListener == null) {\n sharedPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {\n @Override\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n switch (key.toLowerCase()) {\n case \"pref_in_team\":\n hideIfNotInTeam(sharedPreferences.getBoolean(key, false));\n break;\n case \"pref_use_map\":\n hideIfUsingMap(sharedPreferences.getBoolean(key, false));\n break;\n case \"pref_battery\":\n final String pref_battery = sharedPreferences.getString(key, \"\");\n ServiceController.allowBattery = Integer.parseInt(pref_battery);\n if ((ServiceController.allowBattery != 0)\n && ((ServiceController.resourceManager == null)\n || (!ServiceController.resourceManager.isAlive()))) {\n Log.e(\"SETT\", \"restart resource manger bat=\" + ServiceController.allowBattery);\n ServiceController.resourceManager = new ResourceManager(SettingActivity.this);\n ServiceController.resourceManager.start();\n }\n break;\n case \"pref_kill_ap_no_gps\":\n final String pref_kill_ap_no_gps = sharedPreferences.getString(key, \"\");\n ServiceController.allowNoLocation = Integer.parseInt(pref_kill_ap_no_gps);\n if ((ServiceController.allowNoLocation != 0)\n && ((ServiceController.resourceManager == null)\n || (!ServiceController.resourceManager.isAlive()))) {\n Log.e(\"SETT\", \"restart resource manger=\" + ServiceController.allowNoLocation);\n ServiceController.resourceManager = new ResourceManager(SettingActivity.this);\n ServiceController.resourceManager.start();\n }\n break;\n case \"pref_upload_mode\":\n final int pref_upload = Integer.parseInt(sharedPreferences.getString(key, \"\"));\n hideIfManual(pref_upload);\n break;\n case \"pref_upload_entry\":\n ServiceController.numberOfApToUpload =\n Integer.parseInt(\n sharedPreferences.getString(key, \"5000\"));\n break;\n case \"pref_show_counter\":\n ServiceController.showCounterWrapper\n .setShouldShow(sharedPreferences.getBoolean(key, false));\n break;\n case \"pref_team\":\n ServiceController.teamId = sharedPreferences.getString(key, \"\");\n if (!Utils.checkBssid(ServiceController.teamId)) {\n showAlert(getString(R.string.wrong_id_format));\n }\n break;\n case \"pref_team_tag\":\n ServiceController.tag = sharedPreferences.getString(key, \"\");\n break;\n case \"pref_public_data\":\n if (sharedPreferences.getBoolean(key, true)) {\n ServiceController.mode |= 1;\n } else {\n ServiceController.mode &= 2;\n }\n break;\n case \"pref_publish_map\":\n if (sharedPreferences.getBoolean(key, false)) {\n ServiceController.mode |= 2;\n } else {\n ServiceController.mode &= 1;\n }\n break;\n default:\n break;\n }\n }\n };\n }\n }", "private void updateButtonWithPreferences() {\n\t\tRadioButton c1 = (RadioButton)findViewById(R.id.ch_01Setting);\n\t\tRadioButton c2 = (RadioButton)findViewById(R.id.ch_02Setting);\n\t\tRadioButton c3 = (RadioButton)findViewById(R.id.ch_03Setting);\n\t\tRadioButton c4 = (RadioButton)findViewById(R.id.ch_04Setting);\n\t\tRadioButton c5 = (RadioButton)findViewById(R.id.ch_05Setting);\n\t\tRadioButton c6 = (RadioButton)findViewById(R.id.ch_06Setting);\n\t\tRadioButton c061 = (RadioButton)findViewById(R.id.ch_061Setting);\n\t\tRadioButton c7 = (RadioButton)findViewById(R.id.ch_07Setting);\n\t\tRadioButton c8 = (RadioButton)findViewById(R.id.ch_08Setting);\n\t\tRadioButton c9 = (RadioButton)findViewById(R.id.ch_09Setting);\n\t\tRadioButton c10 = (RadioButton)findViewById(R.id.ch_10Setting);\n\t\tRadioButton c11 = (RadioButton)findViewById(R.id.ch_11Setting);\n\t\tRadioButton c111 = (RadioButton)findViewById(R.id.ch_111Setting);\n\t\tRadioButton c12 = (RadioButton)findViewById(R.id.ch_12Setting);\n\t\tRadioButton c13 = (RadioButton)findViewById(R.id.ch_13Setting);\n\t\tRadioButton c131 = (RadioButton)findViewById(R.id.ch_131Setting);\n\t\tRadioButton c14 = (RadioButton)findViewById(R.id.ch_14Setting);\n\t\tRadioButton c15 = (RadioButton)findViewById(R.id.ch_15Setting);\n\t\tRadioButton c16 = (RadioButton)findViewById(R.id.ch_16Setting);\n\t\tRadioButton c17 = (RadioButton)findViewById(R.id.ch_17Setting);\n\t\tRadioButton c18 = (RadioButton)findViewById(R.id.ch_18Setting);\n\t\tRadioButton c19 = (RadioButton)findViewById(R.id.ch_19Setting);\n\t\tRadioButton c20 = (RadioButton)findViewById(R.id.ch_20Setting);\n\t\tRadioButton c21 = (RadioButton)findViewById(R.id.ch_21Setting);\n\t\tRadioButton c22 = (RadioButton)findViewById(R.id.ch_22Setting);\n\t\tRadioButton c23 = (RadioButton)findViewById(R.id.ch_23Setting);\n\t\tRadioButton c24 = (RadioButton)findViewById(R.id.ch_24Setting);\n\t\tRadioButton c25 = (RadioButton)findViewById(R.id.ch_25Setting);\n\t\tRadioButton c26 = (RadioButton)findViewById(R.id.ch_26Setting);\n\t\tRadioButton c27 = (RadioButton)findViewById(R.id.ch_27Setting);\n\t\tRadioButton c28 = (RadioButton)findViewById(R.id.ch_28Setting);\n\t\tRadioButton c29 = (RadioButton)findViewById(R.id.ch_29Setting);\n\t\tRadioButton c291 = (RadioButton)findViewById(R.id.ch_291Setting);\n\t\tRadioButton c30 = (RadioButton)findViewById(R.id.ch_30Setting);\n\t\tRadioButton c31 = (RadioButton)findViewById(R.id.ch_31Setting);\n\t\tRadioButton c32 = (RadioButton)findViewById(R.id.ch_32Setting);\n\t\tRadioButton c321 = (RadioButton)findViewById(R.id.ch_321Setting);\n\t\tRadioButton c322 = (RadioButton)findViewById(R.id.ch_322Setting);\n\t\t\n\t\tSharedPreferences settings = getSharedPreferences(Constants.SETTINGS, 0);\n\t\tint diff = settings.getInt(Constants.CHAPTER, Constants.CH_01);\n\t\t\n\t\tswitch (diff)\n\t\t{\n\t\tcase Constants.CH_01 : \n\t\t\tc1.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_02 : \n\t\t\tc2.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_03 :\n\t\t\tc3.toggle();\n\t\t\tbreak;\t\n\t\t\t\n\t\tcase Constants.CH_04 : \n\t\t\tc4.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_05 : \n\t\t\tc5.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_06 :\n\t\t\tc6.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_061 :\n\t\t\tc061.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_07 : \n\t\t\tc7.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_08 : \n\t\t\tc8.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_09 :\n\t\t\tc9.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_10 : \n\t\t\tc10.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_11 : \n\t\t\tc11.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_111 : \n\t\t\tc111.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_12 :\n\t\t\tc12.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_13 : \n\t\t\tc13.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_131 : \n\t\t\tc131.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_14 : \n\t\t\tc14.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_15 :\n\t\t\tc15.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_16 : \n\t\t\tc16.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_17 : \n\t\t\tc17.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_18 :\n\t\t\tc18.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_19 : \n\t\t\tc19.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_20 : \n\t\t\tc20.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_21 :\n\t\t\tc21.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_22 : \n\t\t\tc22.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_23 : \n\t\t\tc23.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_24 :\n\t\t\tc24.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_25 : \n\t\t\tc25.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_26 : \n\t\t\tc26.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_27 :\n\t\t\tc27.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_28 : \n\t\t\tc28.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_29 : \n\t\t\tc29.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_291 : \n\t\t\tc291.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_30 :\n\t\t\tc30.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_31 : \n\t\t\tc31.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_32 : \n\t\t\tc32.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_321 : \n\t\t\tc321.toggle();\n\t\t\tbreak;\n\t\t\t\n\t\tcase Constants.CH_322 : \n\t\t\tc322.toggle();\n\t\t\tbreak;\n\t\t}\n\t}", "protected void initPreference(){\n DataUtils.savePreference(Const.REPORT, \"\");\n DataUtils.savePreference(Const.TRY_MATCH_PERSON,\"\");\n }", "public SwitchYardSettingsPropertyPage() {\n super();\n noDefaultAndApplyButton();\n }", "private void resetIfInvalid(ListPreference pref) {\n String value = pref.getValue();\n if (pref.findIndexOfValue(value) == NOT_FOUND) {\n \tif(pref.getKey().equalsIgnoreCase(KEY_VIDEO_QUALITY)) {\n \t\treturn;\n \t}\n pref.setValueIndex(0);\n }\n }", "void bindPreferenceSummaryToValue(Preference preference);", "@Parameterized.AfterParam\n public static void restoreAfter() {\n getApplicationContext().getResources().getDisplayMetrics().setTo(OLD_DISPLAY_METRICS);\n }", "private void resetIfInvalid(ListPreference pref) {\n String value = pref.getValue();\n if (pref.findIndexOfValue(value) == NOT_FOUND) {\n pref.setValueIndex(0);\n }\n }", "@Override\n\tprotected void okPressed() {\n\t\tfor (int i = 0; i < LAST_USED_PREF_IDS.length; i++) {\n\t\t\tlatencyPrefs.setValue(LAST_USED_PREF_IDS[i], localValues.get(LAST_USED_PREF_IDS[i]));\n\t\t}\n\t\t// Save the show dialog pref\n\t\tlatencyPrefs.setValue(Constants.DONT_SHOW_DIALOG, dontShowDialog);\n\t\tsavePreferences();\n\n\t\tsuper.okPressed();\n\t}", "public void discardAndGoBack() {\n try {\n currentEditor.setValue(null);\n if (currentEditor instanceof RestrictedEntityEditor) {\n ((RestrictedEntityEditor) currentEditor).refreshListOfValues();\n }\n } catch (Exception ex) {\n throw new RuntimeException(\"Exception while discarding value of an editor. \", ex);\n }\n goBack();\n }", "private void setupSimplePreferencesScreen() {\n if (!isSimplePreferences(this)) {\n return;\n }\n\n addPreferencesFromResource(R.xml.pref_empty);\n\n addHeader(R.string.pref_header_game);\n addPreferencesFromResource(R.xml.pref_game);\n this.gameModeSettingsPreferenceScreen = getPreferenceScreen();\n\n addHeader(R.string.pref_header_other);\n addPreferencesFromResource(R.xml.pref_other);\n\n Preference key_game_mode_summary = findPreference(getResources().getString(R.string.key_game_mode_summary));\n this.key_game_mode_summary = key_game_mode_summary;\n\n Preference useCodePreference = findPreference(getResources().getString(R.string.key_use_code));\n this.useCodePreference = useCodePreference;\n useCodePreference.setOnPreferenceChangeListener(USE_CODE_PREFERENCE_LISTENER);\n\n Preference customWidthPreference = findPreference(getResources().getString(R.string.key_custom_maze_width));\n customWidthPreference.setSummary(String.valueOf(getCustomMazeWidth()));\n this.customWidthPreference = customWidthPreference;\n customWidthPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int width = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeWidth = width;\n }\n preference.setSummary(String.valueOf(width));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customHeightPreference = findPreference(getResources().getString(R.string.key_custom_maze_height));\n customHeightPreference.setSummary(String.valueOf(getCustomMazeHeight()));\n this.customHeightPreference = customHeightPreference;\n customHeightPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int height = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeHeight = height;\n }\n preference.setSummary(String.valueOf(height));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customCreatePreference = findPreference(getResources().getString(R.string.key_custom_maze_create));\n this.customCreatePreference = customCreatePreference;\n customCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Maze2D.GeneratedMaze maze = generateCustomMaze(SettingsActivity.this);\n synchronized (SettingsActivity.class) {\n SettingsActivity.loadSeedMaze = maze;\n }\n if (maze != null) {\n SettingsActivity.this.finish();\n }\n return true;\n }\n });\n Preference customSolvePreference = findPreference(getResources().getString(R.string.key_custom_maze_solve));\n this.customSolvePreference = customSolvePreference;\n customSolvePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.showSolution = true;\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n Preference regularCreatePreference = findPreference(getResources().getString(R.string.key_maze_create));\n this.regularCreatePreference = regularCreatePreference;\n regularCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n if (MainActivity.getGameMode() == GameMode.REGULAR) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newRegularMaze = true;\n }\n } else {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newFillMaze = true;\n }\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n\n ListPreference algorithmPreference = (ListPreference) findPreference(getResources().getString(R.string.key_algorithm));\n this.algorithmPreference = algorithmPreference;\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n ListPreference gameModePreference = (ListPreference) findPreference(getResources().getString(R.string.key_game_mode));\n this.gamePreference = gameModePreference;\n bindPreferenceSummaryToValue(gameModePreference);\n String[] names = GameMode.getNames(this);\n gameModePreference.setEntries(names);\n gameModePreference.setEntryValues(names);\n GameMode gameMode = MainActivity.getGameMode();\n if (gameMode != null) {\n gameModePreference.setValueIndex(gameMode.getID());\n }\n\n bindPreferenceSummaryToValue(algorithmPreference);\n names = MazeAlgorithm.getNames(this, true);\n algorithmPreference.setEntries(names);\n algorithmPreference.setEntryValues(names);\n MazeAlgorithm algorithm = MainActivity.getAlgorithm();\n if (algorithm != null) {\n algorithmPreference.setDefaultValue(algorithm.getLocalName(this));\n }\n\n SwitchPreference showTracerPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_show_tracer));\n showTracerPreference.setOnPreferenceChangeListener(TOGGLE_TRACER_PREFERENCE_LISTENER);\n showTracerPreference.setDefaultValue(MainActivity.toggleTracer());\n\n SwitchPreference squareCellsPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_square_cells));\n squareCellsPreference.setOnPreferenceChangeListener(SQUARE_CELLS_PREFERENCE_LISTENER);\n squareCellsPreference.setDefaultValue(MainActivity.squareCells());\n\n Preference recalibratePreference = findPreference(getResources().getString(R.string.key_recalibrate));\n recalibratePreference.setOnPreferenceClickListener(RECALIBRATE_PREFERENCE_LISTENER);\n\n Preference defaultTiltPreference = findPreference(getResources().getString(R.string.key_default_tilt));\n defaultTiltPreference.setOnPreferenceClickListener(DEFAULT_TILT_PREFERENCE_LISTENER);\n\n prepareGameModeGUI(MainActivity.getGameMode());\n }", "protected void ClearData() {\n\t\t// TODO Auto-generated method stub\n\t\n\t\t sharedPreferences = this.getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);\n\t\t Editor editor = sharedPreferences.edit();\n\t\t if(sharedPreferences.contains(\"username\")||sharedPreferences.contains(\"password\")){\n\t\t\t editor.remove(\"username\");\n\t\t\t editor.remove(\"password\");\n\t\t }\n\t\t editor.clear();\n\t\t editor.commit();\n\t}" ]
[ "0.706374", "0.6891277", "0.6643766", "0.63816303", "0.629412", "0.623661", "0.61903584", "0.6185817", "0.6158773", "0.61549586", "0.61315435", "0.608523", "0.6050408", "0.5978879", "0.59709686", "0.5968308", "0.5965902", "0.59428453", "0.5919107", "0.5890938", "0.5877152", "0.5876522", "0.5851369", "0.5829375", "0.58226925", "0.5803957", "0.57949317", "0.57940364", "0.57702476", "0.57572615", "0.57551605", "0.572654", "0.57189673", "0.5713016", "0.57070446", "0.57012135", "0.5689977", "0.5664341", "0.56619036", "0.56315666", "0.56177825", "0.56114876", "0.56096685", "0.56088716", "0.56064034", "0.56060344", "0.56004673", "0.55927587", "0.5590031", "0.5586479", "0.5586479", "0.5578912", "0.5578912", "0.55747753", "0.5571114", "0.55688375", "0.5561444", "0.55329365", "0.55296296", "0.5513617", "0.55123985", "0.5508503", "0.55049866", "0.550328", "0.5498574", "0.54974824", "0.5484974", "0.5482813", "0.5476706", "0.5470881", "0.5468968", "0.54668784", "0.54646367", "0.54618424", "0.54564255", "0.54540485", "0.54506576", "0.5449413", "0.5448744", "0.5447738", "0.54416496", "0.54286313", "0.54190195", "0.54140365", "0.5405515", "0.5404983", "0.5401272", "0.53992796", "0.5396647", "0.5389548", "0.5379408", "0.53731173", "0.53713804", "0.53594154", "0.5357354", "0.535099", "0.5346215", "0.53431123", "0.5341756", "0.53345317" ]
0.7329449
0
TODO Autogenerated method stub
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String x = scanner.nextLine(); scanner.close(); System.out.println(countUpperCharacters(x)); }
{ "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
GETTER The event you wish to recieve a notification about. Specify for all events.
@JsonGetter("event") public String getEvent ( ) { return this.event; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Event getEvent();", "EventType getEvent();", "@Override\n public Object getEvent() {\n return eventObj;\n }", "public EventOccurrence getReceiveEvent();", "public String getPushEvent();", "public Object getEvent() {\r\n return event;\r\n }", "public String getEvent() {\n return this.event;\n }", "java.lang.String getEventType();", "public String getEventName();", "public EventEntry getEventEntry();", "com.walgreens.rxit.ch.cda.EIVLEvent getEvent();", "public Event getEvent(){\n\t\t\treturn event;\n\t\t}", "String getEventType();", "public String getEventId();", "public Event getEvent() {\n\t\treturn event;\n\t}", "public EventOccurrence getSendEvent();", "static private Notification getNotificationForEvent(GGEventModel event) {\n Context ctx = SplashActivity.getAppContext();\n\n // Create an explicit intent for an Activity in your app\n Intent intent = new Intent(ctx, EventsActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n PendingIntent pendingIntent = PendingIntent.getActivity(ctx, 0, intent, 0);\n\n // Builder builder = new Builder(ctx, channel_id)\n Builder builder;\n builder = new Builder(ctx, ctx.getResources().getString(R.string.channel_id) )\n .setSmallIcon(R.drawable.laguilde_logo)\n .setContentTitle(event.getTitle())\n .setContentText(event.getDescription())\n .setPriority(PRIORITY_DEFAULT)\n .setGroup(\"LaGuilde\")\n // Set the intent that will fire when the user taps the notification\n .setContentIntent(pendingIntent)\n .setAutoCancel(true)\n //.setTimeoutAfter(5000)\n // .setUsesChronometer(true)\n .setShowWhen(true)\n //.setWhen( System.currentTimeMillis() - 1000*60*60 )\n .setWhen( event.getDate().getTime() )\n .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))\n ;\n\n // todo: ajouter une image\n\n return builder.build();\n }", "String getEventId();", "void notificationReceived(Notification notification);", "public Response fire(EventI event);", "@ApiModelProperty(example = \"transaction.paid\", required = true, value = \"The event that triggered this webhook\")\n public String getEvent() {\n return event;\n }", "Event getE();", "@Override\n\tpublic void ActOnNotification(String message) {\n\t \tSystem.out.println(\"Sending Event\");\n\t}", "public void receiveEvent(Event event)\n {\n if((event.getOperationType() & Notification.RETRIEVAL_OPERATION) == 0)\n {\n try\n {\n RecentChange change = new RecentChange();\n change.setProjectId(event.getProjectId());\n change.setChangeMessage(getChangeMessageFromEvent(event));\n \n addRecentChange(change);\n }\n catch(Exception e)\n {\n \tDebugUtils.GI().logException(e);\n }\n }\n }", "com.google.speech.logs.timeline.InputEvent.Event getEvent();", "public String getEventNote() {\r\n\t\treturn eventNote;\r\n\t}", "@Override\n\tpublic String getNotification() {\n\t\treturn null;\n\t}", "public String getEventMessage() {\n return eventMessage;\n }", "public AdminCommandEventBroker getEventBroker();", "public Object getEventSubject() {\n return eventSubject;\n }", "public void doAction1(int eventId) {\n Log.d(LOG_TAG, \"doAction1 event id: \" + eventId);\n Cursor cursor = null;\n try {\n String name = \"\";\n String message = \"\";\n cursor = getContentResolver().query(Notification.Event.URI, null,\n Notification.EventColumns._ID + \" = \" + eventId, null, null);\n if (cursor != null && cursor.moveToFirst()) {\n int nameIndex = cursor.getColumnIndex(Notification.EventColumns.DISPLAY_NAME);\n int messageIndex = cursor.getColumnIndex(Notification.EventColumns.MESSAGE);\n name = cursor.getString(nameIndex);\n message = cursor.getString(messageIndex);\n }\n\n String toastMessage = getText(R.string.action_event_1) + \", Event: \" + eventId\n + \", Name: \" + name + \", Message: \" + message;\n Toast.makeText(this, toastMessage, Toast.LENGTH_LONG).show();\n } catch (SQLException e) {\n Log.e(LOG_TAG, \"Failed to query event\", e);\n } catch (SecurityException e) {\n Log.e(LOG_TAG, \"Failed to query event\", e);\n } catch (IllegalArgumentException e) {\n Log.e(LOG_TAG, \"Failed to query event\", e);\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n }\n }", "public void notify(Event event) throws RemoteException {\r\n System.out.println(\"Event Notification Received\");\r\n System.out.println(\"These are the Details: \");\r\n System.out.println(event);\r\n receivedEvents.add(event);\r\n }", "public Event getEvent() {\n\n return null;\n }", "@Override\n\tpublic java.lang.String getEvent() {\n\t\treturn _dlSyncEvent.getEvent();\n\t}", "public String getEventID(){\n return eventID;\n }", "INotificationTraveller getSender();", "private static String getNotificationMessage(UserEvent event) {\n return \"Activity \" + event.getCategory().getTitle() + \" in progress\";\n }", "public LiveData<Event> getEvent() {\n return event;\n }", "public String getNotification() {\n return notification;\n }", "public SoEvent getEvent() {\n\t\treturn (eventAction != null ? eventAction.getEvent() : null); \n\t}", "public Constants.LongPollEvent getEvent() {\n if (this == DROP_MESSAGE) return Constants.LongPollEvent.FILTERED_CHAT;\n else return null;\n }", "public interface EventReceiver {\n\n void onNotify(Event event);\n\n }", "public int getEventTypeID() {\r\n\treturn eventType;\r\n}", "@Override\n public String getEventType()\n {\n\t return null;\n }", "public List<Invoke> getNotification() {\n return getInvoke();\n }", "public abstract NAEventType getEventType();", "@Override\r\n\tpublic String toString() {\r\n\t\treturn this.event;\r\n\t}", "public String getEventInfo()\n {\n return \"Event ID: \" + this.hashCode() + \" | Recorded User\\n\" + String.format(\"\\tName %s \\n\\tDate of Birth %s \\n\\tEmail %s \\n\\tContact Number %s \\n\\tAge %d \\nDate %s \\nTime %s \\nParty Size %d \\nEstablishment \\n\\tName: %s \\n\\tAddress: %s\",\n user.getName(), user.getDateOfBirthAsString(), user.getEmail(), user.getPhoneNumber(), \n user.getAge(), getEventDateAsString(), getEventTimeAsString(), partyNumber, establishment.getName(), establishment.getAddress());\n }", "public interface Notice extends Event\n\t{\n\t\tpublic static final String TOPIC_ID = \"aether.notice.topic.id\";\n\t}", "public String getExampleEvent() {\n return exampleEvent;\n }", "public String getEventInfo() {\n\t\treturn String.format(\"%s, which now has %s participant(s)\",\n\t\t\tthis.title, this.participants);\n\t}", "public void setReceiveEvent(EventOccurrence receiveEvent);", "public void getEventDetails() {\r\n\t\t// Query DB to get specific event information based on EventID.\r\n\t}", "@Override\n public void onEvent(EMNotifierEvent event) {\n\n }", "public String getEventType()\r\n {\r\n return eventType;\r\n }", "String getNotificationID();", "public java.lang.String getEventId() {\n return eventId;\n }", "public Collection getReceivedNotifications();", "public NotificationEventTypeCodeType getEventType() {\n\t return this.eventType;\n\t}", "public final String getEventType() {\n return this.id;\n }", "public String getEventType()\n {\n return eventType;\n }", "void onNewEvent(Event event);", "static private CustomListener eventCustListener() {\n return new CustomListener() {\n\t @Override\n\t public void customEventReceived(CustomEvent e) {\n\t\tSystem.out.println(e.getMessage());\n\t }\n }\n}", "@Override\n public void onEvent(EMNotifierEvent event) {\n message = (EMMessage) event.getData();\n messageBean.setGetMsgCode(MessageContant.receiveMsgByListChanged);\n messageBean.setEmMessage(message);\n\n eventBus.post(messageBean);\n }", "public int getEventID()\n {\n return eventID;\n }", "@ApiMethod(name = \"getEvent\", path = \"event\")\n public Event getEvent(@Named(\"eventID\") long id) {\n logger.info(\"getting single event\");\n Event foundEvent = null;\n try {\n Entity eventDatastoreObject = datastoreService.get(KeyFactory.createKey(\"Event\", id));\n foundEvent = new Event((String) eventDatastoreObject.getProperty(\"name\"), (String) eventDatastoreObject.getProperty(\"details\"));\n } catch (EntityNotFoundException e) {\n e.printStackTrace();\n }\n\n return foundEvent;\n }", "@Override\n public void notify(Object event){\n }", "com.google.ads.googleads.v6.resources.ChangeEvent getChangeEvent();", "public interface Event\n\t{\n\t\tpublic static final String EVENT_ID = \"aether.event.id\";\n\t\tpublic static final String TIME = \"aether.event.time\";\n\t\tpublic static final String EVENT_TYPE = \"aether.event.type\";\n\t}", "@Override\n public void onCustomEvent(CustomEvent customEvent) {\n }", "public int getEventID() {\r\n return eventID;\r\n }", "public java.lang.String getEventId() {\n return eventId;\n }", "@NonNull\n public EventModel getEvent() {\n return mEvent;\n }", "public abstract MBeanNotificationInfo[] getNotificationInfo();", "public String getEventType() {\r\n return eventType;\r\n }", "public IEventLog getEventLog();", "public Reminder getReminderForEvent(Event event) \r\n\t{\r\n\t\treturn dataService.getReminderForEvent(event);\r\n\t}", "@Override\r\n\tpublic Long getEventId() {\n\t\treturn null;\r\n\t}", "private void createNotification(FoodEvents event) {\n Context context = getBaseContext();\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher).setContentTitle(event.getTitle())\n .setContentText(event.getDescription());\n Intent resultIntent = new Intent(this, EventDetails.class);\n resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n resultIntent.putExtra(EventDetails.EXTRA_EVENT, event);\n PendingIntent resultPendingIntent = PendingIntent.getActivity(getBaseContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT, null);\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n notifyMyWatch(event);\n }", "public interface INotificationListener extends INotifyObject{\r\n\t\r\n\tvoid OnNotificationEvent(int notification, INotifyObject notificationData);\r\n}", "public Long getEventID()\n/* */ {\n/* 111 */ return this.eventID;\n/* */ }", "@Subscribe\n public void onEvent(Object event) {\n }", "@Subscribe\n public void onEvent(Object event) {\n }", "public String toAPICallbackEvent() {\n if (sdkNotificationEvent == null) {\n return apiCallbackEvent;\n }\n return sdkNotificationEvent.getApiValue();\n }", "@Override\n public void notificationReceived(OSNotification notification) {\n Log.e(\"oneSignal\",\"new Notification\");\n\n }", "void onBusEvent(Event event);", "T getPushNotification();", "public String getEventType() {\n return eventType;\n }", "public SoHandleEventAction getAction() { return eventAction; }", "com.google.protobuf.ByteString getEventTypeBytes();", "public void setEventName(String name);", "@Override\r\n\tpublic int getEventType() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic int getEventType() {\n\t\treturn 0;\r\n\t}", "public String getEventTypeDescription()\n {\n return eventTypeDescription;\n }", "public String Get_event_value() \n {\n\n return event_value;\n }", "public void readNotification()\n {\n userFan.readNotification();\n }", "public abstract void onEvent(T event);", "public String getEventDescription() {\n\t\treturn description;\n\t}", "public EventType getEventType() {\n return this.eventType;\n }", "public String getEventTitle() {\n\t\treturn title;\n\t}" ]
[ "0.7106981", "0.7070848", "0.69118035", "0.6814373", "0.6796271", "0.6760236", "0.6722537", "0.6718795", "0.66193837", "0.65279645", "0.64735425", "0.64609903", "0.63798857", "0.63681215", "0.63619167", "0.6349328", "0.63003886", "0.62974083", "0.62688243", "0.626018", "0.6252612", "0.623561", "0.6186889", "0.61714363", "0.61681503", "0.6157401", "0.6123542", "0.61131585", "0.61111987", "0.6098842", "0.60949993", "0.60855174", "0.60741156", "0.6064636", "0.60510063", "0.6043232", "0.6026782", "0.60249496", "0.5967978", "0.5959437", "0.5945578", "0.5934376", "0.58949524", "0.58848786", "0.5869348", "0.5864186", "0.5828755", "0.5820545", "0.5804469", "0.5800922", "0.57871276", "0.5780567", "0.5779686", "0.57781124", "0.57662004", "0.5743152", "0.574174", "0.5737754", "0.57270813", "0.5707431", "0.5702504", "0.56840336", "0.5669204", "0.5662466", "0.56539565", "0.56382835", "0.5636534", "0.56333375", "0.5626303", "0.56224966", "0.5619663", "0.56155354", "0.5610829", "0.5608754", "0.55917424", "0.5582958", "0.55738175", "0.55584186", "0.55480456", "0.5535407", "0.5529817", "0.55269784", "0.55269784", "0.5518871", "0.5504589", "0.55017", "0.5498336", "0.54948616", "0.54883426", "0.5485094", "0.5480474", "0.54794145", "0.54794145", "0.5470315", "0.5468954", "0.5463162", "0.5459185", "0.5451564", "0.5448782", "0.54458994" ]
0.6486106
10
SETTER The event you wish to recieve a notification about. Specify for all events.
@JsonSetter("event") public void setEvent (String value) { this.event = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSendEvent(EventOccurrence sendEvent);", "public void setEventName(String name);", "public void setReceiveEvent(EventOccurrence receiveEvent);", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "void setEvent(com.walgreens.rxit.ch.cda.EIVLEvent event);", "@Override\n public void onEvent(EMNotifierEvent event) {\n\n }", "public void setEvent(String event) {\n this.event = event;\n }", "@Override\n\tpublic void ActOnNotification(String message) {\n\t \tSystem.out.println(\"Sending Event\");\n\t}", "public void setEvent(String event) {\r\n\t\tthis.event = event;\r\n\t}", "@Override\n\tpublic void setEvent(Event event) {\n\t\tthis.currentEvent = event;\n\t}", "public interface EventReceiver {\n\n void onNotify(Event event);\n\n }", "@Override\n public void notify(Object event){\n }", "public void setNotification(String notif) {\n frame.setNotification(notif);\n }", "public void notificar(String event) {\n\t\toutPoint.notificar(event);\n\t}", "void onNewEvent(Event event);", "private void setEventType(String eventType)\n\t{\n\t\tsomethingChanged = true;\n\t\tthis.eventType = eventType;\n\t}", "@Override\n public void onCustomEvent(CustomEvent customEvent) {\n }", "@Override\n public void onEvent(EMNotifierEvent event) {\n message = (EMMessage) event.getData();\n messageBean.setGetMsgCode(MessageContant.receiveMsgByListChanged);\n messageBean.setEmMessage(message);\n\n eventBus.post(messageBean);\n }", "void notify(IUISemanticEvent event);", "void setReminder(int eventId, String eventEndDate, String eventType);", "public void consulterEvent() {\n\t\t\n\t}", "@Override\r\n\tpublic void onEvent(Object e) {\n\t}", "public Response fire(EventI event);", "boolean notify(int event, Point point, Object value);", "public void setEventType(NotificationEventTypeCodeType eventType) {\n\t this.eventType = eventType;\n\t}", "public abstract void setEventType(Context context, NAEventType type);", "@Override\n\tpublic void setEvent(java.lang.String event) {\n\t\t_dlSyncEvent.setEvent(event);\n\t}", "protected void onTopic(String channel, String topic, String setBy, long date, boolean changed) {}", "public void SetEventNotification(Pointer eventHandler, int eventMask) throws FTD2XXException {\n ensureFTStatus(ftd2xx.FT_SetEventNotification(ftHandle, eventMask, eventHandler));\n }", "@Override\r\n\tpublic void sendGeneralNotification() {\n\t\t\r\n\t}", "public interface Notice extends Event\n\t{\n\t\tpublic static final String TOPIC_ID = \"aether.notice.topic.id\";\n\t}", "protected void setPendingNotification (String eventId,String eventName,String userId, Long eventDate){\n AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);\n Intent notificationIntent = new Intent(\"android.media.action.DISPLAY_NOTIFICATION\");\n notificationIntent.putExtra(\"EVENT_NAME\", eventName);\n notificationIntent.putExtra(\"EVENT_ID\",eventId);\n notificationIntent.putExtra(\"INTENT_ID\",alarmId(eventName,userId,eventDate));\n notificationIntent.addCategory(\"android.intent.category.DEFAULT\");\n\n PendingIntent broadcast = PendingIntent.getBroadcast(this,alarmId(eventName,userId,eventDate) ,\n notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n alarmManager.set(AlarmManager.RTC_WAKEUP, oneHourDifference(eventDate), broadcast);\n }", "private void setEventThread() {\n setEventThread(Thread.currentThread());\n }", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "public void setNotification(String notification) {\n this.notification = notification;\n }", "public String getEventName();", "private void sendNotification() {\n }", "void notificationReceived(Notification notification);", "public void notify(Event event) throws RemoteException {\r\n System.out.println(\"Event Notification Received\");\r\n System.out.println(\"These are the Details: \");\r\n System.out.println(event);\r\n receivedEvents.add(event);\r\n }", "public void setHANotificationBroadcasterName( String newBroadcasterName );", "@Override\n\tpublic void setListener() {\n\n\t}", "public void sendEvent(Event event);", "@Override\r\n\tpublic void onEvent(Event arg0) {\n\r\n\t}", "public void ingresar_a_la_Opcion_de_eventos() {\n\t\t\n\t}", "protected void notify(Employee e) {\n\t}", "@Override\r\n\tpublic void setListener() {\n\r\n\t}", "@Override\r\n\tpublic void setListener() {\n\r\n\t}", "public AdminCommandEventBroker getEventBroker();", "@Override\n public void notificationReceived(OSNotification notification) {\n Log.e(\"oneSignal\",\"new Notification\");\n\n }", "void onBusEvent(Event event);", "public interface Event {\n String getName();\n void setName(String name);\n}", "@Override\n\tprotected void setListener() {\n\n\t}", "@Override\n\tprotected void setListener() {\n\n\t}", "protected void firePaperJamEvent()\n {\n // construct parameters and signatures\n Object[] parameter = new Object[ 1 ];\n parameter[ 0 ] = new Notification( \n \"PrinterEvent.PAPER_JAM\", this, 0L );\n String[] signature = new String[ 1 ];\n signature[ 0 ] = \"javax.management.Notification\";\n \n // invoke notification\n try {\n mBeanServer.invoke( eventBroadcasterName,\n \"sendNotification\", parameter, signature ); \n } \n\n // handle exception when invoking method\n catch( ReflectionException exception ) {\n exception.printStackTrace();\n }\n\n // handle exception communicating with MBean\n catch( MBeanException exception ) {\n exception.printStackTrace();\n } \n\n // handle exception if MBean not found\n catch( InstanceNotFoundException exception ) {\n exception.printStackTrace();\n } \n\n }", "public void setEventID(Long eventID)\n/* */ {\n/* 123 */ this.eventID = eventID;\n/* */ }", "protected void onSetOnTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}", "public abstract void onEvent(T event);", "protected void fireLowTonerEvent()\n {\n // construct parameters and signatures\n Object[] parameter = new Object[ 1 ];\n parameter[ 0 ] = new Notification( \n \"PrinterEvent.LOW_TONER\", this, 0L );\n String[] signature = new String[ 1 ];\n signature[ 0 ] = \"javax.management.Notification\";\n \n // invoke notification\n try {\n mBeanServer.invoke( eventBroadcasterName,\n \"sendNotification\", parameter, signature ); \n } \n\n // handle exception when invoking method\n catch ( ReflectionException exception ) {\n exception.printStackTrace();\n }\n\n // handle exception communicating with MBean\n catch ( MBeanException exception ) {\n exception.printStackTrace();\n }\n\n // handle exception if MBean not found\n catch ( InstanceNotFoundException exception ) {\n exception.printStackTrace();\n } \n \n }", "public void setEventMessage(String eventMessage) {\n this.eventMessage = eventMessage;\n }", "@Subscribe\n public void onEvent(Object event) {\n }", "@Subscribe\n public void onEvent(Object event) {\n }", "public void setEventFun(String eventFun) {\n\t\tthis.eventFun = eventFun;\n\t}", "void event(MetricalEvent event) throws MetricalException;", "@Override\r\n\tpublic void implementEvent() {\r\n\r\n\t\t//currently the only option because FAMILY_CONTACTS won't become ContactEvents.\r\n\t\t//FAMILY_CONTACTS will stay inside AgentEvents.\r\n\t\tif (info.contactType == ContactType.RANDOM_CONTACT) {\r\n\t\t\tplace.locals().contact(personToContact, info);\r\n\t\t} else {\r\n\t\t\tthrow new RuntimeException(\"currently OffNodeContactEvents should be RANDOM_CONTACTS\");\r\n\t\t}\r\n\t}", "void eventChanged();", "@Override\n\tpublic void setNotification(String title, String text, int minutes, int type) {\n\t \t Calendar cal = Calendar.getInstance();\n\t \t // add 5 minutes to the calendar object\n\t \t cal.add(Calendar.MINUTE, minutes);\n\t \t Intent intent = new Intent(this, AlarmReceiver.class);\n\t \t intent.putExtra(\"title\", title);\n\t \t intent.putExtra(\"text\", text);\n\t \t intent.putExtra(\"type\", type);\n\t \t // In reality, you would want to have a static variable for the request code instead of 192837\n\t \t PendingIntent sender = PendingIntent.getBroadcast(this, 192213, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t \t \n\t \t // Get the AlarmManager service\n\t \t AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t \t am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);\n\t}", "@Override\n\tpublic void setOnChangeEvent(String functionName) {\n\t\t\n\t}", "@Override\n public Object getEvent() {\n return eventObj;\n }", "void onHisNotify();", "void notify(HorseFeverEvent e);", "public void setEvent(String population) {\n\t\t// Should really ensure this value is not negative.\n\t\tthis.population = population;\n\t}", "@Override\n\tpublic void set(T e) {\n\t\t\n\t}", "@Override\n\t\tpublic void set(E arg0) {\n\t\t\t\n\t\t}", "@Override\r\n\t\tpublic void set(E arg0) {\n\r\n\t\t}", "public static void setListener(QuadConsumer listener) {\n\t\t\n\t\tnotificationListener = listener;\n\t\t\n\t}", "public void setEventID(String eventID){\n this.eventID = eventID;\n }", "public interface ChoosableEvent extends Event{\n\n void chooseAnswer(String answer, String username);\n}", "java.lang.String getEventType();", "public interface IntfOnChange\n{\n /**\n The method is called when the broker sends a change notification event.\n\n @param subscribers the number of clients subscribed to the topic.\n @param tid the topic name requested or the ephemeral topic ID\n requested to be observed.\n */\n public void smqOnChange(final long subscribers, final long tid);\n}", "void setPassedHabitEvent(HabitEvent passedHabitEvent);", "@Override\n public void call(Object... args) {\n Message msg = mHanler.obtainMessage();\n msg.what = 2;\n msg.obj = args[0];\n msg.sendToTarget();\n LogTool.e(TAG + \" notification call\");\n }", "void onIssueEditedEvent(T event);", "private static void setNotification(Context context, String message) {\n NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n Notification notification = new Notification(R.drawable.icon, message, System.currentTimeMillis());\n\n Intent currentEvent = new Intent(context, CurrentEvent.class);\n PendingIntent target = PendingIntent.getActivity(context, 0, currentEvent, 0);\n String title = context.getString(R.string.reminder_title);\n notification.setLatestEventInfo(context, title, message, target);\n\n // We never want more than one notification, so always use the same ID\n nm.notify(NOTIFICATION_ID, notification);\n }", "public interface OnBriefSettingListener {\r\n\r\n void OnSetBrief(String brief);\r\n\r\n}", "public abstract void setEvents(Map<String, Event> events);", "private void setEventDescription(String eventDescription)\n\t{\n\t\tsomethingChanged = true;\n\t\tthis.eventDescription = eventDescription;\n\t}", "public interface ISemanticEventListener {\n\n\t/**\n\t * Notifies this listener that a semantic event has happened.\n\t * @param event - the semantic event\n\t */\n\tvoid notify(IUISemanticEvent event);\n \n\t////////////////////////////////////////////////////////////////////////////\n\t//\n\t// Meta events\n\t//\n\t////////////////////////////////////////////////////////////////////////////\n\n\t//TODO: maybe these meta-notifications should not have there own methods?\n\t\n /**\n * Notifies this listener that event recording has started.\n */\n void notifyStart();\n \n /**\n * Notifies this listener that event recording has stopped.\n */\n void notifyStop();\n\n /**\n * Notifies this listener that the event stream is to be written.\n */\n void notifyWrite();\n \n /**\n * Notifies this listener that root display has been disposed (effectively, recording is terminated).\n */ \n void notifyDispose();\n\n\t/**\n\t * Notifies this listener that the event stream is to be flushed and restarted.\n\t */\n\tvoid notifyRestart();\n\n\t/**\n\t * Notifies this listener that the event stream is to be paused.\n\t */\n\tvoid notifyPause();\n\t\n\t/**\n\t * Notifies this listener that an error occured during recording.\n\t * @param event - the error event\n\t */\n\tvoid notifyError(RecorderErrorEvent event);\n\n\t/**\n\t * Notifies this listener that a trace event was sent during recording.\n\t * @param event - the trace event\n\t */\n\tvoid notifyTrace(RecorderTraceEvent event);\n\n\t/**\n\t * Notifies this listener that a hook added vent was sent during recording.\n\t * @param hookName \n\t */\n\tvoid notifyAssertionHookAdded(String hookName);\n\t\n\t/**\n\t * Notifies that Recorder Controller was started and listens on specific port \n\t * @param port the port number that this controller started listen on\n\t */\n\tpublic void notifyControllerStart(int port);\n\t\n\t/**\n\t * Notifies this listener that Display instance was not found in the application process\n\t */\n\tpublic void notifyDisplayNotFound();\n\n\t/**\n\t * Notifies the listener that spy mode has been toggled.\n\t */\n\tvoid notifySpyModeToggle();\n}", "public void notify (JsimEvent evt)\n {\n trc.show (\"notify\", \"Event type: \" + evt.getEventType ());\n \n\tObject handback = evt.getRegistrationObject ();\n if (evt.getID () == EventMap.INQUIRE_EVT) {\n } else if (evt.getID () == EventMap.INFORM_EVT) {\n \n /**************************************************************\n * Handle InformEvent from model\n */\n\n ModelProperties prop;\n if (use_xml) {\n\t try {\n Vector data = XMLSerializer.deserializeFromString ((String) handback);\n prop = (ModelProperties) (data.get (0));\n } catch (Exception e) {\n trc.tell (\"notify (InformEvent)\", e.getMessage ());\n e.printStackTrace ();\n return;\n }\n\t } else {\n\t prop = (ModelProperties) handback;\n\t }; // if\n\n if (prop != null) {\n\t\t propCache = prop;\n\t\t new PropertyDialog (this, prop);\n } else {\n\t\t trc.show (\"notify\", \"model prop is null\");\n\t }; // if\n\n } else if (evt.getID () == EventMap.CHANGE_EVT) {\n } else if (evt.getID () == EventMap.CHANGED_EVT) {\n\t fireSimulateEvent ();\n } else if (evt.getID () == EventMap.SIMULATE_EVT) {\n } else if (evt.getID () == EventMap.REPORT_EVT) {\n\t Message msg = null;\n\t if (use_xml) {\n try {\n Vector v = XMLSerializer.deserializeFromString ((String) handback);\n msg = (Message) v.get (0);\n } catch (Exception e) {\n trc.tell (\"notify\", e.getMessage ());\n e.printStackTrace ();\n }\n } else {\n msg = (Message) handback;\n\t }; // if\n\t handleReport (msg);\n } else if (evt.getID () == EventMap.INJECT_EVT) {\n } else if (evt.getID () == EventMap.QUERY_EVT) {\n } else if (evt.getID () == EventMap.STORE_EVT) {\n } else if (evt.getID () == EventMap.RESULT_EVT) {\n } else if (evt.getID () == EventMap.INSTRUCT_EVT) {\n\n /******************************************************************\n * Handle instruct events from a model\n */\n\t Instruct instruct;\n\t if (use_xml) {\n try {\n Vector data = XMLSerializer.deserializeFromString ((String) handback);\n instruct = (Instruct) data.get (0);\n } catch (Exception e) { \n trc.tell (\"notify\", e.getMessage ());\n e.printStackTrace ();\n return;\n }\n\t } else {\n\t instruct = (Instruct) handback;\n\t }; // if\n\n\t scenarioID = instruct.getScenarioID ();\n started = false;\n quit = false;\n fireInquireEvent ();\n\n } else {\n trc.tell (\"notify\", \"Unknown event type!\");\n }; // if\n\n }", "@EventName(\"targetInfoChanged\")\n EventListener onTargetInfoChanged(EventHandler<TargetInfoChanged> eventListener);", "@Override\n public void onTangoEvent(TangoEvent event) {\n }", "public void setEventID(int value) {\r\n this.eventID = value;\r\n }", "@Override\n\tpublic void eventFired(TChannel channel, TEvent event, Object[] args) {\n\t\t\n\t}", "public void setOnReceiveCalled() {\n this.f49 = true;\n }", "EventType getEvent();", "@Test\n public void testDispatchEvent(){\n\n final SampleClass sample = new SampleClass();\n\n assertEquals(\"\", sample.getName());\n\n eventDispatcher.addSimulatorEventListener(new SimulatorEventListener(){\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n sample.setName(\"Modified\");\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n \n }\n });\n\n eventDispatcher.dispatchEvent(SimulatorEventType.NEW_MESSAGE, null, null);\n\n assertEquals(\"Modified\",sample.getName());\n }", "@Override\n\t\t\tpublic void changed(ChangeEvent event, Actor actor) {\n\t\t\t}", "@Override\n\t\t\tpublic void changed(ChangeEvent event, Actor actor) {\n\t\t\t}", "@Override\n\t\t\tpublic void changed(ChangeEvent event, Actor actor) {\n\t\t\t}", "@Override\n\t\t\tpublic void changed(ChangeEvent event, Actor actor) {\n\t\t\t}", "public void notificar(String event,String s) {\n\t\toutPoint.notificar(event,s);\n\t}" ]
[ "0.6457704", "0.64399624", "0.64094687", "0.63668233", "0.61326617", "0.61174715", "0.61026216", "0.60678905", "0.60675645", "0.5864232", "0.5859176", "0.5843475", "0.5791313", "0.57781535", "0.573482", "0.5721", "0.56935006", "0.56845915", "0.56783324", "0.56534654", "0.5627829", "0.56016344", "0.55826634", "0.55826557", "0.55793613", "0.5572972", "0.55660355", "0.55627584", "0.5561105", "0.55507165", "0.5526798", "0.5522037", "0.55043733", "0.5493176", "0.5492629", "0.54711014", "0.5470192", "0.5469806", "0.5463299", "0.54550964", "0.54542476", "0.54540974", "0.5449148", "0.54479223", "0.5392734", "0.53793114", "0.53793114", "0.53773457", "0.5368693", "0.5366622", "0.5364921", "0.53599596", "0.53599596", "0.53593147", "0.5355792", "0.532739", "0.5306218", "0.53031886", "0.5297996", "0.52887964", "0.52887964", "0.5273814", "0.5267584", "0.5267052", "0.5262591", "0.5258541", "0.52574813", "0.5257225", "0.52570117", "0.52564025", "0.5252247", "0.5244206", "0.5230699", "0.52274024", "0.52264845", "0.52263135", "0.5224512", "0.5218657", "0.52152383", "0.52087325", "0.5208469", "0.5208205", "0.52065563", "0.52046186", "0.52044564", "0.52039677", "0.5203838", "0.52017784", "0.51999193", "0.519725", "0.5191208", "0.51908153", "0.5190751", "0.51874685", "0.51730293", "0.5164685", "0.5164685", "0.5164685", "0.5164685", "0.51547265" ]
0.56997997
16
GETTER Whether this event should remain active after it triggers the first time.
@JsonGetter("persistent") public boolean getPersistent ( ) { return this.persistent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getTrigger(){\n \treturn !trigger.get();\n }", "@Override\n\tpublic Boolean isActve() {\n\t\treturn active;\n\t}", "boolean isAlreadyTriggered();", "@Override\n\tpublic boolean isEventStarted() {\n\t\treturn status>=EventStarted;\n\t}", "public boolean isActived() {\r\n\t\treturn isActived;\r\n\t}", "public boolean getActivate() {\r\n return Activate;\r\n }", "public boolean isActiv(){\r\n\t\treturn this.activ;\r\n\t}", "public boolean isActivated()\n {\n return this.currentState;\n }", "public boolean isActivated()\n {\n return this.activated;\n }", "@Override\r\n\tpublic boolean getState() {\n\t\treturn activated;\r\n\t}", "public boolean activate(){\n mIsActive = true;\n return mIsActive;\n }", "public boolean isEventCondition() {\n return true;\n }", "boolean isSetEvent();", "public static boolean isActive() {\n\t\treturn activated;\n\t}", "public boolean isActivated() {\n\t\t\treturn isActivated;\n\t\t}", "public boolean activated() {\n\t\treturn activated;\n\t}", "public boolean isFirstClick(){\n\t\treturn firsttime;\n\t}", "@Override\n public boolean isActive() {\n return isActive;\n }", "public boolean isActive() { return true; }", "public boolean isActive() {\n return !isSuspended() && !isExpired();\n }", "public static boolean inactivateStartGuide(){\n long inactivationTime = 1494536399000L;\r\n long currentTime = System.currentTimeMillis();\r\n boolean inactive = currentTime > inactivationTime;\r\n Log.i(StartPrefsHelper.class.getName(), \"Start Guide inactive: \" + inactive + \", inactivationTime: \" + new Date(inactivationTime) + \", currentTime: \" + new Date(currentTime));\r\n return inactive;\r\n }", "public boolean isInstantConfirmation() {\n return instantConfirmation;\n }", "public boolean getActive()\n {\n return this.active;\n }", "@Override\n public boolean isActive() {\n return active;\n }", "public abstract boolean isTrigger();", "public static boolean getTrigger() {\n\t\treturn true;\r\n\t}", "protected boolean _isFirstTime() {\n return _firstTime;\n }", "private boolean triggered() {\n\t\treturn true;\n\t}", "@Override\r\n public boolean isActive() {\r\n return m_active;\r\n }", "public boolean checkActive() {\n\t\treturn active;\n\t}", "public boolean isNeedsAlert() {\n return current.needsAlert();\n }", "public boolean wasJustPressed() {\n\t\treturn (mNow && (!mLast));\n\t}", "public boolean active(){\r\n\t\treturn active;\r\n\t}", "public final boolean isActive() {\n return isActive;\n }", "public boolean ready() {\n diff = eventTime - System.currentTimeMillis(); //Step 4,5\n return System.currentTimeMillis() >= eventTime;\n }", "public boolean isActive()\r\n {\r\n return isActive;\r\n }", "public final boolean isActive() {\n synchronized (this.lifecycleMonitor) {\n return this.active;\n }\n }", "@Override\n public boolean isActive() {\n return true;\n }", "public boolean isActive() {\n return this.active;\n }", "public boolean hasActive() {\n return active_ != null;\n }", "public boolean isActive() {\n\t\treturn this.state;\n\t}", "public boolean isActive() {\r\n return active;\r\n }", "public Boolean getActive() {\n\t\treturn this.Active;\n\t}", "public boolean isActive() {\n return this.active;\n }", "public boolean isActive() {\n return this.active;\n }", "public boolean getActive();", "public boolean getActive();", "public boolean isActive(){\r\n\t\treturn active_;\r\n\t}", "public boolean isActive() {\r\n return active;\r\n }", "public boolean isActive() {\r\n return active;\r\n }", "public Boolean getActive() {\n return this.active;\n }", "public Boolean getActive() {\n return this.active;\n }", "public boolean isFirstClick() {\n return firstClick;\n }", "private boolean isActive() {\n return isActive;\n }", "public boolean isActive() {\n return isActive;\n }", "public boolean isActive() {\n return isActive;\n }", "public boolean isActive() {\n return isActive;\n }", "@Override\n public boolean active() {\n return false;\n }", "public boolean isActive()\r\n\t{\r\n\t\treturn active;\r\n\t}", "boolean hasCurrentStateTime();", "public boolean isStopOnceCollected() {\n return stopOnceCollected;\n }", "public boolean isActive() {\r\n\t\treturn active;\r\n\t}", "public boolean isActive() {\n return (m_state != INACTIVE_STATE);\n }", "public static boolean isActive(){\n return active;\n }", "public boolean isNextClockChangeCalled();", "public boolean isActive() \n {\n return this.active;\n }", "boolean isActive() {\n assert this.isHeldByCurrentThread();\n return isActive;\n }", "public boolean isActive() {\n return active;\n }", "public boolean isActive() {\n return active;\n }", "public boolean isActive() {\n return active;\n }", "public boolean isActive() {\n return active;\n }", "public boolean isActive() {\n return active;\n }", "public boolean isActive() {\n return active;\n }", "public boolean isActive() \n {\n return mIsActive;\n }", "public boolean isAutoActive()\n {\n return autoCommand != null && autoCommand.isActive();\n }", "public java.lang.Boolean getActive() {\n return active;\n }", "private boolean isFirstTime() {\n SharedPreferences preferences = getActivity().getPreferences(MODE_PRIVATE);\n boolean ranBefore = preferences.getBoolean(\"RanBefore\", false);\n if (!ranBefore) {\n\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(\"RanBefore\", true);\n editor.apply();\n mBind.topLayout.setVisibility(View.VISIBLE);\n mBind.topLayout.setOnTouchListener(new View.OnTouchListener() {\n\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n mBind.topLayout.setVisibility(View.INVISIBLE);\n return false;\n }\n\n });\n }\n return ranBefore;\n\n }", "public boolean isActive()\n {\n return active;\n }", "public boolean isActive() {\n\t\treturn active;\n\t}", "public boolean isIsActive() {\r\n return isActive;\r\n }", "public boolean isCorrectEvent()\n {\n return m_fCorrectEvent;\n }", "@java.lang.Override\n public boolean getIsActive() {\n return isActive_;\n }", "public boolean isActive(){\n\t\treturn active;\n\t}", "public final boolean isAutoConsume()\n {\n return myAutoConsumeProperty.get();\n }", "public boolean isSetEvents() {\n return this.events != null;\n }", "@java.lang.Override\n public boolean getIsActive() {\n return isActive_;\n }", "public boolean takeControl() {\n\t\tif (!sharedState.isFindingObject()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// returns true if the shared state return in 1\r\n\t\treturn sharedState.getCurrentBehaviour()==1; \r\n\t}", "public boolean isActive(){\n\t\treturn false;\n\t}", "public boolean isActive() {\n\t\treturn activeProperty().getValue();\n\t}", "boolean hasEvent();", "public Boolean isActive() {\n return this.active;\n }", "@Override\n public boolean isActivated() {\n return !STenant.DEACTIVATED.equals(getStatus());\n }", "public boolean isActive(){\n return active;\n }", "public boolean isActive(){\n return active;\n }", "public boolean isSelfMessageProcessingEvent();", "public boolean active() //ignores them. yeahhhhhh\r\n\t{\r\n\t\treturn super.getPhase();\r\n\t}", "public boolean getIsActive() {\n return isActive_;\n }", "@SuppressWarnings(\"unused\")\n public boolean isFirstTime() {\n return firstTime;\n }", "public boolean isIsActive() {\n return isActive;\n }", "public boolean isInstantTicket() {\n return instantTicket;\n }", "@Override\n\tprotected boolean on_trigger_activated(String trigger_name) {\n\t\treturn false;\n\t}" ]
[ "0.6756115", "0.67527956", "0.673329", "0.66840094", "0.6675349", "0.66363806", "0.65955144", "0.6561266", "0.6493696", "0.6432079", "0.64227504", "0.64225054", "0.6418083", "0.64063054", "0.63827884", "0.6373321", "0.63685095", "0.63028646", "0.6293588", "0.6263852", "0.62592894", "0.62587285", "0.6244157", "0.62297857", "0.62247473", "0.620983", "0.62029225", "0.61997783", "0.6184891", "0.61841565", "0.61836994", "0.61763555", "0.6171442", "0.6149815", "0.61463773", "0.6142456", "0.61335534", "0.61316234", "0.6129755", "0.61275727", "0.61254406", "0.6122291", "0.6117904", "0.61174536", "0.61174536", "0.61130106", "0.61130106", "0.61120224", "0.61113", "0.61113", "0.61108685", "0.61108685", "0.609081", "0.60891175", "0.60856616", "0.60856616", "0.60856616", "0.60823387", "0.6080017", "0.6076278", "0.6065951", "0.6065927", "0.60650706", "0.6062905", "0.6060583", "0.6052241", "0.6042765", "0.604262", "0.604262", "0.604262", "0.604262", "0.604262", "0.604262", "0.6025352", "0.60226655", "0.60211474", "0.60157645", "0.6011383", "0.6005267", "0.59902805", "0.59786165", "0.5973778", "0.59729856", "0.5969239", "0.5969037", "0.5968922", "0.596387", "0.59590966", "0.59493107", "0.594841", "0.5933484", "0.59215015", "0.59125066", "0.59125066", "0.59062225", "0.5901087", "0.58986765", "0.589455", "0.5893763", "0.5888801", "0.5882341" ]
0.0
-1
SETTER Whether this event should remain active after it triggers the first time.
@JsonSetter("persistent") public void setPersistent (boolean value) { this.persistent = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void activate(){\r\n\t\tactive=true;\r\n\t}", "@objid (\"b47d48ab-22b9-48c5-87ec-5f1f114e042d\")\n void setIsEvent(boolean value);", "public void activate(){\n active = true;\n state = State.cleaving;\n }", "@Override\n\tpublic Boolean isActve() {\n\t\treturn active;\n\t}", "public void setActive() {\n setState(true);\n }", "public boolean activate(){\n mIsActive = true;\n return mIsActive;\n }", "public void activate() {\n if (!isResumed) {\n isToBeActivated = true;\n return;\n }\n\n if (isLocked) {\n return;\n }\n\n if (!isActive) {\n isActive = true;\n onActivate();\n }\n\n if (isFirstUse) {\n isFirstUse = false;\n settings.edit()\n .putBoolean(\"isFirstUse\", false)\n .commit();\n onFirstUse();\n }\n }", "@Override\r\n\tpublic boolean activate() {\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean activate() {\n\t\treturn true;\r\n\t}", "public synchronized void set() {\n this.currentState = EventState.UP;\n notify();\n }", "public void setActive() {\n\t\tactive = true;\n\t}", "boolean isAlreadyTriggered();", "public boolean getActivate() {\r\n return Activate;\r\n }", "public void setOn(){\n state = true;\n //System.out.println(\"Se detecto un requerimiento!\");\n\n }", "@Override\r\n\tpublic boolean getState() {\n\t\treturn activated;\r\n\t}", "@Override\n\tpublic boolean activate() {\n\t\treturn true;\n\t}", "public boolean isActiv(){\r\n\t\treturn this.activ;\r\n\t}", "public void setOnReceiveCalled() {\n this.f49 = true;\n }", "public void ensureActive() {\n\t\tif (!activeProperty().getValue()) {\n\t\t\tactiveProperty().setValue(true);\n\t\t}\n\t}", "@Override\n public void initialize() {\n //manualActivated = !manualActivated;\n }", "public void activate() {\n\t\tactivated = true;\n\t}", "boolean isSetEvent();", "public boolean getTrigger(){\n \treturn !trigger.get();\n }", "private boolean triggered() {\n\t\treturn true;\n\t}", "public void enable(){\r\n\t\tthis.activ = true;\r\n\t}", "public void setActive( boolean tof ) {\n\t\tthis.active = tof;\n\t}", "public void activate() {\n\t\tif (value == null) {\n\t\t\tvalue = Boolean.TRUE;\n\t\t} else if (value == Boolean.TRUE) {\n\t\t\tvalue = Boolean.FALSE;\n\t\t} else if (value == Boolean.FALSE) {\n\t\t\tvalue = null;\n\t\t}\n\t\tfireApplyEditorValue();\n\t}", "@Override\n\tprotected boolean on_trigger_activated(String trigger_name) {\n\t\treturn false;\n\t}", "public boolean isActived() {\r\n\t\treturn isActived;\r\n\t}", "public boolean activated() {\n\t\treturn activated;\n\t}", "public void activate() {\n\tif (canBeActive()) {\n\t\tmActive = true;\n\t} else {\n\t\tthrow new IllegalStateException(getClass().getSimpleName() + \" isn't allowed to be activated\");\n\t}\n}", "public void setAnnounced(Boolean newValue);", "@Override\n public boolean active() {\n return false;\n }", "public boolean isFirstClick(){\n\t\treturn firsttime;\n\t}", "@Override\n public boolean isActive() {\n return isActive;\n }", "@Override\n public boolean isActive() {\n return true;\n }", "public void activate() {\n\t\tif (resetCounter == 0 && isReloaded()) {\n\t\t\tactivated = true;\n\t\t}\n\t}", "@Override\n public boolean isActive() {\n return active;\n }", "public void noteOn()\n\t{\n\t\ttimeFromOn = 0f;\n\t\tisTurnedOn = true;\n\t\t\n\t\t// ddf: reset these so that the envelope can be retriggered\n\t\ttimeFromOff = -1.f;\n\t\tisTurnedOff = false;\n\t}", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "public void setActived(boolean isActived) {\r\n\t\tif( this.isActived == isActived )\r\n\t\t\tmodified = false;\r\n\t\telse {\r\n\t\t\tmodified = true;\r\n\t\t\tthis.isActived = isActived;\r\n\t\t}\r\n\t}", "@Override\r\n public boolean isActive() {\r\n return m_active;\r\n }", "@Override\n\tpublic boolean isEventStarted() {\n\t\treturn status>=EventStarted;\n\t}", "@Override\r\n\tpublic boolean reActivateIt() {\n\t\treturn false;\r\n\t}", "public void onActive() {\n super.onActive();\n this.f5335l.registerOnSharedPreferenceChangeListener(this);\n }", "private boolean isFirstTime() {\n SharedPreferences preferences = getActivity().getPreferences(MODE_PRIVATE);\n boolean ranBefore = preferences.getBoolean(\"RanBefore\", false);\n if (!ranBefore) {\n\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(\"RanBefore\", true);\n editor.apply();\n mBind.topLayout.setVisibility(View.VISIBLE);\n mBind.topLayout.setOnTouchListener(new View.OnTouchListener() {\n\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n mBind.topLayout.setVisibility(View.INVISIBLE);\n return false;\n }\n\n });\n }\n return ranBefore;\n\n }", "public void triggerEvent() {\n\t\ts.changeOpenState();\n\t\ts.setChangedAndNotify();\n\t\t\n\t}", "protected void activeActivity() {\n\t\tLog.i(STARTUP, \"active activity\");\n\t\tcheckActiveActivity();\n\t}", "synchronized void setOneshot( boolean value )\n {\n _cyclicTimer = ! value;\n }", "public abstract boolean isTrigger();", "public final void mo90119b() {\n RxBus.m86979a().mo84367a(new SettingEvent(false));\n }", "public final native void setSingleEvents(boolean singleEvents) /*-{\n this.setSingleEvents(singleEvents);\n }-*/;", "public void setStateToActive() {\n state = VALID_STATES[0];\n }", "@Override\n public void setActive(boolean active) {\n if (book != null) {\n book.getCurrencies().removeCurrencyListener(currencyTableCallback); // At most one listener\n book.removeAccountListener(allAccountsCallback);\n if (active) {\n book.getCurrencies().addCurrencyListener(currencyTableCallback);\n book.addAccountListener(allAccountsCallback);\n }\n }\n }", "public boolean isEventCondition() {\n return true;\n }", "public void activate() {\n\t\t// set cooldown counter\n\t}", "public boolean activate();", "public static boolean isActive() {\n\t\treturn activated;\n\t}", "public void active(boolean value) {\n\t\tactive = value;\n\t}", "public void setStart(){\n\t\tthis.isStart=true;\n\t}", "private final void m95902d() {\n RxBus.m86979a().mo84367a(new SettingEvent(true));\n m95903e();\n }", "public void setFirstLaunchCalled() {\n this.f51 = true;\n }", "protected synchronized void setActive(final boolean b) {\n active = b;\n }", "public boolean isActive() { return true; }", "public void assignAddingEvent(final boolean val) {\n addingEvent = val;\n }", "public void setActive(boolean aIsActive) {\n mIsActive = aIsActive;\n\n if (!mIsActive) {\n stop();\n }\n }", "public boolean isActivated()\n {\n return this.currentState;\n }", "public boolean isActivated()\n {\n return this.activated;\n }", "public abstract boolean setActive(boolean active);", "public void setActive(boolean active)\r\n\t{\r\n\t\tif (this.active != active)\r\n\t\t{\r\n\t\t\tthis.active = active;\r\n\t\t\tapply();\r\n\t\t}\r\n\t}", "public void setActive(boolean active);", "public void setActive(boolean active);", "public void setActive(boolean active);", "public boolean active(){\r\n\t\treturn active;\r\n\t}", "public boolean isActivated() {\n\t\t\treturn isActivated;\n\t\t}", "protected boolean _isFirstTime() {\n return _firstTime;\n }", "protected void setInactive() {\r\n\t\tactive = false;\r\n\t}", "public void setActive(boolean value) {\n this.active = value;\n }", "public void Activate() {\n state.Activate();\n }", "public void setWaitForEver(boolean set){\r\n waitForEverFlag=set;\r\n }", "public void setActive(boolean active) { \n this.active = active;\n }", "public boolean isActive(){\r\n\t\treturn active_;\r\n\t}", "@Override\n public void setActive(boolean active) {\n this.active = active;\n }", "public void setKickerFire(){\r\n\t\tkickerTarget = true;\r\n\t}", "public void setActive(){\n paycheckController.setActive();\n }", "public synchronized static void resetInvoked() {\n\n invoked = false;\n }", "public void setLaunched();", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "protected void setCanBeActive(boolean canBeActive) {\n\tmCanBeActive = canBeActive;\n}", "public boolean isFirstClick() {\n return firstClick;\n }" ]
[ "0.61982197", "0.61959404", "0.61711293", "0.6117971", "0.6099348", "0.59983397", "0.5984954", "0.5966883", "0.5966883", "0.5966446", "0.5956313", "0.59301835", "0.59232813", "0.5896036", "0.58871627", "0.58601713", "0.58430487", "0.5839486", "0.58141375", "0.5814063", "0.5812036", "0.58020556", "0.5799942", "0.5796365", "0.5785623", "0.5774857", "0.57715154", "0.5763499", "0.5761918", "0.57522416", "0.5749516", "0.57320815", "0.5725919", "0.5717676", "0.570972", "0.5686055", "0.5677604", "0.56553006", "0.5653181", "0.563809", "0.5633689", "0.5624409", "0.56243795", "0.560624", "0.5600332", "0.55945414", "0.5586777", "0.55767816", "0.557064", "0.5566053", "0.5565951", "0.5548399", "0.5546126", "0.5544117", "0.5543434", "0.5542981", "0.554169", "0.55279636", "0.55262506", "0.55164963", "0.5514162", "0.5497973", "0.5491671", "0.5489949", "0.5487749", "0.54850024", "0.5481419", "0.54736656", "0.54622793", "0.54612315", "0.5459162", "0.5459162", "0.5459162", "0.5458468", "0.54533076", "0.5452929", "0.54524034", "0.54417306", "0.54224384", "0.5417176", "0.5408705", "0.54032475", "0.53944606", "0.53932905", "0.5386713", "0.53853315", "0.537541", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5372293", "0.5369789", "0.53697693" ]
0.0
-1
time O(n), space O(n)
public int rob(int[] nums) { if(nums == null || nums.length == 0){ return 0; } int res = 0, n = nums.length; int[] dp = new int[n + 1]; dp[1] = nums[0]; for(int i = 2; i <= n; i++){ dp[i] = Math.max(dp[i - 2] + nums[i - 1], dp[i - 1]); } return dp[n]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 }", "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}", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\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 static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }", "public static boolean addUpToFast(int[] array, int n){\n\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tif(hs.contains(n-array[i]))\n\t\t\t\treturn true;\n\t\t\ths.add(array[i]);\n\t\t}\n\t\treturn false;\n\t}", "public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "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 }", "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 }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "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 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 }", "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 boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\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 int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\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 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}", "public static void arraySpeedTestRemove0() {\n ArrayList<Integer> list = new ArrayList<Integer>();\n\t\tfor(int n = 0; n < 8000000; n++) {\n list.add(n);\n }\n\n //Displaying quantity of elements\n\t\tSystem.out.println(\"*** Quantity of elements in the collection: \" + list.size());\n\n //Deleting last element in the collection\n long begin = System.currentTimeMillis();\n\t\tlist.remove(list.size()-1);\n long end = System.currentTimeMillis();\n\n //Displaying time of deletion\n\t\tSystem.out.println(\"*** Removing last element has taken: \" + (end - begin) + \"ms\");\n\n //Deleting first element from collection\n begin = System.currentTimeMillis();\n\t\tlist.remove(0);\n end = System.currentTimeMillis();\n\n //Displaying time of deletion\n\t\tSystem.out.println(\"*** Removing first element has taken: \" + (end - begin) + \"ms\");\n}", "private static int[] p2(int[] ar, int n) {\n int[] p2 = new int[n];\n Arrays.fill(p2, n);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] < ar[st.peek()]) {\n p2[st.peek()] = i;\n st.pop();\n }\n st.push(i);\n }\n return p2;\n }", "protected int insertionIndex(int key) {\r\n\t\tint hash = key & 0x7fffffff;\r\n\t\tint index = this.hashFunc1(hash) * FREE.length;\r\n\t\t// int stepSize = hashFunc2(hash);\r\n\t\tbyte[] cur = new byte[4];\r\n\t\tkeys.position(index);\r\n\t\tkeys.get(cur);\r\n int storehash=(cur[0] << 24)+ ((cur[1] & 0xFF) << 16)+ ((cur[2] & 0xFF) << 8)+ (cur[3] & 0xFF);\r\n\r\n\t\tif (Arrays.equals(cur, FREE)) {\r\n\t\t\treturn index; // empty, all done\r\n\t\t} else if (storehash==key) {\r\n\t\t\treturn -index - 1; // already stored\r\n\t\t} else { // already FULL or REMOVED, must probe\r\n\t\t\t// compute the double hash\r\n\t\t\tfinal int probe = (1 + (hash % (size - 2))) * FREE.length;\r\n\r\n\t\t\t// if the slot we landed on is FULL (but not removed), probe\r\n\t\t\t// until we find an empty slot, a REMOVED slot, or an element\r\n\t\t\t// equal to the one we are trying to insert.\r\n\t\t\t// finding an empty slot means that the value is not present\r\n\t\t\t// and that we should use that slot as the insertion point;\r\n\t\t\t// finding a REMOVED slot means that we need to keep searching,\r\n\t\t\t// however we want to remember the offset of that REMOVED slot\r\n\t\t\t// so we can reuse it in case a \"new\" insertion (i.e. not an update)\r\n\t\t\t// is possible.\r\n\t\t\t// finding a matching value means that we've found that our desired\r\n\t\t\t// key is already in the table\r\n\t\t\tif (!Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\t// starting at the natural offset, probe until we find an\r\n\t\t\t\t// offset that isn't full.\r\n\t\t\t\tdo {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t} while (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& !Arrays.equals(cur, REMOVED)\r\n\t\t\t\t\t\t&& storehash!=hash);\r\n\t\t\t}\r\n\r\n\t\t\t// if the index we found was removed: continue probing until we\r\n\t\t\t// locate a free location or an element which equal()s the\r\n\t\t\t// one we have.\r\n\t\t\tif (Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\tint firstRemoved = index;\r\n\t\t\t\twhile (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& (Arrays.equals(cur, REMOVED) || storehash!=hash)) {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t}\r\n\t\t\t\t// NOTE: cur cannot == REMOVED in this block\r\n\t\t\t\treturn (!Arrays.equals(cur, FREE)) ? -index - 1 : firstRemoved;\r\n\t\t\t}\r\n\t\t\t// if it's full, the key is already stored\r\n\t\t\t// NOTE: cur cannot equal REMOVE here (would have retuned already\r\n\t\t\t// (see above)\r\n\t\t\treturn storehash!=hash ? -index - 1 : index;\r\n\t\t}\r\n\t}", "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 }", "public static void process(int n){\n\t\tint right, left, i;\n\n\t\tright = i = 0;\n\t\twhile(i < n){\n\t\t\twhile (right < n && c[i] == c[right]) right++;\n\t\t\tfor(int j = i; j < right; ++j) max_right[j] = right;\n\t\t\ti = right;\n\t\t}\n\n\t\tleft = i = n-1;\n\t\twhile(i >= 0){\n\t\t\twhile (left >= 0 && c[i] == c[left]) left--;\n\t\t\tfor (int j = i; j > left; --j) max_left[j] = left;\n\t\t\ti = left;\n\t\t}\n\t}", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "private int calcDistanceMemoize(int i, int j, char[] one, char[] two, int [][]table) {\n if (i < 0)\n return j+1;\n\tif (j < 0)\n\t return i+1;\n\n if (table[i][j] == -1) \n table[i][j] = calcDistanceRecursive(i, j, one, two, table);\n\t\n return table[i][j];\n }", "@Override\r\n public long problem1(int size) {\r\n StringBuilder sb = new StringBuilder();\r\n long start = System.currentTimeMillis();\r\n for (int i=0; i<size; i++) {\r\n sb.append(i);\r\n }\r\n long end = System.currentTimeMillis();\r\n return end - start;\r\n }", "private int find(int p){\n while(p!=id[p]){\n p=id[p];\n eachDoUnionArrayAccessTimes+=2; //遍历读取某个元素算一次,设置值也算一次,所以加2次\n }\n eachDoUnionArrayAccessTimes++; //查询p的时候依然会读取一次\n return p;\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 get_odd_occurences_optimal_v2(int[] a) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tresult ^= i;\n\t\t}\n\t\treturn result;\n\t}", "static int runningTime(int[] arr) {\n return insertionSort(arr);\n \n }", "private static void task3(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(t.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\tt.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + t.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t\t \n\t\t }", "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 }", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "public static void targetSumPair(int[] arr, int target){\n //write your code here\n Arrays.sort(arr); // O(nlogn)\n int i=0, j=arr.length-1;\n while(i < j) {\n if(arr[i]+arr[j] < target) {\n i++;\n }\n else if(arr[i] + arr[j] > target)\n j--;\n else {\n System.out.println(arr[i] + \", \" + arr[j]);\n i++; j--;\n }\n }\n }", "private static void task03(int nUMS, AVLTree<Integer> h) {\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(h.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\th.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + h.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\t\t\n\t}", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n long sz = (long)t + 1;\n Map<Long, Long> map = new HashMap<>();\n for (int i = 0; i < nums.length; ++i) {\n long bucket = getBucket(nums[i], sz);\n if (map.containsKey(bucket)) return true;\n if (map.containsKey(bucket + 1) && Math.abs(nums[i] - map.get(bucket + 1)) < sz) return true;\n if (map.containsKey(bucket - 1) && Math.abs(nums[i] - map.get(bucket - 1)) < sz) return true;\n map.put(bucket, (long)nums[i]);\n if (i >= k) map.remove(getBucket(nums[i - k], sz));\n }\n return false;\n}", "private int hashFunc1(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n // Java can return negative vals with hashCode() it's biggg so need to check for this\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n return hashVal; // Idea index position we'd like to insert or search in\n }", "private static void task033(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\t\n\t\tlong start = System.nanoTime();\n\t System.out.println( \"Deletion in the table...\" );\n\t int count=0;\n\t\tfor( int j = 1; j <= nUMS; j++)\n\t\t{\n\t\t\tif(i.isEmpty() == false)\n\t\t\t{\n\t\t\t\n\t\t\ti.delete(j);\n\t\t\t\n\t\t\t}\n//\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t}\n\t\tSystem.out.println(\"Total Size \" + count);\n\t\tSystem.out.println(\"Is it empty \" + i.isEmpty());\n\t\tlong end = System.nanoTime();;\n\t\tlong elapsedTime = end - start;\n\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\n\t\t\n\t}", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\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 long[] radixsort(int arr[], int n)\r\n\r\n {\n\r\n int m = getMax(arr, n);\r\n\r\n long st = System.nanoTime();\r\n\r\n\r\n\r\n for (int exp = 1; m/exp > 0; exp *= 10)\r\n\r\n countSort(arr, n, exp);\r\n\r\n \r\n\r\n long et = System.nanoTime();\r\n\r\n threeVals[2] = et - st;\r\n\r\n return threeVals;\r\n\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 void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "static void UseArrayList(ArrayList<Integer> myList2){\r\n\t\tLong start = System.currentTimeMillis();\r\n\t\tfor (int n=0; n<myList2.size();n++)\r\n\t\t{\r\n\t\t\tfor (int m=n+1; m<myList2.size();m++){\r\n\t\t\t\tif( myList2.get(n)== myList2.get(m) ) {System.out.println(\"Duplicate found \"+myList2.get(n));}\r\n\t\t\t}\r\n\t\t}\r\n\t\tLong End = System.currentTimeMillis();\r\n\t\tSystem.out.println(\"Total time taken for executing this code is: \" + (End-start));\r\n\t}", "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 }", "static int countCollinearFast(int[] a1, int[] a2, int[] a3)\n {\n //TODO: implement this method\n \tsort(a3);\n \tint count = 0;\n \tint search;\n \t\n \tfor (int i=0; i<a1.length; i++)\n \t\tfor (int j=0; j<a2.length; j++)\n \t\t{\n \t\t\tsearch = 2*a2[j] - a1[i];\n \t\t\tif (binarySearch(a3, search))\n \t\t\t\tcount++;\n \t\t}\n \t\n \treturn count;\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}", "private int getIndex2(int val){\n return val/bucket;\n }", "public void missingNumberEfficient2(int[] array, int n) {\n\t\t\n\t\tint X = 0;\n\t\tint Y = 0;\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tX ^= array[i];\n\t\t}\n\t\t\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tY ^= i;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Missing Number is : \" + (X ^ Y));\n\t}", "private static void findDuplicatesByHashTable(int[] arr) {\n\t\t\n\t\t\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\t\n\t\tfor(int i=0; i<arr.length ; i++)\n\t\t{\n\t\t\tif(!map.containsKey(arr[i]))\n\t\t\t{\n\t\t\t\tmap.put(arr[i], 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmap.put(arr[i], map.get(arr[i])+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( Map.Entry<Integer, Integer> entry : map.entrySet() )\n\t\t{\n\t\t\tif(entry.getValue() > 1 )\n\t\t\t{\n\t\t\t\tSystem.out.println(\" Duplicate is by HashTable \" + entry.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private void faster() {\n BigInteger[] denoms = new BigInteger[1000];\n BigInteger[] nums = new BigInteger[1000];\n\n nums[0] = BigInteger.valueOf(3);\n denoms[0] = BigInteger.valueOf(2);\n\n for (int i = 1; i < 1000; i++) {\n denoms[i] = nums[i - 1].add(denoms[i - 1]);\n nums[i] = denoms[i].add(denoms[i - 1]);\n }\n\n int count = 0;\n for (int i = 1; i < 1000; i++) {\n if (nums[i].toString().length() > denoms[i].toString().length()) {\n count++;\n }\n }\n this.answer = count;\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 long arrayManipulation(int n, int[][] queries) {\n int len = queries.length;\n long[] arr = new long[n + 2];\n\n for (int i = 0; i < arr.length; i++) {\n arr[i] = 0;\n }\n\n\n for (int i = 0; i < len; i++) {\n int[] query = queries[i];\n int a = query[0];\n int b = query[1];\n int k = query[2];\n arr[a] = arr[a] + k;\n if (b + 1 <= arr.length) {\n arr[b + 1] = arr[b + 1] - k;\n }\n }\n\n long max = arr[0];\n long x = 0;\n\n for (int i = 0; i < arr.length; i++) {\n x = x + arr[i];\n max = Math.max(x, max);\n }\n\n return max;\n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n TreeSet<Long> set = new TreeSet<>();\n for (int i = 0; i < nums.length; ++i) {\n long num = (long)nums[i];\n Long floor = set.floor(num), ceiling = set.ceiling(num);\n if (floor != null && num - floor <= t || ceiling != null && ceiling - num <= t) return true;\n set.add(num);\n if (i >= k) set.remove((long)nums[i - k]);\n }\n return false;\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 }", "private void discretization(int[] nums) {\n\t\tint[] sorted = nums.clone();\n\t\tArrays.sort(sorted);\n\t\tfor (int i = 0; i < nums.length; i++) {\n\t\t\tnums[i] = Arrays.binarySearch(sorted, nums[i]);\n\t\t}\n\t}", "WeightedUnionFind(int N){\n id = new int[N];\n size = new int[N];\n for (int i = 0; i < N; i++){\n id[i] = i;\n size[i] = 1;\n }\n }", "public int removeDuplicates(int[] nums) {\n if (nums.length == 0) return 0;\n int i = 0;\n for (int j = 1; j < nums.length; j++) {\n if (nums[j] != nums[i]) {\n i++;\n nums[i] = nums[j];\n }\n }\n return i + 1;\n}", "private static void task333(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"RED BLAST BST DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t i.delete(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t}", "private void fastXY(int x, int y){\n ccells.row5bitHash(x,y-2);\n ccells.row5bitHash(x,y-1);\n ccells.row5bitHash(x,y);\n ccells.row5bitHash(x,y+1);\n ccells.row5bitHash(x,y+2);\n // then use some binary math to manipulate this data into hashes for each cell\n // flatten the loop and copy paste yay :)\n // or I could also leave the loop alone and make it loop over array which would be a little more readable\n }", "static int find(int[] arr){\n\t\tif(arr.length==1) return -1;\n\t\tint slow = arr[0] , fast = arr[arr[0]];\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[arr[fast]];\n\t\t}\n\t\tslow = 0;\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[fast];\n\t\t}\n\t\treturn slow;\n\n\t}", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public static long sb(long a[], long n, long x) {\n long len = Long.MAX_VALUE;\n int p1 = 0;\n int p2 = 0;\n long sum = 0l;\n while(p1<=p2 && p2<n) {\n sum = sum + a[p2];\n p2++;\n while(sum >= x) {\n len = len > (p2-p1) ? (p2-p1) : len;\n sum = sum - a[p1];\n p1++;\n }\n }\n return len == Long.MAX_VALUE ? -1 : len;\n }", "private static void task4(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"SPLAY DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t t.remove(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t\t\n\t}", "private static int betterSolution(int n) {\n return n*n*n;\n }", "public int findDuplicate(int[] nums) {\n int slow = nums[0];\n int fast = nums[0];\n do {\n slow = nums[slow];\n fast = nums[nums[fast]];\n } while (slow != fast);\n \n slow = nums[0];\n while (slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n return slow;\n }", "private static void sortAccording(int A1[], int A2[], int m, int n)\n {\n // The temp array is used to store a copy \n // of A1[] and visited[] is used to mark the \n // visited elements in temp[].\n int temp[] = new int[m], visited[] = new int[m];\n for (int i = 0; i < m; i++)\n {\n temp[i] = A1[i];\n visited[i] = 0;\n }\n \n // Sort elements in temp\n Arrays.sort(temp);\n \n // for index of output which is sorted A1[]\n int ind = 0; \n \n // Consider all elements of A2[], find them\n // in temp[] and copy to A1[] in order.\n for (int i = 0; i < n; i++){\n\n // Find index of the first occurrence\n // of A2[i] in temp\n int f = first(temp, 0, m-1, A2[i], m);\n \n // If not present, no need to proceed\n if (f == -1) \n continue;\n \n // Copy all occurrences of A2[i] to A1[]\n for (int j = f; (j < m && temp[j] == A2[i]); j++){\n \n A1[ind++] = temp[j];\n visited[j] = 1;\n }\n }\n \n // Now copy all items of temp[] which are \n // not present in A2[]\n for (int i = 0; i < m; i++)\n if (visited[i] == 0)\n A1[ind++] = temp[i];\n }", "private int elementNC(int i) {\n return first + i * stride;\n }", "static int trappingWater(int arr[], int n) {\r\n\r\n // Your code here\r\n /** *** tle\r\n for(int i=1;i<n-1;i++){\r\n int l=arr[i];\r\n for (int j = 0; j < i; j++) {\r\n l=l < arr[j] ? arr[j] : l;\r\n }\r\n int r=arr[i];\r\n for (int j = i+1; j <n ; j++) {\r\n r=r < arr[j] ? arr[j] : r;\r\n }\r\n\r\n s=s+(l>r? r:l) -arr[i];\r\n }\r\n return s;\r\n\r\n //////////////////////////////////////////////\r\n SC=O(N)\r\n if(n<=2)\r\n return 0;\r\n int[] left=new int[n];\r\n int[] right=new int[n];\r\n left[0]=0;\r\n int leftmax=arr[0];\r\n for (int i = 1; i <n ; ++i) {\r\n left[i]=leftmax;\r\n leftmax=Math.max(leftmax,arr[i]);\r\n }\r\n right[n-1]=0;\r\n int mxright=arr[n-1];\r\n for (int i = n-2; i >=0 ; --i) {\r\n right[i]=mxright;\r\n mxright=Math.max(mxright,arr[i]);\r\n }\r\n int s=0;\r\n for (int i = 1; i < n-1; ++i) {\r\n if(arr[i]<left[i] && arr[i]<right[i]){\r\n s+=Math.min(left[i],right[i])-arr[i];\r\n }\r\n }\r\n return s;\r\n /////////////////////////////////////////////////////\r\n **/\r\n\r\n if(n<=2)\r\n return 0;\r\n\r\n int leftMax = arr[0];\r\n int rightMax = arr[n-1];\r\n\r\n int left = 1;\r\n int right = n-2;\r\n int water = 0;\r\n\r\n while(left <= right) {\r\n if (leftMax < rightMax) {\r\n if (arr[left] >= leftMax) {\r\n leftMax = arr[left];\r\n } else\r\n water = water + (leftMax - arr[left]);\r\n\r\n //leftMax = Math.max(leftMax, arr[left]);\r\n left++;\r\n } else {\r\n if (arr[right] > rightMax) {\r\n rightMax = arr[right];\r\n }\r\n\r\n water = water + (rightMax - arr[right]);\r\n right--;\r\n }\r\n }\r\n return water;\r\n\r\n }", "static int linearLogTime(int[] n, int[] m) {\n if(n == null || n.length == 0 || m == null || m.length == 0) return -1;\n int sum = 0;\n for(int i = 0; i < n.length; ++i) {\n sum += logTime(m, 0, m.length, 15);\n }\n return sum;\n }", "static int[] productExceptSelfSpaceOptimized(int[] nums) {\n int n = nums.length;\n int[] result = new int[n];\n Arrays.fill(result, 1);\n int curr = 1;\n\n for (int i = 0; i < n; i++) {\n result[i] *= curr;\n curr *= nums[i];\n }\n\n curr = 1;\n for (int i = n - 1; i >= 0; i--) {\n result[i] *= curr;\n curr *= nums[i];\n }\n\n return result;\n }", "protected int index(int hashvalue) {\r\n\t\tint hash=hashvalue& 0x7fffffff;\r\n\t\tint index = this.hashFunc1(hash) * FREE.length;////获取一个整型数值(正整数),用来定位一条数据存储\r\n\t\t// int stepSize = hashFunc2(hash);\r\n\t\tbyte[] cur = new byte[4];\r\n\t\tkeys.position(index);\r\n\t\tkeys.get(cur);\r\n\t\tint storehash=(cur[0] << 24)+ ((cur[1] & 0xFF) << 16)+ ((cur[2] & 0xFF) << 8)+ (cur[3] & 0xFF);\r\n\t\tif (storehash==hash) {\r\n\t\t\treturn index;\r\n\t\t}\r\n\t\tif (Arrays.equals(cur, FREE)) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t// NOTE: here it has to be REMOVED or FULL (some user-given value)\r\n\t\tif (Arrays.equals(cur, REMOVED) || storehash!=hash) {\r\n\t\t\t// see Knuth, p. 529\r\n\t\t\tfinal int probe = (1 + (hash % (size - 2))) * FREE.length;\r\n\t\t\tint z = 0;\r\n\t\t\tdo {\r\n\t\t\t\tz++;\r\n\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\tkeys.position(index);\r\n\t\t\t\tkeys.get(cur);\r\n\t\t\t\tif (z > size) {\r\n\t\t\t\t\tSDFSLogger.getLog().info(\r\n\t\t\t\t\t\t\t\"entries exhaused size=\" + this.size + \" entries=\"\r\n\t\t\t\t\t\t\t\t\t+ this.entries);\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t} while (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t&& (Arrays.equals(cur, REMOVED) || storehash!=hash));\r\n\t\t}\r\n\r\n\t\treturn storehash!=hash ? -1 : index;\r\n\t}", "private static int find(int i)\r\n{\n int ind = i;\r\n while (ind != ptrs[ind]) {\r\n ind = ptrs[ind];\r\n }\r\n // fix the link so that it is one hop only\r\n // note: this doesn't implement the full union-find update\r\n\r\n ptrs[i] = ind;\r\n\r\n return ind;\r\n}", "private static void bfs(int idx) {\n\t\t\n\t\tQueue<node> q =new LinkedList<node>();\n\t\tq.add(new node(idx,0,\"\"));\n\t\twhile (!q.isEmpty()) {\n\t\t\tnode tmp = q.poll();\n\t\t\tif(tmp.idx<0 ||tmp.idx > 200000) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(tmp.cnt> min) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tmp.idx == k) {\n\t\t\t\tif(tmp.cnt < min) {\n\t\t\t\t\tmin = tmp.cnt;\n\t\t\t\t\tminnode = tmp;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!visit[tmp.idx] && tmp.idx<=100000) {\n\t\t\t\tvisit[tmp.idx]= true;\n\t\t\t\tq.add(new node(tmp.idx*2, tmp.cnt+1,tmp.s));\n\t\t\t\tq.add(new node(tmp.idx-1, tmp.cnt+1,tmp.s));\n\t\t\t\tq.add(new node(tmp.idx+1, tmp.cnt+1,tmp.s));\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static int firstMissingEffective(int[] x){\n int i = 0;\n while(i<x.length){\n // first two conditions check that element can correspond to index of array\n // third condition checks that they are not in their required position\n // fourth condition checks that there is no duplicate already at their position\n if( x[i]>0 && x[i]<x.length && x[i]-1!=i && x[x[i]-1]!=x[i]) exch(x,i,x[i]-1);\n else i++;\n }\n\n // second pass\n for(int j=0; j < x.length; j++){\n if( x[j]-1!=j) return j+1;\n }\n return x.length+1;\n\n }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "private int gameV(int i, int j, int x) {\n int count = 2;\n for (int ii = 0; ii < i; ii++) {\n for (int jj = ii + 1; jj < n; jj++) {\n if (ii != x && jj != x) count++;\n }\n }\n for (int jj = i + 1; jj < j; jj++) {\n if (jj != x) count++;\n }\n return count;\n }", "private static int[] computePermutations(int n) {\n final int[] indexes = new int[n];\n for (int i = 0; i < n; i++) {\n indexes[i] = i;\n //indexes[i] = i + 1;\n }\n\n final int total = computePermutations(indexes, 0, n);\n System.out.println(\"# \" + np + \"; total = \" + total);\n\n return indexes;\n }", "public static void insert(Comparable[] arr, int n) \n\t{\n\t\tif (arr != null && n > 1)\n\t\t {\n\t\t\tif (n > arr.length)\n\t\t\t\tn = arr.length;\n\t\t}\n\t\tfor (int i = 1; i < n; i++) \n\t\t{ //complexity is n in the best case, complexity is n squared in the worst case\n\t\t\tfor (int j = i; j > 0 && arr[j].compareTo(arr[j-1]) < 0; j--) //complexity of 1 in the best case, complexity of i in the worst case\n\t\t\t\tswap(arr, j, j-1);\t//complexity of 1\n\t\t}\n\t}", "private static int distance(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost, int s, int t) {\n\n Set<Integer> visited = new HashSet<>(); //option 1\n Map<Integer, Integer> distance = new HashMap<>();\n// Queue<Integer> q = new PriorityQueue<>(11, (o1, o2) -> { //option 0\n// Integer d1 = distance.get(o1); //option 0\n// Integer d2 = distance.get(o2); //option 0\n Queue<Map.Entry<Integer, Integer>> q = new PriorityQueue<>(11, (o1, o2) -> { //option 1\n Integer d1 = o1.getValue(); //option 1\n Integer d2 = o2.getValue(); //option 1\n\n if (Objects.equals(d1, d2)) return 0;\n if (d1 == null) return 1;\n if (d2 == null) return -1;\n\n return d1 - d2;\n });\n\n distance.put(s, 0);\n// q.addAll(IntStream.range(0, adj.length).boxed().collect(Collectors.toList())); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(s, 0)); //option 1\n\n while (!q.isEmpty()) {\n// int u = q.remove(); //option 0\n int u = q.remove().getKey(); //option 1\n\n if (u == t) {\n Integer dist = distance.get(u);\n if (dist == null) return -1;\n return dist;\n }\n\n if (visited.contains(u)) continue; //option 1\n visited.add(u); //option 1\n\n List<Integer> adjList = adj[u];\n List<Integer> costList = cost[u];\n for (int i = 0; i < adjList.size(); i++) {\n int v = adjList.get(i);\n int w = costList.get(i);\n Integer dist = distance.get(v);\n Integer newDist = distance.get(u);\n if (newDist != null) newDist += w;\n\n if (newDist != null && (dist == null || dist > newDist)) {\n //relax\n distance.put(v, newDist);\n// q.remove(v); //option 0\n// q.add(v); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(v, distance.get(v))); //option 1\n }\n }\n }\n\n return -1;\n }", "public int singles(int [] arr){\n HashMap<Integer, Integer> hm = new HashMap<>();\n long s1 = 0, s2 = 0;\n for(int x = 0; x < arr.length; x++){\n if(!hm.containsKey(arr[x])){\n s1 += arr[x];\n hm.put(arr[x], 1);\n }\n s2 += arr[x];\n }\n return (int)(2* s1 - s2);\n }", "static int logTime(int[] n, int start, int end, int val) {\n if(n == null || n.length == 0) return -1;\n int mid = (start + end) / 2;\n if(val < n[mid]) logTime(n, 0, mid, val);\n if(val > n[mid]) logTime(n, mid + 1, n.length, val);\n return n[mid];\n }", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}", "public static int[] answer(int[] data, int n) {\n\t\tHashMap <Integer, Integer> h = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i=0; i<data.length; i++){\r\n\t\t\tif (!h.containsKey(data[i])){\r\n\t\t\t\th.put(data[i], 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\th.put(data[i], h.get(data[i])+1);\r\n\t\t\t//h[data[i]]++;\r\n\t\r\n\t\t\tif (h.get(data[i]) > n){\r\n\t\t\t\th.put(data[i], Integer.MIN_VALUE);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<Integer> r = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor(int i=0; i<data.length; i++){\r\n\t\t\t\r\n\t\t\tif (h.get(data[i])>0){\r\n\t\t\t\tr.add(data[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//pp(h);\r\n\t\t//System.out.println(h);\r\n\t\t\r\n\t\tint [] rr = new int [r.size()];\r\n\r\n\t\tfor(int k=0; k<r.size(); k++){\r\n\t\t\trr[k] = r.get(k);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn rr;\r\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}", "public static int firstMissingPositiveSpace(int[] nums) {\n int n = nums.length;\n int map[] = new int[n];\n for(int i=0;i<n;i++){\n if(nums[i]>0 && nums[i] <= n){\n map[nums[i]-1] = nums[i];\n }\n }\n int i=0;\n for(;i<n;i++){\n if(i+1!=map[i])\n return i+1;\n }\n return i==n ? n+1 : 1;\n }", "private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}", "public static double linSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n for (int j = 0; j < a.length; j++){\n if (a[j] == searchVar)\n break;\n }\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }" ]
[ "0.68100625", "0.66772884", "0.63322693", "0.60761565", "0.6074929", "0.5911255", "0.58581734", "0.58558583", "0.57943225", "0.57244885", "0.57223284", "0.56843394", "0.55883145", "0.5569671", "0.55656254", "0.55595756", "0.55452365", "0.5526082", "0.54625463", "0.54573876", "0.5436721", "0.5386376", "0.5381536", "0.53636634", "0.5346985", "0.5346103", "0.53450143", "0.53393483", "0.53317827", "0.53271925", "0.53234804", "0.5322697", "0.5317063", "0.53024054", "0.5298486", "0.52882797", "0.5287996", "0.5252918", "0.52524084", "0.5250958", "0.52489185", "0.524859", "0.5238011", "0.52054954", "0.5205128", "0.52004594", "0.5197922", "0.51922333", "0.51904243", "0.518781", "0.5184299", "0.517095", "0.5154895", "0.51501536", "0.5138622", "0.51379675", "0.5134054", "0.51201993", "0.51179904", "0.511623", "0.5110515", "0.5109215", "0.510777", "0.5107026", "0.51036847", "0.51032466", "0.5099302", "0.50970113", "0.5094347", "0.5093081", "0.50918335", "0.50916934", "0.508755", "0.5069291", "0.5067737", "0.50662494", "0.50614834", "0.5060784", "0.5059171", "0.5053421", "0.5047717", "0.5043139", "0.50423497", "0.5038465", "0.503798", "0.50332713", "0.5033198", "0.5032583", "0.50315845", "0.5027568", "0.50178784", "0.5016964", "0.50168425", "0.5011637", "0.50100744", "0.5004371", "0.4995836", "0.4990251", "0.49851015", "0.4979385", "0.4979262" ]
0.0
-1
private Constructor to prevent instantiation
private PropertiesUtils() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Rekenhulp()\n\t{\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private Instantiation(){}", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private SystemInfo() {\r\n // forbid object construction \r\n }", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "public Constructor(){\n\t\t\n\t}", "private MApi() {}", "private TMCourse() {\n\t}", "private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}", "private Utils() {\n\t}", "private Utils() {\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "Reproducible newInstance();", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "private LOCFacade() {\r\n\r\n\t}", "private Singleton()\n\t\t{\n\t\t}", "private Verify(){\n\t\t// Private constructor to prevent instantiation\n\t}", "private JsonUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private Marinator() {\n }", "private Marinator() {\n }", "private FactoryCacheValet() {\n\t\tsuper();\n\t}", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "private FlowExecutorUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "private TagCacheManager(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "private Utility() {\n\t}", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "private Util() { }", "private UtilsCache() {\n\t\tsuper();\n\t}", "private CheckingTools() {\r\n super();\r\n }", "private WebXmlIo()\n {\n // Voluntarily empty constructor as utility classes should not have a public or default\n // constructor\n }", "private ServiceListingList() {\n //This Exists to defeat instantiation\n super();\n }", "private XMLUtil() {\n\t}", "private XMLUtils()\r\n\t{\r\n\t}", "private XmlStreamFactory()\n {\n /*\n * nothing to do\n */\n }", "private Utility() {\n throw new IllegalAccessError();\n }", "private ChainingMethods() {\n // private constructor\n\n }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private GeoUtil()\n\t{\n\t}", "private Ex() {\n }", "private Singleton() {\n\t}", "private SingleObject()\r\n {\r\n }", "private ContentUtil() {\n // do nothing\n }", "private ClinicFileLoader() {\n\t}", "private MappingReader() {\n\t}", "private WolUtil() {\n }", "private CommonMethods() {\n }", "private JsonUtils() {\n\t\tsuper();\n\t}", "protected VboUtil() {\n }", "private AcceleoLibrariesEclipseUtil() {\n \t\t// hides constructor\n \t}", "private SingletonObject() {\n\n\t}", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "private Supervisor() {\r\n\t}", "private AccessList() {\r\n\r\n }", "private Util() {\n }", "private BookReader() {\n\t}", "private OMUtil() { }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "public Pitonyak_09_02() {\r\n }", "private Util() {\n }", "private Util() {\n }", "private EagerlySinleton()\n\t{\n\t}", "private Source() {\n throw new AssertionError(\"This class should not be instantiated.\");\n }", "private SnapshotUtils() {\r\n\t}", "protected abstract void construct();", "private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}", "private Terms(){\n\t\t //this prevents even the native class from calling this ctor as well :\n\t\t throw new AssertionError();\n\t\t }", "private Cat() {\n\t\t\n\t}", "private PermissionUtil() {\n throw new IllegalStateException(\"you can't instantiate PermissionUtil!\");\n }", "private Security() { }", "private Validate(){\n //private empty constructor to prevent object initiation\n }", "private Log()\n {\n //Hides implicit constructor.\n }", "protected Approche() {\n }", "private PerksFactory() {\n\n\t}", "private HttpClient() {\n\t}", "private InstanceUtil() {\n }", "private FileUtility() {\r\n\t}", "private GuiUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private S3Utils() {\n throw new UnsupportedOperationException(\"This class cannot be instantiated\");\n }", "private FlexOrderTransformer() {\n // constructor preventing instantiation.\n }", "private Mocks() { }", "private XmlFactory() {\r\n /* no-op */\r\n }", "private StreamFactory()\n {\n /*\n * nothing to do\n */\n }", "private SupplierLoaderUtil() {\n\t}", "private FixtureCache() {\n\t}", "private SparkseeUtils()\n {\n /*\n * Intentionally left empty.\n */\n }", "private HabitTrackerUtils() {\n // Required empty private constructor (to prevent instantiation).\n }", "private ObjectFactory() { }", "private MetallicityUtils() {\n\t\t\n\t}", "private ClientLoader() {\r\n }", "private GraphFileManager() {\n\t}" ]
[ "0.7856971", "0.778026", "0.77717793", "0.75592965", "0.7548901", "0.75098884", "0.74887955", "0.7484872", "0.7481701", "0.7467042", "0.74469924", "0.7408885", "0.73692584", "0.73692584", "0.7339318", "0.73373663", "0.7335747", "0.7287246", "0.7282257", "0.72774374", "0.7276361", "0.7270281", "0.7270281", "0.7235363", "0.7213179", "0.7209888", "0.71903676", "0.7180237", "0.7179673", "0.7177748", "0.7157872", "0.715667", "0.7155181", "0.7154959", "0.7135639", "0.7132871", "0.7122731", "0.71195614", "0.71098447", "0.7105966", "0.709855", "0.709855", "0.709855", "0.709855", "0.70915574", "0.70897555", "0.7089595", "0.7081566", "0.7067409", "0.7066394", "0.7065936", "0.70626277", "0.7062273", "0.7058764", "0.7057768", "0.7052447", "0.7048917", "0.70468485", "0.70418006", "0.70387334", "0.7035516", "0.7032987", "0.70251966", "0.7019833", "0.7019833", "0.7019833", "0.7019833", "0.7019833", "0.7017176", "0.70163435", "0.70163435", "0.7015587", "0.7010193", "0.7006584", "0.7005382", "0.7004902", "0.7003476", "0.7001619", "0.6994898", "0.6985927", "0.698505", "0.6984454", "0.6983016", "0.69726884", "0.69725543", "0.6971072", "0.6970502", "0.69685835", "0.6960918", "0.69595563", "0.69593924", "0.6958966", "0.69581723", "0.6951818", "0.69468075", "0.694606", "0.6945677", "0.69387525", "0.69250643", "0.6922442", "0.69192976" ]
0.0
-1
Loads a Properties file from the classpath matching the given file name
public static Properties getPropertiesFromClasspath(String fileName) throws PropertiesFileNotFoundException { Properties props = new Properties(); try { InputStream is = ClassLoader.getSystemResourceAsStream(fileName); if (is == null) { // try this instead is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); logger.debug("loaded properties file with Thread.currentThread()"); } props.load(is); } catch (Exception e) { throw new PropertiesFileNotFoundException( "ERROR LOADING PROPERTIES FROM CLASSPATH >" + fileName + "< !!!", e); } return props; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void loadProperties(Properties p, String fileName)throws IOException {\n ClassLoader classLoader = ClassLoader.getSystemClassLoader();\n URL f = classLoader.getResource(fileName);\n FileInputStream fr = new FileInputStream(new File(fileName));\n p.load(fr);\n fr.close();\n }", "private void LoadConfigFromClasspath() throws IOException \n {\n InputStream is = this.getClass().getClassLoader().getResourceAsStream(\"lrs.properties\");\n config.load(is);\n is.close();\n\t}", "private static void loadPropertiesFile() {\n checkNotNull(propertyFileName, \"propertyFileName cannot be null\");\n String currentDir = new File(\"\").getAbsolutePath();\n propertyFile = currentDir + \"/\" + propertyFileName;\n File propFile = new File(propertyFile);\n try {\n propFile.createNewFile();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n\n props = new Properties();\n try {\n FileInputStream fis = new FileInputStream(propertyFile);\n props.load(fis);\n fis.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }", "public void loadPropertyFile(String filename) {\n try (InputStream is = new FileInputStream(filename)) {\n properties.load(is);\n } catch (IOException x) {\n throw new IllegalArgumentException(x);\n }\n }", "private void loadProperties() {\n try (InputStream in = getClass().getClassLoader().getResourceAsStream(PATH_TO_PROPERTIES)) {\n this.prs.load(in);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }", "public static void loadProperties(String filename) {\n\n if (filename.equals(\"\")) {\n return;\n }\n propfilename = userhome + FS + filename;\n File f = new File(propfilename);\n if (f.exists()) {\n //loadProperties(propfilename);\n } else {\n propfilename = userhome + FS + \"Properties\" + FS + filename;\n f = new File(propfilename);\n if (f.exists()) {\n //loadProperties(propfilename);\n }\n }\n\n try {\n try (FileInputStream i = new FileInputStream(propfilename)) {\n prop.load(i);\n //prtProperties();\n }\n } catch (FileNotFoundException e) {\n System.out.println(\" ** Properties file not found=\" + propfilename + \" userhome=\" + userhome + \" \" + System.getProperty(\"user.home\"));\n saveProperties();\n } catch (IOException e) {\n System.out.println(\"IOException reading properties file=\" + propfilename);\n System.exit(1);\n }\n }", "public static void loadPropertyFile() {\r\n\t\t\r\n\t\tif (loaded) {\r\n\t\t\tthrow new IllegalStateException(\"Properties have already been loaded!\"); \r\n\t\t}\r\n\t\tloaded = true; \r\n\t\t\r\n\t\t// if property file was specified, use it instead of standard property\r\n\t\t// file\r\n\r\n\t\tString file = STANDARD_PROPERTY_FILE;\r\n\r\n\t\tif (System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE) != null\r\n\t\t\t\t&& System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE)\r\n\t\t\t\t\t\t.length() != 0) {\r\n\t\t\tfile = System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE);\r\n\t\t}\r\n\r\n\t\t// load property file\r\n\t\ttry {\r\n\t\t\tProperties props = System.getProperties();\r\n\t\t\tprops.load(ClassLoader.getSystemResourceAsStream(file));\r\n\t\t\tSystem.setProperties(props);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t}\r\n\r\n\t}", "public static void load() {\n try {\n File confFile = SessionService.getConfFileByPath(Const.FILE_CONFIGURATION);\n UtilSystem.recoverFileIfRequired(confFile);\n // Conf file doesn't exist at first launch\n if (confFile.exists()) {\n // Now read the conf file\n InputStream str = new FileInputStream(confFile);\n try {\n properties.load(str);\n } finally {\n str.close();\n }\n }\n } catch (Exception e) {\n Log.error(e);\n Messages.showErrorMessage(114);\n }\n }", "public Properties loadPropertiesFromFile(String path) {\n\n\t\ttry {\n\t\t\tInputStream fileInputStream = PropertyUtil.class\n\t\t\t\t\t.getResourceAsStream(path);\n\t\t\tproperties.load(fileInputStream);\n\t\t\tfileInputStream.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn properties;\n\t}", "private Properties loadProperties(String fileName){\r\n\t\t\r\n\t\tProperties prop = new Properties();\r\n\t\tInputStream input = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tinput = new FileInputStream(fileName);\r\n\t\t\tprop.load(input);\r\n\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (input != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tinput.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prop;\t \r\n\t}", "private static Properties readPropertiesFile(String fileName) throws IOException\n {\n LOG.log(Level.FINE, \"Searching for {0} file...\", fileName);\n try (final InputStream stream = SmartProperties.class.getClassLoader().getResourceAsStream(fileName))\n {\n Properties properties = new Properties();\n properties.load(stream);\n LOG.log(Level.FINE, \"{0} loaded successfully\", fileName);\n return properties;\n }\n }", "private Properties loadPropertiesFile(String file) {\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(file);\n\t\t\tif (fis != null) {\n\t\t\t\tProperties props = new Properties();\n\t\t\t\tprops.load(fis);\n\t\t\t\treturn props;\n\t\t\t}\n\t\t\tSystem.err.println(\"Cannot load \" + file\n\t\t\t\t\t+ \" , file input stream object is null\");\n\t\t} catch (java.io.IOException ioe) {\n\t\t\tSystem.err.println(\"Cannot load \" + file + \", error reading file\");\n\t\t}\n\t\treturn null;\n\t}", "void loadPropertiesFile()\n\t{\n\t\tlogger.info(\"Fetching the properties files\");\n\t\t\n\t\tconfigProp=new Properties(); \n\t\ttry{\tconfigProp.load(loadFile(\"Config.properties\"));\t\t} \n\t\tcatch (IOException e){\tAssert.assertTrue(\"Cannot initialise the Config properties file, Check if the file is corrupted\", false);\t}\t\t\t\n\t}", "private void loadPropertiesFile(String propertiesFile) {\n\n\t\t//open the properties file.\n\t\t_props = new Properties();\n\n\t\t//sanity check the properties file\n\t\tFile f = new File(propertiesFile);\n\t\tif (!f.canRead()) {\n\t\t\t//print an error - can't read the props file.\n\t\t\tSystem.err.println(\"Properties file \" + propertiesFile + \" cannot be read.\");\n\t\t}\n\n\t\ttry {\n\t\t\t_props.load(new FileInputStream(f));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final void loadPropertiesFromFile(final String fileName)\n {\n\n Properties tempProp = PropertyLoader.loadProperties(fileName);\n fProp.putAll(tempProp);\n\n }", "public void load(String fileName)\n throws FileNotFoundException, IOException, MissingRequiredTestPropertyException\n {\n\t\tinitializeTestProperties(new BufferedInputStream(new FileInputStream(fileName)));\n\t}", "private static ConfigImpl loadProperties(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 = loadProperties(reader);\n }\n }\n return ret;\n }", "public static Properties loadResource(String propertyName) throws IOException {\n Properties properties = new Properties();\n InputStream in = Configuration.class.getClassLoader().getResourceAsStream(propertyName);\n try {\n if (null == in) {\n String path = propertyName.replace('/', separatorChar);\n path = path.replace('\\\\', separatorChar);\n if (!path.startsWith(File.separator)) {\n path = separatorChar + path;\n }\n File configurationFile = new File(ConfigurationHolder.getHome() + separatorChar\n + \"properties\" + path);\n if (configurationFile.exists()) {\n in = new FileInputStream(configurationFile);\n }\n }\n if (null != in) {\n properties.load(in);\n }\n } finally {\n IOUtils.closeQuietly(in);\n }\n return properties;\n }", "@SuppressWarnings(\"unchecked\")\n private void loadProperties()\n {\n File f = getPropertiesFile();\n if (!f.exists())\n return;\n \n m_props = (Map<String, Object>) PSConfigUtils.loadObjectFromFile(f);\n }", "public static Properties loadProperties(String filePath)\n {\n \tProperties listProperties = new Properties();\n\t\t//System.out.println(filePath);\n\n\t\tFileInputStream file = null;\n\t\ttry \n\t\t{\n\t\t\tfile = new FileInputStream(filePath);\n\t\t\t\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry \n\t\t{\n\t\t\t listProperties.load(file);\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listProperties;\n }", "private void init(String propFilePath) {\n properties = new Properties();\n try {\n properties.load(new FileInputStream(new File(propFilePath)));\n } catch (FileNotFoundException e1) {\n logger.error(\"External properties file not found!\", e1);\n System.exit(1);\n } catch (IOException e2) {\n logger.error(\"Error while reading External properties file!\", e2);\n System.exit(1);\n }\n }", "private void loadData() {\n\n \tInputStream inputStream = this.getClass().getResourceAsStream(propertyFilePath);\n \n //Read configuration.properties file\n try {\n //prop.load(new FileInputStream(propertyFilePath));\n \tprop.load(inputStream);\n //prop.load(this.getClass().getClassLoader().getResourceAsStream(\"configuration.properties\"));\n } catch (IOException e) {\n System.out.println(\"Configuration properties file cannot be found\");\n }\n \n //Get properties from configuration.properties\n browser = prop.getProperty(\"browser\");\n testsiteurl = prop.getProperty(\"testsiteurl\");\n defaultUserName = prop.getProperty(\"defaultUserName\");\n defaultPassword = prop.getProperty(\"defaultPassword\");\n }", "public static Properties loadProperties(String name, ClassLoader loader) {\n\t\tif (name == null )\n\t\t\tthrow new IllegalArgumentException(\"null input: name\");\n\n\t\tif (name.startsWith(\"/\"))\n\t\t\tname = name.substring(1);\n\n\t\tif (name.endsWith(SUFFIX))\n\t\t\tname = name.substring(0, name.length() - SUFFIX.length());\n\n\t\tProperties result = null;\n\n\t\tInputStream in = null;\n\t\tFile propFile = new File(name);\n\n\t\ttry {\n\t\t\tif (propFile.exists()){\n\t\t\t\tin = new FileInputStream(propFile);\n\t\t\t// load a properties file\n\t\t\tresult = new Properties();\n\t\t\t\tresult.load(in);\n\t\t\tif (saveInSystem) {\n\t\t\t\tIterator iterator = result.keySet().iterator();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tString key = (String) iterator.next();\n\t\t\t\t\tString value = result.getProperty(key);\n\t\t\t\t\tSystem.getProperties().setProperty(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\tif (loader == null)\n\t\t\t\tloader = ClassLoaderResolver.getClassLoader();\n\n\t\t\tif (LOAD_AS_RESOURCE_BUNDLE) {\n\t\t\t\tname = name.replace('/', '.');\n\n\t\t\t\t// throws MissingResourceException on lookup failures:\n\t\t\t\tfinal ResourceBundle rb = ResourceBundle.getBundle(name,\n\t\t\t\t\t\tLocale.getDefault(), loader);\n\n\t\t\t\tresult = new Properties();\n\t\t\t\tfor (Enumeration<String> keys = rb.getKeys(); keys\n\t\t\t\t\t\t.hasMoreElements();) {\n\t\t\t\t\tfinal String key = (String) keys.nextElement();\n\t\t\t\t\tfinal String value = rb.getString(key);\n\t\t\t\t\tif (saveInSystem)\n\t\t\t\t\t\tSystem.getProperties().setProperty(key, value);\n\n\t\t\t\t\tresult.put(key, value);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tname = name.replace('.', '/');\n\n\t\t\t\tif (!name.endsWith(SUFFIX))\n\t\t\t\t\tname = name.concat(SUFFIX);\n\n\t\t\t\t// returns null on lookup failures:\n\t\t\t\tin = loader.getResourceAsStream(name);\n\t\t\t\tif (in != null) {\n\t\t\t\t\tresult = new Properties();\n\t\t\t\t\tresult.load(in); // can throw IOException\n\t\t\t\t\tif (saveInSystem) {\n\t\t\t\t\t\tIterator iterator = result.keySet().iterator();\n\t\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\t\tString key = (String) iterator.next();\n\t\t\t\t\t\t\tString value = result.getProperty(key);\n\t\t\t\t\t\t\tSystem.getProperties().setProperty(key, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tresult = null;\n\t\t} finally {\n\t\t\tif (in != null)\n\t\t\t\ttry {\n\t\t\t\t\tin.close();\n\t\t\t\t} catch (Throwable ignore) {\n\t\t\t\t}\n\t\t}\n\n\t\tif (THROW_ON_LOAD_FAILURE && (result == null)) {\n\t\t\tthrow new IllegalArgumentException(\"could not load [\"\n\t\t\t\t\t+ name\n\t\t\t\t\t+ \"]\"\n\t\t\t\t\t+ \" as \"\n\t\t\t\t\t+ (LOAD_AS_RESOURCE_BUNDLE ? \"a resource bundle\"\n\t\t\t\t\t\t\t: \"a classloader resource\"));\n\t\t}\n\n\t\treturn result;\n\t}", "public static Properties loadProperties(String filePath) throws MnoConfigurationException {\n\t\tProperties properties = new Properties();\n\t\tInputStream input = getInputStreamFromClassPathOrFile(filePath);\n\t\ttry {\n\t\t\tproperties.load(input);\n\t\t} catch (IOException e) {\n\t\t\tthrow new MnoConfigurationException(\"Could not load properties file: \" + filePath, e);\n\t\t}\n\t\treturn properties;\n\t}", "public static Configuration get(String fileName) {\n String confLocation = PathUtils.getProjectPath();\n try {\n URL url;\n File file = new File(confLocation, fileName);\n if (confLocation == null || !file.exists()) {\n LOG.info(\"Looking for {} in classpath\", fileName);\n url = ApplicationProperties.class.getClassLoader().getResource(fileName);\n if (url == null) {\n LOG.info(\"Looking for /{} in classpath\", fileName);\n url = ApplicationProperties.class.getClassLoader().getResource(\"/\" + fileName);\n }\n } else {\n url = file.toURI().toURL();\n }\n LOG.info(\"Loading {} from {}\", fileName, url);\n Parameters params = new Parameters();\n FileBasedConfigurationBuilder<FileBasedConfiguration> builder =\n new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)\n .configure(params.properties()\n .setURL(url));\n FileBasedConfiguration configuration = builder.getConfiguration();\n logConfiguration(configuration);\n return configuration;\n } catch (Exception e) {\n throw new HiveHookException(\"Failed to load application properties\", e);\n }\n }", "public void loadProperties(){\n\n\ttry{\n\t prop.load(file);\n // get the property value and print it out\n host = prop.getProperty(\"host\");\n\t port = prop.getProperty(\"port\");\n\t sslmode = prop.getProperty(\"sslmode\");\n\t source = prop.getProperty(\"source\");\n dbname = prop.getProperty(\"dbname\");\n help_url_prefix = prop.getProperty(\"base.help.url\");\n password = prop.getProperty(\"password\");\n\t user = prop.getProperty(\"user\");\t \n\t temp_dir = new File(System.getProperty(\"java.io.tmpdir\")).toString();\n\t working_dir = new File(System.getProperty(\"user.dir\")).toString();\n\t file.close();\n\t}catch(IOException ioe){\n\t\t\n\t} \n\t \n }", "protected Properties loadClientProperties(String filename) throws Exception {\n InputStream is = null;\n try {\n Properties props = new Properties();\n\n // Open the properties file specified by the user.\n File f = new File(filename);\n if (f.exists()) {\n is = new FileInputStream(f);\n } else {\n throw new FileNotFoundException(\"Properties file '\" + filename + \"' not found.\");\n }\n\n // Load the properties.\n props.load(is);\n is.close();\n\n return props;\n } finally {\n if (is != null) {\n is.close();\n }\n }\n }", "public static Properties getPropertiesFromPath(String fileName)\n throws PropertiesFileNotFoundException {\n\n Properties props = new Properties();\n FileInputStream fis;\n try {\n fis = new FileInputStream(fileName);\n props.load(fis);\n fis.close();\n } catch (Exception e) {\n throw new PropertiesFileNotFoundException(\n \"ERROR LOADING PROPERTIES FROM PATH >\" + fileName + \"< !!!\", e);\n }\n return props;\n }", "public final Properties readPropertiesFromFile(final String fileName)\n {\n\n if (!StringUtils.isEmpty(fileName))\n {\n return PropertyLoader.loadProperties(fileName);\n } else\n {\n return null;\n } // end if..else\n\n }", "public static Properties loadProperties(String file) throws Exception {\n Properties props = new Properties();\n props.load(new FileInputStream(file));\n\n return props;\n }", "private void loadPropertyFile(InputStream stream) throws IOException{\n\t\tproperties = new Properties();\n\t\tproperties.load(stream);\n\t}", "public static void loadConfigurationFile() throws IOException {\n\t\tFileInputStream fis= new FileInputStream(\"config.properties\");\n\t\tprop.load(fis);\n\t}", "private void initProperties()\r\n {\r\n try\r\n {\r\n properties.load(new FileInputStream(propertiesURL));\r\n }\r\n catch (IOException ex)\r\n {\r\n log.log(DEBUG,\"\"+ex);\r\n } \r\n }", "public static Properties loadProperties(String path) throws IOException {\n BufferedReader br = IOTools.asReader(path);\n Properties prop = new Properties();\n prop.load(br);\n br.close();\n return prop;\n }", "public void load(File configFile) {\n try {\n this.getProperties().load(new FileInputStream(configFile));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static Properties loadProperties(final String filename) throws IllegalArgumentException {\n final File file = new File(filename);\n final Properties properties = new Properties();\n try {\n properties.load(new FileInputStream(file));\n } catch (FileNotFoundException ex) {\n throw new IllegalArgumentException(\"File not found: \" + file, ex);\n } catch (IOException ex) {\n throw new IllegalArgumentException(\"Unable to load properties: \" + file, ex);\n }\n return properties;\n }", "public static void loadProperties() {\n properties = new Properties();\n try {\n File f = new File(\"system.properties\");\n if (!(f.exists())) {\n OutputStream out = new FileOutputStream(f);\n }\n InputStream is = new FileInputStream(f);\n properties.load(is);\n lastDir = getLastDir();\n if (lastDir == null) {\n lastDir = \"~\";\n setLastDir(lastDir);\n }\n properties.setProperty(\"lastdir\", lastDir);\n\n // Try loading properties from the file (if found)\n properties.load(is);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected SftpPropertyLoad(final String bundleFileName) {\n\n\t\tthis.bundleFileName = bundleFileName;\n\n\t\tfinal Resource res = new ClassPathResource(StringUtil.replace(bundleFileName, \".\", \"/\") + \".properties\");\n\t\tfinal EncodedResource encodedResource = new EncodedResource(res, \"UTF-8\");\n\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(encodedResource);\n\t\t} catch (IOException e) {\n\t\t\tthrow new WebRuntimeException(e);\n\t\t}\n\t}", "@Override\n public Properties loadProperties(String filename) {\n return testProperties;\n }", "void loadProperties(final String fileName){\n mProperties = new Properties();\n try {\n InputStreamReader stream = new InputStreamReader(CoreLib.getAppContext().getResources().\n getAssets().open(fileName));\n mProperties.load(stream);\n }catch (IOException e){\n throw new Error(\"Make sure you have both properties file(\" + fileName + \")present under assets\");\n }\n }", "private void loadProperties(){\n try {\n input = new FileInputStream(fileName);\n properties.load(input);\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO LOAD GAME ---\");\n e.printStackTrace();\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE INTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n }", "public static String loadProperty(String key) {\n Properties prop = new Properties();\n InputStream is;\n\n try {\n is = new FileInputStream(\"./config.properties\");\n prop.load(is);\n } catch (IOException e) {\n System.out.println(\"Error al cargar el archivo\");\n }\n\n return prop.getProperty(key);\n }", "public static Properties getProperties(String filename)\r\n/* 13: */ {\r\n/* 14:26 */ Properties properties = new Properties();\r\n/* 15: */ try\r\n/* 16: */ {\r\n/* 17:29 */ properties.load(new FileInputStream(System.getProperty(\"user.dir\") + \"/properties/\" + filename));\r\n/* 18: */ }\r\n/* 19: */ catch (IOException ex)\r\n/* 20: */ {\r\n/* 21:31 */ logger.error(\"Can't load properties file: \" + filename, ex);\r\n/* 22: */ }\r\n/* 23:33 */ return properties;\r\n/* 24: */ }", "private Properties loadProperties(String propertyFile) {\n\t\toAuthProperties = new Properties();\n\t\ttry {\n\t\t\toAuthProperties.load(App.class.getResourceAsStream(propertyFile));\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Unable to read \" + propertyFile\n\t\t\t\t\t+ \" configuration. Make sure you have a properly formatted \" + propertyFile + \" file.\");\n\t\t\treturn null;\n\t\t}\n\t\treturn oAuthProperties;\n\t}", "public static void loadProps(InputStream in) {\r\n\t\ttry {\r\n properties.load(in);\r\n } catch (IOException e) {\r\n System.out.println( \"No config.properties was found.\");\r\n e.printStackTrace();\r\n }\r\n\t}", "private static String readPropertiesFile() {\n Properties prop = new Properties();\n\n try (InputStream inputStream = MembershipService.class.getClassLoader().getResourceAsStream(\"config.properties\")) {\n\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n throw new FileNotFoundException(\"property file 'config.properties' not found in the classpath\");\n }\n } catch (Exception e) {\n return \"\";\n }\n return prop.getProperty(\"introducer\");\n }", "private Properties loadConfig(String baseFileName, String userPathParamName) throws IOException {\n\t\tString fileName = baseFileName + \".properties\";\n\t\tProperties properties = new Properties();\n\t\ttry (InputStream configStream = ApiInitializer.class.getClassLoader().getResourceAsStream(fileName)) {\n\t\t\tif (configStream != null) {\n\t\t\t\tproperties.load(configStream);\n\t\t\t}\n\t\t}\n\n\t\t// Then, override with whatever the user set up.\n\t\tString userFilePath = servletContext.getInitParameter(userPathParamName);\n\t\tif (userFilePath == null) {\n\t\t\tuserFilePath = \"WEB-INF/\" + baseFileName + \".properties\";\n\t\t} else {\n\t\t\tPath path = Paths.get(userFilePath, baseFileName + \".properties\");\n\t\t\tuserFilePath = path.toString();\n\t\t}\n\t\ttry (InputStream inStream = servletContext.getResourceAsStream(userFilePath);) {\n\t\t\tif (inStream != null) {\n\t\t\t\tproperties.load(inStream);\n\t\t\t}\n\t\t}\n\n\t\treturn properties;\n\t}", "public ConfigFile(String fileName, String encoding) {\n InputStream inputStream = null;\n try {\n inputStream = getClassLoader().getResourceAsStream(fileName); // properties.load(ConfigFile.class.getResourceAsStream(fileName));\n if (inputStream == null) {\n throw new IllegalArgumentException(\"Properties file not found in classpath: \" + fileName);\n }\n\n properties = new Properties();\n if (fileName.endsWith(\"yml\")){\n isYml = true;\n properties= new Yaml().loadAs(new InputStreamReader(inputStream, encoding),Properties.class);\n }else\n properties.load(new InputStreamReader(inputStream, encoding));\n } catch (IOException e) {\n throw new RuntimeException(\"Error loading properties file.\", e);\n } finally {\n if (inputStream != null) try {\n inputStream.close();\n } catch (IOException e) {\n LogKit.error(e.getMessage(), e);\n }\n }\n }", "protected static Properties loadFileAsProperty(File file) throws FileNotFoundException, IOException {\r\n\t\tProperties result = new Properties();\r\n\t\tresult.load(new FileReader(file));\r\n\t\treturn result;\r\n\t}", "public void read() {\n\t\tconfigfic = new Properties();\n\t\tInputStream input = ConfigReader.class.getClassLoader().getResourceAsStream(\"source/config.properties\");\n\t\t// on peut remplacer ConfigReader.class par getClass()\n\t\ttry {\n\t\t\tconfigfic.load(input);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void loadConfig(String path) throws IOException {\n \tInputStream stream = null;\n \t\n \t// Load the config\n \ttry {\n \t\t// Get the stream\n \t\ttry {\n \t\t\tstream = new FileInputStream(new File(path));\n \t\t} catch(FileNotFoundException e) {\n \t\t\tstream = NotaQL.class.getClassLoader().getResourceAsStream(path);\n \t\t}\n\n \t\tif(stream == null) {\n \t\t\tthrow new FileNotFoundException(\"Unable to find \" + path + \" in classpath.\");\n \t\t}\n\n \t\t\n \t\t// load the properties\n \t\tloadConfig(stream);\n\n \t} finally {\n \t\t// Always close the stream if any\n \t\tif (stream != null)\n \t\t\tstream.close();\n\t\t}\n }", "public Resource load(String filename) throws MalformedURLException;", "public void loadConfiguration() {\n Properties prop = new Properties();\n String propFileName = \".env_\" + this.dbmode.name().toLowerCase();\n InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\n try {\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n System.err.println(\"property file '\" + propFileName + \"' not found in the classpath\");\n }\n this.jdbc = prop.getProperty(\"jdbc\");\n this.host = prop.getProperty(\"host\");\n this.port = prop.getProperty(\"port\");\n this.database = prop.getProperty(\"database\");\n this.user = prop.getProperty(\"user\");\n this.password = prop.getProperty(\"password\");\n // this.sslFooter = prop.getProperty(\"sslFooter\");\n } catch (Exception e) {\n System.err.println(\"can't read property file\");\n }\n try {\n inputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static Properties getProperties(final String filename) throws IOException, FileNotFoundException {\r\n \r\n final Properties result = new Properties();\r\n final InputStream propertiesStream = getInputStream(filename);\r\n result.load(propertiesStream);\r\n return result;\r\n }", "public ReadPropertyFile()\n\t{\n\t prob = new Properties(); \n\t \n\t try\n\t {\n\t FileInputStream fis = new FileInputStream(\".//config.properties\");\n\t prob.load(fis);\n\t }\n\t catch(FileNotFoundException e)\n\t {\n\t\t System.out.println(e.getMessage());\n\t }\n catch(IOException e)\n\t {\n \t System.out.println(e.getMessage());\n\t }\n\t}", "public static Properties loadProperties(@NonNull String path) throws IOException {\n File file = loadFile(path);\n if(file == null){ throw new IOException(\"没有找到文件\"); }\n return ReaderUtils.loadProperties(file);\n }", "public void loadObject() {\n\n obj = new Properties();\n try {\n obj.load(new FileInputStream(\"./src/test/resources/config.properties\"));\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n public void loadConfigProperties() {\n Properties properties = new Properties();\n InputStream inputStream = null;\n try {\n String configFile = Constant.CONFIGURATION_PROPERTIES;\n inputStream = RepositoryParser.class.getClassLoader().getResourceAsStream(configFile);\n // Loading the property file\n properties.load(inputStream);\n } catch (FileNotFoundException e) {\n Log.error(\"Property file was not found\");\n } catch (IOException e) {\n Log.error(\"The key was not found in the property file\");\n } finally {\n if (inputStream != null) {\n try {\n inputStream.close();\n } catch (IOException e) {\n Log.error(\"The property file was not closed\");\n }\n }\n }\n\n // Getting the corresponding value of the key in the property file\n configPropertiesMap = new HashMap<String, String>((Map) properties);\n }", "public String fw_Read_From_Property_file(String PropertyName) throws IOException\n\t{\n\t\tProperties prop = new Properties();\n\t\tInputStream input = null;\n\t\tinput = new FileInputStream(\"config.properties\");\n\t\tprop.load(input);\n\t\treturn prop.getProperty(PropertyName);\n\n\t}", "void load() {\n\t\ttry {\n\t\t\tfinal FileInputStream fis = new FileInputStream(propertyFile);\n\t\t\tfinal Properties newProperties = new Properties();\n\t\t\tnewProperties.load(fis);\n\t\t\ttimeLastRead = propertyFile.lastModified();\n\t\t\tproperties = newProperties;\n\t\t\tfis.close();\n\t\t} catch (final Exception e) {\n\t\t\tlogger.info(\"Property file \" + propertyFile + \" \" + e.getMessage());\n\t\t}\n\t}", "private FileInputStream loadFile(String file)\n\t{\n\t\tlogger.info(\"Fetching File : \"+System.getProperty(\"user.dir\")+\"\\\\src\\\\main\\\\resources\\\\\"+file);\n\t\ttry \n\t\t{\n\t\t\treturn(new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\src\\\\main\\\\resources\\\\\"+file));\n\t\t} catch (FileNotFoundException e) {\t\t\t\t\n\t\t\tAssert.assertTrue(file+\" file is missing\", false);\n\t\t\treturn null;\n\t\t}\n\t}", "public static Properties load(String propsFile)\n {\n \tProperties props = new Properties();\n FileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(new File(propsFile));\n\t\t\tprops.load(fis); \n\t\t fis.close();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \n return props;\n }", "private void readProperties() {\n // reading config files\n if (driver == null) {\n try {\n fis = new FileInputStream(userDir + \"\\\\src\\\\main\\\\resources\\\\properties\\\\Config.properties\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n try {\n config.load(fis);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.close();\r\n\t\t\t}catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}", "private Properties loadConfigProperties() {\n \tProperties prop = new Properties();\n \tInputStream in = null;\n \ttry {\n \t\tin = this.getClass().getClassLoader().getResourceAsStream(\"resources/config.properties\");\n \t\tprop.load(in);\n \t} catch (IOException ex) {\n \t\tex.printStackTrace();\n \t} finally {\n \t\tif (in != null) {\n \t\t\ttry {\n \t\t\t\tin.close();\n \t\t\t} catch (IOException e) {\n \t\t\t\te.printStackTrace();\n \t\t\t}\n \t\t}\n \t}\n \treturn prop;\n\t}", "protected void loadProperties(ClassLoader al, URL url) {\n try (InputStream is = url.openStream()) {\n if (is == null) {\n log(\"Could not load definitions from \" + url,\n Project.MSG_WARN);\n return;\n }\n Properties props = new Properties();\n props.load(is);\n for (String key : props.stringPropertyNames()) {\n name = key;\n classname = props.getProperty(name);\n addDefinition(al, name, classname);\n }\n } catch (IOException ex) {\n throw new BuildException(ex, getLocation());\n }\n }", "public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }", "private void loadLocalConfig()\n {\n try\n {\n // Load the system config file.\n URL fUrl = Config.class.getClassLoader().getResource( PROP_FILE );\n config.setDelimiterParsingDisabled( true );\n if ( fUrl == null )\n {\n String error = \"static init: Error, null cfg file: \" + PROP_FILE;\n LOG.warn( error );\n }\n else\n {\n LOG.info( \"static init: found from: {} path: {}\", PROP_FILE, fUrl.getPath() );\n config.load( fUrl );\n LOG.info( \"static init: loading from: {}\", PROP_FILE );\n }\n\n URL fUserUrl = Config.class.getClassLoader().getResource( USER_PROP_FILE );\n if ( fUserUrl != null )\n {\n LOG.info( \"static init: found user properties from: {} path: {}\", USER_PROP_FILE, fUserUrl.getPath() );\n config.load( fUserUrl );\n }\n }\n catch ( org.apache.commons.configuration.ConfigurationException ex )\n {\n String error = \"static init: Error loading from cfg file: [\" + PROP_FILE\n + \"] ConfigurationException=\" + ex;\n LOG.error( error );\n throw new CfgRuntimeException( GlobalErrIds.FT_CONFIG_BOOTSTRAP_FAILED, error, ex );\n }\n }", "public void load(File file)\n throws FileNotFoundException, IOException, MissingRequiredTestPropertyException \n {\n\t initializeTestProperties(new BufferedInputStream(new FileInputStream(file)));\n\t}", "public static void loadProperties()\n {\n Properties props = new Properties();\n try {\n props.load( new BufferedInputStream( ClassLoader.getSystemResourceAsStream(\"bench.properties\") ) );\n } catch (IOException ioe)\n {\n logger.log(Level.SEVERE, ioe.getMessage());\n }\n props.putAll(System.getProperties()); //overwrite\n System.getProperties().putAll(props);\n }", "public static String getPropertyFromFile(String propName)throws ISException{\n InputStream inputStream;\n Properties prop = new Properties();\n try {\n inputStream = new FileInputStream(new File(System.getenv(\"conf.home\")+\"\\\\application.properties\"));\n prop.load(inputStream);\n if(prop==null){\n throw new ISException(\"getProperty: Cannot open property file!\");\n }\n return prop.getProperty(propName);\n } catch(Exception e){\n throw new ISException(\"getProperty: Cannot open property file!\");\n }\n }", "private Properties loadProperties() {\n Properties properties = new Properties();\n try {\n properties.load(getClass().getResourceAsStream(\"/config.properties\"));\n } catch (IOException e) {\n throw new WicketRuntimeException(e);\n }\n return properties;\n }", "public static void loadPropertyFile() throws IOException {\n\t\tPropertyFileReader.property = new Properties();\n\t\tPropertyFileReader.targetPlatform = System.getProperty(\"targetPlatform\");\n\t\tPropertyFileReader.targetDevice = System.getProperty(\"targetDevice\");\n\n\t\t// Load the property file based on platform and device\n\n\t\tif (PropertyFileReader.targetPlatform.equalsIgnoreCase(\"android\")) {\n\t\t\tfinal File file = new File(String.valueOf(System.getProperty(\"user.dir\"))\n\t\t\t\t\t+ \"\\\\src\\\\main\\\\resources\\\\testdata\\\\\" + PropertyFileReader.targetPlatform + \"\\\\\"\n\t\t\t\t\t+ PropertyFileReader.targetDevice + \"\\\\capabilities.properties\");\n\t\t\tPropertyFileReader.filereader = new FileReader(file);\n\t\t\tPropertyFileReader.property.load(PropertyFileReader.filereader);\n\t\t}\n\n\t\tif (PropertyFileReader.targetPlatform.equalsIgnoreCase(\"iOS\")) {\n\t\t\t// To do in case of iOS\n\t\t}\n\t}", "public HashMap<String, String> readPropertyFile(String propertyFilePath) throws Exception {\n File propertyFile = null;\n InputStream inputStream = null;\n Properties properties = null;\n HashMap<String, String> propertyMap = new HashMap<String, String>();\n try {\n\n //creating file object\n propertyFile = new File(propertyFilePath);\n\n //check if property file exists on hard drive\n if (propertyFile.exists()) {\n inputStream = new FileInputStream(propertyFile);\n // check if the file exists in web environment or relative to class path\n } else {\n inputStream = getClass().getClassLoader().getResourceAsStream(propertyFilePath);\n }\n\n if (inputStream == null) {\n throw new Exception(\"FILE NOT FOUND : inputStream = null : \" + propertyFilePath);\n }\n\n properties = new Properties();\n properties.load(inputStream);\n Enumeration enuKeys = properties.keys();\n while (enuKeys.hasMoreElements()) {\n\n String key = (String) enuKeys.nextElement();\n String value = properties.getProperty(key);\n\n //System.out.print(\"key = \"+key + \" : value = \"+value);\n propertyMap.put(key, value);\n }\n if (propertyMap == null) {\n throw new Exception(\"readPropertyFile : propertyMap = null\");\n }\n\n return propertyMap;\n } catch (Exception e) {\n throw new Exception(\"readPropertyFile : \" + e.toString());\n } finally {\n try {\n inputStream.close();\n } catch (Exception e) {\n }\n try {\n properties = null;\n } catch (Exception e) {\n }\n }\n }", "@Override\n public Map<String, String> readProperty(String fileName) {\n Map<String, String> result = new HashMap<>();\n Properties prop = new Properties();\n InputStream input;\n try {\n input = FullPropertyReader.class.getClassLoader().getResourceAsStream(fileName);\n prop.load(input);\n Set<String> strings = prop.stringPropertyNames();\n for (String string : strings) {\n result.put(string, prop.getProperty(string));\n }\n } catch (IOException e) {\n throw new PropertyReaderException(\"Trouble in FullPropertyReader\", e);\n }\n return result;\n }", "public String ReadFile_FromClassPath(String sFileName) {\n String stemp = null;\n\n try {\n InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName);\n stemp = getStringFromInputStream(is);\n\n } catch (Exception e) {\n stemp = null;\n throw new Exception(\"ReadFile_FromClassPath : \" + e.toString());\n } finally {\n return stemp;\n }\n }", "private void loadPropertiesFromFile(String propertiesFileName) {\t\t\n\t\tif ( (propertiesFileName != null) && !(propertiesFileName.isEmpty()) ) {\n\t\t\tpropertiesFileName = config_file_name;\n\t \t\ttry {\n\t \t\t\t// FileInputStream lFis = new FileInputStream(config_file_name);\n\t \t\t\t// FileInputStream lFis = getServletContext().getResourceAsStream(config_file_name);\n\t \t\t\tInputStream lFis = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"config.properties\");\n\t \t\t\tif (lFis != null) {\n\t\t \t\t\tProperties lConnectionProps = new Properties();\n\t\t \t\t\tlConnectionProps.load(lFis);\n\t\t \t\t\tlFis.close();\n\t\t \t\t\tlLogger.info(DEBUG_PREFIX + \"Using configuration file \" + config_file_name);\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceNname\") != null) ssosvc_name = lConnectionProps.getProperty(\"SsoServiceNname\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceLabel\") != null) ssosvc_label = lConnectionProps.getProperty(\"SsoServiceLabel\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServicePlan\") != null) ssosvc_plan = lConnectionProps.getProperty(\"SsoServicePlan\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_clientId = lConnectionProps.getProperty(\"SsoServiceCredential_clientId\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_secret = lConnectionProps.getProperty(\"SsoServiceCredential_secret\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_serverSupportedScope = lConnectionProps.getProperty(\"SsoServiceCredential_serverSupportedScope\");\n\t\t\tlLogger.info(DEBUG_PREFIX + \"CONFIG FILE parsing, found Scopes = \" + ssosvc_cred_serverSupportedScope + \" for service name = \" + ssosvc_name);\t\n\t\t\t Pattern seperators = Pattern.compile(\".*\\\\[ *(.*) *\\\\].*\");\n\t\t\t if (seperators != null) {\n\t\t\t \tMatcher scopeMatcher = seperators.matcher(ssosvc_cred_serverSupportedScope);\n\t\t\t\t scopeMatcher.find();\n\t\t\t\t ssosvc_cred_serverSupportedScope = scopeMatcher.group(1); // only get the first occurrence\n\t\t\t\t lLogger.info(DEBUG_PREFIX + \"CONFIG FILE parsing, retrieved first Scope = \" + ssosvc_cred_serverSupportedScope);\n\t\t\t }\n\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_issuerIdentifier = lConnectionProps.getProperty(\"SsoServiceCredential_issuerIdentifier\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_tokenEndpointUrl = lConnectionProps.getProperty(\"SsoServiceCredential_tokenEndpointUrl\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_authorizationEndpointUrl = lConnectionProps.getProperty(\"SsoServiceCredential_authorizationEndpointUrl\");\n\t\n\t\t \t\t\tlLogger.info(DEBUG_PREFIX + \"Using config for SSO Service with name \" + ssosvc_name);\n\t \t\t\t} else {\n\t \t\t\t\tlLogger.severe(DEBUG_PREFIX + \"Configuration file not found! Using default settings.\");\n\t \t\t\t}\n\n\t \t\t} catch (FileNotFoundException e) {\n\t \t\t\tlLogger.severe(DEBUG_PREFIX + \"Configuration file = \" + config_file_name + \" not found! Using default settings.\");\n\t \t\t\te.printStackTrace();\n\t \t\t} catch (IOException e) {\n\t \t\t\tlLogger.severe(\"SF-DEBUG: Configuration file = \" + config_file_name + \" not readable! Using default settings.\");\n\t \t\t\te.printStackTrace();\n\t \t\t}\n\t \t} else {\n\t \t\tlLogger.info(DEBUG_PREFIX + \"Configuration file = \" + config_file_name + \" not found! Using default settings.\");\n\t \t}\n\t}", "public GMailProperties(final String filepath, final String charsetName) throws FileNotFoundException, IOException {\r\n this.properties = new PropertyStorage(filepath, charsetName);\r\n }", "public static Properties readProperties(String filePath){\n try {\n FileInputStream fileInputStream= new FileInputStream(filePath);\n properties=new Properties();\n properties.load(fileInputStream);\n fileInputStream.close();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return properties;\n }", "public static void loadFileFromClasspath(final String aFile)\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(classLoader);\n\t\t\tfinal Resource resource = resolver.getResource(aFile);\n\t\t\tif (resource == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal InputStream inputStream = resource.getInputStream();\n\t\t\tcreateTransformer(inputStream, resource.getDescription());\n\t\t}\n\t\tcatch (final Exception e)\n\t\t{\n\t\t\tlogger.warn(\"Unable to load file \" + aFile, e);\n\t\t}\n\n\t}", "private void loadURL() throws IOException{\n\t\tLOGGER.debug(\"BEGIN\");\n\t\t\t\t\t\n\t\ttry {\n\t\t\tinitCassandra();\n\t\t\tInitialContext initCtx = new InitialContext();\n\t\t\tString location = (String) initCtx.lookup(PropertiesConstants.PROPERTY_URL_JNDI);\n\t\t\tfileInputStream = new FileInputStream(new File(location));\n\t\t\t\n\t\t\tloadPropertyFile(fileInputStream);\n\t\t\t\n\t\t\tLOGGER.debug(\"Loading Property File\" + location);\n\t\t}catch (Exception e) {\n\t\t\tLOGGER.debug(\"No JNDI Settings found. \" + e);\t\t\t\n\t\t}\n\t\tsetLogLevel(getInt(PropertiesConstants.LOG_LEVEL));\n\t\tLOGGER.debug(\"END\");\n\t}", "public ReadProperties(String filename) {\n\n\t\ttry {\n\t\t\tInputStream in = new FileInputStream(filename);\n\n\t\t\tprop = new Properties();\n\n\t\t\tprop.load(in);\n\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}", "private static synchronized void setProperties(\n final String strPropertiesFilename) {\n if (msbPropertiesLoaded) {\n Verbose.warning(\"Properties already loaded; ignoring request\");\n\n return;\n }\n\n File oFile = new File(strPropertiesFilename);\n\n if (!oFile.exists()) {\n // Try to get it from jar file\n ClassLoader classLoader = Thread.currentThread()\n .getContextClassLoader();\n final InputStream input;\n\n if (classLoader == null) {\n classLoader = Class.class.getClassLoader();\n }\n input = classLoader\n .getResourceAsStream('/' + strPropertiesFilename);\n PropertyDef.setProperties(input, null);\n } else {\n PropertyDef.setProperties(new File(strPropertiesFilename), null,\n false);\n }\n if (strPropertiesFilename == DEFAULT_PROPERTIES_FILENAME) {\n oFile = new File(CUSTOMER_PROPERTIES_FILENAME);\n if (oFile.exists() && oFile.isFile()) {\n PropertyDef.addProperties(oFile);\n }\n }\n AdaptiveReplicationTool.msbPropertiesLoaded = true;\n }", "private void loadProperties() {\n Path path = getSamplePropertiesPath();\n LOG.info(\"Loading Properties from {}\", path.toString());\n try {\n FileInputStream fis = new FileInputStream(getSamplePropertiesPath().toFile());\n Properties properties = new Properties();\n properties.load(fis);\n\n String privateKey = properties.getProperty(PRIVATE_KEY);\n this.credentials = Credentials.create(privateKey);\n this.contract1Address = properties.getProperty(CONTRACT1_ADDRESS);\n this.contract2Address = properties.getProperty(CONTRACT2_ADDRESS);\n this.contract3Address = properties.getProperty(CONTRACT3_ADDRESS);\n this.contract4Address = properties.getProperty(CONTRACT4_ADDRESS);\n this.contract5Address = properties.getProperty(CONTRACT5_ADDRESS);\n this.contract6Address = properties.getProperty(CONTRACT6_ADDRESS);\n\n } catch (IOException ioEx) {\n // By the time we have reached the loadProperties method, we should be sure the file\n // exists. As such, just throw an exception to stop.\n throw new RuntimeException(ioEx);\n }\n }", "public static Properties load(File file) {\n\t\ttry {\n\t\t\tif (file != null && file.exists()) {\n\t\t\t\treturn load(new FileInputStream(file));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void loadProperties() throws IOException\n\t{\n\t\tFile src = new File(\"D://Selenium Stuff//Selenium Workspace//OpenCartL2_28112017//ObjectRepo.properties\");\n\t\tFileInputStream fis = new FileInputStream(src);\n\t\tpro = new Properties();\n\t\tpro.load(fis);\n\t}", "public ReadConfigFile (){\n\t\ttry {\n\t\t\tinput = ReadConfigFile.class.getClassLoader().getResourceAsStream(Constant.CONFIG_PROPERTIES_DIRECTORY);\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch ( IOException e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t}", "public static Properties readPropertiesFile(String path) {\n\n\t\tProperties propFile = new Properties();\n\t\ttry {\n\t\t\tpropFile.load(new FileInputStream(path));\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error Reading Properties File\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn propFile;\n\t}", "public static Properties readPropertyFile(String fileName) {\n\t\tProperties properties = new Properties();\n\t\tFileInputStream in = null;\n\t\ttry {\n\t\t\tin = new FileInputStream(fileName);\n\t\t\tproperties.load(in);\n\t\t} catch (IOException e) {\n\t\t\tLOG.error(\"cannot read property file \" + fileName);\n\t\t\tSystem.exit(-1);\n\t\t} finally {\n\t\t\tif (in != null) {\n\t\t\t\ttry {\n\t\t\t\t\tin.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLOG.error(e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn properties;\n\t}", "File getPropertiesFile();", "public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void load(Path fileName) throws IOException {\n try(BufferedReader reader = Files.newBufferedReader(fileName)) {\n String line = \"\";\n\n // Matches lines with the format:\n // key=value\n // where the key is any sequence of lowercase letters. (a to z)\n // where value may be any letters from a to z (case insensitive) 0 to 9 or the letters '-' and '.'.\n Pattern validLine = Pattern.compile(\"^(?<key>[a-z]+)=(?<value>[a-zA-Z0-9-.]+)$\");\n\n // Read the file line by line\n while((line = reader.readLine()) != null) {\n if(line.startsWith(\";\")) { // Ignore lines that start with ;\n continue;\n }\n\n // Remove any whitespace\n line = line.trim();\n\n // Continue if our line is empty\n if(\"\".equals(line)) {\n continue;\n }\n\n Matcher matcher = validLine.matcher(line);\n\n if(!matcher.matches() || matcher.groupCount() != 2) {\n System.err.println(\"Unable to parse line: \" + line);\n continue;\n }\n\n String key = matcher.group(\"key\");\n String value = matcher.group(\"value\");\n\n map.put(key, value);\n }\n }\n }", "public Properties loadProps(String propFile) {\n Properties props = new Properties();\n BufferedReader f;\n try {\n f = new BufferedReader(new FileReader(propFile));\n } catch (FileNotFoundException e) {\n return null;\n }\n try {\n props.load(f);\n } catch (IOException e) {\n System.err.println(\"IO EXception in loadProps in EvalModels class\");\n }\n System.out.println(props.toString());\n return props;\n }", "private static void loadPropertiesFromURL(String url, Properties properties) {\n \t\tif(url == null) throw new IllegalArgumentException(\"url cannot be null\");\n \t\tif(properties == null) throw new IllegalArgumentException(\"properties cannot be null\");\n \t\tURL propertiesLocation;\n \t\ttry {\n \t\t\tpropertiesLocation = new URL(url);\n \t\t} catch (MalformedURLException e1) {\n \t\t\tthrow new IllegalArgumentException(\"Could not load property file from url: \"+url, e1);\n \t\t}\n \t\ttry {\n \t\t\tproperties.load(propertiesLocation.openStream());\n \t\t} catch (Exception e) {\n \t\t\tthrow new Error(e);\n \t\t}\n \t}", "public static Properties load(String basedir)\n throws Exception {\n if (!basedir.endsWith(File.separator)) {\n basedir = basedir + File.separator;\n }\n \n Properties prop = null;\n String amConfigProperties = basedir +\n SetupConstants.AMCONFIG_PROPERTIES;\n File file = new File(amConfigProperties);\n if (file.exists()) {\n prop = new Properties();\n InputStream propIn = new FileInputStream(amConfigProperties);\n try {\n prop.load(propIn);\n } finally {\n propIn.close();\n }\n } else {\n isBootstrap = true;\n String bootstrapFile = basedir + BOOTSTRAP;\n String urlBootstrap = readFile(bootstrapFile);\n prop = getConfiguration(urlBootstrap, true);\n }\n \n return prop;\n }", "@PostConstruct\n\tpublic void loadProperties() {\n\t\tproperties.put(PropertyKey.TRANSLATION_FILE_STORE, \"C:\\\\development\\\\projects\\\\mega-translator\\\\store\");\n\t}", "public static Properties loadProperties(@NonNull File file) throws IOException {\n FileInputStream fileInputStream = new FileInputStream(file);\n Properties properties = new Properties();\n properties.load(fileInputStream);\n return properties;\n }", "void setKarafPropertiesFileLocation(String propFile);", "private static String loadPropertiesFileByEnvironement(String propertiesPath) {\n\t\t\tSystem.setProperty(\"ENV\", \"dev\");\n\t\tString env = System.getProperty(\"ENV\");\n\t\tString [] ts = propertiesPath.split(\"/\");\n\t\tfor(int i = 0;i<ts.length;i++){\n\t\t\tif(ts[i].contains(\".cfg.\")){\n\t\t\t\tts[i] = env+\"_\"+ts[i];\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tString newPathProperties = \"\";\n\t\tfor(String s : ts)\n\t\t\tnewPathProperties=newPathProperties +\"/\"+s;\n\t\tnewPathProperties = newPathProperties.substring(1,newPathProperties.length());\n\t\treturn newPathProperties;\n\t}", "public Properties loadConfig(){\n\t\tprintln(\"Begin loadConfig \");\n\t\tProperties prop = null;\n\t\t prop = new Properties();\n\t\ttry {\n\t\t\t\n\t\t\tprop.load(new FileInputStream(APIConstant.configFullPath));\n\n\t } catch (Exception ex) {\n\t ex.printStackTrace();\n\t println(\"Exception \"+ex.toString());\n\t \n\t }\n\t\tprintln(\"End loadConfig \");\n\t\treturn prop;\n\t\t\n\t}" ]
[ "0.74327856", "0.72128356", "0.7185454", "0.7042593", "0.70348173", "0.70325404", "0.6881861", "0.67785746", "0.671196", "0.6656841", "0.66313773", "0.65736413", "0.6560033", "0.6559879", "0.65591973", "0.6527644", "0.6513106", "0.6463022", "0.6449587", "0.64240324", "0.64063454", "0.639672", "0.6377322", "0.6353227", "0.63517815", "0.63381", "0.6335675", "0.63343245", "0.63290715", "0.63024795", "0.62931067", "0.6292637", "0.6274359", "0.6274106", "0.62627816", "0.62426084", "0.62276", "0.6217697", "0.6213807", "0.6208116", "0.62026066", "0.6200352", "0.6199382", "0.6194322", "0.6168603", "0.6141983", "0.6139536", "0.61321425", "0.61216617", "0.61192685", "0.60977435", "0.60501677", "0.6048475", "0.603196", "0.6029903", "0.60262084", "0.6016808", "0.6013206", "0.599849", "0.5984602", "0.5982069", "0.59714204", "0.5967598", "0.59663236", "0.5965555", "0.59628385", "0.59582955", "0.5950346", "0.59446436", "0.5937594", "0.59250015", "0.5924537", "0.59073275", "0.5893928", "0.58893937", "0.5880146", "0.5879388", "0.587614", "0.58583325", "0.5839499", "0.5834539", "0.58338183", "0.58336544", "0.5830708", "0.5828774", "0.582378", "0.5823097", "0.5808851", "0.5790091", "0.5783278", "0.5768367", "0.5757251", "0.5753767", "0.5738793", "0.57292795", "0.5728367", "0.57174134", "0.5709643", "0.56833893", "0.5667396" ]
0.72214925
1
Loads a Properties file from the given file name
public static Properties getPropertiesFromPath(String fileName) throws PropertiesFileNotFoundException { Properties props = new Properties(); FileInputStream fis; try { fis = new FileInputStream(fileName); props.load(fis); fis.close(); } catch (Exception e) { throw new PropertiesFileNotFoundException( "ERROR LOADING PROPERTIES FROM PATH >" + fileName + "< !!!", e); } return props; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadPropertyFile(String filename) {\n try (InputStream is = new FileInputStream(filename)) {\n properties.load(is);\n } catch (IOException x) {\n throw new IllegalArgumentException(x);\n }\n }", "private static void loadPropertiesFile() {\n checkNotNull(propertyFileName, \"propertyFileName cannot be null\");\n String currentDir = new File(\"\").getAbsolutePath();\n propertyFile = currentDir + \"/\" + propertyFileName;\n File propFile = new File(propertyFile);\n try {\n propFile.createNewFile();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n\n props = new Properties();\n try {\n FileInputStream fis = new FileInputStream(propertyFile);\n props.load(fis);\n fis.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }", "public static void loadProperties(String filename) {\n\n if (filename.equals(\"\")) {\n return;\n }\n propfilename = userhome + FS + filename;\n File f = new File(propfilename);\n if (f.exists()) {\n //loadProperties(propfilename);\n } else {\n propfilename = userhome + FS + \"Properties\" + FS + filename;\n f = new File(propfilename);\n if (f.exists()) {\n //loadProperties(propfilename);\n }\n }\n\n try {\n try (FileInputStream i = new FileInputStream(propfilename)) {\n prop.load(i);\n //prtProperties();\n }\n } catch (FileNotFoundException e) {\n System.out.println(\" ** Properties file not found=\" + propfilename + \" userhome=\" + userhome + \" \" + System.getProperty(\"user.home\"));\n saveProperties();\n } catch (IOException e) {\n System.out.println(\"IOException reading properties file=\" + propfilename);\n System.exit(1);\n }\n }", "public static void loadProperties(Properties p, String fileName)throws IOException {\n ClassLoader classLoader = ClassLoader.getSystemClassLoader();\n URL f = classLoader.getResource(fileName);\n FileInputStream fr = new FileInputStream(new File(fileName));\n p.load(fr);\n fr.close();\n }", "private Properties loadProperties(String fileName){\r\n\t\t\r\n\t\tProperties prop = new Properties();\r\n\t\tInputStream input = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tinput = new FileInputStream(fileName);\r\n\t\t\tprop.load(input);\r\n\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (input != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tinput.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prop;\t \r\n\t}", "private void loadPropertiesFile(String propertiesFile) {\n\n\t\t//open the properties file.\n\t\t_props = new Properties();\n\n\t\t//sanity check the properties file\n\t\tFile f = new File(propertiesFile);\n\t\tif (!f.canRead()) {\n\t\t\t//print an error - can't read the props file.\n\t\t\tSystem.err.println(\"Properties file \" + propertiesFile + \" cannot be read.\");\n\t\t}\n\n\t\ttry {\n\t\t\t_props.load(new FileInputStream(f));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final void loadPropertiesFromFile(final String fileName)\n {\n\n Properties tempProp = PropertyLoader.loadProperties(fileName);\n fProp.putAll(tempProp);\n\n }", "void loadProperties(final String fileName){\n mProperties = new Properties();\n try {\n InputStreamReader stream = new InputStreamReader(CoreLib.getAppContext().getResources().\n getAssets().open(fileName));\n mProperties.load(stream);\n }catch (IOException e){\n throw new Error(\"Make sure you have both properties file(\" + fileName + \")present under assets\");\n }\n }", "private Properties loadPropertiesFile(String file) {\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(file);\n\t\t\tif (fis != null) {\n\t\t\t\tProperties props = new Properties();\n\t\t\t\tprops.load(fis);\n\t\t\t\treturn props;\n\t\t\t}\n\t\t\tSystem.err.println(\"Cannot load \" + file\n\t\t\t\t\t+ \" , file input stream object is null\");\n\t\t} catch (java.io.IOException ioe) {\n\t\t\tSystem.err.println(\"Cannot load \" + file + \", error reading file\");\n\t\t}\n\t\treturn null;\n\t}", "private void loadProperties(){\n try {\n input = new FileInputStream(fileName);\n properties.load(input);\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO LOAD GAME ---\");\n e.printStackTrace();\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE INTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n }", "public void load(String fileName)\n throws FileNotFoundException, IOException, MissingRequiredTestPropertyException\n {\n\t\tinitializeTestProperties(new BufferedInputStream(new FileInputStream(fileName)));\n\t}", "public static void loadPropertyFile() {\r\n\t\t\r\n\t\tif (loaded) {\r\n\t\t\tthrow new IllegalStateException(\"Properties have already been loaded!\"); \r\n\t\t}\r\n\t\tloaded = true; \r\n\t\t\r\n\t\t// if property file was specified, use it instead of standard property\r\n\t\t// file\r\n\r\n\t\tString file = STANDARD_PROPERTY_FILE;\r\n\r\n\t\tif (System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE) != null\r\n\t\t\t\t&& System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE)\r\n\t\t\t\t\t\t.length() != 0) {\r\n\t\t\tfile = System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE);\r\n\t\t}\r\n\r\n\t\t// load property file\r\n\t\ttry {\r\n\t\t\tProperties props = System.getProperties();\r\n\t\t\tprops.load(ClassLoader.getSystemResourceAsStream(file));\r\n\t\t\tSystem.setProperties(props);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t}\r\n\r\n\t}", "private static Properties readPropertiesFile(String fileName) throws IOException\n {\n LOG.log(Level.FINE, \"Searching for {0} file...\", fileName);\n try (final InputStream stream = SmartProperties.class.getClassLoader().getResourceAsStream(fileName))\n {\n Properties properties = new Properties();\n properties.load(stream);\n LOG.log(Level.FINE, \"{0} loaded successfully\", fileName);\n return properties;\n }\n }", "void loadPropertiesFile()\n\t{\n\t\tlogger.info(\"Fetching the properties files\");\n\t\t\n\t\tconfigProp=new Properties(); \n\t\ttry{\tconfigProp.load(loadFile(\"Config.properties\"));\t\t} \n\t\tcatch (IOException e){\tAssert.assertTrue(\"Cannot initialise the Config properties file, Check if the file is corrupted\", false);\t}\t\t\t\n\t}", "public static Properties loadProperties(final String filename) throws IllegalArgumentException {\n final File file = new File(filename);\n final Properties properties = new Properties();\n try {\n properties.load(new FileInputStream(file));\n } catch (FileNotFoundException ex) {\n throw new IllegalArgumentException(\"File not found: \" + file, ex);\n } catch (IOException ex) {\n throw new IllegalArgumentException(\"Unable to load properties: \" + file, ex);\n }\n return properties;\n }", "private void loadProperties() {\n try (InputStream in = getClass().getClassLoader().getResourceAsStream(PATH_TO_PROPERTIES)) {\n this.prs.load(in);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }", "@SuppressWarnings(\"unchecked\")\n private void loadProperties()\n {\n File f = getPropertiesFile();\n if (!f.exists())\n return;\n \n m_props = (Map<String, Object>) PSConfigUtils.loadObjectFromFile(f);\n }", "public Properties loadPropertiesFromFile(String path) {\n\n\t\ttry {\n\t\t\tInputStream fileInputStream = PropertyUtil.class\n\t\t\t\t\t.getResourceAsStream(path);\n\t\t\tproperties.load(fileInputStream);\n\t\t\tfileInputStream.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn properties;\n\t}", "@Override\n public Properties loadProperties(String filename) {\n return testProperties;\n }", "public String fw_Read_From_Property_file(String PropertyName) throws IOException\n\t{\n\t\tProperties prop = new Properties();\n\t\tInputStream input = null;\n\t\tinput = new FileInputStream(\"config.properties\");\n\t\tprop.load(input);\n\t\treturn prop.getProperty(PropertyName);\n\n\t}", "public final Properties readPropertiesFromFile(final String fileName)\n {\n\n if (!StringUtils.isEmpty(fileName))\n {\n return PropertyLoader.loadProperties(fileName);\n } else\n {\n return null;\n } // end if..else\n\n }", "public static void load() {\n try {\n File confFile = SessionService.getConfFileByPath(Const.FILE_CONFIGURATION);\n UtilSystem.recoverFileIfRequired(confFile);\n // Conf file doesn't exist at first launch\n if (confFile.exists()) {\n // Now read the conf file\n InputStream str = new FileInputStream(confFile);\n try {\n properties.load(str);\n } finally {\n str.close();\n }\n }\n } catch (Exception e) {\n Log.error(e);\n Messages.showErrorMessage(114);\n }\n }", "public static Properties loadProperties(String file) throws Exception {\n Properties props = new Properties();\n props.load(new FileInputStream(file));\n\n return props;\n }", "private void loadPropertyFile(InputStream stream) throws IOException{\n\t\tproperties = new Properties();\n\t\tproperties.load(stream);\n\t}", "private static Properties getProperties(final String filename) throws IOException, FileNotFoundException {\r\n \r\n final Properties result = new Properties();\r\n final InputStream propertiesStream = getInputStream(filename);\r\n result.load(propertiesStream);\r\n return result;\r\n }", "protected Properties loadClientProperties(String filename) throws Exception {\n InputStream is = null;\n try {\n Properties props = new Properties();\n\n // Open the properties file specified by the user.\n File f = new File(filename);\n if (f.exists()) {\n is = new FileInputStream(f);\n } else {\n throw new FileNotFoundException(\"Properties file '\" + filename + \"' not found.\");\n }\n\n // Load the properties.\n props.load(is);\n is.close();\n\n return props;\n } finally {\n if (is != null) {\n is.close();\n }\n }\n }", "public void loadProperties(){\n\n\ttry{\n\t prop.load(file);\n // get the property value and print it out\n host = prop.getProperty(\"host\");\n\t port = prop.getProperty(\"port\");\n\t sslmode = prop.getProperty(\"sslmode\");\n\t source = prop.getProperty(\"source\");\n dbname = prop.getProperty(\"dbname\");\n help_url_prefix = prop.getProperty(\"base.help.url\");\n password = prop.getProperty(\"password\");\n\t user = prop.getProperty(\"user\");\t \n\t temp_dir = new File(System.getProperty(\"java.io.tmpdir\")).toString();\n\t working_dir = new File(System.getProperty(\"user.dir\")).toString();\n\t file.close();\n\t}catch(IOException ioe){\n\t\t\n\t} \n\t \n }", "public static Properties loadProperties(String filePath)\n {\n \tProperties listProperties = new Properties();\n\t\t//System.out.println(filePath);\n\n\t\tFileInputStream file = null;\n\t\ttry \n\t\t{\n\t\t\tfile = new FileInputStream(filePath);\n\t\t\t\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry \n\t\t{\n\t\t\t listProperties.load(file);\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listProperties;\n }", "void load() {\n\t\ttry {\n\t\t\tfinal FileInputStream fis = new FileInputStream(propertyFile);\n\t\t\tfinal Properties newProperties = new Properties();\n\t\t\tnewProperties.load(fis);\n\t\t\ttimeLastRead = propertyFile.lastModified();\n\t\t\tproperties = newProperties;\n\t\t\tfis.close();\n\t\t} catch (final Exception e) {\n\t\t\tlogger.info(\"Property file \" + propertyFile + \" \" + e.getMessage());\n\t\t}\n\t}", "public ReadProperties(String filename) {\n\n\t\ttry {\n\t\t\tInputStream in = new FileInputStream(filename);\n\n\t\t\tprop = new Properties();\n\n\t\t\tprop.load(in);\n\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 static Properties getProperties(String filename)\r\n/* 13: */ {\r\n/* 14:26 */ Properties properties = new Properties();\r\n/* 15: */ try\r\n/* 16: */ {\r\n/* 17:29 */ properties.load(new FileInputStream(System.getProperty(\"user.dir\") + \"/properties/\" + filename));\r\n/* 18: */ }\r\n/* 19: */ catch (IOException ex)\r\n/* 20: */ {\r\n/* 21:31 */ logger.error(\"Can't load properties file: \" + filename, ex);\r\n/* 22: */ }\r\n/* 23:33 */ return properties;\r\n/* 24: */ }", "private Properties loadProperties(String propertyFile) {\n\t\toAuthProperties = new Properties();\n\t\ttry {\n\t\t\toAuthProperties.load(App.class.getResourceAsStream(propertyFile));\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Unable to read \" + propertyFile\n\t\t\t\t\t+ \" configuration. Make sure you have a properly formatted \" + propertyFile + \" file.\");\n\t\t\treturn null;\n\t\t}\n\t\treturn oAuthProperties;\n\t}", "public void load(File configFile) {\n try {\n this.getProperties().load(new FileInputStream(configFile));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected static Properties loadFileAsProperty(File file) throws FileNotFoundException, IOException {\r\n\t\tProperties result = new Properties();\r\n\t\tresult.load(new FileReader(file));\r\n\t\treturn result;\r\n\t}", "public static Properties readPropertyFile(String fileName) {\n\t\tProperties properties = new Properties();\n\t\tFileInputStream in = null;\n\t\ttry {\n\t\t\tin = new FileInputStream(fileName);\n\t\t\tproperties.load(in);\n\t\t} catch (IOException e) {\n\t\t\tLOG.error(\"cannot read property file \" + fileName);\n\t\t\tSystem.exit(-1);\n\t\t} finally {\n\t\t\tif (in != null) {\n\t\t\t\ttry {\n\t\t\t\t\tin.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLOG.error(e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn properties;\n\t}", "public static Properties loadProperties(String name, ClassLoader loader) {\n\t\tif (name == null )\n\t\t\tthrow new IllegalArgumentException(\"null input: name\");\n\n\t\tif (name.startsWith(\"/\"))\n\t\t\tname = name.substring(1);\n\n\t\tif (name.endsWith(SUFFIX))\n\t\t\tname = name.substring(0, name.length() - SUFFIX.length());\n\n\t\tProperties result = null;\n\n\t\tInputStream in = null;\n\t\tFile propFile = new File(name);\n\n\t\ttry {\n\t\t\tif (propFile.exists()){\n\t\t\t\tin = new FileInputStream(propFile);\n\t\t\t// load a properties file\n\t\t\tresult = new Properties();\n\t\t\t\tresult.load(in);\n\t\t\tif (saveInSystem) {\n\t\t\t\tIterator iterator = result.keySet().iterator();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tString key = (String) iterator.next();\n\t\t\t\t\tString value = result.getProperty(key);\n\t\t\t\t\tSystem.getProperties().setProperty(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\tif (loader == null)\n\t\t\t\tloader = ClassLoaderResolver.getClassLoader();\n\n\t\t\tif (LOAD_AS_RESOURCE_BUNDLE) {\n\t\t\t\tname = name.replace('/', '.');\n\n\t\t\t\t// throws MissingResourceException on lookup failures:\n\t\t\t\tfinal ResourceBundle rb = ResourceBundle.getBundle(name,\n\t\t\t\t\t\tLocale.getDefault(), loader);\n\n\t\t\t\tresult = new Properties();\n\t\t\t\tfor (Enumeration<String> keys = rb.getKeys(); keys\n\t\t\t\t\t\t.hasMoreElements();) {\n\t\t\t\t\tfinal String key = (String) keys.nextElement();\n\t\t\t\t\tfinal String value = rb.getString(key);\n\t\t\t\t\tif (saveInSystem)\n\t\t\t\t\t\tSystem.getProperties().setProperty(key, value);\n\n\t\t\t\t\tresult.put(key, value);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tname = name.replace('.', '/');\n\n\t\t\t\tif (!name.endsWith(SUFFIX))\n\t\t\t\t\tname = name.concat(SUFFIX);\n\n\t\t\t\t// returns null on lookup failures:\n\t\t\t\tin = loader.getResourceAsStream(name);\n\t\t\t\tif (in != null) {\n\t\t\t\t\tresult = new Properties();\n\t\t\t\t\tresult.load(in); // can throw IOException\n\t\t\t\t\tif (saveInSystem) {\n\t\t\t\t\t\tIterator iterator = result.keySet().iterator();\n\t\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\t\tString key = (String) iterator.next();\n\t\t\t\t\t\t\tString value = result.getProperty(key);\n\t\t\t\t\t\t\tSystem.getProperties().setProperty(key, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tresult = null;\n\t\t} finally {\n\t\t\tif (in != null)\n\t\t\t\ttry {\n\t\t\t\t\tin.close();\n\t\t\t\t} catch (Throwable ignore) {\n\t\t\t\t}\n\t\t}\n\n\t\tif (THROW_ON_LOAD_FAILURE && (result == null)) {\n\t\t\tthrow new IllegalArgumentException(\"could not load [\"\n\t\t\t\t\t+ name\n\t\t\t\t\t+ \"]\"\n\t\t\t\t\t+ \" as \"\n\t\t\t\t\t+ (LOAD_AS_RESOURCE_BUNDLE ? \"a resource bundle\"\n\t\t\t\t\t\t\t: \"a classloader resource\"));\n\t\t}\n\n\t\treturn result;\n\t}", "public static Properties loadResource(String propertyName) throws IOException {\n Properties properties = new Properties();\n InputStream in = Configuration.class.getClassLoader().getResourceAsStream(propertyName);\n try {\n if (null == in) {\n String path = propertyName.replace('/', separatorChar);\n path = path.replace('\\\\', separatorChar);\n if (!path.startsWith(File.separator)) {\n path = separatorChar + path;\n }\n File configurationFile = new File(ConfigurationHolder.getHome() + separatorChar\n + \"properties\" + path);\n if (configurationFile.exists()) {\n in = new FileInputStream(configurationFile);\n }\n }\n if (null != in) {\n properties.load(in);\n }\n } finally {\n IOUtils.closeQuietly(in);\n }\n return properties;\n }", "public GMailProperties(final String filepath, final String charsetName) throws FileNotFoundException, IOException {\r\n this.properties = new PropertyStorage(filepath, charsetName);\r\n }", "public static Properties load(String propsFile)\n {\n \tProperties props = new Properties();\n FileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(new File(propsFile));\n\t\t\tprops.load(fis); \n\t\t fis.close();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \n return props;\n }", "private void init(String propFilePath) {\n properties = new Properties();\n try {\n properties.load(new FileInputStream(new File(propFilePath)));\n } catch (FileNotFoundException e1) {\n logger.error(\"External properties file not found!\", e1);\n System.exit(1);\n } catch (IOException e2) {\n logger.error(\"Error while reading External properties file!\", e2);\n System.exit(1);\n }\n }", "@Override\n public Map<String, String> readProperty(String fileName) {\n Map<String, String> result = new HashMap<>();\n Properties prop = new Properties();\n InputStream input;\n try {\n input = FullPropertyReader.class.getClassLoader().getResourceAsStream(fileName);\n prop.load(input);\n Set<String> strings = prop.stringPropertyNames();\n for (String string : strings) {\n result.put(string, prop.getProperty(string));\n }\n } catch (IOException e) {\n throw new PropertyReaderException(\"Trouble in FullPropertyReader\", e);\n }\n return result;\n }", "public static Properties loadProperties(String path) throws IOException {\n BufferedReader br = IOTools.asReader(path);\n Properties prop = new Properties();\n prop.load(br);\n br.close();\n return prop;\n }", "private static ConfigImpl loadProperties(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 = loadProperties(reader);\n }\n }\n return ret;\n }", "void setPropertiesFile(File file);", "public static String loadProperty(String key) {\n Properties prop = new Properties();\n InputStream is;\n\n try {\n is = new FileInputStream(\"./config.properties\");\n prop.load(is);\n } catch (IOException e) {\n System.out.println(\"Error al cargar el archivo\");\n }\n\n return prop.getProperty(key);\n }", "private void loadData() {\n\n \tInputStream inputStream = this.getClass().getResourceAsStream(propertyFilePath);\n \n //Read configuration.properties file\n try {\n //prop.load(new FileInputStream(propertyFilePath));\n \tprop.load(inputStream);\n //prop.load(this.getClass().getClassLoader().getResourceAsStream(\"configuration.properties\"));\n } catch (IOException e) {\n System.out.println(\"Configuration properties file cannot be found\");\n }\n \n //Get properties from configuration.properties\n browser = prop.getProperty(\"browser\");\n testsiteurl = prop.getProperty(\"testsiteurl\");\n defaultUserName = prop.getProperty(\"defaultUserName\");\n defaultPassword = prop.getProperty(\"defaultPassword\");\n }", "File getPropertiesFile();", "protected SftpPropertyLoad(final String bundleFileName) {\n\n\t\tthis.bundleFileName = bundleFileName;\n\n\t\tfinal Resource res = new ClassPathResource(StringUtil.replace(bundleFileName, \".\", \"/\") + \".properties\");\n\t\tfinal EncodedResource encodedResource = new EncodedResource(res, \"UTF-8\");\n\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(encodedResource);\n\t\t} catch (IOException e) {\n\t\t\tthrow new WebRuntimeException(e);\n\t\t}\n\t}", "public void load(File file)\n throws FileNotFoundException, IOException, MissingRequiredTestPropertyException \n {\n\t initializeTestProperties(new BufferedInputStream(new FileInputStream(file)));\n\t}", "private void initProperties()\r\n {\r\n try\r\n {\r\n properties.load(new FileInputStream(propertiesURL));\r\n }\r\n catch (IOException ex)\r\n {\r\n log.log(DEBUG,\"\"+ex);\r\n } \r\n }", "public static Properties readProperties(String filePath){\n try {\n FileInputStream fileInputStream= new FileInputStream(filePath);\n properties=new Properties();\n properties.load(fileInputStream);\n fileInputStream.close();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return properties;\n }", "private void load(Path fileName) throws IOException {\n try(BufferedReader reader = Files.newBufferedReader(fileName)) {\n String line = \"\";\n\n // Matches lines with the format:\n // key=value\n // where the key is any sequence of lowercase letters. (a to z)\n // where value may be any letters from a to z (case insensitive) 0 to 9 or the letters '-' and '.'.\n Pattern validLine = Pattern.compile(\"^(?<key>[a-z]+)=(?<value>[a-zA-Z0-9-.]+)$\");\n\n // Read the file line by line\n while((line = reader.readLine()) != null) {\n if(line.startsWith(\";\")) { // Ignore lines that start with ;\n continue;\n }\n\n // Remove any whitespace\n line = line.trim();\n\n // Continue if our line is empty\n if(\"\".equals(line)) {\n continue;\n }\n\n Matcher matcher = validLine.matcher(line);\n\n if(!matcher.matches() || matcher.groupCount() != 2) {\n System.err.println(\"Unable to parse line: \" + line);\n continue;\n }\n\n String key = matcher.group(\"key\");\n String value = matcher.group(\"value\");\n\n map.put(key, value);\n }\n }\n }", "public ReadPropertyFile()\n\t{\n\t prob = new Properties(); \n\t \n\t try\n\t {\n\t FileInputStream fis = new FileInputStream(\".//config.properties\");\n\t prob.load(fis);\n\t }\n\t catch(FileNotFoundException e)\n\t {\n\t\t System.out.println(e.getMessage());\n\t }\n catch(IOException e)\n\t {\n \t System.out.println(e.getMessage());\n\t }\n\t}", "public ConfigFile(String fileName, String encoding) {\n InputStream inputStream = null;\n try {\n inputStream = getClassLoader().getResourceAsStream(fileName); // properties.load(ConfigFile.class.getResourceAsStream(fileName));\n if (inputStream == null) {\n throw new IllegalArgumentException(\"Properties file not found in classpath: \" + fileName);\n }\n\n properties = new Properties();\n if (fileName.endsWith(\"yml\")){\n isYml = true;\n properties= new Yaml().loadAs(new InputStreamReader(inputStream, encoding),Properties.class);\n }else\n properties.load(new InputStreamReader(inputStream, encoding));\n } catch (IOException e) {\n throw new RuntimeException(\"Error loading properties file.\", e);\n } finally {\n if (inputStream != null) try {\n inputStream.close();\n } catch (IOException e) {\n LogKit.error(e.getMessage(), e);\n }\n }\n }", "public static Properties loadProperties(@NonNull File file) throws IOException {\n FileInputStream fileInputStream = new FileInputStream(file);\n Properties properties = new Properties();\n properties.load(fileInputStream);\n return properties;\n }", "public static Properties loadProperties(String filePath) throws MnoConfigurationException {\n\t\tProperties properties = new Properties();\n\t\tInputStream input = getInputStreamFromClassPathOrFile(filePath);\n\t\ttry {\n\t\t\tproperties.load(input);\n\t\t} catch (IOException e) {\n\t\t\tthrow new MnoConfigurationException(\"Could not load properties file: \" + filePath, e);\n\t\t}\n\t\treturn properties;\n\t}", "public void\tload(String fileName) throws IOException;", "public void loadProperties() throws IOException\n\t{\n\t\tFile src = new File(\"D://Selenium Stuff//Selenium Workspace//OpenCartL2_28112017//ObjectRepo.properties\");\n\t\tFileInputStream fis = new FileInputStream(src);\n\t\tpro = new Properties();\n\t\tpro.load(fis);\n\t}", "public static void loadProperties() {\n properties = new Properties();\n try {\n File f = new File(\"system.properties\");\n if (!(f.exists())) {\n OutputStream out = new FileOutputStream(f);\n }\n InputStream is = new FileInputStream(f);\n properties.load(is);\n lastDir = getLastDir();\n if (lastDir == null) {\n lastDir = \"~\";\n setLastDir(lastDir);\n }\n properties.setProperty(\"lastdir\", lastDir);\n\n // Try loading properties from the file (if found)\n properties.load(is);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void loadConfigurationFile() throws IOException {\n\t\tFileInputStream fis= new FileInputStream(\"config.properties\");\n\t\tprop.load(fis);\n\t}", "@PostConstruct\n\tpublic void loadProperties() {\n\t\tproperties.put(PropertyKey.TRANSLATION_FILE_STORE, \"C:\\\\development\\\\projects\\\\mega-translator\\\\store\");\n\t}", "public HashMap<String, String> readPropertyFile(String propertyFilePath) throws Exception {\n File propertyFile = null;\n InputStream inputStream = null;\n Properties properties = null;\n HashMap<String, String> propertyMap = new HashMap<String, String>();\n try {\n\n //creating file object\n propertyFile = new File(propertyFilePath);\n\n //check if property file exists on hard drive\n if (propertyFile.exists()) {\n inputStream = new FileInputStream(propertyFile);\n // check if the file exists in web environment or relative to class path\n } else {\n inputStream = getClass().getClassLoader().getResourceAsStream(propertyFilePath);\n }\n\n if (inputStream == null) {\n throw new Exception(\"FILE NOT FOUND : inputStream = null : \" + propertyFilePath);\n }\n\n properties = new Properties();\n properties.load(inputStream);\n Enumeration enuKeys = properties.keys();\n while (enuKeys.hasMoreElements()) {\n\n String key = (String) enuKeys.nextElement();\n String value = properties.getProperty(key);\n\n //System.out.print(\"key = \"+key + \" : value = \"+value);\n propertyMap.put(key, value);\n }\n if (propertyMap == null) {\n throw new Exception(\"readPropertyFile : propertyMap = null\");\n }\n\n return propertyMap;\n } catch (Exception e) {\n throw new Exception(\"readPropertyFile : \" + e.toString());\n } finally {\n try {\n inputStream.close();\n } catch (Exception e) {\n }\n try {\n properties = null;\n } catch (Exception e) {\n }\n }\n }", "public static Properties load(File file) {\n\t\ttry {\n\t\t\tif (file != null && file.exists()) {\n\t\t\t\treturn load(new FileInputStream(file));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public static void loadProps(InputStream in) {\r\n\t\ttry {\r\n properties.load(in);\r\n } catch (IOException e) {\r\n System.out.println( \"No config.properties was found.\");\r\n e.printStackTrace();\r\n }\r\n\t}", "public static Properties loadProperties(@NonNull String path) throws IOException {\n File file = loadFile(path);\n if(file == null){ throw new IOException(\"没有找到文件\"); }\n return ReaderUtils.loadProperties(file);\n }", "public void loadGame(){\n\n try {\n input = new FileInputStream(fileName);\n properties.load(input);\n System.out.println(\"--- LOADING GAMEFILE PROPERTIES ---\");\n\n int highestReachedLevel = getHighestLevelFromProperties();\n GameModel.getInstance().setHighestCompletedLevel(highestReachedLevel);\n\n GameModel.getInstance().setfirstTimePlay(false);\n\n //TODO: Save properties to gameModel\n\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO LOAD GAME ---\");\n GameModel.getInstance().setfirstTimePlay(true);\n e.printStackTrace();\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE INTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n\n }", "public static Properties readPropertiesFile(String path) {\n\n\t\tProperties propFile = new Properties();\n\t\ttry {\n\t\t\tpropFile.load(new FileInputStream(path));\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error Reading Properties File\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn propFile;\n\t}", "public static Properties getPropertiesFromClasspath(String fileName)\n throws PropertiesFileNotFoundException {\n\n Properties props = new Properties();\n try {\n InputStream is = ClassLoader.getSystemResourceAsStream(fileName);\n if (is == null) { // try this instead\n is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);\n logger.debug(\"loaded properties file with Thread.currentThread()\");\n }\n props.load(is);\n } catch (Exception e) {\n throw new PropertiesFileNotFoundException(\n \"ERROR LOADING PROPERTIES FROM CLASSPATH >\" + fileName + \"< !!!\", e);\n }\n return props;\n }", "private void loadProperties() {\n Path path = getSamplePropertiesPath();\n LOG.info(\"Loading Properties from {}\", path.toString());\n try {\n FileInputStream fis = new FileInputStream(getSamplePropertiesPath().toFile());\n Properties properties = new Properties();\n properties.load(fis);\n\n String privateKey = properties.getProperty(PRIVATE_KEY);\n this.credentials = Credentials.create(privateKey);\n this.contract1Address = properties.getProperty(CONTRACT1_ADDRESS);\n this.contract2Address = properties.getProperty(CONTRACT2_ADDRESS);\n this.contract3Address = properties.getProperty(CONTRACT3_ADDRESS);\n this.contract4Address = properties.getProperty(CONTRACT4_ADDRESS);\n this.contract5Address = properties.getProperty(CONTRACT5_ADDRESS);\n this.contract6Address = properties.getProperty(CONTRACT6_ADDRESS);\n\n } catch (IOException ioEx) {\n // By the time we have reached the loadProperties method, we should be sure the file\n // exists. As such, just throw an exception to stop.\n throw new RuntimeException(ioEx);\n }\n }", "public Resource load(String filename) throws MalformedURLException;", "public static Properties file2Properties(File file) {\r\n Properties props = new Properties();\r\n FileInputStream stream = null;\r\n InputStreamReader streamReader = null;\r\n\r\n\r\n try {\r\n stream = new FileInputStream(file);\r\n streamReader = new InputStreamReader(stream, charSet);\r\n props.load(streamReader);\r\n } catch (IOException ex) {\r\n Logger.getLogger(RunProcessor.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n return props;\r\n }", "public static void loadPropertyFile() throws IOException {\n\t\tPropertyFileReader.property = new Properties();\n\t\tPropertyFileReader.targetPlatform = System.getProperty(\"targetPlatform\");\n\t\tPropertyFileReader.targetDevice = System.getProperty(\"targetDevice\");\n\n\t\t// Load the property file based on platform and device\n\n\t\tif (PropertyFileReader.targetPlatform.equalsIgnoreCase(\"android\")) {\n\t\t\tfinal File file = new File(String.valueOf(System.getProperty(\"user.dir\"))\n\t\t\t\t\t+ \"\\\\src\\\\main\\\\resources\\\\testdata\\\\\" + PropertyFileReader.targetPlatform + \"\\\\\"\n\t\t\t\t\t+ PropertyFileReader.targetDevice + \"\\\\capabilities.properties\");\n\t\t\tPropertyFileReader.filereader = new FileReader(file);\n\t\t\tPropertyFileReader.property.load(PropertyFileReader.filereader);\n\t\t}\n\n\t\tif (PropertyFileReader.targetPlatform.equalsIgnoreCase(\"iOS\")) {\n\t\t\t// To do in case of iOS\n\t\t}\n\t}", "@Test\r\n\t\tpublic static void Properties() \r\n\r\n\t\t{\r\n\t\t\ttry{\r\n\t\t\t\tprop = new Properties();\r\n\t\t\t\tfile = new File(\"C:\\\\Users\\\\vardhan\\\\eclipse-workspace\\\\com.makemytrip\\\\prop.properties\");\r\n\t\t\t\tfilereader = new FileReader(file);\r\n\t\t\t\tprop.load(filereader);\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\r\n\t\t\r\n\t\t\tcatch(Exception e)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}", "private static String readPropertiesFile() {\n Properties prop = new Properties();\n\n try (InputStream inputStream = MembershipService.class.getClassLoader().getResourceAsStream(\"config.properties\")) {\n\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n throw new FileNotFoundException(\"property file 'config.properties' not found in the classpath\");\n }\n } catch (Exception e) {\n return \"\";\n }\n return prop.getProperty(\"introducer\");\n }", "public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.close();\r\n\t\t\t}catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}", "public static Properties loadOrCreateProperties(String filename, Properties defaultProperties) {\n\n Properties properties = new Properties();\n try {\n properties.load(new FileInputStream(filename));\n } catch (Exception loadException) {\n try {\n FileOutputStream out = new FileOutputStream(filename);\n if (defaultProperties != null) {\n defaultProperties.store(out, null);\n }\n out.close();\n properties.load(new FileInputStream(filename));\n } catch (Exception writeException) {\n // Do nothing\n return null;\n }\n }\n return properties;\n }", "private Properties loadConfig(String baseFileName, String userPathParamName) throws IOException {\n\t\tString fileName = baseFileName + \".properties\";\n\t\tProperties properties = new Properties();\n\t\ttry (InputStream configStream = ApiInitializer.class.getClassLoader().getResourceAsStream(fileName)) {\n\t\t\tif (configStream != null) {\n\t\t\t\tproperties.load(configStream);\n\t\t\t}\n\t\t}\n\n\t\t// Then, override with whatever the user set up.\n\t\tString userFilePath = servletContext.getInitParameter(userPathParamName);\n\t\tif (userFilePath == null) {\n\t\t\tuserFilePath = \"WEB-INF/\" + baseFileName + \".properties\";\n\t\t} else {\n\t\t\tPath path = Paths.get(userFilePath, baseFileName + \".properties\");\n\t\t\tuserFilePath = path.toString();\n\t\t}\n\t\ttry (InputStream inStream = servletContext.getResourceAsStream(userFilePath);) {\n\t\t\tif (inStream != null) {\n\t\t\t\tproperties.load(inStream);\n\t\t\t}\n\t\t}\n\n\t\treturn properties;\n\t}", "public void loadObjectData(String datafile) {\n\t\tProperties databaseAddData = new Properties();\n\t\ttry {\n\t\t\tdatabaseAddData.load(new FileInputStream(langFile));\n\t\t} catch (Exception e) {}\n\t\t//put values from the properties file into hashmap\n\t\tthis.properties.put(\"PROPERTY\", databaseAddData.getProperty(\"PROPERTY\"));\n\t}", "@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n public void loadConfigProperties() {\n Properties properties = new Properties();\n InputStream inputStream = null;\n try {\n String configFile = Constant.CONFIGURATION_PROPERTIES;\n inputStream = RepositoryParser.class.getClassLoader().getResourceAsStream(configFile);\n // Loading the property file\n properties.load(inputStream);\n } catch (FileNotFoundException e) {\n Log.error(\"Property file was not found\");\n } catch (IOException e) {\n Log.error(\"The key was not found in the property file\");\n } finally {\n if (inputStream != null) {\n try {\n inputStream.close();\n } catch (IOException e) {\n Log.error(\"The property file was not closed\");\n }\n }\n }\n\n // Getting the corresponding value of the key in the property file\n configPropertiesMap = new HashMap<String, String>((Map) properties);\n }", "public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }", "public void load(String filename) throws IOException\n {\n FileInputStream input;\n\n try {\n input = new FileInputStream(new File(filename));\n }\n catch (Exception e)\n {\n throw new IOException(\"Cannot open input file \" + filename + \":\" + e.getMessage());\n }\n load(input);\n input.close();\n }", "void loadProperties(File propertiesFile) throws IOException\n {\n // Load the properties.\n LOGGER.info(\"Loading properties from \\\"{}\\\" file...\", propertiesFile);\n try (InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(propertiesFile), \"UTF-8\"))\n {\n properties.load(inputStreamReader);\n }\n\n // Log all properties except for password.\n StringBuilder propertiesStringBuilder = new StringBuilder();\n for (Object key : properties.keySet())\n {\n String propertyName = key.toString();\n propertiesStringBuilder.append(propertyName).append('=')\n .append(HERD_PASSWORD_PROPERTY.equalsIgnoreCase(propertyName) ? \"***\" : properties.getProperty(propertyName)).append('\\n');\n }\n LOGGER.info(\"Successfully loaded properties:%n{}\", propertiesStringBuilder.toString());\n }", "@Test\n public void testCreateFromProperties_Properties() throws Exception {\n System.out.println(\"createFromProperties\");\n Properties props = new Properties();\n props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(propertiesName));\n EngineConfiguration result = EngineConfiguration.createFromProperties(props);\n assertProperties(result);\n }", "public void loadObject() {\n\n obj = new Properties();\n try {\n obj.load(new FileInputStream(\"./src/test/resources/config.properties\"));\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private void loadPropertiesFromFile(String propertiesFileName) {\t\t\n\t\tif ( (propertiesFileName != null) && !(propertiesFileName.isEmpty()) ) {\n\t\t\tpropertiesFileName = config_file_name;\n\t \t\ttry {\n\t \t\t\t// FileInputStream lFis = new FileInputStream(config_file_name);\n\t \t\t\t// FileInputStream lFis = getServletContext().getResourceAsStream(config_file_name);\n\t \t\t\tInputStream lFis = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"config.properties\");\n\t \t\t\tif (lFis != null) {\n\t\t \t\t\tProperties lConnectionProps = new Properties();\n\t\t \t\t\tlConnectionProps.load(lFis);\n\t\t \t\t\tlFis.close();\n\t\t \t\t\tlLogger.info(DEBUG_PREFIX + \"Using configuration file \" + config_file_name);\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceNname\") != null) ssosvc_name = lConnectionProps.getProperty(\"SsoServiceNname\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceLabel\") != null) ssosvc_label = lConnectionProps.getProperty(\"SsoServiceLabel\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServicePlan\") != null) ssosvc_plan = lConnectionProps.getProperty(\"SsoServicePlan\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_clientId = lConnectionProps.getProperty(\"SsoServiceCredential_clientId\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_secret = lConnectionProps.getProperty(\"SsoServiceCredential_secret\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_serverSupportedScope = lConnectionProps.getProperty(\"SsoServiceCredential_serverSupportedScope\");\n\t\t\tlLogger.info(DEBUG_PREFIX + \"CONFIG FILE parsing, found Scopes = \" + ssosvc_cred_serverSupportedScope + \" for service name = \" + ssosvc_name);\t\n\t\t\t Pattern seperators = Pattern.compile(\".*\\\\[ *(.*) *\\\\].*\");\n\t\t\t if (seperators != null) {\n\t\t\t \tMatcher scopeMatcher = seperators.matcher(ssosvc_cred_serverSupportedScope);\n\t\t\t\t scopeMatcher.find();\n\t\t\t\t ssosvc_cred_serverSupportedScope = scopeMatcher.group(1); // only get the first occurrence\n\t\t\t\t lLogger.info(DEBUG_PREFIX + \"CONFIG FILE parsing, retrieved first Scope = \" + ssosvc_cred_serverSupportedScope);\n\t\t\t }\n\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_issuerIdentifier = lConnectionProps.getProperty(\"SsoServiceCredential_issuerIdentifier\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_tokenEndpointUrl = lConnectionProps.getProperty(\"SsoServiceCredential_tokenEndpointUrl\");\n\t\t \t\t\tif ( lConnectionProps.getProperty(\"SsoServiceCredential\") != null) ssosvc_cred_authorizationEndpointUrl = lConnectionProps.getProperty(\"SsoServiceCredential_authorizationEndpointUrl\");\n\t\n\t\t \t\t\tlLogger.info(DEBUG_PREFIX + \"Using config for SSO Service with name \" + ssosvc_name);\n\t \t\t\t} else {\n\t \t\t\t\tlLogger.severe(DEBUG_PREFIX + \"Configuration file not found! Using default settings.\");\n\t \t\t\t}\n\n\t \t\t} catch (FileNotFoundException e) {\n\t \t\t\tlLogger.severe(DEBUG_PREFIX + \"Configuration file = \" + config_file_name + \" not found! Using default settings.\");\n\t \t\t\te.printStackTrace();\n\t \t\t} catch (IOException e) {\n\t \t\t\tlLogger.severe(\"SF-DEBUG: Configuration file = \" + config_file_name + \" not readable! Using default settings.\");\n\t \t\t\te.printStackTrace();\n\t \t\t}\n\t \t} else {\n\t \t\tlLogger.info(DEBUG_PREFIX + \"Configuration file = \" + config_file_name + \" not found! Using default settings.\");\n\t \t}\n\t}", "private Properties loadProperties() {\n Properties properties = new Properties();\n try {\n properties.load(getClass().getResourceAsStream(\"/config.properties\"));\n } catch (IOException e) {\n throw new WicketRuntimeException(e);\n }\n return properties;\n }", "private static void readCitProperties(String fileName) {\n/* */ try {\n/* 91 */ ResourceLocation e = new ResourceLocation(fileName);\n/* 92 */ InputStream in = Config.getResourceStream(e);\n/* */ \n/* 94 */ if (in == null) {\n/* */ return;\n/* */ }\n/* */ \n/* */ \n/* 99 */ Config.dbg(\"CustomItems: Loading \" + fileName);\n/* 100 */ Properties props = new Properties();\n/* 101 */ props.load(in);\n/* 102 */ in.close();\n/* 103 */ useGlint = Config.parseBoolean(props.getProperty(\"useGlint\"), true);\n/* */ }\n/* 105 */ catch (FileNotFoundException var4) {\n/* */ \n/* */ return;\n/* */ }\n/* 109 */ catch (IOException var5) {\n/* */ \n/* 111 */ var5.printStackTrace();\n/* */ } \n/* */ }", "protected static Properties getProperties(String fName) throws IOException {\r\n\t\tProperties props = new Properties();\r\n\t\tFile f = new File(fName);\r\n \r\n if (!f.exists()) {\r\n \treturn props;\r\n }\r\n \r\n props.load(new FileInputStream(f)); \r\n return props;\r\n }", "public Properties loadProps(String propFile) {\n Properties props = new Properties();\n BufferedReader f;\n try {\n f = new BufferedReader(new FileReader(propFile));\n } catch (FileNotFoundException e) {\n return null;\n }\n try {\n props.load(f);\n } catch (IOException e) {\n System.err.println(\"IO EXception in loadProps in EvalModels class\");\n }\n System.out.println(props.toString());\n return props;\n }", "public void refresh() {\n try (InputStream stream = new FileInputStream(file)) {\n Map<String, String> properties = new HashMap<>();\n Properties props = new Properties();\n props.load(stream);\n for (String key : props.stringPropertyNames()) {\n properties.put(key, props.getProperty(key));\n }\n LOG.log(Level.FINEST, \"Loaded properties from \" + file);\n this.properties = properties;\n } catch (IOException e) {\n LOG.log(Level.FINEST, \"Cannot load properties from \" + file, e);\n }\n }", "public HistogramConfiguration loadProperties(String propertyFileName)\n {\n HistogramConfiguration histConfig = HistogramConfiguration.getInstance();\n\n try(FileInputStream inputStream = new FileInputStream(propertyFileName))\n {\n properties.load(inputStream);\n\n histConfig.setShouldIgnoreWhiteSpaces(loadShouldIgnoreWhiteSpace());\n histConfig.setIgnoreCharacters(loadIgnoredCharactersProperties());\n\n }catch (IOException e)\n {\n e.printStackTrace();\n }\n\n return histConfig;\n }", "public void setPropertiesFile(File propertiesFile) {\n this.propertiesFile = propertiesFile;\n }", "private static synchronized void setProperties(\n final String strPropertiesFilename) {\n if (msbPropertiesLoaded) {\n Verbose.warning(\"Properties already loaded; ignoring request\");\n\n return;\n }\n\n File oFile = new File(strPropertiesFilename);\n\n if (!oFile.exists()) {\n // Try to get it from jar file\n ClassLoader classLoader = Thread.currentThread()\n .getContextClassLoader();\n final InputStream input;\n\n if (classLoader == null) {\n classLoader = Class.class.getClassLoader();\n }\n input = classLoader\n .getResourceAsStream('/' + strPropertiesFilename);\n PropertyDef.setProperties(input, null);\n } else {\n PropertyDef.setProperties(new File(strPropertiesFilename), null,\n false);\n }\n if (strPropertiesFilename == DEFAULT_PROPERTIES_FILENAME) {\n oFile = new File(CUSTOMER_PROPERTIES_FILENAME);\n if (oFile.exists() && oFile.isFile()) {\n PropertyDef.addProperties(oFile);\n }\n }\n AdaptiveReplicationTool.msbPropertiesLoaded = true;\n }", "default void load(Map<String, Object> properties)\r\n {\r\n }", "public void loadFile(File p_file) throws IOException;", "public void read() {\n\t\tconfigfic = new Properties();\n\t\tInputStream input = ConfigReader.class.getClassLoader().getResourceAsStream(\"source/config.properties\");\n\t\t// on peut remplacer ConfigReader.class par getClass()\n\t\ttry {\n\t\t\tconfigfic.load(input);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void a(Properties props, String filename) {\n/* */ try {\n/* 99 */ props.load(((c == null) ? (c = b(\"org.cyberneko.html.e\")) : c).getResourceAsStream(filename));\n/* */ }\n/* 101 */ catch (IOException iOException) {\n/* 102 */ System.err.println(\"error: unable to load resource \\\"\" + filename + \"\\\"\");\n/* */ } \n/* */ }", "private static void loadPropertiesFromURL(String url, Properties properties) {\n \t\tif(url == null) throw new IllegalArgumentException(\"url cannot be null\");\n \t\tif(properties == null) throw new IllegalArgumentException(\"properties cannot be null\");\n \t\tURL propertiesLocation;\n \t\ttry {\n \t\t\tpropertiesLocation = new URL(url);\n \t\t} catch (MalformedURLException e1) {\n \t\t\tthrow new IllegalArgumentException(\"Could not load property file from url: \"+url, e1);\n \t\t}\n \t\ttry {\n \t\t\tproperties.load(propertiesLocation.openStream());\n \t\t} catch (Exception e) {\n \t\t\tthrow new Error(e);\n \t\t}\n \t}", "public static String getPropertyFromFile(String propName)throws ISException{\n InputStream inputStream;\n Properties prop = new Properties();\n try {\n inputStream = new FileInputStream(new File(System.getenv(\"conf.home\")+\"\\\\application.properties\"));\n prop.load(inputStream);\n if(prop==null){\n throw new ISException(\"getProperty: Cannot open property file!\");\n }\n return prop.getProperty(propName);\n } catch(Exception e){\n throw new ISException(\"getProperty: Cannot open property file!\");\n }\n }", "public void load (String argFileName) throws IOException;" ]
[ "0.7763178", "0.7741672", "0.75270945", "0.7286266", "0.7271418", "0.7246614", "0.7190825", "0.718454", "0.7105531", "0.7024684", "0.69551104", "0.6952535", "0.69109565", "0.6902234", "0.6893414", "0.6843886", "0.67867774", "0.6759639", "0.67481804", "0.67430055", "0.67373395", "0.67229176", "0.66845834", "0.6672395", "0.6669555", "0.6660429", "0.6653333", "0.66495323", "0.66215354", "0.65943635", "0.65933484", "0.6585713", "0.6553276", "0.6553135", "0.6513681", "0.64587843", "0.6426233", "0.6422745", "0.6417769", "0.6411708", "0.63990295", "0.63971245", "0.63959897", "0.639327", "0.6388107", "0.63869226", "0.63838184", "0.6359927", "0.63561404", "0.63541484", "0.62964994", "0.6294556", "0.62742406", "0.62563026", "0.6254643", "0.62286675", "0.62254393", "0.62171185", "0.6209049", "0.6208133", "0.6195985", "0.6178794", "0.61708325", "0.61667544", "0.61523813", "0.61387885", "0.6117737", "0.61101896", "0.61067075", "0.6100692", "0.6093809", "0.6086999", "0.60833013", "0.6071661", "0.60687715", "0.6057746", "0.60494614", "0.6045236", "0.60419846", "0.60394806", "0.60391456", "0.60267097", "0.60243624", "0.6022649", "0.6011653", "0.5992529", "0.59862095", "0.59852123", "0.5966076", "0.59599847", "0.59596217", "0.5953927", "0.5951017", "0.5944673", "0.5935835", "0.59332854", "0.5917661", "0.5900324", "0.58913165", "0.58881485" ]
0.64223576
38
checks for the presence of an edge in a small graph that contains only two vertices, with that as the only edge
@Test public void testPublic1() { Graph<Character> graph= TestGraphs.testGraph1(); assertEquals(3, graph.getEdge('A', 'B')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean hasEdge(int from, int to);", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public boolean isEdge (T vertex1, T vertex2){\n int i1 = vertexIndex(vertex1);\n int i2 = vertexIndex(vertex2);\n if (i1 != NOT_FOUND && i2 != NOT_FOUND && edges[i1][i2] > 0){\n return true;\n }\n return false;\n }", "public boolean hasEdge(int node1, int node2)\n{\n\tNode s=(Node)this.getNodes().get(node1);\n return s.hasNi(node2);\n\t\n}", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "boolean hasIsVertexOf();", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "public abstract boolean getEdge(Point a, Point b);", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.isEmpty() | !adjacentA.isEmpty() | !adjacentB.isEmpty()) {\r\n fail();\r\n } \r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "public boolean isEqual(Edge e){\n if(v1.equals(e.v1) && v2.equals(e.v2)){\n return true;\n }\n else if(v1.equals(e.v2) && v2.equals(e.v1)){\n return true;\n }\n else{\n return false;\n }\n }", "public void testContainsEdgeEdge( ) {\n init( );\n\n //TODO Implement containsEdge().\n }", "private boolean isClosed(EdgeWeightedDigraph G, FlowEdge e, int V) {}", "public boolean containsEdge(E edge);", "private boolean forbidEdgeCreation(NetworkEdge edge) {\n return network.getEdges().stream()\n .filter(networkEdge ->\n edge.getFrom().equals(networkEdge.getTo())\n ).anyMatch(networkEdge ->\n edge.getTo().equals(networkEdge.getFrom())\n );\n }", "public abstract boolean isUsing(Edge graphEdge);", "public boolean hasEdge(Edge e) {\n for (Edge outEdge : outEdges) {\n if (outEdge.equals(e) && e.getTo() == outEdge.getTo()) {\n return true;\n }\n }\n return false;\n }", "boolean contains(Edge edge);", "public boolean hasEdge (E vertex1, E vertex2) throws IllegalArgumentException\n {\n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n \n Node node = adjacencySequences[index1];\n boolean hasEdge = false;\n while (!hasEdge && node != null)\n {\n if (node.neighbourIndex == index2)\n hasEdge = true;\n else\n node = node.nextNode;\n }\n\n return hasEdge;\n }", "boolean containsEdge(V v, V w);", "public boolean containsEdge(Edge<V> edge);", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "public boolean hasEdge(T beg, T end);", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "@DisplayName(\"Has edge\")\n @Test\n public void testHasEdge() {\n boolean directed1 = true;\n graph = new Graph(edges, directed1, 0, 5, GraphType.RANDOM);\n Assertions.assertTrue(graph.hasEdge(new Edge(0, 1)));\n }", "@Override\r\n public boolean edgeExists(Vertex v1, Vertex v2) {\r\n return adjacencyList.get(v1).contains(v2); //checking if the list of adjacent vertices contains v2\r\n }", "public boolean hasEdge(T begin, T end);", "@Test\n\tpublic void edgesTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertEquals(2, graph.edges().size());\n\t\tassertTrue(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().contains(edge_1));\n\t}", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "default boolean isEdge(int x, int y) {\n return getNeighbors(x).contains(y);\n }", "public void testRemoveEdge_betweenVertices() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(graph.removeEdge(new Integer(i), new Integer(j)));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "public boolean containsEdge(Edge e)\n\t{\n\t\tif (e.getOne() == null || e.getTwo() == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn this.edges.containsKey(e.hashCode());\n\t}", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "public void testRemoveEdge_edge() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(\n graph.removeEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "public boolean isBipartiteUndirectedGraph (){\r\n int[] vertices = new int[getNumV()];\r\n for (int i = 0; i < getNumV(); ++i)\r\n vertices[i] = -1;\r\n\r\n vertices[0] = 1;\r\n\r\n Stack <Integer> q = new Stack<Integer>();\r\n q.push(0);\r\n\r\n while (!q.isEmpty()) {\r\n int current = q.pop();\r\n Iterator<Edge> iter = edgeIterator(current);\r\n while (iter.hasNext()) {\r\n Edge edge = iter.next();\r\n int neighbor = edge.getDest();\r\n if (vertices[neighbor] == -1) {\r\n vertices[neighbor] = 1 - vertices[current];\r\n q.push(neighbor);\r\n }\r\n else if (vertices[neighbor] == vertices[current])\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "@Test\r\n public void testOutboundEdges() {\r\n System.out.println(\"outboundEdges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n Object v3Element = 3;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n Vertex v3 = instance.insertVertex(v3Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e1 = instance.insertEdge(v1, v2, edgeElement);\r\n Edge e2 = instance.insertEdge(v1, v3, edgeElement);\r\n Edge e3 = instance.insertEdge(v2, v3, edgeElement);\r\n\r\n Collection e1OutboundEdges = instance.outboundEdges(v2);\r\n Collection e2OutboundEdges = instance.outboundEdges(v3);\r\n Collection e3OutboundEdges = instance.outboundEdges(v3);\r\n\r\n boolean e1Result = e1OutboundEdges.contains(e1);\r\n boolean e2Result = e2OutboundEdges.contains(e2);\r\n boolean e3Result = e3OutboundEdges.contains(e3);\r\n\r\n Object expectedResult = true;\r\n assertEquals(expectedResult, e1Result);\r\n assertEquals(expectedResult, e2Result);\r\n assertEquals(expectedResult, e3Result);\r\n }", "private boolean isEdge(Node node) {\n for (Node n: nodes){\n if(!node.equals(n)) {\n for(Edge e:n.getEdges()){\n if(e.getDestination().equals(node)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public boolean hasEdge(Node p_a, Node p_b) {\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\treturn edges.contains(edge);\n\t}", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "public boolean containsEdge(V source, V target);", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public boolean canAddEdge(Edge newEdge){\n\t\t/*\n\t\tif(v1.equals(v2)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tEdge newEdge = new Edge(v1, v2, weight);\n\t\t*/\n\t\tif(edges.containsKey(newEdge.hashCode())){\n\t\t\treturn false;\n\t\t\t\n\t\t\t/*\n\t\t// Edge already has been assigned to a vertex\n\t\t}else if(v1.containsConnection(newEdge) || v2.containsConnection(newEdge)){\n\t\t\treturn false;\n\t\t\t*/\n\t\t}\n\t\t\n\t\t\n\t\t// If edge passes all the above tests then add edge to graph\n\t\taddEdge(newEdge);\n\t\treturn true;\n\t}", "@Override\n public boolean hasEdge(V from, V to)\n {\n if (from.equals(null) || to.equals(null)){\n throw new IllegalArgumentException();\n }\n if (!contains(from)){\n return false;\n }\n else{\n Iterator graphIterator = graph.entrySet().iterator();\n Map.Entry graphElement = (Map.Entry) graphIterator.next();\n V vert = (V) graphElement.getKey();\n while (graphIterator.hasNext() && vert != from){\n graphElement = (Map.Entry) graphIterator.next();\n vert = (V)graphElement.getKey();\n }\n\t ArrayList <V> edges = graph.get(vert);\n\t return edges.contains(to);\n\t }\n }", "public boolean isInEdge(int width, int height, Position position);", "static boolean isBipartite(int graph[][], int num_vertices)\n {\n int color[] = new int[num_vertices];\n //-1 means uncolored, 0 is red, 1 is black\n for (int i=0; i < num_vertices; i++)\n color[i] = -1;\n color[0] = 1;\n\n //queue of vertex numbers\n LinkedList<Integer> queue = new LinkedList<>();\n //start at vertex 0 because our graph is connected we can always start at\n //vertex 0\n queue.add(0);\n\n //while vertices in queue\n while (queue.size() != 0)\n {\n //deque color of first vertex in queue;\n int u = queue.poll();\n for (int i = 0; i < num_vertices; i++)\n {\n //if edge exists and vertex is uncolored\n if ( (graph[u][i] == 1) && (color[i] == -1) )\n {\n //color red if uncolored\n color[i] = 1 - color[u];\n queue.add(i);\n }\n //if edge exists an the color is same as the color of the polled vertex\n else if ( (graph[u][i] == 1) && (color[i] == color[u]) )\n return false;\n }\n }\n return true;\n }", "@Test\n void test07_tryToRemoveNonExistentEdge() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n try {\n graph.removeEdge(\"e\", \"f\"); // remove non existent edge\n } catch (Exception e) {\n fail(\"Shouldn't have thrown exception\");\n }\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.add(\"c\"); // creates mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) { // checks if vertices weren't added or removed\n fail(\"wrong vertices are inserted into the graph\");\n }\n if (graph.size() != 2) {\n fail(\"wrong number of edges in the graph\");\n }\n\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "public boolean hasEdge(int i,int j){\n return Matrix[i][j];\n }", "VertexType getOtherVertexFromEdge( EdgeType r, VertexType oneVertex );", "public boolean containsEdge(Edge e){\n\t\treturn edges.containsKey(e.hashCode());\n\t}", "@Test\n void test05_checkSize() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\"); // adds three vertices\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\");\n graph.addEdge(\"c\", \"b\"); // add three edges\n if (graph.size() != 3) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "public boolean isEdge(int i,int j){\r\n\t\treturn matrix[i][j]!=0;\r\n\t}", "public boolean addEdge(Edge e) {\n return g.addNode(e.getSrc())&&g.addNode(e.getDst())&&g.addEdge(e.getSrc(),e.getDst());\n }", "public boolean hasEdge(Node k){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == k){\n return true;\n }\n }\n return false;\n }", "public boolean addEdge(Vertex one, Vertex two)\n\t{\n\t\treturn addEdge(one, two, 1);//returns true if added\n\t}", "public void testRemoveEdgeEdge( ) {\n init( );\n\n assertEquals( m_g4.edgeSet( ).size( ), 4 );\n m_g4.removeEdge( m_v1, m_v2 );\n assertEquals( m_g4.edgeSet( ).size( ), 3 );\n assertFalse( m_g4.removeEdge( m_eLoop ) );\n assertTrue( m_g4.removeEdge( m_g4.getEdge( m_v2, m_v3 ) ) );\n assertEquals( m_g4.edgeSet( ).size( ), 2 );\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "public boolean hasEdge(K u, K v)\n\t{\n \tList<HashMap<K, Integer>> adj = adjLists.get(u);\n\n \t// check for edge already being there\n \tint count=0;\n \tfor (HashMap<K, Integer> A:adj){\n \t\tfor (K vertex:A.keySet()){\n \t\t\tif (!vertex.equals(v))\n \t\t {\n \t\t\t\tcount++;\n\n \t\t }\n \t\t}\n \t\t\n \t}\n \tif (count==adj.size()) return false;\n \treturn true;\n\t}", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "public boolean isAdjacentTo(final Vertex other){\n\t\tboolean result = false;\n\t\tif(getNeighbours().contains(other))\n\t\t\tresult = true;\n\t\treturn result;\n\t}", "public boolean isEdge(int s,int d) throws Exception\r\n\t{\r\n\t\tif(s>=0&&s<n&&d>=0&&d<n)\r\n\t\t{\r\n\t\t\tLinkedList l=g.get(s);\r\n\t\t\tNode temp=l.getHead();\r\n\t\t\twhile(temp!=null)\r\n\t\t\t{\r\n\t\t\t\tif(temp.getData()==g.get(d).getHead().getData())\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\ttemp=temp.getNext();\t\t\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\tthrow new Exception(\"Vertex is not present\");\r\n\t}", "public boolean hasEdge(K u, K v)\n {\n return adjMaps.get(u).containsKey(v);\n }", "@Test\r\n void test_insert_edges_remove_edges_check_size() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n\r\n // There are no more edges in the graph\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"A\", \"E\");\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n }", "public boolean hasPath(Graph graph) {\n\t\tif (!isNonZeroDegreeVerticesConnected(graph)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// (2) number of odd vertices has to be between zero to two\n\t\tint vertices = graph.countVertices();\n\t\tint odd = 0;\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\t// counting number of odd vertices\n\t\t\tif (((graph.getNeighbours(i).length & 1) == 1)) {\n\t\t\t\todd++;\n\t\t\t}\n\t\t}\n\n\t\tif (odd <= 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean addEdge(E edge);", "boolean removeEdge(E edge);", "public boolean hasEular(Graph graph) {\n\t\tint vertices = graph.countVertices();\n\t\tint i = 0;\n\t\tint[] x = new int[]{1, 5};\n\t\tfor (i = 0; i < vertices; i++) {\n\t\t\tif (graph.getNeighbours(i).length != 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i == vertices) {\n\t\t\treturn true;\n\t\t}\n\t\t// (2) All vertices with non-zero degree are connected.\n\t\tif (!isNonZeroDegreeVerticesConnected(graph)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// (3) All vertices have even degree.\n\t\t// int vertices = graph.countVertices();\n\t\tint odd = 0;\n\t\tfor (i = 0; i < vertices; i++) {\n\t\t\tif ((graph.getNeighbours(i).length & 1) == 1) {\n\t\t\t\todd++;\n\t\t\t}\n\t\t}\n\n\t\tif (odd > 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean hasEdge(String id1, String id2)\n\t{\n\t\treturn nodes.containsKey(id1) && getNode(id1).hasEdge(id2);\n\t}", "public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2);", "private boolean edgeExists() {\n for (int i = 1; i < parentMatrix[randomChild][0]; i++) {\n if (parentMatrix[randomChild][i] == randomParent) {\n return true;\n }\n }\n return false;\n }", "public abstract boolean isConnected(N n1, E e, N n2);", "@Override\n public boolean isAdjacent(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n return dictionary.get(vertex1).contains(vertex2) && dictionary.get(vertex2).contains(vertex1);\n } else {\n return false;\n }\n }", "public void testGetEdge() {\n System.out.println(\"getEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertNull(graph.getEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertNotNull(graph.getEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n }", "public boolean isEdge( VKeyT fromKey, VKeyT toKey )\n throws NoSuchVertexException;", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}", "private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public void testAddEdge() {\n System.out.println(\"addEdge\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n graph.addVertex(new Integer(i));\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertTrue(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertFalse(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n }", "public void testContainsEdgeObjectObject( ) {\n init( );\n\n assertFalse( m_g1.containsEdge( m_v1, m_v2 ) );\n assertFalse( m_g1.containsEdge( m_v1, m_v1 ) );\n\n assertTrue( m_g2.containsEdge( m_v1, m_v2 ) );\n assertTrue( m_g2.containsEdge( m_v2, m_v1 ) );\n\n assertTrue( m_g3.containsEdge( m_v1, m_v2 ) );\n assertTrue( m_g3.containsEdge( m_v2, m_v1 ) );\n assertTrue( m_g3.containsEdge( m_v3, m_v2 ) );\n assertTrue( m_g3.containsEdge( m_v2, m_v3 ) );\n assertTrue( m_g3.containsEdge( m_v1, m_v3 ) );\n assertTrue( m_g3.containsEdge( m_v3, m_v1 ) );\n\n assertFalse( m_g4.containsEdge( m_v1, m_v4 ) );\n m_g4.addEdge( m_v1, m_v4 );\n assertTrue( m_g4.containsEdge( m_v1, m_v4 ) );\n\n assertFalse( m_g3.containsEdge( m_v4, m_v2 ) );\n assertFalse( m_g3.containsEdge( null, null ) );\n }", "private boolean hasANeighbour(Graph<V, E> g, Set<V> set, V v)\n {\n return set.stream().anyMatch(s -> g.containsEdge(s, v));\n }", "public boolean remainingVerticies(ArrayList<Vertex> edges) {\n\n for (int i = 0; i < edges.size(); i++) {\n if (edges.get(i).color == Color.YELLOW) {\n return true;\n }\n }\n return false;\n }", "@Test\r\n public void testEdges() {\r\n System.out.println(\"edges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Collection colection = instance.edges();\r\n boolean result = colection.contains(e);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n result = colection.contains(e);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "@Test\n public void testEdges() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n Set<Edge> expectedEdges = new HashSet<>();\n expectedEdges.add(e1);\n expectedEdges.add(e2);\n expectedEdges.add(e3);\n\n assertEquals(expectedEdges, g.allEdges());\n\n expectedEdges.remove(e2);\n assertEquals(expectedEdges, g.allEdges(v1));\n\n assertEquals(e3, g.getEdge(v1, v4));\n }", "@Test\n\tvoid testIfAdjacentNodeExists() {\n\t\tMap<String, LinkedHashSet<String>> map = new HashMap<String, LinkedHashSet<String>>();\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.of(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(1, map.get(\"Boston\").size());\n\t\t\tString[] edgesArray = new String[edges.size()];\n\t\t\tedgesArray = edges.toArray(edgesArray);\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertEquals(\"New York\", edgesArray[0]);\n\t\t}\n\n\t}", "public boolean removeEdge(E edge);", "public boolean isBipartite(){\n int pos = 0;// two colors 1 and 0\n return colorGraph(pos,1);\n }", "private void checkEdgesToSearch() {\n if (edgesToSearch == null || edgesToSearch.length == 0) {\n Graph hg;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n edgesToSearch = hg.getEdges().toArray();\n }\n }", "public boolean isConnectedTo(A e) {\n\t\n\t\tif (g == null) return false;\n\t\t\n\t\tfor (Object o: g.getEdges()) {\n\t\t\t\n\t\t\tif (((Edge<?>)o).getFrom().equals(this) && ((Edge<?>)o).getTo().getValue().equals(e)) {\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private boolean hasConfigurationType1(Graph<V, E> g)\n {\n for (V v1 : g.vertexSet()) {\n Set<V> temp = new ConnectivityInspector<>(g).connectedSetOf(v1);\n for (V v2 : temp) {\n if (v1 == v2 || !g.containsEdge(v1, v2))\n continue;\n for (V v3 : temp) {\n if (v3 == v1 || v3 == v2 || !g.containsEdge(v2, v3) || g.containsEdge(v1, v3))\n continue;\n for (V v4 : temp) {\n if (v4 == v1 || v4 == v2 || v4 == v3 || g.containsEdge(v1, v4)\n || g.containsEdge(v2, v4) || !g.containsEdge(v3, v4))\n continue;\n for (V v5 : temp) {\n if (v5 == v1 || v5 == v2 || v5 == v3 || v5 == v4\n || g.containsEdge(v2, v5) || g.containsEdge(v3, v5)\n || !g.containsEdge(v1, v5) || !g.containsEdge(v4, v5))\n continue;\n if (certify) {\n List<E> edgeList = new LinkedList<>();\n edgeList.add(g.getEdge(v1, v2));\n edgeList.add(g.getEdge(v2, v3));\n edgeList.add(g.getEdge(v3, v4));\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n\n return false;\n }", "@Override\n\tpublic boolean containsEdge(Edge<?> edge)\n\t{\n\t\treturn edgeList.contains(edge);\n\t}", "public void testEdgesSet_ofVertex() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i));\n\n Assert.assertEquals(set.size(), i % 2 == 0 ? 25 : 23);\n for (Edge<Integer> edge : set) {\n Assert.assertTrue((edge.getTargetVertex() + i) % 2 == 0);\n }\n }\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "public boolean addEdge(final int vertice1, final int vertice2) {\n\t\tboolean isAdded = false;\n\n\t\ttry {\n\n\t\t\tadjacencyList[vertice1].add(vertice2);\n\t\t\tadjacencyList[vertice2].add(vertice1);\n\t\t\tisAdded = true;\n\t\t} catch (final Exception exception) {\n\t\t\tSystem.err.println(\"-----ERROR--------\\n\" + exception.getMessage());\n\t\t}\n\n\t\treturn isAdded;\n\t}", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public boolean ShareEdge (int i, int j)\n\t{\n\t\tboolean first = false, second = false, third = false;\n\t\tfirst = trimesh.faces[i].fvlist[0]\n\t\t == trimesh.faces[j].fvlist[0] ||\n\t\t trimesh.faces[i].fvlist[0]\n\t\t == trimesh.faces[j].fvlist[1] ||\n\t\t trimesh.faces[i].fvlist[0]\n\t\t == trimesh.faces[j].fvlist[2];\n\t\tsecond = trimesh.faces[i].fvlist[1]\n\t\t == trimesh.faces[j].fvlist[0] ||\n\t\t trimesh.faces[i].fvlist[1]\n\t\t == trimesh.faces[j].fvlist[1] ||\n\t\t trimesh.faces[i].fvlist[1]\n\t\t == trimesh.faces[j].fvlist[2];\n\t\tthird = trimesh.faces[i].fvlist[2]\n\t\t == trimesh.faces[j].fvlist[0] ||\n\t\t trimesh.faces[i].fvlist[2]\n\t\t == trimesh.faces[j].fvlist[1] ||\n\t\t trimesh.faces[i].fvlist[2]\n\t\t == trimesh.faces[j].fvlist[2];\n\t\treturn (first && second || first && third || second && third);\n\t}", "private boolean hasANonneighbourInX(Graph<V, E> g, V v, Set<V> X)\n {\n return X.stream().anyMatch(x -> !g.containsEdge(v, x));\n }", "boolean ignoreExistingVertices();" ]
[ "0.73573947", "0.72954154", "0.7094395", "0.70864147", "0.69524807", "0.69299227", "0.690647", "0.68862796", "0.68855405", "0.68592656", "0.679603", "0.67850834", "0.67639333", "0.66866976", "0.66850513", "0.667998", "0.66707903", "0.6663581", "0.66492236", "0.6642524", "0.6584309", "0.6565539", "0.65640324", "0.6562476", "0.65192705", "0.6515211", "0.6500237", "0.6484398", "0.6480369", "0.6471492", "0.64501566", "0.64428043", "0.64410716", "0.64092267", "0.6386615", "0.6346489", "0.6325204", "0.6323851", "0.62844115", "0.6275503", "0.62753254", "0.6272017", "0.6244047", "0.623719", "0.62322456", "0.6231247", "0.62184274", "0.6212859", "0.620014", "0.61993486", "0.61829424", "0.61759704", "0.6156029", "0.6131196", "0.6118912", "0.6116101", "0.6112704", "0.6102054", "0.61015433", "0.60931003", "0.60913366", "0.6087294", "0.60815805", "0.6078453", "0.60690385", "0.6062671", "0.6048533", "0.6038314", "0.6037199", "0.60260797", "0.6018207", "0.6017533", "0.60058874", "0.5996544", "0.5995624", "0.5993339", "0.5993068", "0.5989149", "0.5971666", "0.59496623", "0.59494686", "0.5939515", "0.59382254", "0.5935823", "0.5933633", "0.59130836", "0.58999723", "0.5898839", "0.58917433", "0.58897775", "0.5888703", "0.5883074", "0.5875813", "0.58623904", "0.58477384", "0.5843509", "0.58384436", "0.5837376", "0.582952", "0.5795112", "0.57890445" ]
0.0
-1
tests adding a vertex to a graph twice (adding one that's already present), which should throw an IllegalArgumentException.
@Test(expected=IllegalArgumentException.class) public void testPublic2() { Graph<Character> graph= TestGraphs.testGraph3(); graph.addVertex('A'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "@Test\n\tpublic void addVertexTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(B));\n\t\tassertTrue(graph.vertices().contains(D));\n\t\tassertFalse(graph.addVertex(B)); // the graph has already have the vertex B, so assert false here.\n\t}", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\n void testAddVertexGraph() {\n Assertions.assertTrue(graph.addVertex(v1));\n Assertions.assertTrue(graph.containsVertex(v1));\n Assertions.assertTrue(checkInv());\n }", "@Test\n public void testAddVertexExisting() throws Exception {\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n graph = graph.addVertex(new Vertex<>(1L, 1L));\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "public void testAddVertex() {\n System.out.println(\"addVertex\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.addVertex(new Integer(i)));\n }\n\n for (int i = 0; i < 25; i++) {\n Assert.assertFalse(graph.addVertex(new Integer(i)));\n }\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Test\n void test07_tryToRemoveNonExistentEdge() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n try {\n graph.removeEdge(\"e\", \"f\"); // remove non existent edge\n } catch (Exception e) {\n fail(\"Shouldn't have thrown exception\");\n }\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.add(\"c\"); // creates mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) { // checks if vertices weren't added or removed\n fail(\"wrong vertices are inserted into the graph\");\n }\n if (graph.size() != 2) {\n fail(\"wrong number of edges in the graph\");\n }\n\n }", "@Override\n public void addVertex(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n ArrayList <V> edges = new ArrayList<>();\n\t graph.put(vertex, edges);\n\n }", "private void addVertex(Vertex vertex) {\n if (!this.verticesAndTheirEdges.containsKey(vertex)) {\n this.verticesAndTheirEdges.put(vertex, new LinkedList<>());\n } else {\n System.out.println(\"Vertex already exists in map.\");\n }\n }", "public void testCreateAndSetOnSameVertexShouldCreateOnlyVertexOnly() {\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "@Test\n\tpublic void addEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tassertTrue(graph.addEdge(edge_0));\n\t\tassertFalse(graph.addEdge(edge_0));\n\t}", "@Test\n public void testAddVerticesBothExisting() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n List<Vertex<Long, Long>> vertices = new ArrayList<>();\n vertices.add(new Vertex<>(1L, 1L));\n vertices.add(new Vertex<>(3L, 3L));\n\n graph = graph.addVertices(vertices);\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public boolean addVertex(V vertex);", "public boolean addVertex(V vertex);", "@Test\r\n void test_insert_null_vertex() {\r\n graph.addVertex(null);\r\n vertices = graph.getAllVertices();\r\n \r\n if(vertices.contains(null))\r\n fail();\r\n if(vertices.size() != 0 ||graph.order() != 0) {\r\n fail();\r\n }\r\n\r\n }", "public abstract boolean putVertex(Vertex incomingVertex);", "@Test\n public void testAddVerticesOneExisting() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n List<Vertex<Long, Long>> vertices = new ArrayList<>();\n vertices.add(new Vertex<>(1L, 1L));\n vertices.add(new Vertex<>(6L, 6L));\n\n graph = graph.addVertices(vertices);\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\" + \"6,6\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n public void tae1()\n {\n Graph graph = new Graph(0);\n graph.addEdge(0,0);\n System.out.println(graph);\n assertEquals(\"Cannot add edges to a graph of size < 1\",\"Cannot add edges to a graph of size < 1\");\n }", "@Test\n\tvoid testAddSecondEdgeForGivenVertex() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tedges.add(\"Newark\");\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"Newark\"));\n\t\t}\n\t}", "void addVertex(Vertex v);", "@Test\n public void testAddVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n graph = graph.addVertex(new Vertex<>(6L, 6L));\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\" + \"6,6\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "void add(Vertex vertex);", "public void addVertex(Vertex v) {\n\t \tif (!this.vertexes.contains(v)) {\r\n\t \t\tthis.vertexes.add(v);\r\n\t \t}\r\n\t \t//otherwise just ignore, the Graph already has this vertex\r\n\t }", "@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.isEmpty() | !adjacentA.isEmpty() | !adjacentB.isEmpty()) {\r\n fail();\r\n } \r\n }", "@Test \n\tpublic void removeVertexTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tgraph.addVertex(D);\n\t\tassertFalse(graph.removeVertex(C));\n\t\tgraph.addVertex(C);\n\t\tgraph.addEdge(edge_0);\n\t\tassertTrue(graph.removeVertex(D));\n\t\tassertFalse(graph.vertices().contains(D));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.addVertex(D));\n\t}", "public boolean addVertex(Vertex vertex)\n\t{\n\t\tVertex current = this.vertices.get(vertex.getLabel());\n\t\tif (current != null)\n\t\t{\n\t\t\tcurrent.visit();//if vertex exists, increment visits\n\t\t\t\n\t\t\t//add edge between vertices\n\t\t\taddEdge(last,current);\n\t\t\t//overwrite last vertex\n\t\t\tlast = current;\n\t\t\t\n\t\t\treturn false;//vertex not added\n\t\t\t\n\t\t}\n\t\tvertices.put(vertex.getLabel(), vertex);\n\t\t//track last vertex to add edge\n\t\tif(last == null)//first vertex?\n\t\t{\n\t\t\tlast = vertex;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//add edge between vertices\n\t\t\taddEdge(last,vertex);\n\t\t\t//overwrite last vertex\n\t\t\tlast = vertex;\n\t\t}\n\t\treturn true;//vertex was added\n\t\t\n\t}", "@Override public boolean add(L vertex) {\r\n \r\n \tif(vertices.contains(vertex)==false)\r\n \t{\r\n \tvertices.add(vertex);\r\n \tcheckRep();\r\n \treturn true;\r\n }\r\n else {\r\n \t\r\n \treturn false;\r\n }\r\n \t\r\n }", "@Test\n void test02_removeVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two\n graph.removeVertex(\"a\"); // remove\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.remove(\"a\"); // creates a mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't remove the vertices correctly\");\n }\n }", "@Test\r\n void test_insert_50_vertex_check() {\r\n String str;\r\n for(int i = 0; i < 50; i++) {\r\n str = \"\" + i;\r\n graph.addVertex(str);\r\n }\r\n vertices = graph.getAllVertices();\r\n for(int j = 0; j < 50; j++) {\r\n str = \"\" + j;\r\n if (!vertices.contains(str))\r\n fail(\"Insert not working!!\");\r\n }\r\n }", "boolean addVertex(V v);", "void add(int vertex);", "void addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;", "@Test\n\tpublic void test() {\n\t\tAssert.assertNotEquals(null, vertex.getEdges());\n\t\t\n\t\t// Check no edges are initially connected\n\t\tAssert.assertEquals(0, vertex.degree());\n\t\t\n\t\t// Check an edge can be added correctly\n\t\ttEdge = new Edge(vertex, new Vertex(\"test2\"));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using existing edge\n\t\tvertex.add(tEdge);\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using new edge\n\t\tvertex.add(new Edge(vertex, new Vertex(\"test2\")));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check edges can be removed correctly\n\t\tvertex.remove(\"test2\");\n\t\tAssert.assertEquals(0, vertex.degree());\n\t}", "@Override\n public boolean addEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n dictionary.get(vertex1).add(vertex2);\n dictionary.get(vertex2).add(vertex1);\n return true;\n } else {\n return false;\n }\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Override\r\n\tpublic boolean insertVertex(E e) {\r\n\t\tif(!containsVertex(e)) {\r\n\t\t\tvertices.put(e, new Vertex<E>(e));\r\n\t\t\tadjacencyLists.put(e, new ArrayList<>());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void addVertex();", "@Test\r\n public void testInsertEdge_3args_2() {\r\n System.out.println(\"insertEdge\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Object result = e.element();\r\n Object expectedResult = \"A\";\r\n assertEquals(expectedResult, result);\r\n }", "@Test\n public void testAddEdgesInvalidVertices() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n List<Edge<Long, Long>> edgesToBeAdded = new ArrayList<>();\n edgesToBeAdded.add(new Edge<>(6L, 1L, 61L));\n edgesToBeAdded.add(new Edge<>(7L, 1L, 71L));\n\n graph = graph.addEdges(edgesToBeAdded);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n public void testAddExistingEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Override\n\tpublic boolean addEdge(E vertexX, E vertexY) {\n\t\tif (!vertices.contains(vertexX) || !vertices.contains(vertexY))\n\t\t\treturn false;\n\t\tUnorderedPair<E> edge = new UnorderedPair<>(vertexX, vertexY);\n\t\treturn edges.add(edge);\n\t}", "public void testAddEdge() {\n System.out.println(\"addEdge\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n graph.addVertex(new Integer(i));\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertTrue(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertFalse(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n }", "@Test\r\n public void testInsertEdge_3args_1() {\r\n System.out.println(\"insertEdge\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1, v2, edgeElement);\r\n\r\n Object result = e.element();\r\n Object expectedResult = \"A\";\r\n assertEquals(expectedResult, result);\r\n }", "public Boolean addEdge( AnyType vertex_value_A, AnyType vertex_value_B ) throws VertexException {\n \n // ------------------------------------\n // Basic steps:\n // ------------------------------------\n // 1) For Vertex A and B, check to see if the vertex exits in the \n // vertex_adjacency_list. If not, then add new vertex (with given \n // value) to the vertex_adjacency_list.\n // 2) In Vertex class, check if Vertex B is in Vertex A's \n // adjacent_vertex_list and vice versa (i.e. an edge exists). If \n // edge already exists, then return false, otherwise goto step 3.\n // 3) Add Vertex B to Vertex A's adjacent_vertex_list and vice versa.\n // Lastly, return true indicating the edge was successfully added.\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n boolean a_in_list = false;\n boolean b_in_list = false;\n boolean edge = false;\n int size = vertex_adjacency_list.size();\n int a = -1;\n int b = -1;\n \n //make new vertices with values passed in\n Vertex<AnyType> A = new Vertex<AnyType>(vertex_value_A);\n Vertex<AnyType> B = new Vertex<AnyType>(vertex_value_B);\n //check if they are in the list\n for(int i = 0; i<= size-1; i++){\n if( vertex_adjacency_list.get(i).compareTo( A) == 0){\n a_in_list = true;\n a = i;\n \n }\n if( vertex_adjacency_list.get(i).compareTo(B) == 0){\n b_in_list = true;\n b = i;\n \n }\n }\n //if not in list, add\n if( a_in_list == false){\n vertex_adjacency_list.add(A);\n a_in_list = true;\n a = vertex_adjacency_list.size()-1;\n }\n if( b_in_list == false){\n vertex_adjacency_list.add(B);\n b_in_list =true;\n b = vertex_adjacency_list.size()-1;\n }\n //check if edge\n edge = vertex_adjacency_list.get(a).hasAdjacentVertex(vertex_adjacency_list.get(b));\n //if edge then add to list \n if( a_in_list == true && b_in_list == true){\n if(edge){\n return edge;\n }\n else{\n vertex_adjacency_list.get(a).addAdjacentVertex(vertex_adjacency_list.get(b));\n vertex_adjacency_list.get(b).addAdjacentVertex(vertex_adjacency_list.get(a));\n edge = true;\n }\n }\n return edge;\n \n }", "@Override\n\tpublic boolean add(E vertex) {\n\t\treturn vertices.add(vertex);\n\t}", "public void testAddEdgeEdge( ) {\n init( );\n\n try {\n m_g1.addEdge( m_eLoop ); // loops not allowed\n assertFalse( );\n }\n catch( IllegalArgumentException e ) {\n assertTrue( );\n }\n\n try {\n m_g3.addEdge( null );\n assertFalse( ); // NPE\n }\n catch( NullPointerException e ) {\n assertTrue( );\n }\n\n Edge e = m_eFactory.createEdge( m_v2, m_v1 );\n\n try {\n m_g1.addEdge( e ); // no such vertex in graph\n assertFalse( );\n }\n catch( IllegalArgumentException ile ) {\n assertTrue( );\n }\n\n assertEquals( false, m_g2.addEdge( e ) );\n assertEquals( false, m_g3.addEdge( e ) );\n assertEquals( true, m_g4.addEdge( e ) );\n }", "@Override\n public boolean contains(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n return graph.containsKey(vertex);\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "public void addVertex (E vertex)\n {\n if (!this.containsVertex (vertex))\n {\n // Enlargen the graph if needed\n if (lastIndex == vertices.length - 1)\n this.enlarge ();\n\n lastIndex = lastIndex + 1;\n vertices[lastIndex] = vertex;\n }\n }", "@Test\n public void testAddVertices() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n List<Vertex<Long, Long>> vertices = new ArrayList<>();\n // the first vertex has a duplicate ID from a vertex in the graph and\n // should not be added to the new graph\n vertices.add(new Vertex<>(5L, 0L));\n vertices.add(new Vertex<>(6L, 6L));\n vertices.add(new Vertex<>(7L, 7L));\n\n graph = graph.addVertices(vertices);\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\" + \"6,6\\n\" + \"7,7\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public boolean addVertex(String label)\n\t{\n\t\tif(!hasVertex(label)) //if edge does not already exist add it\n\t\t{\n\t\t\tDSAGraphVertex v = new DSAGraphVertex(label, null);\n\t\t\tvertices.insertLast(v); //inserts into vertices list at end\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "public void addVertex (T vertex){\n if (vertexIndex(vertex) > 0) return; // vertex already in graph, return.\n if (n == vertices.length){ // need to expand capacity of arrays\n expandCapacity();\n }\n \n vertices[n] = vertex;\n for (int i = 0; i < n; i++){ // populating new edges with -1\n edges[n][i] = -1;\n edges[i][n] = -1;\n }\n n++;\n }", "private void addEdge(Vertex v1, Vertex v2) {\n LinkedList<Vertex> v1AdjacentVertices = verticesAndTheirEdges.get(v1);\n if (!v1AdjacentVertices.contains(v2)) {\n v1AdjacentVertices.add(v2);\n }\n }", "void addVertex(Vertex v, ArrayList<Vertex> neighbors, ArrayList<Double> weights) throws VertexNotInGraphException;", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "@Test\n void test05_checkSize() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\"); // adds three vertices\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\");\n graph.addEdge(\"c\", \"b\"); // add three edges\n if (graph.size() != 3) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "public boolean addVertex(T vert);", "@Override\n\tpublic boolean add(L vertex) {\n\t\tIterator<Vertex<L>> vertexiter = verticelist.iterator();\n\t\twhile (vertexiter.hasNext()) {\n\t\t\tVertex<L> v = vertexiter.next();\n\t\t\tL lab = v.getlabel();\n\t\t\tif (lab.equals(vertex))\n\t\t\t\treturn false;\n\t\t}\n\t\tVertex<L> v = new Vertex<L>(vertex);\n\t\tverticelist.add(v);\n\t\treturn true;\n\t}", "@Test\r\n public void testVertices() {\r\n System.out.println(\"vertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n Collection colection = instance.vertices();\r\n boolean result = colection.contains(v1);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n result = colection.contains(v1);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Override\n\tpublic void implementAddVertex() {\n\t\t\n\t}", "@Test\n\tvoid testAddFirstEdgeForGivenVertex() {\n\t\tmap.put(\"Boston\", null);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tLinkedHashSet<String> firstEdge = new LinkedHashSet<String>();\n\t\t\tfirstEdge.add(\"New York\");\n\t\t\tmap.put(\"Boston\", firstEdge);\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t}\n\t}", "public boolean addEdge(final int vertice1, final int vertice2) {\n\t\tboolean isAdded = false;\n\n\t\ttry {\n\n\t\t\tadjacencyList[vertice1].add(vertice2);\n\t\t\tadjacencyList[vertice2].add(vertice1);\n\t\t\tisAdded = true;\n\t\t} catch (final Exception exception) {\n\t\t\tSystem.err.println(\"-----ERROR--------\\n\" + exception.getMessage());\n\t\t}\n\n\t\treturn isAdded;\n\t}", "public void addEdge (E vertex1, E vertex2, int edgeWeight) throws IllegalArgumentException\n {\n if(vertex1 == vertex2)\n return;\n \n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n \n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n\n\n if (this.hasEdge (vertex1, vertex2))\n {\n this.removeNode (index1, index2);\n this.removeNode (index2, index1);\n }\n \n Node node = new Node(index2, edgeWeight);\n this.addNode(node, index1);\n node = new Node(index1, edgeWeight);\n this.addNode(node, index2);\n }", "public TransactionBuilder checkInternalVertexExistence();", "@Test\n\tpublic void edgesTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertEquals(2, graph.edges().size());\n\t\tassertTrue(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().contains(edge_1));\n\t}", "public boolean addEdge(Vertex one, Vertex two)\n\t{\n\t\treturn addEdge(one, two, 1);//returns true if added\n\t}", "@Test\n public void testVertices() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v4id = new Vertex (4, \"E\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n assertFalse(g.addVertex(v4id));\n\n Set<Vertex> expectedVertices = new HashSet<>();\n expectedVertices.add(v1);\n expectedVertices.add(v2);\n expectedVertices.add(v3);\n expectedVertices.add(v4);\n\n assertEquals(expectedVertices, g.allVertices());\n\n Assert.assertTrue(g.remove(v1));\n\n }", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "public V addVertex(V v);", "@Test(expected = IllegalArgumentException.class)\n public void testAddAlreadyRegisteredPeer() {\n replay(participantsConfig);\n\n peerManager.activate();\n\n peerManager.addPeerDetails(newPeer.name().get(),\n IpAddress.valueOf(PEER_IP),\n newPeer.connectPoint(),\n newPeer.interfaceName());\n }", "@Test\r\n public void testInsertVertex() {\r\n System.out.println(\"insertVertex\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expectedResult = 1;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "@DisplayName(\"Add undirected edge\")\n @Test\n public void testAddEdgeUndirected() {\n graph.addEdge(new Edge(3, 4));\n List<Integer> l0 = new ArrayList<>();\n l0.add(0);\n List<Integer> l1 = new ArrayList<>();\n l1.add(4);\n Assertions.assertEquals(l0.get(0), graph.getNeighbours(4).get(0));\n Assertions.assertEquals(l1.get(0), graph.getNeighbours(0).get(0));\n }", "@Test\n\tpublic void verticesTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(D));\n\t}", "private void validateVertex(int v) {\r\n\t if (v < 0 || v >= V)\r\n\t throw new IndexOutOfBoundsException(\"vertex \" + v + \" is not between 0 and \" + (V-1));\r\n\t }", "@Test\r\n public void testRemoveVertex() {\r\n System.out.println(\"removeVertex\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expectedResult = 1;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n\r\n expectedResult = 0;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "Vertex addVertex(String name){\n\t\t//if graph doesn't already have the key\n\t\tif (!adjlist.containsKey(name)) {\n\t\t\tkeys.add(name); //places keys in list in order they're added\n\t\t\tvertices++; //increases vertex count variable\n\t\t\treturn adjlist.put(name, new Vertex(name)); //adds to hashmap\n\t\t//if graph does already have the key\n\t\t} else {\n\t\t\treturn adjlist.get(name);\n\t\t}\n\t}", "public boolean addVertex(String label, Object value)\n\t{\n\t\tif(!hasVertex(label)) //if edge does not already exist add it\n\t\t{\n\t\t\tDSAGraphVertex v = new DSAGraphVertex(label, value);\n\t\t\tvertices.insertLast(v); //inserts into vertices list at end\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n void test04_checkOrder() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addVertex(\"d\");\n graph.addVertex(\"e\");\n graph.addVertex(\"f\"); // added 6 items\n if (graph.order() != 6) {\n fail(\"graph has counted incorrect number of vertices\");\n }\n }", "public void addVertex(Vertex v) {\r\n if (vertexNum >= maxNum) {\r\n System.out.println(\"Error\");\r\n return;\r\n }\r\n vertexNum += 1;\r\n vertexList.add(v);\r\n }", "public boolean addVertex(T vertexLabel);", "public void validateVertex(int index) {\n if(!(index < verticesNumber && index >= 0)) {\n throw new IllegalArgumentException(INVALID_VERTEX);\n }\n }", "public void addVertex(String vertexName, E data)\r\n\t{\r\n\t\tif(this.adjacencyMap.containsKey(vertexName))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex already exists in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.dataMap.put(vertexName, data);\r\n\t\tthis.adjacencyMap.put(vertexName, new HashMap<String,Integer>());\r\n\t}", "public void testAddEdgeObjectObject( ) {\n init( );\n\n try {\n m_g1.addEdge( m_v1, m_v1 ); // loops not allowed\n assertFalse( );\n }\n catch( IllegalArgumentException e ) {\n assertTrue( );\n }\n\n try {\n m_g3.addEdge( null, null );\n assertFalse( ); // NPE\n }\n catch( NullPointerException e ) {\n assertTrue( );\n }\n\n try {\n m_g1.addEdge( m_v2, m_v1 ); // no such vertex in graph\n assertFalse( );\n }\n catch( IllegalArgumentException ile ) {\n assertTrue( );\n }\n\n assertNull( m_g2.addEdge( m_v2, m_v1 ) );\n assertNull( m_g3.addEdge( m_v2, m_v1 ) );\n assertNotNull( m_g4.addEdge( m_v2, m_v1 ) );\n }", "public void addVertex(int vertex) {\n if (!adjacencyMap.containsKey(vertex)) {\n adjacencyMap.put(vertex, new HashSet<>());\n }\n }", "boolean addEdge(E edge);", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}" ]
[ "0.7827969", "0.7795871", "0.76207983", "0.736475", "0.7292032", "0.7208947", "0.71969414", "0.7189899", "0.71736515", "0.7158254", "0.71297276", "0.71117914", "0.71088374", "0.70977855", "0.70705974", "0.7018073", "0.70179117", "0.69455314", "0.6944763", "0.69423074", "0.67955804", "0.66726434", "0.6669743", "0.6669743", "0.6664258", "0.6618921", "0.65979487", "0.6580667", "0.65718096", "0.6563125", "0.6547231", "0.6547019", "0.6539145", "0.6494756", "0.64875376", "0.64627546", "0.6459371", "0.64497614", "0.6431813", "0.64284295", "0.64143914", "0.6404479", "0.6403433", "0.63998175", "0.6392733", "0.6386942", "0.635863", "0.635128", "0.63400155", "0.6338232", "0.6337721", "0.6337158", "0.63218963", "0.6319984", "0.6316695", "0.6308519", "0.6301596", "0.62917864", "0.6284839", "0.6244071", "0.6231795", "0.622256", "0.62217146", "0.62063795", "0.6206038", "0.619514", "0.6163709", "0.6151106", "0.6139678", "0.61313957", "0.61237663", "0.61107147", "0.6110134", "0.6108453", "0.61078197", "0.6082237", "0.6072373", "0.6058708", "0.60541767", "0.6044923", "0.60333544", "0.6032518", "0.60225326", "0.6020337", "0.60146314", "0.6007921", "0.60067105", "0.5998144", "0.59904253", "0.59784126", "0.5963941", "0.59562314", "0.5955818", "0.5925403", "0.59179854", "0.59169805", "0.59133446", "0.59054816", "0.590042", "0.5890549" ]
0.64602125
36
tests adding an edge to a graph twice, which should replace the edge's previous cost
@Test public void testPublic3() { Graph<String> graph= TestGraphs.testGraph2(); graph.addEdge("apple", "banana", 2); graph.addEdge("cherry", "date", 3); graph.addEdge("elderberry", "fig", 4); assertEquals(graph.getEdge("apple", "banana"), 2); assertEquals(graph.getEdge("cherry", "date"), 3); assertEquals(graph.getEdge("elderberry", "fig"), 4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "boolean addEdge(E edge);", "public void testAddEdge() {\n System.out.println(\"addEdge\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n graph.addVertex(new Integer(i));\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertTrue(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertFalse(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n }", "@Test\n\tpublic void addEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tassertTrue(graph.addEdge(edge_0));\n\t\tassertFalse(graph.addEdge(edge_0));\n\t}", "public IEdge addEdge(String from, String to, Double cost);", "void addEdge(int source, int destination, int weight);", "public void addEdge(Node src, Node dest, int cost){\n if(nodes.containsKey(src) && nodes.containsKey(dest)){\n Edge newEdge = new Edge(src, dest, cost);\n nodes.get(src).add(dest);\n src.addNodeEdge(newEdge);\n\n Edge otherEdge = new Edge(dest, src, cost);\n nodes.get(dest).add(src);\n dest.addNodeEdge(otherEdge);\n\n\n }\n\n }", "public abstract boolean addEdge(Node node1, Node node2, int weight);", "void add(Edge edge);", "private Edge addEdge(Node source, Node dest, double weight)\r\n\t{\r\n\t final Edge newEdge = new Edge(edgeType, source, dest, weight);\r\n\t if (!eSet.add(newEdge))\r\n\t\tthrow new RuntimeException(\"Edge already exists!\");\r\n\t source.addEdge(newEdge);\n\t return newEdge;\r\n\t}", "private void addEdge(int node1, int node2, int cost, int bandwidth) throws IllegalArgumentException {\n // We can't add edges between non-existent nodes\n int nodeCount = mGraph.getNodeCount();\n if (node1 >= nodeCount || node2 >= nodeCount) {\n throw new IllegalArgumentException();\n }\n\n // Add forward edge\n int edgeCount = mGraph.getEdgeCount() / 2;\n\n Edge forward = mGraph.addEdge(String.valueOf(edgeCount + \"f\"), node1, node2, true);\n forward.addAttribute(\"ui.label\", String.valueOf(edgeCount));\n forward.addAttribute(\"edge.cluster\", String.valueOf(edgeCount));\n forward.addAttribute(\"cost\", cost);\n\n // Add backward edge\n Edge backward = mGraph.addEdge(String.valueOf(edgeCount + \"b\"), node2, node1, true);\n backward.addAttribute(\"edge.cluster\", String.valueOf(edgeCount));\n backward.addAttribute(\"cost\", cost);\n\n // Add edge to the SimpleEdge list\n mEdgeList.add(new SimpleEdge(node1, node2, cost, bandwidth));\n }", "Edge(Vertex first, Vertex second, Integer cost) {\n this.first = first;\n this.second = second;\n this.cost = cost;\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "void addDirectedEdge(final Node first, final Node second)\n {\n if ( first == second )\n {\n return;\n }\n else if (first.connectedNodes.contains(second))\n return;\n else\n first.connectedNodes.add(second);\n }", "@Test\n\tvoid testAddEdge() {\n\t\tgeo_location ge = new GeoLoc(0,1,2);\n\t\tnode_data n0 =new NodeData(0,ge);\n\t\tgeo_location ge1 = new GeoLoc(0,6,2);\n\t\tnode_data n1 =new NodeData(2,ge1);\n\t\tgraph.addNode(n0);\n\t\tgraph.addNode(n1);\n\t\tedge_data e = new EdgeData(0, 2, 20);\n\t\tgraph.connect(0, 2, 20);\n\t\tedge_data actual = graph.getEdge(0, 2);\n\t\tedge_data expected = e;\n\t\tassertEquals(expected.getSrc(), actual.getSrc());\n\t\tassertEquals(expected.getDest(), actual.getDest());\n\t\tassertEquals(expected.getWeight(), actual.getWeight());\n\t}", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}", "@Test\n public void tae1()\n {\n Graph graph = new Graph(0);\n graph.addEdge(0,0);\n System.out.println(graph);\n assertEquals(\"Cannot add edges to a graph of size < 1\",\"Cannot add edges to a graph of size < 1\");\n }", "@Test\n public void testAddExistingEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n public void testSimplify2() {\n ControlFlowGraph graph = new ControlFlowGraph();\n\n ControlFlowNode branch1 = new ControlFlowNode(null, graph, BRANCH);\n ControlFlowNode branch2 = new ControlFlowNode(null, graph, BRANCH);\n ControlFlowNode node1 = new ControlFlowNode(null, graph, STATEMENT);\n ControlFlowNode node2 = new ControlFlowNode(null, graph, STATEMENT);\n ControlFlowNode fictitious = new ControlFlowNode(null, graph, CONVERGE);\n ControlFlowNode fictitious2 = new ControlFlowNode(null, graph, CONVERGE);\n\n\n\n graph.addEdge(branch1, branch2);\n graph.addEdge(branch1, fictitious);\n graph.addEdge(branch2, node1);\n graph.addEdge(branch2, fictitious);\n graph.addEdge(node1, fictitious);\n graph.addEdge(fictitious, fictitious2);\n graph.addEdge(fictitious2, node2);\n\n graph.simplifyConvergenceNodes();\n\n assertTrue(graph.containsEdge(branch1, node2));\n assertTrue(graph.containsEdge(branch2, node2));\n assertTrue(graph.containsEdge(node1, node2));\n assertFalse(graph.containsVertex(fictitious));\n assertFalse(graph.containsVertex(fictitious2));\n }", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "void addEdge(Edge e) {\n if (e.getTail().equals(this)) {\n outEdges.put(e.getHead(), e);\n\n return;\n } else if (e.getHead().equals(this)) {\n indegree++;\n inEdges.put(e.getTail(), e);\n\n return;\n }\n\n throw new RuntimeException(\"Cannot add edge that is unrelated to current node.\");\n }", "@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }", "void addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;", "private void addEdge(int from, int to, int cost) {\r\n\t\tif (edges[from] == null)\r\n\t\t\tedges[from] = new HashMap<Integer, Integer>(INITIAL_MAP_SIZE);\r\n\t\tif (edges[from].put(to, cost) == null)\r\n\t\t\tnumEdges++;\r\n\t}", "public boolean addEdge(Vertex one,Vertex two,int weight)\n\t{\n\t\tif (one.equals(two)) { return false; }\n\t\t\n\t\t//check that edge is not in graph\n\t\tEdge e = new Edge(one,two,weight);\n\t\t//future location to increment trips along\n\t\t//the same path\n\t\tif (edges.containsKey(e.hashCode()))\n\t\t{\n\t\t\te.addTrip();//does not work\n\t\t\treturn false;\n\t\t}\n\t\t//check that edge is not incident to either vertex\n\t\telse if (one.containsNeighbor(e) || two.containsNeighbor(e))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tedges.put(e.hashCode(), e);\n\t\tone.addNeighbor(e);\n\t\ttwo.addNeighbor(e);\n\t\treturn true;\n\t}", "public void addEdge(edge_type edge) {\n //first make sure the from and to nodes exist within the graph\n assert (edge.getFrom() < nextNodeIndex) && (edge.getTo() < nextNodeIndex) :\n \"<SparseGraph::AddEdge>: invalid node index\";\n\n //make sure both nodes are active before adding the edge\n if ((nodeVector.get(edge.getTo()).getIndex() != invalid_node_index)\n && (nodeVector.get(edge.getFrom()).getIndex() != invalid_node_index)) {\n //add the edge, first making sure it is unique\n if (isEdgeNew(edge.getFrom(), edge.getTo())) {\n edgeListVector.get(edge.getFrom()).add(edge);\n }\n\n //if the graph is undirected we must add another connection in the opposite\n //direction\n if (!isDirectedGraph) {\n //check to make sure the edge is unique before adding\n if (isEdgeNew(edge.getTo(), edge.getFrom())) {\n GraphEdge reversedEdge = new GraphEdge(edge.getTo(),edge.getFrom(),edge.getCost());\n edgeListVector.get(edge.getTo()).add(reversedEdge);\n }\n }\n }\n }", "@Test\n void test07_tryToRemoveNonExistentEdge() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n try {\n graph.removeEdge(\"e\", \"f\"); // remove non existent edge\n } catch (Exception e) {\n fail(\"Shouldn't have thrown exception\");\n }\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.add(\"c\"); // creates mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) { // checks if vertices weren't added or removed\n fail(\"wrong vertices are inserted into the graph\");\n }\n if (graph.size() != 2) {\n fail(\"wrong number of edges in the graph\");\n }\n\n }", "public void testAddEdgeEdge( ) {\n init( );\n\n try {\n m_g1.addEdge( m_eLoop ); // loops not allowed\n assertFalse( );\n }\n catch( IllegalArgumentException e ) {\n assertTrue( );\n }\n\n try {\n m_g3.addEdge( null );\n assertFalse( ); // NPE\n }\n catch( NullPointerException e ) {\n assertTrue( );\n }\n\n Edge e = m_eFactory.createEdge( m_v2, m_v1 );\n\n try {\n m_g1.addEdge( e ); // no such vertex in graph\n assertFalse( );\n }\n catch( IllegalArgumentException ile ) {\n assertTrue( );\n }\n\n assertEquals( false, m_g2.addEdge( e ) );\n assertEquals( false, m_g3.addEdge( e ) );\n assertEquals( true, m_g4.addEdge( e ) );\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "public void addEdge(Edge edge){\n \n synchronized(vertexes){\n Long start = edge.getStart();\n Vertex sVertex = vertexes.get(start);\n if(sVertex != null){\n sVertex.addEdge(edge, true);\n }\n// if undirected graph then adds edge to the finish vertex too \n if(!edge.isDirected()){\n Long finish = edge.getFinish();\n Vertex fVertex = vertexes.get(finish);\n if(fVertex != null){\n fVertex.addEdge(edge, false);\n }\n }\n }\n \n }", "public boolean canAddEdge(Edge newEdge){\n\t\t/*\n\t\tif(v1.equals(v2)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tEdge newEdge = new Edge(v1, v2, weight);\n\t\t*/\n\t\tif(edges.containsKey(newEdge.hashCode())){\n\t\t\treturn false;\n\t\t\t\n\t\t\t/*\n\t\t// Edge already has been assigned to a vertex\n\t\t}else if(v1.containsConnection(newEdge) || v2.containsConnection(newEdge)){\n\t\t\treturn false;\n\t\t\t*/\n\t\t}\n\t\t\n\t\t\n\t\t// If edge passes all the above tests then add edge to graph\n\t\taddEdge(newEdge);\n\t\treturn true;\n\t}", "public void addEdge(int start, int end, double weight);", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "public void testRemoveEdge_edge() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(\n graph.removeEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "private final void addTemporaryEdge(int v1, int v2, float weight) {\n // We assume that expansion is never needed.\n /*if (nEdges >= edgeWeights.length) {\n edgeWeights = Arrays.copyOf(edgeWeights, edgeWeights.length*2);\n edgeLevels = Arrays.copyOf(edgeLevels, edgeLevels.length*2);\n isMarkedIndex = Arrays.copyOf(isMarkedIndex, isMarkedIndex.length*2);\n }*/\n int edgeIndex = nEdges;\n\n // add edge to v1\n {\n int index = nOutgoingEdgess[v1];\n if (index >= outgoingEdgess[v1].length) {\n int newLength = outgoingEdgess[v1].length*2;\n outgoingEdgess[v1] = Arrays.copyOf(outgoingEdgess[v1], newLength);\n outgoingEdgeIndexess[v1] = Arrays.copyOf(outgoingEdgeIndexess[v1], newLength);\n outgoingEdgeIsMarkeds[v1] = Arrays.copyOf(outgoingEdgeIsMarkeds[v1], newLength);\n }\n outgoingEdgess[v1][index] = v2;\n outgoingEdgeIndexess[v1][index] = edgeIndex;\n nOutgoingEdgess[v1]++;\n }\n\n edgeWeights[edgeIndex] = weight;\n edgeLevels[edgeIndex] = 0;\n isMarked[edgeIndex] = false;\n ++nEdges;\n }", "public abstract boolean putEdge(Edge incomingEdge);", "private static void addTripToGraph(Trip newTrip, Graph<Node, WeightEdge> graph, List<Node> depots, List<Node> trips, Problem problem){\n Node tripStart = new Node(newTrip, 0, false);\n Node tripEnd = new Node(newTrip, 0, true);\n\n graph.addVertex(tripStart);\n graph.addVertex(tripEnd);\n\n // Add weightEdgeWithBounders from trip startPoint to trip endPoint\n // lowerBound and upperBound for this edges is 1, because we are looking for solution that saturates all trips\n WeightEdge tripInternalWeightEdge = new BoundedWeightEdge(1,1);\n graph.addEdge(tripStart, tripEnd, tripInternalWeightEdge);\n graph.setEdgeWeight(tripInternalWeightEdge, 0);\n\n for(Node depot : depots){\n if(depot.isExitNode()){ // is source\n // add weightEdgeWithBounders from depot source to trip startPoint\n WeightEdge depotToTripWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(depot, tripStart, depotToTripWeightEdge);\n graph.setEdgeWeight(depotToTripWeightEdge, problem.getCost(depot.getLocation(), tripStart.getLocation()).toMinutes());\n }else{ // is depot sink\n // add weightEdgeWithBounders from trip endPoint to depot sink\n WeightEdge tripToDepotWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(tripEnd, depot, tripToDepotWeightEdge);\n graph.setEdgeWeight(tripToDepotWeightEdge, problem.getCost(tripEnd.getLocation(), depot.getLocation()).toMinutes());\n }\n }\n\n for(Node otherTrip : trips){\n if(otherTrip.isExitNode()){\n // add feasible edges from all trips endPoints to this trip startPoint\n if(isFeasibleEdge(otherTrip, tripStart, problem)){\n WeightEdge otherTripToThisTrip = new BoundedWeightEdge(0, 1);\n graph.addEdge(otherTrip, tripStart, otherTripToThisTrip);\n graph.setEdgeWeight(otherTripToThisTrip, problem.getCost(otherTrip.getLocation(), tripStart.getLocation()).toMinutes());\n }\n }else{\n // add feasible edges from this trip endPoint to all trips startPoints\n if(isFeasibleEdge(tripEnd, otherTrip, problem)){\n WeightEdge thisTripToOtherTrip = new BoundedWeightEdge(0, 1);\n graph.addEdge(tripEnd, otherTrip, thisTripToOtherTrip);\n graph.setEdgeWeight(thisTripToOtherTrip, problem.getCost(tripEnd.getLocation(), otherTrip.getLocation()).toMinutes());\n }\n }\n }\n\n // add this nodes in our trips list;\n trips.add(tripStart);\n trips.add(tripEnd);\n }", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "private final void addEdge(int v1, int v2, float weight) {\n if (nEdges >= edgeWeights.length) {\n edgeWeights = Arrays.copyOf(edgeWeights, edgeWeights.length*2);\n }\n int edgeIndex = nEdges;\n\n // add edge to v1\n int v1Index;\n {\n v1Index = nOutgoingEdgess[v1];\n if (v1Index >= outgoingEdgess[v1].length) {\n int newLength = outgoingEdgess[v1].length*2;\n outgoingEdgess[v1] = Arrays.copyOf(outgoingEdgess[v1], newLength);\n outgoingEdgeIndexess[v1] = Arrays.copyOf(outgoingEdgeIndexess[v1], newLength);\n outgoingEdgeIsMarkeds[v1] = Arrays.copyOf(outgoingEdgeIsMarkeds[v1], newLength);\n outgoingEdgeOppositeIndexess[v1] = Arrays.copyOf(outgoingEdgeOppositeIndexess[v1], newLength);\n }\n outgoingEdgess[v1][v1Index] = v2;\n outgoingEdgeIndexess[v1][v1Index] = edgeIndex;\n nOutgoingEdgess[v1]++;\n }\n\n // add edge to v2\n int v2Index;\n {\n v2Index = nOutgoingEdgess[v2];\n if (v2Index >= outgoingEdgess[v2].length) {\n int newLength = outgoingEdgess[v2].length*2;\n outgoingEdgess[v2] = Arrays.copyOf(outgoingEdgess[v2], newLength);\n outgoingEdgeIndexess[v2] = Arrays.copyOf(outgoingEdgeIndexess[v2], newLength);\n outgoingEdgeIsMarkeds[v2] = Arrays.copyOf(outgoingEdgeIsMarkeds[v2], newLength);\n outgoingEdgeOppositeIndexess[v2] = Arrays.copyOf(outgoingEdgeOppositeIndexess[v2], newLength);\n }\n outgoingEdgess[v2][v2Index] = v1;\n outgoingEdgeIndexess[v2][v2Index] = edgeIndex;\n nOutgoingEdgess[v2]++;\n }\n\n outgoingEdgeOppositeIndexess[v1][v1Index] = v2Index;\n outgoingEdgeOppositeIndexess[v2][v2Index] = v1Index;\n \n edgeWeights[nEdges] = weight;\n ++nEdges;\n }", "public TransitionSystemEdge addEdge(TransitionSystemEdge newEdge) {\n\t\tTransitionSystemVertex v1 = (TransitionSystemVertex) newEdge\n\t\t\t\t.getSource();\n\t\tTransitionSystemVertex v2 = (TransitionSystemVertex) newEdge.getDest();\n\n\t\tHashSet edges = this.getEdgesBetween(v1, v2);\n\t\tif ((v1 != v2) && (edges.size() > 1)) { // 1 - created edge\n\t\t\t// The edge has been created, hence the nodes v1 and v2 know about\n\t\t\t// it.\n\t\t\t// and newEdge is not an inEdge of v1 (hence false as 2nd argument)\n\t\t\tv1.removeEdge(newEdge, false);\n\t\t\t// The edge has been created, hence the nodes v1 and v2 know about\n\t\t\t// it.\n\t\t\t// and newEdge is an inEdge of v2 (hence true as 2nd argument)\n\t\t\tv2.removeEdge(newEdge, true);\n\n\t\t\tIterator it = edges.iterator();\n\t\t\treturn (TransitionSystemEdge) it.next();\n\t\t} else if ((v1 == v2) && (edges.size() >= 2)) { // a tricky check for\n\t\t\t// the case of loops\n\t\t\tIterator it = edges.iterator();\n\t\t\tTransitionSystemEdge existingEdge = null;\n\t\t\tint k = 0;\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tTransitionSystemEdge anEdge = (TransitionSystemEdge) it.next();\n\t\t\t\tif (anEdge.getIdentifier().equals(newEdge.getIdentifier())) {\n\t\t\t\t\tk++;\n\t\t\t\t\texistingEdge = anEdge;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (k == 1) {\n\t\t\t\tsuper.addEdge(newEdge);\n\t\t\t\treturn newEdge;\n\t\t\t} else {\n\t\t\t\t// The edge has been created, hence the nodes v1 and v2 know\n\t\t\t\t// about it.\n\t\t\t\t// and newEdge is not an inEdge of v1 (hence false as 2nd\n\t\t\t\t// argument)\n\t\t\t\tv1.removeEdge(newEdge, false);\n\t\t\t}\n\t\t\t// The edge has been created, hence the nodes v1 and v2 know about\n\t\t\t// it.\n\t\t\t// and newEdge is an inEdge of v2 (hence true as 2nd argument)\n\t\t\tv2.removeEdge(newEdge, true);\n\t\t\treturn existingEdge;\n\t\t} else {\n\t\t\tsuper.addEdge(newEdge);\n\t\t\treturn newEdge;\n\t\t}\n\t}", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "public int edgeCost(Vertex a, Vertex b) {\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n int cost = -1;\n if (adjacentVertices(a).contains(b)) {\n //create a copy of all the edges at the passed in Vertex a\n //to restrict any reference to interals of this class\n Collection<Edge> copyOfEdges = new ArrayList<Edge>();\n copyOfEdges.addAll(myGraph.get(a));\n\n Iterator<Edge> edges = copyOfEdges.iterator();\n while(edges.hasNext()){\n Edge currEdge = edges.next();\n if(currEdge.getDestination().equals(b)) {\n cost = currEdge.getWeight();\n }\n }\n }\n return cost;\n }", "void addEdge(Edge e) {\n\t\t\tif(!_edges.containsKey(e.makeKey())) {\n\t\t\t\t_edges.put(e.makeKey(),e);\n\t\t\t\te._one.addNeighborEdge(e);\n\t\t\t\te._two.addNeighborEdge(e);\n\t\t\t}\n\t\t}", "void addEdge(int one, int two, boolean redundant) {\n\t\tif (redundant == true) {\n\t\t\tadjacencyList[one].add(two);\n\t\t\tadjacencyList[two].add(one);\n\t\t}\n\t\telse if (one < two) {\n\t\t\tadjacencyList[one].add(two);\n\t\t}\n\t\telse {\n\t\t\tadjacencyList[two].add(one);\n\t\t}\n\t}", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "protected static <V, E extends WeightedEdge> boolean addEgdeWithWeigth(IWeightedGraph<V, E> graph, V firstVertex,\r\n\t\t\tV secondVertex, E edge, double weight) {\r\n\t\ttry {\r\n\t\t\tgraph.addEdge(firstVertex, secondVertex, edge);\r\n\t\t\tgraph.setEdgeWeight(graph.getEdge(firstVertex, secondVertex), weight);\r\n\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void addDirectedEdge(String startVertex, String endVertex, int cost)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.adjacencyMap.get(startVertex).put(endVertex, cost);\r\n\t}", "public void addEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge = new Edge(v1, v2, edgeInfo);\n if(adjLists[v1].contains(edge)){\n return;\n }\n adjLists[v1].addLast(edge);\n }", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "@Test\n public void testSimplify() {\n ControlFlowGraph graph = new ControlFlowGraph();\n\n ControlFlowNode branch1 = new ControlFlowNode(null, graph, BRANCH);\n ControlFlowNode branch2 = new ControlFlowNode(null, graph, BRANCH);\n ControlFlowNode node1 = new ControlFlowNode(null, graph, STATEMENT);\n ControlFlowNode node2 = new ControlFlowNode(null, graph, STATEMENT);\n ControlFlowNode fictitious = new ControlFlowNode(null, graph, CONVERGE);\n\n graph.addEdge(branch1, branch2);\n graph.addEdge(branch1, fictitious);\n graph.addEdge(branch2, node1);\n graph.addEdge(branch2, fictitious);\n graph.addEdge(node1, fictitious);\n graph.addEdge(fictitious, node2);\n\n graph.simplifyConvergenceNodes();\n\n assertTrue(graph.containsEdge(branch1, node2));\n assertTrue(graph.containsEdge(branch2, node2));\n assertTrue(graph.containsEdge(node1, node2));\n assertFalse(graph.containsVertex(fictitious));\n }", "public void addEdge(Edge e) {\n int v = e.either();\n int w = e.other(v);\n adj[v].add(e);\n adj[w].add(e);\n E++;\n }", "public void addEdge(Edge edgeToAdd){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == edgeToAdd.end()){\n edge.setWeight(edgeToAdd.weight()); // Change weight and return if edge is present\n return;\n }\n }\n this.edges.add(edgeToAdd); // Add edge normally\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "protected void addEdges(IWeightedGraph<GraphNode, WeightedEdge> graph) {\r\n\t\tQueue<GraphNode> nodesToWorkOn = new LinkedList<GraphNode>();\r\n\r\n\t\taddDefaultEdges(graph, nodesToWorkOn);\r\n\r\n\t\t// Check each already connected once node against all other nodes to\r\n\t\t// find a possible match between the combined effects of the path + the\r\n\t\t// worldState and the preconditions of the current node.\r\n\t\twhile (!nodesToWorkOn.isEmpty()) {\r\n\t\t\tGraphNode node = nodesToWorkOn.poll();\r\n\r\n\t\t\t// Select only node to which a path can be created (-> targets!)\r\n\t\t\tif (!node.equals(this.startNode) && !this.endNodes.contains(node)) {\r\n\t\t\t\ttryToConnectNode(graph, node, nodesToWorkOn);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "public boolean addEdge(Edge edge) {\r\n\t\treturn true;\r\n\t}", "@Test\r\n public void testRemoveEdge() {\r\n System.out.println(\"removeEdge\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n expectedResult = 1;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n\r\n expectedResult = 0;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "@DisplayName(\"Add undirected edge\")\n @Test\n public void testAddEdgeUndirected() {\n graph.addEdge(new Edge(3, 4));\n List<Integer> l0 = new ArrayList<>();\n l0.add(0);\n List<Integer> l1 = new ArrayList<>();\n l1.add(4);\n Assertions.assertEquals(l0.get(0), graph.getNeighbours(4).get(0));\n Assertions.assertEquals(l1.get(0), graph.getNeighbours(0).get(0));\n }", "public boolean addEdge(Edge e) {\n return g.addNode(e.getSrc())&&g.addNode(e.getDst())&&g.addEdge(e.getSrc(),e.getDst());\n }", "public void edgeMake(int vertex1, int vertex2) {\n addVertex(vertex1); // both vertices added to the set\n addVertex(vertex2);\n adjacencyMap.get(vertex1).add(vertex2); // both vertices receive the edge\n adjacencyMap.get(vertex2).add(vertex1);\n }", "@Test\n\tvoid testAddSecondEdgeForGivenVertex() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tedges.add(\"Newark\");\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"Newark\"));\n\t\t}\n\t}", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\n public void testGraphElements(){\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v5 = new Vertex(5, \"E\");\n Vertex v6 = new Vertex(6, \"F\");\n Vertex v7 = new Vertex(7, \"G\");\n Vertex v8 = new Vertex(8, \"H\");\n\n Vertex fakeVertex = new Vertex(100, \"fake vertex\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v3, v4, 1);\n Edge<Vertex> e4 = new Edge<>(v2, v4, 1);\n Edge<Vertex> e5 = new Edge<>(v2, v6, 1);\n Edge<Vertex> e6 = new Edge<>(v2, v5, 10);\n Edge<Vertex> e7 = new Edge<>(v5, v6, 10);\n Edge<Vertex> e8 = new Edge<>(v4, v6, 10);\n Edge<Vertex> e9 = new Edge<>(v6, v7, 10);\n Edge<Vertex> e10 = new Edge<>(v7, v8, 10);\n\n Edge<Vertex> fakeEdge = new Edge<>(fakeVertex, v1);\n Edge<Vertex> edgeToRemove = new Edge<>(v2, v7, 200);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addVertex(v5);\n g.addVertex(v6);\n g.addVertex(v7);\n g.addVertex(v8);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n g.addEdge(e6);\n g.addEdge(e7);\n g.addEdge(e8);\n g.addEdge(e9);\n g.addEdge(edgeToRemove);\n\n Assert.assertTrue(g.addEdge(e10));\n\n //adding null edge or vertex to graph returns false\n Assert.assertFalse(g.addEdge(null));\n Assert.assertFalse(g.addVertex(null));\n\n //adding edge with a vertex that does not exist in graph g returns false\n Assert.assertFalse(g.addEdge(fakeEdge));\n\n //get an edge that does not exit in graph returns false\n Assert.assertFalse(g.edge(v1, fakeVertex));\n\n //getting length of edge from vertex not in graph g returns false\n Assert.assertEquals(0, g.edgeLength(fakeVertex, v2));\n\n //Remove an edge in graph g returns true\n Assert.assertTrue(g.remove(edgeToRemove));\n\n //Removing edge not in graph g returns false\n Assert.assertFalse(g.remove(fakeEdge));\n\n //Removing vertex not in graph g returns false\n Assert.assertFalse(g.remove(fakeVertex));\n\n //Finding an edge with an endpoint not in graph g returns null\n assertNull(g.getEdge(v1, fakeVertex));\n }", "@Test\n public void sourceEqualsTarget() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(0, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n assertPath(calcPath(0, 0, 0, 1), 0.3, 3, 300, nodes(0, 1, 2, 0));\n assertPath(calcPath(0, 0, 1, 0), 0.3, 3, 300, nodes(0, 2, 1, 0));\n // without restrictions the weight should be zero\n assertPath(calcPath(0, 0, ANY_EDGE, ANY_EDGE), 0, 0, 0, nodes(0));\n // in some cases no path is possible\n assertNotFound(calcPath(0, 0, 1, 1));\n assertNotFound(calcPath(0, 0, 5, 1));\n }", "@Test\n\tpublic void edgesTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertEquals(2, graph.edges().size());\n\t\tassertTrue(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().contains(edge_1));\n\t}", "public void addEdge(Edge e)\r\n\t{\n\t\tint v = e.either(), w = e.other(v);\r\n\t\tadj[v].add(e);\r\n\t\tadj[w].add(e);\r\n\t}", "@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }", "private static NodeWithWeightDistanceTotal updateNextNodeAlgo2(Node nextNode, Edge edge, Integer weightDistanceTotal) {\n if (edge.weight + edge.getDestination().getDistanceToZ() < weightDistanceTotal) {\n weightDistanceTotal = (edge.weight + edge.getDestination().getDistanceToZ());\n return new NodeWithWeightDistanceTotal(edge.destination, weightDistanceTotal);\n // System.out.println(nextNode.getName());\n }\n return new NodeWithWeightDistanceTotal(nextNode, weightDistanceTotal);\n }", "public void testRemoveEdgeEdge( ) {\n init( );\n\n assertEquals( m_g4.edgeSet( ).size( ), 4 );\n m_g4.removeEdge( m_v1, m_v2 );\n assertEquals( m_g4.edgeSet( ).size( ), 3 );\n assertFalse( m_g4.removeEdge( m_eLoop ) );\n assertTrue( m_g4.removeEdge( m_g4.getEdge( m_v2, m_v3 ) ) );\n assertEquals( m_g4.edgeSet( ).size( ), 2 );\n }", "void addEdge(int s1,int c,int s2)\r\n\t{\r\n\t\tg[s1][c][s2]=true;\r\n\t}", "private void checkEdgeExistance(Node a, Node b, int weight) {\n for (Edge edge : a.getEdges()) {\n if (edge.getSource() == a && edge.getDestination() == b) {\n edge.setWeight(weight);\n return;\n }\n }\n a.getEdges().add(new Edge(a, b, weight));\n }", "protected void addEdge(CyEdge edge, LayoutNode v1, LayoutNode v2) {\n\tLayoutEdge newEdge = new LayoutEdge(edge, v1, v2);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }", "public boolean addEdge(T begin, T end, int weight);", "@Override\n public void addEdge(V source, V destination, double weight)\n {\n super.addEdge(source, destination, weight);\n super.addEdge(destination, source, weight);\n }", "@Test\n public void worksWithTurnCosts() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 4).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(0, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 2).setDistance(1).set(speedEnc, 10, 10);\n\n setRestriction(0, 3, 4);\n setTurnCost(4, 5, 2, 6);\n\n // due to the restrictions we have to take the expensive path with turn costs\n assertPath(calcPath(0, 2, 0, 6), 6.4, 4, 6400, nodes(0, 1, 4, 5, 2));\n // enforcing going south from node 0 yields no path, because of the restricted turn 0->3->4\n assertNotFound(calcPath(0, 2, 3, ANY_EDGE));\n // without the restriction its possible\n assertPath(calcPath(0, 2, ANY_EDGE, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n }", "public boolean addEdge(Vertex one, Vertex two)\n\t{\n\t\treturn addEdge(one, two, 1);//returns true if added\n\t}", "public static Multigraph smartAddEdge(Multigraph graph, Edge edge, boolean stopIfMissing) {\n\n if (!graph.containsVertex(edge.getSource())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing source node for edge \"+ edge);\n }\n graph.addVertex(edge.getSource());\n }\n if (!graph.containsVertex(edge.getDestination())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing destination node for edge \"+ edge);\n }\n graph.addVertex(edge.getDestination());\n }\n //That a good mapping edge, add to the related query\n graph.addEdge(edge.getSource(), edge.getDestination(), edge.getLabel());\n return graph;\n }", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "@Test\r\n public void testEdges() {\r\n System.out.println(\"edges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Collection colection = instance.edges();\r\n boolean result = colection.contains(e);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n result = colection.contains(e);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "@Test\n\tpublic void test() {\n\t\tAssert.assertNotEquals(null, vertex.getEdges());\n\t\t\n\t\t// Check no edges are initially connected\n\t\tAssert.assertEquals(0, vertex.degree());\n\t\t\n\t\t// Check an edge can be added correctly\n\t\ttEdge = new Edge(vertex, new Vertex(\"test2\"));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using existing edge\n\t\tvertex.add(tEdge);\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using new edge\n\t\tvertex.add(new Edge(vertex, new Vertex(\"test2\")));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check edges can be removed correctly\n\t\tvertex.remove(\"test2\");\n\t\tAssert.assertEquals(0, vertex.degree());\n\t}", "void addEdge(int x, int y);", "public void addEdge(String source, String destination, double cost, boolean status) {\r\n\r\n\t\tboolean flag = false;\r\n\t\tVertex v = getVertex(source, status);\r\n\t\tVertex w = getVertex(destination, status);\r\n\t\tEdge edge = new Edge(v, w, cost, status);\r\n\t\tif (v.adjacent.size() == 0)\r\n\t\t\tv.adjacent.add(edge);\r\n\t\telse {\r\n\t\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\t\tEdge adj = (Edge) i.next();\r\n\t\t\t\tif (adj.getDestination().equals(destination)) {\r\n\t\t\t\t\tadj.setCost(cost);\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else\r\n\t\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (!flag)\r\n\t\t\t\tv.adjacent.add(edge);\r\n\t\t}\r\n\t}", "@Override\n public void addEdge(E pEdge, TimeFrame tf) {\n \n // If The Edge ID is not initialized yet, initalialize it\n if (pEdge.getId() < 0) {\n int id = edgeIdGen.getNextAvailableID();\n pEdge.setId(id);\n mapAllEdges.add(id, pEdge);\n //System.out.println(\"\\t\\t\\t\\t\\t\\t====***************** DynamicGraph.addEdge() edge (id, mapAllEdges.size) = \" + id + \", \" + mapAllEdges.size());\n }\n // Adding to the adjacent list\n if (!darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).add(pEdge);\n //System.out.println(\"\\t\\t\\t\\t\\t\\t====***************** DynamicGraph.addEdge() ading to darrGlobalAdjList \");\n if(!pEdge.isDirected() &&\n !darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).contains(pEdge)) {\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).add(pEdge);\n }\n }\n \n hmpGraphsAtTimeframes.get(tf).addEdge(pEdge);\n \n }", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public boolean addEdge(String id1, String id2, Integer weight)\n\t{\n\t\t// if its a new edge, or a new edge weight\n\t\tif (!hasEdge(id1, id2) || (weight != null && edgeWeight(id1, id2) == null))\n\t\t{\n\t\t\tNode n1 = getNode(id1);\n\t\t\tNode n2 = getNode(id2);\n\t\t\tn1.addEdge(n2, weight);\n\t\t\tn2.addEdge(n1, weight);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "public void testContainsEdgeEdge( ) {\n init( );\n\n //TODO Implement containsEdge().\n }", "@Test\r\n void test_insert_edges_remove_edges_check_size() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n\r\n // There are no more edges in the graph\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"A\", \"E\");\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n }", "public void addEdge(Graph graph, int source, int destination, double weight){\r\n\r\n Node node = new Node(destination, weight);\r\n LinkedList<Node> list = null;\r\n\r\n //Add an adjacent Node for source\r\n list = adjacencyList.get((double)source);\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)source, list);\r\n\r\n //Add adjacent node again since graph is undirected\r\n node = new Node(source, weight);\r\n\r\n list = null;\r\n\r\n list = adjacencyList.get((double)destination);\r\n\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)destination, list);\r\n }", "public Edge addEdge(Node p_a, Node p_b) {\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\tif(edges.add(edge)) {\n\t\t\t\n\t\t\t// The weight is only updated if the edge was not in the graph\n\t\t\tweights.put(edge.hashCode(), DEFAULT_WEIGHT);\n\t\t}\n\t\treturn edge;\n\t}", "public void addEdge(StubEdge e) {\n }", "@Override\n\tpublic boolean addEdge(ET edge)\n\t{\n\t\tif (edge == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (edgeList.contains(edge))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tList<N> graphNodes = edge.getAdjacentNodes();\n\t\tfor (N node : graphNodes)\n\t\t{\n\t\t\taddNode(node);\n\t\t\tnodeEdgeMap.get(node).add(edge);\n\t\t}\n\t\tedgeList.add(edge);\n\t\tgcs.fireGraphEdgeChangeEvent(edge, EdgeChangeEvent.EDGE_ADDED);\n\t\treturn true;\n\t}", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "boolean addEdge(V v, V w, double weight);", "@Override\n public boolean addEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n dictionary.get(vertex1).add(vertex2);\n dictionary.get(vertex2).add(vertex1);\n return true;\n } else {\n return false;\n }\n }", "@Test\n void testDeepCopy(){\n weighted_graph g = new WGraph_DS();\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.addNode(1);\n g.addNode(2);\n g.addNode(3);\n g.addNode(4);\n g.connect(1,2,13);\n g.connect(1,3,14);\n g.connect(1,4,15);\n g.connect(2,3,23);\n weighted_graph g1 = ga.copy();\n g1.removeNode(3);\n assertNotNull(g.getNode(3));\n assertEquals(14,g.getEdge(1,3));\n assertNull(g1.getNode(3));\n assertEquals(-1,g1.getEdge(1,3));\n }" ]
[ "0.7316444", "0.7113837", "0.6996365", "0.6612842", "0.66079223", "0.6607612", "0.6584149", "0.6560712", "0.6533573", "0.65314853", "0.65162086", "0.6478298", "0.6434205", "0.64094216", "0.63963705", "0.6378145", "0.63570946", "0.63496435", "0.63455296", "0.6303726", "0.62905777", "0.62891304", "0.6281553", "0.6264509", "0.6239278", "0.62345237", "0.6215488", "0.62010247", "0.6199852", "0.6194644", "0.61929566", "0.6189065", "0.61787516", "0.6178015", "0.61486757", "0.61407006", "0.61254835", "0.61243653", "0.61180544", "0.61180234", "0.6116513", "0.61157346", "0.611454", "0.61067915", "0.61049247", "0.6103163", "0.60985863", "0.60947675", "0.6090474", "0.6087279", "0.60761184", "0.6073393", "0.60601264", "0.6054812", "0.604241", "0.60358495", "0.6031691", "0.602813", "0.6026857", "0.60250247", "0.60215086", "0.6013726", "0.5995389", "0.5985106", "0.5984833", "0.59777397", "0.5973947", "0.5972863", "0.59720576", "0.5965552", "0.5963333", "0.59595007", "0.59432316", "0.5939117", "0.5932801", "0.59299654", "0.5929582", "0.592882", "0.59274274", "0.5925236", "0.5919961", "0.59197485", "0.5919632", "0.5910275", "0.5905204", "0.5891932", "0.58911985", "0.5884697", "0.5882305", "0.58765644", "0.58687127", "0.58632636", "0.5849019", "0.5847041", "0.58452487", "0.5838267", "0.5830917", "0.58308965", "0.58182454", "0.58122087", "0.58005327" ]
0.0
-1
calls getNeighbors() on the only vertex in a small graph that has an edge (the only edge), to the only other vertex, and ensures that the adjacent vertex is in the set returned
@Test public void testPublic4() { Graph<Character> graph= TestGraphs.testGraph1(); assertEquals("B", TestGraphs.collToString(graph.getNeighbors('A'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "Set<Edge> getIncomingNeighborEdges(boolean onUpwardPass) {\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\treturn outgoingEdges;\n\t\t}", "public Set<V> getNeighbours(V vertex);", "Set<E> getForwardNeighbors();", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "private List<Node> getAdjacentNodes(Node current, List<Node> closedSet, Node dest) {\n\t\tList<Node> adjacent = new ArrayList<Node>();\n\t\t\n\t\tfor (int i = -1; i <=1; i++) {\n\t\t\tinner:\n\t\t\tfor (int j = -1; j <=1; j++) {\n\t\t\t\tif (i == 0 && j == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tint x = current.getX() + i;\n\t\t\t\tint y = current.getY() + j;\n\t\t\t\tif (!currentState.inBounds(x, y)\n\t\t\t\t\t\t|| board.getHasTree(x, y)\n\t\t\t\t\t\t|| peasantAt(x,y)\n\t\t\t\t\t\t|| board.getTowerProbability(x, y) == 1\n\t\t\t\t\t\t|| isTownHallAt(x, y, dest)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tNode node = new Node(x, y, getHitProbability(x, y), current);\n\t\t\t\tfor (Node visitedNode : closedSet) {\n\t\t\t\t\tif (node.equals(visitedNode)) {\n\t\t\t\t\t\tcontinue inner;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tadjacent.add(node);\n\t\t\t}\n\t\t}\n//\t\tSystem.out.println(\"AT \" + current);\n//\t\tSystem.out.println(\"NEIGHBORS:\");\n//\t\tfor (Node node : adjacent) {\n//\t\t\tSystem.out.println(\"\\t\" + node);\n//\t\t}\n\t\t\n\t\treturn adjacent;\n\t}", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "Set<Edge> getUpwardOutgoingNeighborEdges() {\n\t\t\tif(!_bumpOnUpwardPass) {\n\t\t\t\tSystem.err.println(\"calling upward pass neighbor method on downward pass!\");\n\t\t\t}\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID > v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn outgoingEdges;\n\t\t\t\tSystem.out.println(this.toString()+\"'s outgoing edges:\\n\"+ outgoingEdges);\n\t\t\t\treturn outgoingEdges;\n\t\t}", "private List<Node> getNeighbors(Node node) {\n List<Node> neighbors = new LinkedList<>();\n\n for(Node adjacent : node.getAdjacentNodesSet()) {\n if(!isSettled(adjacent)) {\n neighbors.add(adjacent);\n }\n }\n\n return neighbors;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList<Node<A>> neighbours(){\n\t\t\n\t\tArrayList<Node<A>> output = new ArrayList<Node<A>>();\n\t\t\n\t\tif (g == null) return output;\n\t\t\n\t\tfor (Object o: g.getEdges()){\n\n\t\t\t\n\t\t\tif (((Edge<?>)o).getTo().equals(this)) {\n\t\t\t\t\n\t\t\t\tif (!output.contains(((Edge<?>)o).getFrom()))\n\t\t\t\t\t\toutput.add((Node<A>) ((Edge<?>)o).getFrom());\n\t\t\t\t\n\t\t\t}\n\n\t\t} \n\t\treturn output;\n\t\t\n\t}", "public Set<Edge<V>> edgeSet();", "protected abstract List<Integer> getNeighbors(int vertex);", "@Override\n public Set<T> getNeighbors(T v) {\n int index = getVInfoIndex(v);\n\n // check for an error and throw exception\n // if vertices not in graph\n if (index == -1) {\n throw new IllegalArgumentException(\"DiGraph getNeighbors(): vertex not in graph\");\n }\n HashSet<T> edgeSet = new HashSet<T>();\n VertexInfo<T> vtxInfo = vInfo.get(index);\n Iterator<Edge> iter = vtxInfo.edgeList.iterator();\n Edge e = null;\n\n while (iter.hasNext()) {\n e = iter.next();\n edgeSet.add(vInfo.get(e.dest).vertex);\n }\n\n return edgeSet;\n\n }", "Set<Edge> getDownwardOutgoingNeighborEdges() {\n\t\t\tif(_bumpOnUpwardPass) {\n\t\t\t\tSystem.err.println(\"calling downward pass neighbor method on upward pass!\");\n\t\t\t}\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\tSystem.out.println(this.toString()+\"'s outgoing edges:\\n\"+ outgoingEdges);\n\t\t\t\treturn outgoingEdges;\n\t\t}", "public abstract Set<? extends EE> edgesOf(VV vertex);", "public void testEdgesSet_ofVertex() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i));\n\n Assert.assertEquals(set.size(), i % 2 == 0 ? 25 : 23);\n for (Edge<Integer> edge : set) {\n Assert.assertTrue((edge.getTargetVertex() + i) % 2 == 0);\n }\n }\n }", "public static Long neighborPairsSingle(Set<Integer>[] graph) {\n long triangleCount = 0;\n int degv, degu, degw;\n for (int v = 0; v < graph.length; v++) {\n degv = graph[v].size();\n for (Integer u : graph[v]) {\n degu = graph[u].size();\n if (degu > degv || (degu == degv && v < u)) {\n for (Integer w : graph[v]) {\n if (w <= u)\n continue;\n degw = graph[w].size();\n if (degw > degv || (degw == degv && v < w)) {\n if (graph[u].contains(w))\n triangleCount++;\n }\n }\n }\n }\n }\n return triangleCount;\n }", "public Set<E> primMST() throws NegativeWeightEdgeException, DisconnectedGraphException;", "protected abstract Set<T> findNeighbors(T node, Map<T, T> parentMap);", "private Set<Edge> reachableDAG(Vertex start, Vertex obstacle) {\n \tHashSet<Edge> result = new HashSet<Edge>();\n \tVector<Vertex> currentVertexes = new Vector<Vertex>();\n \tint lastResultNumber = 0;\n \tcurrentVertexes.add(start);\n \t\n \tdo {\n \t\t//System.out.println(\"size of currentVertexes:\" + currentVertexes.size());\n \t\t\n \t\tVector<Vertex> newVertexes = new Vector<Vertex>();\n \t\tlastResultNumber = result.size();\n \t\t\n \t\tfor (Vertex v : currentVertexes) {\n \t\t\t//System.out.println(\"layerID:\" + v.layerID + \"\\tlabel:\" + v.label);\n \t\t\taddIncomingEdges(v, obstacle, result, newVertexes);\n \t\t\taddOutgoingEdges(v, obstacle, result, newVertexes);\n \t\t}\n \t\t\n \t\t//System.out.println(\"size of newVertexes:\" + newVertexes.size());\n \t\t\n \t\tcurrentVertexes = newVertexes;\t\n \t\t//System.out.println(\"lastResultNumber:\" + lastResultNumber);\n \t\t//System.out.println(\"result.size():\" + result.size());\n \t} while (lastResultNumber != result.size());\n \t\n\t\treturn result;\n }", "public Collection<N> neighbors();", "public Set<Integer> getNeighbors(int v) {\n \tif (v > (n-1)) {\n \tthrow new IllegalArgumentException();\n }\n \t\n \treturn this.edges.get(v).keySet();\n }", "public Set<E> kruskalMST() throws NegativeWeightEdgeException, DisconnectedGraphException;", "List<GraphEdge> getNeighbors(NodeKey key);", "public abstract Set<Tile> getNeighbors(Tile tile);", "public HashSet<Position> getNeighborPos() { return neighborPos; }", "public List<AdjacentVertexWithEdge> getNeighbourhood(SubGraph subGraph) {\n if (disable) {\n return null;\n }\n \n CacheKey cacheKey = new CacheKey(subGraph);\n List<AdjacentVertexWithEdge> neighbourhood = cachedNeighborhoods.get(cacheKey);\n if (neighbourhood != null) {\n // moved cached key to the end of the queue\n lruQueue.remove(cacheKey);\n lruQueue.add(cacheKey);\n }\n \n return neighbourhood;\n }", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "public Collection< VKeyT > neighborKeys( VKeyT key )\n throws NoSuchVertexException;", "public int[] findRedundantConnection(int[][] edges) {\n int[] parent = new int[2*edges.length];\n int[] sz = new int[parent.length];\n // initialize parent array, every element points to itself\n for (int i = 0; i < parent.length; i++) parent[i] = i;\n Arrays.fill(sz, 1);\n\n for (int[] edge : edges) {\n int p = find(parent, edge[0]);\n int q = find(parent, edge[1]);\n if (p==q) return edge;\n union(parent, sz, p, q);\n }\n return new int[2]; // default return, if no such edge found\n }", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "public static int[] findRedundantConnection(int[][] edges) {\n UnionDataStructure obj = new UnionDataStructure();\n \n int nodes = edges.length;\n Set<int[]> set = new HashSet<>();\n \n for( int i = 1; i<=nodes; i++ ){\n\t\t\tobj.makeSet( i );\n\t\t}\n\t\t\n for( int[] edge: edges ){\n\t\t\tint edge1 = edge[0];\n\t\t\tint edge2 = edge[1];\n\t\t\tset.add( edge );\n\t\t\t\n\t\t\tif( obj.findSet_representative( edge1 ) != obj.findSet_representative( edge2 ) ){\n\t\t\t\tset.remove( edge );\n\t\t\t\tobj.union( edge1, edge2 );\n\t\t\t}\n\t\t}\n\n Iterator<int[]> iterator = set.iterator();\n\n return iterator.next();\n }", "private List<Vertex> getNeighbors(Vertex node) {\n return edges.stream()\n .filter( edge ->edge.getSource().equals(node) && !settledNodes.contains(edge.getDestination()))\n .map(edge -> edge.getDestination())\n .collect(Collectors.toList());\n }", "private LinkedList<T> getUnvisitedNeighbors(T vertex){\n LinkedList<T> neighbors = getNeighbors(vertex);\n LinkedList<T> unvisitedNeighbors = new LinkedList<T>();\n \n for (T neighbor : neighbors){\n if (!visited.contains(neighbor)){\n unvisitedNeighbors.add(neighbor);\n }\n }\n return unvisitedNeighbors;\n }", "ArrayList<Edge> getAdjacencies();", "private boolean hasANeighbour(Graph<V, E> g, Set<V> set, V v)\n {\n return set.stream().anyMatch(s -> g.containsEdge(s, v));\n }", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "public Iterable<Vertex> adjacentTo(Vertex v) {\n if (!mAdjList.containsKey(v)) return EMPTY_SET;\n return mAdjList.get(v);\n }", "public Set<E> getEdges();", "public static Set<List<Vertex>> breadthFirstSearch(Graph graph) {\n\n Set<List<Vertex>> arrayListHashSet=new HashSet<>();\n\n for(Vertex v : graph.getVertices()){\n ArrayList<Vertex> visitedArrayList=new ArrayList<>();\n Queue<Vertex> vertexQueue=new ArrayDeque<>();\n visitedArrayList.add(v);\n vertexQueue.offer(v);\n while (!vertexQueue.isEmpty()){\n for(Vertex v1:graph.getNeighbors(vertexQueue.poll())){\n if(!visitedArrayList.contains(v1)){\n visitedArrayList.add(v1);\n vertexQueue.offer(v1);\n }\n }\n }\n arrayListHashSet.add(visitedArrayList);\n }\n return arrayListHashSet; // this should be changed\n }", "public Set<Node<E>> getNeighbors(Node<E> node){\n Set<Node<E>> result = new HashSet<>();\n result = nodes.get(node);\n return result;\n }", "@Override\r\n public List<INavMeshAtom> getNeighbours(NavMesh mesh) { \r\n List<INavMeshAtom> neighbours = new ArrayList<INavMeshAtom>();\r\n \r\n if(pId > 0) neighbours.add(new NavMeshPolygon(pId));\r\n \r\n for(OffMeshEdge oe : outgoingEdges) {\r\n neighbours.add(oe.getTo());\r\n }\r\n \r\n return neighbours;\r\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "Set<MacAddress> neighbors();", "public Vector getAdjacentNodes()\n\t{\n\t\tVector vAdjNodes = new Vector();\n\t\t\n\t\tfor (int i = 0; i < m_vConnectedNodes.size(); i++)\n\t\t{\n\t\t\tif ( ((NodeConnection)m_vConnectedNodes.get(i)).getCost() > 0 )\n\t\t\t{\n\t\t\t\tvAdjNodes.add(((NodeConnection)m_vConnectedNodes.get(i)).getLinkedNode());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn vAdjNodes;\n\t}", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "VertexType getOtherVertexFromEdge( EdgeType r, VertexType oneVertex );", "public ArrayList<Node> getNeighbors(){\n ArrayList<Node> result = new ArrayList<Node>();\n for(Edge edge: edges){\n result.add(edge.end());\n }\n return result;\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "public List<MoveEdge> getEdgeNeighborhood(final LabeledUndirectedGraph<N, E> sk) {\n final List<MoveEdge> neighborood = new ArrayList<>();\n final LabeledUndirectedGraph<N, E> csk = new LabeledUndirectedGraph<>(sk);\n // For each spanning edges...\n csk.getEdges().forEach(edge -> {\n csk.removeEdge(edge);\n final List<Set<N>> nodes = new ArrayList<>(csk.getSubGraphsNodes());\n if (nodes.size() == 2) {\n final Set<E> candidates = new HashSet<>();\n csk.getRemovedEdges().stream()\n .filter(redge -> (!redge.equals(edge))\n && ((nodes.get(0).contains(redge.getNode1()) && nodes.get(1).contains(redge.getNode2()))\n || (nodes.get(0).contains(redge.getNode2()) && nodes.get(1).contains(redge.getNode1()))))\n .forEachOrdered(redge -> candidates.add(redge));\n candidates.forEach(candidate -> neighborood.add(new MoveEdge(edge, candidate, sk)));\n }\n csk.addEdge(edge);\n });\n return neighborood;\n }", "public abstract int neighboursInBlock(Set<Integer> block, int vertexIndex);", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "public boolean isAdjacentTo(final Vertex other){\n\t\tboolean result = false;\n\t\tif(getNeighbours().contains(other))\n\t\t\tresult = true;\n\t\treturn result;\n\t}", "public BitSet getAdjacentVertices(int vertex) {\n\t\treturn adjacencyMatrix[vertex];\n\t}", "Set<CyEdge> getExternalEdgeList();", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public abstract boolean hasEdge(int from, int to);", "public Collection<IntPair> findEmptyNeighbors(int x, int y);", "Dijk(final EdgeWeighted graph, final int one) {\n distace = new int[graph.vertices()];\n edge = new Edge[graph.vertices()];\n min = new IndexMinPQ<Integer>(graph.vertices());\n for (int i = 0; i < graph.vertices(); i++) {\n distace[i] = NUMBER;\n }\n distace[one] = 0;\n min.insert(one, distace[one]);\n while (!min.isEmpty()) {\n int two = min.delMin();\n for (Edge each : graph.adjacentEdges(two)) {\n relax(each, two);\n }\n }\n }", "private void getNeighbors() {\n\t\tRowIterator iterator = currentGen.iterateRows();\n\t\twhile (iterator.hasNext()) {\n\t\t\tElemIterator elem = iterator.next();\n\t\t\twhile (elem.hasNext()) {\n\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\tint row = mElem.rowIndex();\n\t\t\t\tint col = mElem.columnIndex();\n\t\t\t\tint numNeighbors = 0;\n\t\t\t\tfor (int i = -1; i < 2; i++) { // loops through row above,\n\t\t\t\t\t\t\t\t\t\t\t\t// actual row, and row below\n\t\t\t\t\tfor (int j = -1; j < 2; j++) { // loops through column left,\n\t\t\t\t\t\t\t\t\t\t\t\t\t// actual column, coloumn\n\t\t\t\t\t\t\t\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (!currentGen.elementAt(row + i, col + j).equals(\n\t\t\t\t\t\t\t\tfalse)) // element is alive, add 1 to neighbor\n\t\t\t\t\t\t\t\t\t\t// total\n\t\t\t\t\t\t\tnumNeighbors += 1;\n\t\t\t\t\t\telse { // element is not alive, add 1 to its total\n\t\t\t\t\t\t\t\t// number of neighbors\n\t\t\t\t\t\t\tInteger currentNeighbors = (Integer) neighbors\n\t\t\t\t\t\t\t\t\t.elementAt(row + i, col + j);\n\t\t\t\t\t\t\tneighbors.setValue(row + i, col + j,\n\t\t\t\t\t\t\t\t\tcurrentNeighbors + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tneighbors.setValue(row, col, numNeighbors - 1); // -1 to account\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for counting\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// itself as a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// neighbor\n\t\t\t}\n\t\t}\n\t}", "private static double findOneSetCost(int r, int [] set,\r\n Vector oneSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n ArrayList setNeighbors = new ArrayList();\r\n for ( int i = 0; i < set.length; i++)\r\n {\r\n int index = set[i] - 1;\r\n Host neighbor = (Host) neighbors.get(index);\r\n setNeighbors.add(neighbor);\r\n }\r\n double [][] setDistanceArray = findDistanceArray(currentNode, destList, setNeighbors);\r\n //the setDistanceArray[r][m]\r\n\r\n //check if any neighbor in set is not common neighbor for all dests\r\n //if a neighbor is so, return a MaxDistance, hopArray = NULL\r\n int m = destList.size();\r\n for ( int i = 0; i < m; i++)\r\n {\r\n int num = 0;\r\n for ( int j = 0; j < r; j++)\r\n {\r\n if (setDistanceArray[j][i] < 0)\r\n {\r\n num++;\r\n setDistanceArray[j][i] = MaxDistance;\r\n }\r\n }\r\n if ( num >= r )\r\n {\r\n // All the neighbors in set cannot forward to destination[i]\r\n oneSetVector.clear(); // ???\r\n return MaxDistance;\r\n }\r\n }\r\n\r\n //find forward nodes provides min remain distance\r\n double totalCost = 0.0;\r\n\r\n //go thourgh destList, find a best forward neighbor for each dest\r\n //add the distance to totalRemainDistance\r\n for (int i = 0; i < m; ++i) {//loop through destList\r\n double minCost = setDistanceArray[0][i];//get first neighbor for each dest\r\n oneSetVector.add(i, setNeighbors.get(0));\r\n for (int j = 0; j < r; ++j) {// Loop through the neighbor\r\n if (minCost > setDistanceArray[j][i]) {\r\n // Swap\r\n minCost = setDistanceArray[j][i];\r\n oneSetVector.set(i, setNeighbors.get(j));\r\n }\r\n }\r\n totalCost += minCost;\r\n }\r\n\r\n return totalCost;\r\n }", "public abstract int[] getConnected(int vertexIndex);", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Test\n\tvoid testAdjacentNodes() {\n\t\tLinkedHashSet<String> edges = null;\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\t// Boston does not have any adjacent nodes\n\t\tAssertions.assertTrue(vertexOptional.isEmpty());\n\t\t// if connected vertex is null new vertex is created. Now Adjacent nodes will\n\t\t// not have any nodes inside it.\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tedges = new LinkedHashSet<String>();\n\t\t\tmap.put(\"Boston\", edges);\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(0, map.get(\"Boston\").size());\n\n\t\t}\n\n\t}", "private final void pruneParallelSkipEdges() {\n // TODO: IF THERE ARE MULTIPLE EDGES WITH THE SAME EDGE WEIGHT, WE ARBITRARILY PICK THE FIRST EDGE TO KEEP\n // THE ORDERING MAY BE DIFFERENT FROM BOTH SIDES OF THE EDGE, WHICH CAN LEAD TO A NONSYMMETRIC GRAPH\n // However, no issues have cropped up yet. Perhaps the ordering happens to be the same for both sides,\n // due to how the graph is constructed. This is not good to rely upon, however.\n Memory.initialise(maxSize, Float.POSITIVE_INFINITY, -1, false);\n \n int maxDegree = 0;\n for (int i=0;i<nNodes;++i) {\n maxDegree = Math.max(maxDegree, nSkipEdgess[i]);\n }\n \n int[] neighbourIndexes = new int[maxDegree];\n int[] lowestCostEdgeIndex = new int[maxDegree];\n float[] lowestCost = new float[maxDegree];\n int nUsed = 0;\n \n for (int i=0;i<nNodes;++i) {\n nUsed = 0;\n int degree = nSkipEdgess[i];\n int[] sEdges = outgoingSkipEdgess[i];\n float[] sWeights = outgoingSkipEdgeWeightss[i];\n \n for (int j=0;j<degree;++j) {\n int dest = sEdges[j];\n float weight = sWeights[j];\n \n int p = Memory.parent(dest);\n int index = -1;\n \n if (p == -1) {\n index = nUsed;\n ++nUsed;\n \n Memory.setParent(dest, index);\n neighbourIndexes[index] = dest;\n \n lowestCostEdgeIndex[index] = j;\n lowestCost[index] = weight;\n } else {\n index = p;\n if (weight < lowestCost[index]) {\n // Remove existing\n \n /* ________________________________\n * |______E__________C____________L_|\n * ________________________________\n * |______C__________L____________E_|\n * ^\n * |\n * nSkipEdges--\n */\n swapSkipEdges(i, lowestCostEdgeIndex[index], j);\n swapSkipEdges(i, j, degree-1);\n --j; --degree;\n \n // lowestCostEdgeIndex[index] happens to be the same as before.\n lowestCost[index] = weight;\n } else {\n // Remove this.\n \n /* ________________________________\n * |______E__________C____________L_|\n * ________________________________\n * |______E__________L____________C_|\n * ^\n * |\n * nSkipEdges--\n */\n swapSkipEdges(i, j, degree-1);\n --j; --degree;\n }\n }\n \n }\n nSkipEdgess[i] = degree;\n \n // Cleanup\n for (int j=0;j<nUsed;++j) {\n Memory.setParent(neighbourIndexes[j], -1); \n }\n }\n }", "private ArrayList<Edge>getFullyConnectedGraph(){\n\t\tArrayList<Edge> edges = new ArrayList<>();\n\t\tfor(int i=0;i<nodes.size();i++){\n\t\t\tfor(int j=i+1;j<nodes.size();j++){\n\t\t\t\tEdge edge = new Edge(nodes.get(i), nodes.get(j),Utils.distance(nodes.get(i), nodes.get(j)));\n\t\t\t\tedges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn edges;\n\t}", "private boolean containsShortestOddHole(Graph<V, E> g, Set<V> X)\n {\n for (V y1 : g.vertexSet()) {\n if (X.contains(y1))\n continue;\n\n for (V x1 : g.vertexSet()) {\n if (x1 == y1)\n continue;\n GraphPath<V, E> rx1y1 = getPathAvoidingX(g, x1, y1, X);\n for (V x3 : g.vertexSet()) {\n if (x3 == x1 || x3 == y1 || !g.containsEdge(x1, x3))\n continue;\n for (V x2 : g.vertexSet()) {\n if (x2 == x3 || x2 == x1 || x2 == y1 || g.containsEdge(x2, x1)\n || !g.containsEdge(x3, x2))\n continue;\n\n GraphPath<V, E> rx2y1 = getPathAvoidingX(g, x2, y1, X);\n\n double n;\n if (rx1y1 == null || rx2y1 == null)\n continue;\n\n V y2 = null;\n for (V y2Candidate : rx2y1.getVertexList()) {\n if (g.containsEdge(y1, y2Candidate) && y2Candidate != x1\n && y2Candidate != x2 && y2Candidate != x3 && y2Candidate != y1)\n {\n y2 = y2Candidate;\n break;\n }\n }\n if (y2 == null)\n continue;\n\n GraphPath<V, E> rx3y1 = getPathAvoidingX(g, x3, y1, X);\n GraphPath<V, E> rx3y2 = getPathAvoidingX(g, x3, y2, X);\n GraphPath<V, E> rx1y2 = getPathAvoidingX(g, x1, y2, X);\n if (rx3y1 != null && rx3y2 != null && rx1y2 != null\n && rx2y1.getLength() == (n = rx1y1.getLength() + 1)\n && n == rx1y2.getLength() && rx3y1.getLength() >= n\n && rx3y2.getLength() >= n)\n {\n if (certify) {\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(rx1y1.getEdgeList());\n for (int i = rx2y1.getLength() - 1; i >= 0; i--)\n edgeList.add(rx2y1.getEdgeList().get(i));\n edgeList.add(g.getEdge(x2, x3));\n edgeList.add(g.getEdge(x3, x1));\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, x1, x1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "public List<Integer> neighbors(int vertex) {\r\n \tArrayList<Integer> vertices = new ArrayList<Integer>();\r\n \tLinkedList<Edge> testList = myAdjLists[vertex];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tvertices.add(testList.get(counter).myTo);\r\n \tcounter++;\r\n }\r\n return vertices;\r\n }", "private static BigInteger connectedGraphs(\n final int v, final int e) {\n if (v == 0) {\n return ZERO;\n }\n if (v == 1) {\n // Fast exit #1: single-vertex\n return e == 0 ? ONE : ZERO;\n }\n final int allE = v * (v - 1) >> 1;\n if (e == allE) {\n // Fast exit #2: complete graph (the only result)\n return ONE;\n }\n final int key = v << 16 | e;\n if (CONN_GRAPHS_CACHE.containsKey(key)) {\n return CONN_GRAPHS_CACHE.get(key);\n }\n BigInteger result;\n if (e == v - 1) {\n // Fast exit #3: trees -> apply Cayley's formula\n result = BigInteger.valueOf(v).pow(v - 2);\n } else if (e > allE - (v - 1)) {\n // Fast exit #4: e > edges required to build a (v-1)-vertex\n // complete graph -> will definitely form connected graphs\n // in all cases, so just calculate allGraphs()\n result = allGraphs(v, e);\n } else {\n /*\n * In all other cases, we'll have to remove\n * partially-connected graphs from all graphs.\n *\n * We can define a partially-connected graph as a graph\n * with 2 sub-graphs A and B with no edges between them.\n * In addition, we require one of the sub-graphs (say, A)\n * to hold the following properties:\n * 1. A must be connected: this implies that the number\n * of possible patterns for A could be counted\n * by calling connectedGraphs().\n * 2. A must contain at least one fixed vertex:\n * this property - combined with 1. -\n * implies that A would not be over-counted.\n *\n * Under the definitions above, the number of\n * partially-connected graphs to be removed will be:\n *\n * (Combinations of vertices to be added from B to A) *\n * (number of possible A's, by connectedGraphs()) *\n * (number of possible B's, by allGraphs())\n * added up iteratively through v - 1 vertices\n * (one must be fixed in A) and all possible distributions\n * of the e edges through A and B\n */\n result = allGraphs(v, e);\n for (int vA = 1; vA < v; vA++) {\n // Combinations of vertices to be added from B to A\n final BigInteger aComb = nChooseR(v - 1, vA - 1);\n final int allEA = vA * (vA - 1) >> 1;\n // Maximum number of edges which could be added to A\n final int maxEA = allEA < e ? allEA : e;\n for (int eA = vA - 1; eA < maxEA + 1; eA++) {\n result = result.subtract(aComb\n // Number of possible A's\n .multiply(connectedGraphs(vA, eA))\n // Number of possible B's\n .multiply(allGraphs(v - vA, e - eA)));\n }\n }\n }\n CONN_GRAPHS_CACHE.put(key, result);\n return result;\n }", "public void findNeighbours(ArrayList<int[]> visited , Grid curMap) {\r\n\t\tArrayList<int[]> visitd = visited;\r\n\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS cur pos:\" +Arrays.toString(nodePos));\r\n\t\t//for(int j=0; j<visitd.size();j++) {\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +Arrays.toString(visited.get(j)));\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS getvstd\" +Arrays.toString(visited.get(j)));\r\n\t\t//}\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +visited);\r\n\t\tCell left=curMap.getCell(0, 0);\r\n\t\tCell right=curMap.getCell(0, 0);\r\n\t\tCell upper=curMap.getCell(0, 0);\r\n\t\tCell down=curMap.getCell(0, 0);\r\n\t\t//the getStart() method returns x,y coordinates representing the point in x,y axes\r\n\t\t//so if either of [0] or [1] coordinate is zero then we have one less neighbor\r\n\t\tif (nodePos[1]> 0) {\r\n\t\t\tupper=curMap.getCell(nodePos[0], nodePos[1]-1) ; \r\n\t\t}\r\n\t\tif (nodePos[1] < M-1) {\r\n\t\t\tdown=curMap.getCell(nodePos[0], nodePos[1]+1);\r\n\t\t}\r\n\t\tif (nodePos[0] > 0) {\r\n\t\t\tleft=curMap.getCell(nodePos[0] - 1, nodePos[1]);\r\n\t\t}\r\n\t\tif (nodePos[0] < N-1) {\r\n\t\t\tright=curMap.getCell(nodePos[0]+1, nodePos[1]);\r\n\t\t}\r\n\t\t//for(int i=0;i<visitd.size();i++) {\r\n\t\t\t//System.out.println(Arrays.toString(visitd.get(i)));\t\r\n\t\t//}\r\n\t\t\r\n\t\t//check if the neighbor is wall,if its not add to the list\r\n\t\tif(nodePos[1]>0 && !upper.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] - 1}))) {\r\n\t\t\t//Node e=new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1},curMap);\r\n\t\t\t//if(e.getVisited()!=true) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1}, curMap)); // father of the new nodes is this node\r\n\t\t\t//}\r\n\t\t}\r\n\t\tif(nodePos[1]<M-1 &&!down.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] + 1}))){\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] + 1}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]>0 && !left.isWall() && (!exists(visitd,new int[] {nodePos[0] - 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] - 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]<N-1 && !right.isWall() && (!exists(visitd,new int[] {nodePos[0] + 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] + 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\t//for(int i=0; i<NodeChildren.size();i++) {\r\n\t\t\t//System.out.println(\"Paidia sth find:\" + Arrays.toString(NodeChildren.get(i).getNodePos()));\r\n\t\t//}\r\n\t\t\t\t\t\t\r\n\t}", "private List<Vertex> prepareGraphAdjacencyList() {\n\n\t\tList<Vertex> graph = new ArrayList<Vertex>();\n\t\tVertex vertexA = new Vertex(\"A\");\n\t\tVertex vertexB = new Vertex(\"B\");\n\t\tVertex vertexC = new Vertex(\"C\");\n\t\tVertex vertexD = new Vertex(\"D\");\n\t\tVertex vertexE = new Vertex(\"E\");\n\t\tVertex vertexF = new Vertex(\"F\");\n\t\tVertex vertexG = new Vertex(\"G\");\n\n\t\tList<Edge> edges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 2));\n\t\tedges.add(new Edge(vertexD, 6));\n\t\tedges.add(new Edge(vertexF, 5));\n\t\tvertexA.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 2));\n\t\tedges.add(new Edge(vertexC, 7));\n\t\tvertexB.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 7));\n\t\tedges.add(new Edge(vertexD, 9));\n\t\tedges.add(new Edge(vertexF, 1));\n\t\tvertexC.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 6));\n\t\tedges.add(new Edge(vertexC, 9));\n\t\tedges.add(new Edge(vertexE, 4));\n\t\tedges.add(new Edge(vertexG, 8));\n\t\tvertexD.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 4));\n\t\tedges.add(new Edge(vertexF, 3));\n\t\tvertexE.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 5));\n\t\tedges.add(new Edge(vertexC, 1));\n\t\tedges.add(new Edge(vertexE, 3));\n\t\tvertexF.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 8));\n\t\tvertexG.incidentEdges = edges;\n\n\t\tgraph.add(vertexA);\n\t\tgraph.add(vertexB);\n\t\tgraph.add(vertexC);\n\t\tgraph.add(vertexD);\n\t\tgraph.add(vertexE);\n\t\tgraph.add(vertexF);\n\t\tgraph.add(vertexG);\n\n\t\treturn graph;\n\t}", "IList<Edge> getWalls(ArrayList<ArrayList<Vertex>> v, ArrayList<Edge> all) {\n IList<Edge> finalEdges = new Empty<Edge>();\n for (Edge e : all) {\n boolean valid = true;\n for (ArrayList<Vertex> l : v) {\n for (Vertex vt : l) {\n for (Edge e2 : vt.outEdges) {\n if (e.equals(e2) || (e.to == e2.from && e.from == e2.to)) {\n valid = false;\n }\n }\n }\n }\n if (valid) {\n finalEdges = finalEdges.add(e);\n }\n }\n return finalEdges;\n }", "@Override\n\tpublic Set<ET> getAdjacentEdges(N node)\n\t{\n\t\t// implicitly returns null if gn is not in the nodeEdgeMap\n\t\tSet<ET> adjacentEdges = nodeEdgeMap.get(node);\n\t\treturn adjacentEdges == null ? null : new HashSet<ET>(adjacentEdges);\n\t}", "public static int findSmallestMSTEdge(int[][] graph,ArrayList<Integer> chosenVertices, ArrayList<Integer> unChosenVertices){\r\n int smallest = Integer.MAX_VALUE;\r\n for(int i = 0 ; i<chosenVertices.size();i++){\r\n for(int j = 0; j< unChosenVertices.size();j++){\r\n if (graph[unChosenVertices.get(j)][chosenVertices.get(i)] < smallest){\r\n smallest = graph[unChosenVertices.get(j)][chosenVertices.get(i)];\r\n }\r\n }\r\n }\r\n return smallest;\r\n }", "public Set<Integer> getNeighbors() {\n HashSet<Integer> retSet = new HashSet<Integer>();\n retSet.addAll(this.getActiveNeighbors());\n retSet.addAll(this.purgedNeighbors);\n\n return retSet;\n }", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "public Collection<MyNode> getNeighbors(){\r\n return new ArrayList<>(this.neighbors);\r\n }", "public abstract boolean getEdge(Point a, Point b);", "public void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "public ArrayList<Integer> getInNeighbors (int nodeId) {\r\n\t\tArrayList<Integer> inNeighbors = new ArrayList<Integer>();\r\n\t\t// the set of incoming edge ids\r\n\t\tSet<Integer> edgeSet = mInEdges.get(nodeId);\r\n\t\tfor(Integer edgeId: edgeSet) {\r\n\t\t\tinNeighbors.add( getEdge(edgeId).getFromId() );\r\n\t\t}\r\n\t\treturn inNeighbors;\r\n\t}", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "private Vertex findAW(ArrayList<XVertex> nj) {\n\n\t\tArrayList<Vertex> candidateWs = new ArrayList<>();\n\n\t\t// Handle the first two vertices in NJ\n\t\tfor (int j = 0; j < nj.get(0).getVertexDegree(); j++) {\n\n\t\t\tfor (int k = 0; k < nj.get(1).getVertexDegree(); k++) {\n\n\t\t\t\tif (nj.get(0).getNeighbor(j).getId() == nj.get(1).getNeighbor(k).getId()) {\n\n\t\t\t\t\tcandidateWs.add(nj.get(0).getNeighbor(j));\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Handle every additional vertex in NJ\n\t\tfor (int z = 2; z < nj.size(); z++) {\n\t\t\tfor (int y = 0; y < candidateWs.size(); y++) {\n\t\t\t\tif (!(nj.get(z).getNeighborsArrayList().contains(candidateWs.get(y)))) {\n\t\t\t\t\tcandidateWs.remove(y);\n\t\t\t\t\tz--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check that the nodes in the candidates do NOT exist as neighbors in any other\n\t\t// x outside of nj\n\n\t\t// can use a set difference of all x's minus x's in NJ\n\t\tArrayList<Vertex> copy = (ArrayList) this.allX.clone();\n\t\tcopy.removeAll(nj);\n\n\t\tfor (int s = 0; s < copy.size(); s++) {\n\t\t\tfor (int p = 0; p < candidateWs.size(); p++) {\n\t\t\t\tif (copy.get(s).getNeighborsArrayList().contains(candidateWs.get(p))) {\n\t\t\t\t\tcandidateWs.remove(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (candidateWs.size() == 0) {\n\t\t\tthis.numNotRecovered++;\n\t\t\treturn null;\n\t\t}\n\t\treturn candidateWs.get(0); // return the remaining w candidate\n\n\t}", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "public int[] findRedundantDirectedConnection(int[][] edges) {\n int N = edges.length;\n int[] parent = new int[N+1];\n int[] canA = new int[2];\n int[] canB = new int[2];\n // This loop is for checking whether there is a node having two parents\n // If there is such a node, then one of the two edges connecting it to its two parents must be redundant\n // And we keep them in canA and canB (canB occurs later than canA)\n for (int[] e : edges) {\n if (parent[e[1]] != 0) {\n canA = new int[]{parent[e[1]], e[1]};\n canB = Arrays.copyOf(e, 2);\n } else {\n parent[e[1]] = e[0];\n }\n }\n\n // This loop is for checking whether there is still a circle if we ignore the edge canB\n // If there is not a circle anymore, then return canB\n // If there is still a circle, then we check whether canA/canB has been filled in the first loop\n // If canA/canB has been filled, then return canA\n // If canA/canB has not been filled, then it is the case that every node has exactly one parent,\n // so return the current edge\n UnionFind uf = new UnionFind(N);\n for (int[] e : edges) {\n if (Arrays.equals(e, canB))\n continue;\n if (uf.union(e[0], e[1])) {\n if (canA[0] != 0)\n return canA;\n else\n return e;\n }\n }\n\n return canB;\n }", "public void testEdgesSet_0args() {\n System.out.println(\"edgesSet\");\n\n Set<Edge<Integer>> set = generateGraph().edgesSet();\n\n Assert.assertEquals(set.size(), 313);\n for (Edge<Integer> edge : set) {\n int sum = edge.getSourceVertex().intValue() + edge.getTargetVertex().intValue();\n Assert.assertTrue(sum % 2 == 0);\n }\n }", "public ArrayList<Vertex> getNeighbours(Vertex vertex) {\r\n\t\tArrayList<Vertex> neighbours = new ArrayList<Vertex>();\r\n\t\tfor (Vertex vertexOfList : listVertex) {\r\n\r\n\t\t\tif (matrix.getEdges(vertex.getIdVertex(), vertexOfList.getIdVertex()) != null) {\r\n\t\t\t\tneighbours.add(vertexOfList);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn neighbours;\r\n\t}", "public List neighbors(int vertex) {\n// your code here\n LinkedList<Integer> result = new LinkedList<>();\n LinkedList<Edge> list = adjLists[vertex];\n for (Edge a : list) {\n result.add(a.to());\n }\n//List<Integer> list = new List<Integer>();\n return result;\n }", "private void computeShortestPath(){\n T current = start;\n boolean atEnd = false;\n while (!unvisited.isEmpty()&& !atEnd){\n int currentIndex = vertexIndex(current);\n LinkedList<T> neighbors = getUnvisitedNeighbors(current); // getting unvisited neighbors\n \n //what is this doing here???\n if (neighbors.isEmpty()){\n \n }\n \n // looping through to find distances from start to neighbors\n for (T neighbor : neighbors){ \n int neighborIndex = vertexIndex(neighbor); \n int d = distances[currentIndex] + getEdgeWeight(current, neighbor);\n \n if (d < distances[neighborIndex]){ // if this distance is less than previous distance\n distances[neighborIndex] = d;\n closestPredecessor[neighborIndex] = current; // now closest predecessor is current\n }\n }\n \n if (current.equals(end)){\n atEnd = true;\n }\n else{\n // finding unvisited node that is closest to start node\n T min = getMinUnvisited();\n if (min != null){\n unvisited.remove(min); // remove minimum neighbor from unvisited\n visited.add(min); // add minimum neighbor to visited\n current = min;\n }\n }\n }\n computePath();\n totalDistance = distances[vertexIndex(end)];\n }", "public void subsetOneBundlePerEdge() {\n Set<Bundle> set = new HashSet<Bundle>();\n for (int ent_i=0;ent_i<digraph.getNumberOfEntities();ent_i++) {\n for (int i=0;i<digraph.getNumberOfNeighbors(ent_i);i++) {\n int nbor_i = digraph.getNeighbor(ent_i,i);\n\tIterator<Bundle> it = digraph.linkRefIterator(digraph.linkRef(ent_i,nbor_i));\n\tset.add(it.next());\n }\n }\n getRTParent().push(getRTParent().getRootBundles().subset(set));\n }", "private Set<Integer>[] getKernelDAG(List<Integer>[] adjacent) {\n Set<Integer>[] adjacentComponents = (HashSet<Integer>[]) new HashSet[sccCount];\n for (int i = 0; i < adjacentComponents.length; i++) {\n adjacentComponents[i] = new HashSet<>();\n }\n\n for (int vertexId = 0; vertexId < adjacent.length; vertexId++) {\n int currentComponent = sccIds[vertexId];\n\n for (int neighbor : adjacent[vertexId]) {\n if (currentComponent != sccIds[neighbor]) {\n adjacentComponents[currentComponent].add(sccIds[neighbor]);\n }\n }\n }\n return adjacentComponents;\n }", "private boolean hasANonneighbourInX(Graph<V, E> g, V v, Set<V> X)\n {\n return X.stream().anyMatch(x -> !g.containsEdge(v, x));\n }", "@Override\r\n public Iterable<V> neighbors(V vertexName) {\r\n try {\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n while(vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if(vertexName.compareTo(v.vertexName) == 0)\r\n return v.destinations;\r\n }\r\n vertexIterator.next();\r\n return null;\r\n }\r\n catch(NoSuchElementException e) {\r\n throw e;\r\n }\r\n }", "private Set<NodePair> nonadjacencies(Graph graph) {\n Set<NodePair> nonadjacencies = new HashSet<>();\n for (Graph inputPag : input) {\n for (NodePair pair : allNodePairs(inputPag.getNodes())) {\n if (!inputPag.isAdjacentTo(pair.getFirst(), pair.getSecond())) {\n nonadjacencies.add(new NodePair(graph.getNode(pair.getFirst().getName()), graph.getNode(pair.getSecond().getName())));\n }\n }\n }\n return nonadjacencies;\n }", "private ArrayList<Integer> shortestLists(ArrayList<HashMap<Integer,Integer>> table, ArrayList<Integer> pool){\n ArrayList<Integer> subPool = new ArrayList<Integer>();\n int shortestEdgesElement = -1;\n for(int i = 0; i < pool.size(); i++){\n if(shortestEdgesElement < 0 || table.get(pool.get(i)).size() < shortestEdgesElement){\n shortestEdgesElement = table.get(pool.get(i)).size();\n }\n }\n\n for(int i = 0; i < pool.size(); i++){\n if(table.get(pool.get(i)).size() == shortestEdgesElement){\n subPool.add(pool.get(i));\n }\n }\n\n //This should never trigger, but just incase its here\n if(subPool.size() <= 0){\n return pool;\n }\n\n return subPool;\n }", "public static List<BitSet> getNeighbours(IDistanceMeasure measure, List<BitSet> bitsets, BitSet p, double max_error, TIntHashSet visited)\n\t{\n\t\tList<BitSet> neighborhood = new LinkedList<BitSet>();\n\t\t\n\t\tfor(BitSet n : bitsets)\n\t\t{\n\t\t\tif (!visited.contains(n.hashCode()))\n\t\t\t{\n\t\t\t\tif (measure.acceptable(measure.getDistance(n, p), max_error)) neighborhood.add(n);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"done (got: \" + neighborhood.size() + \")\");\n\t\t\n\t\treturn neighborhood;\n\t}", "public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2);", "private void setNeighboringMines(){\n\t\t//cycle the board\n\t\tfor (int r = 0; r < board.length; r++)\n\t\t\tfor (int c = 0; c < board[r].length; c++){\n\t\t\t\tint neighborCount = 0;\n\t\t\t\tif(!board[r][c].isMine()) {\n\t\t\t\t\t//checks if there is mines touching\n\t\t\t\t\tneighborCount = neighboringMines(r, c);\n\t\t\t\t\tif (neighborCount > 0) {\n\t\t\t\t\t\tboard[r][c].setIsNeighboringMine(true);\n\t\t\t\t\t\tboard[r][c].setNumNeighboringMines\n\t\t\t\t\t\t\t\t(neighborCount);\n\t\t\t\t\t} else if (neighborCount == 0) {\n\t\t\t\t\t\tboard[r][c].setNumNeighboringMines(0);\n\t\t\t\t\t\tboard[r][c].setIsNeighboringMine(false);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "public void removeNeighbours(){\n\t\tgetNeighbours().removeAll(getNeighbours());\n\t}", "private void e_Neighbours(int u){ \n int edgeDistance = -1; \n int newDistance = -1; \n \n // All the neighbors of v \n for (int i = 0; i < adj.get(u).size(); i++) { \n Node v = adj.get(u).get(i); \n \n // If current node hasn't already been processed \n if (!settled.contains(v.node)) { \n edgeDistance = v.cost; \n newDistance = dist[u] + edgeDistance; \n \n // If new distance is cheaper in cost \n if (newDistance < dist[v.node]) \n dist[v.node] = newDistance; \n \n // Add the current node to the queue \n pq.add(new Node(v.node, dist[v.node])); \n } \n } \n }" ]
[ "0.69724584", "0.68779993", "0.68746793", "0.65199465", "0.6330758", "0.6284013", "0.6263211", "0.6218036", "0.6154779", "0.6099641", "0.6059597", "0.6057334", "0.6028407", "0.59599006", "0.59568775", "0.5949853", "0.5935523", "0.5933688", "0.59321743", "0.5926206", "0.5923856", "0.58933496", "0.5870059", "0.58520275", "0.58472854", "0.58322257", "0.5817739", "0.58154595", "0.5810381", "0.58093125", "0.58010876", "0.57847196", "0.5778089", "0.57773024", "0.5747375", "0.57444096", "0.5739667", "0.57356817", "0.5723143", "0.5707675", "0.57061714", "0.56925386", "0.56747", "0.56703305", "0.5658448", "0.565525", "0.5654408", "0.5646744", "0.56448823", "0.5640856", "0.5630034", "0.5629329", "0.5619577", "0.56186324", "0.56072867", "0.56016403", "0.55923116", "0.5582544", "0.5579888", "0.55790263", "0.55714494", "0.5571059", "0.5570776", "0.55654454", "0.5561278", "0.55567616", "0.55534256", "0.5531234", "0.55281126", "0.55274606", "0.5517269", "0.5516622", "0.550949", "0.5493533", "0.54830235", "0.5481411", "0.54774624", "0.54742604", "0.5471073", "0.5468619", "0.5465989", "0.5461702", "0.54600567", "0.5458013", "0.5457142", "0.54541636", "0.5452331", "0.544455", "0.5435674", "0.54311234", "0.54288703", "0.54267937", "0.5424454", "0.54240894", "0.54221493", "0.54220617", "0.5417952", "0.5417385", "0.5411254", "0.54065084", "0.5403067" ]
0.0
-1
ensures that only the vertices connected to outgoing edges from a vertex are in the set returned by getNeighbors(), when called on a small graph that has only two vertices and one edge
@Test public void testPublic5() { Graph<Character> graph= TestGraphs.testGraph1(); assertEquals("", TestGraphs.collToString(graph.getNeighbors('B'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Set<Edge> getIncomingNeighborEdges(boolean onUpwardPass) {\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\treturn outgoingEdges;\n\t\t}", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "@Test\r\n public void testOutboundEdges() {\r\n System.out.println(\"outboundEdges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n Object v3Element = 3;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n Vertex v3 = instance.insertVertex(v3Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e1 = instance.insertEdge(v1, v2, edgeElement);\r\n Edge e2 = instance.insertEdge(v1, v3, edgeElement);\r\n Edge e3 = instance.insertEdge(v2, v3, edgeElement);\r\n\r\n Collection e1OutboundEdges = instance.outboundEdges(v2);\r\n Collection e2OutboundEdges = instance.outboundEdges(v3);\r\n Collection e3OutboundEdges = instance.outboundEdges(v3);\r\n\r\n boolean e1Result = e1OutboundEdges.contains(e1);\r\n boolean e2Result = e2OutboundEdges.contains(e2);\r\n boolean e3Result = e3OutboundEdges.contains(e3);\r\n\r\n Object expectedResult = true;\r\n assertEquals(expectedResult, e1Result);\r\n assertEquals(expectedResult, e2Result);\r\n assertEquals(expectedResult, e3Result);\r\n }", "Set<Edge> getUpwardOutgoingNeighborEdges() {\n\t\t\tif(!_bumpOnUpwardPass) {\n\t\t\t\tSystem.err.println(\"calling upward pass neighbor method on downward pass!\");\n\t\t\t}\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID > v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn outgoingEdges;\n\t\t\t\tSystem.out.println(this.toString()+\"'s outgoing edges:\\n\"+ outgoingEdges);\n\t\t\t\treturn outgoingEdges;\n\t\t}", "public Set<V> getNeighbours(V vertex);", "public void testEdgesSet_ofVertex() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i));\n\n Assert.assertEquals(set.size(), i % 2 == 0 ? 25 : 23);\n for (Edge<Integer> edge : set) {\n Assert.assertTrue((edge.getTargetVertex() + i) % 2 == 0);\n }\n }\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "public abstract boolean hasEdge(int from, int to);", "Set<Edge> getDownwardOutgoingNeighborEdges() {\n\t\t\tif(_bumpOnUpwardPass) {\n\t\t\t\tSystem.err.println(\"calling downward pass neighbor method on upward pass!\");\n\t\t\t}\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\tSystem.out.println(this.toString()+\"'s outgoing edges:\\n\"+ outgoingEdges);\n\t\t\t\treturn outgoingEdges;\n\t\t}", "private boolean hasANeighbour(Graph<V, E> g, Set<V> set, V v)\n {\n return set.stream().anyMatch(s -> g.containsEdge(s, v));\n }", "boolean hasIsVertexOf();", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "public boolean isBipartiteUndirectedGraph (){\r\n int[] vertices = new int[getNumV()];\r\n for (int i = 0; i < getNumV(); ++i)\r\n vertices[i] = -1;\r\n\r\n vertices[0] = 1;\r\n\r\n Stack <Integer> q = new Stack<Integer>();\r\n q.push(0);\r\n\r\n while (!q.isEmpty()) {\r\n int current = q.pop();\r\n Iterator<Edge> iter = edgeIterator(current);\r\n while (iter.hasNext()) {\r\n Edge edge = iter.next();\r\n int neighbor = edge.getDest();\r\n if (vertices[neighbor] == -1) {\r\n vertices[neighbor] = 1 - vertices[current];\r\n q.push(neighbor);\r\n }\r\n else if (vertices[neighbor] == vertices[current])\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "public static Long neighborPairsSingle(Set<Integer>[] graph) {\n long triangleCount = 0;\n int degv, degu, degw;\n for (int v = 0; v < graph.length; v++) {\n degv = graph[v].size();\n for (Integer u : graph[v]) {\n degu = graph[u].size();\n if (degu > degv || (degu == degv && v < u)) {\n for (Integer w : graph[v]) {\n if (w <= u)\n continue;\n degw = graph[w].size();\n if (degw > degv || (degw == degv && v < w)) {\n if (graph[u].contains(w))\n triangleCount++;\n }\n }\n }\n }\n }\n return triangleCount;\n }", "private LinkedList<T> getUnvisitedNeighbors(T vertex){\n LinkedList<T> neighbors = getNeighbors(vertex);\n LinkedList<T> unvisitedNeighbors = new LinkedList<T>();\n \n for (T neighbor : neighbors){\n if (!visited.contains(neighbor)){\n unvisitedNeighbors.add(neighbor);\n }\n }\n return unvisitedNeighbors;\n }", "public ArrayList<Integer> getOutNeighbors (int nodeId) {\r\n\t\tArrayList<Integer> outNeighbors = new ArrayList<Integer>();\r\n\t\t// the set of outgoing edge ids\r\n\t\tSet<Integer> edgeSet = mOutEdges.get(nodeId);\r\n\t\tfor(Integer edgeId: edgeSet) {\r\n\t\t\toutNeighbors.add( getEdge(edgeId).getToId() );\r\n\t\t}\r\n\t\treturn outNeighbors;\r\n\t}", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Override\r\n public List<INavMeshAtom> getNeighbours(NavMesh mesh) { \r\n List<INavMeshAtom> neighbours = new ArrayList<INavMeshAtom>();\r\n \r\n if(pId > 0) neighbours.add(new NavMeshPolygon(pId));\r\n \r\n for(OffMeshEdge oe : outgoingEdges) {\r\n neighbours.add(oe.getTo());\r\n }\r\n \r\n return neighbours;\r\n }", "public void testEdgesSet_0args() {\n System.out.println(\"edgesSet\");\n\n Set<Edge<Integer>> set = generateGraph().edgesSet();\n\n Assert.assertEquals(set.size(), 313);\n for (Edge<Integer> edge : set) {\n int sum = edge.getSourceVertex().intValue() + edge.getTargetVertex().intValue();\n Assert.assertTrue(sum % 2 == 0);\n }\n }", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }", "private void clearVisited(){\r\n\t\tfor(int i=0; i<graphSize; i++){\r\n\t\t\tmyGraph[i].visited = false;\r\n\t\t\tAdjVertex vert = myGraph[i].adjVertexHead;\r\n\t\t\twhile(vert != null){\r\n\t\t\t\tvert.visited = false;\r\n\t\t\t\tvert= vert.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public abstract Set<? extends EE> edgesOf(VV vertex);", "boolean ignoreExistingVertices();", "IList<Edge> getWalls(ArrayList<ArrayList<Vertex>> v, ArrayList<Edge> all) {\n IList<Edge> finalEdges = new Empty<Edge>();\n for (Edge e : all) {\n boolean valid = true;\n for (ArrayList<Vertex> l : v) {\n for (Vertex vt : l) {\n for (Edge e2 : vt.outEdges) {\n if (e.equals(e2) || (e.to == e2.from && e.from == e2.to)) {\n valid = false;\n }\n }\n }\n }\n if (valid) {\n finalEdges = finalEdges.add(e);\n }\n }\n return finalEdges;\n }", "public Set<JmiAssocEdge> getAllOutgoingAssocEdges(JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).allOutgoingAssocEdges;\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "private boolean hasANonneighbourInX(Graph<V, E> g, V v, Set<V> X)\n {\n return X.stream().anyMatch(x -> !g.containsEdge(v, x));\n }", "private Set<Edge> reachableDAG(Vertex start, Vertex obstacle) {\n \tHashSet<Edge> result = new HashSet<Edge>();\n \tVector<Vertex> currentVertexes = new Vector<Vertex>();\n \tint lastResultNumber = 0;\n \tcurrentVertexes.add(start);\n \t\n \tdo {\n \t\t//System.out.println(\"size of currentVertexes:\" + currentVertexes.size());\n \t\t\n \t\tVector<Vertex> newVertexes = new Vector<Vertex>();\n \t\tlastResultNumber = result.size();\n \t\t\n \t\tfor (Vertex v : currentVertexes) {\n \t\t\t//System.out.println(\"layerID:\" + v.layerID + \"\\tlabel:\" + v.label);\n \t\t\taddIncomingEdges(v, obstacle, result, newVertexes);\n \t\t\taddOutgoingEdges(v, obstacle, result, newVertexes);\n \t\t}\n \t\t\n \t\t//System.out.println(\"size of newVertexes:\" + newVertexes.size());\n \t\t\n \t\tcurrentVertexes = newVertexes;\t\n \t\t//System.out.println(\"lastResultNumber:\" + lastResultNumber);\n \t\t//System.out.println(\"result.size():\" + result.size());\n \t} while (lastResultNumber != result.size());\n \t\n\t\treturn result;\n }", "@Test\r\n void test_insert_edges_remove_edges_check_size() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n\r\n // There are no more edges in the graph\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"A\", \"E\");\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList<Node<A>> neighbours(){\n\t\t\n\t\tArrayList<Node<A>> output = new ArrayList<Node<A>>();\n\t\t\n\t\tif (g == null) return output;\n\t\t\n\t\tfor (Object o: g.getEdges()){\n\n\t\t\t\n\t\t\tif (((Edge<?>)o).getTo().equals(this)) {\n\t\t\t\t\n\t\t\t\tif (!output.contains(((Edge<?>)o).getFrom()))\n\t\t\t\t\t\toutput.add((Node<A>) ((Edge<?>)o).getFrom());\n\t\t\t\t\n\t\t\t}\n\n\t\t} \n\t\treturn output;\n\t\t\n\t}", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}", "Set<E> getForwardNeighbors();", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "int[] getOutEdges(int... nodes);", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "@DisplayName(\"Has neighbours?\")\n @Test\n public void testGetNeighbours() {\n Assertions.assertTrue(graph.getNeighbours(0).size() > 1);\n }", "public void removeAllEdges() {\n }", "private static BigInteger connectedGraphs(\n final int v, final int e) {\n if (v == 0) {\n return ZERO;\n }\n if (v == 1) {\n // Fast exit #1: single-vertex\n return e == 0 ? ONE : ZERO;\n }\n final int allE = v * (v - 1) >> 1;\n if (e == allE) {\n // Fast exit #2: complete graph (the only result)\n return ONE;\n }\n final int key = v << 16 | e;\n if (CONN_GRAPHS_CACHE.containsKey(key)) {\n return CONN_GRAPHS_CACHE.get(key);\n }\n BigInteger result;\n if (e == v - 1) {\n // Fast exit #3: trees -> apply Cayley's formula\n result = BigInteger.valueOf(v).pow(v - 2);\n } else if (e > allE - (v - 1)) {\n // Fast exit #4: e > edges required to build a (v-1)-vertex\n // complete graph -> will definitely form connected graphs\n // in all cases, so just calculate allGraphs()\n result = allGraphs(v, e);\n } else {\n /*\n * In all other cases, we'll have to remove\n * partially-connected graphs from all graphs.\n *\n * We can define a partially-connected graph as a graph\n * with 2 sub-graphs A and B with no edges between them.\n * In addition, we require one of the sub-graphs (say, A)\n * to hold the following properties:\n * 1. A must be connected: this implies that the number\n * of possible patterns for A could be counted\n * by calling connectedGraphs().\n * 2. A must contain at least one fixed vertex:\n * this property - combined with 1. -\n * implies that A would not be over-counted.\n *\n * Under the definitions above, the number of\n * partially-connected graphs to be removed will be:\n *\n * (Combinations of vertices to be added from B to A) *\n * (number of possible A's, by connectedGraphs()) *\n * (number of possible B's, by allGraphs())\n * added up iteratively through v - 1 vertices\n * (one must be fixed in A) and all possible distributions\n * of the e edges through A and B\n */\n result = allGraphs(v, e);\n for (int vA = 1; vA < v; vA++) {\n // Combinations of vertices to be added from B to A\n final BigInteger aComb = nChooseR(v - 1, vA - 1);\n final int allEA = vA * (vA - 1) >> 1;\n // Maximum number of edges which could be added to A\n final int maxEA = allEA < e ? allEA : e;\n for (int eA = vA - 1; eA < maxEA + 1; eA++) {\n result = result.subtract(aComb\n // Number of possible A's\n .multiply(connectedGraphs(vA, eA))\n // Number of possible B's\n .multiply(allGraphs(v - vA, e - eA)));\n }\n }\n }\n CONN_GRAPHS_CACHE.put(key, result);\n return result;\n }", "@Test\n void test05_checkSize() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\"); // adds three vertices\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\");\n graph.addEdge(\"c\", \"b\"); // add three edges\n if (graph.size() != 3) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "public void testVerticesSet() {\n System.out.println(\"verticesSet\");\n\n Assert.assertTrue(generateGraph().verticesSet().size() == 25);\n }", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "public void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "private List<Vertex> getNeighbors(Vertex node) {\n return edges.stream()\n .filter( edge ->edge.getSource().equals(node) && !settledNodes.contains(edge.getDestination()))\n .map(edge -> edge.getDestination())\n .collect(Collectors.toList());\n }", "public void checkEdges()\n\tthrows InconsistencyException\n\t{\n\t\t// first check if edges is non-null\n\t\tif(edges == null)\n\t\t\tthrow new InconsistencyException(\"The ArrayList edges should be non-null, but is null.\");\n\n\t\t// check that all vertices are referenced at least three times, as each is the vertex of at least one simplex\n\t\t// and in each simplex three edges meet at each vertex\n\t\t\n\t\t// create an array of ints that will hold the number of references to each vertex in the list of edges...\n\t\tint[] vertexReferences = new int[vertices.size()];\n\t\t\n\t\t// ... and set all these reference counts initially to zero\n\t\tfor(int i=0; i<vertexReferences.length; i++) vertexReferences[i] = 0;\n\t\t\n\t\t// go through all edges...\n\t\tfor(Edge edge:edges)\n\t\t{\n\t\t\t// go through both vertices...\n\t\t\tfor(int i=0; i<2; i++)\n\t\t\t\t// ... and increase the reference count of the vertex by 1\n\t\t\t\tvertexReferences[edge.getVertexIndices()[i]]++;\n\t\t\t// note that any vertex indices that are out of bounds will throw up an error here!\n\t\t}\n\n\t\t// check that all reference counts are >= 3\n\t\tfor(int i=0; i<vertexReferences.length; i++)\n\t\t{\n\t\t\tif(vertexReferences[i] < 3)\n\t\t\t{\n\t\t\t\t// vertex i is referenced fewer than 3 times\n\t\t\t\t\n\t\t\t\t// throw an InconsistencyException\n\t\t\t\tthrow(new InconsistencyException(\"Vertex #\" + i + \" should be referenced in the list of edges >= 3 times, but is referenced only \" + vertexReferences[i] + \" times.\"));\n\t\t\t}\n\t\t}\n\t}", "private static int nonIsolatedVertex(Graph G) {\n for (int v = 0; v < G.V(); v++)\n if (G.degree(v) > 0)\n return v;\n return -1;\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "protected abstract List<Integer> getNeighbors(int vertex);", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "public Set<E> primMST() throws NegativeWeightEdgeException, DisconnectedGraphException;", "@Override\n\tpublic boolean isConnected() {\n\t\tif(dwg.getV().size()==0) return true;\n\n\t\tIterator<node_data> temp = dwg.getV().iterator();\n\t\twhile(temp.hasNext()) {\n\t\t\tfor(node_data w : dwg.getV()) {\n\t\t\t\tw.setTag(0);\n\t\t\t}\n\t\t\tnode_data n = temp.next();\n\t\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\t\tn.setTag(1);\n\t\t\tq.add(n);\n\t\t\twhile(!q.isEmpty()) {\n\t\t\t\tnode_data v = q.poll();\n\t\t\t\tCollection<edge_data> arrE = dwg.getE(v.getKey());\n\t\t\t\tfor(edge_data e : arrE) {\n\t\t\t\t\tint keyU = e.getDest();\n\t\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\t\tif(u.getTag() == 0) {\n\t\t\t\t\t\tu.setTag(1);\n\t\t\t\t\t\tq.add(u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv.setTag(2);\n\t\t\t}\n\t\t\tCollection<node_data> col = dwg.getV();\n\t\t\tfor(node_data n1 : col) {\n\t\t\t\tif(n1.getTag() != 2) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public abstract int[] getConnected(int vertexIndex);", "public int outDegree(N v) {\n return getOutEdges(v).size();\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public Set<E> kruskalMST() throws NegativeWeightEdgeException, DisconnectedGraphException;", "public int outdegree(int v) {\r\n validateVertex(v);\r\n return adj[v].size();\r\n }", "private int createEdges() {\n\t\t// Use random numbers to generate random number of edges for each vertex\n\t\tint avgNumEdgesPerVertex = this.desiredTotalEdges / this.vertices.size();\n\t\tint countSuccessfulEdges = 0;\n\t\t// In order to determine the number of edges to create for each vertex\n\t\t// get a random number between 0 and 2 times the avgNumEdgesPerVertex\n\t\t// then add neighbors (edges are represented by the number of neighbors each\n\t\t// vertex has)\n\t\tfor (int i = 0; i < this.vertices.size(); i++) {\n\t\t\tfor (int j = 0; j <= (this.randomGen(avgNumEdgesPerVertex * 50) + 1); j++) {\n\t\t\t\t// select a random vertex from this.vertices (vertex list) and add as neighbor\n\t\t\t\t// ensure we don't add a vertex as a neighbor of itself\n\t\t\t\tint neighbor = this.randomGen(this.vertices.size());\n\t\t\t\tif (neighbor != i)\n\t\t\t\t\tif (this.vertices.get(i).addNeighbor(this.vertices.get(neighbor))) {\n\t\t\t\t\t\tthis.vertices.get(neighbor).addNeighbor(this.vertices.get(i));\n\t\t\t\t\t\tcountSuccessfulEdges++;\n\t\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn countSuccessfulEdges;\n\t}", "public int outdegree(int v) {\n return adj[v].size();\n }", "public Set<Integer> getNeighbors(int v) {\n \tif (v > (n-1)) {\n \tthrow new IllegalArgumentException();\n }\n \t\n \treturn this.edges.get(v).keySet();\n }", "public Set<Edge<V>> edgeSet();", "static boolean isBipartite(int graph[][], int num_vertices)\n {\n int color[] = new int[num_vertices];\n //-1 means uncolored, 0 is red, 1 is black\n for (int i=0; i < num_vertices; i++)\n color[i] = -1;\n color[0] = 1;\n\n //queue of vertex numbers\n LinkedList<Integer> queue = new LinkedList<>();\n //start at vertex 0 because our graph is connected we can always start at\n //vertex 0\n queue.add(0);\n\n //while vertices in queue\n while (queue.size() != 0)\n {\n //deque color of first vertex in queue;\n int u = queue.poll();\n for (int i = 0; i < num_vertices; i++)\n {\n //if edge exists and vertex is uncolored\n if ( (graph[u][i] == 1) && (color[i] == -1) )\n {\n //color red if uncolored\n color[i] = 1 - color[u];\n queue.add(i);\n }\n //if edge exists an the color is same as the color of the polled vertex\n else if ( (graph[u][i] == 1) && (color[i] == color[u]) )\n return false;\n }\n }\n return true;\n }", "public Set<Vec3i> cisConnections();", "private List<Vertex> prepareGraphAdjacencyList() {\n\n\t\tList<Vertex> graph = new ArrayList<Vertex>();\n\t\tVertex vertexA = new Vertex(\"A\");\n\t\tVertex vertexB = new Vertex(\"B\");\n\t\tVertex vertexC = new Vertex(\"C\");\n\t\tVertex vertexD = new Vertex(\"D\");\n\t\tVertex vertexE = new Vertex(\"E\");\n\t\tVertex vertexF = new Vertex(\"F\");\n\t\tVertex vertexG = new Vertex(\"G\");\n\n\t\tList<Edge> edges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 2));\n\t\tedges.add(new Edge(vertexD, 6));\n\t\tedges.add(new Edge(vertexF, 5));\n\t\tvertexA.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 2));\n\t\tedges.add(new Edge(vertexC, 7));\n\t\tvertexB.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 7));\n\t\tedges.add(new Edge(vertexD, 9));\n\t\tedges.add(new Edge(vertexF, 1));\n\t\tvertexC.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 6));\n\t\tedges.add(new Edge(vertexC, 9));\n\t\tedges.add(new Edge(vertexE, 4));\n\t\tedges.add(new Edge(vertexG, 8));\n\t\tvertexD.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 4));\n\t\tedges.add(new Edge(vertexF, 3));\n\t\tvertexE.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 5));\n\t\tedges.add(new Edge(vertexC, 1));\n\t\tedges.add(new Edge(vertexE, 3));\n\t\tvertexF.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 8));\n\t\tvertexG.incidentEdges = edges;\n\n\t\tgraph.add(vertexA);\n\t\tgraph.add(vertexB);\n\t\tgraph.add(vertexC);\n\t\tgraph.add(vertexD);\n\t\tgraph.add(vertexE);\n\t\tgraph.add(vertexF);\n\t\tgraph.add(vertexG);\n\n\t\treturn graph;\n\t}", "@Test\n public void test_witness_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(6, 6, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 20, 20);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.addEdge(1, 5, edge++, 10, 10);\n graph.addEdge(5, 3, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 30.0, 100);\n assertEquals(20, weight, 1.e-6);\n }", "private boolean hasConfigurationType1(Graph<V, E> g)\n {\n for (V v1 : g.vertexSet()) {\n Set<V> temp = new ConnectivityInspector<>(g).connectedSetOf(v1);\n for (V v2 : temp) {\n if (v1 == v2 || !g.containsEdge(v1, v2))\n continue;\n for (V v3 : temp) {\n if (v3 == v1 || v3 == v2 || !g.containsEdge(v2, v3) || g.containsEdge(v1, v3))\n continue;\n for (V v4 : temp) {\n if (v4 == v1 || v4 == v2 || v4 == v3 || g.containsEdge(v1, v4)\n || g.containsEdge(v2, v4) || !g.containsEdge(v3, v4))\n continue;\n for (V v5 : temp) {\n if (v5 == v1 || v5 == v2 || v5 == v3 || v5 == v4\n || g.containsEdge(v2, v5) || g.containsEdge(v3, v5)\n || !g.containsEdge(v1, v5) || !g.containsEdge(v4, v5))\n continue;\n if (certify) {\n List<E> edgeList = new LinkedList<>();\n edgeList.add(g.getEdge(v1, v2));\n edgeList.add(g.getEdge(v2, v3));\n edgeList.add(g.getEdge(v3, v4));\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n\n return false;\n }", "public Enumeration undirectedEdges();", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "public Collection<N> neighbors();", "void contractEdges(DynamicGraph G, Integer u, Integer v ){\n G.removeEdges(u, v);\n // for all vertices w adj to v\n for (Integer w: G.adjacent(v)){\n // addEdge(u, w);\n G.addEdge(u, w);\n }\n // removeVertex(v); decrement V.\n G.removeVertex(v);\n /*System.out.println(\"After contracting edge u: \"+ u +\" v: \"+ v);\n System.out.println(G);*/\n }", "private boolean isClosed(EdgeWeightedDigraph G, FlowEdge e, int V) {}", "@Override\n public Set<T> getNeighbors(T v) {\n int index = getVInfoIndex(v);\n\n // check for an error and throw exception\n // if vertices not in graph\n if (index == -1) {\n throw new IllegalArgumentException(\"DiGraph getNeighbors(): vertex not in graph\");\n }\n HashSet<T> edgeSet = new HashSet<T>();\n VertexInfo<T> vtxInfo = vInfo.get(index);\n Iterator<Edge> iter = vtxInfo.edgeList.iterator();\n Edge e = null;\n\n while (iter.hasNext()) {\n e = iter.next();\n edgeSet.add(vInfo.get(e.dest).vertex);\n }\n\n return edgeSet;\n\n }", "@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }", "@Test\n void test02_removeVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two\n graph.removeVertex(\"a\"); // remove\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.remove(\"a\"); // creates a mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't remove the vertices correctly\");\n }\n }", "@Test\n public void directedRouting_noUTurnAtVirtualEdge() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(3, 4).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(4, 5).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(5, 0).setDistance(1).set(speedEnc, 10, 0);\n NodeAccess na = graph.getNodeAccess();\n na.setNode(0, 1, 0);\n na.setNode(1, 1, 1);\n na.setNode(2, 1, 2);\n na.setNode(3, 0, 2);\n na.setNode(4, 0, 1);\n na.setNode(5, 0, 0);\n\n LocationIndexTree locationIndex = new LocationIndexTree(graph, graph.getDirectory());\n locationIndex.prepareIndex();\n Snap snap = locationIndex.findClosest(1.1, 0.5, EdgeFilter.ALL_EDGES);\n QueryGraph queryGraph = QueryGraph.create(graph, snap);\n\n assertEquals(Snap.Position.EDGE, snap.getSnappedPosition(), \"wanted to get EDGE\");\n assertEquals(6, snap.getClosestNode());\n\n // check what edges there are on the query graph directly, there should not be a direct connection from 1 to 0\n // anymore, but only the virtual edge from 1 to 6 (this is how the u-turn is prevented).\n assertEquals(new HashSet<>(Arrays.asList(0, 2)), GHUtility.getNeighbors(graph.createEdgeExplorer().setBaseNode(1)));\n assertEquals(new HashSet<>(Arrays.asList(6, 2)), GHUtility.getNeighbors(queryGraph.createEdgeExplorer().setBaseNode(1)));\n\n EdgeIteratorState virtualEdge = GHUtility.getEdge(queryGraph, 6, 1);\n int outEdge = virtualEdge.getEdge();\n EdgeToEdgeRoutingAlgorithm algo = createAlgo(queryGraph, weighting);\n Path path = algo.calcPath(6, 0, outEdge, ANY_EDGE);\n assertEquals(nodes(6, 1, 2, 3, 4, 5, 0), path.calcNodes());\n assertEquals(5 + virtualEdge.getDistance(), path.getDistance(), 1.e-3);\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }", "public Set<Square> validDestinations(Board b);", "public void neighhbors(Village vertex) {\n\t\tIterable<Edge> neighbors = g.getNeighbors(vertex);\n\t\tSystem.out.println(\"------------\");\n\t\tSystem.out.println(\"vertex: \" + vertex.getName());\n\t\tfor(Edge e : neighbors) {\n\t\t\tSystem.out.println(\"edge: \" + e.getName());\n\t\t\tSystem.out.println(\"transit: \" + e.getTransit() + \" color: \" + e.getColor());\n\t\t}\n\t}", "public void testRemoveAllVertices() {\n System.out.println(\"removeAllVertices\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllVertices());\n Assert.assertEquals(graph.verticesSet().size(), 0);\n }", "@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public static int[] findRedundantConnection(int[][] edges) {\n UnionDataStructure obj = new UnionDataStructure();\n \n int nodes = edges.length;\n Set<int[]> set = new HashSet<>();\n \n for( int i = 1; i<=nodes; i++ ){\n\t\t\tobj.makeSet( i );\n\t\t}\n\t\t\n for( int[] edge: edges ){\n\t\t\tint edge1 = edge[0];\n\t\t\tint edge2 = edge[1];\n\t\t\tset.add( edge );\n\t\t\t\n\t\t\tif( obj.findSet_representative( edge1 ) != obj.findSet_representative( edge2 ) ){\n\t\t\t\tset.remove( edge );\n\t\t\t\tobj.union( edge1, edge2 );\n\t\t\t}\n\t\t}\n\n Iterator<int[]> iterator = set.iterator();\n\n return iterator.next();\n }", "boolean containsEdge(V v, V w);", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "public void testRemoveEdge_betweenVertices() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(graph.removeEdge(new Integer(i), new Integer(j)));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "private void checkEdgesToSearch() {\n if (edgesToSearch == null || edgesToSearch.length == 0) {\n Graph hg;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n edgesToSearch = hg.getEdges().toArray();\n }\n }", "public static void complementaryGraph(mxAnalysisGraph aGraph) {\n ArrayList<ArrayList<mxCell>> oldConnections = new ArrayList<ArrayList<mxCell>>();\n mxGraph graph = aGraph.getGraph();\n Object parent = graph.getDefaultParent();\n //replicate the edge connections in oldConnections\n Object[] vertices = aGraph.getChildVertices(parent);\n int vertexCount = vertices.length;\n\n for (int i = 0; i < vertexCount; i++) {\n mxCell currVertex = (mxCell)vertices[i];\n int edgeCount = currVertex.getEdgeCount();\n mxCell currEdge = new mxCell();\n ArrayList<mxCell> neighborVertexes = new ArrayList<mxCell>();\n\n for (int j = 0; j < edgeCount; j++) {\n currEdge = (mxCell)currVertex.getEdgeAt(j);\n\n mxCell source = (mxCell)currEdge.getSource();\n mxCell destination = (mxCell)currEdge.getTarget();\n\n if (!source.equals(currVertex)) {\n neighborVertexes.add(j, source);\n }\n else {\n neighborVertexes.add(j, destination);\n }\n\n }\n\n oldConnections.add(i, neighborVertexes);\n }\n\n //delete all edges and make a complementary model\n Object[] edges = aGraph.getChildEdges(parent);\n graph.removeCells(edges);\n\n for (int i = 0; i < vertexCount; i++) {\n ArrayList<mxCell> oldNeighbors = new ArrayList<mxCell>();\n oldNeighbors = oldConnections.get(i);\n mxCell currVertex = (mxCell)vertices[i];\n\n for (int j = 0; j < vertexCount; j++) {\n mxCell targetVertex = (mxCell)vertices[j];\n boolean shouldConnect = true; // the decision if the two current vertexes should be connected\n\n if (oldNeighbors.contains(targetVertex)) {\n shouldConnect = false;\n }\n else if (targetVertex.equals(currVertex)) {\n shouldConnect = false;\n }\n else if (areConnected(aGraph, currVertex, targetVertex)) {\n shouldConnect = false;\n }\n\n if (shouldConnect) {\n graph.insertEdge(parent, null, null, currVertex, targetVertex);\n }\n }\n\n }\n }" ]
[ "0.6658693", "0.63925356", "0.6344519", "0.63189197", "0.63164437", "0.6301537", "0.60661715", "0.6032388", "0.6027323", "0.6000981", "0.599212", "0.5917469", "0.5902579", "0.5849554", "0.58383524", "0.58330643", "0.579371", "0.5787325", "0.57791424", "0.5745729", "0.5728528", "0.5726066", "0.5718232", "0.5706004", "0.5704553", "0.56833464", "0.56671196", "0.5665511", "0.5661268", "0.56526214", "0.5636464", "0.56257826", "0.5623649", "0.56215274", "0.5618041", "0.5613594", "0.5612736", "0.56126446", "0.55938387", "0.55907434", "0.5587473", "0.5583748", "0.55824935", "0.55680513", "0.55678797", "0.55671453", "0.5567006", "0.55656075", "0.55606794", "0.55586314", "0.55583847", "0.5550589", "0.55420136", "0.5538695", "0.55367386", "0.5529005", "0.5523763", "0.55174226", "0.55164355", "0.5515817", "0.551051", "0.55039144", "0.55022633", "0.5494589", "0.5485905", "0.54821026", "0.5465219", "0.54581237", "0.5457991", "0.5450881", "0.54506123", "0.544715", "0.54429615", "0.5434555", "0.5432406", "0.54268914", "0.5422095", "0.5410066", "0.54077375", "0.5402477", "0.54012483", "0.53931344", "0.53824234", "0.5381248", "0.537963", "0.5366622", "0.53566957", "0.5350666", "0.53457606", "0.5342887", "0.5340482", "0.5333064", "0.5323284", "0.53216887", "0.531771", "0.53169227", "0.53096193", "0.530958", "0.53072613", "0.52879864", "0.5287973" ]
0.0
-1
checks the effects of using removeEdge() to remove some edges from a graph by checking the neighbors of all of the vertices afterward
@Test public void testPublic6() { Graph<Character> graph= TestGraphs.testGraph3(); String[] results= {"O", "", "", "E F", "", "", "", "", "", "", "", "B K", "A N", "C G", "H K", "D"}; Character ch; int i; graph.removeEdge('A', 'I'); graph.removeEdge('K', 'J'); graph.removeEdge('M', 'L'); graph.removeEdge('N', 'P'); for (ch= 'A', i= 0; ch <= 'P'; ch++, i++) assertEquals(results[i], TestGraphs.collToString(graph.getNeighbors(ch))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeAllEdges() {\n }", "public void testRemoveEdge_betweenVertices() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(graph.removeEdge(new Integer(i), new Integer(j)));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "public void testRemoveEdge_edge() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(\n graph.removeEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "boolean removeEdge(E edge);", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "public void testRemoveEdgeEdge( ) {\n init( );\n\n assertEquals( m_g4.edgeSet( ).size( ), 4 );\n m_g4.removeEdge( m_v1, m_v2 );\n assertEquals( m_g4.edgeSet( ).size( ), 3 );\n assertFalse( m_g4.removeEdge( m_eLoop ) );\n assertTrue( m_g4.removeEdge( m_g4.getEdge( m_v2, m_v3 ) ) );\n assertEquals( m_g4.edgeSet( ).size( ), 2 );\n }", "public boolean removeEdge(E edge);", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "void removeEdge(int x, int y);", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "protected void removeEdgeAndVertices(TestbedEdge edge) {\n java.util.Collection<Agent> agents = getIncidentVertices(edge);\n removeEdge(edge);\n for (Agent v : agents) {\n if (getIncidentEdges(v).isEmpty()) {\n removeVertex(v);\n }\n }\n }", "@Test\r\n void test_insert_edges_remove_edges_check_size() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n\r\n // There are no more edges in the graph\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"A\", \"E\");\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n }", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "@Test\n void test07_tryToRemoveNonExistentEdge() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n try {\n graph.removeEdge(\"e\", \"f\"); // remove non existent edge\n } catch (Exception e) {\n fail(\"Shouldn't have thrown exception\");\n }\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.add(\"c\"); // creates mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) { // checks if vertices weren't added or removed\n fail(\"wrong vertices are inserted into the graph\");\n }\n if (graph.size() != 2) {\n fail(\"wrong number of edges in the graph\");\n }\n\n }", "public boolean resetEdges();", "public abstract void removeEdge(int from, int to);", "int removeEdges(ExpLineageEdge.FilterOptions options);", "public void removeNeighbours(){\n\t\tgetNeighbours().removeAll(getNeighbours());\n\t}", "@Override public boolean remove(L vertex) {\r\n if(!vertices.contains(vertex)) return false;\r\n vertices.remove(vertex);\r\n Iterator<Edge<L>> iter=edges.iterator();\r\n while(iter.hasNext()) {\r\n \t Edge<L> tmp=iter.next();\r\n \t //改了\r\n \t if(tmp.getSource().equals(vertex) || tmp.getTarget().equals(vertex))\r\n \t // if(tmp.getSource()==vertex|| tmp.getTarget()==vertex) \r\n \t\t iter.remove();\r\n \t}\r\n checkRep();\r\n return true;\r\n \r\n \r\n }", "@Override\n public boolean deleteEdge(Edge edge) {\n return false;\n }", "@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public void testRemoveVertex() {\n System.out.println(\"removeVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n for (int i = 24; i >= 0; i--) {\n Assert.assertTrue(graph.removeVertex(new Integer(i)));\n Assert.assertFalse(graph.containsVertex(new Integer(i)));\n Assert.assertEquals(graph.verticesSet().size(), i);\n }\n }", "void removeEdges(List<CyEdge> edges);", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "public boolean removeEdge(V source, V target);", "public boolean removeEdges(Collection<? extends E> edges);", "void remove(Edge edge);", "public void testRemoveAllEdges() {\n System.out.println(\"removeAllEdges\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllEdges());\n Assert.assertEquals(graph.edgesSet().size(), 0);\n }", "private void removeEdge() {\n boolean go = true;\n int lastNode;\n int proxNode;\n int atualNode;\n if ((parentMatrix[randomChild][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode =\n parentMatrix[randomChild][parentMatrix[randomChild][0] - 1];\n for (int i = (parentMatrix[randomChild][0] - 1); (i > 0 && go); i--)\n { // remove element from parentMatrix\n atualNode = parentMatrix[randomChild][i];\n if (atualNode != randomParent) {\n proxNode = atualNode;\n parentMatrix[randomChild][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n parentMatrix[randomChild][i] = lastNode;\n go = false;\n }\n }\n if ((childMatrix[randomParent][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode = childMatrix[randomParent][\n childMatrix[randomParent][0] - 1];\n go = true;\n for (int i = (childMatrix[randomParent][0] - 1); (i > 0 &&\n go); i--) { // remove element from childMatrix\n atualNode = childMatrix[randomParent][i];\n if (atualNode != randomChild) {\n proxNode = atualNode;\n childMatrix[randomParent][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n childMatrix[randomParent][i] = lastNode;\n go = false;\n }\n } // end of for\n }\n childMatrix[randomParent][(childMatrix[randomParent][0] - 1)] = -4;\n childMatrix[randomParent][0]--;\n parentMatrix[randomChild][(parentMatrix[randomChild][0] - 1)] = -4;\n parentMatrix[randomChild][0]--;\n }\n }", "@DisplayName(\"Delete undirected edges\")\n @Test\n public void testDeleteEdgeUndirected() {\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertEquals(1, graph.getNeighbours(0).size());\n Assertions.assertEquals(1, graph.getNeighbours(1).size());\n }", "@Test\n void test02_removeVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two\n graph.removeVertex(\"a\"); // remove\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.remove(\"a\"); // creates a mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't remove the vertices correctly\");\n }\n }", "public boolean remainingVerticies(ArrayList<Vertex> edges) {\n\n for (int i = 0; i < edges.size(); i++) {\n if (edges.get(i).color == Color.YELLOW) {\n return true;\n }\n }\n return false;\n }", "@Test \n\tpublic void removeVertexTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tgraph.addVertex(D);\n\t\tassertFalse(graph.removeVertex(C));\n\t\tgraph.addVertex(C);\n\t\tgraph.addEdge(edge_0);\n\t\tassertTrue(graph.removeVertex(D));\n\t\tassertFalse(graph.vertices().contains(D));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.addVertex(D));\n\t}", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "public boolean removeEdge(V tail);", "public void removeEdge(int start, int end);", "private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }", "public Boolean removeEdge( AnyType vertex_value_A, AnyType vertex_value_B ) throws VertexException {\n \n // ------------------------------------\n // Basic steps:\n // ------------------------------------\n // 1) For each vertex, check to see if the vertex exists in \n // the vertex_adjacency_list. If not, return false indicated \n // the edge does not exist. Otherwise goto step 2.\n // 2) In Vertex class, check to see if Vertex B is in Vertex A's\n // adjacent_vertex_list and vice versa (i.e. an edge exists). \n // If the edge does not exist return false, otherwise goto \n // step 3.\n // 3) In the Vertex class, remove Vertex B from Vertex A's \n // adjacent_vertex_list and vice versa, and then goto step 4. \n // Does not exist and return false, otherwise proceed to step 4.\n // 4) If number of adjacent vertices for Vertex A is zero, then \n // remove from the vertex_adjacency_list. Likewise, if the \n // number of adjacent vertices for Vertex B is zero, then \n // remove from _adjacency_list. Lastly, return true indicating \n // the edge was successfully removed.\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n boolean a_in_list = false;\n boolean b_in_list = false;\n boolean edge = false;\n int size = vertex_adjacency_list.size();\n int a = -1;\n int b = -1;\n //Make new vertices with values passed in the parameters\n Vertex<AnyType> A = new Vertex<AnyType>(vertex_value_A);\n Vertex<AnyType> B = new Vertex<AnyType>(vertex_value_B);\n //go through to each vertex and find if the vertices exist\n for(int i = 0; i< size-1; i++){\n if( vertex_adjacency_list.get(i).compareTo(A) == 0){\n a_in_list = true;\n a = i;\n }\n if( vertex_adjacency_list.get(i).compareTo(B) == 0){\n b_in_list = true;\n b = i;\n }\n }\n //if doesn't exist, return false\n if( a_in_list == false || b_in_list == false){\n return false;\n }\n //checks if they're is an edge between vertices\n edge = vertex_adjacency_list.get(a).hasAdjacentVertex(vertex_adjacency_list.get(b));\n if(edge == false){\n return false;\n }\n //if edge exists then remove it from both a's and b's adjacency list\n if(edge){\n vertex_adjacency_list.get(a).removeAdjacentVertex(vertex_adjacency_list.get(b));\n vertex_adjacency_list.get(b).removeAdjacentVertex(vertex_adjacency_list.get(a));\n }\n //checking if no adjacecnt vertices then remove the node\n //bc there is no edge pointing to it\n if(vertex_adjacency_list.get(a).numberOfAdjacentVertices() == 0){\n vertex_adjacency_list.remove(a);\n }\n if(vertex_adjacency_list.get(b).numberOfAdjacentVertices() == 0){\n vertex_adjacency_list.remove(b);\n }\n \n \n return true;\n \n }", "@Test\r\n public void testRemoveEdge() {\r\n System.out.println(\"removeEdge\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n expectedResult = 1;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n\r\n expectedResult = 0;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "void removeIsVertexOf(Subdomain_group oldIsVertexOf);", "public abstract void removeEdge(Point p, Direction dir);", "public boolean removeEdge(Edge edge) {\r\n\t\treturn false;\r\n\t}", "Set<Edge> getIncomingNeighborEdges(boolean onUpwardPass) {\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\treturn outgoingEdges;\n\t\t}", "void removeNeighbors();", "private void clearVisited(){\r\n\t\tfor(int i=0; i<graphSize; i++){\r\n\t\t\tmyGraph[i].visited = false;\r\n\t\t\tAdjVertex vert = myGraph[i].adjVertexHead;\r\n\t\t\twhile(vert != null){\r\n\t\t\t\tvert.visited = false;\r\n\t\t\t\tvert= vert.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@DisplayName(\"Delete directed edges\")\n @Test\n public void testDeleteEdgeDirected() {\n boolean directed1 = true;\n graph = new Graph(edges, directed1, 0, 5, GraphType.RANDOM);\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertTrue(graph.getNeighbours(0).isEmpty());\n }", "public void removeVertex();", "@Test\n public void testGraphElements(){\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v5 = new Vertex(5, \"E\");\n Vertex v6 = new Vertex(6, \"F\");\n Vertex v7 = new Vertex(7, \"G\");\n Vertex v8 = new Vertex(8, \"H\");\n\n Vertex fakeVertex = new Vertex(100, \"fake vertex\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v3, v4, 1);\n Edge<Vertex> e4 = new Edge<>(v2, v4, 1);\n Edge<Vertex> e5 = new Edge<>(v2, v6, 1);\n Edge<Vertex> e6 = new Edge<>(v2, v5, 10);\n Edge<Vertex> e7 = new Edge<>(v5, v6, 10);\n Edge<Vertex> e8 = new Edge<>(v4, v6, 10);\n Edge<Vertex> e9 = new Edge<>(v6, v7, 10);\n Edge<Vertex> e10 = new Edge<>(v7, v8, 10);\n\n Edge<Vertex> fakeEdge = new Edge<>(fakeVertex, v1);\n Edge<Vertex> edgeToRemove = new Edge<>(v2, v7, 200);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addVertex(v5);\n g.addVertex(v6);\n g.addVertex(v7);\n g.addVertex(v8);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n g.addEdge(e6);\n g.addEdge(e7);\n g.addEdge(e8);\n g.addEdge(e9);\n g.addEdge(edgeToRemove);\n\n Assert.assertTrue(g.addEdge(e10));\n\n //adding null edge or vertex to graph returns false\n Assert.assertFalse(g.addEdge(null));\n Assert.assertFalse(g.addVertex(null));\n\n //adding edge with a vertex that does not exist in graph g returns false\n Assert.assertFalse(g.addEdge(fakeEdge));\n\n //get an edge that does not exit in graph returns false\n Assert.assertFalse(g.edge(v1, fakeVertex));\n\n //getting length of edge from vertex not in graph g returns false\n Assert.assertEquals(0, g.edgeLength(fakeVertex, v2));\n\n //Remove an edge in graph g returns true\n Assert.assertTrue(g.remove(edgeToRemove));\n\n //Removing edge not in graph g returns false\n Assert.assertFalse(g.remove(fakeEdge));\n\n //Removing vertex not in graph g returns false\n Assert.assertFalse(g.remove(fakeVertex));\n\n //Finding an edge with an endpoint not in graph g returns null\n assertNull(g.getEdge(v1, fakeVertex));\n }", "private void removeNoMoreExistingOriginalNodes() {\n for (Node mirrorNode : mirrorGraph.nodes()) {\n if (!isPartOfMirrorEdge(mirrorNode) && !originalGraph.has(mirrorNode)) {\n mirrorGraph.remove(mirrorNode);\n }\n }\n }", "private void removeNoMoreExistingOriginalEdges() {\n for (MirrorEdge mirrorEdge : directEdgeMap.values()) {\n if (!originalGraph.has(mirrorEdge.original)) {\n for (Edge segment : mirrorEdge.segments) {\n mirrorGraph.forcedRemove(segment);\n reverseEdgeMap.remove(segment);\n }\n for (Node bend : mirrorEdge.bends) {\n mirrorGraph.forcedRemove(bend);\n reverseEdgeMap.remove(bend);\n }\n directEdgeMap.remove(mirrorEdge.original);\n }\n }\n }", "private final void pruneParallelSkipEdges() {\n // TODO: IF THERE ARE MULTIPLE EDGES WITH THE SAME EDGE WEIGHT, WE ARBITRARILY PICK THE FIRST EDGE TO KEEP\n // THE ORDERING MAY BE DIFFERENT FROM BOTH SIDES OF THE EDGE, WHICH CAN LEAD TO A NONSYMMETRIC GRAPH\n // However, no issues have cropped up yet. Perhaps the ordering happens to be the same for both sides,\n // due to how the graph is constructed. This is not good to rely upon, however.\n Memory.initialise(maxSize, Float.POSITIVE_INFINITY, -1, false);\n \n int maxDegree = 0;\n for (int i=0;i<nNodes;++i) {\n maxDegree = Math.max(maxDegree, nSkipEdgess[i]);\n }\n \n int[] neighbourIndexes = new int[maxDegree];\n int[] lowestCostEdgeIndex = new int[maxDegree];\n float[] lowestCost = new float[maxDegree];\n int nUsed = 0;\n \n for (int i=0;i<nNodes;++i) {\n nUsed = 0;\n int degree = nSkipEdgess[i];\n int[] sEdges = outgoingSkipEdgess[i];\n float[] sWeights = outgoingSkipEdgeWeightss[i];\n \n for (int j=0;j<degree;++j) {\n int dest = sEdges[j];\n float weight = sWeights[j];\n \n int p = Memory.parent(dest);\n int index = -1;\n \n if (p == -1) {\n index = nUsed;\n ++nUsed;\n \n Memory.setParent(dest, index);\n neighbourIndexes[index] = dest;\n \n lowestCostEdgeIndex[index] = j;\n lowestCost[index] = weight;\n } else {\n index = p;\n if (weight < lowestCost[index]) {\n // Remove existing\n \n /* ________________________________\n * |______E__________C____________L_|\n * ________________________________\n * |______C__________L____________E_|\n * ^\n * |\n * nSkipEdges--\n */\n swapSkipEdges(i, lowestCostEdgeIndex[index], j);\n swapSkipEdges(i, j, degree-1);\n --j; --degree;\n \n // lowestCostEdgeIndex[index] happens to be the same as before.\n lowestCost[index] = weight;\n } else {\n // Remove this.\n \n /* ________________________________\n * |______E__________C____________L_|\n * ________________________________\n * |______E__________L____________C_|\n * ^\n * |\n * nSkipEdges--\n */\n swapSkipEdges(i, j, degree-1);\n --j; --degree;\n }\n }\n \n }\n nSkipEdgess[i] = degree;\n \n // Cleanup\n for (int j=0;j<nUsed;++j) {\n Memory.setParent(neighbourIndexes[j], -1); \n }\n }\n }", "public abstract boolean hasEdge(int from, int to);", "public void testRemoveAllVertices() {\n System.out.println(\"removeAllVertices\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllVertices());\n Assert.assertEquals(graph.verticesSet().size(), 0);\n }", "private static void RemoveEdge(Point a, Point b)\n {\n //Here we use a lambda expression/predicate to express that we're looking for a match in list\n //Either if (n.A == a && n.B == b) or if (n.A == b && n.B == a)\n edges.removeIf(n -> n.A == a && n.B == b || n.B == a && n.A == b);\n }", "private void removeEdgeJointPointDest(Vector<Edge> edges) {\n\t\tfor (Edge e: edges) {\n\t\t\t\tEdge currentEdge = e;\n\t\t\t\tremoveEdge(e);\n\t\t\t\twhile (shapes.contains(currentEdge.getDest()) && currentEdge.getDest() instanceof JoinPoint) {\n\t\t\t\t\tJoinPoint join = (JoinPoint) currentEdge.getDest();\n\t\t\t\t\tshapes.remove(join);\n\t\t\t\t\tcurrentEdge = (Edge) join.getDest();\n\t\t\t\t\tremoveEdge(currentEdge);\n\t\t\t\t}\n\t\t}\n\t}", "private void removeEdges()\r\n\t{\r\n\t final String edgeTypeName = edgeType.getName();\r\n\t for (final Edge e : eSet)\r\n\t\te.getSource().removeEdge(edgeTypeName, e.getDest());\r\n\t eSet.clear();\r\n\t}", "void contractEdges(DynamicGraph G, Integer u, Integer v ){\n G.removeEdges(u, v);\n // for all vertices w adj to v\n for (Integer w: G.adjacent(v)){\n // addEdge(u, w);\n G.addEdge(u, w);\n }\n // removeVertex(v); decrement V.\n G.removeVertex(v);\n /*System.out.println(\"After contracting edge u: \"+ u +\" v: \"+ v);\n System.out.println(G);*/\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public void checkEdges()\n\tthrows InconsistencyException\n\t{\n\t\t// first check if edges is non-null\n\t\tif(edges == null)\n\t\t\tthrow new InconsistencyException(\"The ArrayList edges should be non-null, but is null.\");\n\n\t\t// check that all vertices are referenced at least three times, as each is the vertex of at least one simplex\n\t\t// and in each simplex three edges meet at each vertex\n\t\t\n\t\t// create an array of ints that will hold the number of references to each vertex in the list of edges...\n\t\tint[] vertexReferences = new int[vertices.size()];\n\t\t\n\t\t// ... and set all these reference counts initially to zero\n\t\tfor(int i=0; i<vertexReferences.length; i++) vertexReferences[i] = 0;\n\t\t\n\t\t// go through all edges...\n\t\tfor(Edge edge:edges)\n\t\t{\n\t\t\t// go through both vertices...\n\t\t\tfor(int i=0; i<2; i++)\n\t\t\t\t// ... and increase the reference count of the vertex by 1\n\t\t\t\tvertexReferences[edge.getVertexIndices()[i]]++;\n\t\t\t// note that any vertex indices that are out of bounds will throw up an error here!\n\t\t}\n\n\t\t// check that all reference counts are >= 3\n\t\tfor(int i=0; i<vertexReferences.length; i++)\n\t\t{\n\t\t\tif(vertexReferences[i] < 3)\n\t\t\t{\n\t\t\t\t// vertex i is referenced fewer than 3 times\n\t\t\t\t\n\t\t\t\t// throw an InconsistencyException\n\t\t\t\tthrow(new InconsistencyException(\"Vertex #\" + i + \" should be referenced in the list of edges >= 3 times, but is referenced only \" + vertexReferences[i] + \" times.\"));\n\t\t\t}\n\t\t}\n\t}", "protected void checkEdges(){\n if (getX() > getWorld().getBackground().getWidth() + getImage().getWidth()){\n world.monsterAdded();\n getWorld().removeObject(this);\n world.decreaseLives();\n }\n }", "@Test\r\n public void testEdges() {\r\n System.out.println(\"edges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Collection colection = instance.edges();\r\n boolean result = colection.contains(e);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n result = colection.contains(e);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "boolean ignoreExistingVertices();", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "@Test\n public void testRemoveEdges() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(2L, 3L, 23L));\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\" + \"1,2,12\\n\" + \"1,3,13\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public boolean removeEdge(V tail, V head);", "public void deleteSelected() {\r\n \t\tObject cells[] = graph.getSelectionCells();\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \r\n \t\t// If a cell is a blocking region avoid removing its edges and\r\n \t\t// select its element at the end of the removal process\r\n \t\tSet edges = new HashSet();\r\n \t\tSet<Object> select = new HashSet<Object>();\r\n \r\n \t\t// Set with all regions that can be deleted as its child were removed\r\n \t\tSet<Object> regions = new HashSet<Object>();\r\n \t\t// Set with all JmtCells that we are removing\r\n \t\tSet<Object> jmtCells = new HashSet<Object>();\r\n \r\n \t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t// for(int k=0; k<cells.length; k++){\r\n \t\t// if(cells[k] instanceof JmtEdge){\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)cells[k])))).SubOut();\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)cells[k])))).SubIn();\r\n \t\t// }\r\n \t\t//\r\n \t\t// }\r\n \t\tfor (int i = 0; i < cells.length; i++) {\r\n \t\t\tif (!(cells[i] instanceof BlockingRegion)) {\r\n \t\t\t\t// Adds edge for removal\r\n \t\t\t\tedges.addAll(DefaultGraphModel.getEdges(graphmodel, new Object[] { cells[i] }));\r\n \t\t\t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t\t\t// quando vado a eliminare un nodo, a cui collegato un arco,\r\n \t\t\t\t// vado ad incrementare o diminuire il contatore per il\r\n \t\t\t\t// pulsanteAGGIUSTATUTTO\r\n \t\t\t\t// Iterator iter = edges.iterator();\r\n \t\t\t\t// while (iter.hasNext()) {\r\n \t\t\t\t// Object next = iter.next();\r\n \t\t\t\t// if (next instanceof JmtEdge){\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)next)))).SubOut();\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)next)))).SubIn();\r\n \t\t\t\t// }\r\n \t\t\t\t//\r\n \t\t\t\t// }\r\n \t\t\t\t// Stores parents information and cell\r\n \t\t\t\tif (cells[i] instanceof JmtCell) {\r\n \t\t\t\t\tif (((JmtCell) cells[i]).getParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t\tregions.add(((JmtCell) cells[i]).getParent());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tjmtCells.add(cells[i]);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t// Adds node for selection\r\n \t\t\t\tObject[] nodes = graph.getDescendants(new Object[] { cells[i] });\r\n \t\t\t\tfor (Object node : nodes) {\r\n \t\t\t\t\tif (node instanceof JmtCell || node instanceof JmtEdge) {\r\n \t\t\t\t\t\tselect.add(node);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t// Removes blocking region from data structure\r\n \t\t\t\tmodel.deleteBlockingRegion(((BlockingRegion) cells[i]).getKey());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tif (!edges.isEmpty()) {\r\n \t\t\tgraphmodel.remove(edges.toArray());\r\n \t\t}\r\n \t\t// removes cells from graph\r\n \t\tgraphmodel.remove(cells);\r\n \r\n \t\t// Checks if all children of a blocking region have been removed\r\n \t\tIterator<Object> it = regions.iterator();\r\n \t\twhile (it.hasNext()) {\r\n \t\t\tjmtCells.add(null);\r\n \t\t\tBlockingRegion region = (BlockingRegion) it.next();\r\n \t\t\tList child = region.getChildren();\r\n \t\t\tboolean empty = true;\r\n \t\t\tfor (int i = 0; i < child.size(); i++) {\r\n \t\t\t\tif (child.get(i) instanceof JmtCell && !jmtCells.contains(child.get(i))) {\r\n \t\t\t\t\tempty = false;\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (empty) {\r\n \t\t\t\tmodel.deleteBlockingRegion(region.getKey());\r\n \t\t\t\tgraphmodel.remove(new Object[] { region });\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Removes cells from data structure\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tmodel.deleteStation(((CellComponent) ((JmtCell) cell).getUserObject()).getKey());\r\n \t\t\t} else if (cell instanceof JmtEdge) {\r\n \t\t\t\tJmtEdge link = (JmtEdge) cell;\r\n \t\t\t\tmodel.setConnected(link.getSourceKey(), link.getTargetKey(), false);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// If no stations remains gray select and link buttons\r\n \t\tif (graph.getModel().getRootCount() == 0) {\r\n \t\t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\t\tsetConnect.setEnabled(false);\r\n \t\t\tsetSelect.setEnabled(false);\r\n \t\t}\r\n \r\n \t\t// Selects components from removed blocking regions\r\n \t\tif (select.size() > 0) {\r\n \t\t\tgraph.setSelectionCells(select.toArray());\r\n \t\t\t// Resets parent information of cells that changed parent\r\n \t\t\tit = select.iterator();\r\n \t\t\twhile (it.hasNext()) {\r\n \t\t\t\tObject next = it.next();\r\n \t\t\t\tif (next instanceof JmtCell) {\r\n \t\t\t\t\t((JmtCell) next).resetParent();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "void removeNeighbor(IsisNeighbor isisNeighbor);", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "private void checkEdgesToSearch() {\n if (edgesToSearch == null || edgesToSearch.length == 0) {\n Graph hg;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n edgesToSearch = hg.getEdges().toArray();\n }\n }", "protected void processEdge(Edge e) {\n\t}", "void removeVert(Pixel toRemove) {\n\n // is the given below this\n if (this.down == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n }\n }\n\n // is the given downright to this\n else if (this.downRight() == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n toRemove.left.up = toRemove.up;\n }\n if (toRemove.up != null) {\n toRemove.up.down = toRemove.left;\n }\n }\n\n //is the given downleft to this\n else if (this.downLeft() == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n }\n if (toRemove.right != null) {\n toRemove.right.up = toRemove.up;\n }\n if (toRemove.up != null) {\n toRemove.up.down = toRemove.right;\n }\n }\n // if the connections were incorrect\n else {\n throw new RuntimeException(\"Illegal vertical seam\");\n }\n }", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "public static void complementaryGraph(mxAnalysisGraph aGraph) {\n ArrayList<ArrayList<mxCell>> oldConnections = new ArrayList<ArrayList<mxCell>>();\n mxGraph graph = aGraph.getGraph();\n Object parent = graph.getDefaultParent();\n //replicate the edge connections in oldConnections\n Object[] vertices = aGraph.getChildVertices(parent);\n int vertexCount = vertices.length;\n\n for (int i = 0; i < vertexCount; i++) {\n mxCell currVertex = (mxCell)vertices[i];\n int edgeCount = currVertex.getEdgeCount();\n mxCell currEdge = new mxCell();\n ArrayList<mxCell> neighborVertexes = new ArrayList<mxCell>();\n\n for (int j = 0; j < edgeCount; j++) {\n currEdge = (mxCell)currVertex.getEdgeAt(j);\n\n mxCell source = (mxCell)currEdge.getSource();\n mxCell destination = (mxCell)currEdge.getTarget();\n\n if (!source.equals(currVertex)) {\n neighborVertexes.add(j, source);\n }\n else {\n neighborVertexes.add(j, destination);\n }\n\n }\n\n oldConnections.add(i, neighborVertexes);\n }\n\n //delete all edges and make a complementary model\n Object[] edges = aGraph.getChildEdges(parent);\n graph.removeCells(edges);\n\n for (int i = 0; i < vertexCount; i++) {\n ArrayList<mxCell> oldNeighbors = new ArrayList<mxCell>();\n oldNeighbors = oldConnections.get(i);\n mxCell currVertex = (mxCell)vertices[i];\n\n for (int j = 0; j < vertexCount; j++) {\n mxCell targetVertex = (mxCell)vertices[j];\n boolean shouldConnect = true; // the decision if the two current vertexes should be connected\n\n if (oldNeighbors.contains(targetVertex)) {\n shouldConnect = false;\n }\n else if (targetVertex.equals(currVertex)) {\n shouldConnect = false;\n }\n else if (areConnected(aGraph, currVertex, targetVertex)) {\n shouldConnect = false;\n }\n\n if (shouldConnect) {\n graph.insertEdge(parent, null, null, currVertex, targetVertex);\n }\n }\n\n }\n }", "public void removeDuplicates(ArrayList<Edge> edges) {\n\t\tfor (int i = 0; i < edges.size(); i++) {\r\n\t\t\tfor (int j = i + 1; j < edges.size(); j++) {\r\n\t\t\t\tString v11 = edges.get(i).vertex1;\r\n\t\t\t\tString v12 = edges.get(i).vertex2;\r\n\t\t\t\tString v21 = edges.get(j).vertex1;\r\n\t\t\t\tString v22 = edges.get(j).vertex2;\r\n\t\t\t\tif ((v11.equals(v21) && v12.equals(v22)) || (v11.equals(v22) && v12.equals(v21))) {\r\n\t\t\t\t\tedges.remove(j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void removeEdge(N startNode, N endNode)\r\n/* 80: */ {\r\n/* 81:151 */ assert (checkRep());\r\n/* 82:152 */ if ((contains(startNode)) && (((Map)this.map.get(startNode)).containsKey(endNode)))\r\n/* 83: */ {\r\n/* 84:153 */ ((Map)this.map.get(startNode)).remove(endNode);\r\n/* 85:154 */ ((Map)this.map.get(endNode)).remove(startNode);\r\n/* 86: */ }\r\n/* 87: */ }", "public void testContainsEdgeEdge( ) {\n init( );\n\n //TODO Implement containsEdge().\n }", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "void removeEdge(Vertex v1, Vertex v2) throws GraphException;", "private boolean forbidEdgeCreation(NetworkEdge edge) {\n return network.getEdges().stream()\n .filter(networkEdge ->\n edge.getFrom().equals(networkEdge.getTo())\n ).anyMatch(networkEdge ->\n edge.getTo().equals(networkEdge.getFrom())\n );\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public void removeEdge(Edge e){\n edgeList.remove(e);\n }", "@Override\n\tpublic boolean removeEdge(ET edge)\n\t{\n\t\tif (edge == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tList<N> adjacentNodes = edge.getAdjacentNodes();\n\t\tfor (N node : adjacentNodes)\n\t\t{\n\t\t\tSet<ET> adjacentEdges = nodeEdgeMap.get(node);\n\t\t\t/*\n\t\t\t * null Protection required in case edge wasn't actually in the\n\t\t\t * graph\n\t\t\t */\n\t\t\tif (adjacentEdges != null)\n\t\t\t{\n\t\t\t\tadjacentEdges.remove(edge);\n\t\t\t}\n\t\t}\n\t\tif (edgeList.remove(edge))\n\t\t{\n\t\t\tgcs.fireGraphEdgeChangeEvent(edge, EdgeChangeEvent.EDGE_REMOVED);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "private static void stripTrivialCycles(CFG cfg) {\n\t\tCollection<SDGEdge> toRemove = new LinkedList<SDGEdge>();\n\t\tfor (SDGEdge e : cfg.edgeSet()) {\n\t\t\tif (e.getSource().equals(e.getTarget())) {\n\t\t\t\ttoRemove.add(e);\n\t\t\t}\n\t\t}\n\t\t\n\t\tcfg.removeAllEdges(toRemove);\n\t}", "public void cleanNodeListToEdges(CircosEdgeList edges){\n\t\tArrayList<CircosNode> tempnodes = new ArrayList<CircosNode>();\n\t\tHashMap<String,String> tempcolors = new HashMap<String,String>();\n\t\t\n\t\tfor(int i = 0; i < nodes.size(); i++){\n\t\t\tif(edges.containsNodeAsSourceOrTarget(nodes.get(i).getID())){\n\t\t\t\ttempnodes.add(nodes.get(i));\n\t\t\t\ttempcolors.put(nodes.get(i).getID(), colors.get(nodes.get(i).getID()));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tnodes = tempnodes;\n\t\tcolors = tempcolors;\n\t}", "public void removeEdges (E vertex) throws IllegalArgumentException\n {\n int index = this.indexOf (vertex);\n if (index < 0)\n throw new IllegalArgumentException (vertex + \" was not found!\");\n\n Node currentNode = adjacencySequences[index];\n while (currentNode != null)\n {\n this.removeNode (currentNode.neighbourIndex, index);\n currentNode = currentNode.nextNode;\n }\n\n adjacencySequences[index] = null;\n }", "@Override\n\tpublic boolean removeEdge(E vertexX, E vertexY) {\n\t\tUnorderedPair<E> edge = new UnorderedPair<>(vertexX, vertexY);\n\t\treturn edges.remove(edge);\n\t}", "public void removeVertex (T vertex){\n int index = vertexIndex(vertex);\n \n if (index < 0) return; // vertex does not exist\n \n n--;\n // IF THIS DOESN'T WORK make separate loop for column moving\n for (int i = index; i < n; i++){\n vertices[i] = vertices[i + 1];\n for (int j = 0; j < n; j++){\n edges[j][i] = edges[j][i + 1]; // moving row up\n edges[i] = edges[i + 1]; // moving column over\n }\n }\n }", "public void checkNeighbour() {\r\n for (int y = 0; y < table.length; y++){\r\n for (int x = 0; x < table.length; x++){\r\n rule(y, x);\r\n }\r\n }\r\n for (int i = 0; i < table.length; i++)\r\n System.arraycopy(temp_table[i], 0, table[i], 0, table.length);\r\n }", "public void removeEdge(int node1, int node2)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2))\n\t{\n\t\tNode n1 = (Node) getNodes().get(node1);\n\t\tNode n2 = (Node) getNodes().get(node2);\n\n\t\tif(n1.getEdgesOf().containsKey(node2))\n\t\t{\n\t\t\tedge_size--;\n\t\t\tmc++;\n\t\t\tn1.getEdgesOf().remove(node2);\n\n\t\t}\n\t\tif(n2.getEdgesOf().containsKey(node1))\n\t\t{\n\t\t\tedge_size--;\n\t\t\tmc++;\n\t\t\tn2.getEdgesOf().remove(node1);\n\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t\t//System.out.println(\"Edge doesnt exist\");\n\t\t}\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"src or dest doesnt exist\");\n\t}\n}", "public void removeEdge(Position ep) throws InvalidPositionException;", "private LPGActionGraph getDeleteNeighbor(List<PlanGraphStep> removeChoices,\n\t\t\tUnsupportedPrecondition inconsistency, int currentLevel) {\n\t\t\n\t\tLPGActionGraph neighbor = this.copyActionGraph();\n\t\t\n\t\tfor (PlanGraphStep stepToRemove : removeChoices) {\n\t\t\tneighbor.removeEffects(stepToRemove, currentLevel + 1);\n\t\t\tneighbor.removeInvalidMutex(stepToRemove, currentLevel + 1);\n\t\t}\n\t\tneighbor.removeInconsistency(inconsistency);\n\t\tneighbor.updateUnsupportedPreconditionInconsistencies(currentLevel + 1);\n\t\tneighbor.graphQuality = neighbor.calculateQuality();\n\t\treturn neighbor;\n\t}", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "@Test\n public void testRemoveEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdge(new Edge<>(5L, 1L, 51L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }" ]
[ "0.69733655", "0.69452983", "0.6930936", "0.6919946", "0.6847226", "0.6808629", "0.6794669", "0.6786136", "0.67405957", "0.6728995", "0.67150056", "0.6666509", "0.6607185", "0.65802884", "0.6571628", "0.65532124", "0.6543015", "0.647187", "0.64525974", "0.6417833", "0.64112", "0.64016604", "0.6372585", "0.63717073", "0.6371211", "0.6369329", "0.63491994", "0.63462096", "0.6344662", "0.63282746", "0.6321013", "0.63202965", "0.62924623", "0.62749845", "0.6249033", "0.62378645", "0.621647", "0.61979455", "0.61952925", "0.61903507", "0.6182658", "0.61530197", "0.6147092", "0.6128781", "0.607604", "0.6071009", "0.6065004", "0.60573477", "0.6031895", "0.600504", "0.60037357", "0.59971714", "0.5988007", "0.59870636", "0.5984601", "0.5981584", "0.5974795", "0.5950688", "0.5945909", "0.5938144", "0.59126407", "0.5898482", "0.5884175", "0.586456", "0.58516616", "0.5847563", "0.5843699", "0.58421403", "0.58341247", "0.5823406", "0.5820642", "0.5815239", "0.5814769", "0.579336", "0.57753974", "0.5770631", "0.5768896", "0.5753485", "0.5729375", "0.5724027", "0.5715046", "0.5713086", "0.5709319", "0.5705965", "0.5698685", "0.5697869", "0.56786644", "0.5675223", "0.56735766", "0.56708145", "0.565154", "0.564648", "0.5619428", "0.5617903", "0.56122786", "0.5611056", "0.5608493", "0.56029755", "0.55992883", "0.55956095", "0.5595116" ]
0.0
-1
tests getVertices(); is basically the same as the previous test except for use of getVertices() (note that "ch 'A'" is the index of an element of the array; its value is 0 if ch is 'A', 1 if ch is 'B', etc.)
@Test public void testPublic7() { Graph<Character> graph= TestGraphs.testGraph3(); String[] results= {"O", "", "", "E F", "", "", "", "", "", "", "", "B K", "A N", "C G", "H K", "D"}; graph.removeEdge('A', 'I'); graph.removeEdge('K', 'J'); graph.removeEdge('M', 'L'); graph.removeEdge('N', 'P'); for (Character ch : graph.getVertices()) assertEquals(results[ch - 'A'], TestGraphs.collToString(graph.getNeighbors(ch))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getVertices();", "public abstract Vector2[] getVertices();", "public float[] getVertices() {\n/* 793 */ COSBase base = getCOSObject().getDictionaryObject(COSName.VERTICES);\n/* 794 */ if (base instanceof COSArray)\n/* */ {\n/* 796 */ return ((COSArray)base).toFloatArray();\n/* */ }\n/* 798 */ return null;\n/* */ }", "public java.util.List<V> getVertices();", "public Vertex[] getVertices() {\n return arrayOfVertices;\n }", "public float[] getVertices() {\r\n\t\treturn vertices;\r\n\t}", "public E[] verticesView ()\n {\n E[] allVertices = (E[]) new Object[lastIndex + 1];\n for (int index = 0; index < allVertices.length; index++)\n allVertices[index] = this.vertices[index];\n\n return allVertices;\n }", "public Set<V> getVertices();", "public Set<V> getVertices();", "public int[] getVertices() {\n long cPtr = RecastJNI.rcContour_verts_get(swigCPtr, this);\n if (cPtr == 0) {\n return null;\n }\n return Converter.convertToInts(cPtr, getNumberOfVertices() * 4);\n }", "@Override\r\n\tpublic ArrayList<E> getVertices() {\r\n\t\tArrayList<E> verts = new ArrayList<>();\r\n\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\tverts.add(t);\r\n\t\t});\r\n\t\treturn verts;\r\n\t}", "@Test\n public void getVertexes() {\n\n for (int i = 0; i < 6; i++) {\n\n Vertex temp = new Vertex(i + \"\", \"Location number \" + i);\n assertTrue(temp.equals(testGraph.getVertices ().get(i)));\n\n }\n }", "@Test\r\n public void testGetVertices() {\r\n System.out.println(\"getVertices\");\r\n Polygon instance = new Polygon();\r\n int expResult = 0;\r\n int result = instance.getVertices().size();\r\n assertEquals(expResult, result);\r\n }", "public void getVertices (float[] vertices) {\r\n \t\tif (vertices.length < getNumVertices() * getVertexSize() / 4)\r\n \t\t\tthrow new IllegalArgumentException(\"not enough room in vertices array, has \" + vertices.length + \" floats, needs \"\r\n \t\t\t\t+ getNumVertices() * getVertexSize() / 4);\r\n \t\tint pos = getVerticesBuffer().position();\r\n \t\tgetVerticesBuffer().position(0);\r\n \t\tgetVerticesBuffer().get(vertices, 0, getNumVertices() * getVertexSize() / 4);\r\n \t\tgetVerticesBuffer().position(pos);\r\n \t}", "public abstract int getNumberOfVertices();", "Set<Vertex> getVertices();", "private E3DTexturedVertex getVertexA(){\r\n\t\treturn vertices[0];\r\n\t}", "@Test\n\tpublic void verticesTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(D));\n\t}", "public Collection<V> getVertices();", "public int getNumberOfVertices();", "void getVertices() {\r\n\t\tSystem.out.println(\"Enter your vertices:\");\r\n\t\tarrIndexToVertexMap = new HashMap<>();\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < numberOfVertices; i++) {\r\n\t\t\t\tarrIndexToVertexMap.put(i, sc.next());\r\n\t\t\t}\r\n\t\t\tsc.close();\r\n\t\t} catch (RuntimeException re) {\r\n\t\t\tSystem.out.println(\"Error at method:: getVertices || Description:\" + re);\r\n\t\t}\r\n\t}", "public void testVerticesSet() {\n System.out.println(\"verticesSet\");\n\n Assert.assertTrue(generateGraph().verticesSet().size() == 25);\n }", "public int getNumVertices();", "public Vector3f[] getVertices() {\n return vertices;\n }", "@Test\n\tvoid testVerticesExist() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\n\t\tedges.add(\"Newark\");\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tedges = map.get(\"Boston\");\n\t\tString[] edgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Boston\"));\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Newark\"));\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Albany\");\n\t\tmap.put(\"Trenton\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Trenton\"));\n\t}", "public Vertex[] getVertices() {\n return new Vertex[]{v1, v2};\n }", "public Vertex[] getVertices() {\n\t\treturn this._vertices.toArray(new Vertex[0]);\n\t}", "public PosicionVertice[] getVertices(PosicionVertice rpv[]) {\n \n // inicializacion\n rpv = (rpv == null) ? new PosicionVertice[2] : rpv;\n for (int i=0; i<rpv.length; i++) {\n rpv[i] = (rpv[i] == null) ? new PosicionVertice() : rpv[i];\n }\n normaliza();\n \n switch(getOrientacion()) {\n case Este:\n rpv[0].setPos(getX(), getY()-1);\n rpv[0].setOrientacion(OrientacionVertice.Sur);\n rpv[1].setPos(getX()+1, getY());\n rpv[1].setOrientacion(OrientacionVertice.Norte);\n break;\n case NorEste:\n rpv[0].setPos(getX(), getY());\n rpv[0].setOrientacion(OrientacionVertice.Norte);\n rpv[1].setPos(getX(), getY()-1);\n rpv[1].setOrientacion(OrientacionVertice.Sur);\n break; \n case NorOeste:\n rpv[0].setPos(getX(), getY());\n rpv[0].setOrientacion(OrientacionVertice.Norte);\n rpv[1].setPos(getX()-1, getY());\n rpv[1].setOrientacion(OrientacionVertice.Sur);\n break; \n }\n return rpv;\n }", "@Override\r\n\tpublic Vector2f[] getVertices() {\n\t\treturn null;\r\n\t}", "public int numVertices() { return numV; }", "public IntPoint[] getVertices() {\n\t\treturn PointArrays.copy(vertices);\n\t}", "public int numVertices();", "public int numVertices();", "public Enumeration vertices();", "public Set<String> getVertices()\r\n\t{\r\n\t\treturn this.dataMap.keySet();\r\n\t}", "public Vertice[] getSelectedVertices(){\n\t\tVertice selectedVertice;\n\t\tVertice[] vertices = new Vertice[getSelectedModelVerticeCount()];\n\t\tint index = 0;\n\t\tfor(int i = 0; i < getModelVerticesCount(); i++){\n\t\t\tselectedVertice = getModelVertice(i);\n\t\t\tif(selectedVertice.isSelected)\n\t\t\t\tvertices[index++] = selectedVertice;\n\t\t}\n\t\treturn vertices;\n\t}", "@Override public Set<L> vertices() {\r\n return new HashSet<L>(vertices);//防御式拷贝\r\n }", "public abstract int getVertexCount();", "public int getVertexCount();", "int getNumberOfVertexes();", "public List<wVertex> getVertices(){\r\n return vertices;\r\n }", "public Vertex[] Vertices (TrianglePair pair)\n\t{\n\t\tFace tri1 = trimesh.faces[pair.face1];\n\t\tFace tri2 = trimesh.faces[pair.face2];\n\t\tVertex[] verts1 = new Vertex[3];\n\t\tVertex[] verts2 = new Vertex[3];\n\t\tverts1[0] = trimesh.vertices[tri1.fvlist[0]];\n\t\tverts1[1] = trimesh.vertices[tri1.fvlist[1]];\n\t\tverts1[2] = trimesh.vertices[tri1.fvlist[2]];\n\t\tverts2[0] = trimesh.vertices[tri2.fvlist[0]];\n\t\tverts2[1] = trimesh.vertices[tri2.fvlist[1]];\n\t\tverts2[2] = trimesh.vertices[tri2.fvlist[2]];\n\t\tboolean[] equalVerts = new boolean[9];\n\t\tVertex[] retverts = new Vertex[4];\n\t\tequalVerts[0] = (verts1[0] == verts2[0]);\n\t\tequalVerts[1] = (verts1[0] == verts2[1]);\n\t\tequalVerts[2] = (verts1[0] == verts2[2]);\n\t\tequalVerts[3] = (verts1[1] == verts2[0]);\n\t\tequalVerts[4] = (verts1[1] == verts2[1]);\n\t\tequalVerts[5] = (verts1[1] == verts2[2]);\n\t\tequalVerts[6] = (verts1[2] == verts2[0]);\n\t\tequalVerts[7] = (verts1[2] == verts2[1]);\n\t\tequalVerts[8] = (verts1[2] == verts2[2]);\n\t\tint eqto1in1 = 0, eqto1in2 = 0, eqto2in1 = 0, eqto2in2 = 0;\n\t\tint i;\n\t\tfor (i = 0; i < 9; i++)\n\t\t{\n\t\t\tif (equalVerts[i])\n\t\t\t{\n\t\t\t\teqto1in1 = i / 3;\n\t\t\t\teqto1in2 = i % 3;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (i = 8; i >= 0; i--)\n\t\t{\n\t\t\tif (equalVerts[i])\n\t\t\t{\n\t\t\t\teqto2in1 = i / 3;\n\t\t\t\teqto2in2 = i % 3;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tretverts[0] = verts1[eqto1in1];\n\t\tretverts[1] = verts1[eqto2in1];\n\t\tint lone1, lone2;\n\t\tif (eqto1in1 == 0)\n\t\t{\n\t\t\tif (eqto2in1 == 1)\n\t\t\t\tlone1 = 2;\n\t\t\telse // eqto2in1 == 2\n\t\t\t\tlone1 = 1;\n\t\t}\n\t\telse if (eqto1in1 == 1)\n\t\t{\n\t\t\tif (eqto2in1 == 0)\n\t\t\t\tlone1 = 2;\n\t\t\telse // eqto2in1 == 2\n\t\t\t\tlone1 = 0;\n\t\t}\n\t\telse // eqto1in1 == 2\n\t\t{\n\t\t\tif (eqto2in1 == 0)\n\t\t\t\tlone1 = 1;\n\t\t\telse // eqto2in1 == 1\n\t\t\t\tlone1 = 0;\n\t\t}\n\t\tif (eqto1in2 == 0)\n\t\t{\n\t\t\tif (eqto2in2 == 1)\n\t\t\t\tlone2 = 2;\n\t\t\telse // eqto2in2 == 2\n\t\t\t\tlone2 = 1;\n\t\t}\n\t\telse if (eqto1in2 == 1)\n\t\t{\n\t\t\tif (eqto2in2 == 0)\n\t\t\t\tlone2 = 2;\n\t\t\telse // eqto2in2 == 2\n\t\t\t\tlone2 = 0;\n\t\t}\n\t\telse // eqto1in2 == 2\n\t\t{\n\t\t\tif (eqto2in2 == 0)\n\t\t\t\tlone2 = 1;\n\t\t\telse // eqto2in2 == 1\n\t\t\t\tlone2 = 0;\n\t\t}\n\t\tretverts[2] = verts1[lone1];\n\t\tretverts[3] = verts2[lone2];\n\t\treturn retverts;\n\t}", "public int getVertices() {\n return verticesNumber;\n }", "public void setVertices(float[] points) {\n/* 810 */ COSArray ar = new COSArray();\n/* 811 */ ar.setFloatArray(points);\n/* 812 */ getCOSObject().setItem(COSName.VERTICES, (COSBase)ar);\n/* */ }", "public int colorVertices();", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n return world.keySet();\n }", "public native Point [] getAllocationVertices(Actor ancestor);", "List<V> getVertexList();", "public Set<String> getVertices() {\n\t\treturn vertices;\n\t}", "public abstract int[] getConnected(int vertexIndex);", "public void setVertices(float x0, float y0, float z0,\n float x1, float y1, float z1,\n float x2, float y2, float z2) {\n x_array[0] = x0;\n x_array[1] = x1;\n x_array[2] = x2;\n \n y_array[0] = y0;\n y_array[1] = y1;\n y_array[2] = y2;\n \n z_array[0] = z0;\n z_array[1] = z1;\n z_array[2] = z2;\n }", "@Test\n public void getPointsTest() {\n final double[] expectedResult = new double[3];\n final double[] envelope = new double[]{-3, 2, 0, 1, 4, 0};\n\n //lower corner\n System.arraycopy(envelope, 0, expectedResult, 0, 3);\n assertTrue(Arrays.equals(expectedResult, getLowerCorner(envelope)));\n\n //upper corner\n System.arraycopy(envelope, 3, expectedResult, 0, 3);\n assertTrue(Arrays.equals(expectedResult, getUpperCorner(envelope)));\n\n //median\n expectedResult[0] = -1;\n expectedResult[1] = 3;\n expectedResult[2] = 0;\n assertTrue(Arrays.equals(expectedResult, getMedian(envelope)));\n }", "@Override\n public Set<Vertex> getVertices() {\n Set<Vertex> vertices = new HashSet<Vertex>();\n vertices.add(sourceVertex);\n vertices.add(targetVertex);\n return vertices;\n }", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "public int getNumVertices(){\n return numVertices;\n }", "public Vector[] getVerts() {\n\t\treturn this.verts;\n\t}", "public Collection<V> getOtherVertices(Collection<V> vs);", "public int getNumVertices()\n\t{\n\t\t//TODO: Implement this method in WEEK 3\n\t\treturn numVertices;\n\t}", "@Test\n public void testGetVertexIndex() throws GeoTessException {\n posLinear.set(8, new double[]{0., 0., -1.}, 6300.);\n assertEquals(11, posLinear.getVertexIndex());\n\n // set position to x, which does not coincide with a\n // model vertex.\n posLinear.set(8, x, R);\n assertEquals(-1, posLinear.getVertexIndex());\n }", "abstract public Vertex getReadIn();", "public void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "@Test\r\n public void testVertices() {\r\n System.out.println(\"vertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n Collection colection = instance.vertices();\r\n boolean result = colection.contains(v1);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n result = colection.contains(v1);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "public int[] getRawVertices() {\n long cPtr = RecastJNI.rcContour_rverts_get(swigCPtr, this);\n if (cPtr == 0) {\n return null;\n }\n return Converter.convertToInts(cPtr, getNumberOfRawVertices() * 4);\n }", "public Vector3f[] getFaceVertices(int faceNumber) {\n\n\t\tint segmentNumber = 0;\n\n\t\tint indexNumber = faceNumber;\n\n\t\t// debug.println(\"segmentNumber, indexNumber = \" + segmentNumber + \" \" +\n\t\t// indexNumber);\n\n\t\twhile (indexNumber >= getIndexCountInSegment(segmentNumber)) {\n\t\t\tindexNumber -= getIndexCountInSegment(segmentNumber);\n\t\t\tsegmentNumber++;\n\t\t}\n\n\t\t// debug.println(\"segmentNumber, indexNumber = \" + segmentNumber + \" \" +\n\t\t// indexNumber);\n\n\t\tint[] vertindexes = getModelVerticeIndicesInSegment(segmentNumber, indexNumber);\n\n\t\t// parent.println(vertindexes);\n\n\t\tVector3f[] tmp = new Vector3f[vertindexes.length];\n\n\t\tfor (int i = 0; i < tmp.length; i++) {\n\t\t\ttmp[i] = new Vector3f();\n\t\t\ttmp[i].set(getModelVertice(vertindexes[i]));\n\t\t}\n\n\t\treturn tmp;\n\t}", "public static float[] getMeshVertices(GVRMesh mesh) {\n GVRVertexBuffer vertexBuffer = mesh.getVertexBuffer();\n FloatBuffer floatBuffer = vertexBuffer.getFloatVec(\"a_position\");\n int count = floatBuffer.remaining();\n float[] vertices = new float[count];\n floatBuffer.get(vertices);\n // For 3.3 this still works\n// float[] vertices = mesh.getVertices(); // Throws UnsupportedOperationException in 4.0\n return vertices;\n }", "private static int detectarVertices(String linea)\r\n\t\t\tthrows IllegalArgumentException\r\n\t{\r\n linea = linea.substring(3); // Elimina los espacios innecesarios\r\n String[] lista = linea.split(\" \");\r\n \r\n return lista.length;\r\n\t}", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n ArrayList<Long> verticesIter = new ArrayList<>();\n verticesIter.addAll(adj.keySet());\n return verticesIter;\n }", "@Override\r\n\tpublic int getOrder() {\r\n\t\treturn vertices.size();\r\n\t}", "public ArrayList<Triangle> getOccluderVertexData();", "private void setVertices(Vertex[] vs){\n\t\t\n\t\tvertices = new ArrayList<>();\n\t\toriginalVertices = new ArrayList<>();\n\t\tdouble scalar = ViewSettings.getScalar4();\n\n\t\tfor(Vertex v : vs){\n\t\t\tvertices.add(new Vertex(v.getX() * scalar, v.getY() * scalar, v.getZ() * scalar, v.getW() * scalar));\n\t\t\toriginalVertices.add(new Vertex(v.getX(), v.getY(), v.getZ(), v.getW()));\n\t\t}\n\t}", "public interface TestData {\n NumberVertex[] VERTICES = {new NumberVertex(0), new NumberVertex(1), new NumberVertex(2), new NumberVertex(3),\n new NumberVertex(4), new NumberVertex(5), new NumberVertex(6), new NumberVertex(7), new NumberVertex(8)};\n\n DirectedEdge[] DIRECTED_EDGES ={\n new DirectedEdge(VERTICES[0], VERTICES[7]),\n new DirectedEdge(VERTICES[1], VERTICES[0]),\n new DirectedEdge(VERTICES[0], VERTICES[2]),\n new DirectedEdge(VERTICES[0], VERTICES[3]),\n new DirectedEdge(VERTICES[2], VERTICES[4]),\n new DirectedEdge(VERTICES[2], VERTICES[5]),\n new DirectedEdge(VERTICES[2], VERTICES[0]),\n new DirectedEdge(VERTICES[4], VERTICES[6]),\n new DirectedEdge(VERTICES[4], VERTICES[7]),\n new DirectedEdge(VERTICES[6], VERTICES[0]),\n new DirectedEdge(VERTICES[6], VERTICES[8]),\n new DirectedEdge(VERTICES[8], VERTICES[1])};\n\n UndirectedEdge[] UNDIRECTED_EDGES ={\n new UndirectedEdge(VERTICES[1], VERTICES[0]),\n new UndirectedEdge(VERTICES[0], VERTICES[2]),\n new UndirectedEdge(VERTICES[0], VERTICES[3]),\n new UndirectedEdge(VERTICES[2], VERTICES[4]),\n new UndirectedEdge(VERTICES[2], VERTICES[4]),\n new UndirectedEdge(VERTICES[2], VERTICES[5]),\n new UndirectedEdge(VERTICES[4], VERTICES[6]),\n new UndirectedEdge(VERTICES[4], VERTICES[6]),\n new UndirectedEdge(VERTICES[4], VERTICES[7]),\n new UndirectedEdge(VERTICES[6], VERTICES[0]),\n new UndirectedEdge(VERTICES[6], VERTICES[8]),\n new UndirectedEdge(VERTICES[8], VERTICES[1])};\n}", "public Iterable<Vertex> getVertices() {\n return mVertices.values();\n }", "@Test\r\n public void testNumVertices() {\r\n System.out.println(\"numVertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expResult = 0;\r\n int result = instance.numVertices();\r\n assertEquals(expResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expResult = 1;\r\n result = instance.numVertices();\r\n assertEquals(expResult, result);\r\n }", "@Override\n public Iterable<E> getAllVertices() {\n return dictionary.keySet();\n }", "public HashMap<Integer, Vertex> getVertices() {\n\t\treturn vertices;\n\t}", "public abstract int[] getCoords();", "public Vertex [] getSortedVertexArray() {\n\t\tVertex [] array = new Vertex[_vertices.size()];\n\t\tint index = 0;\n\t\tfor (Vertex v : _vertices) {\n\t\t\tarray[index++] = v;\n\t\t}\n\t\t// sort\n\t\tArrays.sort(array);\n\t\treturn array;\n\t}", "@Override\r\n public Iterable<V> vertices() {\r\n LinkedList<V> list = new LinkedList<>();\r\n for(V v : map.keySet())\r\n list.add(v);\r\n return list;\r\n }", "public V getVertex()\r\n/* */ {\r\n/* 198 */ return (V)this.vertex;\r\n/* */ }", "public Collection< VDataT > vertexData();", "public static Vec2[] verticesOfPath2D(Path2D.Float p, int n) {\n Vec2[] result = new Vec2[n];\n float[] values = new float[6];\n PathIterator pi = p.getPathIterator(null);\n int i = 0;\n while (!pi.isDone() && i < n) {\n int type = pi.currentSegment(values);\n if (type == PathIterator.SEG_LINETO) {\n result[i++] = new Vec2(values[0], values[1]);\n }\n pi.next();\n }\n return result;\n }", "public DynamicModelPart.DynamicVertex[] buildVertexs(float x, float y, float z, float f,\n float g, float h) {\n DynamicModelPart.DynamicVertex vertex0 =\n new DynamicModelPart.DynamicVertex(x, y, z, 0.0F, 0.0F);\n DynamicModelPart.DynamicVertex vertex1 =\n new DynamicModelPart.DynamicVertex(f, y, z, 0.0F, 8.0F);\n DynamicModelPart.DynamicVertex vertex2 =\n new DynamicModelPart.DynamicVertex(f, g, z, 8.0F, 8.0F);\n DynamicModelPart.DynamicVertex vertex3 =\n new DynamicModelPart.DynamicVertex(x, g, z, 8.0F, 0.0F);\n DynamicModelPart.DynamicVertex vertex4 =\n new DynamicModelPart.DynamicVertex(x, y, h, 0.0F, 0.0F);\n DynamicModelPart.DynamicVertex vertex5 =\n new DynamicModelPart.DynamicVertex(f, y, h, 0.0F, 8.0F);\n DynamicModelPart.DynamicVertex vertex6 =\n new DynamicModelPart.DynamicVertex(f, g, h, 8.0F, 8.0F);\n DynamicModelPart.DynamicVertex vertex7 =\n new DynamicModelPart.DynamicVertex(x, g, h, 8.0F, 0.0F);\n return new DynamicModelPart.DynamicVertex[] {vertex0, vertex1, vertex2, vertex3,\n vertex4, vertex5, vertex6, vertex7};\n }", "public Set<GeographicPoint> getVertices()\n\t{\n\t\t//TODO: Implement this method in WEEK 3\n\t\tSet<GeographicPoint> ans = new HashSet<GeographicPoint> ();\n\t\tfor (GeographicPoint curr : map.keySet()) {\n\t\t\tif (!ans.contains(curr)) {\n\t\t\t\tans.add(curr);\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public List<FactoryArrayStorage<?>> getVertices() {\n return mFactoryVertices;\n }", "@Test\r\n\tpublic void testArrayPos(){\n\t\tfor(int y=0;y<5;y++){\r\n\t\t\tfor(int x=0;x<5;x++){\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private List<Integer> vertices(int num) {\n List<Integer> list = new LinkedList<>();\n for (int i = 0; i < num; i++) {\n list.add(i);\n }\n return list;\n }", "void setVertices(int vertices);", "public int[] getArticulationVertices() {\n int[] xs = new int[set.cardinality()];\n for (int x = set.nextSetBit(0), i = 0;\n x >= 0;\n x = set.nextSetBit(x + 1), i++) {\n xs[i] = x;\n }\n return xs;\n }", "public void setVertices (float[] vertices, int offset, int count) {\r\n \t\tthis.vertices.setVertices(vertices, offset, count);\r\n \t}", "public int order()\n {\n return numVertices;\n }", "Iterator<Vertex<V, E, M>> getVertices() {\n return this.vertices.values().iterator();\n }", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "public void computeTextureUVCoordinates()\n\t{\n\t\tthis.faceTextureUCoordinates = new float[faceCount][];\n\t\tthis.faceTextureVCoordinates = new float[faceCount][];\n\n\t\tfor (int i = 0; i < faceCount; i++)\n\t\t{\n\t\t\tint textureCoordinate;\n\t\t\tif (textureCoordinates == null)\n\t\t\t{\n\t\t\t\ttextureCoordinate = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttextureCoordinate = textureCoordinates[i];\n\t\t\t}\n\n\t\t\tint textureIdx;\n\t\t\tif (faceTextures == null)\n\t\t\t{\n\t\t\t\ttextureIdx = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttextureIdx = faceTextures[i] & 0xFFFF;\n\t\t\t}\n\n\t\t\tif (textureIdx != -1)\n\t\t\t{\n\t\t\t\tfloat[] u = new float[3];\n\t\t\t\tfloat[] v = new float[3];\n\n\t\t\t\tif (textureCoordinate == -1)\n\t\t\t\t{\n\t\t\t\t\tu[0] = 0.0F;\n\t\t\t\t\tv[0] = 1.0F;\n\n\t\t\t\t\tu[1] = 1.0F;\n\t\t\t\t\tv[1] = 1.0F;\n\n\t\t\t\t\tu[2] = 0.0F;\n\t\t\t\t\tv[2] = 0.0F;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttextureCoordinate &= 0xFF;\n\n\t\t\t\t\tbyte textureRenderType = 0;\n\t\t\t\t\tif (textureRenderTypes != null)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextureRenderType = textureRenderTypes[textureCoordinate];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (textureRenderType == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint faceVertexIdx1 = faceVertexIndices1[i];\n\t\t\t\t\t\tint faceVertexIdx2 = faceVertexIndices2[i];\n\t\t\t\t\t\tint faceVertexIdx3 = faceVertexIndices3[i];\n\n\t\t\t\t\t\tshort triangleVertexIdx1 = textureTriangleVertexIndices1[textureCoordinate];\n\t\t\t\t\t\tshort triangleVertexIdx2 = textureTriangleVertexIndices2[textureCoordinate];\n\t\t\t\t\t\tshort triangleVertexIdx3 = textureTriangleVertexIndices3[textureCoordinate];\n\n\t\t\t\t\t\tfloat triangleX = (float) vertexPositionsX[triangleVertexIdx1];\n\t\t\t\t\t\tfloat triangleY = (float) vertexPositionsY[triangleVertexIdx1];\n\t\t\t\t\t\tfloat triangleZ = (float) vertexPositionsZ[triangleVertexIdx1];\n\n\t\t\t\t\t\tfloat f_882_ = (float) vertexPositionsX[triangleVertexIdx2] - triangleX;\n\t\t\t\t\t\tfloat f_883_ = (float) vertexPositionsY[triangleVertexIdx2] - triangleY;\n\t\t\t\t\t\tfloat f_884_ = (float) vertexPositionsZ[triangleVertexIdx2] - triangleZ;\n\t\t\t\t\t\tfloat f_885_ = (float) vertexPositionsX[triangleVertexIdx3] - triangleX;\n\t\t\t\t\t\tfloat f_886_ = (float) vertexPositionsY[triangleVertexIdx3] - triangleY;\n\t\t\t\t\t\tfloat f_887_ = (float) vertexPositionsZ[triangleVertexIdx3] - triangleZ;\n\t\t\t\t\t\tfloat f_888_ = (float) vertexPositionsX[faceVertexIdx1] - triangleX;\n\t\t\t\t\t\tfloat f_889_ = (float) vertexPositionsY[faceVertexIdx1] - triangleY;\n\t\t\t\t\t\tfloat f_890_ = (float) vertexPositionsZ[faceVertexIdx1] - triangleZ;\n\t\t\t\t\t\tfloat f_891_ = (float) vertexPositionsX[faceVertexIdx2] - triangleX;\n\t\t\t\t\t\tfloat f_892_ = (float) vertexPositionsY[faceVertexIdx2] - triangleY;\n\t\t\t\t\t\tfloat f_893_ = (float) vertexPositionsZ[faceVertexIdx2] - triangleZ;\n\t\t\t\t\t\tfloat f_894_ = (float) vertexPositionsX[faceVertexIdx3] - triangleX;\n\t\t\t\t\t\tfloat f_895_ = (float) vertexPositionsY[faceVertexIdx3] - triangleY;\n\t\t\t\t\t\tfloat f_896_ = (float) vertexPositionsZ[faceVertexIdx3] - triangleZ;\n\n\t\t\t\t\t\tfloat f_897_ = f_883_ * f_887_ - f_884_ * f_886_;\n\t\t\t\t\t\tfloat f_898_ = f_884_ * f_885_ - f_882_ * f_887_;\n\t\t\t\t\t\tfloat f_899_ = f_882_ * f_886_ - f_883_ * f_885_;\n\t\t\t\t\t\tfloat f_900_ = f_886_ * f_899_ - f_887_ * f_898_;\n\t\t\t\t\t\tfloat f_901_ = f_887_ * f_897_ - f_885_ * f_899_;\n\t\t\t\t\t\tfloat f_902_ = f_885_ * f_898_ - f_886_ * f_897_;\n\t\t\t\t\t\tfloat f_903_ = 1.0F / (f_900_ * f_882_ + f_901_ * f_883_ + f_902_ * f_884_);\n\n\t\t\t\t\t\tu[0] = (f_900_ * f_888_ + f_901_ * f_889_ + f_902_ * f_890_) * f_903_;\n\t\t\t\t\t\tu[1] = (f_900_ * f_891_ + f_901_ * f_892_ + f_902_ * f_893_) * f_903_;\n\t\t\t\t\t\tu[2] = (f_900_ * f_894_ + f_901_ * f_895_ + f_902_ * f_896_) * f_903_;\n\n\t\t\t\t\t\tf_900_ = f_883_ * f_899_ - f_884_ * f_898_;\n\t\t\t\t\t\tf_901_ = f_884_ * f_897_ - f_882_ * f_899_;\n\t\t\t\t\t\tf_902_ = f_882_ * f_898_ - f_883_ * f_897_;\n\t\t\t\t\t\tf_903_ = 1.0F / (f_900_ * f_885_ + f_901_ * f_886_ + f_902_ * f_887_);\n\n\t\t\t\t\t\tv[0] = (f_900_ * f_888_ + f_901_ * f_889_ + f_902_ * f_890_) * f_903_;\n\t\t\t\t\t\tv[1] = (f_900_ * f_891_ + f_901_ * f_892_ + f_902_ * f_893_) * f_903_;\n\t\t\t\t\t\tv[2] = (f_900_ * f_894_ + f_901_ * f_895_ + f_902_ * f_896_) * f_903_;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.faceTextureUCoordinates[i] = u;\n\t\t\t\tthis.faceTextureVCoordinates[i] = v;\n\t\t\t}\n\t\t}\n\t}", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "public Collection<V> getOtherVertices(V v);", "public int getNumVertices() {\n return num_vertices;\n }", "Vertex getVertex();", "boolean hasIsVertexOf();", "private void setVertices(){\n \tdouble[] xs = new double[numOfSides];\n \tdouble[] ys = new double[numOfSides];\n \tif (numOfSides%2==1){\n \t\tfor (int i=0; i<numOfSides; i++){\n \t\t\txs[i]=radius*Math.cos(2*i*Math.PI/numOfSides);\n \t\t\tys[i]=radius*Math.sin(2*i*Math.PI/numOfSides);\n \t\t\t}\n \t}\n \telse{\n \t\tdouble start=Math.PI/numOfSides;\n \t\tfor (int i=0; i<numOfSides; i++){\n \t\t\txs[i]=radius*Math.cos(start+2*i*(Math.PI)/numOfSides);\n \t\t\tys[i]=radius*Math.sin(start+2*i*(Math.PI)/numOfSides);\n \t\t\t}\n \t}\n \tsetXLocal(xs);\n \tsetYLocal(ys);\n }", "public Enumeration outAdjacentVertices(Position vp) throws InvalidPositionException;", "public Polygon getPolygon(double eyeDistance){\n //define the front two verticies of the currentTrack\n Point3D track_vertex0 = currentTrack.getVertex(0);\n Point3D track_vertex1 = currentTrack.getVertex(1);\n //use center point to define the center of the sphape\n int cubeSize = 3;\n\n Point3D front_up_left = new Point3D (centerPoint.x-cubeSize, centerPoint.y-cubeSize, centerPoint.z-cubeSize);\n Point3D front_down_left = new Point3D (centerPoint.x-cubeSize, centerPoint.y+cubeSize, centerPoint.z-cubeSize);\n Point3D front_down_right = new Point3D (centerPoint.x+cubeSize, centerPoint.y+cubeSize, centerPoint.z-cubeSize);\n Point3D front_up_right = new Point3D (centerPoint.x+cubeSize, centerPoint.y-cubeSize, centerPoint.z-cubeSize);\n\n Point3D back_up_left = new Point3D (front_up_left.x, front_up_left.y, centerPoint.z+cubeSize);\n Point3D back_down_left = new Point3D (front_down_left.x, front_down_left.y, centerPoint.z+cubeSize);\n Point3D back_down_right = new Point3D (front_down_right.x, front_down_right.y, centerPoint.z+cubeSize);\n Point3D back_up_right = new Point3D (front_up_right.x, front_up_right.y, centerPoint.z+cubeSize);\n\n //aranges verticies in the order they will be drawn\n Point3D[] cube_verticies = {front_up_left, front_down_left, front_down_right, front_up_right,\n front_up_left, back_up_left, back_up_right, front_up_right,\n front_down_right, back_down_right, back_up_right, back_down_right,\n back_down_left, back_up_left, back_down_left, front_down_left};\n\n int[] x_points = new int[16];\n int[] y_points = new int[16];\n //convert 3D points to 2D points\n for(int i=0;i<16;i++){\n if(cube_verticies[i].z <= 200){ //same fix as for the track positioning\n x_points[i] = (int) -cube_verticies[i].projectPoint3D(eyeDistance).getX();\n y_points[i] = (int) cube_verticies[i].projectPoint3D(eyeDistance).getY();\n }\n else{\n x_points[i] = (int) cube_verticies[i].projectPoint3D(eyeDistance).getX();\n y_points[i] = (int) cube_verticies[i].projectPoint3D(eyeDistance).getY();\n }\n }\n Polygon polygon = new Polygon(x_points, y_points, 16);\n return polygon;\n }" ]
[ "0.6944541", "0.6644475", "0.6419768", "0.6293754", "0.6217142", "0.6124119", "0.6018409", "0.6014569", "0.6014569", "0.6007927", "0.5987109", "0.5984027", "0.59408844", "0.5915967", "0.5912223", "0.5910506", "0.59058595", "0.59055614", "0.59052444", "0.5881083", "0.5846214", "0.58021003", "0.57953113", "0.57897496", "0.5755848", "0.57493436", "0.5748597", "0.57305807", "0.5729997", "0.5707404", "0.57028496", "0.5688702", "0.5688702", "0.5665976", "0.56466305", "0.5565714", "0.5560843", "0.5558739", "0.5555829", "0.5531266", "0.5523976", "0.5512207", "0.55064285", "0.54991907", "0.54929215", "0.5491954", "0.5483282", "0.54669845", "0.5466323", "0.546327", "0.54332286", "0.54329085", "0.5410674", "0.53953385", "0.539444", "0.53926677", "0.53770703", "0.5367851", "0.5364804", "0.534609", "0.5333365", "0.53312975", "0.5326583", "0.5319337", "0.53128433", "0.5310429", "0.5296464", "0.5274254", "0.5268897", "0.5256287", "0.5253849", "0.525057", "0.52441525", "0.5240065", "0.5232008", "0.5224809", "0.5221842", "0.5213749", "0.52102137", "0.52043575", "0.5187906", "0.5186433", "0.5185287", "0.51735026", "0.5167715", "0.5149495", "0.5132043", "0.512248", "0.5110396", "0.51101834", "0.5104094", "0.509621", "0.50920355", "0.5091368", "0.50896406", "0.5085785", "0.5085149", "0.50849265", "0.5083383", "0.5076459", "0.5061526" ]
0.0
-1
tests getNeighbors() on a graph that has a cycle
@Test public void testPublic8() { Graph<Integer> graph= TestGraphs.testGraph4(); String[] results= {"1 4", "2 4", "3 4", "0 4", ""}; Integer i; for (i= 0; i <= 4; i++) assertEquals(results[i], TestGraphs.collToString(graph.getNeighbors(i))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "@DisplayName(\"Has neighbours?\")\n @Test\n public void testGetNeighbours() {\n Assertions.assertTrue(graph.getNeighbours(0).size() > 1);\n }", "@SuppressWarnings(\"unchecked\")\r\n private static void cycleTests() throws CALExecutorException {\r\n \r\n final ImmutableDirectedGraph<Integer> noCycles = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 3), Pair.make(1, 3)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthOneCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 1)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthTwoCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 1)),\r\n executionContext);\r\n \r\n System.out.println(\"noCycle.findCycle(): \" + noCycles.findCycle());\r\n System.out.println(\"oneCycle.findCycle(): \" + lengthOneCycle.findCycle());\r\n System.out.println(\"twoCycle.findCycle(): \" + lengthTwoCycle.findCycle());\r\n }", "@Test public void testPublic13() {\n Graph<Integer> graph= TestGraphs.testGraph4();\n int i;\n\n for (i= 0; i < 4; i++)\n assertTrue(graph.isInCycle(i));\n\n assertFalse(graph.isInCycle(4));\n }", "private void getNeighbors() {\n\t\tRowIterator iterator = currentGen.iterateRows();\n\t\twhile (iterator.hasNext()) {\n\t\t\tElemIterator elem = iterator.next();\n\t\t\twhile (elem.hasNext()) {\n\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\tint row = mElem.rowIndex();\n\t\t\t\tint col = mElem.columnIndex();\n\t\t\t\tint numNeighbors = 0;\n\t\t\t\tfor (int i = -1; i < 2; i++) { // loops through row above,\n\t\t\t\t\t\t\t\t\t\t\t\t// actual row, and row below\n\t\t\t\t\tfor (int j = -1; j < 2; j++) { // loops through column left,\n\t\t\t\t\t\t\t\t\t\t\t\t\t// actual column, coloumn\n\t\t\t\t\t\t\t\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (!currentGen.elementAt(row + i, col + j).equals(\n\t\t\t\t\t\t\t\tfalse)) // element is alive, add 1 to neighbor\n\t\t\t\t\t\t\t\t\t\t// total\n\t\t\t\t\t\t\tnumNeighbors += 1;\n\t\t\t\t\t\telse { // element is not alive, add 1 to its total\n\t\t\t\t\t\t\t\t// number of neighbors\n\t\t\t\t\t\t\tInteger currentNeighbors = (Integer) neighbors\n\t\t\t\t\t\t\t\t\t.elementAt(row + i, col + j);\n\t\t\t\t\t\t\tneighbors.setValue(row + i, col + j,\n\t\t\t\t\t\t\t\t\tcurrentNeighbors + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tneighbors.setValue(row, col, numNeighbors - 1); // -1 to account\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for counting\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// itself as a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// neighbor\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n\tpublic void testAdjacency30() {\r\n\t\tBoardCell cell = board.getCell(3, 0);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 0)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 1)));\r\n\t\tassertEquals(2, testList.size());\r\n\t}", "@Test\r\n public void Test017FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(2, 19);\r\n gol.makeLiveCell(1, 18);\r\n gol.makeLiveCell(0, 19);\r\n assertEquals(3, gol.findLiveNeighbours(1, 19));\r\n }", "@Test\r\n public void Test015FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(2, 4);\r\n gol.makeLiveCell(2, 3);\r\n gol.makeLiveCell(3, 5);\r\n // gof.makeLiveCell(3, 4);\r\n assertEquals(3, gol.findLiveNeighbours(3, 4));\r\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "@Test\r\n public void Test016FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(1, 1);\r\n\r\n assertEquals(1, gol.findLiveNeighbours(0, 0));\r\n }", "@Test\r\n public void Test020FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(8, 0);\r\n gol.makeLiveCell(6, 0);\r\n\r\n assertEquals(2, gol.findLiveNeighbours(7, 0));\r\n }", "@Test\n public void graphfromBoggleBoard_mn() {\n Graph testgraph = new AdjacencyMatrixGraph();\n BoggleBoard board = new BoggleBoard(20,20);\n Permeate.boggleGraph(board, testgraph);\n /*System.out.println(testgraph.getVertices());\n for (Vertex vertex : testgraph.getVertices()) {\n System.out.println(vertex + \": \" + testgraph.getNeighbors(vertex));\n }*/\n }", "@Test\r\n\tpublic void testAdjacency11() {\r\n\t\tBoardCell cell = board.getCell(1, 1);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(0, 1)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 0)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 2)));\r\n\t\tassertTrue(testList.contains(board.getCell(2, 1)));\r\n\t\tassertEquals(4, testList.size());\r\n\t}", "@Test\r\n public void Test018FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(19, 2);\r\n gol.makeLiveCell(18, 3);\r\n\r\n assertEquals(2, gol.findLiveNeighbours(19, 3));\r\n }", "@Test\r\n public void Test019FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(19, 19);\r\n gol.makeLiveCell(18, 17);\r\n\r\n assertEquals(2, gol.findLiveNeighbours(19, 18));\r\n }", "@Test\r\n\tpublic void testAdjacency22() {\r\n\t\tBoardCell cell = board.getCell(2, 2);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 1)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 2)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertEquals(4, testList.size());\r\n\t}", "@Test\r\n\tpublic void testAdjacency00() {\r\n\t\tBoardCell cell = board.getCell(0, 0);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(1, 0)));\r\n\t\tassertTrue(testList.contains(board.getCell(0, 1)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t}", "@Test\n public void testNeighbors() {\n\n // Make a bigger nanoverse.runtime.geometry than the one from setUp\n Lattice lattice = new TriangularLattice();\n hex = new Hexagon(lattice, 3);\n Boundary boundary = new Arena(hex, lattice);\n Geometry geometry = new Geometry(lattice, hex, boundary);\n\n Coordinate query;\n\n // Check center\n query = new Coordinate2D(2, 2, 0);\n assertNeighborCount(6, query, geometry);\n\n // Check corner\n query = new Coordinate2D(0, 0, 0);\n assertNeighborCount(3, query, geometry);\n\n // Check side\n query = new Coordinate2D(1, 0, 0);\n assertNeighborCount(4, query, geometry);\n }", "public Collection<N> neighbors();", "@Test\r\n public void Test024FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(18, 0);\r\n\r\n gol.makeLiveCell(19, 1);\r\n assertEquals(2, gol.findLiveNeighbours(19, 0));\r\n }", "@Test\n public void testOneStep1() {\n board sol = new board(3);\n assertEquals(-2, sol.neighbors(1,2));\n }", "@Test\n public void testConnected() {\n System.out.println(\"**** connected *****\");\n int v = 9;\n int w = 12;\n ConnectedComponentsDepthSearch instance = new ConnectedComponentsDepthSearch(g);\n boolean expResult = true;\n boolean result = instance.connected(v, w);\n assertEquals(expResult, result);\n }", "@Test\r\n\tpublic void testAdjacencyWalkways()\r\n\t{\r\n\t\t// Test on top edge of board, two walkway pieces\r\n\t\tSet<BoardCell> testList = board.getAdjList(0, 7);\r\n\t\tassertTrue(testList.contains(board.getCellAt(0, 8)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(1, 7)));\r\n\t\tassertEquals(2, testList.size());\r\n\t\t\r\n\t\t// Test on left edge of board, one walkway piece\r\n\t\ttestList = board.getAdjList(8, 0);\r\n\t\tassertTrue(testList.contains(board.getCellAt(9, 0)));\r\n\t\tassertEquals(1, testList.size());\r\n\r\n\t\t// Test a walkway next to closet, 2 walkway pieces\r\n\t\ttestList = board.getAdjList(12, 9);\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 10)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(13, 9)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t\t// Test surrounded by 4 walkways\r\n\t\ttestList = board.getAdjList(11,4);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 5)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 3)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 4)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 4)));\r\n\t\tassertEquals(4, testList.size());\r\n\t\t\r\n\t\t// Test on bottom edge of board, next to 1 room piece\r\n\t\ttestList = board.getAdjList(24, 18);\r\n\t\tassertTrue(testList.contains(board.getCellAt(23, 18)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(24, 17)));\r\n\t\tassertEquals(2, testList.size());\r\n\t\t\r\n\t\t// Test on right edge of board, next to 1 room piece\r\n\t\ttestList = board.getAdjList(10, 24);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 24)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 23)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t\t// Test on walkway next to door that is not in the needed\r\n\t\t// direction to enter\r\n\t\ttestList = board.getAdjList(12, 21);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(13, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 20)));\r\n\t\tassertEquals(3, testList.size());\r\n\t}", "protected abstract List<Integer> getNeighbors(int vertex);", "@Test\r\n public void Test023FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(0, 18);\r\n\r\n gol.makeLiveCell(1, 19);\r\n assertEquals(2, gol.findLiveNeighbours(0, 19));\r\n }", "@Test\n void findCycle() {\n Map<String, Set<String>> nonCyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\")\n );\n assertThat(solution.findCycle(nonCyclicGraph)).isFalse();\n\n // 0\n // / | \\\n // a b c\n // /\\ | /\n // a2 a3 b2\n Map<String, Set<String>> cyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\", \"b2\")\n );\n assertThat(solution.findCycle(cyclicGraph)).isTrue();\n }", "@Test\n\t\tpublic void walkwayAdjacencyTests() {\n\t\t\t//Tests a walkway space that should have 4 surrounding walkway spaces\n\t\t\tSet<BoardCell> testList = board.getAdjList(11, 10);\n\t\t\tassertEquals(4, testList.size());\n\t\t\tassertTrue(testList.contains(board.getCellAt(11, 9)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(11, 11)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(10, 10)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(12, 10)));\n\t\t\t//Tests a walkway space that is against a room space with 3 surrounding walkway spaces\n\t\t\ttestList = board.getAdjList(11, 7);\n\t\t\tassertEquals(3, testList.size());\n\t\t\tassertTrue(testList.contains(board.getCellAt(11, 8)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(10, 7)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(12, 7)));\n\t\t\n\t\t}", "@Test\r\n public void Test022FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(18, 19);\r\n gol.makeLiveCell(18, 18);\r\n\r\n assertEquals(2, gol.findLiveNeighbours(19, 19));\r\n }", "int isCycle( Graph graph){\n int parent[] = new int[graph.V]; \n \n // Initialize all subsets as single element sets \n for (int i=0; i<graph.V; ++i) \n parent[i]=-1; \n \n // Iterate through all edges of graph, find subset of both vertices of every edge, if both subsets are same, then there is cycle in graph. \n for (int i = 0; i < graph.E; ++i){ \n int x = graph.find(parent, graph.edge[i].src); \n int y = graph.find(parent, graph.edge[i].dest); \n \n if (x == y) \n return 1; \n \n graph.Union(parent, x, y); \n } \n return 0; \n }", "List<GraphEdge> getNeighbors(NodeKey key);", "public static boolean cycleInGraph(int[][] edges) {\n int numberOfNodes = edges.length;\n int[] colors = new int[numberOfNodes]; // By default, 0 (WHITE)\n\n for (int i = 0; i < numberOfNodes; i++) {\n\n if (colors[i] != WHITE) // If already visited/finished.\n continue;\n\n boolean isCycle = traverseAndMarkColor(edges, i, colors);\n\n if (isCycle)\n return true;\n }\n return false;\n }", "ArrayList<PathFindingNode> neighbours(PathFindingNode node);", "@Test\r\n public void Test025FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(18, 0);\r\n\r\n gol.makeLiveCell(19, 1);\r\n assertEquals(2, gol.findLiveNeighbours(19, 0));\r\n }", "@Test\r\n\tpublic void testAdjacency33() {\r\n\t\tBoardCell cell = board.getCell(3, 3);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertEquals(2, testList.size());\r\n\t}", "private List<Node> getNeighbors(Node node) {\n List<Node> neighbors = new LinkedList<>();\n\n for(Node adjacent : node.getAdjacentNodesSet()) {\n if(!isSettled(adjacent)) {\n neighbors.add(adjacent);\n }\n }\n\n return neighbors;\n }", "public void findNeighbours(ArrayList<int[]> visited , Grid curMap) {\r\n\t\tArrayList<int[]> visitd = visited;\r\n\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS cur pos:\" +Arrays.toString(nodePos));\r\n\t\t//for(int j=0; j<visitd.size();j++) {\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +Arrays.toString(visited.get(j)));\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS getvstd\" +Arrays.toString(visited.get(j)));\r\n\t\t//}\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +visited);\r\n\t\tCell left=curMap.getCell(0, 0);\r\n\t\tCell right=curMap.getCell(0, 0);\r\n\t\tCell upper=curMap.getCell(0, 0);\r\n\t\tCell down=curMap.getCell(0, 0);\r\n\t\t//the getStart() method returns x,y coordinates representing the point in x,y axes\r\n\t\t//so if either of [0] or [1] coordinate is zero then we have one less neighbor\r\n\t\tif (nodePos[1]> 0) {\r\n\t\t\tupper=curMap.getCell(nodePos[0], nodePos[1]-1) ; \r\n\t\t}\r\n\t\tif (nodePos[1] < M-1) {\r\n\t\t\tdown=curMap.getCell(nodePos[0], nodePos[1]+1);\r\n\t\t}\r\n\t\tif (nodePos[0] > 0) {\r\n\t\t\tleft=curMap.getCell(nodePos[0] - 1, nodePos[1]);\r\n\t\t}\r\n\t\tif (nodePos[0] < N-1) {\r\n\t\t\tright=curMap.getCell(nodePos[0]+1, nodePos[1]);\r\n\t\t}\r\n\t\t//for(int i=0;i<visitd.size();i++) {\r\n\t\t\t//System.out.println(Arrays.toString(visitd.get(i)));\t\r\n\t\t//}\r\n\t\t\r\n\t\t//check if the neighbor is wall,if its not add to the list\r\n\t\tif(nodePos[1]>0 && !upper.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] - 1}))) {\r\n\t\t\t//Node e=new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1},curMap);\r\n\t\t\t//if(e.getVisited()!=true) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1}, curMap)); // father of the new nodes is this node\r\n\t\t\t//}\r\n\t\t}\r\n\t\tif(nodePos[1]<M-1 &&!down.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] + 1}))){\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] + 1}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]>0 && !left.isWall() && (!exists(visitd,new int[] {nodePos[0] - 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] - 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]<N-1 && !right.isWall() && (!exists(visitd,new int[] {nodePos[0] + 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] + 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\t//for(int i=0; i<NodeChildren.size();i++) {\r\n\t\t\t//System.out.println(\"Paidia sth find:\" + Arrays.toString(NodeChildren.get(i).getNodePos()));\r\n\t\t//}\r\n\t\t\t\t\t\t\r\n\t}", "@Test\n\tpublic void testAdjacencyWalkways()\n\t{\n\t\t// Test on top edge of board, just one walkway piece\n\t\tSet<BoardCell> testList = board.getAdjList(22, 9);\n\t\tassertTrue(testList.contains(board.getCellAt(21, 9)));\n\t\tassertEquals(1, testList.size());\n\n\t\t// Test left edge of board, edge of room\n\t\ttestList = board.getAdjList(16, 0);\n\t\tassertTrue(testList.contains(board.getCellAt(17, 0)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 1)));\n\t\tassertEquals(2, testList.size());\n\n\t\t// Test on left edge of board, three walkway pieces\n\t\ttestList = board.getAdjList(6, 0);\n\t\tassertTrue(testList.contains(board.getCellAt(5, 0)));\n\t\tassertTrue(testList.contains(board.getCellAt(6, 1)));\n\t\tassertTrue(testList.contains(board.getCellAt(7, 0)));\n\t\tassertEquals(3, testList.size());\n\n\t\t// Test surrounded by 4 walkways\n\t\ttestList = board.getAdjList(16,19);\n\t\tassertTrue(testList.contains(board.getCellAt(15, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(17, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 20)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 18)));\n\t\tassertEquals(4, testList.size());\n\n\t\t// Test on bottom edge of board, next to 1 room piece\n\t\ttestList = board.getAdjList(22, 15);\n\t\tassertTrue(testList.contains(board.getCellAt(21, 15)));\n\t\tassertTrue(testList.contains(board.getCellAt(22, 16)));\n\t\tassertEquals(2, testList.size());\n\n\n\t\t// Test on walkway next to door that is not in the needed\n\t\t// direction to enter\n\t\ttestList = board.getAdjList(9, 6);\n\t\tassertTrue(testList.contains(board.getCellAt(8, 6)));\n\t\tassertTrue(testList.contains(board.getCellAt(9, 7)));\n\t\tassertTrue(testList.contains(board.getCellAt(10, 6)));\n\t\tassertEquals(3, testList.size());\n\t}", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "@Test public void testPublic11() {\n Graph<Character> graph= TestGraphs.testGraph3();\n\n for (Character ch : graph.getVertices())\n assertFalse(graph.isInCycle(ch));\n }", "protected abstract int countNeighbors(int x, int y);", "@Test\r\n\tpublic void testAdjacency13() {\r\n\t\tBoardCell cell = board.getCell(1, 3);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(0, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 2)));\r\n\t\tassertEquals(3, testList.size());\r\n\t}", "private LinkedList<int[]> neighborFinder(){\n LinkedList<int[]> neighborhood= new LinkedList<>();\n int[] curr_loc = blankFinder();\n int x = curr_loc[0];\n int y = curr_loc[1];\n if(x >0){\n neighborhood.add(new int[]{x-1, y});\n }\n if(x < n-1){\n neighborhood.add(new int[]{x+1, y});\n }\n if(y > 0){\n neighborhood.add(new int[]{x, y-1});\n }\n if(y < n-1) {\n neighborhood.add(new int[]{x, y+1});\n }\n\n\n return neighborhood;\n }", "@Test\n public void connectionNotFound() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 0);\n\n Path path = calcPath(0, 3, 0, 1);\n assertNotFound(path);\n }", "@Test\r\n public void Test021FindLiveNeighbours()\r\n {\r\n\r\n gol.makeLiveCell(1, 18);\r\n\r\n assertEquals(1, gol.findLiveNeighbours(0, 18));\r\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "public void testGetEdge() {\n System.out.println(\"getEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertNull(graph.getEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertNotNull(graph.getEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n }", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "private static Iterable<Cell> getNeighbors(Grid<Cell> grid, Cell cell) {\n\t\tMooreQuery<Cell> query = new MooreQuery<Cell>(grid, cell);\n\t\tIterable<Cell> neighbors = query.query();\n\t\treturn neighbors;\n\t}", "Cycle getOptimalCycle(Graph<L, T> graph);", "ArrayList<Edge> getAdjacencies();", "public int infectNeighbours(Map map);", "public abstract List<AStarNode> getNeighbours();", "@Test\r\n\tpublic void testAdjacencyDoorways()\r\n\t{\r\n\t\t// Test beside a door direction DOWN\r\n\t\tSet<BoardCell> testList = board.getAdjList(9, 2);\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 2)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(8, 2)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(9, 3)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(9, 1)));\r\n\t\tassertEquals(4, testList.size());\r\n\t\t// Test beside a door direction RIGHT\r\n\t\ttestList = board.getAdjList(19, 7);\r\n\t\tassertTrue(testList.contains(board.getCellAt(19, 8)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(19, 6)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(20, 7)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(18, 7)));\r\n\t\tassertEquals(4, testList.size());\r\n\t\t// Test beside a door direction LEFT\r\n\t\ttestList = board.getAdjList(8, 21);\r\n\t\tassertTrue(testList.contains(board.getCellAt(9, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(7, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(8, 22)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(8, 20)));\r\n\t\tassertEquals(4, testList.size());\r\n\t\t// Test beside a door direction UP\r\n\t\ttestList = board.getAdjList(16, 10);\r\n\t\tassertTrue(testList.contains(board.getCellAt(17, 10)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(15, 10)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(16, 9)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(16, 11)));\r\n\t\tassertEquals(4, testList.size());\r\n\t}", "public abstract DBResult getAdjacentContinuousLinks(int nodeId) throws SQLException;", "public abstract LinkedList<Integer> getNeighbours(int index);", "Set<E> getForwardNeighbors();", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_CycleDetectedInUpstreamNodes() {\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n ValueStreamMap graph = new ValueStreamMap(b, null);\n graph.addUpstreamNode(new PipelineDependencyNode(a, a), null, b);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\"), null, a, new MaterialRevision(null));\n graph.addDownstreamNode(new PipelineDependencyNode(a, a), b);\n graph.addDownstreamNode(new PipelineDependencyNode(c, c), a);\n\n assertThat(graph.hasCycle(), is(true));\n }", "private static boolean isCycle(Graph graph) {\n for (int i = 0; i < graph.edges.length; ++i) {\n int x = graph.find(graph.edges[i][0]);\n int y = graph.find(graph.edges[i][1]);\n\n // if both subsets are same, then there is cycle in graph.\n if (x == y) {\n // for edge 2-0 : parent of 0 is 2 == 2 and so we detected a cycle\n return true;\n }\n // keep doing union/merge of sets\n graph.union(x, y);\n }\n return false;\n }", "public List neighbors(int vertex) {\n// your code here\n LinkedList<Integer> result = new LinkedList<>();\n LinkedList<Edge> list = adjLists[vertex];\n for (Edge a : list) {\n result.add(a.to());\n }\n//List<Integer> list = new List<Integer>();\n return result;\n }", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "private Boolean checkCycle() {\n Node slow = this;\n Node fast = this;\n while (fast.nextNode != null && fast.nextNode.nextNode != null) {\n fast = fast.nextNode.nextNode;\n slow = slow.nextNode;\n if (fast == slow) {\n System.out.println(\"contains cycle\");\n return true;\n }\n }\n System.out.println(\"non-cycle\");\n return false;\n }", "@Test\n\tpublic void testAdjacencyDoorways()\n\t{\n\t\t// Test beside a door direction RIGHT\n\t\tSet<BoardCell> testList = board.getAdjList(18, 18);\n\t\tassertTrue(testList.contains(board.getCellAt(18, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(19, 18)));\n\t\tassertTrue(testList.contains(board.getCellAt(18, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(17, 18)));\n\t\tassertEquals(4, testList.size());\n\t\t// Test beside a door direction DOWN\n\t\ttestList = board.getAdjList(5, 17);\n\t\tassertTrue(testList.contains(board.getCellAt(6, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(4, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(5, 16)));\n\t\tassertTrue(testList.contains(board.getCellAt(5, 18)));\n\t\tassertEquals(4, testList.size());\n\t\t// Test beside a door direction LEFT\n\t\ttestList = board.getAdjList(11, 18);\n\t\tassertTrue(testList.contains(board.getCellAt(11, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(11, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(10, 18)));\n\t\tassertTrue(testList.contains(board.getCellAt(12, 18)));\n\t\tassertEquals(4, testList.size());\n\t\t// Test beside a door direction UP\n\t\ttestList = board.getAdjList(8, 4);\n\t\tassertTrue(testList.contains(board.getCellAt(8, 5)));\n\t\tassertTrue(testList.contains(board.getCellAt(8, 3)));\n\t\tassertTrue(testList.contains(board.getCellAt(7, 4)));\n\t\tassertTrue(testList.contains(board.getCellAt(9, 4)));\n\t\tassertEquals(4, testList.size());\n\t}", "List<Integer> getNeighbors(int x);", "@Test\r\n public void Test027generateNextPatternBlinker()\r\n {\r\n gol.makeLiveCell(4, 3);\r\n gol.makeLiveCell(4, 4);\r\n gol.makeLiveCell(4, 5);\r\n gol.generateNextPattern();\r\n\r\n assertEquals(3, gol.getTotalAliveCells());\r\n }", "@Test\n\tpublic void testDAG() {\n\t\tDirectedGraph<Integer, DirectedEdge<Integer>> directedGraph = new DirectedGraph<Integer, DirectedEdge<Integer>>();\n\t\tdirectedGraph.addNode(1);\n\t\tdirectedGraph.addNode(2);\n\t\tdirectedGraph.addNode(3);\n\t\tdirectedGraph.addNode(4);\n\t\tdirectedGraph.addNode(5);\n\t\tdirectedGraph.addDirectedEdge(new DirectedEdge<Integer>(1, 2));\n\t\tdirectedGraph.addDirectedEdge(new DirectedEdge<Integer>(1, 3));\n\t\tdirectedGraph.addDirectedEdge(new DirectedEdge<Integer>(2, 3));\n\t\tdirectedGraph.addDirectedEdge(new DirectedEdge<Integer>(4, 5));\n\t\t\n\t\t// tested method calls\n\t\tSet<Integer> reachableNodesFrom1 = service.getReachableNodes(directedGraph, 1);\n\t\tSet<Integer> reachableNodesFrom2 = service.getReachableNodes(directedGraph, 2);\n\t\tSet<Integer> reachableNodesFrom3 = service.getReachableNodes(directedGraph, 3);\n\t\tSet<Integer> reachableNodesFrom4 = service.getReachableNodes(directedGraph, 4);\n\t\tSet<Integer> reachableNodesFrom5 = service.getReachableNodes(directedGraph, 5);\n\t\t\n\t\t// assertions\n\t\tassertEquals(ImmutableSet.of(2, 3), reachableNodesFrom1);\n\t\tassertEquals(ImmutableSet.of(3), reachableNodesFrom2);\n\t\tassertEquals(ImmutableSet.of(), reachableNodesFrom3);\n\t\tassertEquals(ImmutableSet.of(5), reachableNodesFrom4);\n\t\tassertEquals(ImmutableSet.of(), reachableNodesFrom5);\n\t}", "@Test\n\tpublic void test1() {\n\t\tConvertGraphToBinaryTree tester=new ConvertGraphToBinaryTree();\n\t\tGraphNode n1=tester.new GraphNode(1);GraphNode n2=tester.new GraphNode(2);\n\t\tGraphNode n3=tester.new GraphNode(3);GraphNode n4=tester.new GraphNode(4);\n\t\tGraphNode n5=tester.new GraphNode(5);GraphNode n6=tester.new GraphNode(6);\n\t\tGraphNode n7=tester.new GraphNode(7);GraphNode n8=tester.new GraphNode(8);\n\t\tGraphNode n9=tester.new GraphNode(9);\n\t\tn1.neighbor.add(n2);n1.neighbor.add(n5);n1.neighbor.add(n6);n1.neighbor.add(n9);\n\t\tn2.neighbor.add(n1);n2.neighbor.add(n3);n2.neighbor.add(n7);\n\t\tn3.neighbor.add(n2);n3.neighbor.add(n4);n3.neighbor.add(n8);\n\t\tn4.neighbor.add(n3);n5.neighbor.add(n1);n6.neighbor.add(n1);\n\t\tn7.neighbor.add(n2);n8.neighbor.add(n3);n9.neighbor.add(n1);\n\t\tassertTrue(!tester.isBinaryTree(n1));\n\t\tGraphNode root=tester.convertToBinaryTree(n1);\n\t\tGraphNode last=null;\n\t\tGraphNode curr=root;\n\t\twhile(curr!=null){\n\t\t\tSystem.out.print(curr.val+\"->\");\n\t\t\tif(curr.neighbor.size()<=1&&root!=curr){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor(int i=0;i<curr.neighbor.size();i++){\n\t\t\t\tGraphNode next=curr.neighbor.get(i);\n\t\t\t\tif(next!=last){\n\t\t\t\t\tlast=curr;\n\t\t\t\t\tcurr=next;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\n\t}", "public Collection<GridNode> getNeighbors(\n final GridMover mover,\n final GridNode node) {\n ArrayList<GridNode> neighbors = new ArrayList<GridNode>();\n addPassableNode(mover, neighbors, node.x() + 1, node.y());\n\n addPassableNode(mover, neighbors, node.x(), node.y() + 1);\n addPassableNode(mover, neighbors, node.x(), node.y() - 1);\n\n addPassableNode(mover, neighbors, node.x() - 1, node.y());\n\n return neighbors;\n }", "public void DFS2() {\n boolean[] visited = new boolean[numVertices];\n int[] predecessors = new int[numVertices];\n for (int i = 0; i < numVertices; i++) {\n if (visited[i] == false && hasCycle(0, visited, predecessors)) {\n System.out.println(\"Cycle has found\");\n return;\n }\n }\n System.out.println(\"No cycle found in the graph\");\n }", "public List<Integer> eventualSafeNodes(int[][] graph) {\n boolean[] visited = new boolean[graph.length];\n boolean[] onStack = new boolean[graph.length];\n boolean[] onCycle = new boolean[graph.length];\n\n for (int i = 0; i < graph.length; i++) {\n if (!visited[i]) {\n if (hasCycle(i, graph, visited, onStack, onCycle)) {\n onCycle[i] = true;\n }\n }\n // System.out.println(i+ \"-->\"+Arrays.toString(onCycle));\n }\n\n List<Integer> res = new ArrayList<>(visited.length);\n for (int i = 0; i < onCycle.length; i++) {\n if (!onCycle[i]) {\n res.add(i);\n }\n }\n return res;\n }", "@Test\n public void testHasCycle() {\n System.out.println(\"**** hasCycle ****\");\n CycleDepthSearch instance = new CycleDepthSearch(g);\n boolean expResult = true;\n boolean result = instance.hasCycle();\n System.out.println(result);\n assertEquals(expResult, result);\n }", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_DownstreamOfCurrentWasUpstreamOfCurrentAtSomePoint() {\n String grandParent = \"grandParent\";\n String parent = \"parent\";\n String child = \"child\";\n String currentPipeline = \"current\";\n ValueStreamMap graph = new ValueStreamMap(currentPipeline, null);\n graph.addDownstreamNode(new PipelineDependencyNode(child, child), currentPipeline);\n graph.addDownstreamNode(new PipelineDependencyNode(grandParent, grandParent), child);\n graph.addUpstreamNode(new PipelineDependencyNode(parent, parent), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(grandParent, grandParent), null, parent);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, grandParent, new MaterialRevision(null));\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, parent, new MaterialRevision(null));\n\n assertThat(graph.hasCycle(), is(true));\n }", "@Test\n public void TestIfNoCycle() {\n final int NUMBER_OF_ELEMENTS = 100;\n TripleList<Integer> tripleList = new TripleList<>();\n for (int i = 0; i < NUMBER_OF_ELEMENTS; ++i) {\n tripleList.add(i);\n }\n /**\n * Created 2 TripleLists, first jumps every single element, another\n * every two elements, in out case every two elements means every\n * NextElement*\n */\n TripleList<Integer> tripleListEverySingleNode = tripleList;\n TripleList<Integer> tripleListEveryTwoNodes = tripleList.getNext();\n for (int i = 0; i < NUMBER_OF_ELEMENTS * NUMBER_OF_ELEMENTS; ++i) {\n Assert.assertNotSame(tripleListEverySingleNode, tripleListEveryTwoNodes);\n //JumpToNextElement(ref tripleListEverySingleNode);\n if (null == tripleListEveryTwoNodes.getNext()) {\n // if list has end means there are no cycles\n break;\n } else {\n tripleListEveryTwoNodes = tripleListEveryTwoNodes.getNext();\n }\n }\n }", "@Override\n public List<V> getNeighbors(V v, TimeFrame pTimeFrame) {\n List<V> lstNeighbors = new ArrayList<>();\n// System.out.println(\"DynamicGraph.getNeighbor() : \" + darrGlobalAdjList.get(v.getId()).get(pTimeFrame));\n if (darrGlobalAdjList.get(v.getId()).containsKey(pTimeFrame)) {\n for (E e : darrGlobalAdjList.get(v.getId()).get(pTimeFrame)){\n if (e.getOtherEndPoint(v) != null) {\n lstNeighbors.add(e.getOtherEndPoint(v));\n }\n }\n }\n return lstNeighbors;\n }", "public CycleDetector(Graph<V, E> graph)\n {\n this.graph = GraphTests.requireDirected(graph);\n }", "public interface CycleInGraph<V> {\n boolean hasCycle(Graph<V> graph) ;\n}", "@DisplayName(\"Add directed edge\")\n @Test\n public void testAddEdgeDirected() {\n graph.addEdge(new Edge(3, 4));\n List<Integer> l = new ArrayList<>();\n l.add(2);\n l.add(4);\n Assertions.assertArrayEquals(l.toArray(), graph.getNeighbours(3).toArray());\n }", "@Override\n public Iterable<WorldState> neighbors() {\n Queue<WorldState> neighbor = new ArrayDeque<>();\n int xDim = 0, yDim = 0;\n int[][] tiles = new int[_N][_N];\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n tiles[i][j] = _tiles[i][j];\n if (_tiles[i][j] == 0) {\n xDim = i;\n yDim = j;\n }\n }\n }\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (Math.abs(i - xDim) + Math.abs(j - yDim) == 1) {\n tiles[i][j] = _tiles[xDim][yDim];\n tiles[xDim][yDim] = _tiles[i][j];\n neighbor.add(new Board(tiles));\n // System.out.println(new Board(tiles));\n tiles[xDim][yDim] = _tiles[xDim][yDim];\n tiles[i][j] = _tiles[i][j];\n }\n }\n }\n return neighbor;\n }", "boolean cycle() {\n int j;\t\t\t\t\t\t// If cycle detected report as negative edge weight cycle.\n for (j = 0; j < e; ++j)\n if (d[edges.get(j).u] + edges.get(j).w < d[edges.get(j).v])\n return false;\n return true;\n }", "public Set<V> getNeighbours(V vertex);", "public List<Integer> eventualSafeNodes(int[][] graph) {\n int N = graph.length;\n int[] color = new int[N];\n List<Integer> ans = new ArrayList<>();\n\n for (int i = 0; i < N; i++) {\n if (hasNoCycle(i, color, graph))\n ans.add(i);\n }\n\n return ans;\n }", "private Set<Edge> reachableDAG(Vertex start, Vertex obstacle) {\n \tHashSet<Edge> result = new HashSet<Edge>();\n \tVector<Vertex> currentVertexes = new Vector<Vertex>();\n \tint lastResultNumber = 0;\n \tcurrentVertexes.add(start);\n \t\n \tdo {\n \t\t//System.out.println(\"size of currentVertexes:\" + currentVertexes.size());\n \t\t\n \t\tVector<Vertex> newVertexes = new Vector<Vertex>();\n \t\tlastResultNumber = result.size();\n \t\t\n \t\tfor (Vertex v : currentVertexes) {\n \t\t\t//System.out.println(\"layerID:\" + v.layerID + \"\\tlabel:\" + v.label);\n \t\t\taddIncomingEdges(v, obstacle, result, newVertexes);\n \t\t\taddOutgoingEdges(v, obstacle, result, newVertexes);\n \t\t}\n \t\t\n \t\t//System.out.println(\"size of newVertexes:\" + newVertexes.size());\n \t\t\n \t\tcurrentVertexes = newVertexes;\t\n \t\t//System.out.println(\"lastResultNumber:\" + lastResultNumber);\n \t\t//System.out.println(\"result.size():\" + result.size());\n \t} while (lastResultNumber != result.size());\n \t\n\t\treturn result;\n }", "@Test\n\t\t\t\tpublic void test4() {\n\t\t\t\t\tConvertGraphToBinaryTree tester=new ConvertGraphToBinaryTree();\n\t\t\t\t\tGraphNode n1=tester.new GraphNode(1);GraphNode n2=tester.new GraphNode(2);\n\t\t\t\t\tGraphNode n3=tester.new GraphNode(3);GraphNode n4=tester.new GraphNode(4);\n\t\t\t\t\tGraphNode n5=tester.new GraphNode(5);GraphNode n6=tester.new GraphNode(6);\n\t\t\t\t\tGraphNode n7=tester.new GraphNode(7);GraphNode n8=tester.new GraphNode(8);\n\t\t\t\t\tGraphNode n9=tester.new GraphNode(9);\n\t\t\t\t\tn1.neighbor.add(n2);n1.neighbor.add(n6);\n\t\t\t\t\tn2.neighbor.add(n1);n2.neighbor.add(n3);n2.neighbor.add(n7);\n\t\t\t\t\tn3.neighbor.add(n2);n3.neighbor.add(n4);n3.neighbor.add(n8);\n\t\t\t\t\tn4.neighbor.add(n3);n6.neighbor.add(n1);\n\t\t\t\t\tn7.neighbor.add(n2);n8.neighbor.add(n3);\n\t\t\t\t\tassertTrue(tester.isBinaryTree(n1));\n\t\t\t\t\tGraphNode root=tester.convertToBinaryTree(n1);\n\t\t\t\t\tGraphNode last=null;\n\t\t\t\t\tGraphNode curr=root;\n\t\t\t\t\twhile(curr!=null){\n\t\t\t\t\t\tSystem.out.print(curr.val+\"->\");\n\t\t\t\t\t\tif(curr.neighbor.size()<=1&&root!=curr){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(int i=0;i<curr.neighbor.size();i++){\n\t\t\t\t\t\t\tGraphNode next=curr.neighbor.get(i);\n\t\t\t\t\t\t\tif(next!=last){\n\t\t\t\t\t\t\t\tlast=curr;\n\t\t\t\t\t\t\t\tcurr=next;\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\t\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}", "protected static int countNeighbours(int i, int j, byte[][] currentGen){\n int count = 0;\n \n for(int x = i-1; x<i+2; x++){\n count+=checkBorders(x, j-1, currentGen);\n count+=checkBorders(x, j+1, currentGen);\n }\n count+=checkBorders(i-1, j, currentGen);\n count+=checkBorders(i+1, j, currentGen);\n\n return count;\n }", "public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2);", "@Test\n\t\tpublic void test2() {\n\t\t\tConvertGraphToBinaryTree tester=new ConvertGraphToBinaryTree();\n\t\t\tGraphNode n1=tester.new GraphNode(1);GraphNode n2=tester.new GraphNode(2);\n\t\t\tGraphNode n3=tester.new GraphNode(3);GraphNode n4=tester.new GraphNode(4);\n\t\t\tGraphNode n5=tester.new GraphNode(5);GraphNode n6=tester.new GraphNode(6);\n\t\t\tGraphNode n7=tester.new GraphNode(7);GraphNode n8=tester.new GraphNode(8);\n\t\t\tGraphNode n9=tester.new GraphNode(9);\n\t\t\tn1.neighbor.add(n2);n1.neighbor.add(n5);n1.neighbor.add(n6);n1.neighbor.add(n9);\n\t\t\tn2.neighbor.add(n1);n2.neighbor.add(n3);n2.neighbor.add(n7);\n\t\t\tn3.neighbor.add(n2);n3.neighbor.add(n4);n3.neighbor.add(n8);\n\t\t\tn4.neighbor.add(n3);n5.neighbor.add(n1);n6.neighbor.add(n1);\n\t\t\tn7.neighbor.add(n2);n8.neighbor.add(n3);n9.neighbor.add(n1);\n\t\t\tn7.neighbor.add(n6);n6.neighbor.add(n7);n7.neighbor.add(n8);\n\t\t\tn8.neighbor.add(n7);\n\t\t\tassertTrue(!tester.isBinaryTree(n1));\n\t\t\tGraphNode root=tester.convertToBinaryTree(n1);\n\t\t\tGraphNode last=null;\n\t\t\tGraphNode curr=root;\n\t\t\twhile(curr!=null){\n\t\t\t\tSystem.out.print(curr.val+\"->\");\n\t\t\t\tif(curr.neighbor.size()<=1&&root!=curr){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor(int i=0;i<curr.neighbor.size();i++){\n\t\t\t\t\tGraphNode next=curr.neighbor.get(i);\n\t\t\t\t\tif(next!=last){\n\t\t\t\t\t\tlast=curr;\n\t\t\t\t\t\tcurr=next;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}", "boolean detectCycleUndirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, -1))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "@Test public void testPublic4() {\n Graph<Character> graph= TestGraphs.testGraph1();\n\n assertEquals(\"B\", TestGraphs.collToString(graph.getNeighbors('A')));\n }", "public abstract int neighboursInBlock(Set<Integer> block, int vertexIndex);", "public abstract int getNumberOfLivingNeighbours(int x, int y);", "private int liveNeighbours(int i,int j) {\n\t\tint count = 0;\n\t\tif (button[i - 1][j - 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i - 1][j].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i - 1][j + 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i][j - 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i][j + 1].getBackground() == Color.yellow){\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i + 1][ j - 1].getBackground() == Color.yellow){\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i + 1][j].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i + 1][j + 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "@Test\n void test014_testGetConnectedComponents() {\n try {\n christmasBuddENetwork.addFriendship(\"Harry\", \"Prancer\");\n\n christmasBuddENetwork.addFriendship(\"Santa\", \"Rudolph\");\n christmasBuddENetwork.addFriendship(\"Comet\", \"Santa\");\n christmasBuddENetwork.addFriendship(\"Rudolph\", \"Comet\");\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Comet\");\n\n // There should be 2 connected components.\n Set<Graph> christmasComponents =\n christmasBuddENetwork.getConnectedComponents();\n int numComponents = christmasComponents.size();\n //\n if (numComponents != 2) {\n fail(\"\");\n }\n Iterator<Graph> christmasGraphIterator = christmasComponents.iterator();\n\n boolean firstCompFound = false;\n boolean secondCompFound = false;\n int componentsFound = 0;\n while (christmasGraphIterator.hasNext()) {\n Graph christmasGraph = christmasGraphIterator.next();\n componentsFound = componentsFound + 1;\n //\n if (christmasGraph.size() == 1) {\n if (firstCompFound == true) {\n fail(\"test014_testGetConnectedComponents(): FAILED! Duplicate \"\n + \"component (size 1) found! :(\");\n }\n Set<User> oneConnectedComponentVertices =\n christmasGraph.getAllVertices();\n ArrayList<String> componentUsersList = new ArrayList<String>();\n for (User userName : oneConnectedComponentVertices) {\n componentUsersList.add(userName.getName());\n System.out.println(userName.getName());\n }\n if ((!componentUsersList.contains(\"Harry\"))\n || (!componentUsersList.contains(\"Prancer\"))) {\n fail(\"test014_testGetConnectedComponents(): Failed! :( Did NOT \"\n + \"have Harry and Prancer\");\n } else {\n firstCompFound = true;\n\n }\n }\n\n if (christmasGraph.size() == 4) {\n if (secondCompFound == true) {\n fail(\"test014_testGetConnectedComponents: FAILED! Duplicate \"\n + \"component (size 4) found! :(\");\n }\n Set<User> secondConnectedComponentVertices =\n christmasGraph.getAllVertices();\n ArrayList<String> componentUsersList2 = new ArrayList<String>();\n for (User userName : secondConnectedComponentVertices) {\n componentUsersList2.add(userName.getName());\n }\n if ((!componentUsersList2.contains(\"santa\"))\n || (!componentUsersList2.contains(\"rudolph\"))\n || (!componentUsersList2.contains(\"comet\"))\n || (!componentUsersList2.contains(\"grinch\"))) {\n fail(\"test014_testGetConnectedComponents(): FAILED! Did NOT have \"\n + \"Santa, Rudolph, Comet, and Grinch!\");\n } else {\n secondCompFound = true;\n }\n }\n }\n\n if (componentsFound != 2) {\n fail(\"test014_testGetConnectedComponents(): Did NOT return 2 for the \"\n + \"connected components but instead returned: \" + componentsFound);\n }\n } catch (Exception e) {\n fail(\"test014_testGetConnectedComponents(): Failed! :(. Threw unexpected \"\n + \"exception\");\n }\n\n }", "public Iterable<Board> neighbors() {\n int[] pos = zeroPosition();\n int x = pos[0];\n int y = pos[1];\n\n Stack<Board> q = new Stack<>();\n if (x > 0) {\n q.push(twinBySwitching(x, y, x-1, y));\n }\n\n if (x < dimension() - 1) {\n q.push(twinBySwitching(x, y, x+1, y));\n }\n\n if (y > 0) {\n q.push(twinBySwitching(x, y, x, y-1));\n }\n\n if (y < dimension() - 1) {\n q.push(twinBySwitching(x, y, x, y+1));\n }\n\n return q;\n }", "public abstract boolean hasEdge(int from, int to);", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }" ]
[ "0.7018658", "0.6783294", "0.66468334", "0.6437041", "0.64156216", "0.6295091", "0.6279916", "0.6260044", "0.6239279", "0.62126285", "0.62100255", "0.6194329", "0.6171767", "0.6148071", "0.61461765", "0.613011", "0.61145", "0.6111748", "0.61043483", "0.6101022", "0.6082275", "0.60728157", "0.6063705", "0.6062275", "0.60610056", "0.6052378", "0.60316175", "0.6010416", "0.6003323", "0.59819007", "0.59815073", "0.59726715", "0.59549505", "0.59518427", "0.5949687", "0.5943189", "0.59411514", "0.59401643", "0.59263206", "0.5923077", "0.5910758", "0.5899153", "0.58937836", "0.58931303", "0.5872814", "0.58272713", "0.5826792", "0.58024734", "0.5798023", "0.5796035", "0.57921576", "0.57883424", "0.57751673", "0.57748324", "0.5773828", "0.57568645", "0.5746919", "0.5729719", "0.5725741", "0.5716702", "0.5689595", "0.56833607", "0.56817675", "0.5672918", "0.56689227", "0.5650892", "0.56449854", "0.5639241", "0.5637626", "0.56329554", "0.5625525", "0.5617734", "0.5612381", "0.5611402", "0.56089234", "0.56071925", "0.55930644", "0.55687994", "0.55633414", "0.55602616", "0.55550903", "0.55543673", "0.5551718", "0.55452347", "0.55333984", "0.5532825", "0.5529709", "0.5526299", "0.552465", "0.5515189", "0.55081064", "0.55075943", "0.55069065", "0.5504785", "0.5501327", "0.54965657", "0.54944366", "0.54923135", "0.5490975", "0.54903126" ]
0.6075077
21
tests the effect of removeVertex() in removing some vertices from a graph
@Test public void testPublic9() { Graph<Character> graph= TestGraphs.testGraph3(); char[] toRemove= {'I', 'H', 'B', 'J', 'C', 'G', 'E', 'F'}; int i; for (i= 0; i < toRemove.length; i++) { graph.removeVertex(toRemove[i]); assertFalse(graph.hasVertex(toRemove[i])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n void test02_removeVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two\n graph.removeVertex(\"a\"); // remove\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.remove(\"a\"); // creates a mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't remove the vertices correctly\");\n }\n }", "@Test \n\tpublic void removeVertexTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tgraph.addVertex(D);\n\t\tassertFalse(graph.removeVertex(C));\n\t\tgraph.addVertex(C);\n\t\tgraph.addEdge(edge_0);\n\t\tassertTrue(graph.removeVertex(D));\n\t\tassertFalse(graph.vertices().contains(D));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.addVertex(D));\n\t}", "public void testRemoveVertex() {\n System.out.println(\"removeVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n for (int i = 24; i >= 0; i--) {\n Assert.assertTrue(graph.removeVertex(new Integer(i)));\n Assert.assertFalse(graph.containsVertex(new Integer(i)));\n Assert.assertEquals(graph.verticesSet().size(), i);\n }\n }", "public void testRemoveAllVertices() {\n System.out.println(\"removeAllVertices\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllVertices());\n Assert.assertEquals(graph.verticesSet().size(), 0);\n }", "@Test\r\n public void testRemoveVertex() {\r\n System.out.println(\"removeVertex\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expectedResult = 1;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n\r\n expectedResult = 0;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "public void removeVertex();", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "@Test\n public void testRemoveVertices() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(1L, 1L));\n verticesToBeRemoved.add(new Vertex<>(2L, 2L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult = \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n void test07_tryToRemoveNonExistentEdge() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n try {\n graph.removeEdge(\"e\", \"f\"); // remove non existent edge\n } catch (Exception e) {\n fail(\"Shouldn't have thrown exception\");\n }\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.add(\"c\"); // creates mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) { // checks if vertices weren't added or removed\n fail(\"wrong vertices are inserted into the graph\");\n }\n if (graph.size() != 2) {\n fail(\"wrong number of edges in the graph\");\n }\n\n }", "@Test\n public void testGraphElements(){\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v5 = new Vertex(5, \"E\");\n Vertex v6 = new Vertex(6, \"F\");\n Vertex v7 = new Vertex(7, \"G\");\n Vertex v8 = new Vertex(8, \"H\");\n\n Vertex fakeVertex = new Vertex(100, \"fake vertex\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v3, v4, 1);\n Edge<Vertex> e4 = new Edge<>(v2, v4, 1);\n Edge<Vertex> e5 = new Edge<>(v2, v6, 1);\n Edge<Vertex> e6 = new Edge<>(v2, v5, 10);\n Edge<Vertex> e7 = new Edge<>(v5, v6, 10);\n Edge<Vertex> e8 = new Edge<>(v4, v6, 10);\n Edge<Vertex> e9 = new Edge<>(v6, v7, 10);\n Edge<Vertex> e10 = new Edge<>(v7, v8, 10);\n\n Edge<Vertex> fakeEdge = new Edge<>(fakeVertex, v1);\n Edge<Vertex> edgeToRemove = new Edge<>(v2, v7, 200);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addVertex(v5);\n g.addVertex(v6);\n g.addVertex(v7);\n g.addVertex(v8);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n g.addEdge(e6);\n g.addEdge(e7);\n g.addEdge(e8);\n g.addEdge(e9);\n g.addEdge(edgeToRemove);\n\n Assert.assertTrue(g.addEdge(e10));\n\n //adding null edge or vertex to graph returns false\n Assert.assertFalse(g.addEdge(null));\n Assert.assertFalse(g.addVertex(null));\n\n //adding edge with a vertex that does not exist in graph g returns false\n Assert.assertFalse(g.addEdge(fakeEdge));\n\n //get an edge that does not exit in graph returns false\n Assert.assertFalse(g.edge(v1, fakeVertex));\n\n //getting length of edge from vertex not in graph g returns false\n Assert.assertEquals(0, g.edgeLength(fakeVertex, v2));\n\n //Remove an edge in graph g returns true\n Assert.assertTrue(g.remove(edgeToRemove));\n\n //Removing edge not in graph g returns false\n Assert.assertFalse(g.remove(fakeEdge));\n\n //Removing vertex not in graph g returns false\n Assert.assertFalse(g.remove(fakeVertex));\n\n //Finding an edge with an endpoint not in graph g returns null\n assertNull(g.getEdge(v1, fakeVertex));\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\n public void testRemoveVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.removeVertex(new Vertex<>(5L, 5L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult = \"1,2,12\\n\" + \"1,3,13\\n\" + \"2,3,23\\n\" + \"3,4,34\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}", "public void testRemoveEdge_betweenVertices() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(graph.removeEdge(new Integer(i), new Integer(j)));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "void removeIsVertexOf(Subdomain_group oldIsVertexOf);", "@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "void remove(Vertex vertex);", "@Test\n public void testVertices() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v4id = new Vertex (4, \"E\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n assertFalse(g.addVertex(v4id));\n\n Set<Vertex> expectedVertices = new HashSet<>();\n expectedVertices.add(v1);\n expectedVertices.add(v2);\n expectedVertices.add(v3);\n expectedVertices.add(v4);\n\n assertEquals(expectedVertices, g.allVertices());\n\n Assert.assertTrue(g.remove(v1));\n\n }", "@Test\r\n public void testRemoveEdge() {\r\n System.out.println(\"removeEdge\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n expectedResult = 1;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n\r\n expectedResult = 0;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "@Test\n public void testRemoveBothInvalidVerticesVertexResult() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(6L, 6L));\n verticesToBeRemoved.add(new Vertex<>(7L, 7L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "public void testRemoveAllEdges() {\n System.out.println(\"removeAllEdges\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllEdges());\n Assert.assertEquals(graph.edgesSet().size(), 0);\n }", "void removeVertex(Vertex v) throws GraphException;", "@Test\n public void testRemoveInvalidVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.removeVertex(new Vertex<>(6L, 6L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\r\n public void testVertices() {\r\n System.out.println(\"vertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n Collection colection = instance.vertices();\r\n boolean result = colection.contains(v1);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n result = colection.contains(v1);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "@Test\n public void testRemoveBothInvalidVertices() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(6L, 6L));\n verticesToBeRemoved.add(new Vertex<>(7L, 7L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Override public boolean remove(L vertex) {\r\n if(!vertices.contains(vertex)) return false;\r\n vertices.remove(vertex);\r\n Iterator<Edge<L>> iter=edges.iterator();\r\n while(iter.hasNext()) {\r\n \t Edge<L> tmp=iter.next();\r\n \t //改了\r\n \t if(tmp.getSource().equals(vertex) || tmp.getTarget().equals(vertex))\r\n \t // if(tmp.getSource()==vertex|| tmp.getTarget()==vertex) \r\n \t\t iter.remove();\r\n \t}\r\n checkRep();\r\n return true;\r\n \r\n \r\n }", "public void testRemoveEdgeEdge( ) {\n init( );\n\n assertEquals( m_g4.edgeSet( ).size( ), 4 );\n m_g4.removeEdge( m_v1, m_v2 );\n assertEquals( m_g4.edgeSet( ).size( ), 3 );\n assertFalse( m_g4.removeEdge( m_eLoop ) );\n assertTrue( m_g4.removeEdge( m_g4.getEdge( m_v2, m_v3 ) ) );\n assertEquals( m_g4.edgeSet( ).size( ), 2 );\n }", "public boolean removeVertex(V vertex);", "public boolean removeVertex(V vertex);", "public void testRemoveEdge_edge() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(\n graph.removeEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Override\n public void clearVertices()\n {\n // Shouldn't clear vertices\n }", "@Test\n public void testRemoveOneValidOneInvalidVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(1L, 1L));\n verticesToBeRemoved.add(new Vertex<>(7L, 7L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult = \"2,3,23\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\r\n void test_check_order_properly_increased_and_decreased() {\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"C\");\r\n graph.addVertex(\"D\");\r\n graph.addVertex(\"C\");\r\n if(graph.order() != 3) {\r\n fail();\r\n } \r\n graph.removeVertex(\"A\");\r\n graph.removeVertex(\"B\");\r\n graph.removeVertex(\"C\");\r\n if(graph.order() != 1) {\r\n fail();\r\n }\r\n \r\n }", "@Test public void testPublic10() {\n Graph<Character> graph= TestGraphs.testGraph3();\n char[] toRemove= {'I', 'H', 'B', 'J', 'C', 'G', 'E', 'F'};\n String[] results= {\"O\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"K\",\n \"A L N\", \"P\", \"K\", \"D\"};\n int i;\n\n for (i= 0; i < toRemove.length; i++)\n graph.removeVertex(toRemove[i]);\n\n for (Character ch : graph.getVertices())\n assertEquals(results[ch - 'A'],\n TestGraphs.collToString(graph.getNeighbors(ch)));\n }", "protected void removeEdgeAndVertices(TestbedEdge edge) {\n java.util.Collection<Agent> agents = getIncidentVertices(edge);\n removeEdge(edge);\n for (Agent v : agents) {\n if (getIncidentEdges(v).isEmpty()) {\n removeVertex(v);\n }\n }\n }", "public native VertexList remove(VertexNode vertex);", "boolean ignoreExistingVertices();", "@Override\n public void deleteVertex(int vertex) {\n\n }", "@Test\r\n void test_insert_edges_remove_edges_check_size() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n\r\n // There are no more edges in the graph\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"A\", \"E\");\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n }", "public V removeVertex(V v);", "@Test\n @org.junit.Ignore\n public void shouldConstructDetachedVertex() {\n }", "@DisplayName(\"Delete undirected edges\")\n @Test\n public void testDeleteEdgeUndirected() {\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertEquals(1, graph.getNeighbours(0).size());\n Assertions.assertEquals(1, graph.getNeighbours(1).size());\n }", "@Test\n public void testRemoveEdges() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(2L, 3L, 23L));\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\" + \"1,2,12\\n\" + \"1,3,13\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "@Test\n\tpublic void verticesTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(D));\n\t}", "public Collection<V> removeVertices(Collection<V> vs);", "public boolean removeVertices(Collection<? extends V> vertices);", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "public void removeVertex(Position vp) throws InvalidPositionException;", "@Test public void testPublic7() {\n Graph<Character> graph= TestGraphs.testGraph3();\n String[] results= {\"O\", \"\", \"\", \"E F\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"B K\", \"A N\", \"C G\", \"H K\", \"D\"};\n\n graph.removeEdge('A', 'I');\n graph.removeEdge('K', 'J');\n graph.removeEdge('M', 'L');\n graph.removeEdge('N', 'P');\n\n for (Character ch : graph.getVertices())\n assertEquals(results[ch - 'A'],\n TestGraphs.collToString(graph.getNeighbors(ch)));\n }", "public void testCreateAndSetOnSameVertexShouldCreateOnlyVertexOnly() {\n }", "@Override\n public void removeVertices(List<V> plstVertex) {\n for (V v : plstVertex) {\n removeVertex(v);\n }\n }", "public void removeVertex (T vertex){\n int index = vertexIndex(vertex);\n \n if (index < 0) return; // vertex does not exist\n \n n--;\n // IF THIS DOESN'T WORK make separate loop for column moving\n for (int i = index; i < n; i++){\n vertices[i] = vertices[i + 1];\n for (int j = 0; j < n; j++){\n edges[j][i] = edges[j][i + 1]; // moving row up\n edges[i] = edges[i + 1]; // moving column over\n }\n }\n }", "public void removeVertex (E vertex)\n {\n int indexOfVertex = this.indexOf (vertex);\n if (indexOfVertex != -1)\n {\n this.removeEdges (vertex);\n\t for (int index = indexOfVertex + 1; index <= lastIndex; index++)\n {\n vertices[index - 1] = vertices[index];\n adjacencySequences[index - 1] = adjacencySequences[index];\n }\n \n vertices[lastIndex] = null;\n adjacencySequences[lastIndex] = null;\n lastIndex--;\n \n for (int index = 0; index <= lastIndex; index++)\n {\n Node node = adjacencySequences[index];\n while (node != null)\n {\n if (node.neighbourIndex > indexOfVertex)\n node.neighbourIndex--;\n node = node.nextNode;\n }\n }\n\t}\n }", "@Override\n \t\t\t\tpublic void deleteGraph() throws TransformedGraphException {\n \n \t\t\t\t}", "@Test\n\tpublic void addVertexTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(B));\n\t\tassertTrue(graph.vertices().contains(D));\n\t\tassertFalse(graph.addVertex(B)); // the graph has already have the vertex B, so assert false here.\n\t}", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Test\n public void testRemoveEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdge(new Edge<>(5L, 1L, 51L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "@Override\r\n\tpublic boolean deleteVertex(E sk) {\r\n\t\tif(containsVertex(sk)) {\r\n\t\t\tvertices.remove(sk); //remove the vertex itself\r\n\t\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\t\tArrayList<Edge<E>> toremove = new ArrayList<>();\r\n\t\t\t\tfor(Edge<E> ale : adjacencyLists.get(t)) {\r\n\t\t\t\t\tif(ale.getDst().equals(sk)) {\r\n\t\t\t\t\t\ttoremove.add(ale);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tadjacencyLists.get(t).removeAll(toremove);\r\n\t\t\t});\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "public boolean removeVertex(String label)\n\t{\n\t\tif(hasVertex(label)) //if vertex in in list\n\t\t{\n\t\t\tvertices.removeAt(getVertex(label));\n\t\t\t//System.out.println(\"Deleted: \" + label); //debug\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private int removeAgentFromVertex(Vertex vertex, Agent ag){\n synchronized (vertexAgentsNumber) {\n vertexAgentsNumber.get(vertex).remove(ag);\n if( vertexAgentsNumber.get(vertex).isEmpty() ) {\n vertexAgentsNumber.remove(vertex);\n return 0;\n }\n else\n return vertexAgentsNumber.get(vertex).size();\n }\n }", "void removeEdge(int x, int y);", "public void removeVertex(V toRemove){\n if (toRemove.equals(null)){\n throw new IllegalArgumentException();\n }\n if(contains(toRemove)){\n graph.remove(toRemove);\n }\n for (V vertex : graph.keySet()){\n if (graph.get(vertex).contains(toRemove)){\n ArrayList<V> edges = graph.get(vertex);\n edges.remove(toRemove);\n graph.put(vertex, edges);\n }\n }\n }", "@Test\r\n public void testEdges() {\r\n System.out.println(\"edges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Collection colection = instance.edges();\r\n boolean result = colection.contains(e);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n result = colection.contains(e);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Test\n\tpublic void test() {\n\t\tAssert.assertNotEquals(null, vertex.getEdges());\n\t\t\n\t\t// Check no edges are initially connected\n\t\tAssert.assertEquals(0, vertex.degree());\n\t\t\n\t\t// Check an edge can be added correctly\n\t\ttEdge = new Edge(vertex, new Vertex(\"test2\"));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using existing edge\n\t\tvertex.add(tEdge);\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using new edge\n\t\tvertex.add(new Edge(vertex, new Vertex(\"test2\")));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check edges can be removed correctly\n\t\tvertex.remove(\"test2\");\n\t\tAssert.assertEquals(0, vertex.degree());\n\t}", "@DisplayName(\"Delete directed edges\")\n @Test\n public void testDeleteEdgeDirected() {\n boolean directed1 = true;\n graph = new Graph(edges, directed1, 0, 5, GraphType.RANDOM);\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertTrue(graph.getNeighbours(0).isEmpty());\n }", "public void removeAllEdges() {\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "@Test\n void test04_checkOrder() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addVertex(\"d\");\n graph.addVertex(\"e\");\n graph.addVertex(\"f\"); // added 6 items\n if (graph.order() != 6) {\n fail(\"graph has counted incorrect number of vertices\");\n }\n }", "@Test\n void testAddVertexGraph() {\n Assertions.assertTrue(graph.addVertex(v1));\n Assertions.assertTrue(graph.containsVertex(v1));\n Assertions.assertTrue(checkInv());\n }", "public native VertexList clear();", "@Test\n public void testRemoveOneValidOneInvalidEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(1L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(6L, 1L, 61L));\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public void testVerticesSet() {\n System.out.println(\"verticesSet\");\n\n Assert.assertTrue(generateGraph().verticesSet().size() == 25);\n }", "boolean removeEdge(E edge);", "void removeEdges(List<CyEdge> edges);", "@Test\n public void testRemoveSameEdgeTwice() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\" + \"1,3,13\\n\" + \"2,3,23\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "@Test public void testPublic6() {\n Graph<Character> graph= TestGraphs.testGraph3();\n String[] results= {\"O\", \"\", \"\", \"E F\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"B K\", \"A N\", \"C G\", \"H K\", \"D\"};\n Character ch;\n int i;\n\n graph.removeEdge('A', 'I');\n graph.removeEdge('K', 'J');\n graph.removeEdge('M', 'L');\n graph.removeEdge('N', 'P');\n\n for (ch= 'A', i= 0; ch <= 'P'; ch++, i++)\n assertEquals(results[i],\n TestGraphs.collToString(graph.getNeighbors(ch)));\n }", "boolean hasIsVertexOf();", "void removeEdge(Vertex v1, Vertex v2) throws GraphException;", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "private void removeFromVertexList(Vertex v) {\n int ind = _vertices.indexOf(v);\n for (int i = ind + 1; i < _vertices.size(); i++) {\n _vertMap.put(_vertices.get(i), i - 1);\n }\n _vertices.remove(v);\n }", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "@Test\r\n public void testOpposite() {\r\n System.out.println(\"opposite\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Vertex result = instance.opposite(v1, e);\r\n Vertex expectedResult = v2;\r\n assertEquals(expectedResult, result);\r\n\r\n result = instance.opposite(v2, e);\r\n expectedResult = v1;\r\n assertEquals(expectedResult, result);\r\n }", "public void testAddVertex() {\n System.out.println(\"addVertex\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.addVertex(new Integer(i)));\n }\n\n for (int i = 0; i < 25; i++) {\n Assert.assertFalse(graph.addVertex(new Integer(i)));\n }\n }", "public void deleteSelected() {\r\n \t\tObject cells[] = graph.getSelectionCells();\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \r\n \t\t// If a cell is a blocking region avoid removing its edges and\r\n \t\t// select its element at the end of the removal process\r\n \t\tSet edges = new HashSet();\r\n \t\tSet<Object> select = new HashSet<Object>();\r\n \r\n \t\t// Set with all regions that can be deleted as its child were removed\r\n \t\tSet<Object> regions = new HashSet<Object>();\r\n \t\t// Set with all JmtCells that we are removing\r\n \t\tSet<Object> jmtCells = new HashSet<Object>();\r\n \r\n \t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t// for(int k=0; k<cells.length; k++){\r\n \t\t// if(cells[k] instanceof JmtEdge){\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)cells[k])))).SubOut();\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)cells[k])))).SubIn();\r\n \t\t// }\r\n \t\t//\r\n \t\t// }\r\n \t\tfor (int i = 0; i < cells.length; i++) {\r\n \t\t\tif (!(cells[i] instanceof BlockingRegion)) {\r\n \t\t\t\t// Adds edge for removal\r\n \t\t\t\tedges.addAll(DefaultGraphModel.getEdges(graphmodel, new Object[] { cells[i] }));\r\n \t\t\t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t\t\t// quando vado a eliminare un nodo, a cui collegato un arco,\r\n \t\t\t\t// vado ad incrementare o diminuire il contatore per il\r\n \t\t\t\t// pulsanteAGGIUSTATUTTO\r\n \t\t\t\t// Iterator iter = edges.iterator();\r\n \t\t\t\t// while (iter.hasNext()) {\r\n \t\t\t\t// Object next = iter.next();\r\n \t\t\t\t// if (next instanceof JmtEdge){\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)next)))).SubOut();\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)next)))).SubIn();\r\n \t\t\t\t// }\r\n \t\t\t\t//\r\n \t\t\t\t// }\r\n \t\t\t\t// Stores parents information and cell\r\n \t\t\t\tif (cells[i] instanceof JmtCell) {\r\n \t\t\t\t\tif (((JmtCell) cells[i]).getParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t\tregions.add(((JmtCell) cells[i]).getParent());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tjmtCells.add(cells[i]);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t// Adds node for selection\r\n \t\t\t\tObject[] nodes = graph.getDescendants(new Object[] { cells[i] });\r\n \t\t\t\tfor (Object node : nodes) {\r\n \t\t\t\t\tif (node instanceof JmtCell || node instanceof JmtEdge) {\r\n \t\t\t\t\t\tselect.add(node);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t// Removes blocking region from data structure\r\n \t\t\t\tmodel.deleteBlockingRegion(((BlockingRegion) cells[i]).getKey());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tif (!edges.isEmpty()) {\r\n \t\t\tgraphmodel.remove(edges.toArray());\r\n \t\t}\r\n \t\t// removes cells from graph\r\n \t\tgraphmodel.remove(cells);\r\n \r\n \t\t// Checks if all children of a blocking region have been removed\r\n \t\tIterator<Object> it = regions.iterator();\r\n \t\twhile (it.hasNext()) {\r\n \t\t\tjmtCells.add(null);\r\n \t\t\tBlockingRegion region = (BlockingRegion) it.next();\r\n \t\t\tList child = region.getChildren();\r\n \t\t\tboolean empty = true;\r\n \t\t\tfor (int i = 0; i < child.size(); i++) {\r\n \t\t\t\tif (child.get(i) instanceof JmtCell && !jmtCells.contains(child.get(i))) {\r\n \t\t\t\t\tempty = false;\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (empty) {\r\n \t\t\t\tmodel.deleteBlockingRegion(region.getKey());\r\n \t\t\t\tgraphmodel.remove(new Object[] { region });\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Removes cells from data structure\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tmodel.deleteStation(((CellComponent) ((JmtCell) cell).getUserObject()).getKey());\r\n \t\t\t} else if (cell instanceof JmtEdge) {\r\n \t\t\t\tJmtEdge link = (JmtEdge) cell;\r\n \t\t\t\tmodel.setConnected(link.getSourceKey(), link.getTargetKey(), false);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// If no stations remains gray select and link buttons\r\n \t\tif (graph.getModel().getRootCount() == 0) {\r\n \t\t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\t\tsetConnect.setEnabled(false);\r\n \t\t\tsetSelect.setEnabled(false);\r\n \t\t}\r\n \r\n \t\t// Selects components from removed blocking regions\r\n \t\tif (select.size() > 0) {\r\n \t\t\tgraph.setSelectionCells(select.toArray());\r\n \t\t\t// Resets parent information of cells that changed parent\r\n \t\t\tit = select.iterator();\r\n \t\t\twhile (it.hasNext()) {\r\n \t\t\t\tObject next = it.next();\r\n \t\t\t\tif (next instanceof JmtCell) {\r\n \t\t\t\t\t((JmtCell) next).resetParent();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test\n public void testRemoveInvalidEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.removeEdge(new Edge<>(6L, 1L, 61L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public native VertexList removeSubList(VertexNode a, VertexNode b);" ]
[ "0.85716736", "0.8479586", "0.8448878", "0.80835104", "0.78957397", "0.7807058", "0.78012204", "0.76159894", "0.7579489", "0.75258076", "0.7438472", "0.74038184", "0.73951215", "0.7354661", "0.7314831", "0.72705895", "0.72602296", "0.7245766", "0.71529794", "0.71256316", "0.7031718", "0.7028444", "0.70107824", "0.70093834", "0.69931346", "0.69900644", "0.69607514", "0.6934473", "0.6907905", "0.6901725", "0.6842826", "0.68328846", "0.6805657", "0.6752991", "0.6752991", "0.67356974", "0.67251647", "0.6721855", "0.6713397", "0.67010236", "0.66913426", "0.6688974", "0.6654348", "0.6582358", "0.6522329", "0.65216637", "0.6477692", "0.64739096", "0.6461227", "0.6443489", "0.6427728", "0.64095604", "0.6390597", "0.6379489", "0.6353252", "0.6343008", "0.6334401", "0.6328964", "0.6301546", "0.629305", "0.6264748", "0.62414336", "0.62356514", "0.6195081", "0.6193463", "0.6177939", "0.6170736", "0.61662906", "0.61520964", "0.61371154", "0.61176944", "0.61147565", "0.6103772", "0.6092937", "0.6092584", "0.6078581", "0.6073413", "0.60565966", "0.6045286", "0.6018472", "0.60035086", "0.598261", "0.5958865", "0.59371793", "0.5928461", "0.5926709", "0.5910629", "0.58812475", "0.5881003", "0.5867209", "0.58629614", "0.584446", "0.583731", "0.5831498", "0.582847", "0.5818527", "0.5813193", "0.5810803", "0.5799223", "0.57906747" ]
0.7487192
10
tests that removeVertex() removes the necessary edges also
@Test public void testPublic10() { Graph<Character> graph= TestGraphs.testGraph3(); char[] toRemove= {'I', 'H', 'B', 'J', 'C', 'G', 'E', 'F'}; String[] results= {"O", "", "", "", "", "", "", "", "", "", "", "K", "A L N", "P", "K", "D"}; int i; for (i= 0; i < toRemove.length; i++) graph.removeVertex(toRemove[i]); for (Character ch : graph.getVertices()) assertEquals(results[ch - 'A'], TestGraphs.collToString(graph.getNeighbors(ch))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test \n\tpublic void removeVertexTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tgraph.addVertex(D);\n\t\tassertFalse(graph.removeVertex(C));\n\t\tgraph.addVertex(C);\n\t\tgraph.addEdge(edge_0);\n\t\tassertTrue(graph.removeVertex(D));\n\t\tassertFalse(graph.vertices().contains(D));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.addVertex(D));\n\t}", "@Test\n void test02_removeVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two\n graph.removeVertex(\"a\"); // remove\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.remove(\"a\"); // creates a mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't remove the vertices correctly\");\n }\n }", "public void testRemoveVertex() {\n System.out.println(\"removeVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n for (int i = 24; i >= 0; i--) {\n Assert.assertTrue(graph.removeVertex(new Integer(i)));\n Assert.assertFalse(graph.containsVertex(new Integer(i)));\n Assert.assertEquals(graph.verticesSet().size(), i);\n }\n }", "public void removeVertex();", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}", "public void testRemoveAllVertices() {\n System.out.println(\"removeAllVertices\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllVertices());\n Assert.assertEquals(graph.verticesSet().size(), 0);\n }", "@Test\n void test07_tryToRemoveNonExistentEdge() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\");\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n try {\n graph.removeEdge(\"e\", \"f\"); // remove non existent edge\n } catch (Exception e) {\n fail(\"Shouldn't have thrown exception\");\n }\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\");\n vertices.add(\"c\"); // creates mock up vertex list\n\n if (!graph.getAllVertices().equals(vertices)) { // checks if vertices weren't added or removed\n fail(\"wrong vertices are inserted into the graph\");\n }\n if (graph.size() != 2) {\n fail(\"wrong number of edges in the graph\");\n }\n\n }", "public void testRemoveEdge_betweenVertices() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(graph.removeEdge(new Integer(i), new Integer(j)));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "@Test\n void test06_removeEdge_checkSize() {\n graph.addVertex(\"c\");\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"b\", \"c\"); // adds two edges\n graph.removeEdge(\"a\", \"b\"); // removes one of the edges\n if (graph.size() != 1) {\n fail(\"graph has counted incorrect number of edges\");\n }\n }", "@Test\r\n public void testRemoveVertex() {\r\n System.out.println(\"removeVertex\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expectedResult = 1;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n\r\n expectedResult = 0;\r\n result = instance.numVertices();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "public void testRemoveEdgeEdge( ) {\n init( );\n\n assertEquals( m_g4.edgeSet( ).size( ), 4 );\n m_g4.removeEdge( m_v1, m_v2 );\n assertEquals( m_g4.edgeSet( ).size( ), 3 );\n assertFalse( m_g4.removeEdge( m_eLoop ) );\n assertTrue( m_g4.removeEdge( m_g4.getEdge( m_v2, m_v3 ) ) );\n assertEquals( m_g4.edgeSet( ).size( ), 2 );\n }", "@Test\n public void testRemoveVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.removeVertex(new Vertex<>(5L, 5L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult = \"1,2,12\\n\" + \"1,3,13\\n\" + \"2,3,23\\n\" + \"3,4,34\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "protected void removeEdgeAndVertices(TestbedEdge edge) {\n java.util.Collection<Agent> agents = getIncidentVertices(edge);\n removeEdge(edge);\n for (Agent v : agents) {\n if (getIncidentEdges(v).isEmpty()) {\n removeVertex(v);\n }\n }\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\r\n public void testRemoveEdge() {\r\n System.out.println(\"removeEdge\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expectedResult = 0;\r\n int result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n expectedResult = 1;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n\r\n expectedResult = 0;\r\n result = instance.numEdges();\r\n\r\n assertEquals(expectedResult, result);\r\n }", "@Test\n public void testRemoveVertices() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(1L, 1L));\n verticesToBeRemoved.add(new Vertex<>(2L, 2L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult = \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n public void testGraphElements(){\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v5 = new Vertex(5, \"E\");\n Vertex v6 = new Vertex(6, \"F\");\n Vertex v7 = new Vertex(7, \"G\");\n Vertex v8 = new Vertex(8, \"H\");\n\n Vertex fakeVertex = new Vertex(100, \"fake vertex\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v3, v4, 1);\n Edge<Vertex> e4 = new Edge<>(v2, v4, 1);\n Edge<Vertex> e5 = new Edge<>(v2, v6, 1);\n Edge<Vertex> e6 = new Edge<>(v2, v5, 10);\n Edge<Vertex> e7 = new Edge<>(v5, v6, 10);\n Edge<Vertex> e8 = new Edge<>(v4, v6, 10);\n Edge<Vertex> e9 = new Edge<>(v6, v7, 10);\n Edge<Vertex> e10 = new Edge<>(v7, v8, 10);\n\n Edge<Vertex> fakeEdge = new Edge<>(fakeVertex, v1);\n Edge<Vertex> edgeToRemove = new Edge<>(v2, v7, 200);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addVertex(v5);\n g.addVertex(v6);\n g.addVertex(v7);\n g.addVertex(v8);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n g.addEdge(e6);\n g.addEdge(e7);\n g.addEdge(e8);\n g.addEdge(e9);\n g.addEdge(edgeToRemove);\n\n Assert.assertTrue(g.addEdge(e10));\n\n //adding null edge or vertex to graph returns false\n Assert.assertFalse(g.addEdge(null));\n Assert.assertFalse(g.addVertex(null));\n\n //adding edge with a vertex that does not exist in graph g returns false\n Assert.assertFalse(g.addEdge(fakeEdge));\n\n //get an edge that does not exit in graph returns false\n Assert.assertFalse(g.edge(v1, fakeVertex));\n\n //getting length of edge from vertex not in graph g returns false\n Assert.assertEquals(0, g.edgeLength(fakeVertex, v2));\n\n //Remove an edge in graph g returns true\n Assert.assertTrue(g.remove(edgeToRemove));\n\n //Removing edge not in graph g returns false\n Assert.assertFalse(g.remove(fakeEdge));\n\n //Removing vertex not in graph g returns false\n Assert.assertFalse(g.remove(fakeVertex));\n\n //Finding an edge with an endpoint not in graph g returns null\n assertNull(g.getEdge(v1, fakeVertex));\n }", "public void testRemoveEdge_edge() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(\n graph.removeEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "public void testRemoveAllEdges() {\n System.out.println(\"removeAllEdges\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n Assert.assertTrue(graph.removeAllEdges());\n Assert.assertEquals(graph.edgesSet().size(), 0);\n }", "@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "void remove(Vertex vertex);", "@Test\n public void testRemoveInvalidVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.removeVertex(new Vertex<>(6L, 6L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test public void testPublic9() {\n Graph<Character> graph= TestGraphs.testGraph3();\n char[] toRemove= {'I', 'H', 'B', 'J', 'C', 'G', 'E', 'F'};\n int i;\n\n for (i= 0; i < toRemove.length; i++) {\n graph.removeVertex(toRemove[i]);\n assertFalse(graph.hasVertex(toRemove[i]));\n }\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "void removeVertex(Vertex v) throws GraphException;", "@DisplayName(\"Delete undirected edges\")\n @Test\n public void testDeleteEdgeUndirected() {\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertEquals(1, graph.getNeighbours(0).size());\n Assertions.assertEquals(1, graph.getNeighbours(1).size());\n }", "@Override public boolean remove(L vertex) {\r\n if(!vertices.contains(vertex)) return false;\r\n vertices.remove(vertex);\r\n Iterator<Edge<L>> iter=edges.iterator();\r\n while(iter.hasNext()) {\r\n \t Edge<L> tmp=iter.next();\r\n \t //改了\r\n \t if(tmp.getSource().equals(vertex) || tmp.getTarget().equals(vertex))\r\n \t // if(tmp.getSource()==vertex|| tmp.getTarget()==vertex) \r\n \t\t iter.remove();\r\n \t}\r\n checkRep();\r\n return true;\r\n \r\n \r\n }", "@Test\n public void testVertices() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v4id = new Vertex (4, \"E\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n assertFalse(g.addVertex(v4id));\n\n Set<Vertex> expectedVertices = new HashSet<>();\n expectedVertices.add(v1);\n expectedVertices.add(v2);\n expectedVertices.add(v3);\n expectedVertices.add(v4);\n\n assertEquals(expectedVertices, g.allVertices());\n\n Assert.assertTrue(g.remove(v1));\n\n }", "@Test\n public void testRemoveBothInvalidVertices() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(6L, 6L));\n verticesToBeRemoved.add(new Vertex<>(7L, 7L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n public void testRemoveBothInvalidVerticesVertexResult() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(6L, 6L));\n verticesToBeRemoved.add(new Vertex<>(7L, 7L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Override\n public void deleteVertex(int vertex) {\n\n }", "void removeIsVertexOf(Subdomain_group oldIsVertexOf);", "@Test\r\n void test_insert_edges_remove_edges_check_size() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n\r\n // There are no more edges in the graph\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"A\", \"E\");\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"A\", \"D\");\r\n graph.addEdge(\"A\", \"E\");\r\n if(graph.size() != 4) {\r\n fail();\r\n }\r\n }", "void removeEdge(int x, int y);", "@Test\n public void testRemoveOneValidOneInvalidVertex() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Vertex<Long, Long>> verticesToBeRemoved = new ArrayList<>();\n verticesToBeRemoved.add(new Vertex<>(1L, 1L));\n verticesToBeRemoved.add(new Vertex<>(7L, 7L));\n\n graph = graph.removeVertices(verticesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult = \"2,3,23\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n public void testRemoveEdges() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(2L, 3L, 23L));\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\" + \"1,2,12\\n\" + \"1,3,13\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public void removeAllEdges() {\n }", "private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Override\n public void clearVertices()\n {\n // Shouldn't clear vertices\n }", "public void removeVertex (T vertex){\n int index = vertexIndex(vertex);\n \n if (index < 0) return; // vertex does not exist\n \n n--;\n // IF THIS DOESN'T WORK make separate loop for column moving\n for (int i = index; i < n; i++){\n vertices[i] = vertices[i + 1];\n for (int j = 0; j < n; j++){\n edges[j][i] = edges[j][i + 1]; // moving row up\n edges[i] = edges[i + 1]; // moving column over\n }\n }\n }", "@Test\n public void testRemoveEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdge(new Edge<>(5L, 1L, 51L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public void testRemoveEdgeObjectObject( ) {\n init( ); //TODO Implement removeEdge().\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "@Test\n @org.junit.Ignore\n public void shouldConstructDetachedVertex() {\n }", "@Override\n \t\t\t\tpublic void deleteGraph() throws TransformedGraphException {\n \n \t\t\t\t}", "@DisplayName(\"Delete directed edges\")\n @Test\n public void testDeleteEdgeDirected() {\n boolean directed1 = true;\n graph = new Graph(edges, directed1, 0, 5, GraphType.RANDOM);\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertTrue(graph.getNeighbours(0).isEmpty());\n }", "boolean removeEdge(E edge);", "void removeEdges(List<CyEdge> edges);", "public boolean removeVertex(V vertex);", "public boolean removeVertex(V vertex);", "public void removeVertex (E vertex)\n {\n int indexOfVertex = this.indexOf (vertex);\n if (indexOfVertex != -1)\n {\n this.removeEdges (vertex);\n\t for (int index = indexOfVertex + 1; index <= lastIndex; index++)\n {\n vertices[index - 1] = vertices[index];\n adjacencySequences[index - 1] = adjacencySequences[index];\n }\n \n vertices[lastIndex] = null;\n adjacencySequences[lastIndex] = null;\n lastIndex--;\n \n for (int index = 0; index <= lastIndex; index++)\n {\n Node node = adjacencySequences[index];\n while (node != null)\n {\n if (node.neighbourIndex > indexOfVertex)\n node.neighbourIndex--;\n node = node.nextNode;\n }\n }\n\t}\n }", "void remove(Edge edge);", "@Test\n public void testRemoveOneValidOneInvalidEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(1L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(6L, 1L, 61L));\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Test\n\tpublic void test() {\n\t\tAssert.assertNotEquals(null, vertex.getEdges());\n\t\t\n\t\t// Check no edges are initially connected\n\t\tAssert.assertEquals(0, vertex.degree());\n\t\t\n\t\t// Check an edge can be added correctly\n\t\ttEdge = new Edge(vertex, new Vertex(\"test2\"));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using existing edge\n\t\tvertex.add(tEdge);\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check no duplicates allowed using new edge\n\t\tvertex.add(new Edge(vertex, new Vertex(\"test2\")));\n\t\tAssert.assertEquals(1, vertex.degree());\n\t\t\n\t\t// Check edges can be removed correctly\n\t\tvertex.remove(\"test2\");\n\t\tAssert.assertEquals(0, vertex.degree());\n\t}", "void removeEdge(Vertex v1, Vertex v2) throws GraphException;", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "public abstract void removeEdge(int from, int to);", "public boolean removeEdge(E edge);", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "public V removeVertex(V v);", "@Test\n public void testRemoveInvalidEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.removeEdge(new Edge<>(6L, 1L, 61L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "@Override\n public boolean deleteEdge(Edge edge) {\n return false;\n }", "public void removeEdge(int start, int end);", "public native VertexList remove(VertexNode vertex);", "public abstract void removeEdge(Point p, Direction dir);", "public void testCreateAndSetOnSameVertexShouldCreateOnlyVertexOnly() {\n }", "@Test\r\n public void testEdges() {\r\n System.out.println(\"edges\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1Element, v2Element, edgeElement);\r\n\r\n Collection colection = instance.edges();\r\n boolean result = colection.contains(e);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeEdge(e);\r\n result = colection.contains(e);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "public void removeVertex(Position vp) throws InvalidPositionException;", "@Test\r\n public void testVertices() {\r\n System.out.println(\"vertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n Collection colection = instance.vertices();\r\n boolean result = colection.contains(v1);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n result = colection.contains(v1);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "@Test\r\n void test_check_order_properly_increased_and_decreased() {\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"C\");\r\n graph.addVertex(\"D\");\r\n graph.addVertex(\"C\");\r\n if(graph.order() != 3) {\r\n fail();\r\n } \r\n graph.removeVertex(\"A\");\r\n graph.removeVertex(\"B\");\r\n graph.removeVertex(\"C\");\r\n if(graph.order() != 1) {\r\n fail();\r\n }\r\n \r\n }", "public boolean removeEdge(V source, V target);", "@Override\n public void removeVertices(List<V> plstVertex) {\n for (V v : plstVertex) {\n removeVertex(v);\n }\n }", "@Test\n public void testRemoveSameEdgeTwice() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n List<Edge<Long, Long>> edgesToBeRemoved = new ArrayList<>();\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n edgesToBeRemoved.add(new Edge<>(5L, 1L, 51L));\n\n graph = graph.removeEdges(edgesToBeRemoved);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\" + \"1,3,13\\n\" + \"2,3,23\\n\" + \"3,4,34\\n\" + \"3,5,35\\n\" + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "int removeEdges(ExpLineageEdge.FilterOptions options);", "@Override\r\n\tpublic boolean deleteVertex(E sk) {\r\n\t\tif(containsVertex(sk)) {\r\n\t\t\tvertices.remove(sk); //remove the vertex itself\r\n\t\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\t\tArrayList<Edge<E>> toremove = new ArrayList<>();\r\n\t\t\t\tfor(Edge<E> ale : adjacencyLists.get(t)) {\r\n\t\t\t\t\tif(ale.getDst().equals(sk)) {\r\n\t\t\t\t\t\ttoremove.add(ale);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tadjacencyLists.get(t).removeAll(toremove);\r\n\t\t\t});\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean ignoreExistingVertices();", "public void removeVertex(V toRemove){\n if (toRemove.equals(null)){\n throw new IllegalArgumentException();\n }\n if(contains(toRemove)){\n graph.remove(toRemove);\n }\n for (V vertex : graph.keySet()){\n if (graph.get(vertex).contains(toRemove)){\n ArrayList<V> edges = graph.get(vertex);\n edges.remove(toRemove);\n graph.put(vertex, edges);\n }\n }\n }", "private void removeEdge() {\n boolean go = true;\n int lastNode;\n int proxNode;\n int atualNode;\n if ((parentMatrix[randomChild][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode =\n parentMatrix[randomChild][parentMatrix[randomChild][0] - 1];\n for (int i = (parentMatrix[randomChild][0] - 1); (i > 0 && go); i--)\n { // remove element from parentMatrix\n atualNode = parentMatrix[randomChild][i];\n if (atualNode != randomParent) {\n proxNode = atualNode;\n parentMatrix[randomChild][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n parentMatrix[randomChild][i] = lastNode;\n go = false;\n }\n }\n if ((childMatrix[randomParent][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode = childMatrix[randomParent][\n childMatrix[randomParent][0] - 1];\n go = true;\n for (int i = (childMatrix[randomParent][0] - 1); (i > 0 &&\n go); i--) { // remove element from childMatrix\n atualNode = childMatrix[randomParent][i];\n if (atualNode != randomChild) {\n proxNode = atualNode;\n childMatrix[randomParent][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n childMatrix[randomParent][i] = lastNode;\n go = false;\n }\n } // end of for\n }\n childMatrix[randomParent][(childMatrix[randomParent][0] - 1)] = -4;\n childMatrix[randomParent][0]--;\n parentMatrix[randomChild][(parentMatrix[randomChild][0] - 1)] = -4;\n parentMatrix[randomChild][0]--;\n }\n }", "public Collection<V> removeVertices(Collection<V> vs);", "@Test public void testPublic7() {\n Graph<Character> graph= TestGraphs.testGraph3();\n String[] results= {\"O\", \"\", \"\", \"E F\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"B K\", \"A N\", \"C G\", \"H K\", \"D\"};\n\n graph.removeEdge('A', 'I');\n graph.removeEdge('K', 'J');\n graph.removeEdge('M', 'L');\n graph.removeEdge('N', 'P');\n\n for (Character ch : graph.getVertices())\n assertEquals(results[ch - 'A'],\n TestGraphs.collToString(graph.getNeighbors(ch)));\n }", "private void removeEdges()\r\n\t{\r\n\t final String edgeTypeName = edgeType.getName();\r\n\t for (final Edge e : eSet)\r\n\t\te.getSource().removeEdge(edgeTypeName, e.getDest());\r\n\t eSet.clear();\r\n\t}", "@Test\n public void testEdges() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n Set<Edge> expectedEdges = new HashSet<>();\n expectedEdges.add(e1);\n expectedEdges.add(e2);\n expectedEdges.add(e3);\n\n assertEquals(expectedEdges, g.allEdges());\n\n expectedEdges.remove(e2);\n assertEquals(expectedEdges, g.allEdges(v1));\n\n assertEquals(e3, g.getEdge(v1, v4));\n }", "public void removeEdges (E vertex) throws IllegalArgumentException\n {\n int index = this.indexOf (vertex);\n if (index < 0)\n throw new IllegalArgumentException (vertex + \" was not found!\");\n\n Node currentNode = adjacencySequences[index];\n while (currentNode != null)\n {\n this.removeNode (currentNode.neighbourIndex, index);\n currentNode = currentNode.nextNode;\n }\n\n adjacencySequences[index] = null;\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "public boolean removeVertices(Collection<? extends V> vertices);", "public void deleteSelected() {\r\n \t\tObject cells[] = graph.getSelectionCells();\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \r\n \t\t// If a cell is a blocking region avoid removing its edges and\r\n \t\t// select its element at the end of the removal process\r\n \t\tSet edges = new HashSet();\r\n \t\tSet<Object> select = new HashSet<Object>();\r\n \r\n \t\t// Set with all regions that can be deleted as its child were removed\r\n \t\tSet<Object> regions = new HashSet<Object>();\r\n \t\t// Set with all JmtCells that we are removing\r\n \t\tSet<Object> jmtCells = new HashSet<Object>();\r\n \r\n \t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t// for(int k=0; k<cells.length; k++){\r\n \t\t// if(cells[k] instanceof JmtEdge){\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)cells[k])))).SubOut();\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)cells[k])))).SubIn();\r\n \t\t// }\r\n \t\t//\r\n \t\t// }\r\n \t\tfor (int i = 0; i < cells.length; i++) {\r\n \t\t\tif (!(cells[i] instanceof BlockingRegion)) {\r\n \t\t\t\t// Adds edge for removal\r\n \t\t\t\tedges.addAll(DefaultGraphModel.getEdges(graphmodel, new Object[] { cells[i] }));\r\n \t\t\t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t\t\t// quando vado a eliminare un nodo, a cui collegato un arco,\r\n \t\t\t\t// vado ad incrementare o diminuire il contatore per il\r\n \t\t\t\t// pulsanteAGGIUSTATUTTO\r\n \t\t\t\t// Iterator iter = edges.iterator();\r\n \t\t\t\t// while (iter.hasNext()) {\r\n \t\t\t\t// Object next = iter.next();\r\n \t\t\t\t// if (next instanceof JmtEdge){\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)next)))).SubOut();\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)next)))).SubIn();\r\n \t\t\t\t// }\r\n \t\t\t\t//\r\n \t\t\t\t// }\r\n \t\t\t\t// Stores parents information and cell\r\n \t\t\t\tif (cells[i] instanceof JmtCell) {\r\n \t\t\t\t\tif (((JmtCell) cells[i]).getParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t\tregions.add(((JmtCell) cells[i]).getParent());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tjmtCells.add(cells[i]);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t// Adds node for selection\r\n \t\t\t\tObject[] nodes = graph.getDescendants(new Object[] { cells[i] });\r\n \t\t\t\tfor (Object node : nodes) {\r\n \t\t\t\t\tif (node instanceof JmtCell || node instanceof JmtEdge) {\r\n \t\t\t\t\t\tselect.add(node);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t// Removes blocking region from data structure\r\n \t\t\t\tmodel.deleteBlockingRegion(((BlockingRegion) cells[i]).getKey());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tif (!edges.isEmpty()) {\r\n \t\t\tgraphmodel.remove(edges.toArray());\r\n \t\t}\r\n \t\t// removes cells from graph\r\n \t\tgraphmodel.remove(cells);\r\n \r\n \t\t// Checks if all children of a blocking region have been removed\r\n \t\tIterator<Object> it = regions.iterator();\r\n \t\twhile (it.hasNext()) {\r\n \t\t\tjmtCells.add(null);\r\n \t\t\tBlockingRegion region = (BlockingRegion) it.next();\r\n \t\t\tList child = region.getChildren();\r\n \t\t\tboolean empty = true;\r\n \t\t\tfor (int i = 0; i < child.size(); i++) {\r\n \t\t\t\tif (child.get(i) instanceof JmtCell && !jmtCells.contains(child.get(i))) {\r\n \t\t\t\t\tempty = false;\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (empty) {\r\n \t\t\t\tmodel.deleteBlockingRegion(region.getKey());\r\n \t\t\t\tgraphmodel.remove(new Object[] { region });\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Removes cells from data structure\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tmodel.deleteStation(((CellComponent) ((JmtCell) cell).getUserObject()).getKey());\r\n \t\t\t} else if (cell instanceof JmtEdge) {\r\n \t\t\t\tJmtEdge link = (JmtEdge) cell;\r\n \t\t\t\tmodel.setConnected(link.getSourceKey(), link.getTargetKey(), false);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// If no stations remains gray select and link buttons\r\n \t\tif (graph.getModel().getRootCount() == 0) {\r\n \t\t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\t\tsetConnect.setEnabled(false);\r\n \t\t\tsetSelect.setEnabled(false);\r\n \t\t}\r\n \r\n \t\t// Selects components from removed blocking regions\r\n \t\tif (select.size() > 0) {\r\n \t\t\tgraph.setSelectionCells(select.toArray());\r\n \t\t\t// Resets parent information of cells that changed parent\r\n \t\t\tit = select.iterator();\r\n \t\t\twhile (it.hasNext()) {\r\n \t\t\t\tObject next = it.next();\r\n \t\t\t\tif (next instanceof JmtCell) {\r\n \t\t\t\t\t((JmtCell) next).resetParent();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public void removeVertex(String vertLabel) {\n\n // Implement me!\n if (indexOf(vertLabel, vertices) <0) {\n return;\n }\n vertices.remove(vertLabel);\n Iterator<String> iterator = edges.keySet().iterator();\n while (iterator.hasNext()) {\n String k = iterator.next();\n if (k.contains(vertLabel)) {\n iterator.remove();\n edges.remove(k);\n }\n }\n }", "public void removeEdge(Position ep) throws InvalidPositionException;", "@Override\n public void remove() {\n deleteFromModel();\n deleteEdgeEndpoints();\n\n setDeleted(true);\n if (!isCached()) {\n HBaseEdge cachedEdge = (HBaseEdge) graph.findEdge(id, false);\n if (cachedEdge != null) cachedEdge.setDeleted(true);\n }\n }", "private void removeFromEdgeMat(Vertex v) {\n int ind = _vertices.indexOf(v);\n for (int i = 0; i < _edges.size(); i++) {\n remove(_edges.get(i).get(ind));\n remove(_edges.get(ind).get(i));\n }\n _edges.remove(ind);\n for (int j = 0; j < _edges.size(); j++) {\n _edges.get(j).remove(ind);\n }\n _edgeMap.clear();\n for (int x = 0; x < _edges.size(); x++) {\n for (int y = 0; y < _edges.size(); y++) {\n if (!_edges.get(x).get(y).isNull()) {\n _edgeMap.put(_edges.get(x).get(y), new int[] {x, y});\n }\n }\n }\n }", "@Test\n\tpublic void addVertexTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(B));\n\t\tassertTrue(graph.vertices().contains(D));\n\t\tassertFalse(graph.addVertex(B)); // the graph has already have the vertex B, so assert false here.\n\t}", "public boolean resetEdges();", "private ProjectedVertex() {\n this.valid = false;\n this.edge = null;\n }", "@Test\n\tpublic void testRemoveLine() {\n\t\tp.removeInteraction(i1);\n\t\tassertFalse(p.hasPathwayObject(i1));\n\t\tassertFalse(p.hasPathwayObject(pt3));\n\t\tassertFalse(p.hasPathwayObject(pt4));\n\t}" ]
[ "0.84506726", "0.8257727", "0.82323813", "0.8000126", "0.79642063", "0.78006816", "0.77229583", "0.77073914", "0.7654906", "0.76357275", "0.76158625", "0.7595911", "0.7594734", "0.7592378", "0.75778365", "0.7511035", "0.7493172", "0.74863356", "0.74716", "0.7362088", "0.72462094", "0.7191354", "0.7177243", "0.7171365", "0.71237534", "0.70893264", "0.70494366", "0.7034392", "0.7032233", "0.700637", "0.69694793", "0.69369507", "0.69140154", "0.69047695", "0.6903289", "0.68881345", "0.68776596", "0.68577933", "0.68513423", "0.68399876", "0.683544", "0.68257236", "0.68120795", "0.6808264", "0.6791249", "0.67112595", "0.6695016", "0.66466343", "0.6608246", "0.6561306", "0.65574014", "0.6550627", "0.65493035", "0.65493035", "0.65468657", "0.6531712", "0.6502335", "0.6461381", "0.64414436", "0.6441331", "0.6411397", "0.6392201", "0.6391533", "0.639035", "0.63815665", "0.63674706", "0.6353669", "0.6349894", "0.63433737", "0.6316947", "0.6306992", "0.6281679", "0.62633127", "0.6253841", "0.62297314", "0.6221899", "0.6190299", "0.61812085", "0.6180897", "0.61687696", "0.616207", "0.61538017", "0.61532956", "0.61041987", "0.60948175", "0.60864294", "0.6073884", "0.60730845", "0.604747", "0.60468227", "0.60257995", "0.60214144", "0.6006406", "0.60001075", "0.5983295", "0.596994", "0.59550023", "0.5921294", "0.592088", "0.5913168" ]
0.62363344
74
ensures that isInCycle() returns false for every vertex in an acyclic graph
@Test public void testPublic11() { Graph<Character> graph= TestGraphs.testGraph3(); for (Character ch : graph.getVertices()) assertFalse(graph.isInCycle(ch)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int isCycle( Graph graph){\n int parent[] = new int[graph.V]; \n \n // Initialize all subsets as single element sets \n for (int i=0; i<graph.V; ++i) \n parent[i]=-1; \n \n // Iterate through all edges of graph, find subset of both vertices of every edge, if both subsets are same, then there is cycle in graph. \n for (int i = 0; i < graph.E; ++i){ \n int x = graph.find(parent, graph.edge[i].src); \n int y = graph.find(parent, graph.edge[i].dest); \n \n if (x == y) \n return 1; \n \n graph.Union(parent, x, y); \n } \n return 0; \n }", "private static boolean isCycle(Graph graph) {\n for (int i = 0; i < graph.edges.length; ++i) {\n int x = graph.find(graph.edges[i][0]);\n int y = graph.find(graph.edges[i][1]);\n\n // if both subsets are same, then there is cycle in graph.\n if (x == y) {\n // for edge 2-0 : parent of 0 is 2 == 2 and so we detected a cycle\n return true;\n }\n // keep doing union/merge of sets\n graph.union(x, y);\n }\n return false;\n }", "boolean detectCycleUndirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, -1))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "boolean isCycleUndirected(SimpleVertex simpleVertex, SimpleVertex parent) {\n\t\tsimpleVertex.parent = parent;\n\n\t\twhile (true) {\n\t\t\tif (simpleVertex.isVisited == false) {\n\t\t\t\tsimpleVertex.isVisited = true;\n\t\t\t\tSystem.out.print(simpleVertex.Vertexname + \" \");\n\t\t\t\tfor (int i = 0; i < simpleVertex.neighborhood.size(); i++) {\n\n\t\t\t\t\tSimpleEdge node = simpleVertex.neighborhood.get(i);\n\t\t\t\t\tnode.EdgeVisited = true;\n\t\t\t\t\t/*\n\t\t\t\t\t * if(simpleVertex.isVisited==node.two.isVisited){\n\t\t\t\t\t * System.out.println(\"cycle present\"); flagUndirected=true; return\n\t\t\t\t\t * flagUndirected; }\n\t\t\t\t\t */\n\n\t\t\t\t\tif (simpleVertex.parent != null && node.two.Vertexname == simpleVertex.parent.Vertexname)\n\t\t\t\t\t\tSystem.out.println(\"skip\");\n\t\t\t\t\telse if (node.two.isVisited == true) {\n\t\t\t\t\t\tSystem.out.println(\"Graph contains a cycle\");\n\t\t\t\t\t\tflagUndirected = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisCycleUndirected(node.two, simpleVertex);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\treturn flagUndirected;\n\n\t}", "@Test\n void findCycle() {\n Map<String, Set<String>> nonCyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\")\n );\n assertThat(solution.findCycle(nonCyclicGraph)).isFalse();\n\n // 0\n // / | \\\n // a b c\n // /\\ | /\n // a2 a3 b2\n Map<String, Set<String>> cyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\", \"b2\")\n );\n assertThat(solution.findCycle(cyclicGraph)).isTrue();\n }", "public boolean hasCycle() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\t\tSet<Vertex> path = new HashSet<Vertex>();\r\n\r\n\t\t// Call the helper function to detect cycle for all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (detectCycle(this.vertices[i], visited, path))\r\n\t\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "private boolean hasNoCycle(int node, int[] color, int[][] graph) {\n if (color[node] > 0)\n return color[node] == 2;\n\n color[node] = 1;\n for (int nei : graph[node]) {\n if (color[nei] == 2)\n continue;\n if (color[nei] == 1 || !hasNoCycle(nei, color, graph))\n return false;\n }\n\n color[node] = 2;\n return true;\n }", "boolean cycle() {\n int j;\t\t\t\t\t\t// If cycle detected report as negative edge weight cycle.\n for (j = 0; j < e; ++j)\n if (d[edges.get(j).u] + edges.get(j).w < d[edges.get(j).v])\n return false;\n return true;\n }", "public static Boolean isCyclic(Graph g) {\n\n for (Vertex v : g) {\n v.seen = false;\n v.parent = null;\n }\n // Running a DFS to check for cycle\n for (Vertex v : g) {\n if (!v.seen) {\n if (isCyclicUtil(v, v.parent)) {\n return true;\n }\n }\n }\n return false;\n\n }", "private boolean isAcyclic() {\n boolean visited[] = new boolean[getNumNodes()];\n boolean noCycle = true;\n int list[] = new int[getNumNodes() + 1];\n int index = 0;\n int lastIndex = 1;\n list[0] = randomParent;\n visited[randomParent] = true;\n while (index < lastIndex && noCycle) {\n int currentNode = list[index];\n int i = 1;\n\n // verify parents of current node\n while ((i < parentMatrix[currentNode][0]) && noCycle) {\n if (!visited[parentMatrix[currentNode][i]]) {\n if (parentMatrix[currentNode][i] != randomChild) {\n list[lastIndex] = parentMatrix[currentNode][i];\n lastIndex++;\n }\n else {\n noCycle = false;\n }\n visited[parentMatrix[currentNode][i]] = true;\n } // end of if(visited)\n i++;\n }\n index++;\n }\n //System.out.println(\"\\tnoCycle:\"+noCycle);\n return noCycle;\n }", "@Test public void testPublic13() {\n Graph<Integer> graph= TestGraphs.testGraph4();\n int i;\n\n for (i= 0; i < 4; i++)\n assertTrue(graph.isInCycle(i));\n\n assertFalse(graph.isInCycle(4));\n }", "private static boolean isCyclic(Node<Integer> graph) {\r\n\t\tif (graph == null || graph.adjNodes.size() == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tStack<Node<Integer>> recursiveStack = new Stack<Node<Integer>>();\r\n\t\trecursiveStack.add(graph);\r\n\t\tgraph.isVisited = true;\r\n\r\n\t\twhile (!recursiveStack.isEmpty()) {\r\n\t\t\tNode<Integer> temp = recursiveStack.pop();\r\n\r\n\t\t\tfor (int i = 0; i < temp.adjNodes.size(); i++) {\r\n\t\t\t\tif (temp.adjNodes.get(i).isVisited) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trecursiveStack.push(temp.adjNodes.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static boolean checkEulerCicleGraph() {// es cycle o es tour\r\n\t\tfor (int i = 0; i < V; i++) {\r\n\t\t\tif (outdeg[i] % 2 == 1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean checkCycle() {\n for (int i = 0; i < 26; i++) {\n color[i] = 0;\n }\n for (int i = 0; i < 26; i++) {\n if (color[i] != -1 && BFS(i)) return true;\n }\n return false;\n }", "public static <V> boolean isGraphAcyclic(Graph<V> graph) {\n V[] arrayValores = graph.getValuesAsArray();\n if (arrayValores.length > 1) { // Un grafo con solo un vertice no puede tener ciclos.\n Set<V> conjuntoRevisados = new LinkedListSet<>();\n return profPrimeroCiclos(graph, arrayValores[0], null, conjuntoRevisados);\n }\n return false;\n }", "private Boolean checkCycle() {\n Node slow = this;\n Node fast = this;\n while (fast.nextNode != null && fast.nextNode.nextNode != null) {\n fast = fast.nextNode.nextNode;\n slow = slow.nextNode;\n if (fast == slow) {\n System.out.println(\"contains cycle\");\n return true;\n }\n }\n System.out.println(\"non-cycle\");\n return false;\n }", "public void DFS2() {\n boolean[] visited = new boolean[numVertices];\n int[] predecessors = new int[numVertices];\n for (int i = 0; i < numVertices; i++) {\n if (visited[i] == false && hasCycle(0, visited, predecessors)) {\n System.out.println(\"Cycle has found\");\n return;\n }\n }\n System.out.println(\"No cycle found in the graph\");\n }", "public boolean isCycle(int V, ArrayList<ArrayList<Integer>> adj)\n {\n boolean visited[] = new boolean[V];\n Arrays.fill(visited, false);\n \n for(int i = 0;i<V;i++)\n {\n if(!visited[i] && isCyclicU(i, V, visited, adj))\n return true;\n }\n \n return false;\n \n }", "public final boolean isAcyclic() {\n return this.topologicalSort().size() == this.sizeNodes();\n }", "private List<V> getNewVertexOrderIfAcyclic () {\n Map<V, Integer> indegree = inDegree();\n // Determine all vertices with zero in-degree\n Stack<V> zeroIncomingVertex = new Stack<V>(); \n for (V v: indegree.keySet()) {\n if (indegree.get(v) == 0) zeroIncomingVertex.push(v);\n }\n \n // Determine the vertex order\n List<V> result = new ArrayList<V>();\n while (!zeroIncomingVertex.isEmpty()) {\n V v = zeroIncomingVertex.pop(); // Choose a vertex with zero in-degree\n result.add(v); // Vertex v is next in vertex ordering\n // \"Remove\" vertex v by updating its neighbors\n for (V neighbor: dag.get(v)) {\n indegree.put(neighbor, indegree.get(neighbor) - 1);\n // Remember any vertices that now have zero in-degree\n if (indegree.get(neighbor) == 0) zeroIncomingVertex.push(neighbor);\n }\n }\n // Check that we have used the entire graph. If not then there was a cycle.\n if (result.size() != dag.size()) return null;\n return result;\n }", "public static boolean cycleInGraph(int[][] edges) {\n int numberOfNodes = edges.length;\n int[] colors = new int[numberOfNodes]; // By default, 0 (WHITE)\n\n for (int i = 0; i < numberOfNodes; i++) {\n\n if (colors[i] != WHITE) // If already visited/finished.\n continue;\n\n boolean isCycle = traverseAndMarkColor(edges, i, colors);\n\n if (isCycle)\n return true;\n }\n return false;\n }", "boolean isCyclic() {\n\n // if we are processing the course currently that is a cyclic graph and we can't\n // do all the courses\n if (processed) {\n return false;\n }\n\n // if we already visited the course and no cycle was found then we can return\n if (visited) {\n return true;\n }\n //else we set the course and visited\n visited = true;\n\n //we then loop through all the prerequisites performing the same check\n for (Course preCourse : pre) {\n if (preCourse.isCyclic()) {\n return true;\n }\n }\n\n //if we arrive here then we have gone through all the combinations and there is no cyclic graph\n visited = false;\n processed = true;\n return false;\n }", "public void removeGraphCycles() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tint[] cycleCount = new int[map.size()];\r\n\t\tforComplexMotion = new boolean[map.size()];\r\n\t\t//count cycles\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(i != j) {\r\n\t\t\t\t\tif(graph[i][j] && graph[j][i]) {\r\n\t\t\t\t\t\tcycleCount[i]++;\r\n\t\t\t\t\t\tcycleCount[j]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//remove fobjects from linear motion planning\r\n\t\tboolean hasCycles = true;\r\n\t\twhile(hasCycles) {\r\n\t\t\tint max = 0;\r\n\t\t\tint maxIndex = -1;\r\n\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\tif(cycleCount[i] > max) {\r\n\t\t\t\t\tmax = cycleCount[i];\r\n\t\t\t\t\tmaxIndex = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(maxIndex == -1) {\r\n\t\t\t\thasCycles = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcycleCount[maxIndex] = 0;\r\n\t\t\t\tforComplexMotion[maxIndex] = true;\r\n\t\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\t\tgraph[maxIndex][i] = false;\r\n\t\t\t\t\tgraph[i][maxIndex] = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public List<Integer> eventualSafeNodes(int[][] graph) {\n boolean[] visited = new boolean[graph.length];\n boolean[] onStack = new boolean[graph.length];\n boolean[] onCycle = new boolean[graph.length];\n\n for (int i = 0; i < graph.length; i++) {\n if (!visited[i]) {\n if (hasCycle(i, graph, visited, onStack, onCycle)) {\n onCycle[i] = true;\n }\n }\n // System.out.println(i+ \"-->\"+Arrays.toString(onCycle));\n }\n\n List<Integer> res = new ArrayList<>(visited.length);\n for (int i = 0; i < onCycle.length; i++) {\n if (!onCycle[i]) {\n res.add(i);\n }\n }\n return res;\n }", "boolean isCycle(SimpleVertex simpleVertex, int length) {\n\n\t\twhile (count != length) {\n\t\t\tif (simpleVertex.isVisited == false) {\n\t\t\t\tsimpleVertex.isVisited = true;\n\t\t\t\tcount++;\n\t\t\t\tSystem.out.print(simpleVertex.Vertexname + \" \");\n\t\t\t\tfor (int i = 0; i < simpleVertex.neighborhood.size(); i++) {\n\n\t\t\t\t\tSimpleEdge node = simpleVertex.neighborhood.get(i);\n\t\t\t\t\tif (node.one.Vertexname == node.two.Vertexname) {\n\n\t\t\t\t\t\tSystem.out.println(\"here ---------------\");\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tisCycle(node.two, length);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\n\t}", "@SuppressWarnings(\"unchecked\")\r\n private static void cycleTests() throws CALExecutorException {\r\n \r\n final ImmutableDirectedGraph<Integer> noCycles = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 3), Pair.make(1, 3)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthOneCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 1)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthTwoCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 1)),\r\n executionContext);\r\n \r\n System.out.println(\"noCycle.findCycle(): \" + noCycles.findCycle());\r\n System.out.println(\"oneCycle.findCycle(): \" + lengthOneCycle.findCycle());\r\n System.out.println(\"twoCycle.findCycle(): \" + lengthTwoCycle.findCycle());\r\n }", "public interface CycleInGraph<V> {\n boolean hasCycle(Graph<V> graph) ;\n}", "public DirectedCycle(Digraph G) {\n onStack = new boolean[G.V()];\n marked = new boolean[G.V()];\n edgeTo = new int[G.V()];\n\n //Cycle through each vertex to see if it is in a cycle\n for (int v = 0; v < G.V(); v++) {\n if (marked[v] == false) {\n dfs(G, v);\n }\n }\n }", "public boolean IsCyclic() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public boolean hasCycle(int nodeIndex, int[][] graph, boolean[] visited, boolean[] onStack,\n boolean[] onCycle) {\n\n if (onCycle[nodeIndex]) {\n return true;\n }\n visited[nodeIndex] = true;\n onStack[nodeIndex] = true;\n boolean cycle = false;\n for (int neighbor : graph[nodeIndex]) {\n if (onCycle[neighbor]) {\n cycle = true;\n continue;\n }\n if (!visited[neighbor]) {\n if (hasCycle(neighbor, graph, visited, onStack, onCycle)) {\n onCycle[neighbor] = true;\n cycle = true;\n }\n } else {\n if (onStack[neighbor]) {\n onCycle[neighbor] = true;\n cycle = true;\n }\n }\n }\n onStack[nodeIndex] = false;\n return cycle;\n }", "private boolean hasCycle() {\n\t\tNode n = head;\n\t\tSet<Node> nodeSeen = new HashSet<>();\n\t\twhile (nodeSeen != null) {\n\t\t\tif (nodeSeen.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tnodeSeen.add(n);\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "public List<Integer> eventualSafeNodes(int[][] graph) {\n int N = graph.length;\n int[] color = new int[N];\n List<Integer> ans = new ArrayList<>();\n\n for (int i = 0; i < N; i++) {\n if (hasNoCycle(i, color, graph))\n ans.add(i);\n }\n\n return ans;\n }", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_CycleDetectedInUpstreamNodes() {\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n ValueStreamMap graph = new ValueStreamMap(b, null);\n graph.addUpstreamNode(new PipelineDependencyNode(a, a), null, b);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\"), null, a, new MaterialRevision(null));\n graph.addDownstreamNode(new PipelineDependencyNode(a, a), b);\n graph.addDownstreamNode(new PipelineDependencyNode(c, c), a);\n\n assertThat(graph.hasCycle(), is(true));\n }", "public boolean hasCycle(int g) {\n\t\t//TODO\n\t}", "public boolean isCyclic(int V, ArrayList<ArrayList<Integer>> adj)\n {\n // code here\n // System.out.println(V);\n // System.out.println(adj.toString());\n boolean visit[] = new boolean[V];\n boolean recstack[] = new boolean[V];\n for(int i = 0; i < V; i++){\n if(dfs(i, visit, recstack, adj)){\n return true;\n }\n }\n return false;\n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_DownstreamOfCurrentWasUpstreamOfCurrentAtSomePoint() {\n String grandParent = \"grandParent\";\n String parent = \"parent\";\n String child = \"child\";\n String currentPipeline = \"current\";\n ValueStreamMap graph = new ValueStreamMap(currentPipeline, null);\n graph.addDownstreamNode(new PipelineDependencyNode(child, child), currentPipeline);\n graph.addDownstreamNode(new PipelineDependencyNode(grandParent, grandParent), child);\n graph.addUpstreamNode(new PipelineDependencyNode(parent, parent), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(grandParent, grandParent), null, parent);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, grandParent, new MaterialRevision(null));\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, parent, new MaterialRevision(null));\n\n assertThat(graph.hasCycle(), is(true));\n }", "public boolean detectCyclesContainingVertex(V v)\n {\n try {\n execute(null, v);\n } catch (CycleDetectedException ex) {\n return true;\n }\n\n return false;\n }", "public static void MakeDirectedNoCycle(graphUndir G) {\r\n\r\n\t\tfor (int i = 0; i < G.Adj.size(); i++) {\r\n\t\t\tG.Adj.elementAt(i).color = \"grey\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\t\t\tfor (int j = 0; j < G.Adj.elementAt(i).next.size(); j++) {\r\n\t\t\t\tif (G.Adj.elementAt(i).next.elementAt(j).color == \"white\") {\r\n\t\t\t\t\tG.Adj.elementAt(i).next.elementAt(j).color = \"grey\";\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).next.elementAt(j).color);\r\n\t\t\t\t} else if (G.Adj.elementAt(i).next.elementAt(j).color == \"black\") {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is rempved from \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).name);\r\n\t\t\t\t\tG.Adj.elementAt(i).next.remove(j);\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tG.Adj.elementAt(i).color = \"black\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\r\n\t\t}\r\n\r\n\t}", "private void awayFromColliderAncestorCycle(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node B : nodes) {\n List<Node> adj = graph.getAdjacentNodes(B);\n\n if (adj.size() < 2) {\n continue;\n }\n\n ChoiceGenerator cg = new ChoiceGenerator(adj.size(), 2);\n int[] combination;\n\n while ((combination = cg.next()) != null) {\n Node A = adj.get(combination[0]);\n Node C = adj.get(combination[1]);\n\n //choice gen doesnt do diff orders, so must switch A & C around.\n// awayFromCollider(graph, A, B, C);\n// awayFromCollider(graph, C, B, A);\n// awayFromAncestor(graph, A, B, C);\n// awayFromAncestor(graph, C, B, A);\n// awayFromCycle(graph, A, B, C);\n// awayFromCycle(graph, C, B, A);\n ruleR1(A, B, C, graph);\n ruleR1(C, B, A, graph);\n ruleR2(A, B, C, graph);\n ruleR2(C, B, A, graph);\n\n }\n }\n }", "@Test\n public void cyclicalGraphs1Test() throws Exception {\n // NOTE: we can't use the parser to create a circular graph because\n // vector clocks are partially ordered and do not admit cycles. So we\n // have to create circular graphs manually.\n ChainsTraceGraph g1 = new ChainsTraceGraph();\n List<EventNode> g1Nodes = addNodesToGraph(g1, new String[] { \"a\", \"a\",\n \"a\" });\n // Create a loop in g1, with 3 nodes\n g1Nodes.get(0).addTransition(g1Nodes.get(1), Event.defTimeRelationStr);\n g1Nodes.get(1).addTransition(g1Nodes.get(2), Event.defTimeRelationStr);\n g1Nodes.get(2).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g1, 0);\n\n ChainsTraceGraph g2 = new ChainsTraceGraph();\n List<EventNode> g2Nodes = addNodesToGraph(g2, new String[] { \"a\", \"a\" });\n // Create a loop in g2, with 2 nodes\n g2Nodes.get(0).addTransition(g2Nodes.get(1), Event.defTimeRelationStr);\n g2Nodes.get(1).addTransition(g2Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g2, 1);\n\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 3);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 4);\n\n ChainsTraceGraph g3 = new ChainsTraceGraph();\n List<EventNode> g3Nodes = addNodesToGraph(g2, new String[] { \"a\" });\n // Create a loop in g3, from a to itself\n g3Nodes.get(0).addTransition(g3Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g3, 2);\n\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 3);\n\n ChainsTraceGraph g4 = new ChainsTraceGraph();\n List<EventNode> g4Nodes = addNodesToGraph(g2, new String[] { \"a\" });\n exportTestGraph(g4, 2);\n\n testKEqual(g4Nodes.get(0), g2Nodes.get(0), 1);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 2);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 3);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 4);\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public static boolean isDeadlocked(List<Vertex> graph) {\n for (Vertex vertex : graph) {\n if (vertex.state == State.UNVISITED && hasCycle(vertex)) {\n return true;\n }\n }\n return false;\n }", "private void treatCycles(SDFGraph graph) throws InvalidExpressionException {\r\n\t\tList<Set<SDFAbstractVertex>> cycles = new ArrayList<Set<SDFAbstractVertex>>();\r\n\t\tCycleDetector<SDFAbstractVertex, SDFEdge> detector = new CycleDetector<SDFAbstractVertex, SDFEdge>(\r\n\t\t\t\tgraph);\r\n\t\tList<SDFAbstractVertex> vertices = new ArrayList<SDFAbstractVertex>(\r\n\t\t\t\tgraph.vertexSet());\r\n\t\twhile (vertices.size() > 0) {\r\n\t\t\tSDFAbstractVertex vertex = vertices.get(0);\r\n\t\t\tSet<SDFAbstractVertex> cycle = detector\r\n\t\t\t\t\t.findCyclesContainingVertex(vertex);\r\n\t\t\tif (cycle.size() > 0) {\r\n\t\t\t\tvertices.removeAll(cycle);\r\n\t\t\t\tcycles.add(cycle);\r\n\t\t\t}\r\n\t\t\tvertices.remove(vertex);\r\n\t\t}\r\n\r\n\t\tfor (Set<SDFAbstractVertex> cycle : cycles) {\r\n\t\t\tint gcd = gcdOfVerticesVrb(cycle);\r\n\t\t\tif (gcd > 1 && !(graph instanceof PSDFGraph)) {\r\n\t\t\t\tcopyCycle(graph, cycle, gcd);\r\n\t\t\t} else if (!(graph instanceof PSDFGraph)) {\r\n\t\t\t\ttreatPSDFCycles(graph, cycle);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// SDFIterator sdfIterator = new SDFIterator(graph);\r\n\t\t// List<SDFAbstractVertex> orderedList = new\r\n\t\t// ArrayList<SDFAbstractVertex>();\r\n\t\t// while (sdfIterator.hasNext()) {\r\n\t\t// SDFAbstractVertex current = sdfIterator.next();\r\n\t\t// orderedList.add(current);\r\n\t\t// if (current instanceof SDFRoundBufferVertex) {\r\n\t\t// int nbTokens = 0;\r\n\t\t// for (SDFEdge edgeData : graph.outgoingEdgesOf(current)) {\r\n\t\t// nbTokens = edgeData.getProd().intValue();\r\n\t\t// }\r\n\t\t// for (int i = orderedList.size() - 1; i >= 0; i--) {\r\n\t\t// if (graph.getAllEdges(orderedList.get(i), current).size() == 1) {\r\n\t\t// if (nbTokens <= 0) {\r\n\t\t// graph.removeAllEdges(orderedList.get(i), current);\r\n\t\t// } else {\r\n\t\t// for (SDFEdge thisEdge : graph.getAllEdges(\r\n\t\t// orderedList.get(i), current)) {\r\n\t\t// nbTokens = nbTokens\r\n\t\t// - thisEdge.getProd().intValue();\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t// // traiter le roundBuffer pour le supprimer\r\n\t\t// if (graph.incomingEdgesOf(current).size() == 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() == 1) {\r\n\t\t// SDFAbstractVertex source = ((SDFEdge) graph\r\n\t\t// .incomingEdgesOf(current).toArray()[0]).getSource();\r\n\t\t// SDFEdge oldEdge = ((SDFEdge) graph.incomingEdgesOf(current)\r\n\t\t// .toArray()[0]);\r\n\t\t// SDFAbstractVertex target = ((SDFEdge) graph\r\n\t\t// .outgoingEdgesOf(current).toArray()[0]).getTarget();\r\n\t\t// SDFEdge refEdge = ((SDFEdge) graph.outgoingEdgesOf(current)\r\n\t\t// .toArray()[0]);\r\n\t\t// SDFEdge newEdge = graph.addEdge(source, target);\r\n\t\t// newEdge.copyProperties(refEdge);\r\n\t\t// graph.removeEdge(refEdge);\r\n\t\t// graph.removeEdge(oldEdge);\r\n\t\t// graph.removeVertex(current);\r\n\t\t// orderedList.remove(current);\r\n\t\t// } else if (graph.incomingEdgesOf(current).size() == 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() > 1) {\r\n\t\t//\r\n\t\t// } else if (graph.incomingEdgesOf(current).size() > 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() == 1) {\r\n\t\t//\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t/*\r\n\t\t * { CycleDetector<SDFAbstractVertex, SDFEdge> detect = new\r\n\t\t * CycleDetector<SDFAbstractVertex, SDFEdge>( graph);\r\n\t\t * List<SDFAbstractVertex> vert = new ArrayList<SDFAbstractVertex>(\r\n\t\t * graph.vertexSet()); while (vert.size() > 0) { SDFAbstractVertex\r\n\t\t * vertex = vert.get(0); Set<SDFAbstractVertex> cycle = detect\r\n\t\t * .findCyclesContainingVertex(vertex); if (cycle.size() > 0) {\r\n\t\t * vert.removeAll(cycle); cycles.add(cycle); } vert.remove(vertex); } }\r\n\t\t */\r\n\r\n\t\treturn;\r\n\t}", "private boolean discrimPaths(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node b : nodes) {\n\n //potential A and C candidate pairs are only those\n // that look like this: A<-oBo->C or A<->Bo->C\n List<Node> possAandC = graph.getNodesOutTo(b, Endpoint.ARROW);\n\n //keep arrows and circles\n List<Node> possA = new LinkedList<>(possAandC);\n possA.removeAll(graph.getNodesInTo(b, Endpoint.TAIL));\n\n //keep only circles\n List<Node> possC = new LinkedList<>(possAandC);\n possC.retainAll(graph.getNodesInTo(b, Endpoint.CIRCLE));\n\n for (Node a : possA) {\n for (Node c : possC) {\n if (!graph.isParentOf(a, c)) {\n continue;\n }\n\n LinkedList<Node> reachable = new LinkedList<>();\n reachable.add(a);\n if (reachablePathFindOrient(graph, a, b, c, reachable)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "private static boolean isAcyclic(int index, BitSet onStack, BitSet visited,\n\t\t\tAutomaton automaton) {\n\n\t\tif (onStack.get(index)) {\n\t\t\treturn false; // found a cycle!\n\t\t}\n\n\t\tif (visited.get(index)) {\n\t\t\t// Ok, we've traversed this node before and it checked out OK.\n\t\t\treturn true;\n\t\t}\n\n\t\tvisited.set(index);\n\t\tonStack.set(index);\n\n\t\tAutomaton.State state = automaton.get(index);\n\t\tif (state instanceof Automaton.Term) {\n\t\t\tAutomaton.Term term = (Automaton.Term) state;\n\t\t\tif (term.contents != Automaton.K_VOID) {\n\t\t\t\tif (!isAcyclic(term.contents, onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (state instanceof Automaton.Collection) {\n\t\t\tAutomaton.Collection compound = (Automaton.Collection) state;\n\t\t\tint[] children = compound.children;\n\t\t\tfor (int i = 0; i != compound.length; ++i) {\n\t\t\t\tif (!isAcyclic(children[i], onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tonStack.set(index, false);\n\n\t\treturn true;\n\t}", "void find_negative_cycle(){\n \t\n \tfor(int j = 0; j<E ; j++)\n\t\t{\n\t\t\trelax(edge[j].src, edge[j].destination, edge[j].weight);\n\t\t}\n \tfor(int i = 0; i<V ; i++)\n\t\t{\n \t\tif(x[i] != dist[i])\n\t\t\t{\n \t\t\tNegCycle = true;\n\t\t\t\tSystem.out.println(\"Negative Cycle Found \");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "boolean detectCycledirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tint[] ancestor = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, ancestor))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isCyclic() {\r\n\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\t\tArrayList<String> list = new ArrayList<>(vtces.keySet());\r\n\r\n\t\tfor (String key : list) {\r\n\t\t\tif (processed.containsKey(key))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t// Create a new pair\r\n\t\t\tPair npr = new Pair();\r\n\t\t\tnpr.vname = key;\r\n\t\t\tnpr.psf = key;\r\n\r\n\t\t\t// put pair queue\r\n\t\t\tqueue.addLast(npr);\r\n\r\n\t\t\t// Work while queue is not empty\r\n\t\t\twhile (!queue.isEmpty()) {\r\n\r\n\t\t\t\t// Remove a pair from queue\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\tif (processed.containsKey(rp.vname))\r\n\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t// Put in processed hashmap\r\n\t\t\t\tprocessed.put(rp.vname, True);\r\n\r\n\t\t\t\t// nbrs\r\n\t\t\t\tVertex rpvertex = vtces.get(rp.vname);\r\n\t\t\t\tArrayList<String> nbrs = new ArrayList<>(rpvertex.nbrs.keySet());\r\n\r\n\t\t\t\tfor (String nbr : nbrs) {\r\n\t\t\t\t\t// Process only unprocessed vertex\r\n\t\t\t\t\tif (!processed.containsKey(nbr)) {\r\n\t\t\t\t\t\t// Create a new pair and put in queue\r\n\t\t\t\t\t\tPair np = new Pair();\r\n\t\t\t\t\t\tnp.vname = nbr;\r\n\t\t\t\t\t\tnp.psf = rp.psf + nbr;\r\n\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean BFS(int i) {\n color[i] = 1;\n for (int j : alphabet.get(i)) {\n // Making sure we don't check one vertex twice\n if (color[j] != -1) {\n if (color[j] == 0) {\n if (BFS(j)) return true;\n }\n // Found visited vertex --> We found cycle\n if (color[j] == 1) {\n System.out.println(j);\n return true;\n }\n }\n }\n //Vertex checked\n color[i] = -1;\n return false;\n }", "public CycleDetector(Graph<V, E> graph)\n {\n this.graph = GraphTests.requireDirected(graph);\n }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Test\n public void shouldNotConsiderTriangleDependencyAsCyclic(){\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n String d = \"D\";\n ValueStreamMap valueStreamMap = new ValueStreamMap(c, null);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(a, a), null, c);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(b, b), null, c);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(d, d), null, b);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(a, a), null, d);\n valueStreamMap.addUpstreamMaterialNode(new SCMDependencyNode(\"g\", \"g\", \"git\"), null, a, new MaterialRevision(null));\n\n assertThat(valueStreamMap.hasCycle(), is(false));\n }", "public static void checkCycleSample() {\n Node ll1_5 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n\n Node ll1_2 = new Node(1, new Node(2, null));\n Node ll3_4 = new Node(3, new Node(4, null));\n Node ll5_6 = new Node(5, new Node(6, null));\n ll1_2.nextNode.nextNode = ll3_4;\n ll3_4.nextNode.nextNode = ll5_6;\n ll5_6.nextNode.nextNode = ll1_2;\n\n ll1_2.checkCycle();\n ll1_5.checkCycle();\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "private void awayFromCycle(Graph graph, Node a, Node b, Node c) {\n if ((graph.isAdjacentTo(a, c)) &&\n (graph.getEndpoint(a, c) == Endpoint.ARROW) &&\n (graph.getEndpoint(c, a) == Endpoint.CIRCLE)) {\n if (graph.isDirectedFromTo(a, b) && graph.isDirectedFromTo(b, c)) {\n graph.setEndpoint(c, a, Endpoint.TAIL);\n changeFlag = true;\n }\n }\n }", "static boolean isCorrectCycle(Vertex v, LinkedList<Vertex> cycle, int print) {\r\n\r\n boolean ret = true;\r\n\r\n if (print > 1)\r\n System.out.println(\"Checking cycle with vertex \" + v + \": \" + cycle);\r\n\r\n // check for invalid parameters\r\n if (v == null || cycle == null || cycle.isEmpty()) {\r\n if (print > 0)\r\n System.out.println(\"null or empty parameter, no check\");\r\n return false;\r\n }\r\n\r\n // check for too short cycles, 4 is minimum (v-x-y-v)\r\n if (cycle.size() < 4) {\r\n if (print > 0)\r\n System.out.println(\"too short cycle: \" + cycle.size());\r\n ret = false;\r\n }\r\n\r\n // check for correct first and last in cycle\r\n if (cycle.getFirst() != v) {\r\n if (print > 0)\r\n System.out.println(\"Wrong first vertex \" + cycle.getFirst());\r\n ret = false;\r\n }\r\n if (cycle.getLast() != v) {\r\n if (print > 0)\r\n System.out.println(\"Wrong last vertex \" + cycle.getLast());\r\n ret = false;\r\n }\r\n\r\n // extra: check if first and last are different (other than v)\r\n\r\n // check that all successive vertices in list are adjacent in graph\r\n\r\n ListIterator<Vertex> li = cycle.listIterator();\r\n Vertex prev = null;\r\n while (li.hasNext()) {\r\n Vertex w = li.next();\r\n if (prev != null && ! prev.isAdjacent(w)) {\r\n if (print > 0)\r\n System.out.println(\"No edge between \" + prev + \" and \" + w);\r\n ret = false;\r\n }\r\n // check that v is not in the middle of cycle\r\n if (prev != null && li.hasNext() && w == v) {\r\n if (print > 0)\r\n System.out.println(\"Required vertex \" + v + \" in the middle of cycle\");\r\n ret = false;\r\n }\r\n\r\n prev = w;\r\n } // while\r\n\r\n if (print > 1 && ret)\r\n System.out.println(\"Valid cycle\");\r\n\r\n return ret;\r\n\r\n }", "public static boolean hasCycle( IntNode head ) {\r\n\t\r\n\t\tfor( IntNode cursor = head; cursor != null; cursor = cursor.link ) {\r\n\t\t\t// otherwise should return false if the list is acyclic\r\n\t\t\tif( cursor.link == null )\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\t// should return true if it is cyclic\r\n\t\treturn true;\r\n\t\t\r\n\t}", "public boolean isDirected();", "public boolean isDirected();", "boolean isDirected();", "public Set<V> findCycles()\n {\n // ProbeIterator can't be used to handle this case,\n // so use StrongConnectivityAlgorithm instead.\n StrongConnectivityAlgorithm<V, E> inspector =\n new KosarajuStrongConnectivityInspector<>(graph);\n List<Set<V>> components = inspector.stronglyConnectedSets();\n\n // A vertex participates in a cycle if either of the following is\n // true: (a) it is in a component whose size is greater than 1\n // or (b) it is a self-loop\n\n Set<V> set = new LinkedHashSet<>();\n for (Set<V> component : components) {\n if (component.size() > 1) {\n // cycle\n set.addAll(component);\n } else {\n V v = component.iterator().next();\n if (graph.containsEdge(v, v)) {\n // self-loop\n set.add(v);\n }\n }\n }\n\n return set;\n }", "@Test\n public void cyclicalGraphs3Test() throws Exception {\n // Test graphs with multiple loops. g1 has two different loops, which\n // have to be correctly matched to g2 -- which is build in a different\n // order but is topologically identical to g1.\n\n ChainsTraceGraph g1 = new ChainsTraceGraph();\n List<EventNode> g1Nodes = addNodesToGraph(g1, new String[] { \"a\", \"b\",\n \"c\", \"d\", \"b\", \"c\" });\n\n // Create loop1 in g1, with the first 4 nodes.\n g1Nodes.get(0).addTransition(g1Nodes.get(1), Event.defTimeRelationStr);\n g1Nodes.get(1).addTransition(g1Nodes.get(2), Event.defTimeRelationStr);\n g1Nodes.get(2).addTransition(g1Nodes.get(3), Event.defTimeRelationStr);\n g1Nodes.get(3).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n\n // Create loop2 in g1, with the last 2 nodes, plus the initial node.\n g1Nodes.get(0).addTransition(g1Nodes.get(4), Event.defTimeRelationStr);\n g1Nodes.get(4).addTransition(g1Nodes.get(5), Event.defTimeRelationStr);\n g1Nodes.get(5).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n\n exportTestGraph(g1, 0);\n\n // //////////////////\n // Now create g2, by generating the two identical loops in the reverse\n // order.\n\n ChainsTraceGraph g2 = new ChainsTraceGraph();\n List<EventNode> g2Nodes = addNodesToGraph(g2, new String[] { \"a\", \"b\",\n \"c\", \"d\", \"b\", \"c\" });\n\n // Create loop2 in g2, with the last 2 nodes, plus the initial node.\n g2Nodes.get(0).addTransition(g2Nodes.get(4), Event.defTimeRelationStr);\n g2Nodes.get(4).addTransition(g2Nodes.get(5), Event.defTimeRelationStr);\n g2Nodes.get(5).addTransition(g2Nodes.get(0), Event.defTimeRelationStr);\n\n // Create loop1 in g2, with the first 4 nodes.\n g2Nodes.get(0).addTransition(g2Nodes.get(1), Event.defTimeRelationStr);\n g2Nodes.get(1).addTransition(g2Nodes.get(2), Event.defTimeRelationStr);\n g2Nodes.get(2).addTransition(g2Nodes.get(3), Event.defTimeRelationStr);\n g2Nodes.get(3).addTransition(g2Nodes.get(0), Event.defTimeRelationStr);\n\n exportTestGraph(g2, 1);\n\n // //////////////////\n // Now test that the two graphs are identical for all k starting at the\n // initial node.\n\n for (int k = 1; k < 7; k++) {\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), k);\n }\n }", "boolean hasIsVertexOf();", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "Cycle getOptimalCycle(Graph<L, T> graph);", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "@Test\n public void TestIfNoCycle() {\n final int NUMBER_OF_ELEMENTS = 100;\n TripleList<Integer> tripleList = new TripleList<>();\n for (int i = 0; i < NUMBER_OF_ELEMENTS; ++i) {\n tripleList.add(i);\n }\n /**\n * Created 2 TripleLists, first jumps every single element, another\n * every two elements, in out case every two elements means every\n * NextElement*\n */\n TripleList<Integer> tripleListEverySingleNode = tripleList;\n TripleList<Integer> tripleListEveryTwoNodes = tripleList.getNext();\n for (int i = 0; i < NUMBER_OF_ELEMENTS * NUMBER_OF_ELEMENTS; ++i) {\n Assert.assertNotSame(tripleListEverySingleNode, tripleListEveryTwoNodes);\n //JumpToNextElement(ref tripleListEverySingleNode);\n if (null == tripleListEveryTwoNodes.getNext()) {\n // if list has end means there are no cycles\n break;\n } else {\n tripleListEveryTwoNodes = tripleListEveryTwoNodes.getNext();\n }\n }\n }", "public static boolean isAllVertexConnected(ArrayList<Edge>[] graph)\n {\n int count = 0;\n int n = graph.length;\n boolean[] vis = new boolean[n];\n\n for(int v = 0; v < n; v++) {\n if(vis[v] == false) {\n count++;\n\n //if number of connected components is greater than 1 then graph is not connected\n if(count > 1) {\n return false;\n }\n gcc(graph, v, vis);\n }\n }\n return true;\n\n }", "private void awayFromAncestorCycle(Graph graph) {\n while (changeFlag) {\n changeFlag = false;\n List<Node> nodes = graph.getNodes();\n\n for (Node B : nodes) {\n List<Node> adj = graph.getAdjacentNodes(B);\n\n if (adj.size() < 2) {\n continue;\n }\n\n ChoiceGenerator cg = new ChoiceGenerator(adj.size(), 2);\n int[] combination;\n\n while ((combination = cg.next()) != null) {\n Node A = adj.get(combination[0]);\n Node C = adj.get(combination[1]);\n\n //choice gen doesnt do diff orders, so must switch A & C around.\n awayFromAncestor(graph, A, B, C);\n awayFromAncestor(graph, C, B, A);\n awayFromCycle(graph, A, B, C);\n awayFromCycle(graph, C, B, A);\n }\n }\n }\n changeFlag = true;\n }", "public boolean isCyclic(int[] parent) {\n\t\tfor (Edge edge : this.edgeList) {\n\t\t\tint v1 = edge.u;\n\t\t\tint v2 = edge.v;\n\n\t\t\t// leader dhundo\n\t\t\tint p1 = findParent(parent, v1);\n\t\t\tint p2 = findParent(parent, v2);\n\n\t\t\tif (p1 != p2) {\n\t\t\t\tunion(v1, v2, parent);\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "public boolean detect_cycle_directed_util(int v,boolean visited[], boolean curr_visited[]) {\n\t\t\n\t\tvisited[v]=true;\n\t\tcurr_visited[v]=true;\n\t\t\n\t\t\n\t\tfor(int neighbour:adj[v]) {\n\t\t\t\n\t\t\tif(curr_visited[neighbour]) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if(!visited[neighbour]&&detect_cycle_directed_util(neighbour,visited,curr_visited)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tcurr_visited[v]=false;\n\t\t\n\t\treturn false;\n\t\t\n\t}", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "private boolean hamiltonianCycleUtil(int path[], int pos) {\n /* exit condition: If all vertices are included in Hamiltonian Cycle */\n if (pos == V) {\n // And if there is an edge from the last included vertex to the first vertex\n return matrix[path[pos - 1]][path[0]] != 0;\n }\n\n // Try different vertices as a next candidate in Hamiltonian Cycle.\n // We don't try for 0 as we included 0 as starting point in in hamiltonianCycle()\n for (int v = 1; v < V; v++) {\n /* Check if this vertex can be added to Hamiltonian Cycle */\n if (isFeasible(v, path, pos)) {\n path[pos] = v;\n\n /* recur to construct rest of the path */\n if (hamiltonianCycleUtil(path, pos + 1))\n return true;\n\n /* If adding vertex v doesn't lead to a solution,\n then remove it, backtracking */\n path[pos] = -1;\n }\n }\n\n /* If no vertex can be added to Hamiltonian Cycle constructed so far, then return false */\n return false;\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "static void graphCheck(int u) {\n\t\tdfs_num[u] = DFS_GRAY; // color this as DFS_GRAY (temp)\r\n\t\tfor (int j = 0; j < (int) AdjList[u].size(); j++) {\r\n\t\t\tEdge v = AdjList[u].get(j);\r\n\t\t\tif (dfs_num[v.to] == DFS_WHITE) { // Tree Edge, DFS_GRAY to\r\n\t\t\t\t\t\t\t\t\t\t\t\t// DFS_WHITE\r\n\t\t\t\tdfs_parent[v.to] = u; // parent of this children is me\r\n\t\t\t\tgraphCheck(v.to);\r\n\t\t\t} else if (dfs_num[v.to] == DFS_GRAY) { // DFS_GRAY to DFS_GRAY\r\n\t\t\t\tif (v.to == dfs_parent[u]) // to differentiate these two\r\n\t\t\t\t\t\t\t\t\t\t\t// cases\r\n\t\t\t\t\tSystem.out.printf(\" Bidirectional (%d, %d) - (%d, %d)\\n\",\r\n\t\t\t\t\t\t\tu, v.to, v.to, u);\r\n\t\t\t\telse\r\n\t\t\t\t\t// la mas usada pillar si tiene un ciclo\r\n\t\t\t\t\tSystem.out.printf(\" Back Edge (%d, %d) (Cycle)\\n\", u, v.to);\r\n\t\t\t} else if (dfs_num[v.to] == DFS_BLACK) // DFS_GRAY to DFS_BLACK\r\n\t\t\t\tSystem.out.printf(\" Forward/Cross Edge (%d, %d)\\n\", u, v.to);\r\n\t\t}\r\n\t\tdfs_num[u] = DFS_BLACK; // despues de la recursion DFS_BLACK (DONE)\r\n\t}", "public boolean checkCyclesRecursive(Integer blockID, LinkedList<Integer> visited){\n System.out.println(\"cc: (block \" + blockID + \") visited: \" + visited);\n if(visited.contains(blockID)){\n return false;\n }\n visited.add(blockID);\n\n /*for (Con connection : this.connections) {\n if(connection.src == blockID){\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(connection.dst, new_visited) == false){\n return false;\n }\n }\n }*/\n\n for(Type output : this.getBlockByID(blockID).outputs)\n {\n /*if(output.getFirstDstID() != -1) {\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(output.getFirstDstID(), new_visited) == false){\n return false;\n }\n }*/\n for (Integer id : output.getAllDstID()) {\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(id, new_visited) == false){\n return false;\n } \n }\n }\n return true;\n }", "public boolean isBipartiteUndirectedGraph (){\r\n int[] vertices = new int[getNumV()];\r\n for (int i = 0; i < getNumV(); ++i)\r\n vertices[i] = -1;\r\n\r\n vertices[0] = 1;\r\n\r\n Stack <Integer> q = new Stack<Integer>();\r\n q.push(0);\r\n\r\n while (!q.isEmpty()) {\r\n int current = q.pop();\r\n Iterator<Edge> iter = edgeIterator(current);\r\n while (iter.hasNext()) {\r\n Edge edge = iter.next();\r\n int neighbor = edge.getDest();\r\n if (vertices[neighbor] == -1) {\r\n vertices[neighbor] = 1 - vertices[current];\r\n q.push(neighbor);\r\n }\r\n else if (vertices[neighbor] == vertices[current])\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private void clearVisited(){\r\n\t\tfor(int i=0; i<graphSize; i++){\r\n\t\t\tmyGraph[i].visited = false;\r\n\t\t\tAdjVertex vert = myGraph[i].adjVertexHead;\r\n\t\t\twhile(vert != null){\r\n\t\t\t\tvert.visited = false;\r\n\t\t\t\tvert= vert.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void cyclicalGraphs2Test() throws Exception {\n // Test history tracking -- the \"last a\" in g1 and g2 below and\n // different kinds of nodes topologically. At k=4 this becomes apparent\n // with kTails, if we start at the first 'a'.\n\n ChainsTraceGraph g1 = new ChainsTraceGraph();\n List<EventNode> g1Nodes = addNodesToGraph(g1, new String[] { \"a\", \"b\",\n \"c\", \"d\" });\n // Create a loop in g1, with 4 nodes\n g1Nodes.get(0).addTransition(g1Nodes.get(1), Event.defTimeRelationStr);\n g1Nodes.get(1).addTransition(g1Nodes.get(2), Event.defTimeRelationStr);\n g1Nodes.get(2).addTransition(g1Nodes.get(3), Event.defTimeRelationStr);\n g1Nodes.get(3).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g1, 0);\n\n // g1.a is k-equivalent to g1.a for all k\n for (int k = 1; k < 6; k++) {\n testKEqual(g1Nodes.get(0), g1Nodes.get(0), k);\n }\n\n ChainsTraceGraph g2 = new ChainsTraceGraph();\n List<EventNode> g2Nodes = addNodesToGraph(g2, new String[] { \"a\", \"b\",\n \"c\", \"d\", \"a\" });\n // Create a chain from a to a'.\n g2Nodes.get(0).addTransition(g2Nodes.get(1), Event.defTimeRelationStr);\n g2Nodes.get(1).addTransition(g2Nodes.get(2), Event.defTimeRelationStr);\n g2Nodes.get(2).addTransition(g2Nodes.get(3), Event.defTimeRelationStr);\n g2Nodes.get(3).addTransition(g2Nodes.get(4), Event.defTimeRelationStr);\n exportTestGraph(g2, 1);\n\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 3);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 4);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 5);\n\n testNotKEqual(g1Nodes.get(0), g2Nodes.get(0), 6);\n testNotKEqual(g1Nodes.get(0), g2Nodes.get(0), 7);\n }", "private static boolean findCyclesInSCC(\n ARGState pStartState,\n ARGState pCurrentState,\n Set<ARGState> pBlockedSet,\n SetMultimap<ARGState, ARGState> pBlockedMap,\n Deque<ARGState> pStack,\n List<List<ARGState>> pAllCycles,\n Set<ARGState> pExcludeSet) {\n\n if (pExcludeSet.contains(pCurrentState)) {\n // Do not regard nodes which were deliberately put into a set of excluded states\n return false;\n }\n\n boolean foundCycle = false;\n pStack.push(pCurrentState);\n pBlockedSet.add(pCurrentState);\n\n for (ARGState successor : pCurrentState.getChildren()) {\n // If the successor is equal to the startState, a cycle has been found.\n // Store contents of stack in the final result.\n if (successor.equals(pStartState)) {\n List<ARGState> cycle = new ArrayList<>();\n pStack.push(pStartState);\n cycle.addAll(pStack);\n Collections.reverse(cycle);\n pStack.pop();\n pAllCycles.add(cycle);\n foundCycle = true;\n } else if (!pBlockedSet.contains(successor)) {\n // Explore this successor only if it is not already in the blocked set.\n boolean gotCycle =\n findCyclesInSCC(\n pStartState, successor, pBlockedSet, pBlockedMap, pStack, pAllCycles, pExcludeSet);\n foundCycle = foundCycle || gotCycle;\n }\n }\n\n if (foundCycle) {\n unblock(pCurrentState, pBlockedSet, pBlockedMap);\n } else {\n for (ARGState s : pCurrentState.getChildren()) {\n pBlockedMap.put(s, pCurrentState);\n }\n }\n pStack.pop();\n\n return foundCycle;\n }", "private boolean isCyclicUtil(String v, Set<String> visited, String parent) {\n\t\tvisited.add(v);\n\t\tSet<String> neighbors = this.neighbors.get(v);\n\t\tfor (String n: neighbors) {\n\t\t\tif (!visited.contains(n)) {\n\t\t\t\tif (isCyclicUtil(n, visited, v)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!n.equals(parent)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static <T> Set<List<T>> findSimpleCycles(Map<T, Set<T>> graph) {\n if (graph == null) {\n return null;\n }\n Set<List<T>> result = new HashSet<>();\n Set<T> vertices = new HashSet<>(graph.keySet());\n while (!graph.isEmpty()) {\n Set<Set<T>> components = findStronglyConnectedComponents(graph);\n Set<T> maxComponent = null;\n for (Set<T> component : components) {\n if (component.size() < 2) {\n if (isSelfCycle(graph, component)) {\n result.add(new ArrayList<>(component));\n }\n vertices.removeAll(component);\n } else if ((maxComponent == null) || (component.size() > maxComponent.size())) {\n maxComponent = component;\n }\n }\n if (maxComponent != null) {\n Map<T, Set<T>> subgraph = project(graph, maxComponent);\n T startVertex = maxComponent.iterator().next();\n result.addAll(findSimpleCycles(subgraph, startVertex));\n vertices.remove(startVertex);\n }\n graph = project(graph, vertices);\n }\n return result;\n }", "public void setNodesToUnvisited(){\n for(GraphNode node: graphNode){\n if(node.visited){\n node.visited = false;\n }\n }\n }", "public static boolean hasCycle(ListNode node) {\n\t\treturn true;\n\t}", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "public void dfs() {\n\t\tfor (Vertice v : vertices) {\n\t\t\tv.setVisited(false);\n\t\t}\n\t\tfor (Vertice v : vertices) {\n\t\t\tif (!v.getVisited()) {\n\t\t\t\tVisitar(v, -1);\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "boolean hasCycle() {\n if (head == null){\n return false;\n }\n Node slow = head;\n Node fast = head;\n while (slow != null && fast != null && fast.next != null){\n slow = slow.next;\n fast = fast.next.next;\n if (slow == fast){\n return true;\n }\n }\n return false;\n }", "@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }", "public static boolean Util(Graph<V, DefaultEdge> g, ArrayList<V> set, int colors, HashMap<String, Integer> coloring, int i, ArrayList<arc> arcs, Queue<arc> agenda)\n {\n /*if (i == set.size())\n {\n System.out.println(\"reached max size\");\n return true;\n }*/\n if (set.isEmpty())\n {\n System.out.println(\"Set empty\");\n return true;\n }\n //V currentVertex = set.get(i);\n\n /*System.out.println(\"vertices and mrv:\");\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n System.out.println(\"vertex \" + v.getID() + \" has mrv of \" + v.mrv);\n }*/\n\n // Find vertex with mrv\n V currentVertex;\n int index = -1;\n int mrv = colors + 10;\n for (int it = 0; it < set.size(); it++)\n {\n if (set.get(it).mrv < mrv)\n {\n mrv = set.get(it).mrv;\n index = it;\n }\n }\n currentVertex = set.remove(index);\n\n //System.out.println(\"Got vertex: \" + currentVertex.getID());\n\n\n // Try to assign that vertex a color\n for (int c = 0; c < colors; c++)\n {\n currentVertex.color = c;\n if (verifyColor(g, currentVertex))\n {\n\n // We can assign color c to vertex v\n // See if AC3 is satisfied\n /*currentVertex.domain.clear();\n currentVertex.domain.add(c);*/\n if (!agenda.isEmpty()) numAgenda++;\n while(!agenda.isEmpty())\n {\n arc temp = agenda.remove();\n\n // Make sure there exists v1, v2, in V1, V2, such that v1 != v2\n V v1 = g.vertexSet().stream().filter(V -> V.getID().equals(temp.x)).findAny().orElse(null);\n V v2 = g.vertexSet().stream().filter(V -> V.getID().equals(temp.y)).findAny().orElse(null);\n\n\n\n // No solution exists in this branch if a domain is empty\n //if ((v1.domain.isEmpty()) || (v2.domain.isEmpty())) return false;\n\n if (v2.color == -1) continue;\n else\n {\n Boolean[] toRemove = new Boolean[colors];\n Boolean domainChanged = false;\n for (Integer it : v1.domain)\n {\n if (it == v2.color)\n {\n toRemove[it] = true;\n }\n }\n for (int j = 0; j < toRemove.length; j++)\n {\n if ((toRemove[j] != null))\n {\n v1.domain.remove(j);\n domainChanged = true;\n }\n }\n // Need to check constraints with v1 on the right hand side\n if (domainChanged)\n {\n for (arc it : arcs)\n {\n // Add arc back to agenda to check constraints again\n if (it.y.equals(v1.getID()))\n {\n agenda.add(it);\n }\n }\n }\n }\n if ((v1.domain.isEmpty()) || (v2.domain.isEmpty()))\n {\n System.out.println(\"returning gfalse here\");\n return false;\n }\n }\n\n // Reset agenda to check arc consistency on next iteration\n for (int j = 0; j < arcs.size(); j++)\n {\n agenda.add(arcs.get(i));\n }\n\n\n //System.out.println(\"Checking if vertex \" + currentVertex.getID() + \" can be assigned color \" + c);\n coloring.put(currentVertex.getID(), c);\n updateMRV(g, currentVertex);\n if (Util(g, set, colors, coloring, i + 1, arcs, agenda))\n {\n\n return true;\n }\n\n //System.out.println(\"Assigning vertex \" + currentVertex.getID() + \" to color \" + currentVertex.color + \" did not work\");\n coloring.remove(currentVertex.getID());\n currentVertex.color = -1;\n }\n }\n return false;\n }", "protected static void checkForDisconnectedDataNodes(final EnactmentGraph graph) {\n for (final Task task : graph) {\n if (TaskPropertyService.isCommunication(task) && graph.getIncidentEdges(task).isEmpty()) {\n throw new IllegalStateException(\n \"The generated graph contains a disconnected data node: \" + task.getId());\n }\n }\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "private boolean cyclicUpdate() {\n if (cyclicUpdate_EM()) {\n mUpdate = 0;\n return true;\n }\n return false;\n }" ]
[ "0.7915997", "0.7672264", "0.7596332", "0.73785263", "0.72354794", "0.7227538", "0.7198124", "0.71275663", "0.71267813", "0.7093839", "0.7072945", "0.7050121", "0.70226735", "0.6994442", "0.6990098", "0.6945224", "0.6929477", "0.6903318", "0.6902124", "0.6887454", "0.6848836", "0.6784254", "0.67325234", "0.6718868", "0.6659509", "0.6613648", "0.66082484", "0.65569365", "0.65307754", "0.65256566", "0.65195155", "0.65096885", "0.6480269", "0.6475438", "0.6473448", "0.6470361", "0.64393705", "0.6406047", "0.63628244", "0.63611376", "0.6354501", "0.6351878", "0.63164395", "0.63150436", "0.6296911", "0.6296498", "0.6289925", "0.6275631", "0.6268436", "0.6253375", "0.62491924", "0.62480414", "0.6244265", "0.62338394", "0.6231618", "0.6226583", "0.6213678", "0.61819375", "0.6177947", "0.6176706", "0.6176706", "0.61675894", "0.61636543", "0.6154205", "0.6154089", "0.61398053", "0.61329955", "0.61260206", "0.6119377", "0.61182934", "0.6114753", "0.6094734", "0.60937107", "0.6091604", "0.60823107", "0.6076987", "0.606672", "0.6051879", "0.6023716", "0.6022064", "0.60019827", "0.5998631", "0.59763306", "0.5975995", "0.59647816", "0.59619987", "0.59561723", "0.59468156", "0.5942759", "0.59383744", "0.5935113", "0.5934606", "0.59074247", "0.5902419", "0.58994925", "0.5890994", "0.58873063", "0.58852553", "0.5879459", "0.5875359" ]
0.7368787
4
ensures that isInCycle() returns true for every vertex in a graph in which all vertices are in a cycle
@Test public void testPublic12() { Graph<Integer> graph= new Graph<Integer>(); int i; // note this adds the adjacent vertices in the process for (i= 0; i < 10; i++) graph.addEdge(i, i + 1, 1); graph.addEdge(10, 0, 1); for (Integer vertex : graph.getVertices()) assertTrue(graph.isInCycle(vertex)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasCycle() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\t\tSet<Vertex> path = new HashSet<Vertex>();\r\n\r\n\t\t// Call the helper function to detect cycle for all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (detectCycle(this.vertices[i], visited, path))\r\n\t\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "int isCycle( Graph graph){\n int parent[] = new int[graph.V]; \n \n // Initialize all subsets as single element sets \n for (int i=0; i<graph.V; ++i) \n parent[i]=-1; \n \n // Iterate through all edges of graph, find subset of both vertices of every edge, if both subsets are same, then there is cycle in graph. \n for (int i = 0; i < graph.E; ++i){ \n int x = graph.find(parent, graph.edge[i].src); \n int y = graph.find(parent, graph.edge[i].dest); \n \n if (x == y) \n return 1; \n \n graph.Union(parent, x, y); \n } \n return 0; \n }", "private static boolean isCycle(Graph graph) {\n for (int i = 0; i < graph.edges.length; ++i) {\n int x = graph.find(graph.edges[i][0]);\n int y = graph.find(graph.edges[i][1]);\n\n // if both subsets are same, then there is cycle in graph.\n if (x == y) {\n // for edge 2-0 : parent of 0 is 2 == 2 and so we detected a cycle\n return true;\n }\n // keep doing union/merge of sets\n graph.union(x, y);\n }\n return false;\n }", "boolean cycle() {\n int j;\t\t\t\t\t\t// If cycle detected report as negative edge weight cycle.\n for (j = 0; j < e; ++j)\n if (d[edges.get(j).u] + edges.get(j).w < d[edges.get(j).v])\n return false;\n return true;\n }", "public static boolean cycleInGraph(int[][] edges) {\n int numberOfNodes = edges.length;\n int[] colors = new int[numberOfNodes]; // By default, 0 (WHITE)\n\n for (int i = 0; i < numberOfNodes; i++) {\n\n if (colors[i] != WHITE) // If already visited/finished.\n continue;\n\n boolean isCycle = traverseAndMarkColor(edges, i, colors);\n\n if (isCycle)\n return true;\n }\n return false;\n }", "boolean detectCycleUndirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, -1))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isCycle(int V, ArrayList<ArrayList<Integer>> adj)\n {\n boolean visited[] = new boolean[V];\n Arrays.fill(visited, false);\n \n for(int i = 0;i<V;i++)\n {\n if(!visited[i] && isCyclicU(i, V, visited, adj))\n return true;\n }\n \n return false;\n \n }", "private Boolean checkCycle() {\n Node slow = this;\n Node fast = this;\n while (fast.nextNode != null && fast.nextNode.nextNode != null) {\n fast = fast.nextNode.nextNode;\n slow = slow.nextNode;\n if (fast == slow) {\n System.out.println(\"contains cycle\");\n return true;\n }\n }\n System.out.println(\"non-cycle\");\n return false;\n }", "boolean isCycle(SimpleVertex simpleVertex, int length) {\n\n\t\twhile (count != length) {\n\t\t\tif (simpleVertex.isVisited == false) {\n\t\t\t\tsimpleVertex.isVisited = true;\n\t\t\t\tcount++;\n\t\t\t\tSystem.out.print(simpleVertex.Vertexname + \" \");\n\t\t\t\tfor (int i = 0; i < simpleVertex.neighborhood.size(); i++) {\n\n\t\t\t\t\tSimpleEdge node = simpleVertex.neighborhood.get(i);\n\t\t\t\t\tif (node.one.Vertexname == node.two.Vertexname) {\n\n\t\t\t\t\t\tSystem.out.println(\"here ---------------\");\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tisCycle(node.two, length);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\n\t}", "private static boolean checkEulerCicleGraph() {// es cycle o es tour\r\n\t\tfor (int i = 0; i < V; i++) {\r\n\t\t\tif (outdeg[i] % 2 == 1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static <V> boolean isGraphAcyclic(Graph<V> graph) {\n V[] arrayValores = graph.getValuesAsArray();\n if (arrayValores.length > 1) { // Un grafo con solo un vertice no puede tener ciclos.\n Set<V> conjuntoRevisados = new LinkedListSet<>();\n return profPrimeroCiclos(graph, arrayValores[0], null, conjuntoRevisados);\n }\n return false;\n }", "@Test public void testPublic11() {\n Graph<Character> graph= TestGraphs.testGraph3();\n\n for (Character ch : graph.getVertices())\n assertFalse(graph.isInCycle(ch));\n }", "private boolean checkCycle() {\n for (int i = 0; i < 26; i++) {\n color[i] = 0;\n }\n for (int i = 0; i < 26; i++) {\n if (color[i] != -1 && BFS(i)) return true;\n }\n return false;\n }", "@Test\n void findCycle() {\n Map<String, Set<String>> nonCyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\")\n );\n assertThat(solution.findCycle(nonCyclicGraph)).isFalse();\n\n // 0\n // / | \\\n // a b c\n // /\\ | /\n // a2 a3 b2\n Map<String, Set<String>> cyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\", \"b2\")\n );\n assertThat(solution.findCycle(cyclicGraph)).isTrue();\n }", "boolean isCycleUndirected(SimpleVertex simpleVertex, SimpleVertex parent) {\n\t\tsimpleVertex.parent = parent;\n\n\t\twhile (true) {\n\t\t\tif (simpleVertex.isVisited == false) {\n\t\t\t\tsimpleVertex.isVisited = true;\n\t\t\t\tSystem.out.print(simpleVertex.Vertexname + \" \");\n\t\t\t\tfor (int i = 0; i < simpleVertex.neighborhood.size(); i++) {\n\n\t\t\t\t\tSimpleEdge node = simpleVertex.neighborhood.get(i);\n\t\t\t\t\tnode.EdgeVisited = true;\n\t\t\t\t\t/*\n\t\t\t\t\t * if(simpleVertex.isVisited==node.two.isVisited){\n\t\t\t\t\t * System.out.println(\"cycle present\"); flagUndirected=true; return\n\t\t\t\t\t * flagUndirected; }\n\t\t\t\t\t */\n\n\t\t\t\t\tif (simpleVertex.parent != null && node.two.Vertexname == simpleVertex.parent.Vertexname)\n\t\t\t\t\t\tSystem.out.println(\"skip\");\n\t\t\t\t\telse if (node.two.isVisited == true) {\n\t\t\t\t\t\tSystem.out.println(\"Graph contains a cycle\");\n\t\t\t\t\t\tflagUndirected = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisCycleUndirected(node.two, simpleVertex);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\treturn flagUndirected;\n\n\t}", "private static boolean isCyclic(Node<Integer> graph) {\r\n\t\tif (graph == null || graph.adjNodes.size() == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tStack<Node<Integer>> recursiveStack = new Stack<Node<Integer>>();\r\n\t\trecursiveStack.add(graph);\r\n\t\tgraph.isVisited = true;\r\n\r\n\t\twhile (!recursiveStack.isEmpty()) {\r\n\t\t\tNode<Integer> temp = recursiveStack.pop();\r\n\r\n\t\t\tfor (int i = 0; i < temp.adjNodes.size(); i++) {\r\n\t\t\t\tif (temp.adjNodes.get(i).isVisited) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trecursiveStack.push(temp.adjNodes.get(i));\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 detectCyclesContainingVertex(V v)\n {\n try {\n execute(null, v);\n } catch (CycleDetectedException ex) {\n return true;\n }\n\n return false;\n }", "public boolean hasCycle(int nodeIndex, int[][] graph, boolean[] visited, boolean[] onStack,\n boolean[] onCycle) {\n\n if (onCycle[nodeIndex]) {\n return true;\n }\n visited[nodeIndex] = true;\n onStack[nodeIndex] = true;\n boolean cycle = false;\n for (int neighbor : graph[nodeIndex]) {\n if (onCycle[neighbor]) {\n cycle = true;\n continue;\n }\n if (!visited[neighbor]) {\n if (hasCycle(neighbor, graph, visited, onStack, onCycle)) {\n onCycle[neighbor] = true;\n cycle = true;\n }\n } else {\n if (onStack[neighbor]) {\n onCycle[neighbor] = true;\n cycle = true;\n }\n }\n }\n onStack[nodeIndex] = false;\n return cycle;\n }", "public boolean IsCyclic() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public void DFS2() {\n boolean[] visited = new boolean[numVertices];\n int[] predecessors = new int[numVertices];\n for (int i = 0; i < numVertices; i++) {\n if (visited[i] == false && hasCycle(0, visited, predecessors)) {\n System.out.println(\"Cycle has found\");\n return;\n }\n }\n System.out.println(\"No cycle found in the graph\");\n }", "boolean isCyclic() {\n\n // if we are processing the course currently that is a cyclic graph and we can't\n // do all the courses\n if (processed) {\n return false;\n }\n\n // if we already visited the course and no cycle was found then we can return\n if (visited) {\n return true;\n }\n //else we set the course and visited\n visited = true;\n\n //we then loop through all the prerequisites performing the same check\n for (Course preCourse : pre) {\n if (preCourse.isCyclic()) {\n return true;\n }\n }\n\n //if we arrive here then we have gone through all the combinations and there is no cyclic graph\n visited = false;\n processed = true;\n return false;\n }", "private boolean hasCycle() {\n\t\tNode n = head;\n\t\tSet<Node> nodeSeen = new HashSet<>();\n\t\twhile (nodeSeen != null) {\n\t\t\tif (nodeSeen.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tnodeSeen.add(n);\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "@Test public void testPublic13() {\n Graph<Integer> graph= TestGraphs.testGraph4();\n int i;\n\n for (i= 0; i < 4; i++)\n assertTrue(graph.isInCycle(i));\n\n assertFalse(graph.isInCycle(4));\n }", "private boolean isAcyclic() {\n boolean visited[] = new boolean[getNumNodes()];\n boolean noCycle = true;\n int list[] = new int[getNumNodes() + 1];\n int index = 0;\n int lastIndex = 1;\n list[0] = randomParent;\n visited[randomParent] = true;\n while (index < lastIndex && noCycle) {\n int currentNode = list[index];\n int i = 1;\n\n // verify parents of current node\n while ((i < parentMatrix[currentNode][0]) && noCycle) {\n if (!visited[parentMatrix[currentNode][i]]) {\n if (parentMatrix[currentNode][i] != randomChild) {\n list[lastIndex] = parentMatrix[currentNode][i];\n lastIndex++;\n }\n else {\n noCycle = false;\n }\n visited[parentMatrix[currentNode][i]] = true;\n } // end of if(visited)\n i++;\n }\n index++;\n }\n //System.out.println(\"\\tnoCycle:\"+noCycle);\n return noCycle;\n }", "public static Boolean isCyclic(Graph g) {\n\n for (Vertex v : g) {\n v.seen = false;\n v.parent = null;\n }\n // Running a DFS to check for cycle\n for (Vertex v : g) {\n if (!v.seen) {\n if (isCyclicUtil(v, v.parent)) {\n return true;\n }\n }\n }\n return false;\n\n }", "private boolean hasNoCycle(int node, int[] color, int[][] graph) {\n if (color[node] > 0)\n return color[node] == 2;\n\n color[node] = 1;\n for (int nei : graph[node]) {\n if (color[nei] == 2)\n continue;\n if (color[nei] == 1 || !hasNoCycle(nei, color, graph))\n return false;\n }\n\n color[node] = 2;\n return true;\n }", "public boolean isCyclic() {\r\n\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\t\tArrayList<String> list = new ArrayList<>(vtces.keySet());\r\n\r\n\t\tfor (String key : list) {\r\n\t\t\tif (processed.containsKey(key))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t// Create a new pair\r\n\t\t\tPair npr = new Pair();\r\n\t\t\tnpr.vname = key;\r\n\t\t\tnpr.psf = key;\r\n\r\n\t\t\t// put pair queue\r\n\t\t\tqueue.addLast(npr);\r\n\r\n\t\t\t// Work while queue is not empty\r\n\t\t\twhile (!queue.isEmpty()) {\r\n\r\n\t\t\t\t// Remove a pair from queue\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\tif (processed.containsKey(rp.vname))\r\n\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t// Put in processed hashmap\r\n\t\t\t\tprocessed.put(rp.vname, True);\r\n\r\n\t\t\t\t// nbrs\r\n\t\t\t\tVertex rpvertex = vtces.get(rp.vname);\r\n\t\t\t\tArrayList<String> nbrs = new ArrayList<>(rpvertex.nbrs.keySet());\r\n\r\n\t\t\t\tfor (String nbr : nbrs) {\r\n\t\t\t\t\t// Process only unprocessed vertex\r\n\t\t\t\t\tif (!processed.containsKey(nbr)) {\r\n\t\t\t\t\t\t// Create a new pair and put in queue\r\n\t\t\t\t\t\tPair np = new Pair();\r\n\t\t\t\t\t\tnp.vname = nbr;\r\n\t\t\t\t\t\tnp.psf = rp.psf + nbr;\r\n\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "static boolean isCorrectCycle(Vertex v, LinkedList<Vertex> cycle, int print) {\r\n\r\n boolean ret = true;\r\n\r\n if (print > 1)\r\n System.out.println(\"Checking cycle with vertex \" + v + \": \" + cycle);\r\n\r\n // check for invalid parameters\r\n if (v == null || cycle == null || cycle.isEmpty()) {\r\n if (print > 0)\r\n System.out.println(\"null or empty parameter, no check\");\r\n return false;\r\n }\r\n\r\n // check for too short cycles, 4 is minimum (v-x-y-v)\r\n if (cycle.size() < 4) {\r\n if (print > 0)\r\n System.out.println(\"too short cycle: \" + cycle.size());\r\n ret = false;\r\n }\r\n\r\n // check for correct first and last in cycle\r\n if (cycle.getFirst() != v) {\r\n if (print > 0)\r\n System.out.println(\"Wrong first vertex \" + cycle.getFirst());\r\n ret = false;\r\n }\r\n if (cycle.getLast() != v) {\r\n if (print > 0)\r\n System.out.println(\"Wrong last vertex \" + cycle.getLast());\r\n ret = false;\r\n }\r\n\r\n // extra: check if first and last are different (other than v)\r\n\r\n // check that all successive vertices in list are adjacent in graph\r\n\r\n ListIterator<Vertex> li = cycle.listIterator();\r\n Vertex prev = null;\r\n while (li.hasNext()) {\r\n Vertex w = li.next();\r\n if (prev != null && ! prev.isAdjacent(w)) {\r\n if (print > 0)\r\n System.out.println(\"No edge between \" + prev + \" and \" + w);\r\n ret = false;\r\n }\r\n // check that v is not in the middle of cycle\r\n if (prev != null && li.hasNext() && w == v) {\r\n if (print > 0)\r\n System.out.println(\"Required vertex \" + v + \" in the middle of cycle\");\r\n ret = false;\r\n }\r\n\r\n prev = w;\r\n } // while\r\n\r\n if (print > 1 && ret)\r\n System.out.println(\"Valid cycle\");\r\n\r\n return ret;\r\n\r\n }", "public boolean hasCycle(int g) {\n\t\t//TODO\n\t}", "public static boolean isAllVertexConnected(ArrayList<Edge>[] graph)\n {\n int count = 0;\n int n = graph.length;\n boolean[] vis = new boolean[n];\n\n for(int v = 0; v < n; v++) {\n if(vis[v] == false) {\n count++;\n\n //if number of connected components is greater than 1 then graph is not connected\n if(count > 1) {\n return false;\n }\n gcc(graph, v, vis);\n }\n }\n return true;\n\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n private static void cycleTests() throws CALExecutorException {\r\n \r\n final ImmutableDirectedGraph<Integer> noCycles = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 3), Pair.make(1, 3)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthOneCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 1)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthTwoCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 1)),\r\n executionContext);\r\n \r\n System.out.println(\"noCycle.findCycle(): \" + noCycles.findCycle());\r\n System.out.println(\"oneCycle.findCycle(): \" + lengthOneCycle.findCycle());\r\n System.out.println(\"twoCycle.findCycle(): \" + lengthTwoCycle.findCycle());\r\n }", "public interface CycleInGraph<V> {\n boolean hasCycle(Graph<V> graph) ;\n}", "public boolean isCyclic(int V, ArrayList<ArrayList<Integer>> adj)\n {\n // code here\n // System.out.println(V);\n // System.out.println(adj.toString());\n boolean visit[] = new boolean[V];\n boolean recstack[] = new boolean[V];\n for(int i = 0; i < V; i++){\n if(dfs(i, visit, recstack, adj)){\n return true;\n }\n }\n return false;\n }", "public final boolean isAcyclic() {\n return this.topologicalSort().size() == this.sizeNodes();\n }", "public static boolean hasCycle( IntNode head ) {\r\n\t\r\n\t\tfor( IntNode cursor = head; cursor != null; cursor = cursor.link ) {\r\n\t\t\t// otherwise should return false if the list is acyclic\r\n\t\t\tif( cursor.link == null )\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\t// should return true if it is cyclic\r\n\t\treturn true;\r\n\t\t\r\n\t}", "private boolean hamiltonianCycleUtil(int path[], int pos) {\n /* exit condition: If all vertices are included in Hamiltonian Cycle */\n if (pos == V) {\n // And if there is an edge from the last included vertex to the first vertex\n return matrix[path[pos - 1]][path[0]] != 0;\n }\n\n // Try different vertices as a next candidate in Hamiltonian Cycle.\n // We don't try for 0 as we included 0 as starting point in in hamiltonianCycle()\n for (int v = 1; v < V; v++) {\n /* Check if this vertex can be added to Hamiltonian Cycle */\n if (isFeasible(v, path, pos)) {\n path[pos] = v;\n\n /* recur to construct rest of the path */\n if (hamiltonianCycleUtil(path, pos + 1))\n return true;\n\n /* If adding vertex v doesn't lead to a solution,\n then remove it, backtracking */\n path[pos] = -1;\n }\n }\n\n /* If no vertex can be added to Hamiltonian Cycle constructed so far, then return false */\n return false;\n }", "boolean hasIsVertexOf();", "public boolean checkCyclesRecursive(Integer blockID, LinkedList<Integer> visited){\n System.out.println(\"cc: (block \" + blockID + \") visited: \" + visited);\n if(visited.contains(blockID)){\n return false;\n }\n visited.add(blockID);\n\n /*for (Con connection : this.connections) {\n if(connection.src == blockID){\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(connection.dst, new_visited) == false){\n return false;\n }\n }\n }*/\n\n for(Type output : this.getBlockByID(blockID).outputs)\n {\n /*if(output.getFirstDstID() != -1) {\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(output.getFirstDstID(), new_visited) == false){\n return false;\n }\n }*/\n for (Integer id : output.getAllDstID()) {\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(id, new_visited) == false){\n return false;\n } \n }\n }\n return true;\n }", "public static boolean connected(Graph grafo) {\r\n\t\tint numVertices = grafo.getVertexNumber();\r\n\t\tSet<Vertice> verticesVisitados = new HashSet<Vertice>(); // sem repeticoes\r\n\t\tfor (Aresta aresta : grafo.getArestas()) {\r\n\t\t\tverticesVisitados.add(aresta.getV1());\r\n\t\t\tverticesVisitados.add(aresta.getV2());\r\n\t\t}\r\n\r\n\t\treturn numVertices == verticesVisitados.size();\r\n\t}", "public Set<V> findCycles()\n {\n // ProbeIterator can't be used to handle this case,\n // so use StrongConnectivityAlgorithm instead.\n StrongConnectivityAlgorithm<V, E> inspector =\n new KosarajuStrongConnectivityInspector<>(graph);\n List<Set<V>> components = inspector.stronglyConnectedSets();\n\n // A vertex participates in a cycle if either of the following is\n // true: (a) it is in a component whose size is greater than 1\n // or (b) it is a self-loop\n\n Set<V> set = new LinkedHashSet<>();\n for (Set<V> component : components) {\n if (component.size() > 1) {\n // cycle\n set.addAll(component);\n } else {\n V v = component.iterator().next();\n if (graph.containsEdge(v, v)) {\n // self-loop\n set.add(v);\n }\n }\n }\n\n return set;\n }", "public static boolean hasCycle(ListNode node) {\n\t\treturn true;\n\t}", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "private boolean BFS(int i) {\n color[i] = 1;\n for (int j : alphabet.get(i)) {\n // Making sure we don't check one vertex twice\n if (color[j] != -1) {\n if (color[j] == 0) {\n if (BFS(j)) return true;\n }\n // Found visited vertex --> We found cycle\n if (color[j] == 1) {\n System.out.println(j);\n return true;\n }\n }\n }\n //Vertex checked\n color[i] = -1;\n return false;\n }", "boolean hasCycle() {\n if (head == null){\n return false;\n }\n Node slow = head;\n Node fast = head;\n while (slow != null && fast != null && fast.next != null){\n slow = slow.next;\n fast = fast.next.next;\n if (slow == fast){\n return true;\n }\n }\n return false;\n }", "private static boolean findCyclesInSCC(\n ARGState pStartState,\n ARGState pCurrentState,\n Set<ARGState> pBlockedSet,\n SetMultimap<ARGState, ARGState> pBlockedMap,\n Deque<ARGState> pStack,\n List<List<ARGState>> pAllCycles,\n Set<ARGState> pExcludeSet) {\n\n if (pExcludeSet.contains(pCurrentState)) {\n // Do not regard nodes which were deliberately put into a set of excluded states\n return false;\n }\n\n boolean foundCycle = false;\n pStack.push(pCurrentState);\n pBlockedSet.add(pCurrentState);\n\n for (ARGState successor : pCurrentState.getChildren()) {\n // If the successor is equal to the startState, a cycle has been found.\n // Store contents of stack in the final result.\n if (successor.equals(pStartState)) {\n List<ARGState> cycle = new ArrayList<>();\n pStack.push(pStartState);\n cycle.addAll(pStack);\n Collections.reverse(cycle);\n pStack.pop();\n pAllCycles.add(cycle);\n foundCycle = true;\n } else if (!pBlockedSet.contains(successor)) {\n // Explore this successor only if it is not already in the blocked set.\n boolean gotCycle =\n findCyclesInSCC(\n pStartState, successor, pBlockedSet, pBlockedMap, pStack, pAllCycles, pExcludeSet);\n foundCycle = foundCycle || gotCycle;\n }\n }\n\n if (foundCycle) {\n unblock(pCurrentState, pBlockedSet, pBlockedMap);\n } else {\n for (ARGState s : pCurrentState.getChildren()) {\n pBlockedMap.put(s, pCurrentState);\n }\n }\n pStack.pop();\n\n return foundCycle;\n }", "public DirectedCycle(Digraph G) {\n onStack = new boolean[G.V()];\n marked = new boolean[G.V()];\n edgeTo = new int[G.V()];\n\n //Cycle through each vertex to see if it is in a cycle\n for (int v = 0; v < G.V(); v++) {\n if (marked[v] == false) {\n dfs(G, v);\n }\n }\n }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "private void treatCycles(SDFGraph graph) throws InvalidExpressionException {\r\n\t\tList<Set<SDFAbstractVertex>> cycles = new ArrayList<Set<SDFAbstractVertex>>();\r\n\t\tCycleDetector<SDFAbstractVertex, SDFEdge> detector = new CycleDetector<SDFAbstractVertex, SDFEdge>(\r\n\t\t\t\tgraph);\r\n\t\tList<SDFAbstractVertex> vertices = new ArrayList<SDFAbstractVertex>(\r\n\t\t\t\tgraph.vertexSet());\r\n\t\twhile (vertices.size() > 0) {\r\n\t\t\tSDFAbstractVertex vertex = vertices.get(0);\r\n\t\t\tSet<SDFAbstractVertex> cycle = detector\r\n\t\t\t\t\t.findCyclesContainingVertex(vertex);\r\n\t\t\tif (cycle.size() > 0) {\r\n\t\t\t\tvertices.removeAll(cycle);\r\n\t\t\t\tcycles.add(cycle);\r\n\t\t\t}\r\n\t\t\tvertices.remove(vertex);\r\n\t\t}\r\n\r\n\t\tfor (Set<SDFAbstractVertex> cycle : cycles) {\r\n\t\t\tint gcd = gcdOfVerticesVrb(cycle);\r\n\t\t\tif (gcd > 1 && !(graph instanceof PSDFGraph)) {\r\n\t\t\t\tcopyCycle(graph, cycle, gcd);\r\n\t\t\t} else if (!(graph instanceof PSDFGraph)) {\r\n\t\t\t\ttreatPSDFCycles(graph, cycle);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// SDFIterator sdfIterator = new SDFIterator(graph);\r\n\t\t// List<SDFAbstractVertex> orderedList = new\r\n\t\t// ArrayList<SDFAbstractVertex>();\r\n\t\t// while (sdfIterator.hasNext()) {\r\n\t\t// SDFAbstractVertex current = sdfIterator.next();\r\n\t\t// orderedList.add(current);\r\n\t\t// if (current instanceof SDFRoundBufferVertex) {\r\n\t\t// int nbTokens = 0;\r\n\t\t// for (SDFEdge edgeData : graph.outgoingEdgesOf(current)) {\r\n\t\t// nbTokens = edgeData.getProd().intValue();\r\n\t\t// }\r\n\t\t// for (int i = orderedList.size() - 1; i >= 0; i--) {\r\n\t\t// if (graph.getAllEdges(orderedList.get(i), current).size() == 1) {\r\n\t\t// if (nbTokens <= 0) {\r\n\t\t// graph.removeAllEdges(orderedList.get(i), current);\r\n\t\t// } else {\r\n\t\t// for (SDFEdge thisEdge : graph.getAllEdges(\r\n\t\t// orderedList.get(i), current)) {\r\n\t\t// nbTokens = nbTokens\r\n\t\t// - thisEdge.getProd().intValue();\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t// // traiter le roundBuffer pour le supprimer\r\n\t\t// if (graph.incomingEdgesOf(current).size() == 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() == 1) {\r\n\t\t// SDFAbstractVertex source = ((SDFEdge) graph\r\n\t\t// .incomingEdgesOf(current).toArray()[0]).getSource();\r\n\t\t// SDFEdge oldEdge = ((SDFEdge) graph.incomingEdgesOf(current)\r\n\t\t// .toArray()[0]);\r\n\t\t// SDFAbstractVertex target = ((SDFEdge) graph\r\n\t\t// .outgoingEdgesOf(current).toArray()[0]).getTarget();\r\n\t\t// SDFEdge refEdge = ((SDFEdge) graph.outgoingEdgesOf(current)\r\n\t\t// .toArray()[0]);\r\n\t\t// SDFEdge newEdge = graph.addEdge(source, target);\r\n\t\t// newEdge.copyProperties(refEdge);\r\n\t\t// graph.removeEdge(refEdge);\r\n\t\t// graph.removeEdge(oldEdge);\r\n\t\t// graph.removeVertex(current);\r\n\t\t// orderedList.remove(current);\r\n\t\t// } else if (graph.incomingEdgesOf(current).size() == 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() > 1) {\r\n\t\t//\r\n\t\t// } else if (graph.incomingEdgesOf(current).size() > 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() == 1) {\r\n\t\t//\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t/*\r\n\t\t * { CycleDetector<SDFAbstractVertex, SDFEdge> detect = new\r\n\t\t * CycleDetector<SDFAbstractVertex, SDFEdge>( graph);\r\n\t\t * List<SDFAbstractVertex> vert = new ArrayList<SDFAbstractVertex>(\r\n\t\t * graph.vertexSet()); while (vert.size() > 0) { SDFAbstractVertex\r\n\t\t * vertex = vert.get(0); Set<SDFAbstractVertex> cycle = detect\r\n\t\t * .findCyclesContainingVertex(vertex); if (cycle.size() > 0) {\r\n\t\t * vert.removeAll(cycle); cycles.add(cycle); } vert.remove(vertex); } }\r\n\t\t */\r\n\r\n\t\treturn;\r\n\t}", "public static boolean hasCycle1(ListNode head) {\n Set<ListNode> visited = new HashSet<>();\n\n while (head != null) {\n if (visited.contains(head)) {\n return true;\n }\n visited.add(head);\n head = head.next;\n }\n\n return false;\n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "private boolean containsCycle(TransactionId tid) {\n HashSet<TransactionId> visited = new HashSet<TransactionId>();\n LinkedList<TransactionId> queue = new LinkedList<TransactionId>();\n\n queue.add(tid);\n\n while (!(queue.isEmpty())) {\n TransactionId cur = queue.remove();\n if (visited.contains(cur)) {\n return true;\n }\n\n visited.add(cur);\n\n if (this.dependencyMap.containsKey(cur) && !(this.dependencyMap.get(cur).isEmpty())) {\n Iterator<TransactionId> it = this.dependencyMap.get(cur).iterator();\n while (it.hasNext()) {\n queue.add(it.next());\n }\n }\n }\n\n return false;\n }", "private boolean connected(DepthFirstSearch dfs, Graph G) {\n return dfs.count() == G.V();\r\n }", "public List<Integer> eventualSafeNodes(int[][] graph) {\n boolean[] visited = new boolean[graph.length];\n boolean[] onStack = new boolean[graph.length];\n boolean[] onCycle = new boolean[graph.length];\n\n for (int i = 0; i < graph.length; i++) {\n if (!visited[i]) {\n if (hasCycle(i, graph, visited, onStack, onCycle)) {\n onCycle[i] = true;\n }\n }\n // System.out.println(i+ \"-->\"+Arrays.toString(onCycle));\n }\n\n List<Integer> res = new ArrayList<>(visited.length);\n for (int i = 0; i < onCycle.length; i++) {\n if (!onCycle[i]) {\n res.add(i);\n }\n }\n return res;\n }", "public boolean detectCycles()\n {\n try {\n execute(null, null);\n } catch (CycleDetectedException ex) {\n return true;\n }\n\n return false;\n }", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_CycleDetectedInUpstreamNodes() {\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n ValueStreamMap graph = new ValueStreamMap(b, null);\n graph.addUpstreamNode(new PipelineDependencyNode(a, a), null, b);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\"), null, a, new MaterialRevision(null));\n graph.addDownstreamNode(new PipelineDependencyNode(a, a), b);\n graph.addDownstreamNode(new PipelineDependencyNode(c, c), a);\n\n assertThat(graph.hasCycle(), is(true));\n }", "private static boolean isAcyclic(int index, BitSet onStack, BitSet visited,\n\t\t\tAutomaton automaton) {\n\n\t\tif (onStack.get(index)) {\n\t\t\treturn false; // found a cycle!\n\t\t}\n\n\t\tif (visited.get(index)) {\n\t\t\t// Ok, we've traversed this node before and it checked out OK.\n\t\t\treturn true;\n\t\t}\n\n\t\tvisited.set(index);\n\t\tonStack.set(index);\n\n\t\tAutomaton.State state = automaton.get(index);\n\t\tif (state instanceof Automaton.Term) {\n\t\t\tAutomaton.Term term = (Automaton.Term) state;\n\t\t\tif (term.contents != Automaton.K_VOID) {\n\t\t\t\tif (!isAcyclic(term.contents, onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (state instanceof Automaton.Collection) {\n\t\t\tAutomaton.Collection compound = (Automaton.Collection) state;\n\t\t\tint[] children = compound.children;\n\t\t\tfor (int i = 0; i != compound.length; ++i) {\n\t\t\t\tif (!isAcyclic(children[i], onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tonStack.set(index, false);\n\n\t\treturn true;\n\t}", "int hasCycle(Node head) {\n\t// If list is null\n\tif(head == null) {\n\t\t// No cycle\n\t\treturn 0;\n\t}\n\n\tSet<Node> visitedNodes = new HashSet<Node>();\n\t\n\tNode current = head;\n\n\t// Loop through the list\n\twhile(current != null) {\n\t\t// If we have seen this node befor\n\t\tif(visitedNodes.contains(current)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Add it to the set\n\t\tvisitedNodes.add(current);\n\n\t\t// Update current\n\t\tcurrent = current.next;\n\t}\n\n\t// If we get here, there are no cycles\n\treturn 0;\n}", "public static void checkCycleSample() {\n Node ll1_5 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n\n Node ll1_2 = new Node(1, new Node(2, null));\n Node ll3_4 = new Node(3, new Node(4, null));\n Node ll5_6 = new Node(5, new Node(6, null));\n ll1_2.nextNode.nextNode = ll3_4;\n ll3_4.nextNode.nextNode = ll5_6;\n ll5_6.nextNode.nextNode = ll1_2;\n\n ll1_2.checkCycle();\n ll1_5.checkCycle();\n }", "private boolean findCycles(int v, int s, Vector<Integer>[] adjList)\n {\n boolean f = false;\n this.stack.add(v);\n this.blocked[v] = true;\n\n for (int i = 0; i < adjList[v].size(); i++) {\n int w = adjList[v].get(i);\n // found cycle\n if (w == s) {\n Vector cycle = new Vector();\n for (int j = 0; j < this.stack.size(); j++) {\n int index = this.stack.get(j).intValue();\n cycle.add(this.graphNodes[index]);\n }\n this.cycles.add(cycle);\n\n\n // we hard-limit the cycle number to 10k!!\n if (this.cycles.size() > 10000) {\n break;\n }\n\n f = true;\n }\n else if (!this.blocked[w]) {\n if (this.findCycles(w, s, adjList)) {\n f = true;\n }\n }\n }\n\n if (f) {\n this.unblock(v);\n }\n else {\n for (int i = 0; i < adjList[v].size(); i++) {\n int w = ((Integer) adjList[v].get(i)).intValue();\n if (!this.B[w].contains(new Integer(v))) {\n this.B[w].add(new Integer(v));\n }\n }\n }\n\n this.stack.remove(new Integer(v));\n return f;\n }", "boolean detectCycledirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tint[] ancestor = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, ancestor))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n Set<ListNode> nodes = new HashSet<ListNode>();\n ListNode cur = head;\n while(cur != null){\n if(nodes.contains(cur)){\n return true;\n }\n nodes.add(cur);\n cur = cur.next;\n }\n return false;\n }", "public boolean IsConnected() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\t\tint counter = 0;\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tcounter++;\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn counter == 1;\r\n\t}", "@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }", "public boolean isCyclic(int[] parent) {\n\t\tfor (Edge edge : this.edgeList) {\n\t\t\tint v1 = edge.u;\n\t\t\tint v2 = edge.v;\n\n\t\t\t// leader dhundo\n\t\t\tint p1 = findParent(parent, v1);\n\t\t\tint p2 = findParent(parent, v2);\n\n\t\t\tif (p1 != p2) {\n\t\t\t\tunion(v1, v2, parent);\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private List<V> getNewVertexOrderIfAcyclic () {\n Map<V, Integer> indegree = inDegree();\n // Determine all vertices with zero in-degree\n Stack<V> zeroIncomingVertex = new Stack<V>(); \n for (V v: indegree.keySet()) {\n if (indegree.get(v) == 0) zeroIncomingVertex.push(v);\n }\n \n // Determine the vertex order\n List<V> result = new ArrayList<V>();\n while (!zeroIncomingVertex.isEmpty()) {\n V v = zeroIncomingVertex.pop(); // Choose a vertex with zero in-degree\n result.add(v); // Vertex v is next in vertex ordering\n // \"Remove\" vertex v by updating its neighbors\n for (V neighbor: dag.get(v)) {\n indegree.put(neighbor, indegree.get(neighbor) - 1);\n // Remember any vertices that now have zero in-degree\n if (indegree.get(neighbor) == 0) zeroIncomingVertex.push(neighbor);\n }\n }\n // Check that we have used the entire graph. If not then there was a cycle.\n if (result.size() != dag.size()) return null;\n return result;\n }", "public boolean isConnected() {\n if (this.isEmpty()) return true;\n\n if (this.directed) {\n Deque<Node> toVisit = new LinkedList<>();\n for (Node s : this.nodes.values()) {\n Node current;\n toVisit.addLast(s);\n while (!toVisit.isEmpty()) {\n current = toVisit.removeLast();\n current.setFlag(\"_visited\");\n for (Edge edge : current.getNeighbours()) {\n Node n = edge.getEnd();\n if (!n.getFlag(\"_visited\")) toVisit.addLast(n);\n }\n }\n\n //Check if all nodes have been visited and remove flags\n boolean allVisited = true;\n for (Node n : nodes.values()) {\n allVisited = allVisited && n.getFlag(\"_visited\");\n n.unsetFlag(\"_visited\");\n }\n if (!allVisited) return false;\n }\n return true;\n }\n else {\n //Perform a DFS from a random start node marking nodes as visited\n Node current;\n Deque<Node> toVisit = new LinkedList<>();\n toVisit.addLast(this.nodes.values().iterator().next());\n while (!toVisit.isEmpty()) {\n current = toVisit.removeLast();\n current.setFlag(\"_visited\");\n for (Edge edge : current.getNeighbours()) {\n Node n = edge.getEnd();\n if (!n.getFlag(\"_visited\")) toVisit.addLast(n);\n }\n }\n\n //Check if all nodes have been visited and remove flags\n boolean allVisited = true;\n for (Node n : nodes.values()) {\n allVisited = allVisited && n.getFlag(\"_visited\");\n n.unsetFlag(\"_visited\");\n }\n\n return allVisited;\n }\n }", "public boolean hasCycle(Node<T> first) {\n Iterator itOne = this.iterator();\n Iterator itTwo = this.iterator();\n try {\n while (true) {\n T one = (T) itOne.next();\n itTwo.next();\n T two = (T) itTwo.next();\n if (one.equals(two)) {\n return true;\n }\n }\n } catch (NullPointerException ex) {\n ex.printStackTrace();\n }\n return false;\n }", "public boolean isConnected() {\n\t\tif (vertices.size() == 0)\n\t\t\treturn false;\n\n\t\tif (vertices.size() == 1)\n\t\t\treturn true;\n\n\t\t// determine if it is connected by using a wave\n\t\tHashSet<E> waveFront = new HashSet<>();\n\t\tHashSet<E> waveVisited = new HashSet<>();\n\n\t\t// grab the first element for the start of the wave\n\t\tE first = vertices.iterator().next();\n\t\t\n\n\t\twaveFront.add(first);\n\n\t\t// continue until there are no more elements in the wave front\n\t\twhile (waveFront.size() > 0) {\n\t\t\t// add all of the wave front elements to the visited elements\n\t\t\twaveVisited.addAll(waveFront);\n\t\t\t\n\t\t\t// if done break out of the while\n\t\t\tif (waveVisited.size() == vertices.size())\n\t\t\t\tbreak;\n\n\t\t\t// grab the iterator from the wave front\n\t\t\tIterator<E> front = waveFront.iterator();\n\n\t\t\t// reset the wave front to a new array list\n\t\t\twaveFront = new HashSet<>();\n\n\t\t\t// loop through all of the elements from the front\n\t\t\twhile (front.hasNext()) {\n\t\t\t\tE next = front.next();\n\n\t\t\t\t// grab all of the neighbors to next\n\t\t\t\tList<E> neighbors = neighbors(next);\n\n\t\t\t\t// add them to the wave front if they haven't been visited yet\n\t\t\t\tfor (E neighbor : neighbors) {\n\t\t\t\t\tif (!waveVisited.contains(neighbor))\n\t\t\t\t\t\twaveFront.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// return whether all of the nodes have been visited or not\n\t\treturn waveVisited.size() == vertices.size();\n\t}", "public int inDegree(int vertex) {\n int count = 0;\n//your code here\n for(int i=0; i<adjLists.length; i++){\n if(i==vertex){ continue;}\n if(isAdjacent(i,vertex)){\n count++;\n continue;\n }\n }\n return count;\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "private boolean revisar(DigrafoAristaPonderada G) {\n\n // edge-weighted digraph is cyclic\n if (tieneCiclo()) {\n // verify ciclo\n AristaDirigida primero = null, ultimo = null;\n for (AristaDirigida a : ciclo()) {\n if (primero == null) primero = a;\n if (ultimo != null) {\n if (ultimo.hacia() != a.desde()) {\n System.err.printf(\n \"aristas de ciclo %s and %s no incidentes\\n\",\n ultimo, a);\n return false;\n }\n }\n ultimo = a;\n }\n\n if (ultimo.hacia() != primero.desde()) {\n System.err.printf(\n \"aristas de ciclo %s and %s no incidentes\\n\", \n ultimo, primero);\n return false;\n }\n }\n\n\n return true;\n }", "public static boolean isDeadlocked(List<Vertex> graph) {\n for (Vertex vertex : graph) {\n if (vertex.state == State.UNVISITED && hasCycle(vertex)) {\n return true;\n }\n }\n return false;\n }", "private boolean hasCycle()\r\n {\r\n boolean passed = false;\r\n for(Field.RadioData dst=radioList; dst!=null; dst=dst.next)\r\n {\r\n if(dst==radioList && passed) return true;\r\n passed = true;\r\n }\r\n return false;\r\n }", "public CycleDetector(Graph<V, E> graph)\n {\n this.graph = GraphTests.requireDirected(graph);\n }", "private boolean discrimPaths(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node b : nodes) {\n\n //potential A and C candidate pairs are only those\n // that look like this: A<-oBo->C or A<->Bo->C\n List<Node> possAandC = graph.getNodesOutTo(b, Endpoint.ARROW);\n\n //keep arrows and circles\n List<Node> possA = new LinkedList<>(possAandC);\n possA.removeAll(graph.getNodesInTo(b, Endpoint.TAIL));\n\n //keep only circles\n List<Node> possC = new LinkedList<>(possAandC);\n possC.retainAll(graph.getNodesInTo(b, Endpoint.CIRCLE));\n\n for (Node a : possA) {\n for (Node c : possC) {\n if (!graph.isParentOf(a, c)) {\n continue;\n }\n\n LinkedList<Node> reachable = new LinkedList<>();\n reachable.add(a);\n if (reachablePathFindOrient(graph, a, b, c, reachable)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public boolean detect_cycle_directed_util(int v,boolean visited[], boolean curr_visited[]) {\n\t\t\n\t\tvisited[v]=true;\n\t\tcurr_visited[v]=true;\n\t\t\n\t\t\n\t\tfor(int neighbour:adj[v]) {\n\t\t\t\n\t\t\tif(curr_visited[neighbour]) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if(!visited[neighbour]&&detect_cycle_directed_util(neighbour,visited,curr_visited)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tcurr_visited[v]=false;\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public void removeGraphCycles() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tint[] cycleCount = new int[map.size()];\r\n\t\tforComplexMotion = new boolean[map.size()];\r\n\t\t//count cycles\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(i != j) {\r\n\t\t\t\t\tif(graph[i][j] && graph[j][i]) {\r\n\t\t\t\t\t\tcycleCount[i]++;\r\n\t\t\t\t\t\tcycleCount[j]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//remove fobjects from linear motion planning\r\n\t\tboolean hasCycles = true;\r\n\t\twhile(hasCycles) {\r\n\t\t\tint max = 0;\r\n\t\t\tint maxIndex = -1;\r\n\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\tif(cycleCount[i] > max) {\r\n\t\t\t\t\tmax = cycleCount[i];\r\n\t\t\t\t\tmaxIndex = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(maxIndex == -1) {\r\n\t\t\t\thasCycles = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcycleCount[maxIndex] = 0;\r\n\t\t\t\tforComplexMotion[maxIndex] = true;\r\n\t\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\t\tgraph[maxIndex][i] = false;\r\n\t\t\t\t\tgraph[i][maxIndex] = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "boolean hasCycle(Node head) {\n node = head;\n //h.add(node.data);//just add the first one //node = node.next; //get to the next one where we, at 2nd best case, will Find Cycle\n while (node.next != null){\n if ( h.contains(node.data) ){\n return true;\n }else {\n h.add(node.data);\n }\n node = node.next;\n }\n return false;\n }", "@Test\n public void testHasCycle() {\n System.out.println(\"**** hasCycle ****\");\n CycleDepthSearch instance = new CycleDepthSearch(g);\n boolean expResult = true;\n boolean result = instance.hasCycle();\n System.out.println(result);\n assertEquals(expResult, result);\n }", "private boolean hasCycle1() {\n\t\tNode slow = head;\n\t\tNode fast = head;\n\t\t\n\t\twhile (fast != null && fast.next != null) {\n\t\t\tslow = slow.next;\n\t\t\tfast = fast.next.next;\n\t\t\tif(slow == fast) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean reachable(Vertex start, Vertex end){\n\t\tSet<Vertex> reach = this.post(start); \n\t\treturn reach.contains(end);\n\t}", "public boolean isBipartiteUndirectedGraph (){\r\n int[] vertices = new int[getNumV()];\r\n for (int i = 0; i < getNumV(); ++i)\r\n vertices[i] = -1;\r\n\r\n vertices[0] = 1;\r\n\r\n Stack <Integer> q = new Stack<Integer>();\r\n q.push(0);\r\n\r\n while (!q.isEmpty()) {\r\n int current = q.pop();\r\n Iterator<Edge> iter = edgeIterator(current);\r\n while (iter.hasNext()) {\r\n Edge edge = iter.next();\r\n int neighbor = edge.getDest();\r\n if (vertices[neighbor] == -1) {\r\n vertices[neighbor] = 1 - vertices[current];\r\n q.push(neighbor);\r\n }\r\n else if (vertices[neighbor] == vertices[current])\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static void main(String[] args) {\n ArrayList<Integer> input = new ArrayList<>(Arrays.asList(1, 2, -1, 2, 2));\n System.out.println(\"has Cycle : \" + CycleCircularArray.hasCycle(input));\n input = new ArrayList<>(Arrays.asList(2, 2, -1, 2));\n System.out.println(\"has Cycle : \" + CycleCircularArray.hasCycle(input));\n input = new ArrayList<>(Arrays.asList(2, 1, -1, -2));\n System.out.println(\"has Cycle : \" + CycleCircularArray.hasCycle(input));\n }", "public boolean hasEular(Graph graph) {\n\t\tint vertices = graph.countVertices();\n\t\tint i = 0;\n\t\tint[] x = new int[]{1, 5};\n\t\tfor (i = 0; i < vertices; i++) {\n\t\t\tif (graph.getNeighbours(i).length != 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i == vertices) {\n\t\t\treturn true;\n\t\t}\n\t\t// (2) All vertices with non-zero degree are connected.\n\t\tif (!isNonZeroDegreeVerticesConnected(graph)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// (3) All vertices have even degree.\n\t\t// int vertices = graph.countVertices();\n\t\tint odd = 0;\n\t\tfor (i = 0; i < vertices; i++) {\n\t\t\tif ((graph.getNeighbours(i).length & 1) == 1) {\n\t\t\t\todd++;\n\t\t\t}\n\t\t}\n\n\t\tif (odd > 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void cyclicalGraphs1Test() throws Exception {\n // NOTE: we can't use the parser to create a circular graph because\n // vector clocks are partially ordered and do not admit cycles. So we\n // have to create circular graphs manually.\n ChainsTraceGraph g1 = new ChainsTraceGraph();\n List<EventNode> g1Nodes = addNodesToGraph(g1, new String[] { \"a\", \"a\",\n \"a\" });\n // Create a loop in g1, with 3 nodes\n g1Nodes.get(0).addTransition(g1Nodes.get(1), Event.defTimeRelationStr);\n g1Nodes.get(1).addTransition(g1Nodes.get(2), Event.defTimeRelationStr);\n g1Nodes.get(2).addTransition(g1Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g1, 0);\n\n ChainsTraceGraph g2 = new ChainsTraceGraph();\n List<EventNode> g2Nodes = addNodesToGraph(g2, new String[] { \"a\", \"a\" });\n // Create a loop in g2, with 2 nodes\n g2Nodes.get(0).addTransition(g2Nodes.get(1), Event.defTimeRelationStr);\n g2Nodes.get(1).addTransition(g2Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g2, 1);\n\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 3);\n testKEqual(g1Nodes.get(0), g2Nodes.get(0), 4);\n\n ChainsTraceGraph g3 = new ChainsTraceGraph();\n List<EventNode> g3Nodes = addNodesToGraph(g2, new String[] { \"a\" });\n // Create a loop in g3, from a to itself\n g3Nodes.get(0).addTransition(g3Nodes.get(0), Event.defTimeRelationStr);\n exportTestGraph(g3, 2);\n\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 1);\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 2);\n testKEqual(g3Nodes.get(0), g2Nodes.get(0), 3);\n\n ChainsTraceGraph g4 = new ChainsTraceGraph();\n List<EventNode> g4Nodes = addNodesToGraph(g2, new String[] { \"a\" });\n exportTestGraph(g4, 2);\n\n testKEqual(g4Nodes.get(0), g2Nodes.get(0), 1);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 2);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 3);\n testNotKEqual(g4Nodes.get(0), g2Nodes.get(0), 4);\n }", "@Override\n public boolean onRecurse(DefaultGraph graph, int cycleStart,\n int cycleSecond, int lastVertex, int current, int currentFaces,\n int edgesLeft, int edgesInCurrentCycle)\n {\n int girth = graph.getGirth();\n \n /* Minimum number of edges needed to finnish current cycle. */\n int neededInCurrent;\n if(edgesInCurrentCycle >= girth) {\n if(graph.hasEdge(current, cycleStart))\n neededInCurrent = 1;\n else\n neededInCurrent = 2;\n } else {\n neededInCurrent = girth - edgesInCurrentCycle;\n }\n \n /* Simple bounding based on edges left/current number of faces. The\n * +1 is the cycle we're currently working on. */\n int estimate = currentFaces + 1 + (edgesLeft - neededInCurrent) / girth;\n \n /* If we are not going to get higher than our previous result, we can\n * bound. Note that we add 1 to our previous result, this is because\n * either all results will be even, or all results will be odd. */\n if(estimate <= previousResult + 1) {\n return false;\n }\n \n /*float depth = (float) edgesLeft / (float) graph.getNumberOfEdges();\n if(previousResult >= 0 && current < 0 &&\n estimate * 0.8f <= previousResult && depth >= 0.3f) {\n if(graph.estimate() <= previousResult) {\n return false;\n }\n }*/\n \n return true;\n }", "private boolean isCyclicUtil(String v, Set<String> visited, String parent) {\n\t\tvisited.add(v);\n\t\tSet<String> neighbors = this.neighbors.get(v);\n\t\tfor (String n: neighbors) {\n\t\t\tif (!visited.contains(n)) {\n\t\t\t\tif (isCyclicUtil(n, visited, v)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!n.equals(parent)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isConnected() {\r\n\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\t\tArrayList<String> list = new ArrayList<>(vtces.keySet());\r\n\t\tint count = 0;\r\n\t\tfor (String key : list) {\r\n\t\t\tif (processed.containsKey(key))\r\n\t\t\t\tcontinue;\r\n\t\t\tcount++;\r\n\t\t\t// Create a new pair\r\n\t\t\tPair npr = new Pair();\r\n\t\t\tnpr.vname = key;\r\n\t\t\tnpr.psf = key;\r\n\r\n\t\t\t// put pair queue\r\n\t\t\tqueue.addLast(npr);\r\n\r\n\t\t\t// Work while queue is not empty\r\n\t\t\twhile (!queue.isEmpty()) {\r\n\r\n\t\t\t\t// Remove a pair from queue\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\tif (processed.containsKey(rp.vname))\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t// Put in processed hashmap\r\n\t\t\t\tprocessed.put(rp.vname, True);\r\n\r\n\t\t\t\t// nbrs\r\n\t\t\t\tVertex rpvertex = vtces.get(rp.vname);\r\n\t\t\t\tArrayList<String> nbrs = new ArrayList<>(rpvertex.nbrs.keySet());\r\n\r\n\t\t\t\tfor (String nbr : nbrs) {\r\n\t\t\t\t\t// Process only unprocessed vertex\r\n\t\t\t\t\tif (!processed.containsKey(nbr)) {\r\n\t\t\t\t\t\t// Create a new pair and put in queue\r\n\t\t\t\t\t\tPair np = new Pair();\r\n\t\t\t\t\t\tnp.vname = nbr;\r\n\t\t\t\t\t\tnp.psf = rp.psf + nbr;\r\n\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (count > 1)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_DownstreamOfCurrentWasUpstreamOfCurrentAtSomePoint() {\n String grandParent = \"grandParent\";\n String parent = \"parent\";\n String child = \"child\";\n String currentPipeline = \"current\";\n ValueStreamMap graph = new ValueStreamMap(currentPipeline, null);\n graph.addDownstreamNode(new PipelineDependencyNode(child, child), currentPipeline);\n graph.addDownstreamNode(new PipelineDependencyNode(grandParent, grandParent), child);\n graph.addUpstreamNode(new PipelineDependencyNode(parent, parent), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(grandParent, grandParent), null, parent);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, grandParent, new MaterialRevision(null));\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, parent, new MaterialRevision(null));\n\n assertThat(graph.hasCycle(), is(true));\n }", "public boolean hasCycle(ListNode head) {\n ListNode p1 = head;\n ListNode p2 = head;\n while (p2 != null && p2.next != null) {\n \tp1 = p1.next;\n \tif (p2.next != null) {\n \t\tp2 = p2.next.next;\n \t}\n \tif (p1 == p2) {\n \t\treturn true;\n \t}\n }\n return false;\n }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(dwg.getV().size()==0) return true;\n\n\t\tIterator<node_data> temp = dwg.getV().iterator();\n\t\twhile(temp.hasNext()) {\n\t\t\tfor(node_data w : dwg.getV()) {\n\t\t\t\tw.setTag(0);\n\t\t\t}\n\t\t\tnode_data n = temp.next();\n\t\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\t\tn.setTag(1);\n\t\t\tq.add(n);\n\t\t\twhile(!q.isEmpty()) {\n\t\t\t\tnode_data v = q.poll();\n\t\t\t\tCollection<edge_data> arrE = dwg.getE(v.getKey());\n\t\t\t\tfor(edge_data e : arrE) {\n\t\t\t\t\tint keyU = e.getDest();\n\t\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\t\tif(u.getTag() == 0) {\n\t\t\t\t\t\tu.setTag(1);\n\t\t\t\t\t\tq.add(u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv.setTag(2);\n\t\t\t}\n\t\t\tCollection<node_data> col = dwg.getV();\n\t\t\tfor(node_data n1 : col) {\n\t\t\t\tif(n1.getTag() != 2) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public abstract boolean hasEdge(int from, int to);", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "public boolean hasCycle(ListNode head) {\n\t\tListNode fast,slow;\n\t\tfast=slow=head;\n\t\twhile(fast!=null & fast.next()!=null) {\n\t\t\tfast=fast.next().next();\n\t\t\tslow=slow.next();\n\t\t\t//Meet at a point\n\t\t\tif (fast==slow) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "Cycle getOptimalCycle(Graph<L, T> graph);", "public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n\n ListNode p1 = head.next;\n ListNode p2 = head.next.next;\n while(p1 != null && p2 != null){\n if(p1 == p2){\n return true;\n }\n p1 = p1.next;\n p2 = p2.next;\n if(p2 != null){\n p2 = p2.next;\n }\n }\n return false;\n }", "static boolean hasCycle(Node head) {\n\t\t\n\t\tif(head == null) return false;\n\t\t\n\t\t//Using the concept of one pointer moving faster than another, since at some point both will meet \n\t\t//at the same point and close a cycle (if any).\n\t\tNode slowPointerNode = head;\n\t\tNode fastPointerNode = head.getNext();\n\t\t\n\t\twhile(fastPointerNode != null && fastPointerNode.getNext() != null) {\n\t\t\tif(slowPointerNode == fastPointerNode) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tslowPointerNode = slowPointerNode.getNext();\n\t\t\tfastPointerNode = fastPointerNode.getNext().getNext();\n\t\t}\n\t\t\n\t\treturn false;\n\t}" ]
[ "0.8119962", "0.80667055", "0.788831", "0.7548402", "0.7445042", "0.7296667", "0.7293143", "0.7283916", "0.72656643", "0.7174929", "0.7149107", "0.71481067", "0.7066718", "0.70441556", "0.70439357", "0.70329577", "0.7023651", "0.7017505", "0.7005367", "0.699114", "0.6983964", "0.69598365", "0.69502175", "0.68586135", "0.6842865", "0.6809164", "0.6775017", "0.67328393", "0.6695853", "0.66933084", "0.6672216", "0.66243064", "0.66149366", "0.65983456", "0.65765154", "0.6569159", "0.64912236", "0.64764374", "0.63920397", "0.63561547", "0.63495517", "0.6334553", "0.63098603", "0.6299929", "0.6299752", "0.6297546", "0.626979", "0.6264976", "0.6248847", "0.62403095", "0.6228747", "0.61908156", "0.6180239", "0.6172876", "0.61713195", "0.6161363", "0.61439335", "0.6133412", "0.61307484", "0.61218816", "0.6114432", "0.6092146", "0.60892785", "0.6087636", "0.608629", "0.607618", "0.606718", "0.60389245", "0.6038849", "0.60139847", "0.59926975", "0.5983635", "0.5979427", "0.5977738", "0.59688866", "0.5965514", "0.5963491", "0.5960941", "0.5953865", "0.59492135", "0.59464073", "0.59391415", "0.5933087", "0.5924978", "0.5919421", "0.59156823", "0.59140205", "0.58949184", "0.5892721", "0.5890921", "0.58814573", "0.5875793", "0.5872536", "0.586463", "0.5849956", "0.58496976", "0.58494496", "0.58415437", "0.58240986", "0.5821842" ]
0.7403129
5
checks the result of isInCycle() on a graph in which some vertices are in a cycle, but one is not
@Test public void testPublic13() { Graph<Integer> graph= TestGraphs.testGraph4(); int i; for (i= 0; i < 4; i++) assertTrue(graph.isInCycle(i)); assertFalse(graph.isInCycle(4)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int isCycle( Graph graph){\n int parent[] = new int[graph.V]; \n \n // Initialize all subsets as single element sets \n for (int i=0; i<graph.V; ++i) \n parent[i]=-1; \n \n // Iterate through all edges of graph, find subset of both vertices of every edge, if both subsets are same, then there is cycle in graph. \n for (int i = 0; i < graph.E; ++i){ \n int x = graph.find(parent, graph.edge[i].src); \n int y = graph.find(parent, graph.edge[i].dest); \n \n if (x == y) \n return 1; \n \n graph.Union(parent, x, y); \n } \n return 0; \n }", "private static boolean isCycle(Graph graph) {\n for (int i = 0; i < graph.edges.length; ++i) {\n int x = graph.find(graph.edges[i][0]);\n int y = graph.find(graph.edges[i][1]);\n\n // if both subsets are same, then there is cycle in graph.\n if (x == y) {\n // for edge 2-0 : parent of 0 is 2 == 2 and so we detected a cycle\n return true;\n }\n // keep doing union/merge of sets\n graph.union(x, y);\n }\n return false;\n }", "public boolean hasCycle() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\t\tSet<Vertex> path = new HashSet<Vertex>();\r\n\r\n\t\t// Call the helper function to detect cycle for all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (detectCycle(this.vertices[i], visited, path))\r\n\t\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "private Boolean checkCycle() {\n Node slow = this;\n Node fast = this;\n while (fast.nextNode != null && fast.nextNode.nextNode != null) {\n fast = fast.nextNode.nextNode;\n slow = slow.nextNode;\n if (fast == slow) {\n System.out.println(\"contains cycle\");\n return true;\n }\n }\n System.out.println(\"non-cycle\");\n return false;\n }", "boolean detectCycleUndirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, -1))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static boolean checkEulerCicleGraph() {// es cycle o es tour\r\n\t\tfor (int i = 0; i < V; i++) {\r\n\t\t\tif (outdeg[i] % 2 == 1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean hasNoCycle(int node, int[] color, int[][] graph) {\n if (color[node] > 0)\n return color[node] == 2;\n\n color[node] = 1;\n for (int nei : graph[node]) {\n if (color[nei] == 2)\n continue;\n if (color[nei] == 1 || !hasNoCycle(nei, color, graph))\n return false;\n }\n\n color[node] = 2;\n return true;\n }", "boolean cycle() {\n int j;\t\t\t\t\t\t// If cycle detected report as negative edge weight cycle.\n for (j = 0; j < e; ++j)\n if (d[edges.get(j).u] + edges.get(j).w < d[edges.get(j).v])\n return false;\n return true;\n }", "public static <V> boolean isGraphAcyclic(Graph<V> graph) {\n V[] arrayValores = graph.getValuesAsArray();\n if (arrayValores.length > 1) { // Un grafo con solo un vertice no puede tener ciclos.\n Set<V> conjuntoRevisados = new LinkedListSet<>();\n return profPrimeroCiclos(graph, arrayValores[0], null, conjuntoRevisados);\n }\n return false;\n }", "@Test\n void findCycle() {\n Map<String, Set<String>> nonCyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\")\n );\n assertThat(solution.findCycle(nonCyclicGraph)).isFalse();\n\n // 0\n // / | \\\n // a b c\n // /\\ | /\n // a2 a3 b2\n Map<String, Set<String>> cyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\", \"b2\")\n );\n assertThat(solution.findCycle(cyclicGraph)).isTrue();\n }", "public static boolean cycleInGraph(int[][] edges) {\n int numberOfNodes = edges.length;\n int[] colors = new int[numberOfNodes]; // By default, 0 (WHITE)\n\n for (int i = 0; i < numberOfNodes; i++) {\n\n if (colors[i] != WHITE) // If already visited/finished.\n continue;\n\n boolean isCycle = traverseAndMarkColor(edges, i, colors);\n\n if (isCycle)\n return true;\n }\n return false;\n }", "private boolean checkCycle() {\n for (int i = 0; i < 26; i++) {\n color[i] = 0;\n }\n for (int i = 0; i < 26; i++) {\n if (color[i] != -1 && BFS(i)) return true;\n }\n return false;\n }", "private static boolean isCyclic(Node<Integer> graph) {\r\n\t\tif (graph == null || graph.adjNodes.size() == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tStack<Node<Integer>> recursiveStack = new Stack<Node<Integer>>();\r\n\t\trecursiveStack.add(graph);\r\n\t\tgraph.isVisited = true;\r\n\r\n\t\twhile (!recursiveStack.isEmpty()) {\r\n\t\t\tNode<Integer> temp = recursiveStack.pop();\r\n\r\n\t\t\tfor (int i = 0; i < temp.adjNodes.size(); i++) {\r\n\t\t\t\tif (temp.adjNodes.get(i).isVisited) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trecursiveStack.push(temp.adjNodes.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test public void testPublic11() {\n Graph<Character> graph= TestGraphs.testGraph3();\n\n for (Character ch : graph.getVertices())\n assertFalse(graph.isInCycle(ch));\n }", "boolean isCycleUndirected(SimpleVertex simpleVertex, SimpleVertex parent) {\n\t\tsimpleVertex.parent = parent;\n\n\t\twhile (true) {\n\t\t\tif (simpleVertex.isVisited == false) {\n\t\t\t\tsimpleVertex.isVisited = true;\n\t\t\t\tSystem.out.print(simpleVertex.Vertexname + \" \");\n\t\t\t\tfor (int i = 0; i < simpleVertex.neighborhood.size(); i++) {\n\n\t\t\t\t\tSimpleEdge node = simpleVertex.neighborhood.get(i);\n\t\t\t\t\tnode.EdgeVisited = true;\n\t\t\t\t\t/*\n\t\t\t\t\t * if(simpleVertex.isVisited==node.two.isVisited){\n\t\t\t\t\t * System.out.println(\"cycle present\"); flagUndirected=true; return\n\t\t\t\t\t * flagUndirected; }\n\t\t\t\t\t */\n\n\t\t\t\t\tif (simpleVertex.parent != null && node.two.Vertexname == simpleVertex.parent.Vertexname)\n\t\t\t\t\t\tSystem.out.println(\"skip\");\n\t\t\t\t\telse if (node.two.isVisited == true) {\n\t\t\t\t\t\tSystem.out.println(\"Graph contains a cycle\");\n\t\t\t\t\t\tflagUndirected = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisCycleUndirected(node.two, simpleVertex);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\treturn flagUndirected;\n\n\t}", "private boolean hasCycle() {\n\t\tNode n = head;\n\t\tSet<Node> nodeSeen = new HashSet<>();\n\t\twhile (nodeSeen != null) {\n\t\t\tif (nodeSeen.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tnodeSeen.add(n);\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isCycle(int V, ArrayList<ArrayList<Integer>> adj)\n {\n boolean visited[] = new boolean[V];\n Arrays.fill(visited, false);\n \n for(int i = 0;i<V;i++)\n {\n if(!visited[i] && isCyclicU(i, V, visited, adj))\n return true;\n }\n \n return false;\n \n }", "public void DFS2() {\n boolean[] visited = new boolean[numVertices];\n int[] predecessors = new int[numVertices];\n for (int i = 0; i < numVertices; i++) {\n if (visited[i] == false && hasCycle(0, visited, predecessors)) {\n System.out.println(\"Cycle has found\");\n return;\n }\n }\n System.out.println(\"No cycle found in the graph\");\n }", "public boolean hasCycle(int nodeIndex, int[][] graph, boolean[] visited, boolean[] onStack,\n boolean[] onCycle) {\n\n if (onCycle[nodeIndex]) {\n return true;\n }\n visited[nodeIndex] = true;\n onStack[nodeIndex] = true;\n boolean cycle = false;\n for (int neighbor : graph[nodeIndex]) {\n if (onCycle[neighbor]) {\n cycle = true;\n continue;\n }\n if (!visited[neighbor]) {\n if (hasCycle(neighbor, graph, visited, onStack, onCycle)) {\n onCycle[neighbor] = true;\n cycle = true;\n }\n } else {\n if (onStack[neighbor]) {\n onCycle[neighbor] = true;\n cycle = true;\n }\n }\n }\n onStack[nodeIndex] = false;\n return cycle;\n }", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "public static Boolean isCyclic(Graph g) {\n\n for (Vertex v : g) {\n v.seen = false;\n v.parent = null;\n }\n // Running a DFS to check for cycle\n for (Vertex v : g) {\n if (!v.seen) {\n if (isCyclicUtil(v, v.parent)) {\n return true;\n }\n }\n }\n return false;\n\n }", "public boolean IsCyclic() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "boolean isCyclic() {\n\n // if we are processing the course currently that is a cyclic graph and we can't\n // do all the courses\n if (processed) {\n return false;\n }\n\n // if we already visited the course and no cycle was found then we can return\n if (visited) {\n return true;\n }\n //else we set the course and visited\n visited = true;\n\n //we then loop through all the prerequisites performing the same check\n for (Course preCourse : pre) {\n if (preCourse.isCyclic()) {\n return true;\n }\n }\n\n //if we arrive here then we have gone through all the combinations and there is no cyclic graph\n visited = false;\n processed = true;\n return false;\n }", "public boolean detectCyclesContainingVertex(V v)\n {\n try {\n execute(null, v);\n } catch (CycleDetectedException ex) {\n return true;\n }\n\n return false;\n }", "static boolean isCorrectCycle(Vertex v, LinkedList<Vertex> cycle, int print) {\r\n\r\n boolean ret = true;\r\n\r\n if (print > 1)\r\n System.out.println(\"Checking cycle with vertex \" + v + \": \" + cycle);\r\n\r\n // check for invalid parameters\r\n if (v == null || cycle == null || cycle.isEmpty()) {\r\n if (print > 0)\r\n System.out.println(\"null or empty parameter, no check\");\r\n return false;\r\n }\r\n\r\n // check for too short cycles, 4 is minimum (v-x-y-v)\r\n if (cycle.size() < 4) {\r\n if (print > 0)\r\n System.out.println(\"too short cycle: \" + cycle.size());\r\n ret = false;\r\n }\r\n\r\n // check for correct first and last in cycle\r\n if (cycle.getFirst() != v) {\r\n if (print > 0)\r\n System.out.println(\"Wrong first vertex \" + cycle.getFirst());\r\n ret = false;\r\n }\r\n if (cycle.getLast() != v) {\r\n if (print > 0)\r\n System.out.println(\"Wrong last vertex \" + cycle.getLast());\r\n ret = false;\r\n }\r\n\r\n // extra: check if first and last are different (other than v)\r\n\r\n // check that all successive vertices in list are adjacent in graph\r\n\r\n ListIterator<Vertex> li = cycle.listIterator();\r\n Vertex prev = null;\r\n while (li.hasNext()) {\r\n Vertex w = li.next();\r\n if (prev != null && ! prev.isAdjacent(w)) {\r\n if (print > 0)\r\n System.out.println(\"No edge between \" + prev + \" and \" + w);\r\n ret = false;\r\n }\r\n // check that v is not in the middle of cycle\r\n if (prev != null && li.hasNext() && w == v) {\r\n if (print > 0)\r\n System.out.println(\"Required vertex \" + v + \" in the middle of cycle\");\r\n ret = false;\r\n }\r\n\r\n prev = w;\r\n } // while\r\n\r\n if (print > 1 && ret)\r\n System.out.println(\"Valid cycle\");\r\n\r\n return ret;\r\n\r\n }", "boolean isCycle(SimpleVertex simpleVertex, int length) {\n\n\t\twhile (count != length) {\n\t\t\tif (simpleVertex.isVisited == false) {\n\t\t\t\tsimpleVertex.isVisited = true;\n\t\t\t\tcount++;\n\t\t\t\tSystem.out.print(simpleVertex.Vertexname + \" \");\n\t\t\t\tfor (int i = 0; i < simpleVertex.neighborhood.size(); i++) {\n\n\t\t\t\t\tSimpleEdge node = simpleVertex.neighborhood.get(i);\n\t\t\t\t\tif (node.one.Vertexname == node.two.Vertexname) {\n\n\t\t\t\t\t\tSystem.out.println(\"here ---------------\");\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tisCycle(node.two, length);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\n\t}", "public boolean hasCycle(int g) {\n\t\t//TODO\n\t}", "@SuppressWarnings(\"unchecked\")\r\n private static void cycleTests() throws CALExecutorException {\r\n \r\n final ImmutableDirectedGraph<Integer> noCycles = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 3), Pair.make(1, 3)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthOneCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 1)),\r\n executionContext);\r\n \r\n final ImmutableDirectedGraph<Integer> lengthTwoCycle = ImmutableDirectedGraph\r\n .makeGraph(\r\n Collections.<Integer>emptyList(),\r\n Arrays.asList(Pair.make(1, 2), Pair.make(2, 1)),\r\n executionContext);\r\n \r\n System.out.println(\"noCycle.findCycle(): \" + noCycles.findCycle());\r\n System.out.println(\"oneCycle.findCycle(): \" + lengthOneCycle.findCycle());\r\n System.out.println(\"twoCycle.findCycle(): \" + lengthTwoCycle.findCycle());\r\n }", "private boolean isAcyclic() {\n boolean visited[] = new boolean[getNumNodes()];\n boolean noCycle = true;\n int list[] = new int[getNumNodes() + 1];\n int index = 0;\n int lastIndex = 1;\n list[0] = randomParent;\n visited[randomParent] = true;\n while (index < lastIndex && noCycle) {\n int currentNode = list[index];\n int i = 1;\n\n // verify parents of current node\n while ((i < parentMatrix[currentNode][0]) && noCycle) {\n if (!visited[parentMatrix[currentNode][i]]) {\n if (parentMatrix[currentNode][i] != randomChild) {\n list[lastIndex] = parentMatrix[currentNode][i];\n lastIndex++;\n }\n else {\n noCycle = false;\n }\n visited[parentMatrix[currentNode][i]] = true;\n } // end of if(visited)\n i++;\n }\n index++;\n }\n //System.out.println(\"\\tnoCycle:\"+noCycle);\n return noCycle;\n }", "private static boolean findCyclesInSCC(\n ARGState pStartState,\n ARGState pCurrentState,\n Set<ARGState> pBlockedSet,\n SetMultimap<ARGState, ARGState> pBlockedMap,\n Deque<ARGState> pStack,\n List<List<ARGState>> pAllCycles,\n Set<ARGState> pExcludeSet) {\n\n if (pExcludeSet.contains(pCurrentState)) {\n // Do not regard nodes which were deliberately put into a set of excluded states\n return false;\n }\n\n boolean foundCycle = false;\n pStack.push(pCurrentState);\n pBlockedSet.add(pCurrentState);\n\n for (ARGState successor : pCurrentState.getChildren()) {\n // If the successor is equal to the startState, a cycle has been found.\n // Store contents of stack in the final result.\n if (successor.equals(pStartState)) {\n List<ARGState> cycle = new ArrayList<>();\n pStack.push(pStartState);\n cycle.addAll(pStack);\n Collections.reverse(cycle);\n pStack.pop();\n pAllCycles.add(cycle);\n foundCycle = true;\n } else if (!pBlockedSet.contains(successor)) {\n // Explore this successor only if it is not already in the blocked set.\n boolean gotCycle =\n findCyclesInSCC(\n pStartState, successor, pBlockedSet, pBlockedMap, pStack, pAllCycles, pExcludeSet);\n foundCycle = foundCycle || gotCycle;\n }\n }\n\n if (foundCycle) {\n unblock(pCurrentState, pBlockedSet, pBlockedMap);\n } else {\n for (ARGState s : pCurrentState.getChildren()) {\n pBlockedMap.put(s, pCurrentState);\n }\n }\n pStack.pop();\n\n return foundCycle;\n }", "public boolean checkCyclesRecursive(Integer blockID, LinkedList<Integer> visited){\n System.out.println(\"cc: (block \" + blockID + \") visited: \" + visited);\n if(visited.contains(blockID)){\n return false;\n }\n visited.add(blockID);\n\n /*for (Con connection : this.connections) {\n if(connection.src == blockID){\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(connection.dst, new_visited) == false){\n return false;\n }\n }\n }*/\n\n for(Type output : this.getBlockByID(blockID).outputs)\n {\n /*if(output.getFirstDstID() != -1) {\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(output.getFirstDstID(), new_visited) == false){\n return false;\n }\n }*/\n for (Integer id : output.getAllDstID()) {\n LinkedList<Integer> new_visited = new LinkedList(visited);\n if(checkCyclesRecursive(id, new_visited) == false){\n return false;\n } \n }\n }\n return true;\n }", "public static boolean hasCycle( IntNode head ) {\r\n\t\r\n\t\tfor( IntNode cursor = head; cursor != null; cursor = cursor.link ) {\r\n\t\t\t// otherwise should return false if the list is acyclic\r\n\t\t\tif( cursor.link == null )\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\t// should return true if it is cyclic\r\n\t\treturn true;\r\n\t\t\r\n\t}", "public boolean isCyclic() {\r\n\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\t\tArrayList<String> list = new ArrayList<>(vtces.keySet());\r\n\r\n\t\tfor (String key : list) {\r\n\t\t\tif (processed.containsKey(key))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t// Create a new pair\r\n\t\t\tPair npr = new Pair();\r\n\t\t\tnpr.vname = key;\r\n\t\t\tnpr.psf = key;\r\n\r\n\t\t\t// put pair queue\r\n\t\t\tqueue.addLast(npr);\r\n\r\n\t\t\t// Work while queue is not empty\r\n\t\t\twhile (!queue.isEmpty()) {\r\n\r\n\t\t\t\t// Remove a pair from queue\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\tif (processed.containsKey(rp.vname))\r\n\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t// Put in processed hashmap\r\n\t\t\t\tprocessed.put(rp.vname, True);\r\n\r\n\t\t\t\t// nbrs\r\n\t\t\t\tVertex rpvertex = vtces.get(rp.vname);\r\n\t\t\t\tArrayList<String> nbrs = new ArrayList<>(rpvertex.nbrs.keySet());\r\n\r\n\t\t\t\tfor (String nbr : nbrs) {\r\n\t\t\t\t\t// Process only unprocessed vertex\r\n\t\t\t\t\tif (!processed.containsKey(nbr)) {\r\n\t\t\t\t\t\t// Create a new pair and put in queue\r\n\t\t\t\t\t\tPair np = new Pair();\r\n\t\t\t\t\t\tnp.vname = nbr;\r\n\t\t\t\t\t\tnp.psf = rp.psf + nbr;\r\n\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public interface CycleInGraph<V> {\n boolean hasCycle(Graph<V> graph) ;\n}", "public static boolean hasCycle(ListNode node) {\n\t\treturn true;\n\t}", "public static boolean verifyGraph(Graph<V, DefaultEdge> g)\n {\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n if (v.color == -1)\n {\n System.out.println(\"Did not color vertex \" + v.getID());\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n for (V neighbor : neighbors)\n {\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n return false;\n }\n if (!verifyColor(g, v))\n {\n System.out.println(\"check neighbors of \" + v.getID());\n List<V> neighbors = Graphs.neighborListOf(g, v);\n for (V neighbor : neighbors)\n {\n if (v.color == neighbor.color)\n {\n System.out.println(\"Vertex \" + v.getID() + \" color: \" + v.color);\n System.out.println(\"neighbor \" + neighbor.getID() + \" color: \" + neighbor.color);\n }\n }\n return false;\n }\n }\n return true;\n }", "public static boolean isDeadlocked(List<Vertex> graph) {\n for (Vertex vertex : graph) {\n if (vertex.state == State.UNVISITED && hasCycle(vertex)) {\n return true;\n }\n }\n return false;\n }", "public final boolean isAcyclic() {\n return this.topologicalSort().size() == this.sizeNodes();\n }", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_CycleDetectedInUpstreamNodes() {\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n ValueStreamMap graph = new ValueStreamMap(b, null);\n graph.addUpstreamNode(new PipelineDependencyNode(a, a), null, b);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\"), null, a, new MaterialRevision(null));\n graph.addDownstreamNode(new PipelineDependencyNode(a, a), b);\n graph.addDownstreamNode(new PipelineDependencyNode(c, c), a);\n\n assertThat(graph.hasCycle(), is(true));\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean hasCycle(Node<T> first) {\n Iterator itOne = this.iterator();\n Iterator itTwo = this.iterator();\n try {\n while (true) {\n T one = (T) itOne.next();\n itTwo.next();\n T two = (T) itTwo.next();\n if (one.equals(two)) {\n return true;\n }\n }\n } catch (NullPointerException ex) {\n ex.printStackTrace();\n }\n return false;\n }", "boolean hasIsVertexOf();", "private boolean hamiltonianCycleUtil(int path[], int pos) {\n /* exit condition: If all vertices are included in Hamiltonian Cycle */\n if (pos == V) {\n // And if there is an edge from the last included vertex to the first vertex\n return matrix[path[pos - 1]][path[0]] != 0;\n }\n\n // Try different vertices as a next candidate in Hamiltonian Cycle.\n // We don't try for 0 as we included 0 as starting point in in hamiltonianCycle()\n for (int v = 1; v < V; v++) {\n /* Check if this vertex can be added to Hamiltonian Cycle */\n if (isFeasible(v, path, pos)) {\n path[pos] = v;\n\n /* recur to construct rest of the path */\n if (hamiltonianCycleUtil(path, pos + 1))\n return true;\n\n /* If adding vertex v doesn't lead to a solution,\n then remove it, backtracking */\n path[pos] = -1;\n }\n }\n\n /* If no vertex can be added to Hamiltonian Cycle constructed so far, then return false */\n return false;\n }", "private void treatCycles(SDFGraph graph) throws InvalidExpressionException {\r\n\t\tList<Set<SDFAbstractVertex>> cycles = new ArrayList<Set<SDFAbstractVertex>>();\r\n\t\tCycleDetector<SDFAbstractVertex, SDFEdge> detector = new CycleDetector<SDFAbstractVertex, SDFEdge>(\r\n\t\t\t\tgraph);\r\n\t\tList<SDFAbstractVertex> vertices = new ArrayList<SDFAbstractVertex>(\r\n\t\t\t\tgraph.vertexSet());\r\n\t\twhile (vertices.size() > 0) {\r\n\t\t\tSDFAbstractVertex vertex = vertices.get(0);\r\n\t\t\tSet<SDFAbstractVertex> cycle = detector\r\n\t\t\t\t\t.findCyclesContainingVertex(vertex);\r\n\t\t\tif (cycle.size() > 0) {\r\n\t\t\t\tvertices.removeAll(cycle);\r\n\t\t\t\tcycles.add(cycle);\r\n\t\t\t}\r\n\t\t\tvertices.remove(vertex);\r\n\t\t}\r\n\r\n\t\tfor (Set<SDFAbstractVertex> cycle : cycles) {\r\n\t\t\tint gcd = gcdOfVerticesVrb(cycle);\r\n\t\t\tif (gcd > 1 && !(graph instanceof PSDFGraph)) {\r\n\t\t\t\tcopyCycle(graph, cycle, gcd);\r\n\t\t\t} else if (!(graph instanceof PSDFGraph)) {\r\n\t\t\t\ttreatPSDFCycles(graph, cycle);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// SDFIterator sdfIterator = new SDFIterator(graph);\r\n\t\t// List<SDFAbstractVertex> orderedList = new\r\n\t\t// ArrayList<SDFAbstractVertex>();\r\n\t\t// while (sdfIterator.hasNext()) {\r\n\t\t// SDFAbstractVertex current = sdfIterator.next();\r\n\t\t// orderedList.add(current);\r\n\t\t// if (current instanceof SDFRoundBufferVertex) {\r\n\t\t// int nbTokens = 0;\r\n\t\t// for (SDFEdge edgeData : graph.outgoingEdgesOf(current)) {\r\n\t\t// nbTokens = edgeData.getProd().intValue();\r\n\t\t// }\r\n\t\t// for (int i = orderedList.size() - 1; i >= 0; i--) {\r\n\t\t// if (graph.getAllEdges(orderedList.get(i), current).size() == 1) {\r\n\t\t// if (nbTokens <= 0) {\r\n\t\t// graph.removeAllEdges(orderedList.get(i), current);\r\n\t\t// } else {\r\n\t\t// for (SDFEdge thisEdge : graph.getAllEdges(\r\n\t\t// orderedList.get(i), current)) {\r\n\t\t// nbTokens = nbTokens\r\n\t\t// - thisEdge.getProd().intValue();\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t// // traiter le roundBuffer pour le supprimer\r\n\t\t// if (graph.incomingEdgesOf(current).size() == 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() == 1) {\r\n\t\t// SDFAbstractVertex source = ((SDFEdge) graph\r\n\t\t// .incomingEdgesOf(current).toArray()[0]).getSource();\r\n\t\t// SDFEdge oldEdge = ((SDFEdge) graph.incomingEdgesOf(current)\r\n\t\t// .toArray()[0]);\r\n\t\t// SDFAbstractVertex target = ((SDFEdge) graph\r\n\t\t// .outgoingEdgesOf(current).toArray()[0]).getTarget();\r\n\t\t// SDFEdge refEdge = ((SDFEdge) graph.outgoingEdgesOf(current)\r\n\t\t// .toArray()[0]);\r\n\t\t// SDFEdge newEdge = graph.addEdge(source, target);\r\n\t\t// newEdge.copyProperties(refEdge);\r\n\t\t// graph.removeEdge(refEdge);\r\n\t\t// graph.removeEdge(oldEdge);\r\n\t\t// graph.removeVertex(current);\r\n\t\t// orderedList.remove(current);\r\n\t\t// } else if (graph.incomingEdgesOf(current).size() == 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() > 1) {\r\n\t\t//\r\n\t\t// } else if (graph.incomingEdgesOf(current).size() > 1\r\n\t\t// && graph.outgoingEdgesOf(current).size() == 1) {\r\n\t\t//\r\n\t\t// }\r\n\t\t// }\r\n\t\t// }\r\n\t\t/*\r\n\t\t * { CycleDetector<SDFAbstractVertex, SDFEdge> detect = new\r\n\t\t * CycleDetector<SDFAbstractVertex, SDFEdge>( graph);\r\n\t\t * List<SDFAbstractVertex> vert = new ArrayList<SDFAbstractVertex>(\r\n\t\t * graph.vertexSet()); while (vert.size() > 0) { SDFAbstractVertex\r\n\t\t * vertex = vert.get(0); Set<SDFAbstractVertex> cycle = detect\r\n\t\t * .findCyclesContainingVertex(vertex); if (cycle.size() > 0) {\r\n\t\t * vert.removeAll(cycle); cycles.add(cycle); } vert.remove(vertex); } }\r\n\t\t */\r\n\r\n\t\treturn;\r\n\t}", "private boolean discrimPaths(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node b : nodes) {\n\n //potential A and C candidate pairs are only those\n // that look like this: A<-oBo->C or A<->Bo->C\n List<Node> possAandC = graph.getNodesOutTo(b, Endpoint.ARROW);\n\n //keep arrows and circles\n List<Node> possA = new LinkedList<>(possAandC);\n possA.removeAll(graph.getNodesInTo(b, Endpoint.TAIL));\n\n //keep only circles\n List<Node> possC = new LinkedList<>(possAandC);\n possC.retainAll(graph.getNodesInTo(b, Endpoint.CIRCLE));\n\n for (Node a : possA) {\n for (Node c : possC) {\n if (!graph.isParentOf(a, c)) {\n continue;\n }\n\n LinkedList<Node> reachable = new LinkedList<>();\n reachable.add(a);\n if (reachablePathFindOrient(graph, a, b, c, reachable)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "boolean hasCycle() {\n if (head == null){\n return false;\n }\n Node slow = head;\n Node fast = head;\n while (slow != null && fast != null && fast.next != null){\n slow = slow.next;\n fast = fast.next.next;\n if (slow == fast){\n return true;\n }\n }\n return false;\n }", "int hasCycle(Node head) {\n\t// If list is null\n\tif(head == null) {\n\t\t// No cycle\n\t\treturn 0;\n\t}\n\n\tSet<Node> visitedNodes = new HashSet<Node>();\n\t\n\tNode current = head;\n\n\t// Loop through the list\n\twhile(current != null) {\n\t\t// If we have seen this node befor\n\t\tif(visitedNodes.contains(current)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Add it to the set\n\t\tvisitedNodes.add(current);\n\n\t\t// Update current\n\t\tcurrent = current.next;\n\t}\n\n\t// If we get here, there are no cycles\n\treturn 0;\n}", "void find_negative_cycle(){\n \t\n \tfor(int j = 0; j<E ; j++)\n\t\t{\n\t\t\trelax(edge[j].src, edge[j].destination, edge[j].weight);\n\t\t}\n \tfor(int i = 0; i<V ; i++)\n\t\t{\n \t\tif(x[i] != dist[i])\n\t\t\t{\n \t\t\tNegCycle = true;\n\t\t\t\tSystem.out.println(\"Negative Cycle Found \");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "public boolean hasCycle(ListNode head) {\n ListNode p1 = head;\n ListNode p2 = head;\n while (p2 != null && p2.next != null) {\n \tp1 = p1.next;\n \tif (p2.next != null) {\n \t\tp2 = p2.next.next;\n \t}\n \tif (p1 == p2) {\n \t\treturn true;\n \t}\n }\n return false;\n }", "private boolean containsCycle(TransactionId tid) {\n HashSet<TransactionId> visited = new HashSet<TransactionId>();\n LinkedList<TransactionId> queue = new LinkedList<TransactionId>();\n\n queue.add(tid);\n\n while (!(queue.isEmpty())) {\n TransactionId cur = queue.remove();\n if (visited.contains(cur)) {\n return true;\n }\n\n visited.add(cur);\n\n if (this.dependencyMap.containsKey(cur) && !(this.dependencyMap.get(cur).isEmpty())) {\n Iterator<TransactionId> it = this.dependencyMap.get(cur).iterator();\n while (it.hasNext()) {\n queue.add(it.next());\n }\n }\n }\n\n return false;\n }", "public boolean isCyclic(int V, ArrayList<ArrayList<Integer>> adj)\n {\n // code here\n // System.out.println(V);\n // System.out.println(adj.toString());\n boolean visit[] = new boolean[V];\n boolean recstack[] = new boolean[V];\n for(int i = 0; i < V; i++){\n if(dfs(i, visit, recstack, adj)){\n return true;\n }\n }\n return false;\n }", "@Test\n public void shouldThrowCyclicDependencyExceptionIfACycleIsDetected_DownstreamOfCurrentWasUpstreamOfCurrentAtSomePoint() {\n String grandParent = \"grandParent\";\n String parent = \"parent\";\n String child = \"child\";\n String currentPipeline = \"current\";\n ValueStreamMap graph = new ValueStreamMap(currentPipeline, null);\n graph.addDownstreamNode(new PipelineDependencyNode(child, child), currentPipeline);\n graph.addDownstreamNode(new PipelineDependencyNode(grandParent, grandParent), child);\n graph.addUpstreamNode(new PipelineDependencyNode(parent, parent), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(grandParent, grandParent), null, parent);\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, grandParent, new MaterialRevision(null));\n graph.addUpstreamMaterialNode(new SCMDependencyNode(\"g\",\"g\",\"git\") , null, parent, new MaterialRevision(null));\n\n assertThat(graph.hasCycle(), is(true));\n }", "public static void checkCycleSample() {\n Node ll1_5 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n\n Node ll1_2 = new Node(1, new Node(2, null));\n Node ll3_4 = new Node(3, new Node(4, null));\n Node ll5_6 = new Node(5, new Node(6, null));\n ll1_2.nextNode.nextNode = ll3_4;\n ll3_4.nextNode.nextNode = ll5_6;\n ll5_6.nextNode.nextNode = ll1_2;\n\n ll1_2.checkCycle();\n ll1_5.checkCycle();\n }", "public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n\n ListNode p1 = head.next;\n ListNode p2 = head.next.next;\n while(p1 != null && p2 != null){\n if(p1 == p2){\n return true;\n }\n p1 = p1.next;\n p2 = p2.next;\n if(p2 != null){\n p2 = p2.next;\n }\n }\n return false;\n }", "Cycle getOptimalCycle(Graph<L, T> graph);", "private boolean revisar(DigrafoAristaPonderada G) {\n\n // edge-weighted digraph is cyclic\n if (tieneCiclo()) {\n // verify ciclo\n AristaDirigida primero = null, ultimo = null;\n for (AristaDirigida a : ciclo()) {\n if (primero == null) primero = a;\n if (ultimo != null) {\n if (ultimo.hacia() != a.desde()) {\n System.err.printf(\n \"aristas de ciclo %s and %s no incidentes\\n\",\n ultimo, a);\n return false;\n }\n }\n ultimo = a;\n }\n\n if (ultimo.hacia() != primero.desde()) {\n System.err.printf(\n \"aristas de ciclo %s and %s no incidentes\\n\", \n ultimo, primero);\n return false;\n }\n }\n\n\n return true;\n }", "private boolean findCycles(int v, int s, Vector<Integer>[] adjList)\n {\n boolean f = false;\n this.stack.add(v);\n this.blocked[v] = true;\n\n for (int i = 0; i < adjList[v].size(); i++) {\n int w = adjList[v].get(i);\n // found cycle\n if (w == s) {\n Vector cycle = new Vector();\n for (int j = 0; j < this.stack.size(); j++) {\n int index = this.stack.get(j).intValue();\n cycle.add(this.graphNodes[index]);\n }\n this.cycles.add(cycle);\n\n\n // we hard-limit the cycle number to 10k!!\n if (this.cycles.size() > 10000) {\n break;\n }\n\n f = true;\n }\n else if (!this.blocked[w]) {\n if (this.findCycles(w, s, adjList)) {\n f = true;\n }\n }\n }\n\n if (f) {\n this.unblock(v);\n }\n else {\n for (int i = 0; i < adjList[v].size(); i++) {\n int w = ((Integer) adjList[v].get(i)).intValue();\n if (!this.B[w].contains(new Integer(v))) {\n this.B[w].add(new Integer(v));\n }\n }\n }\n\n this.stack.remove(new Integer(v));\n return f;\n }", "public static boolean isAllVertexConnected(ArrayList<Edge>[] graph)\n {\n int count = 0;\n int n = graph.length;\n boolean[] vis = new boolean[n];\n\n for(int v = 0; v < n; v++) {\n if(vis[v] == false) {\n count++;\n\n //if number of connected components is greater than 1 then graph is not connected\n if(count > 1) {\n return false;\n }\n gcc(graph, v, vis);\n }\n }\n return true;\n\n }", "public boolean hasPath(Graph graph) {\n\t\tif (!isNonZeroDegreeVerticesConnected(graph)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// (2) number of odd vertices has to be between zero to two\n\t\tint vertices = graph.countVertices();\n\t\tint odd = 0;\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\t// counting number of odd vertices\n\t\t\tif (((graph.getNeighbours(i).length & 1) == 1)) {\n\t\t\t\todd++;\n\t\t\t}\n\t\t}\n\n\t\tif (odd <= 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n Set<ListNode> nodes = new HashSet<ListNode>();\n ListNode cur = head;\n while(cur != null){\n if(nodes.contains(cur)){\n return true;\n }\n nodes.add(cur);\n cur = cur.next;\n }\n return false;\n }", "public boolean detectCycles()\n {\n try {\n execute(null, null);\n } catch (CycleDetectedException ex) {\n return true;\n }\n\n return false;\n }", "private boolean hasCycle()\r\n {\r\n boolean passed = false;\r\n for(Field.RadioData dst=radioList; dst!=null; dst=dst.next)\r\n {\r\n if(dst==radioList && passed) return true;\r\n passed = true;\r\n }\r\n return false;\r\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public static boolean hasCycle1(ListNode head) {\n Set<ListNode> visited = new HashSet<>();\n\n while (head != null) {\n if (visited.contains(head)) {\n return true;\n }\n visited.add(head);\n head = head.next;\n }\n\n return false;\n }", "public boolean hasEular(Graph graph) {\n\t\tint vertices = graph.countVertices();\n\t\tint i = 0;\n\t\tint[] x = new int[]{1, 5};\n\t\tfor (i = 0; i < vertices; i++) {\n\t\t\tif (graph.getNeighbours(i).length != 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i == vertices) {\n\t\t\treturn true;\n\t\t}\n\t\t// (2) All vertices with non-zero degree are connected.\n\t\tif (!isNonZeroDegreeVerticesConnected(graph)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// (3) All vertices have even degree.\n\t\t// int vertices = graph.countVertices();\n\t\tint odd = 0;\n\t\tfor (i = 0; i < vertices; i++) {\n\t\t\tif ((graph.getNeighbours(i).length & 1) == 1) {\n\t\t\t\todd++;\n\t\t\t}\n\t\t}\n\n\t\tif (odd > 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean hasCycle(ListNode head) {\n\t\tListNode fast,slow;\n\t\tfast=slow=head;\n\t\twhile(fast!=null & fast.next()!=null) {\n\t\t\tfast=fast.next().next();\n\t\t\tslow=slow.next();\n\t\t\t//Meet at a point\n\t\t\tif (fast==slow) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public boolean reachable(Vertex start, Vertex end){\n\t\tSet<Vertex> reach = this.post(start); \n\t\treturn reach.contains(end);\n\t}", "public List<Integer> eventualSafeNodes(int[][] graph) {\n boolean[] visited = new boolean[graph.length];\n boolean[] onStack = new boolean[graph.length];\n boolean[] onCycle = new boolean[graph.length];\n\n for (int i = 0; i < graph.length; i++) {\n if (!visited[i]) {\n if (hasCycle(i, graph, visited, onStack, onCycle)) {\n onCycle[i] = true;\n }\n }\n // System.out.println(i+ \"-->\"+Arrays.toString(onCycle));\n }\n\n List<Integer> res = new ArrayList<>(visited.length);\n for (int i = 0; i < onCycle.length; i++) {\n if (!onCycle[i]) {\n res.add(i);\n }\n }\n return res;\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "public abstract boolean hasEdge(int from, int to);", "public boolean isCyclic(int[] parent) {\n\t\tfor (Edge edge : this.edgeList) {\n\t\t\tint v1 = edge.u;\n\t\t\tint v2 = edge.v;\n\n\t\t\t// leader dhundo\n\t\t\tint p1 = findParent(parent, v1);\n\t\t\tint p2 = findParent(parent, v2);\n\n\t\t\tif (p1 != p2) {\n\t\t\t\tunion(v1, v2, parent);\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "boolean detectCycledirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tint[] ancestor = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, ancestor))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static boolean connected(Graph grafo) {\r\n\t\tint numVertices = grafo.getVertexNumber();\r\n\t\tSet<Vertice> verticesVisitados = new HashSet<Vertice>(); // sem repeticoes\r\n\t\tfor (Aresta aresta : grafo.getArestas()) {\r\n\t\t\tverticesVisitados.add(aresta.getV1());\r\n\t\t\tverticesVisitados.add(aresta.getV2());\r\n\t\t}\r\n\r\n\t\treturn numVertices == verticesVisitados.size();\r\n\t}", "public boolean isBipartiteUndirectedGraph (){\r\n int[] vertices = new int[getNumV()];\r\n for (int i = 0; i < getNumV(); ++i)\r\n vertices[i] = -1;\r\n\r\n vertices[0] = 1;\r\n\r\n Stack <Integer> q = new Stack<Integer>();\r\n q.push(0);\r\n\r\n while (!q.isEmpty()) {\r\n int current = q.pop();\r\n Iterator<Edge> iter = edgeIterator(current);\r\n while (iter.hasNext()) {\r\n Edge edge = iter.next();\r\n int neighbor = edge.getDest();\r\n if (vertices[neighbor] == -1) {\r\n vertices[neighbor] = 1 - vertices[current];\r\n q.push(neighbor);\r\n }\r\n else if (vertices[neighbor] == vertices[current])\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public boolean IsConnected() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\t\tint counter = 0;\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tcounter++;\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn counter == 1;\r\n\t}", "static boolean hasCycle(Node head) {\n\t\t\n\t\tif(head == null) return false;\n\t\t\n\t\t//Using the concept of one pointer moving faster than another, since at some point both will meet \n\t\t//at the same point and close a cycle (if any).\n\t\tNode slowPointerNode = head;\n\t\tNode fastPointerNode = head.getNext();\n\t\t\n\t\twhile(fastPointerNode != null && fastPointerNode.getNext() != null) {\n\t\t\tif(slowPointerNode == fastPointerNode) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tslowPointerNode = slowPointerNode.getNext();\n\t\t\tfastPointerNode = fastPointerNode.getNext().getNext();\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private List<V> getNewVertexOrderIfAcyclic () {\n Map<V, Integer> indegree = inDegree();\n // Determine all vertices with zero in-degree\n Stack<V> zeroIncomingVertex = new Stack<V>(); \n for (V v: indegree.keySet()) {\n if (indegree.get(v) == 0) zeroIncomingVertex.push(v);\n }\n \n // Determine the vertex order\n List<V> result = new ArrayList<V>();\n while (!zeroIncomingVertex.isEmpty()) {\n V v = zeroIncomingVertex.pop(); // Choose a vertex with zero in-degree\n result.add(v); // Vertex v is next in vertex ordering\n // \"Remove\" vertex v by updating its neighbors\n for (V neighbor: dag.get(v)) {\n indegree.put(neighbor, indegree.get(neighbor) - 1);\n // Remember any vertices that now have zero in-degree\n if (indegree.get(neighbor) == 0) zeroIncomingVertex.push(neighbor);\n }\n }\n // Check that we have used the entire graph. If not then there was a cycle.\n if (result.size() != dag.size()) return null;\n return result;\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "private boolean hasCycle1() {\n\t\tNode slow = head;\n\t\tNode fast = head;\n\t\t\n\t\twhile (fast != null && fast.next != null) {\n\t\t\tslow = slow.next;\n\t\t\tfast = fast.next.next;\n\t\t\tif(slow == fast) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasCycle2(ListNode head) {\n if (head == null || head.next == null) {\n return false;\n }\n\n ListNode p1 = head;\n ListNode p2 = head.next.next;\n\n while (p2 != null && p2.next != null) {\n p1 = p1.next;\n p2 = p2.next.next;\n\n if (p1 == p2) {\n return true;\n }\n }\n\n return false;\n }", "private static boolean isAcyclic(int index, BitSet onStack, BitSet visited,\n\t\t\tAutomaton automaton) {\n\n\t\tif (onStack.get(index)) {\n\t\t\treturn false; // found a cycle!\n\t\t}\n\n\t\tif (visited.get(index)) {\n\t\t\t// Ok, we've traversed this node before and it checked out OK.\n\t\t\treturn true;\n\t\t}\n\n\t\tvisited.set(index);\n\t\tonStack.set(index);\n\n\t\tAutomaton.State state = automaton.get(index);\n\t\tif (state instanceof Automaton.Term) {\n\t\t\tAutomaton.Term term = (Automaton.Term) state;\n\t\t\tif (term.contents != Automaton.K_VOID) {\n\t\t\t\tif (!isAcyclic(term.contents, onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (state instanceof Automaton.Collection) {\n\t\t\tAutomaton.Collection compound = (Automaton.Collection) state;\n\t\t\tint[] children = compound.children;\n\t\t\tfor (int i = 0; i != compound.length; ++i) {\n\t\t\t\tif (!isAcyclic(children[i], onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tonStack.set(index, false);\n\n\t\treturn true;\n\t}", "public List<Integer> eventualSafeNodes(int[][] graph) {\n int N = graph.length;\n int[] color = new int[N];\n List<Integer> ans = new ArrayList<>();\n\n for (int i = 0; i < N; i++) {\n if (hasNoCycle(i, color, graph))\n ans.add(i);\n }\n\n return ans;\n }", "boolean hasCycle(Node head) {\n node = head;\n //h.add(node.data);//just add the first one //node = node.next; //get to the next one where we, at 2nd best case, will Find Cycle\n while (node.next != null){\n if ( h.contains(node.data) ){\n return true;\n }else {\n h.add(node.data);\n }\n node = node.next;\n }\n return false;\n }", "@Override\n public boolean onRecurse(DefaultGraph graph, int cycleStart,\n int cycleSecond, int lastVertex, int current, int currentFaces,\n int edgesLeft, int edgesInCurrentCycle)\n {\n int girth = graph.getGirth();\n \n /* Minimum number of edges needed to finnish current cycle. */\n int neededInCurrent;\n if(edgesInCurrentCycle >= girth) {\n if(graph.hasEdge(current, cycleStart))\n neededInCurrent = 1;\n else\n neededInCurrent = 2;\n } else {\n neededInCurrent = girth - edgesInCurrentCycle;\n }\n \n /* Simple bounding based on edges left/current number of faces. The\n * +1 is the cycle we're currently working on. */\n int estimate = currentFaces + 1 + (edgesLeft - neededInCurrent) / girth;\n \n /* If we are not going to get higher than our previous result, we can\n * bound. Note that we add 1 to our previous result, this is because\n * either all results will be even, or all results will be odd. */\n if(estimate <= previousResult + 1) {\n return false;\n }\n \n /*float depth = (float) edgesLeft / (float) graph.getNumberOfEdges();\n if(previousResult >= 0 && current < 0 &&\n estimate * 0.8f <= previousResult && depth >= 0.3f) {\n if(graph.estimate() <= previousResult) {\n return false;\n }\n }*/\n \n return true;\n }", "public void removeGraphCycles() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tint[] cycleCount = new int[map.size()];\r\n\t\tforComplexMotion = new boolean[map.size()];\r\n\t\t//count cycles\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(i != j) {\r\n\t\t\t\t\tif(graph[i][j] && graph[j][i]) {\r\n\t\t\t\t\t\tcycleCount[i]++;\r\n\t\t\t\t\t\tcycleCount[j]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//remove fobjects from linear motion planning\r\n\t\tboolean hasCycles = true;\r\n\t\twhile(hasCycles) {\r\n\t\t\tint max = 0;\r\n\t\t\tint maxIndex = -1;\r\n\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\tif(cycleCount[i] > max) {\r\n\t\t\t\t\tmax = cycleCount[i];\r\n\t\t\t\t\tmaxIndex = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(maxIndex == -1) {\r\n\t\t\t\thasCycles = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcycleCount[maxIndex] = 0;\r\n\t\t\t\tforComplexMotion[maxIndex] = true;\r\n\t\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\t\tgraph[maxIndex][i] = false;\r\n\t\t\t\t\tgraph[i][maxIndex] = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public Set<V> findCycles()\n {\n // ProbeIterator can't be used to handle this case,\n // so use StrongConnectivityAlgorithm instead.\n StrongConnectivityAlgorithm<V, E> inspector =\n new KosarajuStrongConnectivityInspector<>(graph);\n List<Set<V>> components = inspector.stronglyConnectedSets();\n\n // A vertex participates in a cycle if either of the following is\n // true: (a) it is in a component whose size is greater than 1\n // or (b) it is a self-loop\n\n Set<V> set = new LinkedHashSet<>();\n for (Set<V> component : components) {\n if (component.size() > 1) {\n // cycle\n set.addAll(component);\n } else {\n V v = component.iterator().next();\n if (graph.containsEdge(v, v)) {\n // self-loop\n set.add(v);\n }\n }\n }\n\n return set;\n }", "private boolean connected(DepthFirstSearch dfs, Graph G) {\n return dfs.count() == G.V();\r\n }", "public boolean\n checkCycle(int nd, ArrayList<ArrayList<Integer>> adj,\n cycleHelper cyHlp) {\n // insert into stack\n cyHlp.isStack[nd] = true;\n for (int it : adj.get(nd)) {\n // if next node is visited\n if (cyHlp.visited[it] == true) {\n // if the node is in stack then cycle is found\n if (cyHlp.isStack[it] == true) return true;\n continue;\n }\n cyHlp.visited[it] = true;\n if (checkCycle(it, adj, cyHlp)) return true;\n }\n // removing from stack\n cyHlp.isStack[nd] = false;\n return false;\n }", "public DirectedCycle(Digraph G) {\n onStack = new boolean[G.V()];\n marked = new boolean[G.V()];\n edgeTo = new int[G.V()];\n\n //Cycle through each vertex to see if it is in a cycle\n for (int v = 0; v < G.V(); v++) {\n if (marked[v] == false) {\n dfs(G, v);\n }\n }\n }", "protected boolean hasCycle(Map<Object, Object> data) {\n return Boolean.TRUE == data.get(DATA_CLOSURE_CYCLIC); \n }", "public boolean reducible() {\n if (dfsTree.back.isEmpty()) {\n return true;\n }\n int size = controlFlow.transitions.length;\n boolean[] loopEnters = dfsTree.loopEnters;\n TIntHashSet[] cycleIncomings = new TIntHashSet[size];\n // really this may be array, since dfs already ensures no duplicates\n TIntArrayList[] nonCycleIncomings = new TIntArrayList[size];\n int[] collapsedTo = new int[size];\n int[] queue = new int[size];\n int top;\n for (int i = 0; i < size; i++) {\n if (loopEnters[i]) {\n cycleIncomings[i] = new TIntHashSet();\n }\n nonCycleIncomings[i] = new TIntArrayList();\n collapsedTo[i] = i;\n }\n\n // from whom back connections\n for (Edge edge : dfsTree.back) {\n cycleIncomings[edge.to].add(edge.from);\n }\n // from whom ordinary connections\n for (Edge edge : dfsTree.nonBack) {\n nonCycleIncomings[edge.to].add(edge.from);\n }\n\n for (int w = size - 1; w >= 0 ; w--) {\n top = 0;\n // NB - it is modified later!\n TIntHashSet p = cycleIncomings[w];\n if (p == null) {\n continue;\n }\n TIntIterator iter = p.iterator();\n while (iter.hasNext()) {\n queue[top++] = iter.next();\n }\n\n while (top > 0) {\n int x = queue[--top];\n TIntArrayList incoming = nonCycleIncomings[x];\n for (int i = 0; i < incoming.size(); i++) {\n int y1 = collapsedTo[incoming.getQuick(i)];\n if (!dfsTree.isDescendant(y1, w)) {\n return false;\n }\n if (y1 != w && p.add(y1)) {\n queue[top++] = y1;\n }\n }\n }\n\n iter = p.iterator();\n while (iter.hasNext()) {\n collapsedTo[iter.next()] = w;\n }\n }\n\n return true;\n }", "boolean isCircular();", "private static boolean checkAndAddDependency(int trans_id, int independent_trans_id) {\n List<Integer> txnsInCycle = new ArrayList<Integer>();\n txnsInCycle.add(trans_id);\n if (DeadlockHandler.isThereACycleInGraph(trans_id, independent_trans_id, txnsInCycle)) {\n // System.out.println(\"List contents are\" + txnsInCycle.toString());\n long youngestTxnTime = transactions.get(txnsInCycle.get(0)).getStartTime();\n Integer youngestTxnId = txnsInCycle.get(0);\n for (Integer t : txnsInCycle) {\n if (youngestTxnTime < transactions.get(t).getStartTime()) {\n youngestTxnTime = transactions.get(t).getStartTime();\n youngestTxnId = t;\n }\n }\n\n\n\n System.out.println(\"Cycle in graph. DEADLOCK\");\n System.out.println(\"Aborted : T\" + youngestTxnId);\n releaseResources(youngestTxnId);\n clearWaitingOperations();\n if (youngestTxnId != trans_id && youngestTxnId != independent_trans_id) {\n DeadlockHandler.addDependencyEdge(independent_trans_id, trans_id);\n return true;\n }\n\n\n\n return false;\n\n }\n\n else {\n\n // if edge exists we don't need to do anything\n if (!DeadlockHandler.ifThereIsAnEdgeFromT1toT2(trans_id, independent_trans_id)) {\n\n // System.out.println(\"checkAndAddDependency::Edge is not present\");\n // System.out.println(\"checkAndAddDependency::Add dependency edge\");\n // no deadlock hence we can add the edge\n DeadlockHandler.addDependencyEdge(independent_trans_id, trans_id);\n }\n }\n\n return true;\n }", "public boolean isNegativeCycle(int destination){\n\t\treturn hasNegativeCycle[destination];\n\t}", "public boolean hasCycle(ListNode head) {\n if (head == null) {\n return false;\n }\n ListNode slow = head;\n ListNode fast = head;\n \n while (slow != null) {\n slow = slow.next;\n if (fast != null && fast.next != null) {\n fast = fast.next.next;\n } else {\n return false;\n }\n if (slow == fast)\n return true;\n }\n return false;\n }", "@Test\n public void shouldNotConsiderTriangleDependencyAsCyclic(){\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n String d = \"D\";\n ValueStreamMap valueStreamMap = new ValueStreamMap(c, null);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(a, a), null, c);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(b, b), null, c);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(d, d), null, b);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(a, a), null, d);\n valueStreamMap.addUpstreamMaterialNode(new SCMDependencyNode(\"g\", \"g\", \"git\"), null, a, new MaterialRevision(null));\n\n assertThat(valueStreamMap.hasCycle(), is(false));\n }", "public int inDegree(int vertex) {\n int count = 0;\n//your code here\n for(int i=0; i<adjLists.length; i++){\n if(i==vertex){ continue;}\n if(isAdjacent(i,vertex)){\n count++;\n continue;\n }\n }\n return count;\n }", "public boolean detect_cycle_directed_util(int v,boolean visited[], boolean curr_visited[]) {\n\t\t\n\t\tvisited[v]=true;\n\t\tcurr_visited[v]=true;\n\t\t\n\t\t\n\t\tfor(int neighbour:adj[v]) {\n\t\t\t\n\t\t\tif(curr_visited[neighbour]) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if(!visited[neighbour]&&detect_cycle_directed_util(neighbour,visited,curr_visited)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tcurr_visited[v]=false;\n\t\t\n\t\treturn false;\n\t\t\n\t}" ]
[ "0.80471146", "0.79410887", "0.7854335", "0.7427628", "0.7411035", "0.74053323", "0.72727233", "0.7265673", "0.7195885", "0.71682", "0.70703954", "0.7061263", "0.70322907", "0.69821227", "0.6971202", "0.6966055", "0.69585127", "0.6955309", "0.6953422", "0.6908964", "0.68839675", "0.68611217", "0.6859504", "0.6818011", "0.681061", "0.6802461", "0.6767506", "0.6717438", "0.6690909", "0.65239793", "0.65012246", "0.6479878", "0.6479759", "0.6475376", "0.64440566", "0.64208496", "0.6367688", "0.6365573", "0.6313915", "0.6309663", "0.63096", "0.62814575", "0.6266356", "0.625364", "0.62528276", "0.62460834", "0.62280524", "0.62247264", "0.6193553", "0.6189611", "0.6143453", "0.6132274", "0.6125648", "0.6111074", "0.61040026", "0.61007565", "0.6099748", "0.6098934", "0.60961574", "0.6087307", "0.608337", "0.6075798", "0.60655665", "0.6064757", "0.6054077", "0.6049916", "0.6042034", "0.60376966", "0.6031993", "0.60222286", "0.6019343", "0.60067683", "0.6001782", "0.5999453", "0.5996934", "0.59901667", "0.5977032", "0.5947471", "0.59412843", "0.5931608", "0.591489", "0.5914304", "0.59142315", "0.59074986", "0.59067917", "0.5900531", "0.59002525", "0.5872967", "0.58667344", "0.58644634", "0.5861158", "0.5855898", "0.5851796", "0.5851269", "0.58408767", "0.5821407", "0.58178794", "0.58080614", "0.5801833", "0.57957834" ]
0.6787413
26
calls Dijkstra's algorithm on vertices in a linear graph and checks its results
@Test public void testPublic14() { Graph<String> graph= TestGraphs.testGraph2(); List<String> shortestPath= new ArrayList<String>(); assertEquals(1, graph.Dijkstra("apple", "banana", shortestPath)); assertEquals("apple banana", TestGraphs.listToString(shortestPath)); assertEquals(2, graph.Dijkstra("apple", "cherry", shortestPath)); assertEquals("apple banana cherry", TestGraphs.listToString(shortestPath)); assertEquals(3, graph.Dijkstra("apple", "date", shortestPath)); assertEquals("apple banana cherry date", TestGraphs.listToString(shortestPath)); assertEquals(4, graph.Dijkstra("apple", "elderberry", shortestPath)); assertEquals("apple banana cherry date elderberry", TestGraphs.listToString(shortestPath)); assertEquals(5, graph.Dijkstra("apple", "fig", shortestPath)); assertEquals("apple banana cherry date elderberry fig", TestGraphs.listToString(shortestPath)); assertEquals(6, graph.Dijkstra("apple", "guava", shortestPath)); assertEquals("apple banana cherry date elderberry fig guava", TestGraphs.listToString(shortestPath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}", "void dijkstra(int[][] graph){\r\n int dist[] = new int[rideCount];\r\n Boolean sptSet[] = new Boolean[rideCount];\r\n\r\n for(int i = 0; i< rideCount; i++){\r\n dist[i] = Integer.MAX_VALUE;\r\n sptSet[i] = false;\r\n }\r\n\r\n dist[0] = 0;\r\n\r\n for(int count = 0; count< rideCount -1; count++){\r\n int u = minWeight(dist, sptSet);\r\n sptSet[u] = true;\r\n for(int v = 0; v< rideCount; v++){\r\n if (!sptSet[v] && graph[u][v] != 0 && dist[u] + graph[u][v] < dist[v]){\r\n dist[v] = dist[u] + graph[u][v];\r\n }\r\n }\r\n }\r\n printSolution(dist);\r\n }", "public void testDijkstra() {\n \t\tfinal Dijkstra model = new Dijkstra();\n \t\tfinal Formula noDeadlocks = model.dijkstraPreventsDeadlocksAssertion();\n \t\tfinal Solution sol = solve(noDeadlocks, model.bounds(6,6,6));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 4344 18609\n //\t\tprimary variables: 444\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(444, sol.stats().primaryVariables());\n \t\tassertEquals(4344, sol.stats().variables());\n\t\tassertEquals(18609, sol.stats().clauses());\n \t}", "void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "private static List<Vertex> doDijkstra(List<Vertex> vertexes) {\n\n\t\t// Zok, we have a graph constructed. Traverse.\n\t\tPriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(me);\n\t\tme.setMinDistance(0);\n\n\t\twhile (!vertexQueue.isEmpty()) {\n\t\t\tVertex v = vertexQueue.poll();\n\t\t\tdouble distance = v.getMinDistance() + 1;\n\n\t\t\tfor (Vertex neighbor : v.getAdjacencies()) {\n\t\t\t\tif (distance < neighbor.getMinDistance()) {\n\t\t\t\t\tneighbor.setMinDistance(distance);\n\t\t\t\t\tneighbor.setPrevious(v);\n\t\t\t\t\tvertexQueue.remove(neighbor);\n\t\t\t\t\tvertexQueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn vertexes;\n\t}", "@Test public void testPublic18() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(13, graph.Dijkstra(250, 141, shortestPath));\n assertEquals(\"250 351 132 141\", TestGraphs.listToString(shortestPath));\n }", "@Test public void testPublic17() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(8, graph.Dijkstra(131, 141, shortestPath));\n assertEquals(\"131 330 132 141\", TestGraphs.listToString(shortestPath));\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "public static void liveDemo() {\n Scanner in = new Scanner( System.in );\n float srcTank1, srcTank2, destTank;\n int alternetPaths;\n Graph mnfld = new Graph();\n boolean runSearch = true;\n\n //might need to limit query results, too large maybe?\n //newnodes = JDBC.graphInformation(); //returns arraylist of nodes\n //mnfld.setPipes(newnodes); //set nodes to the manifold\n //JDBC.insertConnections(mnfld);\n\n//\t\t /*\n//\t\t\tfor (int i = 0; i < newnodes.length(); i++) { //length might be wrong\n//\t\t\t\t//need to look for way to add edges by looking for neighbor nodes i think\n//\t\t\t\t//loop through nodes and create Edges\n//\t\t\t\t//might need new query\n//\t\t\t\tnewedges.addEdge(node1,node2,cost);\n//\t\t\t}\n//\n//\t\t\tmnfld.setConnections(newedges);\n//\n//\t\t\tup to this point, graph should be global to Dijkstra and unused.\n//\t\t\tloop until user leaves page\n//\t\t\tget input from user for tanks to transfer\n//\t\t\tfind shortest path between both tanks\n//\t\t\tend loop\n//\t\t\tthis will change depending how html works so not spending any time now on it\n//\t\t*/\n //shortestPath.runTest();\n\n shortestPath.loadGraph( mnfld );\n while (runSearch) {\n // Gets user input\n System.out.print( \"First Source Tank: \" );\n srcTank1 = in.nextFloat();\n System.out.print( \"Second Source Tank: \" );\n srcTank2 = in.nextFloat();\n System.out.print( \"Destination Tank: \" );\n destTank = in.nextFloat();\n System.out.print( \"Desired Number of Alternate Paths: \" );\n alternetPaths = in.nextInt();\n\n // Prints outputs\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"True shortest with alt paths\" );\n Dijkstra.findAltPaths( mnfld, alternetPaths, srcTank1, destTank );\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering used connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), true );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering only open connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), false );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Merge Lineup\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ) );\n System.out.println( \"\\t Original Lineup: \" );\n mnfld.getPipe( destTank ).printLine();\n System.out.println( \"\\t Merged Lineup: \" );\n Dijkstra.mergePaths( mnfld, srcTank2, mnfld.getPipe( destTank ).getPath(), mnfld.getPipe( destTank ) );\n System.out.print( \"\\nRun another search [1:Yes, 0:No] :: \" );\n if (in.nextInt() == 0) runSearch = false;\n else System.out.println( \"\\n\\n\\n\" );\n }\n\n\n }", "public void floyd(TripartiteGraph graph) throws Exception\n\t{\n\t\tint size = graph.numNodes();\n\t\tSparseMatrix matrix = (SparseMatrix) graph.matrix();\n\t\t// initialize dist\n\t\tfor (int i = 0; i < size; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t{\n\t\t\t\tif (!matrix.containRowCol(i, j))\n\t\t\t\t\tdist[i][j] = INF;\n\t\t\t\telse\n\t\t\t\t\tdist[i][j] = (int) matrix.at(i, j);\n\t\t\t}\n\t\t}\n\t\tfor (int k = 0; k < size; k++)\n\t\t{\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t\t{\n\t\t\t\t\tif (dist[i][k] != INF && dist[k][j] != INF\n\t\t\t\t\t\t\t&& dist[i][k] + dist[k][j] < dist[i][j])\n\t\t\t\t\t{\n\t\t\t\t\t\tdist[i][j] = dist[i][k] + dist[k][j];\n\t\t\t\t\t\tpath.set(i, j, k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testDijkstra() throws Exception {\n String graphFileName = \"algorithm/graph/shortestpath/weighted/weightedGraph.txt\";\n Graph graph = Graph.createGraphFromFile(WeightedShortestPath.class.getResource(\"/\").getPath() + File.separator +\n graphFileName);\n\n System.out.println(\"==============Graph before weighted shortest path found==============\");\n graph.printGraph();\n\n WeightedShortestPath.dijkstra(graph, graph.getVertex(\"v1\"));\n System.out.println(\"======Graph after weighted shortest path found by Dijkstra's algorithm=====\");\n graph.printGraph();\n\n System.out.println(\"===================Print the path to each vertex====================\");\n for (Vertex v: graph.getVertexMap().values()) {\n graph.printPath(v);\n System.out.println();\n }\n System.out.println();\n }", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Test public void testPublic16() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(5, graph.Dijkstra(131, 351, shortestPath));\n assertEquals(\"131 330 351\", TestGraphs.listToString(shortestPath));\n }", "private void DijkstrasAlgoritm(List<Vertex<T>> vertexes){\n\t\tIterator<Vertex<T>> i = vertexes.iterator();\n\t\tVertex<T> smallest = null;\n\t\twhile(i.hasNext()){\n\t\t\tVertex<T> current = i.next();\n\t\t\t\n\t\t\tif(current.getStatus() != Vertex.Status.Used){\n\t\t\t\tif(smallest == null){\n\t\t\t\t\tsmallest = current;\n\t\t\t\t}else if(smallest.getDistance() > current.getDistance()){\n\t\t\t\t\tsmallest = current;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(smallest != null){\n\t\t\tDijkstrasAlgoritm(smallest);\n\t\t\tDijkstrasAlgoritm(vertexes);\n\t\t}\n\t\t\n\t\tprepToString(vertexes);\n\t}", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "public Dijkstra(Grafo<K, Integer> grafo, Vertice<K, Integer> vertOrigem) {\n\t\t\n\t\tthis.vertices = grafo.getVertices();\n\t\tthis.vertOrigem = vertOrigem;\n\t\t\n\t\tint total = vertices.size();\n\t\tboolean visitado[] = new boolean[total];\n\t\tthis.solucao = new Object[total][2]; // [0] = distancia [1] = vertice adjacente\n\t\t\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tsolucao[i][0] = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint vIndex = vertices.indexOf(vertOrigem);\n\t\tsolucao[vIndex][0] = 0;\n\t\tsolucao[vIndex][1] = vertOrigem;\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tVertice<K, Integer> y = null;\n\t\t\t\n\t\t\tfor (int z = 0; z < total; z++) {\n\t\t\t\tif (visitado[z]) continue;\n\t\t\t\tif ((Integer)solucao[z][0] < min) {\n\t\t\t\t\tmin = (Integer)solucao[z][0];\n\t\t\t\t\ty = vertices.get(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (min == Integer.MAX_VALUE) break;\n\t\t\t\n\t\t\tint yIndex = vertices.indexOf(y);\n\t\t\t\n\t\t\tList<Aresta<K, Integer>> arestas = y.getArestas();\n\t\t\tfor (Aresta<K, Integer> a:arestas) {\n\t\t\t\t\n\t\t\t\tVertice<K, Integer> w = a.getVertices()[0];\n\t\t\t\tint wIndex = vertices.indexOf(w);\n\t\t\t\tif (visitado[wIndex]) continue;\n\t\t\t\t\n\t\t\t\tif ((Integer)solucao[yIndex][0] + a.getValor() < (Integer)solucao[wIndex][0]) {\n\t\t\t\t\tsolucao[wIndex][0] = (Integer)solucao[yIndex][0] + a.getValor();\n\t\t\t\t\tsolucao[wIndex][1] = y;\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tvisitado[yIndex] = true;\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "public double dijkstra(NodoArista[][] adjacencyMatrix, int startVertex, int nodoBuscado, ListaEnlazada lista) {\n int nVertices = adjacencyMatrix[0].length;\n // shortestDistances[i] will hold the shortest distance from src to i\n double[] shortestDistances = new double[nVertices];\n double[] precios = new double[nVertices];\n // added[i] will true if vertex i is included / in shortest path tree or shortest distance from src to i is finalized \n boolean[] added = new boolean[nVertices];\n\n // Initialize all distances as INFINITE and added[] as false \n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n shortestDistances[vertexIndex] = Integer.MAX_VALUE;\n precios[vertexIndex] = Integer.MAX_VALUE;\n added[vertexIndex] = false;\n }\n // Distance of source vertex from itself is always 0 \n shortestDistances[startVertex] = 0;\n precios[startVertex] = 0;\n // Parent array to store shortest path tree \n int[] parents = new int[nVertices];\n // The starting vertex does not have a parent \n parents[startVertex] = NO_PARENT;\n\n // Find shortest path for all vertices \n for (int i = 1; i < nVertices; i++) {\n // Pick the minimum distance vertex from the set of vertices not yet processed. nearestVertex is always equal to startNode in first iteration. \n int nearestVertex = -1;\n double shortestDistance = Integer.MAX_VALUE;\n double precio = Integer.MAX_VALUE;\n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n if (!added[vertexIndex] && shortestDistances[vertexIndex] < shortestDistance) {\n nearestVertex = vertexIndex;\n shortestDistance = shortestDistances[vertexIndex];\n precio = precios[vertexIndex];\n }\n }\n\n // Mark the picked vertex as processed \n added[nearestVertex] = true;\n\n // Update dist value of the adjacent vertices of the picked vertex. \n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n double edgeDistance = adjacencyMatrix[nearestVertex][vertexIndex].getPeso();\n double precioActual = adjacencyMatrix[nearestVertex][vertexIndex].getPrecio();\n double edgePrice = adjacencyMatrix[nearestVertex][vertexIndex].getPrecio();\n if (edgeDistance > 0 && ((shortestDistance + edgeDistance) < shortestDistances[vertexIndex])) {\n parents[vertexIndex] = nearestVertex;\n shortestDistances[vertexIndex] = shortestDistance + edgeDistance;\n precios[vertexIndex] = precio + precioActual;\n }\n if (edgePrice > 0 && ((shortestDistance + edgeDistance) < shortestDistances[vertexIndex])) {\n parents[vertexIndex] = nearestVertex;\n shortestDistances[vertexIndex] = shortestDistance + edgeDistance;\n precios[vertexIndex] = precio + precioActual;\n }\n }\n }\n printSolution(startVertex, shortestDistances, parents);\n printSolutionPara(startVertex, shortestDistances, parents, nodoBuscado, lista);\n\n return precios[nodoBuscado];\n }", "public DjkstraAlgo(int vertices) {\n\n\t\tthis.vertices = vertices;\n\t\tthis.graph = new LinkedList[vertices];\n\t\tdist = new int[vertices];\n\t\tq = new PriorityQueue(vertices, new Node()); // to order priority queue based on comparator we use 2 argument constructor\n\t\tvisited = new HashSet<>();\n\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\tgraph[i] = new LinkedList<>(); // initialised to make new list here instead of null\n\t\t}\n\t}", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "private void compare_with_dijkstra(Weighting w) {\n final long seed = System.nanoTime();\n final int numQueries = 1000;\n\n Random rnd = new Random(seed);\n int numNodes = 100;\n GHUtility.buildRandomGraph(graph, rnd, numNodes, 2.2, true, speedEnc, null, 0.8, 0.8);\n GHUtility.addRandomTurnCosts(graph, seed, null, turnCostEnc, maxTurnCosts, turnCostStorage);\n\n long numStrictViolations = 0;\n for (int i = 0; i < numQueries; i++) {\n int source = rnd.nextInt(numNodes);\n int target = rnd.nextInt(numNodes);\n Path dijkstraPath = new Dijkstra(graph, w, TraversalMode.EDGE_BASED).calcPath(source, target);\n Path path = calcPath(source, target, ANY_EDGE, ANY_EDGE, w);\n assertEquals(dijkstraPath.isFound(), path.isFound(), \"dijkstra found/did not find a path, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n assertEquals(dijkstraPath.getWeight(), path.getWeight(), 1.e-6, \"weight does not match dijkstra, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n // we do not do a strict check because there can be ambiguity, for example when there are zero weight loops.\n // however, when there are too many deviations we fail\n if (\n Math.abs(dijkstraPath.getDistance() - path.getDistance()) > 1.e-6\n || Math.abs(dijkstraPath.getTime() - path.getTime()) > 10\n || !dijkstraPath.calcNodes().equals(path.calcNodes())) {\n numStrictViolations++;\n }\n }\n if (numStrictViolations > Math.max(1, 0.05 * numQueries)) {\n fail(\"Too many strict violations, seed: \" + seed + \" - \" + numStrictViolations + \" / \" + numQueries);\n }\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\r\n void test_insert_50_vertex_check() {\r\n String str;\r\n for(int i = 0; i < 50; i++) {\r\n str = \"\" + i;\r\n graph.addVertex(str);\r\n }\r\n vertices = graph.getAllVertices();\r\n for(int j = 0; j < 50; j++) {\r\n str = \"\" + j;\r\n if (!vertices.contains(str))\r\n fail(\"Insert not working!!\");\r\n }\r\n }", "public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "boolean hasIsVertexOf();", "public void Djkstra(int source) {\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE; // added infinity to all ,\n\t\t}\n\t\t\n\t\tdist[source] = 0;\n\n\t\t// add source vertex to priority queue\n\t\tq.add(new Node(source, 0));\n\n\n\t\t// while my all vertices are not selected as a min among smallest one time\n\t\t// refracted in visited\n\t\twhile (visited.size() != vertices) {\n\n\t\t\t// pick from priority queue the smallest/min distance\n\t\t\tint i = q.remove().node;\n\n\t\t\t// once node is removed from queue add to set\n\t\t\tvisited.add(i);\n\n\t\t\t// relax adjacent vertex of this node;\n\t\t\t// And add the new node to queue bcoz distance has got updated so add new node as i dont have any method to update \n\t\t\t// already present node and its distance\n\t\t\t\n\n\t\t\tfor (Node v : graph[i]) {\n\t\t\t\tif (!visited.contains(v.node)) {\n\t\t\t\t\tif (dist[i] + v.cost < dist[v.node]) {\n\t\t\t\t\t\tdist[v.node] = dist[i] + v.cost;\n\t\t\t\t\t\tq.add(new Node(v.node, dist[v.node]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "public void dijkstraAllPairs(boolean print) {\r\n int numSuccesses = 0;\r\n long totalTimeSuccesses = 0;\r\n if (print) System.out.println(\"Paths between all pairs of vertices using Dijkstra's algorithm:\");\r\n for (int i = 0; i < location.size(); i++) {\r\n for (int j = i+1; j < location.size(); j++) {\r\n long startTime = System.nanoTime();\r\n ArrayList<Vertex> pathIJ = dijkstraPath(i, j);\r\n long endTime = System.nanoTime();\r\n if (!pathIJ.isEmpty()) {\r\n numSuccesses++;\r\n totalTimeSuccesses += (endTime - startTime);\r\n }\r\n if (print) System.out.println(\"I = \" + i + \" J = \" + j + \" : \" + pathIJ.toString());\r\n }\r\n }\r\n System.out.println(\"Dijkstra's algorithm is successfull \" + numSuccesses + \"/\" + location.size()*(location.size()-1)/2 + \" times.\");\r\n if (numSuccesses != 0) {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is \" + totalTimeSuccesses/numSuccesses + \" nanoseconds.\");\r\n } else {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is N/A nanoseconds.\");\r\n }\r\n System.out.println(\"\");\r\n }", "private int[] shrtst_Path_Dijkstra_Algo(int[][] matrx, int sNode, int[] forward_tab_dist, int[] list_Prevoius_Nodes) \n\t{\n\t\tArrayList<Integer> visitedNodes_M = new ArrayList<>(); //3. set of visited vertices is initially empty\n\t\tArrayList<Integer> unvisitedNodes_Q = new ArrayList<>(); //4. the queue initially contains all vertices\n\t\t\n\t\t//1. Distance to source vertex = 0\n\t\tforward_tab_dist[sNode] = 0;\n\n\t\t//2. Initialize: Set all other distances to infinity\n\t\tint k=0;\n\t\twhile(k < matrx.length)\n\t\t{\n\t\t\tunvisitedNodes_Q.add(k);\n\t\t\tif(k != sNode)\n\t\t\t{\n\t\t\t\tforward_tab_dist[k] = INFINITE_DIST;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\t\n\t\t//list of previous nodes, to traverse back\n\t\tlist_Prevoius_Nodes[sNode] = sNode;\n\t\t\n\t\t//5. While queue is not empty\n\t\twhile(!unvisitedNodes_Q.isEmpty())\n\t\t{\n\t\t\tint minDist = INFINITE_DIST;\n\t\t\tint u_minDistNode = -1;\n\t\t\t\n\t\t\t//6. select the element of Q with min distance\n\t\t\tint l = 0;\n\t\t\twhile(l < unvisitedNodes_Q.size())\n\t\t\t{\n\t\t\t\tint n = unvisitedNodes_Q.get(l);\n\t\t\t\tif(!(forward_tab_dist[n] <= minDist))\n\t\t\t\t{\n\t\t\t\t\tl++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tu_minDistNode = n;\n\t\t\t\t\tminDist = forward_tab_dist[n];\n\t\t\t\t}\n\t\t\t\tl++;\n\t\t\t}\n\t\t\t//No minimum distance node found then return\n\t\t\tif(u_minDistNode == -1)\n\t\t\t{\tbreak;\t}\n\t\t\t\n\t\t\t//7. add u to list of visited vertices\n\t\t\tvisitedNodes_M.add(u_minDistNode);\n\t\t\t\n\t\t\tint index = unvisitedNodes_Q.indexOf(u_minDistNode);\t//remove this node from unvisited nodes\n\t\t\tunvisitedNodes_Q.remove(index);\n\t\t\t\n\t\t\t//8.0 algo - consider neighbor as direct distance nodes except source\n\t\t\tfor(int v=0; v<matrx.length; v++)\n\t\t\t{\n\t\t\t\t//matrix[minDistNode_u][v] > 0 ensures it is not source node\n\t\t\t\t//unvisitedNodes_Q.contains(v) only check for unvisited nodes\n\t\t\t\t\n\t\t\t\tif(unvisitedNodes_Q.contains(v) && matrx[u_minDistNode][v] > 0)\n\t\t\t\t{\n\t\t\t\t\tint val = forward_tab_dist[u_minDistNode] + matrx[u_minDistNode][v];\n\t\t\t\t\tif(val < forward_tab_dist[v])\n\t\t\t\t\t{\n\t\t\t\t\t\t//stores shortest distance\n\t\t\t\t\t\tforward_tab_dist[v] = val;\n\t\t\t\t\t\t//stores last node for back traversal to find path\n\t\t\t\t\t\tlist_Prevoius_Nodes[v] = u_minDistNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn forward_tab_dist;\n\t}", "private double dijkstrasAlgo(String source, String dest) {\r\n\r\n\t\tclearAll(); // running time: |V|\r\n\t\tint count = 0; // running time: Constant\r\n\t\tfor (Vertex v : vertexMap.values()) // running time: |V|\r\n\t\t\tif (v.isStatus())\r\n\t\t\t\tcount++;\r\n\r\n\t\tVertex[] queue = new Vertex[count]; // running time: Constant\r\n\t\tVertex start = vertexMap.get(source); // running time: Constant\r\n\t\tstart.dist = 0; // running time: Constant\r\n\t\tstart.prev = null; // running time: Constant\r\n\r\n\t\tint index = 0; // running time: Constant\r\n\t\tfor (Vertex v : vertexMap.values()) { // running time: |V|\r\n\t\t\tif (v.isStatus()) {\r\n\t\t\t\tqueue[index] = v;\r\n\t\t\t\tv.setHandle(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbuildMinHeap(queue, count); // running time: |V|\r\n\r\n\t\twhile (count != 0) { // running time: |V|\r\n\t\t\tVertex min = extractMin(queue, count); // running time: log |V|\r\n\t\t\tcount--; // running time: Constant\r\n\r\n\t\t\tfor (Iterator i = min.adjacent.iterator(); i.hasNext();) { // running time: |E|\r\n\t\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\t\tif (edge.isStatus()) {\r\n\t\t\t\t\tVertex adjVertex = vertexMap.get(edge.getDestination());\r\n\t\t\t\t\tif (adjVertex.dist > (min.dist + edge.getCost()) && adjVertex.isStatus()) {\r\n\t\t\t\t\t\tadjVertex.dist = (min.dist + edge.getCost());\r\n\t\t\t\t\t\tadjVertex.prev = min;\r\n\t\t\t\t\t\tint pos = adjVertex.getHandle();\r\n\t\t\t\t\t\tHeapdecreaseKey(queue, pos, adjVertex); // running time: log |V|\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn vertexMap.get(dest).dist; // running time: Constant\r\n\t}", "public static void main(String[] args) {\n int vertices = Integer.parseInt(StdIn.readLine());\n //Storing vertex weights\n double[] vertW = new double[vertices];\n for(int i=0;i<vertices;i++)\n vertW[i] = Double.parseDouble(StdIn.readLine());\n //Reading in new graph, G**\n String[] Gstarstar = StdIn.readAllLines();\n //Making graph\n EdgeWeightedDigraph G = new EdgeWeightedDigraph(Gstarstar);\n //Dijkstra All Pairs\n DijkstraAllPairsSP DAP = new DijkstraAllPairsSP(G);\n //Printing output of paths\n for(int i=0; i<G.V(); i++){\n for(int j=0; j<G.V(); j++){\n if(!DAP.hasPath(i,j))\n StdOut.print(i+\" to \"+j+\"\\t\\tno path\");\n else{\n double newEW;\n double EW;\n Iterable<DirectedEdge> path = DAP.path(i,j);\n double totalWeight = 0;\n String sp = \"\"; //String that's going to form the path\n for(DirectedEdge x : path){\n newEW = x.weight();\n EW = newEW + vertW[x.to()] - vertW[x.from()]; //reverse calibrate\n totalWeight += EW;\n sp += \"\\t\"+x.from()+\"->\"+x.to()+\" \"+String.format(\"%.2f\",EW); //adding to path\n }\n StdOut.print(i+\" to \"+j+\"\\t(\"+String.format(\"%.2f\",totalWeight)+\") \");\n StdOut.print(sp);\n }\n StdOut.println();\n }\n StdOut.println();\n }\n }", "@Test\n\tpublic void verticesTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(D));\n\t}", "private int[] runDijkstra(int graph[][], int source) {\r\n\r\n // Stores the best estimate of the shortest distance from\r\n // the source to each node \r\n int d[] = new int[graph.length];\r\n \r\n // Initialized with infinite value.\r\n // Value of -1 means the node has been settled \r\n int dC[] = new int[graph.length];\r\n \r\n // Stores the predecessor of each node on the shortest path \r\n // from the source\r\n int p[] = new int[graph.length];\r\n\r\n // Initialize\r\n for (int i = 0; i < graph.length; i++ ) {\r\n d[i] = this.INFINITE;\r\n dC[i] = this.INFINITE;\r\n p[i] = -1;\r\n }\r\n \r\n // We start knowning the distance of the source from itself (zero)\r\n d[source] = 0;\r\n dC[source] = 0;\r\n\r\n int i = 0;\r\n int min = this.INFINITE;\r\n int pos = 0;\r\n\r\n while (i < graph.length) {\r\n //extract minimum distance\r\n for (int j = 0; j < dC.length; j++ ){\r\n if( min > d[j] && dC[j] != -1 ){\r\n min = d[j];\r\n pos = j;\r\n }\r\n }\r\n // This node is settled\r\n dC[pos] = -1;\r\n\r\n // relax its neighbours\r\n for (int j = 0; j < graph.length; j++ ) {\r\n if ( (graph[pos][j] != -1) && (d[j] > graph[pos][j] + d[pos]) ) {\r\n d[j] = graph[pos][j] + d[pos];\r\n p[j] = pos;\r\n }\r\n }\r\n i++;\r\n min = this.INFINITE;\r\n }\r\n\r\n return p;\r\n }", "public void dijkstra(int graphWeight[][], int source){\r\n\t\t\r\n\t\tint queue[] = new int[vertices]; //The array which will hold the shortest distance from source to node i\r\n\t\tboolean set[] = new boolean[vertices]; //It will store true for node i if the shortest path to that vertex or node is found\r\n\t\t\r\n\t\t//Initialize distances to infinity and set[] array to false \r\n\t\tfor(int i=0;i<vertices;i++){\r\n\t\t\tqueue[i] = Integer.MAX_VALUE; \r\n\t\t\tset[i] = false;\r\n\t\t}\r\n\t\t\r\n\t\t//Distance of source vertex from itself is always 0\r\n\t\tqueue[source] = 0;\r\n\r\n\t\t//Find shortest path of all the vertices\r\n\t\tfor(int count=0;count<vertices-1;count++){\r\n\t\t\t\r\n\t\t\t//Pick the minimum distance vertex from the from the set of vertices \r\n\t\t\t//not processed. u is equal to source in first iteration\r\n\t\t\tint u = extractMinDistance(queue, set);\r\n\t\t\t\r\n\t\t\t//Mark the picked vertex processed\r\n\t\t\tset[u] = true;\r\n\t\t\t//Update queue value of the adjacent vertices of the picked vertex\r\n\t\t\tfor(int v=0;v<vertices;v++)\r\n\t\t\t{\r\n\t\t\t\t//Update queue[v] only if\r\n\t\t\t\t// 1. It is not in set true in the Set Array\r\n\t\t\t\t// 2. There is an edge from u to v\r\n\t\t\t\t// 3. Total weight of path from source to v through u is smaller than current value of queue[v]\r\n\t\t\t\tif((graphWeight[u][v] > 0) && set[v] == false){\r\n\t\t\t\t\t\tif(queue[u] + graphWeight[u][v] < queue[v]){\r\n\t\t\t\t\t\t\tqueue[v] = queue[u] + graphWeight[u][v];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//printSolution(queue, vertices);\r\n\t\t}\r\n\t\t//Print the constructed distance array\r\n\t\tprintSolution(queue, vertices);\r\n\t}", "public static void djikstra(int[][] graph, int src) {\n\t\t/* output array */\n\t\tint[] dist = new int[graph.length];\n\t\tboolean[] visited = new boolean[graph.length];\n\n\t\tfor (int i = 0; i < graph.length; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE;\n\t\t\tvisited[i] = false;\n\t\t}\n\n\t\tdist[src] = 0;\n\n\t\tfor (int i = 0; i < graph.length - 1; i++) {\n\n\t\t\t// Pick the minimum distance vertex from the set of vertices not\n\t\t\t// yet processed. u is always equal to src in first iteration.\n\t\t\tint u = findMinDistanceVertex(dist, visited);\n\t\t\t// Mark the picked vertex as processed\n\t\t\tvisited[u] = true;\n\t\t\t\n\t\t\tfor(int j = 0; j < graph.length; j++) {\n\t\t\t\t\n\t\t\t\t// Update dist[v] only if is not in sptSet, there is an edge from \n\t\t // u to v, and total weight of path from src to v through u is \n\t\t // smaller than current value of dist[v]\n\t\t\t\tif(!visited[j] && graph[u][j] != 0\n\t\t\t\t\t\t&& dist[u] != Integer.MAX_VALUE\n\t\t\t\t\t\t&& dist[u] + graph[u][j] < dist[j]) {\n\t\t\t\t\tdist[j] = dist[u] + graph[u][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintSolution(dist, graph.length);\n\t}", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "private static void computePaths(Vertex source) {\n source.minDistance = 0;\n // retrieves with log(n) time\n PriorityQueue<Vertex> vertexPriorityQueue = new PriorityQueue<>();\n\n //BFS traversal\n vertexPriorityQueue.add(source);\n\n // O((v + e) * log(v))\n while (!vertexPriorityQueue.isEmpty()) {\n // this poll always returns the shortest distance vertex at log(v) time\n Vertex vertex = vertexPriorityQueue.poll();\n\n //visit each edge exiting vertex (adjacencies)\n for (Edge edgeInVertex : vertex.adjacencies) {\n // calculate new distance between edgeInVertex and target\n Vertex targetVertex = edgeInVertex.target;\n double edgeWeightForThisVertex = edgeInVertex.weight;\n double distanceThruVertex = vertex.minDistance + edgeWeightForThisVertex;\n if (distanceThruVertex < targetVertex.minDistance) {\n // modify the targetVertex with new calculated minDistance and previous vertex\n // by removing the old vertex and add new vertex with updates\n vertexPriorityQueue.remove(targetVertex);\n targetVertex.minDistance = distanceThruVertex;\n // update previous with the shortest distance vertex\n targetVertex.previous = vertex;\n vertexPriorityQueue.add(targetVertex);// adding takes log(v) time because needs to heapify\n }\n }\n }\n }", "@Test public void testPublic15() {\n Graph<Character> graph= TestGraphs.testGraph3();\n List<Character> shortestPath= new ArrayList<Character>();\n\n assertEquals(1, graph.Dijkstra('A', 'O', shortestPath));\n assertEquals(\"A O\", TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra('M', 'F', shortestPath));\n assertEquals(\"M N P D F\", TestGraphs.listToString(shortestPath));\n }", "public Square[] buildPath(GameBoard board, Player player) {\n\n // flag to check if we hit a goal location\n boolean goalVertex = false;\n\n // Queue of vertices to be checked\n Queue<Vertex> q = new LinkedList<Vertex>();\n\n // set each vertex to have a distance of -1\n for ( int i = 0; i < graph.length; i++ )\n graph[i] = new Vertex(i,-1);\n\n // get the start location, i.e. the player's location\n Vertex start = \n squareToVertex(board.getPlayerLoc(player.getPlayerNo()));\n start.dist = 0;\n q.add(start);\n\n // while there are still vertices to check\n while ( !goalVertex ) {\n\n // get the vertex and remove it;\n // we don't want to look at it again\n Vertex v = q.remove();\n\n // check if this vertex is at a goal row\n switch ( player.getPlayerNo() ) {\n case 0: if ( v.graphLoc >= 72 ) \n goalVertex = true; break;\n case 1: if ( v.graphLoc <= 8 ) \n goalVertex = true; break;\n case 2: if ( (v.graphLoc+1) % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n case 3: if ( v.graphLoc % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n }\n\n // if we're at a goal vertex, we don't need to calculate\n // its neighboors\n if ( !goalVertex ) {\n\n // retrieve all reachable ajacencies\n Square[] adjacencies = reachableAdjacentSquares\n (board, vertexToSquare(v, board), player.getPlayerNo());\n\n // for each adjacency...\n for ( Square s : adjacencies ) {\n\n // convert to graph location\n Vertex adjacent = squareToVertex(s); \n\n // modify the vertex if it hasn't been modified\n if ( adjacent.dist < 0 ) {\n adjacent.dist = v.dist+1;\n adjacent.path = v;\n q.add(adjacent);\n }\n }\n\n }\n else\n return returnPath(v,board);\n \n }\n // should never get here\n return null;\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = sc.nextInt();\n\t\tint roadlines = sc.nextInt();\n\t\tsc.nextLine(); // for reading string in nextline\n\t\tEdgeWeightedGraph edge = new EdgeWeightedGraph(cities);\n\t\t// The Time Complexity is O(E)\n\t\t// The road lines is the number of edges\n\t\tfor (int i = 0; i < roadlines; i++) {\n\t\t\tString[] tokens = sc.nextLine().split(\" \");\n\t\t\tedge.addEdge(new Edge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]),\n\t\t\t\tDouble.parseDouble(tokens[2])));\n\t\t}\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t\tSystem.out.println(edge);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] input = sc.nextLine().split(\" \");\n\t\t\tDijkstraSP shortest = new DijkstraSP(\n edge, Integer.parseInt(input[0]));\n double distance = shortest.distTo(Integer.parseInt(input[1]));\n // The time complexity is O(1)\n if (!shortest.hasPathTo(Integer.parseInt(input[1]))) {\n \tSystem.out.println(\"No Path Found.\");\n } else {\n \tSystem.out.println(distance);\n }\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] str1 = sc.nextLine().split(\" \");\n\t\t\tboolean flag1 = false;\n\t\t\tboolean flag2 = false;\n\t\t\tdouble distance1 = 0.0;\n\t\t\tdouble distance2 = 0.0;\n\t\t\tDijkstraSP shortest1 = new DijkstraSP(edge, Integer.parseInt(str1[0]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest1.hasPathTo(Integer.parseInt(str1[1]))) {\n\t\t\t\tflag1 = true;\n\t\t\t\tdistance1 = shortest1.distance(Integer.parseInt(str1[1]));\n\t\t\t}\n\t\t\tDijkstraSP shortest2 = new DijkstraSP(edge, Integer.parseInt(str1[1]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest2.hasPathTo(Integer.parseInt(str1[2]))) {\n\t\t\t\tflag2 = true;\n\t\t\t\tdistance2 = shortest2.distance(Integer.parseInt(str1[2]));\n\t\t\t}\n\t\t\tdouble Distance = distance1 + distance2;\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (flag1 && flag2) {\n\t\t\t// Displays output upto 1 decimal point\n\t\t\tSystem.out.format(\"%.1f\", Distance);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n ArrayList<Integer> path = new ArrayList<>();\n for (Edge eachlink : shortest1.pathTo(Integer.parseInt(str1[1]))) {\n int either = eachlink.either();\n int other = eachlink.other(eachlink.either());\n if (!path.contains(other)) {\n path.add(other);\n }\n if (!path.contains(either)) {\n path.add(either);\n }\n }\n for (Edge eachlink1 : shortest2.pathTo(Integer.parseInt(str1[2]))) {\n int either1 = eachlink1.either();\n int other1 = eachlink1.other(eachlink1.either());\n if (!path.contains(other1)) {\n path.add(other1);\n }\n if (!path.contains(either1)) {\n path.add(either1);\n }\n }\n for (int everyval : path) {\n System.out.print(everyval + \" \");\n }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public void calcSP(Graph g, Vertex source){\n // Algorithm:\n // 1. Take the unvisited node with minimum weight.\n // 2. Visit all its neighbours.\n // 3. Update the distances for all the neighbours (In the Priority Queue).\n // Repeat the process till all the connected nodes are visited.\n\n // clear existing info\n// System.out.println(\"Calc SP from vertex:\" + source.name);\n g.resetMinDistance();\n source.minDistance = 0;\n PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();\n queue.add(source);\n\n while(!queue.isEmpty()){\n Vertex u = queue.poll();\n for(Edge neighbour:u.neighbours){\n// System.out.println(\"Scanning vector: \"+neighbour.target.name);\n Double newDist = u.minDistance+neighbour.weight;\n\n // get new shortest path, empty existing path info\n if(neighbour.target.minDistance>newDist){\n // Remove the node from the queue to update the distance value.\n queue.remove(neighbour.target);\n neighbour.target.minDistance = newDist;\n\n // Take the path visited till now and add the new node.s\n neighbour.target.path = new ArrayList<>(u.path);\n neighbour.target.path.add(u);\n// System.out.println(\"Path\");\n// for (Vertex vv: neighbour.target.path) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n\n// System.out.println(\"Paths\");\n neighbour.target.pathCnt = 0;\n neighbour.target.paths = new ArrayList<ArrayList<Vertex>>();\n if (u.paths.size() == 0) {\n ArrayList<Vertex> p = new ArrayList<Vertex>();\n p.add(u);\n neighbour.target.paths.add(p);\n neighbour.target.pathCnt++;\n } else {\n for (ArrayList<Vertex> p : u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n// for (Vertex vv : p1) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n }\n\n //Reenter the node with new distance.\n queue.add(neighbour.target);\n }\n // get equal cost path, add into path list\n else if (neighbour.target.minDistance == newDist) {\n queue.remove(neighbour.target);\n for(ArrayList<Vertex> p: u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n queue.add(neighbour.target);\n }\n }\n }\n }", "public boolean DFS_Vist(int vertex ,LinkedList <Integer>adjacencyListArray [],int numofCourses){\n color[vertex] =1;\n start[vertex] = ++time;\n // find all the adjacent vertices in the prerequestie array\n LinkedList<Integer> adjacentVertices = adjacencyListArray[vertex];\n for(Integer v : adjacentVertices){\n // if the color of the adjacent vertex is gray that means it is back edge\n // also it means that cycle exists thus no courses can be completed\n if(color[v] == 1){\n return false;\n }\n if(color[v] == 0 && !DFS_Vist(v,adjacencyListArray,numofCourses) ){\n // if the vertex is unexplored explore the vertex\n pred[v] =vertex;\n return false;\n }\n }\n finish[vertex] =++time;\n topologicalSortOrder.add(vertex);\n // since vertex is completely explored and all the adjacent vertices are explored change the color to black\n color[vertex] =2;\n return true;\n }", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "public static void main(String[] args) {\n\t\tint vertices = Integer.parseInt(args[0]);\n\t\tint edges = Integer.parseInt(args[1]);\n\t\tint seed = Integer.parseInt(args[2]);\n\t\tRandom random = new Random(seed);\n\n\t\tAdjMatrixEdgeWeightedDirectedGraph g = new AdjMatrixEdgeWeightedDirectedGraph(vertices);\n\t\tfor (int i = 0; i < edges; i++) {\n\t\t\tint v = random.nextInt(vertices);\n\t\t\tint w = random.nextInt(vertices);\n\t\t\tdouble weight = Math.round(100 * (random.nextDouble() - 0.15)) / 100.0;\n\t\t\tif (v == w) g.addEdge(new Edge(v, w, Math.abs(weight)));\n\t\t\telse g.addEdge(new Edge(v, w, weight));\n\t\t}\n\n\t\t// run Floyd-Warshall algorithm\n\t\tFloydWarshall spt = new FloydWarshall(g);\n\n\t\t// print all-pairs shortest path distances\n\t\tSystem.out.print(\" \");\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%6d \", v);\n\t\t}\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%3d: \", v);\n\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\tif (spt.hasPath(v, w)) System.out.printf(\"%6.2f \", spt.dist(v, w));\n\t\t\t\telse System.out.printf(\" Inf \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// print negative cycle\n\t\tif (spt.hasNegativeCycle()) {\n\t\t\tSystem.out.println(\"Negative cost cycle:\");\n\t\t\tfor (int v : spt.negativeCycle()) System.out.println(v);\n\t\t\tSystem.out.println();\n\t\t// print all-pairs shortest paths\n\t\t} else {\n\t\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\t\tif (spt.hasPath(v, w)) {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d (%5.2f) \", v, w, spt.dist(v, w));\n\t\t\t\t\t\tfor (Edge e : spt.path(v, w)) System.out.print(e + \" \");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d no path\\n\", v, w);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "@Override\r\n\tpublic void Dijkstra(E src) {\r\n\t\tPriorityQueue<Vertex<E>> pq = new PriorityQueue<Vertex<E>>();\r\n\t\tif(containsVertex(src)) {\r\n\t\t\tlastSrc = vertices.get(src);\r\n\t\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\t\tu.setDistance(Integer.MAX_VALUE);\r\n\t\t\t\tu.setPredecessor(null);\r\n\t\t\t\tpq.offer(u);\r\n\t\t\t});\r\n\t\t\tpq.remove(lastSrc);\r\n\t\t\tlastSrc.setDistance(0);\r\n\t\t\tpq.offer(lastSrc);\r\n\t\t\twhile(!pq.isEmpty()) {\r\n\t\t\t\tVertex<E> u = pq.poll();\r\n\t\t\t\tfor(Edge<E> ale : adjacencyLists.get(u.getElement())) {\r\n\t\t\t\t\tVertex<E> s = vertices.get(ale.getSrc());\r\n\t\t\t\t\tVertex<E> d = vertices.get(ale.getDst());\r\n\t\t\t\t\tif(d.getDistance() > (long)s.getDistance() + (long)ale.getWeight()) {\r\n\t\t\t\t\t\tpq.remove(ale.getDst());\r\n\t\t\t\t\t\td.setDistance(s.getDistance() + ale.getWeight());\r\n\t\t\t\t\t\td.setPredecessor(s);\r\n\t\t\t\t\t\tpq.offer(d);\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}", "@Test\n public void getVertexes() {\n\n for (int i = 0; i < 6; i++) {\n\n Vertex temp = new Vertex(i + \"\", \"Location number \" + i);\n assertTrue(temp.equals(testGraph.getVertices ().get(i)));\n\n }\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "double estimatedDistanceToGoal(Vertex s, Vertex goal);", "public boolean connectsVertex(V v);", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public static int QTDelHeuristic1 (Graph<Integer,String> h) {\n\t\tint count = 0;\r\n\t\tboolean isQT = false;\r\n\t\t//h = Copy(g);\r\n\t\t//boolean moreToDo = true;\r\n\t\t\r\n\t\tIterator<Integer> a;\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\r\n\t\twhile (isQT == false) {\r\n\t\t\tisQT = true;\r\n\t\t\ta= h.getVertices().iterator();\r\n\t\t\twhile(a.hasNext()){\r\n\t\t\t\tInteger A = a.next();\r\n\t\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\t\tb = h.getNeighbors(A).iterator();\r\n\t\t\t\twhile(b.hasNext()){\r\n\t\t\t\t\tInteger B = b.next();\r\n\t\t\t\t\tc = h.getNeighbors(B).iterator();\r\n\t\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\t\tif (h.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\t\td = h.getNeighbors(C).iterator();\r\n\t\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\t\tisQT = false;\r\n\t\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t\t// requires 2 deletions\r\n\t\t\t\t\t\t\t\tcount += 2;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 2 + QTDelHeuristic1(h);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcount += 1;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 1 + QTDelHeuristic1(h);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\t\t\r\n\t\treturn count;\t\t\r\n\t}", "int bfs(Vertex start, Vertex goal) {\n // Create queue for holding upcoming vertices to check.\n Queue<Vertex> queue = new LinkedList<>();\n // Create list of vertices that have been checked.\n ArrayList<Vertex> visited = new ArrayList<>(verticesAndTheirEdges.size());\n\n // Create map for storing distance from start to each vertex.\n // Defaults to -1 (since we want to return -1 if no path can be found)\n HashMap<Vertex, Integer> distance = new HashMap<>();\n for (Map.Entry<Vertex, LinkedList<Vertex>> vertex : verticesAndTheirEdges.entrySet()) {\n distance.put(vertex.getKey(), -1);\n }\n distance.put(start, 0);\n\n // Add start vertex to queue to initiate search,\n // then add it to the 'visited' list so that we don't check it again.\n queue.add(start);\n visited.add(start);\n while (!queue.isEmpty()) {\n // Take the first vertex from the queue.\n Vertex v = queue.remove();\n // Get all the vertexes edges.\n List<Vertex> neighbours = verticesAndTheirEdges.get(v);\n for (Vertex n : neighbours) {\n // If we haven't visited the neighboring vertex:\n if (n != null && !visited.contains(n)) {\n // Save the neighbors distance as the previous vertex distance +1.\n distance.put(n, distance.get(v) + 1);\n // Add the vertex to the queue of upcoming vertices to check.\n queue.add(n);\n // Mark vertex as visited.\n visited.add(n);\n }\n }\n }\n // Return the distance between start and goal vertices in the graph.\n return distance.get(goal);\n }", "private static void shortestPath(Graph graph, Character startNode, int algorithm) {\n Node currentNode = graph.getNode(startNode);\n\n // keep track of the nodes visited\n List<Character> nodesVisited = new ArrayList<>();\n\n // add the current node\n nodesVisited.add(currentNode.getName());\n\n // breadth first search to help keep track of the nodes we have already visited\n // helps with backtracking\n Stack<Node> visitingNodes = new Stack<>();\n\n // loop through the graph\n while (currentNode != graph.getNode('Z')) {\n // we have visited a node\n // add it to the stack\n // set true to since its been visited and it will be in the shortest path\n visitingNodes.add(currentNode);\n currentNode.setNodeVisited(true);\n currentNode.setInShortestPath(true);\n\n // get all the edges that are connected to the current node we are on\n List<Edge> adjacentNodes = currentNode.getNeighbors();\n\n // temp for next node\n Node nextNode = null;\n int weightDistanceTotal = Integer.MAX_VALUE;\n\n for (Edge i: adjacentNodes) {\n // testing\n // System.out.println(i.destination.getName());\n // System.out.println(i.destination.getDistanceToZ());\n\n // 1. always check to see if we have visited the node\n if (i.destination.isNodeVisited()) {\n // System.out.println(i.destination.getName() + \" is already in the path\");\n continue;\n }\n\n // 2. assign the next node to the destination\n if (nextNode == null) {\n nextNode = i.destination;\n }\n\n // compare distances\n if (algorithm == 1) {\n nextNode = updateNextNodeAlgo1(nextNode, i.destination);\n } else {\n NodeWithWeightDistanceTotal nodeWithWeightDistanceTotal = updateNextNodeAlgo2(nextNode, i, weightDistanceTotal);\n nextNode = nodeWithWeightDistanceTotal.node;\n weightDistanceTotal = nodeWithWeightDistanceTotal.weightDistanceTotal;\n }\n //if (nextNode.getDistanceToZ() > i.destination.getDistanceToZ()) {\n // nextNode = i.destination;\n //}\n }\n\n // next has no other edges\n if (nextNode == null) {\n // System.out.println(\"There no place to go from \" + currentNode.getName());\n // pop off the node we just visited\n nextNode = visitingNodes.pop();\n // its not in the shortest path to Z\n nextNode.setInShortestPath(false);\n // set the next node to the previous node\n nextNode = visitingNodes.pop();\n }\n\n // add the nodes we visit to keep track of the path\n nodesVisited.add(nextNode.getName());\n\n // System.out.println(Arrays.toString(nodesVisited.toArray()));\n // testing purposes to see if the node is on the shortest path\n\n// for (Character node: nodesVisited) {\n// Node boolVisit = graph.getNode(node);\n// System.out.println(boolVisit.isInShortestPath());\n// }\n\n // progress to the next node\n currentNode = nextNode;\n // when visiting the last node mark z in the shortest path\n if (currentNode.getName() == 'Z') {\n currentNode.setInShortestPath(true);\n }\n // testing\n // System.out.println(\"next node = \" + currentNode.getName());\n }\n\n // keep track of the path visited and the total addition of weights\n int pathCounter = 0;\n\n // construct the shortest path\n List<Node> shortestPath = new ArrayList<>();\n\n for (Character nodeVisitor: nodesVisited) {\n // get the node\n Node node = graph.getNode(nodeVisitor);\n\n // add to the shortest path\n if (node.isInShortestPath() && !shortestPath.contains(node)) {\n shortestPath.add(node);\n }\n }\n\n // print the shortest path\n for (int i = 0; i < shortestPath.size() - 1; i++) {\n currentNode = shortestPath.get(i);\n Node nextNode = shortestPath.get(i + 1);\n\n // find the weight of that node\n int weight = currentNode.findWeight(nextNode);\n pathCounter += weight;\n\n // System.out.println(\"weight \" + weight);\n // System.out.println(\"path total \" + pathCounter);\n }\n\n // final output\n String fullPathSequence = \"\";\n String shortestPathSequence = \"\";\n\n for (int i = 0; i < nodesVisited.size(); i++) {\n if (i != nodesVisited.size() - 1) {\n fullPathSequence += nodesVisited.get(i) + \" -> \";\n }\n }\n\n fullPathSequence += nodesVisited.get(nodesVisited.size() - 1);\n\n for (int i = 0; i < shortestPath.size(); i++) {\n if (i != shortestPath.size() - 1) {\n shortestPathSequence += shortestPath.get(i).getName() + \" -> \";\n }\n }\n\n if (currentNode.getName() == 'Z') {\n shortestPathSequence += \"Z\";\n } else {\n shortestPathSequence += shortestPath.get(shortestPath.size() - 1).getName();\n }\n\n System.out.println(\"Algorithm \" + algorithm + \" : \");\n System.out.println(\"Sequence of all nodes \" + fullPathSequence);\n System.out.println(\"Shortest path: \" + shortestPathSequence);\n System.out.println(\"Shortest path length: \" + pathCounter);\n System.out.println(\"\\n\");\n\n // reset the graph\n graph.graphReset();\n\n }", "void prim(AdjacencyLists g, int start)\r\n\t{\r\n\t\t// whether the node is in the tree or not.\r\n\t\tboolean[] intree = new boolean[g.nvertices];\r\n\t\t\r\n\t\t// the cost of adding the edge to the tree\r\n\t\tint[] distance = new int[g.nvertices];\r\n\t\t\r\n\t\tint[] parent = new int[g.nvertices]; \r\n\t\t\r\n\t\tfor (int i = 0; i < g.nvertices; ++i) {\r\n\t\t\tintree[i] = false;\r\n\t\t\tdistance[i] = Integer.MAX_VALUE;\r\n\t\t\tparent[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tdistance[start] = 0;\r\n\t\t\r\n\t\t// current vertex to process\r\n\t\tint v = start;\r\n\t\t// candidate next vertex\r\n\t\tint w; \r\n\t\t// edge weight\r\n\t\tint weight;\r\n\t\t// best current distance from start\r\n\t\tint dist;\r\n\t\t\r\n\t\twhile (!intree[v]) {\r\n\t\t\tintree[v] = true;\r\n\t\t\t\r\n\t\t\tEdgeNode p = g.edges[v];\r\n\t\t\t\r\n\t\t\t// for each node w that is not in the tree\r\n\t\t\t// identify the lowest cost\r\n\t\t\twhile (p != null) {\r\n\t\t\t\tw = p.y;\r\n\t\t\t\tweight = p.weight;\r\n\t\t\t\tif (!intree[w] && distance[w] > weight) {\r\n\t\t\t\t\t// pick the edge that is lowest cost from v.\r\n\t\t\t\t\tdistance[w] = weight;\r\n\t\t\t\t\tparent[w] = v;\r\n\t\t\t\t}\r\n\t\t\t\tp = p.next;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// find the node that is not in the list, \r\n\t\t\t// and has the smallest distance value.\r\n\t\t\tv = 0;\r\n\t\t\tdist = Integer.MAX_VALUE;\r\n\t\t\tfor (int i = 0; i < g.nvertices; ++i) {\r\n\t\t\t\tif (!intree[i] && dist > distance[i]) {\r\n\t\t\t\t\tdist = distance[i];\r\n\t\t\t\t\tv = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "public static void PrimsAlgorithm(WeightedGraph graph) {\n System.out.println(\"______________________________Prim's Algorithm(Priority Queue)_____________________________\\n\");\n ArrayList<Edge> mst = new ArrayList<>();\n // initialize an array that will keep track of which vertices have been visited\n boolean[] visited = new boolean[graph.getVertices()];\n // initialize a PriorityQueue \n PriorityQueue<Edge> priorityQueue = new PriorityQueue<>();\n // mark the initial vertex as visited\n visited[0] = true;\n\n // for every edge connected to the source, add it to the PriorityQueue \n for (int i = 0; i < graph.getAdjacencylist(0).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(0).get(i));\n }\n\n // keep adding edges until the PriorityQueue is empty\n while (!priorityQueue.isEmpty()) {\n Edge e = priorityQueue.remove();\n\n // if we have already visited the opposite vertex, go to the next edge\n if (visited[e.getDestination()]) {\n continue;\n }\n\n //mark the opposite vertex as visited\n visited[e.getDestination()] = true;\n //Add an edge to the minimum spanning tree\n mst.add(e);\n\n // for every edge connected to the opposite vertex, add it to the PriorityQueue\n for (int i = 0; i < graph.getAdjacencylist(e.getDestination()).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(e.getDestination()).get(i));\n }\n\n }\n\n // if we haven't visited all of the vertices, return \n for (int i = 1; i < graph.getVertices(); i++) {\n if (!visited[i]) {\n System.out.println(\"Error! the graph is not connected.\");\n return;\n }\n }\n\n }", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "void dijkstra(Coordinate startName) {\n if (!graph.containsKey(startName)) {\n //test use print statement\n //System.out.printf(\"Graph doesn't contain start vertex \\\"%s\\\"\\n\", startName);\n return;\n }\n final Node source = graph.get(startName);\n NavigableSet<Node> queue = new TreeSet<>();\n\n // set-up vertices\n for (Node node : graph.values()) {\n node.previous = node == source ? source : null;\n node.dist = node == source ? 0 : Integer.MAX_VALUE;\n queue.add(node);\n }\n dijkstra(queue);\n }", "static void FindPath(vertex s, vertex[] array){\r\n\t\tvertex v; \r\n\t\tint min = Integer.MAX_VALUE;\r\n\t\t//node wN; vertex wV; //wN= adjacent node in LinkedList; wV= find the values in the vertices for wL\r\n\t\tint j =0;\r\n\t\ts.known = true;\r\n\t\ts.dist = 0;\r\n\t\tShortestPath(s, array);\r\n\t\r\n\t\twhile(j<array.length-1 ){ //&& array[j].known== false){\r\n\t\t\tint count = 0; \r\n\t\t\tmin = Integer.MAX_VALUE;\r\n\t\t\tfor(int i = 0; i<array.length; i++){\r\n\t\t\t\tif(array[i].known== false && array[i].dist < min){\r\n\t\t\t\t\tmin = array[i].dist;\r\n\t\t\t\t\tcount = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tv = array[count];\r\n //System.out.println(\"count: \" + count + \"Next v: \" + v.name);\r\n\t\t\tShortestPath(v, array);\r\n\t\t\tj++; \t\t\r\n }\r\n\t}", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\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\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "public void finish(){\n //check start vertex is valid for given algorithm\n }", "private double dijkstraSingleTarget(Map<Integer, List<Node>> graph, int vertices, int source, int target) {\n Queue<Node> minHeap = new PriorityQueue<>(\n Comparator.comparingDouble(a -> a.weight)\n );\n\n double[] dist = new double[vertices + 1]; //shortest distance for each vertex\n Arrays.fill(dist, 0.0);\n\n boolean visited[] = new boolean[vertices + 1];\n\n // Distance for starting node is 0\n dist[source] = -1;\n minHeap.add((new Node(-1,source)));\n\n while (!minHeap.isEmpty()) {\n Node topPair = minHeap.remove();\n int currNode = topPair.vertex;\n double currDistance = topPair.weight;\n\n if (!graph.containsKey(currNode)) {\n continue;\n }\n\n if (visited[currNode]) continue;\n visited[currNode] = true;\n\n\n for (Node edge : graph.get(currNode)) {\n double weight = edge.weight;\n int neighborNode = edge.vertex;\n double nextDist = currDistance * weight;\n\n if (!visited[neighborNode] && nextDist < dist[neighborNode]) {\n dist[neighborNode] = nextDist;\n minHeap.add((new Node(nextDist, neighborNode)));\n\n }\n\n }\n\n\n }\n\n return -dist[target];\n }", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static <V> Graph<V> getMinimumSpanningTreePrim(Graph<V> graph) {\n V[] array = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[][] matrizCopia = new double[array.length][array.length]; //Se hace una copia del array. Sino, se modificaria en el grafo original.\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n matrizCopia[x][y] = matriz[x][y];\n }\n }\n\n boolean[] revisados = new boolean[array.length]; // Arreglo de booleanos que marca los valores por donde ya se paso.\n Set<V> conjuntoRevisados = new LinkedListSet<>(); //Conjunto donde se guardan los vertices por donde ya se paso\n Graph<V> nuevo = new AdjacencyMatrix<>(graph.isDirected(), true);\n\n if (array.length > 0) { // Grafo no vacio\n\n revisados[0] = true;\n conjuntoRevisados.put(array[0]);\n nuevo.addNode(array[0]);\n\n double menorArista = 50000;\n V verticeOrigen = null;\n V verticeDestino = null;\n\n while (conjuntoRevisados.size() != array.length) { // mientras hayan vertices sin revisar\n\n Iterator<V> it1 = conjuntoRevisados.iterator(); //Se recorren todos los vertices guardados\n while (it1.hasNext()) {\n\n V aux = it1.next();\n int posArray = buscarPosicion(aux, array);\n for (int x = 0; x < array.length; x++) {\n\n if (matrizCopia[posArray][x] != -1) { //Si existe arista\n //Si los 2 vertices no estan en el arbol, para evitar un ciclo\n if (!(conjuntoRevisados.isMember(aux) && conjuntoRevisados.isMember(array[x]))) {\n if (matrizCopia[posArray][x] < menorArista) {\n menorArista = matrizCopia[posArray][x];\n if (!graph.isDirected()) {\n matrizCopia[x][posArray] = -1;\n }\n verticeOrigen = aux;\n verticeDestino = array[x];\n }\n }\n }\n }\n }\n\n if (verticeOrigen != null) {\n if (!nuevo.contains(verticeDestino)) {\n nuevo.addNode(verticeDestino);\n if (!conjuntoRevisados.isMember(verticeDestino)) {\n conjuntoRevisados.put(verticeDestino);\n }\n revisados[buscarPosicion(verticeDestino, array)] = true;\n }\n nuevo.addEdge(verticeOrigen, verticeDestino, menorArista);\n\n verticeOrigen = null;\n menorArista = 50000;\n } else {\n for (int x = 0; x < array.length; x++) {\n if (revisados[x] == false) {\n conjuntoRevisados.put(array[x]);\n nuevo.addNode(array[x]);\n }\n }\n }\n }\n }\n return nuevo;\n }", "@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }", "@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "public void shortestRouteDijkstra(){\n int landmark1 = l1.getSelectionModel().getSelectedIndex();\n int landmark2 = l2.getSelectionModel().getSelectedIndex();\n GraphNodeAL<MapPoint> lm1 = landmarkList.get(landmark1);\n GraphNodeAL<MapPoint> lm2 = landmarkList.get(landmark2);\n\n shortestRouteDij(lm1, lm2);\n }", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "public static <V> Dictionary<V, DijkstraResult<V>> getShortestPathDijkstra(Graph<V> graph, V value) {\n V[] vertices = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[] distancias = new double[vertices.length];\n V[] camino = (V[]) new Object[vertices.length];\n int pos = buscarPosicion(value, vertices);\n\n for (int x = 0; x < vertices.length; x++) { // Se llenan los arreglos con la informacion de sus adyacentes.\n if (pos == x) {\n distancias[x] = 0;\n camino[x] = null;\n } else {\n if (matriz[pos][x] == -1) {\n distancias[x] = Integer.MAX_VALUE - 1;\n camino[x] = vertices[pos];\n } else {\n distancias[x] = matriz[pos][x];\n camino[x] = vertices[pos];\n }\n }\n }\n\n Set<V> revisados = new LinkedListSet<>();\n revisados.put(value);\n while (revisados.size() < vertices.length) {\n double menor = Integer.MAX_VALUE;\n V actual = null;\n for (int x = 0; x < vertices.length; x++) {\n if (distancias[x] < menor) {\n if (!revisados.isMember(vertices[x])) {\n menor = distancias[x];\n actual = vertices[x];\n }\n }\n }\n\n pos = buscarPosicion(actual, vertices);\n for (int x = 0; x < vertices.length; x++) { // Se recorre la matriz para buscar adyacencias.\n if (matriz[pos][x] != -1) { // Si existe arist\n if (menor + matriz[pos][x] < distancias[x]) {\n distancias[x] = menor + matriz[pos][x];\n camino[x] = actual;\n }\n }\n }\n revisados.put(actual);\n }\n Dictionary<V, DijkstraResult<V>> diccionario = new Hashtable<>();\n for (int x = 0; x < vertices.length; x++) {\n DijkstraResult<V> aux = new DijkstraResult<>(vertices[x], camino[x], distancias[x]);\n diccionario.put(vertices[x], aux);\n }\n return diccionario;\n }", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "@Test\n public void testDistantPoints() {\n // OK with 1000 visited nodes:\n MapMatching mapMatching = new MapMatching(hopper, algoOptions);\n List<GPXEntry> inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.23, 12.18),\n new GHPoint(51.45, 12.59));\n MatchResult mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(57650, mr.getMatchLength(), 1);\n assertEquals(2747796, mr.getMatchMillis(), 1);\n\n // not OK when we only allow a small number of visited nodes:\n AlgorithmOptions opts = AlgorithmOptions.start(algoOptions).maxVisitedNodes(1).build();\n mapMatching = new MapMatching(hopper, opts);\n try {\n mr = mapMatching.doWork(inputGPXEntries);\n fail(\"Expected sequence to be broken due to maxVisitedNodes being too small\");\n } catch (RuntimeException e) {\n assertTrue(e.getMessage().startsWith(\"Sequence is broken for submitted track\"));\n }\n }", "ShortestPath(UndirectedWeightedGraph graph, String startNodeId, String endNodeId) throws NotFoundNodeException {\r\n\t\t\r\n\t\tif (!graph.containsNode(startNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, startNodeId);\r\n\t\t}\t\t\r\n\t\tif (!graph.containsNode(endNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, endNodeId);\r\n\t\t}\t\r\n\r\n\t\tsrc = startNodeId;\r\n\t\tdst = endNodeId;\r\n\t\t\r\n\t\tif (endNodeId.equals(startNodeId)) {\r\n\t\t\tlength = 0;\r\n\t\t\tnumOfPath = 1;\r\n\t\t\tArrayList<String> path = new ArrayList<String>();\r\n\t\t\tpath.add(startNodeId);\r\n\t\t\tpathList.add(path);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// create a HashMap of updated distance from the starting node to every node\r\n\t\t\t// initially it is 0, inf, inf, inf, ...\r\n\t\t\tHashMap<String, Double> distance = new HashMap<String, Double>();\t\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif (nodeId.equals(startNodeId)) {\r\n\t\t\t\t\t// the starting node will always have 0 distance from itself\r\n\t\t\t\t\tdistance.put(nodeId, 0.0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// the others have initial distance is infinity\r\n\t\t\t\t\tdistance.put(nodeId, Double.MAX_VALUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// a HashMap of preceding node of each node\r\n\t\t\tHashMap<String, HashSet<String>> precedence = new HashMap<String, HashSet<String>>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif ( nodeId.equals(startNodeId) ) {\r\n\t\t\t\t\tprecedence.put(nodeId, null);\t// the start node will have no preceding node\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tprecedence.put(nodeId, new HashSet<String>());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\tSet<String> unvisitedNode = new HashSet<String>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tunvisitedNode.add(nodeId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble minUnvisitedLength;\r\n\t\t\tString minUnvisitedNode;\r\n\t\t\t// run loop while not all node is visited\r\n\t\t\twhile ( unvisitedNode.size() != 0 ) {\r\n\t\t\t\t// find the unvisited node with minimum current distance in distance list\r\n\t\t\t\tminUnvisitedLength = Double.MAX_VALUE;\r\n\t\t\t\tminUnvisitedNode = \"\";\r\n\t\t\t\tfor (String nodeId : unvisitedNode) {\r\n\t\t\t\t\tif (distance.get(nodeId) < minUnvisitedLength) {\r\n\t\t\t\t\t\tminUnvisitedNode = nodeId;\r\n\t\t\t\t\t\tminUnvisitedLength = distance.get(nodeId); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if there are no node that can be visited from the unvisitedNode, break the loop \r\n\t\t\t\tif (minUnvisitedLength == Double.MAX_VALUE) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// remove the node from unvisitedNode\r\n\t\t\t\tunvisitedNode.remove(minUnvisitedNode);\r\n\t\t\t\t\r\n\t\t\t\t// update the distance of its neighbors\r\n\t\t\t\tfor (Node neighborNode : graph.getNodeList().get(minUnvisitedNode).getNeighbors().keySet()) {\r\n\t\t\t\t\tdouble distanceFromTheMinNode = distance.get(minUnvisitedNode) + graph.getNodeList().get(minUnvisitedNode).getNeighbors().get(neighborNode).getWeight();\r\n\t\t\t\t\t// if the distance of the neighbor can be shorter from the current node, change \r\n\t\t\t\t\t// its details in distance and precedence\r\n\t\t\t\t\tif ( distanceFromTheMinNode < distance.get(neighborNode.getId()) ) {\r\n\t\t\t\t\t\tdistance.replace(neighborNode.getId(), distanceFromTheMinNode);\r\n\t\t\t\t\t\t// renew the precedence of the neighbor node\r\n\t\t\t\t\t\tprecedence.put(neighborNode.getId(), new HashSet<String>());\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (distanceFromTheMinNode == distance.get(neighborNode.getId())) {\r\n\t\t\t\t\t\t// unlike dijkstra's algorithm, multiple path should be update into the precedence\r\n\t\t\t\t\t\t// if from another node the distance is the same, add it to the precedence\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// if the current node in the process is the end node, we can stop the while loop here\r\n\t\t\t\tif (minUnvisitedNode == endNodeId) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (distance.get(endNodeId) == Double.MAX_VALUE) {\r\n\t\t\t\t// in case there is no shortest path between the 2 nodes\r\n\t\t\t\tlength = 0;\r\n\t\t\t\tnumOfPath = 0;\r\n\t\t\t\tpathList = null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// other wise we have these information\r\n\t\t\t\tlength = distance.get(endNodeId);\r\n\t\t\t\t//numOfPath = this.getNumPath(precedence, startNodeId, endNodeId);\r\n\t\t\t\tpathList = this.findPathList(precedence, startNodeId, endNodeId);\r\n\t\t\t\tnumOfPath = pathList.size();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t// END ELSE\t\t\r\n\t}", "private Route calculate(String fromStation, String toStation) {\n\t\tif (stations==null){\r\n\t\t\tSystem.out.println(\"DEBUG RUN OF DIJKSTRA.\");\r\n\t\t\tstations = new ArrayList<Station>();\r\n\t\t\tcreateDebugMap(stations);\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Check if the stations exists\r\n\t\t */\r\n\t\tStation startStation = null, endStation = null;\r\n\r\n\t\t// Find starting station\r\n\t\tfor (Station thisStation : stations) {\r\n\t\t\tif (thisStation.stationName.equals(fromStation)) {\r\n\t\t\t\tSystem.out.println(\"Found startStaion in the Database\");\r\n\t\t\t\tstartStation = thisStation;\r\n\t\t\t}\r\n\t\t\tif (thisStation.stationName.equals(toStation)) {\r\n\t\t\t\tSystem.out.println(\"Found endStation in the Database\");\r\n\t\t\t\tendStation = thisStation;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Station not found. Break\r\n\t\tif (startStation == null || endStation == null) {\r\n\t\t\tSystem.out.println(\"Shit! One of the stations could not be found\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Declare the variables for the algorithm\r\n\t\t */\r\n\r\n\t\t// ArrayList for keeping track of stations we have visited.\r\n\t\tArrayList<Station> visitedStations = new ArrayList<Station>();\r\n\t\t// Array for the DijkstraStations. This type holds the current best cost and best link to it.\r\n\t\tArrayList<DijkstraStation> dijkstraStations = new ArrayList<DijkstraStation>();\r\n\r\n\t\t// The station we are examining neighbors from.\r\n\t\tDijkstraStation currentStation = new DijkstraStation(new Neighbor(startStation, 0, 0), 0, startStation);\r\n\r\n\t\t// PriorityQueue for sorting unvisited DijkstraStations.\r\n\t\tNeighBorDijktstraComparetor Dijkcomparator = new NeighBorDijktstraComparetor();\r\n\t\tPriorityQueue<DijkstraStation> unvisitedDijkstraStations;\r\n\t\tunvisitedDijkstraStations = new PriorityQueue<DijkstraStation>(100, Dijkcomparator);\r\n\r\n\t\t// Variable to keep track of the goal\r\n\t\tboolean goalFound = false; // did we find the goal yet\r\n\t\tint goalBestCost = Integer.MAX_VALUE; // did we find the goal yet\r\n\r\n\t\t// Add the start staion to the queue so that the loop will start with this staiton\r\n\t\tunvisitedDijkstraStations.add(currentStation);\r\n\t\tdijkstraStations.add(currentStation);\r\n\r\n\t\t/***************************\r\n\t\t * The Dijkstra algorithm loop.\r\n\t\t ***************************/\r\n\r\n\t\twhile (!unvisitedDijkstraStations.isEmpty()) {\r\n\t\t\t// Take the next station to examine from the queue and set the next station as the currentStation\r\n\t\t\tcurrentStation = unvisitedDijkstraStations.poll();\r\n\r\n\t\t\tSystem.out.println(\"\\n============= New loop passtrough =============\");\r\n\t\t\tSystem.out.println(\"Analysing neighbors of \" + currentStation.stationRef.stationName + \". Cost to this station is: \" + currentStation.totalCost);\r\n\r\n\t\t\t// Add visited so we dont visit again.\r\n\t\t\tvisitedStations.add(currentStation.stationRef);\r\n\r\n\t\t\t// break the algorithm if the current stations totalcost if bigger than the best cost of the goal\r\n\t\t\tif (goalBestCost < currentStation.totalCost) {\r\n\t\t\t\tSystem.out.println(\"Best route to the goal has been found. Best cost is: \" + goalBestCost\r\n\t\t\t\t\t\t+ \" (To reach current station is: \" + currentStation.totalCost + \")\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check all neighbors from the currentStation to the neighBorQueue so we can examine them\r\n\t\t\tfor (Neighbor thisNeighbor : currentStation.stationRef.neighbors) {\r\n\r\n\t\t\t\t// Skip stations we have already visited\r\n\t\t\t\tif (!visitedStations.contains(thisNeighbor.stationRef)) {\r\n\t\t\t\t\t// If we havent seen this station before\r\n\t\t\t\t\t// Add it to the list of Dijkstrastations and to the PriorityQueue of unvisited stations\r\n\t\t\t\t\tif (getDijkstraStationByID(thisNeighbor.stationRef.stationid, dijkstraStations) == null) {\r\n\t\t\t\t\t\tDijkstraStation thisDijkstraStation = new DijkstraStation(thisNeighbor, currentStation.totalCost\r\n\t\t\t\t\t\t\t\t+ thisNeighbor.cost, currentStation.stationRef);\r\n\t\t\t\t\t\tdijkstraStations.add(thisDijkstraStation);\r\n\t\t\t\t\t\tunvisitedDijkstraStations.offer(thisDijkstraStation);\r\n\r\n\t\t\t\t\t\tif (thisNeighbor.stationRef.equals(endStation)) {\r\n\t\t\t\t\t\t\tgoalFound = true;\r\n\t\t\t\t\t\t\tgoalBestCost = (int) thisDijkstraStation.totalCost;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Goal station found :) Cost to goal is: \" + goalBestCost);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"New station seen: \" + thisDijkstraStation);\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Station has been seen before.\r\n\r\n\t\t\t\t\t\t// Get the station as a DijkstraStation from the array\r\n\t\t\t\t\t\tDijkstraStation thisDijkstraStation = getDijkstraStationByID(thisNeighbor.stationRef.stationid,\r\n\t\t\t\t\t\t\t\tdijkstraStations);\r\n\r\n\t\t\t\t\t\t// Check if the connection is better than the one we already know\r\n\t\t\t\t\t\tif (currentStation.totalCost + thisNeighbor.cost < thisDijkstraStation.totalCost) {\r\n\r\n\t\t\t\t\t\t\t// New best link found\r\n\t\t\t\t\t\t\tSystem.out.println(\"New best route found for \" + thisNeighbor.stationRef.stationName);\r\n\t\t\t\t\t\t\tSystem.out.println(\"Old cost:\" + thisDijkstraStation.totalCost + \", New cost: \"\r\n\t\t\t\t\t\t\t\t\t+ (currentStation.totalCost + thisNeighbor.cost));\r\n\r\n\t\t\t\t\t\t\t// update the cost and via station on the DijkstraStation\r\n\t\t\t\t\t\t\tthisDijkstraStation.updateBestLink((int) (currentStation.totalCost + thisNeighbor.cost),\r\n\t\t\t\t\t\t\t\t\tcurrentStation.stationRef, thisNeighbor);\r\n\r\n\t\t\t\t\t\t\t// if this is the goal station, update the totalCost\r\n\t\t\t\t\t\t\tif (thisNeighbor.stationRef.equals(endStation)) {\r\n\t\t\t\t\t\t\t\tgoalBestCost = (int) thisDijkstraStation.totalCost;\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Updated cost for the goal to : \" + goalBestCost);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}// End while\r\n\r\n\t\t// Print the World:\r\n//\t\t System.out.println();\r\n//\t\t System.out.println(\"################# Printing the world ###################\");\r\n//\t\t for (DijkstraStation thisDijkstraStation : dijkstraStations) {\r\n//\t\t System.out.println(thisDijkstraStation.toString());\r\n//\t\t DijkstraStation tempStation = thisDijkstraStation;\r\n//\t\t System.out.print(\"BackTracking route =>\");\r\n//\t\t while (!tempStation.stationRef.equals(startStation)) {\r\n//\t\t System.out.print(\" \" + tempStation.cost + \" to \" + tempStation.viaStation.stationName + \" #\");\r\n//\t\t\r\n//\t\t tempStation = getDijkstraStationByID(tempStation.viaStation.stationid, dijkstraStations);\r\n//\t\t }\r\n//\t\t System.out.print(\" End\");\r\n//\t\t System.out.print(\"\\n\\n\");\r\n//\t\t }\r\n//\r\n\t\tif (goalFound) {\r\n\t\t\tSystem.out.println(\"Generating route to goal\");\r\n\t\t\t// create a route object with all the stations.\r\n\t\t\tRoute routeToGoal = new Route(fromStation, toStation);\r\n\t\t\t// get the goalStation as a DijkstraStation Type\r\n\t\t\tDijkstraStation goalStation = getDijkstraStationByID(endStation.stationid, dijkstraStations);\r\n\r\n\t\t\trouteToGoal.cost = goalStation.totalCost;\r\n\t\t\trouteToGoal.price = (int) goalStation.totalCost;\r\n\r\n\t\t\t// Find the route to the goal\r\n\t\t\tDijkstraStation tempStation = goalStation;\r\n\r\n\t\t\twhile (!tempStation.stationRef.equals(startStation)) {\r\n\t\t\t\t// Add the station to the route table\r\n\t\t\t\tSerializableStation thisStation = new SerializableStation(tempStation.cost, tempStation.cost,\r\n\t\t\t\t\t\ttempStation.stationRef.stationName, tempStation.stationRef.stationid);\r\n\t\t\t\t\r\n\t\t\t\t//Fix region string\r\n\t\t\t\tString regionString=\"\";\r\n\t\t\t\tfor (Integer regionID : tempStation.stationRef.region) {\r\n\t\t\t\t\tregionString.concat(regionID+ \",\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\tthisStation.region = regionString.substring(0, regionString.length() - 1);\r\n\t\t\t\t\r\n\t\t\t\t//Add the station\r\n\t\t\t\trouteToGoal.route.add(0, thisStation);\r\n\t\t\t\t// Go to the previous station\r\n\t\t\t\ttempStation = getDijkstraStationByID(tempStation.viaStation.stationid, dijkstraStations);\r\n\t\t\t}\r\n\t\t\t// add the starting station\r\n\t\t\tSerializableStation thisStation = new SerializableStation(tempStation.stationRef.latitude, tempStation.stationRef.longitude, tempStation.stationRef.stationName,\r\n\t\t\t\t\ttempStation.stationRef.stationid);\r\n\t\t\trouteToGoal.route.add(0, thisStation);\r\n\r\n\t\t\t// print the route\r\n\t\t\t//System.out.println(\"Printing best route to the Goal:\\n\" + routeToGoal.toString());\r\n\r\n\t\t\treturn routeToGoal;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n private OptimizedItinerary doDijkstra(HipsterDirectedGraph<String,Long> graph, String origin, String destination) {\r\n log.info(String.format(\"----- Doing Dijkstra for origen: %s, and destination: %s -----\", origin, destination));\r\n SearchResult res = null;\r\n SearchProblem p = GraphSearchProblem\r\n .startingFrom(origin)\r\n .in(graph)\r\n .takeCostsFromEdges()\r\n .build();\r\n\r\n res= Hipster.createDijkstra(p).search(destination);\r\n WeightedNode node = (WeightedNode)res.getGoalNode();\r\n log.info(String.format(\"Best itineraries: %s, cost final: %s\", res.getOptimalPaths(), node.getCost()));\r\n \r\n return new OptimizedItinerary.Builder(res.getOptimalPaths())\r\n .setCost( Double.parseDouble(node.getCost().toString()))\r\n .from(origin)\r\n .to(destination)\r\n .build();\r\n }", "public static void main(String[] args) {\n\t\tVertex A = new Vertex(\"A\");\n\t\tVertex B = new Vertex(\"B\");\n\t\tVertex C = new Vertex(\"C\");\n\t\tVertex D = new Vertex(\"D\");\n\t\tVertex E = new Vertex(\"E\");\n\n\t\tA.adjacencies = new Edge[]{ new Edge(B, 10),\tnew Edge(C, 3) };\n\t\tB.adjacencies = new Edge[]{\tnew Edge(C, 1), \tnew Edge(D, 2)};\n\t\tC.adjacencies = new Edge[]{ new Edge(B, 4), \tnew Edge(D, 8),\tnew Edge(E, 2)};\n\t\tD.adjacencies = new Edge[]{ new Edge(E, 7)};\n\t\tE.adjacencies = new Edge[]{ new Edge(D, 9)};\n\t\tVertex[] vertices = { A,B,C,D,E };\n\t\t\n\t\tcomputePaths(A);\n\t\t\n\t\tfor (Vertex v : vertices)\n\t\t{\n\t\t System.out.println(\"Distance to \" + v + \": \" + v.minDistance);\n\t\t List<Vertex> path = getShortestPathTo(v);\n\t\t System.out.println(\"Path: \" + path);\n\t\t}\n\t}", "public HashMap<Nodo, Integer> dijkstra() {\r\n\r\n\t\tPriorityQueue<NodoDijkstra> aVisitar = new PriorityQueue<NodoDijkstra>();\r\n\t\tHashMap<Nodo, Integer> distancias = new HashMap<Nodo, Integer>();\r\n\t\tHashMap<Nodo, Integer> retorno = new HashMap<Nodo, Integer>();\r\n\t\tHashSet<Nodo> visitados = new HashSet<Nodo>();\r\n\r\n\t\tNodoDijkstra nodoOrigen = new NodoDijkstra(this, 0);\r\n\t\tnodoOrigen.setCamino(new Camino(this));\r\n\t\taVisitar.add(nodoOrigen);\r\n\t\tdistancias.put(this, new Integer(0));\r\n\t\tretorno.put(this, new Integer(0));\r\n\r\n\t\twhile (!aVisitar.isEmpty()) {\r\n\t\t\tNodoDijkstra dNodo = aVisitar.poll();\r\n\t\t\tNodo actual = dNodo.getNodo();\r\n\t\t\tCamino camino = dNodo.getCamino();\r\n\r\n\t\t\tif (visitados.contains(actual))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvisitados.add(actual);\r\n\r\n\t\t\tfor (CanalOptico canal : actual.canales) {\r\n\t\t\t\tNodo vecino = canal.getOtroExtremo(actual);\r\n\t\t\t\tint costo = canal.getCosto();\r\n\r\n\t\t\t\t/* Restriccion del Dijkstra */\r\n\t\t\t\tif (visitados.contains(vecino))\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (canal.estaBloqueado())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (vecino.estaBloqueado())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (distancias.containsKey(vecino)) {\r\n\t\t\t\t\tint dActual = distancias.get(vecino);\r\n\r\n\t\t\t\t\tif (dActual <= dNodo.getDistancia() + costo)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taVisitar.remove(vecino);\r\n\t\t\t\t\t\tdistancias.remove(vecino);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNodoDijkstra nuevoNodo = new NodoDijkstra(vecino,\r\n\t\t\t\t\t\tdNodo.getDistancia() + costo);\r\n\t\t\t\tCamino caminoNuevo = new Camino(camino);\r\n\t\t\t\tcaminoNuevo.addSalto(new Salto(camino.getSaltos().size() + 1,\r\n\t\t\t\t\t\tcanal));\r\n\t\t\t\tnuevoNodo.setCamino(caminoNuevo);\r\n\t\t\t\taVisitar.add(nuevoNodo);\r\n\t\t\t\tdistancias.put(nuevoNodo.getNodo(), nuevoNodo.getDistancia());\r\n\t\t\t\tretorno.put(nuevoNodo.getNodo(), nuevoNodo.getDistancia());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "@Test\n void testAddVertexGraph() {\n Assertions.assertTrue(graph.addVertex(v1));\n Assertions.assertTrue(graph.containsVertex(v1));\n Assertions.assertTrue(checkInv());\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}" ]
[ "0.6820986", "0.6673024", "0.64775413", "0.6410827", "0.62239754", "0.6222534", "0.62039167", "0.6188479", "0.61768746", "0.617655", "0.616202", "0.6160104", "0.61569667", "0.61418957", "0.61357117", "0.6117747", "0.6089937", "0.6089298", "0.60835195", "0.60698974", "0.60559934", "0.6052767", "0.60457796", "0.602421", "0.6020261", "0.6016217", "0.60142493", "0.59882665", "0.5976564", "0.5952753", "0.5928375", "0.59235144", "0.59225196", "0.5915897", "0.59076315", "0.59063756", "0.5900646", "0.5897352", "0.58873945", "0.58820355", "0.58716124", "0.58582985", "0.58393735", "0.58142036", "0.5810341", "0.58101636", "0.58066165", "0.5798042", "0.57869583", "0.5780962", "0.5774881", "0.5774005", "0.57705706", "0.5769942", "0.57530326", "0.5752361", "0.57503015", "0.57461137", "0.5745827", "0.57373786", "0.5723301", "0.572254", "0.57159877", "0.5710696", "0.5707264", "0.5706052", "0.57049245", "0.57043254", "0.57002693", "0.57000804", "0.5697258", "0.569137", "0.56852746", "0.5672631", "0.5672346", "0.56677705", "0.5660656", "0.5649146", "0.5634509", "0.56323296", "0.56221735", "0.56157565", "0.56126666", "0.5612226", "0.5610516", "0.56076694", "0.56033075", "0.5603014", "0.5601631", "0.55967563", "0.5593212", "0.55873007", "0.55785364", "0.55776876", "0.55768484", "0.5574596", "0.55694485", "0.55683917", "0.5565679", "0.5559216" ]
0.64701253
3
calls Dijkstra's algorithm on two pairs of vertices in a simple graph and checks its results
@Test public void testPublic15() { Graph<Character> graph= TestGraphs.testGraph3(); List<Character> shortestPath= new ArrayList<Character>(); assertEquals(1, graph.Dijkstra('A', 'O', shortestPath)); assertEquals("A O", TestGraphs.listToString(shortestPath)); assertEquals(4, graph.Dijkstra('M', 'F', shortestPath)); assertEquals("M N P D F", TestGraphs.listToString(shortestPath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test public void testPublic14() {\n Graph<String> graph= TestGraphs.testGraph2();\n List<String> shortestPath= new ArrayList<String>();\n\n assertEquals(1, graph.Dijkstra(\"apple\", \"banana\", shortestPath));\n assertEquals(\"apple banana\", TestGraphs.listToString(shortestPath));\n\n assertEquals(2, graph.Dijkstra(\"apple\", \"cherry\", shortestPath));\n assertEquals(\"apple banana cherry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(3, graph.Dijkstra(\"apple\", \"date\", shortestPath));\n assertEquals(\"apple banana cherry date\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra(\"apple\", \"elderberry\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(5, graph.Dijkstra(\"apple\", \"fig\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(6, graph.Dijkstra(\"apple\", \"guava\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig guava\",\n TestGraphs.listToString(shortestPath));\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "void dijkstra(int[][] graph){\r\n int dist[] = new int[rideCount];\r\n Boolean sptSet[] = new Boolean[rideCount];\r\n\r\n for(int i = 0; i< rideCount; i++){\r\n dist[i] = Integer.MAX_VALUE;\r\n sptSet[i] = false;\r\n }\r\n\r\n dist[0] = 0;\r\n\r\n for(int count = 0; count< rideCount -1; count++){\r\n int u = minWeight(dist, sptSet);\r\n sptSet[u] = true;\r\n for(int v = 0; v< rideCount; v++){\r\n if (!sptSet[v] && graph[u][v] != 0 && dist[u] + graph[u][v] < dist[v]){\r\n dist[v] = dist[u] + graph[u][v];\r\n }\r\n }\r\n }\r\n printSolution(dist);\r\n }", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.isEmpty() | !adjacentA.isEmpty() | !adjacentB.isEmpty()) {\r\n fail();\r\n } \r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "public static void main(String[] args) {\n Digraph grph = new Digraph(5);\n grph.addEdge(0, 1);\n grph.addEdge(1, 2);\n grph.addEdge(2, 3);\n BreadthFirstDirectedPaths path1 = new BreadthFirstDirectedPaths(grph, 0);\n BreadthFirstDirectedPaths path2 = new BreadthFirstDirectedPaths(grph, 0);\n int len = -1;\n for (int i = 0; i < grph.V(); i++) {\n if (path1.hasPathTo(i) && path2.hasPathTo(i)) {\n if (len == -1) {\n len = path1.distTo(i);\n }\n if (path1.distTo(i) > len) {\n len = path1.distTo(i);\n }\n }\n }\n }", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "@Test\r\n public void testAreAdjacent() {\r\n System.out.println(\"areAdjacent\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1, v2, edgeElement);\r\n\r\n Object result = instance.areAdjacent(v1, v2);\r\n Object expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n }", "public void dijkstraAllPairs(boolean print) {\r\n int numSuccesses = 0;\r\n long totalTimeSuccesses = 0;\r\n if (print) System.out.println(\"Paths between all pairs of vertices using Dijkstra's algorithm:\");\r\n for (int i = 0; i < location.size(); i++) {\r\n for (int j = i+1; j < location.size(); j++) {\r\n long startTime = System.nanoTime();\r\n ArrayList<Vertex> pathIJ = dijkstraPath(i, j);\r\n long endTime = System.nanoTime();\r\n if (!pathIJ.isEmpty()) {\r\n numSuccesses++;\r\n totalTimeSuccesses += (endTime - startTime);\r\n }\r\n if (print) System.out.println(\"I = \" + i + \" J = \" + j + \" : \" + pathIJ.toString());\r\n }\r\n }\r\n System.out.println(\"Dijkstra's algorithm is successfull \" + numSuccesses + \"/\" + location.size()*(location.size()-1)/2 + \" times.\");\r\n if (numSuccesses != 0) {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is \" + totalTimeSuccesses/numSuccesses + \" nanoseconds.\");\r\n } else {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is N/A nanoseconds.\");\r\n }\r\n System.out.println(\"\");\r\n }", "@Test public void testPublic16() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(5, graph.Dijkstra(131, 351, shortestPath));\n assertEquals(\"131 330 351\", TestGraphs.listToString(shortestPath));\n }", "@Test\n public void testDijkstra() throws Exception {\n String graphFileName = \"algorithm/graph/shortestpath/weighted/weightedGraph.txt\";\n Graph graph = Graph.createGraphFromFile(WeightedShortestPath.class.getResource(\"/\").getPath() + File.separator +\n graphFileName);\n\n System.out.println(\"==============Graph before weighted shortest path found==============\");\n graph.printGraph();\n\n WeightedShortestPath.dijkstra(graph, graph.getVertex(\"v1\"));\n System.out.println(\"======Graph after weighted shortest path found by Dijkstra's algorithm=====\");\n graph.printGraph();\n\n System.out.println(\"===================Print the path to each vertex====================\");\n for (Vertex v: graph.getVertexMap().values()) {\n graph.printPath(v);\n System.out.println();\n }\n System.out.println();\n }", "public static ArrayList<edges<String, Double>> Dijkstra(String CHAR1, String CHAR2, graph<String,Float> g) {\n\t\tPriorityQueue<ArrayList<edges<String, Double>>> active = \n\t\t\tnew PriorityQueue<ArrayList<edges<String, Double>>>(10,new Comparator<ArrayList<edges<String, Double>>>() {\n\t\t\t\tpublic int compare(ArrayList<edges<String, Double>> path1, ArrayList<edges<String, Double>> path2) {\n\t\t\t\t\tedges<String, Double> dest1 = path1.get(path1.size() - 1);\n\t\t\t\t\tedges<String, Double> dest2 = path2.get(path2.size() - 1);\n\t\t\t\t\tif (!(dest1.getLabel().equals(dest2.getLabel())))\n\t\t\t\t\t\treturn dest1.getLabel().compareTo(dest2.getLabel());\n\t\t\t\t\treturn path1.size() - path2.size();\n\t\t\t\t}\n\t\t\t});\n\t\t\tSet<String> known = new HashSet<String>();\n\t\t\tArrayList<edges<String, Double>> begin = new ArrayList<edges<String, Double>>();\n\t\t\tbegin.add(new edges<String, Double>(CHAR1, 0.0));\n\t\t\tactive.add(begin);\t\t\n\t\t\twhile (!active.isEmpty()) {\n\t\t\t\tArrayList<edges<String, Double>> minPath = active.poll();\n\t\t\t\tedges<String, Double> endOfMinPath = minPath.get(minPath.size() - 1);\n\t\t\t\tString minDest = endOfMinPath.getDest();\n\t\t\t\tdouble minCost = endOfMinPath.getLabel();\n\t\t\t\tif (minDest.equals(CHAR2)) {\n\t\t\t\t\treturn minPath;\n\t\t\t\t}\n\t\t\t\tif (known.contains(minDest))\n\t\t\t\t\tcontinue;\n\t\t\t\tSet<edges<String,Float>> children = g.childrenOf(minDest);\n\t\t\t\tfor (edges<String, Float> e : children) {\n\t\t\t\t\tif (!known.contains(e.getDest())) {\n\t\t\t\t\t\tdouble newCost = minCost + e.getLabel();\n\t\t\t\t\t\tArrayList<edges<String, Double>> newPath = new ArrayList<edges<String, Double>>(minPath); \n\t\t\t\t\t\tnewPath.add(new edges<String, Double>(e.getDest(), newCost));\n\t\t\t\t\t\tactive.add(newPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tknown.add(minDest);\n\t\t\t}\n\t\t\treturn null;\n\t}", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test public void testPublic18() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(13, graph.Dijkstra(250, 141, shortestPath));\n assertEquals(\"250 351 132 141\", TestGraphs.listToString(shortestPath));\n }", "public static void main(String[] args) {\n\t\tint vertices = Integer.parseInt(args[0]);\n\t\tint edges = Integer.parseInt(args[1]);\n\t\tint seed = Integer.parseInt(args[2]);\n\t\tRandom random = new Random(seed);\n\n\t\tAdjMatrixEdgeWeightedDirectedGraph g = new AdjMatrixEdgeWeightedDirectedGraph(vertices);\n\t\tfor (int i = 0; i < edges; i++) {\n\t\t\tint v = random.nextInt(vertices);\n\t\t\tint w = random.nextInt(vertices);\n\t\t\tdouble weight = Math.round(100 * (random.nextDouble() - 0.15)) / 100.0;\n\t\t\tif (v == w) g.addEdge(new Edge(v, w, Math.abs(weight)));\n\t\t\telse g.addEdge(new Edge(v, w, weight));\n\t\t}\n\n\t\t// run Floyd-Warshall algorithm\n\t\tFloydWarshall spt = new FloydWarshall(g);\n\n\t\t// print all-pairs shortest path distances\n\t\tSystem.out.print(\" \");\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%6d \", v);\n\t\t}\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%3d: \", v);\n\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\tif (spt.hasPath(v, w)) System.out.printf(\"%6.2f \", spt.dist(v, w));\n\t\t\t\telse System.out.printf(\" Inf \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// print negative cycle\n\t\tif (spt.hasNegativeCycle()) {\n\t\t\tSystem.out.println(\"Negative cost cycle:\");\n\t\t\tfor (int v : spt.negativeCycle()) System.out.println(v);\n\t\t\tSystem.out.println();\n\t\t// print all-pairs shortest paths\n\t\t} else {\n\t\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\t\tif (spt.hasPath(v, w)) {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d (%5.2f) \", v, w, spt.dist(v, w));\n\t\t\t\t\t\tfor (Edge e : spt.path(v, w)) System.out.print(e + \" \");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d no path\\n\", v, w);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "@Test public void testPublic17() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(8, graph.Dijkstra(131, 141, shortestPath));\n assertEquals(\"131 330 132 141\", TestGraphs.listToString(shortestPath));\n }", "private void connectVertex(IndoorVertex indoorV1, IndoorVertex indoorV2)\n {\n XYPos firstPos = indoorV1.getPosition();\n XYPos secondPos = indoorV2.getPosition();\n\n //Change in only X position means that the vertex's are East/West of eachother\n //Change in only Y position means that the vertex's are North/South of eachother\n if(firstPos.getX() > secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addWestConnection(indoorV2);\n indoorV2.addEastConnection(indoorV1);\n }\n else if(firstPos.getX() < secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addEastConnection(indoorV2);\n indoorV2.addWestConnection(indoorV1);\n }\n else if(firstPos.getY() > secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addSouthConnection(indoorV2);\n indoorV2.addNorthConnection(indoorV1);\n }\n else if(firstPos.getY() < secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addNorthConnection(indoorV2);\n indoorV2.addSouthConnection(indoorV1);\n }\n\n\n indoorV1.addConnection(indoorV2);\n indoorV2.addConnection(indoorV1);\n }", "private void compare_with_dijkstra(Weighting w) {\n final long seed = System.nanoTime();\n final int numQueries = 1000;\n\n Random rnd = new Random(seed);\n int numNodes = 100;\n GHUtility.buildRandomGraph(graph, rnd, numNodes, 2.2, true, speedEnc, null, 0.8, 0.8);\n GHUtility.addRandomTurnCosts(graph, seed, null, turnCostEnc, maxTurnCosts, turnCostStorage);\n\n long numStrictViolations = 0;\n for (int i = 0; i < numQueries; i++) {\n int source = rnd.nextInt(numNodes);\n int target = rnd.nextInt(numNodes);\n Path dijkstraPath = new Dijkstra(graph, w, TraversalMode.EDGE_BASED).calcPath(source, target);\n Path path = calcPath(source, target, ANY_EDGE, ANY_EDGE, w);\n assertEquals(dijkstraPath.isFound(), path.isFound(), \"dijkstra found/did not find a path, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n assertEquals(dijkstraPath.getWeight(), path.getWeight(), 1.e-6, \"weight does not match dijkstra, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n // we do not do a strict check because there can be ambiguity, for example when there are zero weight loops.\n // however, when there are too many deviations we fail\n if (\n Math.abs(dijkstraPath.getDistance() - path.getDistance()) > 1.e-6\n || Math.abs(dijkstraPath.getTime() - path.getTime()) > 10\n || !dijkstraPath.calcNodes().equals(path.calcNodes())) {\n numStrictViolations++;\n }\n }\n if (numStrictViolations > Math.max(1, 0.05 * numQueries)) {\n fail(\"Too many strict violations, seed: \" + seed + \" - \" + numStrictViolations + \" / \" + numQueries);\n }\n }", "public void testDijkstra() {\n \t\tfinal Dijkstra model = new Dijkstra();\n \t\tfinal Formula noDeadlocks = model.dijkstraPreventsDeadlocksAssertion();\n \t\tfinal Solution sol = solve(noDeadlocks, model.bounds(6,6,6));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 4344 18609\n //\t\tprimary variables: 444\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(444, sol.stats().primaryVariables());\n \t\tassertEquals(4344, sol.stats().variables());\n\t\tassertEquals(18609, sol.stats().clauses());\n \t}", "public static void liveDemo() {\n Scanner in = new Scanner( System.in );\n float srcTank1, srcTank2, destTank;\n int alternetPaths;\n Graph mnfld = new Graph();\n boolean runSearch = true;\n\n //might need to limit query results, too large maybe?\n //newnodes = JDBC.graphInformation(); //returns arraylist of nodes\n //mnfld.setPipes(newnodes); //set nodes to the manifold\n //JDBC.insertConnections(mnfld);\n\n//\t\t /*\n//\t\t\tfor (int i = 0; i < newnodes.length(); i++) { //length might be wrong\n//\t\t\t\t//need to look for way to add edges by looking for neighbor nodes i think\n//\t\t\t\t//loop through nodes and create Edges\n//\t\t\t\t//might need new query\n//\t\t\t\tnewedges.addEdge(node1,node2,cost);\n//\t\t\t}\n//\n//\t\t\tmnfld.setConnections(newedges);\n//\n//\t\t\tup to this point, graph should be global to Dijkstra and unused.\n//\t\t\tloop until user leaves page\n//\t\t\tget input from user for tanks to transfer\n//\t\t\tfind shortest path between both tanks\n//\t\t\tend loop\n//\t\t\tthis will change depending how html works so not spending any time now on it\n//\t\t*/\n //shortestPath.runTest();\n\n shortestPath.loadGraph( mnfld );\n while (runSearch) {\n // Gets user input\n System.out.print( \"First Source Tank: \" );\n srcTank1 = in.nextFloat();\n System.out.print( \"Second Source Tank: \" );\n srcTank2 = in.nextFloat();\n System.out.print( \"Destination Tank: \" );\n destTank = in.nextFloat();\n System.out.print( \"Desired Number of Alternate Paths: \" );\n alternetPaths = in.nextInt();\n\n // Prints outputs\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"True shortest with alt paths\" );\n Dijkstra.findAltPaths( mnfld, alternetPaths, srcTank1, destTank );\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering used connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), true );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering only open connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), false );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Merge Lineup\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ) );\n System.out.println( \"\\t Original Lineup: \" );\n mnfld.getPipe( destTank ).printLine();\n System.out.println( \"\\t Merged Lineup: \" );\n Dijkstra.mergePaths( mnfld, srcTank2, mnfld.getPipe( destTank ).getPath(), mnfld.getPipe( destTank ) );\n System.out.print( \"\\nRun another search [1:Yes, 0:No] :: \" );\n if (in.nextInt() == 0) runSearch = false;\n else System.out.println( \"\\n\\n\\n\" );\n }\n\n\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = sc.nextInt();\n\t\tint roadlines = sc.nextInt();\n\t\tsc.nextLine(); // for reading string in nextline\n\t\tEdgeWeightedGraph edge = new EdgeWeightedGraph(cities);\n\t\t// The Time Complexity is O(E)\n\t\t// The road lines is the number of edges\n\t\tfor (int i = 0; i < roadlines; i++) {\n\t\t\tString[] tokens = sc.nextLine().split(\" \");\n\t\t\tedge.addEdge(new Edge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]),\n\t\t\t\tDouble.parseDouble(tokens[2])));\n\t\t}\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t\tSystem.out.println(edge);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] input = sc.nextLine().split(\" \");\n\t\t\tDijkstraSP shortest = new DijkstraSP(\n edge, Integer.parseInt(input[0]));\n double distance = shortest.distTo(Integer.parseInt(input[1]));\n // The time complexity is O(1)\n if (!shortest.hasPathTo(Integer.parseInt(input[1]))) {\n \tSystem.out.println(\"No Path Found.\");\n } else {\n \tSystem.out.println(distance);\n }\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] str1 = sc.nextLine().split(\" \");\n\t\t\tboolean flag1 = false;\n\t\t\tboolean flag2 = false;\n\t\t\tdouble distance1 = 0.0;\n\t\t\tdouble distance2 = 0.0;\n\t\t\tDijkstraSP shortest1 = new DijkstraSP(edge, Integer.parseInt(str1[0]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest1.hasPathTo(Integer.parseInt(str1[1]))) {\n\t\t\t\tflag1 = true;\n\t\t\t\tdistance1 = shortest1.distance(Integer.parseInt(str1[1]));\n\t\t\t}\n\t\t\tDijkstraSP shortest2 = new DijkstraSP(edge, Integer.parseInt(str1[1]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest2.hasPathTo(Integer.parseInt(str1[2]))) {\n\t\t\t\tflag2 = true;\n\t\t\t\tdistance2 = shortest2.distance(Integer.parseInt(str1[2]));\n\t\t\t}\n\t\t\tdouble Distance = distance1 + distance2;\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (flag1 && flag2) {\n\t\t\t// Displays output upto 1 decimal point\n\t\t\tSystem.out.format(\"%.1f\", Distance);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n ArrayList<Integer> path = new ArrayList<>();\n for (Edge eachlink : shortest1.pathTo(Integer.parseInt(str1[1]))) {\n int either = eachlink.either();\n int other = eachlink.other(eachlink.either());\n if (!path.contains(other)) {\n path.add(other);\n }\n if (!path.contains(either)) {\n path.add(either);\n }\n }\n for (Edge eachlink1 : shortest2.pathTo(Integer.parseInt(str1[2]))) {\n int either1 = eachlink1.either();\n int other1 = eachlink1.other(eachlink1.either());\n if (!path.contains(other1)) {\n path.add(other1);\n }\n if (!path.contains(either1)) {\n path.add(either1);\n }\n }\n for (int everyval : path) {\n System.out.print(everyval + \" \");\n }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tDirectedWeightedGraph graph = new DirectedWeightedGraph(3);\n\t\tgraph.addEdge(0, 1, 2);\n\t\tgraph.addEdge(0, 2, 3);\n\t\tgraph.addEdge(2, 1, -2);\n\t\tSystem.out.println(graph);\n\t\tint start = 0;\n\t\tint end = 1;\n\t\tDijkstra d = new Dijkstra(graph, start);\n\t\td.showShortestPathBetweenFromAndTo(graph, start, end);\n\t\td.showAllShortestPathInGraph(graph, start);\n\t}", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "@Test\n public void testShortestDistance2() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 3);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n List<Vertex> expectedPath = new ArrayList<>();\n expectedPath.add(v1);\n expectedPath.add(v2);\n expectedPath.add(v3);\n\n assertTrue(g.edge(e1));\n assertTrue(g.vertex(v1));\n\n v1.updateName(\"test\");\n assertEquals(\"test\", v1.name());\n\n assertEquals(expectedPath, g.shortestPath(v1, v3));\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public static void main(String[] args) {\n\t\tString vertex=\"abcdefghij\";\n\t\tString edge=\"bdegachiabefbc\";\n\t\tchar[] vc=vertex.toCharArray();\n\t\tchar[] ec=edge.toCharArray();\n\t\tint[] v=new int[vc.length];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i]=vc[i]-'a'+1;\n\t\t}\n\t\tint[] e=new int[ec.length];\n\t\tfor (int i = 0; i < e.length; i++) {\n\t\t\te[i]=ec[i]-'a'+1;\n\t\t}\t\t\n\t\t\n\t\tDS_List ds_List=new DS_List(v.length);\n//\t\tfor (int i = 0; i < v.length; i++) {\n//\t\t\tds_List.make_set(v[i]);\n//\t\t}\n//\t\tfor (int i = 0; i < e.length; i=i+2) {\n//\t\t\tif (ds_List.find_set(e[i])!=ds_List.find_set(e[i+1])) {\n//\t\t\t\tds_List.union(e[i], e[i+1]);\n//\t\t\t}\n//\t\t}\n\t\tds_List.connect_components(v, e);\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tSystem.out.print(ds_List.find_set(v[i])+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(ds_List.same_component(v[1], v[2]));\n\t}", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // There are 6 possible edge orderings at a shared vertex (all\n // of these orderings are circular, i.e. abcd == bcda):\n //\n // (1) a2 b2 b0 a0: A contains B\n // (2) a2 a0 b0 b2: B contains A\n // (3) a2 a0 b2 b0: A and B are disjoint\n // (4) a2 b0 a0 b2: A and B intersect in one wedge\n // (5) a2 b2 a0 b0: A and B intersect in one wedge\n // (6) a2 b0 b2 a0: A and B intersect in two wedges\n //\n // In cases (4-6), the boundaries of A and B cross (i.e. the boundary\n // of A intersects the interior and exterior of B and vice versa).\n // Thus we want to distinguish cases (1), (2-3), and (4-6).\n //\n // Note that the vertices may satisfy more than one of the edge\n // orderings above if two or more vertices are the same. The tests\n // below are written so that we take the most favorable\n // interpretation, i.e. preferring (1) over (2-3) over (4-6). In\n // particular note that if orderedCCW(a,b,c,o) returns true, it may be\n // possible that orderedCCW(c,b,a,o) is also true (if a == b or b == c).\n\n if (orderedCCW(a0, a2, b2, ab1)) {\n // The cases with this vertex ordering are 1, 5, and 6,\n // although case 2 is also possible if a2 == b2.\n if (orderedCCW(b2, b0, a0, ab1)) {\n return 1; // Case 1 (A contains B)\n }\n\n // We are in case 5 or 6, or case 2 if a2 == b2.\n return (a2.equalsPoint(b2)) ? 0 : -1; // Case 2 vs. 5,6.\n }\n // We are in case 2, 3, or 4.\n return orderedCCW(a0, b0, a2, ab1) ? 0 : -1; // Case 2,3 vs. 4.\n }", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "public boolean connectsVertex(V v);", "public Dijkstra(Grafo<K, Integer> grafo, Vertice<K, Integer> vertOrigem) {\n\t\t\n\t\tthis.vertices = grafo.getVertices();\n\t\tthis.vertOrigem = vertOrigem;\n\t\t\n\t\tint total = vertices.size();\n\t\tboolean visitado[] = new boolean[total];\n\t\tthis.solucao = new Object[total][2]; // [0] = distancia [1] = vertice adjacente\n\t\t\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tsolucao[i][0] = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint vIndex = vertices.indexOf(vertOrigem);\n\t\tsolucao[vIndex][0] = 0;\n\t\tsolucao[vIndex][1] = vertOrigem;\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tVertice<K, Integer> y = null;\n\t\t\t\n\t\t\tfor (int z = 0; z < total; z++) {\n\t\t\t\tif (visitado[z]) continue;\n\t\t\t\tif ((Integer)solucao[z][0] < min) {\n\t\t\t\t\tmin = (Integer)solucao[z][0];\n\t\t\t\t\ty = vertices.get(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (min == Integer.MAX_VALUE) break;\n\t\t\t\n\t\t\tint yIndex = vertices.indexOf(y);\n\t\t\t\n\t\t\tList<Aresta<K, Integer>> arestas = y.getArestas();\n\t\t\tfor (Aresta<K, Integer> a:arestas) {\n\t\t\t\t\n\t\t\t\tVertice<K, Integer> w = a.getVertices()[0];\n\t\t\t\tint wIndex = vertices.indexOf(w);\n\t\t\t\tif (visitado[wIndex]) continue;\n\t\t\t\t\n\t\t\t\tif ((Integer)solucao[yIndex][0] + a.getValor() < (Integer)solucao[wIndex][0]) {\n\t\t\t\t\tsolucao[wIndex][0] = (Integer)solucao[yIndex][0] + a.getValor();\n\t\t\t\t\tsolucao[wIndex][1] = y;\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tvisitado[yIndex] = true;\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Test\n void testShortestPathDist(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(Double.compare(45,ga.shortestPathDist(1,4)) == 0);\n assertEquals(0,ga.shortestPathDist(1,1));\n assertEquals(-1,ga.shortestPathDist(1,200));\n }", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "@Test\n public void differentLinearGraphsTest() throws Exception {\n EventNode[] g1Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"d\" });\n\n EventNode[] g2Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"e\" });\n\n // ///////////////////\n // g1 and g2 are k-equivalent at first three nodes for k=1,2,3\n // respectively, but no further. Subsumption follows the same pattern.\n\n // \"INITIAL\" not at root:\n testKEqual(g1Nodes[0], g2Nodes[0], 1);\n testKEqual(g1Nodes[0], g2Nodes[0], 2);\n testKEqual(g1Nodes[0], g2Nodes[0], 3);\n testKEqual(g1Nodes[0], g2Nodes[0], 4);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 5);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 6);\n\n // \"a\" node at root:\n testKEqual(g1Nodes[1], g2Nodes[1], 1);\n testKEqual(g1Nodes[1], g2Nodes[1], 2);\n testKEqual(g1Nodes[1], g2Nodes[1], 3);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 4);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 5);\n\n // \"b\" node at root:\n testKEqual(g1Nodes[2], g2Nodes[2], 1);\n testKEqual(g1Nodes[2], g2Nodes[2], 2);\n testNotKEqual(g1Nodes[2], g2Nodes[2], 3);\n\n // \"c\" node at root:\n testKEqual(g1Nodes[3], g2Nodes[3], 1);\n testNotKEqual(g1Nodes[3], g2Nodes[3], 2);\n\n // \"d\" and \"e\" nodes at root:\n testNotKEqual(g1Nodes[4], g2Nodes[4], 1);\n }", "public abstract int shortestPathDistance(String vertLabel1, String vertLabel2);", "@Test\r\n\tpublic void testInputA() {\r\n\t\t//where there is 2 vertices but only 1 edge\r\n\t\tCompetitionDijkstra map1 = new CompetitionDijkstra(\"input-A.txt\", 55,60,92);\r\n\t\tCompetitionFloydWarshall map2= new CompetitionFloydWarshall(\"input-A.txt\", 60,60,92);\r\n\t\tassertEquals(-1, map1.timeRequiredforCompetition());\r\n\t\tassertEquals(-1, map2.timeRequiredforCompetition()); \t\r\n\t}", "@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Override\n public boolean isAdjacent(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n return dictionary.get(vertex1).contains(vertex2) && dictionary.get(vertex2).contains(vertex1);\n } else {\n return false;\n }\n }", "@Test\n\tvoid testIsTwoVertexesConnected() {\n\t\tLinkedHashSet<String> edges = null;\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tAssertions.assertEquals(\"Vertex is not connected (No)\", \"Vertex is not connected (No)\"); // This vertex does\n\t\t\t// not have any\n\t\t\t// edges to\n\t\t\t// connect with\n\t\t\t// vertex\n\t\t}\n\n\t\t// Test one vertex is connected with other vertex\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tvertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\")); // This denotes Boston vertex is connected with another Vertex\n\t\t\t// New York\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tString[] edgesArray = new String[edges.size()];\n\t\t\tedgesArray = edges.toArray(edgesArray);\n\t\t\tAssertions.assertEquals(\"New York\", edgesArray[0]);\n\t\t\tAssertions.assertEquals(\"Vertex is not connected (Yes)\", \"Vertex is not connected (Yes)\");\n\t\t}\n\n\t\t// Test one vertex is connected with other vertex\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tedges.add(\"Newark\");\n\t\tmap.put(\"Boston\", edges);\n\t\tLinkedHashSet<String> edgess = new LinkedHashSet<String>();\n\t\tedgess.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edgess);\n\n\t\tList<String> connectedVertex = new ArrayList<String>();\n\t\tconnectedVertex.addAll(map.get(\"Boston\"));\n\t\tif (connectedVertex.contains(\"Philadelphia\")) {\n\t\t\tAssertions.assertEquals(\"Vertex is not connected (Yes)\", \"Vertex is not connected (Yes)\");\n\t\t} else {\n\t\t\tconnectedVertex.forEach((String name) -> {\n\t\t\t\tif (map.get(name) != null) {\n\n\t\t\t\t\tAssertions.assertTrue(map.get(name).contains(\"Philadelphia\"));\n\t\t\t\t\tAssertions.assertEquals(\"Vertex is not connected (Yes)\", \"Vertex is not connected (Yes)\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t}", "@Test\r\n\tpublic void test_Big_Graph() {\n\t\tweighted_graph g = new WGraph_DS();\r\n\t\tint size = 1000*1000;\r\n\t\tint ten=1;\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tg.addNode(i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tint dest=i;\r\n\t\t\tg.connect(size-2, i, 0.23); \r\n\r\n\t\t\tif(i<size-1){\r\n\t\t\t\tg.connect(i,++dest,0.78);\r\n\t\t\t}\r\n\t\t\tif(i%2==0&&i<size-2) {\r\n\t\t\t\tg.connect(i,2+dest,0.94);\r\n\t\t\t}\t\r\n\r\n\t\t\tif(ten==i&&(i%2==0)) {\r\n\t\t\t\tfor (int j =0 ; j <size; j++) {\r\n\t\t\t\t\tg.connect(ten, j,0.56);\r\n\t\t\t\t\tg.connect(ten-2, j, 0.4);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tten=ten*10;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t\tweighted_graph_algorithms algo = new WGraph_Algo();\r\n\t\talgo.init(g);\r\n\t\tassertTrue(algo.isConnected());\r\n\t\tassertEquals(algo.shortestPathDist(0, 999998),0.23);\r\n\t\tassertEquals(algo.shortestPathDist(0, 8),0.46);\r\n\t\tint expected2 []= {6,999998,8};\r\n\t\tint actual2 [] = new int [3];\r\n\t\tint i=0;\r\n\t\tfor(node_info n :algo.shortestPath(6, 8)) {\r\n\t\t\tactual2[i++]=n.getKey();\r\n\t\t}\r\n\t\tassertArrayEquals(expected2,actual2);\r\n\r\n\t}", "private void checkConnection( SquareNode a , SquareNode b ) {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tSquareEdge edgeA = a.edges[i];\n\t\t\tif( edgeA == null )\n\t\t\t\tcontinue;\n\n\t\t\tSquareNode common = edgeA.destination(a);\n\t\t\tint commonToA = edgeA.destinationSide(a);\n\t\t\tint commonToB = CircularIndex.addOffset(commonToA,1,4);\n\n\t\t\tSquareEdge edgeB = common.edges[commonToB];\n\t\t\tif( edgeB != null && edgeB.destination(common) == b ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfail(\"Failed\");\n\t}", "public void shortestRouteDijkstra(){\n int landmark1 = l1.getSelectionModel().getSelectedIndex();\n int landmark2 = l2.getSelectionModel().getSelectedIndex();\n GraphNodeAL<MapPoint> lm1 = landmarkList.get(landmark1);\n GraphNodeAL<MapPoint> lm2 = landmarkList.get(landmark2);\n\n shortestRouteDij(lm1, lm2);\n }", "@Test\n public void identicalLinearGraphsTest() throws Exception {\n // Create two a->b->c->d graphs\n String events[] = new String[] { \"a\", \"b\", \"c\", \"d\" };\n EventNode[] g1Nodes = getChainTraceGraphNodesInOrder(events);\n EventNode[] g2Nodes = getChainTraceGraphNodesInOrder(events);\n\n // Check that g1 and g2 are equivalent for all k at every corresponding\n // node, regardless of subsumption.\n\n // NOTE: both graphs have an additional INITIAL and TERMINAL nodes, thus\n // the +2 in the loop condition.\n EventNode e1, e2;\n for (int i = 0; i < (events.length + 2); i++) {\n e1 = g1Nodes[i];\n e2 = g2Nodes[i];\n for (int k = 1; k < 6; k++) {\n testKEqual(e1, e2, k);\n testKEqual(e1, e1, k);\n }\n }\n }", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "public static void main(String[] args) {\n\t\tGraph g = new Graph(5, false);\r\n\t\tg.addConnection(1, 2, 15);\r\n\t\tg.addConnection(1, 3, 5);\r\n\t\tg.addConnection(1, 4, 1);\r\n\t\t\r\n\t\tg.addConnection(2, 3, 5);\r\n\t\t//g.addConnection(2, 5, 1);\r\n\t\t\r\n\t\t//g.addConnection(4, 5, 1);\r\n\r\n\t\tSystem.out.println(g);\r\n\t\tg.dijkstra(1);\r\n\t\tg.prim(1);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tVertex A = new Vertex(\"A\");\n\t\tVertex B = new Vertex(\"B\");\n\t\tVertex C = new Vertex(\"C\");\n\t\tVertex D = new Vertex(\"D\");\n\t\tVertex E = new Vertex(\"E\");\n\n\t\tA.adjacencies = new Edge[]{ new Edge(B, 10),\tnew Edge(C, 3) };\n\t\tB.adjacencies = new Edge[]{\tnew Edge(C, 1), \tnew Edge(D, 2)};\n\t\tC.adjacencies = new Edge[]{ new Edge(B, 4), \tnew Edge(D, 8),\tnew Edge(E, 2)};\n\t\tD.adjacencies = new Edge[]{ new Edge(E, 7)};\n\t\tE.adjacencies = new Edge[]{ new Edge(D, 9)};\n\t\tVertex[] vertices = { A,B,C,D,E };\n\t\t\n\t\tcomputePaths(A);\n\t\t\n\t\tfor (Vertex v : vertices)\n\t\t{\n\t\t System.out.println(\"Distance to \" + v + \": \" + v.minDistance);\n\t\t List<Vertex> path = getShortestPathTo(v);\n\t\t System.out.println(\"Path: \" + path);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint[] vertex= {0,1,2,3,4};\r\n\t\tint[][] graph= {{100,3,100,100,5},{100,100,8,5,3},{100,100,100,100,100},{100,100,2,100,100},{100,100,100,4,100}};\r\n\t\tint[] dist= {0,100,100,100,100};\r\n\t\tint i=0;\r\n\t\tint tvc=1;\r\n\t\twhile(tvc<5) {\r\n\t\t\tfor(int j=0;j<vertex.length;j++) {\r\n\t\t\t\tif(dist[j]>graph[i][j]+dist[i]) {\r\n\t\t\t\t\tdist[j]=graph[i][j]+dist[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttvc++;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tSystem.out.println(\"Shortest path (distance from source):\");\r\n\t\tSystem.out.println(\"a: \"+dist[0]);\r\n\t\tSystem.out.println(\"b: \"+dist[1]);\r\n\t\tSystem.out.println(\"c: \"+dist[2]);\r\n\t\tSystem.out.println(\"d: \"+dist[3]);\r\n\t\tSystem.out.println(\"e: \"+dist[4]);\r\n\t}", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "public static void main(String[] args) {\n int vertices = Integer.parseInt(StdIn.readLine());\n //Storing vertex weights\n double[] vertW = new double[vertices];\n for(int i=0;i<vertices;i++)\n vertW[i] = Double.parseDouble(StdIn.readLine());\n //Reading in new graph, G**\n String[] Gstarstar = StdIn.readAllLines();\n //Making graph\n EdgeWeightedDigraph G = new EdgeWeightedDigraph(Gstarstar);\n //Dijkstra All Pairs\n DijkstraAllPairsSP DAP = new DijkstraAllPairsSP(G);\n //Printing output of paths\n for(int i=0; i<G.V(); i++){\n for(int j=0; j<G.V(); j++){\n if(!DAP.hasPath(i,j))\n StdOut.print(i+\" to \"+j+\"\\t\\tno path\");\n else{\n double newEW;\n double EW;\n Iterable<DirectedEdge> path = DAP.path(i,j);\n double totalWeight = 0;\n String sp = \"\"; //String that's going to form the path\n for(DirectedEdge x : path){\n newEW = x.weight();\n EW = newEW + vertW[x.to()] - vertW[x.from()]; //reverse calibrate\n totalWeight += EW;\n sp += \"\\t\"+x.from()+\"->\"+x.to()+\" \"+String.format(\"%.2f\",EW); //adding to path\n }\n StdOut.print(i+\" to \"+j+\"\\t(\"+String.format(\"%.2f\",totalWeight)+\") \");\n StdOut.print(sp);\n }\n StdOut.println();\n }\n StdOut.println();\n }\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "@Test\n public void testShortestDistance() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 3);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 2);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n List<Vertex> expectedPath = new ArrayList<>();\n expectedPath.add(v1);\n expectedPath.add(v3);\n assertEquals(expectedPath, g.shortestPath(v1, v3));\n\n assertEquals(6, g.edgeLengthSum());\n }", "@Test\n public void equalDagGraphsTest() throws Exception {\n // Generate two identical DAGs\n String traceStr = \"1,0 a\\n\" + \"2,1 b\\n\" + \"1,2 c\\n\" + \"2,3 d\\n\"\n + \"--\\n\" + \"1,0 a\\n\" + \"2,1 b\\n\" + \"1,2 c\\n\" + \"2,3 d\\n\";\n\n TraceParser parser = genParser();\n ArrayList<EventNode> parsedEvents = parser.parseTraceString(traceStr,\n testName.getMethodName(), -1);\n DAGsTraceGraph g1 = parser.generateDirectPORelation(parsedEvents);\n exportTestGraph(g1, 0);\n\n List<Transition<EventNode>> initNodeTransitions = g1\n .getDummyInitialNode().getAllTransitions();\n EventNode firstA = initNodeTransitions.get(0).getTarget();\n EventNode secondA = initNodeTransitions.get(1).getTarget();\n for (int k = 1; k < 4; k++) {\n testKEqual(firstA, secondA, k);\n }\n }", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "public static void main(String[] args)\n\t{\n\t\t\n\t\tMapGraph simpleTestMap = new MapGraph();\n\t\tGraphLoader.loadRoadMap(\"data/testdata/simpletest.map\", simpleTestMap);\n\t\t\n\t\tGeographicPoint testStart = new GeographicPoint(1.0, 1.0);\n\t\tGeographicPoint testEnd = new GeographicPoint(8.0, -1.0);\n\t\t\n\t\tSystem.out.println(\"Test 1 using simpletest: Dijkstra should be 9 and AStar should be 5\");\n\t\tList<GeographicPoint> testroute = simpleTestMap.dijkstra(testStart,testEnd);\n\t\tList<GeographicPoint> testroute2 = simpleTestMap.aStarSearch(testStart,testEnd);\t\n\t\tMapGraph testMap = new MapGraph();\n\t\tGraphLoader.loadRoadMap(\"data/maps/utc.map\", testMap);\n\t\t\n\t\t// A very simple test using real data\n\t\ttestStart = new GeographicPoint(32.869423, -117.220917);\n\t\ttestEnd = new GeographicPoint(32.869255, -117.216927);\n\t\tSystem.out.println(\"Test 2 using utc: Dijkstra should be 13 and AStar should be 5\");\n\t\ttestroute = testMap.dijkstra(testStart,testEnd);\n\t\ttestroute2 = testMap.aStarSearch(testStart,testEnd);\n\t\t\n\t\t\n\t\t// A slightly more complex test using real data\n\t\ttestMap = new MapGraph();\n\t\tGraphLoader.loadRoadMap(\"data/maps/utc.map\", testMap);\n\t\t\n\t\ttestStart = new GeographicPoint(32.8674388, -117.2190213);\n\t\ttestEnd = new GeographicPoint(32.8697828, -117.2244506);\n\t\tSystem.out.println(\"Test 3 using utc: Dijkstra should be 37 and AStar should be 10\");\n\t\ttestroute = testMap.dijkstra(testStart,testEnd);\n\t\ttestroute2 = testMap.aStarSearch(testStart,testEnd);\n\t\t\n\t\tMapGraph theMap = new MapGraph();\n\t\tSystem.out.print(\"DONE. \\nLoading the map...\");\n\t\tGraphLoader.loadRoadMap(\"data/maps/utc.map\", theMap);\n\t\tSystem.out.println(\"DONE.\");\n\n\t\tGeographicPoint start = new GeographicPoint(32.8648772, -117.2254046);\n\t\tGeographicPoint end = new GeographicPoint(32.8660691, -117.217393);\n\t\t\n\t\t\n\t\tList<GeographicPoint> route = theMap.dijkstra(start,end);\n\t\tList<GeographicPoint> route2 = theMap.aStarSearch(start,end);\n\t\tSystem.out.println(testroute);\n\t\tSystem.out.println(testroute2);\n\t\t\n\t}", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "ShortestPath(UndirectedWeightedGraph graph, String startNodeId, String endNodeId) throws NotFoundNodeException {\r\n\t\t\r\n\t\tif (!graph.containsNode(startNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, startNodeId);\r\n\t\t}\t\t\r\n\t\tif (!graph.containsNode(endNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, endNodeId);\r\n\t\t}\t\r\n\r\n\t\tsrc = startNodeId;\r\n\t\tdst = endNodeId;\r\n\t\t\r\n\t\tif (endNodeId.equals(startNodeId)) {\r\n\t\t\tlength = 0;\r\n\t\t\tnumOfPath = 1;\r\n\t\t\tArrayList<String> path = new ArrayList<String>();\r\n\t\t\tpath.add(startNodeId);\r\n\t\t\tpathList.add(path);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// create a HashMap of updated distance from the starting node to every node\r\n\t\t\t// initially it is 0, inf, inf, inf, ...\r\n\t\t\tHashMap<String, Double> distance = new HashMap<String, Double>();\t\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif (nodeId.equals(startNodeId)) {\r\n\t\t\t\t\t// the starting node will always have 0 distance from itself\r\n\t\t\t\t\tdistance.put(nodeId, 0.0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// the others have initial distance is infinity\r\n\t\t\t\t\tdistance.put(nodeId, Double.MAX_VALUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// a HashMap of preceding node of each node\r\n\t\t\tHashMap<String, HashSet<String>> precedence = new HashMap<String, HashSet<String>>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif ( nodeId.equals(startNodeId) ) {\r\n\t\t\t\t\tprecedence.put(nodeId, null);\t// the start node will have no preceding node\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tprecedence.put(nodeId, new HashSet<String>());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\tSet<String> unvisitedNode = new HashSet<String>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tunvisitedNode.add(nodeId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble minUnvisitedLength;\r\n\t\t\tString minUnvisitedNode;\r\n\t\t\t// run loop while not all node is visited\r\n\t\t\twhile ( unvisitedNode.size() != 0 ) {\r\n\t\t\t\t// find the unvisited node with minimum current distance in distance list\r\n\t\t\t\tminUnvisitedLength = Double.MAX_VALUE;\r\n\t\t\t\tminUnvisitedNode = \"\";\r\n\t\t\t\tfor (String nodeId : unvisitedNode) {\r\n\t\t\t\t\tif (distance.get(nodeId) < minUnvisitedLength) {\r\n\t\t\t\t\t\tminUnvisitedNode = nodeId;\r\n\t\t\t\t\t\tminUnvisitedLength = distance.get(nodeId); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if there are no node that can be visited from the unvisitedNode, break the loop \r\n\t\t\t\tif (minUnvisitedLength == Double.MAX_VALUE) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// remove the node from unvisitedNode\r\n\t\t\t\tunvisitedNode.remove(minUnvisitedNode);\r\n\t\t\t\t\r\n\t\t\t\t// update the distance of its neighbors\r\n\t\t\t\tfor (Node neighborNode : graph.getNodeList().get(minUnvisitedNode).getNeighbors().keySet()) {\r\n\t\t\t\t\tdouble distanceFromTheMinNode = distance.get(minUnvisitedNode) + graph.getNodeList().get(minUnvisitedNode).getNeighbors().get(neighborNode).getWeight();\r\n\t\t\t\t\t// if the distance of the neighbor can be shorter from the current node, change \r\n\t\t\t\t\t// its details in distance and precedence\r\n\t\t\t\t\tif ( distanceFromTheMinNode < distance.get(neighborNode.getId()) ) {\r\n\t\t\t\t\t\tdistance.replace(neighborNode.getId(), distanceFromTheMinNode);\r\n\t\t\t\t\t\t// renew the precedence of the neighbor node\r\n\t\t\t\t\t\tprecedence.put(neighborNode.getId(), new HashSet<String>());\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (distanceFromTheMinNode == distance.get(neighborNode.getId())) {\r\n\t\t\t\t\t\t// unlike dijkstra's algorithm, multiple path should be update into the precedence\r\n\t\t\t\t\t\t// if from another node the distance is the same, add it to the precedence\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// if the current node in the process is the end node, we can stop the while loop here\r\n\t\t\t\tif (minUnvisitedNode == endNodeId) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (distance.get(endNodeId) == Double.MAX_VALUE) {\r\n\t\t\t\t// in case there is no shortest path between the 2 nodes\r\n\t\t\t\tlength = 0;\r\n\t\t\t\tnumOfPath = 0;\r\n\t\t\t\tpathList = null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// other wise we have these information\r\n\t\t\t\tlength = distance.get(endNodeId);\r\n\t\t\t\t//numOfPath = this.getNumPath(precedence, startNodeId, endNodeId);\r\n\t\t\t\tpathList = this.findPathList(precedence, startNodeId, endNodeId);\r\n\t\t\t\tnumOfPath = pathList.size();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t// END ELSE\t\t\r\n\t}", "public boolean dfs(String v1name, String v2name) {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> stack = new LinkedList<>();\r\n\r\n\t\tPair rootpair = new Pair(v1name, v1name);\r\n\t\tstack.addFirst(rootpair);\r\n\r\n\t\twhile (stack.size() != 0) {\r\n\t\t\t// 1. removeFirst\r\n\t\t\tPair rp = stack.removeFirst();\r\n\r\n\t\t\t// 2. check if processed, mark if not\r\n\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t// 3. Check, if an edge is found\r\n\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\tif (this.containsEdge(rp.vname, v2name) == true) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\tstack.addFirst(np);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private double dijkstrasAlgo(String source, String dest) {\r\n\r\n\t\tclearAll(); // running time: |V|\r\n\t\tint count = 0; // running time: Constant\r\n\t\tfor (Vertex v : vertexMap.values()) // running time: |V|\r\n\t\t\tif (v.isStatus())\r\n\t\t\t\tcount++;\r\n\r\n\t\tVertex[] queue = new Vertex[count]; // running time: Constant\r\n\t\tVertex start = vertexMap.get(source); // running time: Constant\r\n\t\tstart.dist = 0; // running time: Constant\r\n\t\tstart.prev = null; // running time: Constant\r\n\r\n\t\tint index = 0; // running time: Constant\r\n\t\tfor (Vertex v : vertexMap.values()) { // running time: |V|\r\n\t\t\tif (v.isStatus()) {\r\n\t\t\t\tqueue[index] = v;\r\n\t\t\t\tv.setHandle(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbuildMinHeap(queue, count); // running time: |V|\r\n\r\n\t\twhile (count != 0) { // running time: |V|\r\n\t\t\tVertex min = extractMin(queue, count); // running time: log |V|\r\n\t\t\tcount--; // running time: Constant\r\n\r\n\t\t\tfor (Iterator i = min.adjacent.iterator(); i.hasNext();) { // running time: |E|\r\n\t\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\t\tif (edge.isStatus()) {\r\n\t\t\t\t\tVertex adjVertex = vertexMap.get(edge.getDestination());\r\n\t\t\t\t\tif (adjVertex.dist > (min.dist + edge.getCost()) && adjVertex.isStatus()) {\r\n\t\t\t\t\t\tadjVertex.dist = (min.dist + edge.getCost());\r\n\t\t\t\t\t\tadjVertex.prev = min;\r\n\t\t\t\t\t\tint pos = adjVertex.getHandle();\r\n\t\t\t\t\t\tHeapdecreaseKey(queue, pos, adjVertex); // running time: log |V|\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn vertexMap.get(dest).dist; // running time: Constant\r\n\t}", "public static <G extends BaseWeightedGraph<V,E,W>,V,E extends WeightedEdge<V,W>, W extends Number & Comparable<W>> List<E> findShortestPathDouble(G graph, V source, V sink){\r\n\t\t// check graph contains source and sink\r\n\t\tSet<V> vertecies = graph.getVertices();\r\n\t\tif( !(vertecies.contains(source) && vertecies.contains(sink)) ){\r\n\t\t\tthrow new IllegalArgumentException(\"BaseGraph must contain both source and sink\");\r\n\t\t}\r\n\t\t\r\n\t\tPriorityQueue<WeightedPathChain<V,E,W,Double>> pq = new PriorityQueue<WeightedPathChain<V,E,W,Double>>(); \r\n\t\tHashSet<V> checked = new HashSet<V>();\r\n\t\tHashMap<V,WeightedPathChain<V,E,W,Double>> map = new HashMap<V,WeightedPathChain<V,E,W,Double>>();\r\n\t\taddOrUpdate(map,pq,source,Double.valueOf(0));\r\n\t\twhile(!pq.isEmpty()&&!sink.equals(pq.peek().vertex)){\r\n\t\t\tWeightedPathChain<V,E,W,Double> current = pq.poll(); // poll lowest level vertex\r\n\t\t\tchecked.add(current.vertex); // add vertex to checked set\r\n\t\t\tfor (E edge :graph.getOutgoingEdges(current.vertex)){\t// for each outgoing edge \r\n\t\t\t\tif(!checked.contains(edge.getOpposingVertex(current.vertex))){\t\t// if opposing vertex has not been checked \r\n\t\t\t\t\taddOrUpdate(map,\r\n\t\t\t\t\t\t\t\tpq,\r\n\t\t\t\t\t\t\t\tedge.getOpposingVertex(current.vertex),\r\n\t\t\t\t\t\t\t\tDouble.valueOf(map.get(current.vertex).val+edge.getWeight().doubleValue() ) ,\r\n\t\t\t\t\t\t\t\tedge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tArrayList<V> path = new ArrayList<V>(); // vertex path \r\n\t\tArrayList<E> edgePath = new ArrayList<E>(); // edge path\r\n\t\tboolean run = true; \r\n\t\tif(!pq.isEmpty()&&pq.peek().vertex.equals(sink)) { // \r\n\t\t\tWeightedPathChain<V,E,W,Double> vv = pq.poll();\r\n\t\t\tpath.add(vv.vertex);\r\n\t\t\tedgePath.add(vv.edge);\r\n\t\t\twhile(run) {\r\n\t\t\t\tvv = map.get(vv.edge.getOpposingVertex(vv.vertex));\r\n\t\t\t\tif(vv.vertex.equals(source)) {\r\n\t\t\t\t\trun=false;\r\n\t\t\t\t\tpath.add(vv.vertex);\r\n\t\t\t\t}\r\n\t\t\t\telse {\t\r\n\t\t\t\t\tedgePath.add(vv.edge);\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return path;\r\n\t\t\r\n\t\tCollections.reverse(edgePath);\r\n\t\treturn edgePath;\r\n\t}", "private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static int QTDelHeuristic1 (Graph<Integer,String> h) {\n\t\tint count = 0;\r\n\t\tboolean isQT = false;\r\n\t\t//h = Copy(g);\r\n\t\t//boolean moreToDo = true;\r\n\t\t\r\n\t\tIterator<Integer> a;\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\r\n\t\twhile (isQT == false) {\r\n\t\t\tisQT = true;\r\n\t\t\ta= h.getVertices().iterator();\r\n\t\t\twhile(a.hasNext()){\r\n\t\t\t\tInteger A = a.next();\r\n\t\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\t\tb = h.getNeighbors(A).iterator();\r\n\t\t\t\twhile(b.hasNext()){\r\n\t\t\t\t\tInteger B = b.next();\r\n\t\t\t\t\tc = h.getNeighbors(B).iterator();\r\n\t\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\t\tif (h.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\t\td = h.getNeighbors(C).iterator();\r\n\t\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\t\tisQT = false;\r\n\t\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t\t// requires 2 deletions\r\n\t\t\t\t\t\t\t\tcount += 2;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 2 + QTDelHeuristic1(h);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcount += 1;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 1 + QTDelHeuristic1(h);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\t\t\r\n\t\treturn count;\t\t\r\n\t}", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "public static void main(String args[])\n\t{\n\t\tList<Vertex> v = new LinkedList<Vertex>();\n\t\tVertex v1 = new Vertex(1);\n\t\tVertex v2 = new Vertex(2);\n\t\tVertex v3 = new Vertex(3);\n \t\tVertex v4 = new Vertex(4);\n\t\t\n \t\t//Setting adjList for each vertex\n \t\tList<Vertex> adjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tadjList.add(v3);\n\t\tv1.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v4);\n\t\tv2.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tv3.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v3);\n\t\tv4.setAdjList(adjList);\n\t\t\n\t\tv.add(v1);\n\t\tv.add(v2);\n \t\tv.add(v3);\n\t\tv.add(v4);\n\n\t\tEdge e1 = new Edge(1, 2);\n\t\tList<Edge> e = new LinkedList<Edge>();\n\t\te.add(e1);\n\t\te1 = new Edge(1, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(2, 4);\n\t\te.add(e1);\n\t\te1 = new Edge(4, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(3, 2);\n\t\te.add(e1);\n\t\t\n\t\t\n\t\tGraph g = new Graph(v, e);\n\t\tg.bfs(v4);\n\t\t\n\t\t//v has all vertices\n\t\tg.unconnected(v2, v);\n\t}", "int bfs(Vertex start, Vertex goal) {\n // Create queue for holding upcoming vertices to check.\n Queue<Vertex> queue = new LinkedList<>();\n // Create list of vertices that have been checked.\n ArrayList<Vertex> visited = new ArrayList<>(verticesAndTheirEdges.size());\n\n // Create map for storing distance from start to each vertex.\n // Defaults to -1 (since we want to return -1 if no path can be found)\n HashMap<Vertex, Integer> distance = new HashMap<>();\n for (Map.Entry<Vertex, LinkedList<Vertex>> vertex : verticesAndTheirEdges.entrySet()) {\n distance.put(vertex.getKey(), -1);\n }\n distance.put(start, 0);\n\n // Add start vertex to queue to initiate search,\n // then add it to the 'visited' list so that we don't check it again.\n queue.add(start);\n visited.add(start);\n while (!queue.isEmpty()) {\n // Take the first vertex from the queue.\n Vertex v = queue.remove();\n // Get all the vertexes edges.\n List<Vertex> neighbours = verticesAndTheirEdges.get(v);\n for (Vertex n : neighbours) {\n // If we haven't visited the neighboring vertex:\n if (n != null && !visited.contains(n)) {\n // Save the neighbors distance as the previous vertex distance +1.\n distance.put(n, distance.get(v) + 1);\n // Add the vertex to the queue of upcoming vertices to check.\n queue.add(n);\n // Mark vertex as visited.\n visited.add(n);\n }\n }\n }\n // Return the distance between start and goal vertices in the graph.\n return distance.get(goal);\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = Integer.parseInt(sc.nextLine());\n\t\tint roads = Integer.parseInt(sc.nextLine());\n\n EdgeWeightedGraph graphObj = new EdgeWeightedGraph(cities);\n for (int i = 0; i < roads; i++) {\n String way = sc.nextLine();\n String[] tokens = way.split(\" \");\n graphObj.addEdge(new Edge(Integer.parseInt(tokens[0]),\n Integer.parseInt(tokens[1]), Double.parseDouble(tokens[2])));\n }\n\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t System.out.println(graphObj);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the path[1].\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t String[] path = sc.nextLine().split(\" \");\n\t\t int source = Integer.parseInt(path[0]);\n\t\t int destiny = Integer.parseInt(path[1]);\n\t\t\tDijkstraUndirectedSP pathObj = new DijkstraUndirectedSP(graphObj, source);\n\t\t\tif(pathObj.hasPathTo(destiny)) {\n\t\t\t\tSystem.out.println(pathObj.distTo(destiny));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the path[1].\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t String[] path1 = sc.nextLine().split(\" \");\n\t\t int source1 = Integer.parseInt(path1[0]);\n\t\t int via = Integer.parseInt(path1[1]);\n\t\t int destiny1 = Integer.parseInt(path1[2]);\n\n\t\t\tDijkstraUndirectedSP path1Obj = new DijkstraUndirectedSP(graphObj, source1);\n\t\t\tif(path1Obj.hasPathTo(via)) {\n\n\t\t\t\tDijkstraUndirectedSP viaObj = new DijkstraUndirectedSP(graphObj, via);\n\t\t\t\tif(viaObj.hasPathTo(destiny1)) {\n\t\t\t\t\tdouble dist = path1Obj.distTo(via);\n\t\t\t\t\tdist += viaObj.distTo(destiny1);\n\t\t\t\t\tSystem.out.println(dist);\n\n\t\t\t\tList<Integer> arraylist = new List<Integer>();\n\t\t\t\t\tString srcvia = path1Obj.pathTo(via)+\"\"+viaObj.pathTo(destiny1);\n\t\t\t\t\t//System.out.println(srcvia);\n\t\t\t\t \tString[] temp = srcvia.split(\" \");\n\t\t\t\t \tString[] temp1 = temp[0].split(\"-\");\n\t\t\t\t \tString[] temp2 = temp[2].split(\"-\");\n\t\t\t\t \tString[] temp3 = temp[4].split(\"-\");\n\t\t\t\t \tString[] temp4 = temp[6].split(\"-\");\n\t\t\t\t \tString[] temp5 = temp[8].split(\"-\");\n\n\t\t\t\t// \tString[] val = temp[1].split(\" \");\n\t\t\t\t \tarraylist.add(Integer.parseInt(temp1[1]));\n\t\t\t\t\tarraylist.add(Integer.parseInt(temp1[0]));\n\t\t\t\t\tarraylist.add(Integer.parseInt(temp3[1]));\n\t\t\t\t\tarraylist.add(Integer.parseInt(temp3[0]));\n\t\t\t\t\tarraylist.add(Integer.parseInt(temp5[1]));\n\t\t\t\t\tarraylist.add(Integer.parseInt(temp5[0]));\n\n\n\n\n\n\n\t\t\t\tSystem.out.println(arraylist);\n\n\n\n\t\t\t\t\t//System.out.println(path1Obj.pathTo(via)+\"\"+viaObj.pathTo(destiny1));\n\t\t\t}\n\n\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t}\n\t\t}\n\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "private static boolean compareEdges(S2Point a0, S2Point a1, S2Point b0, S2Point b1) {\n if (a1.lessThan(a0)) {\n S2Point temp = a0;\n a0 = a1;\n a1 = temp;\n }\n if (b1.lessThan(b0)) {\n S2Point temp = b0;\n b0 = b1;\n b1 = temp;\n }\n return a0.lessThan(b0) || (a0.equalsPoint(b0) && b0.lessThan(b1));\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "@Test\n public void testDistantPoints() {\n // OK with 1000 visited nodes:\n MapMatching mapMatching = new MapMatching(hopper, algoOptions);\n List<GPXEntry> inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.23, 12.18),\n new GHPoint(51.45, 12.59));\n MatchResult mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(57650, mr.getMatchLength(), 1);\n assertEquals(2747796, mr.getMatchMillis(), 1);\n\n // not OK when we only allow a small number of visited nodes:\n AlgorithmOptions opts = AlgorithmOptions.start(algoOptions).maxVisitedNodes(1).build();\n mapMatching = new MapMatching(hopper, opts);\n try {\n mr = mapMatching.doWork(inputGPXEntries);\n fail(\"Expected sequence to be broken due to maxVisitedNodes being too small\");\n } catch (RuntimeException e) {\n assertTrue(e.getMessage().startsWith(\"Sequence is broken for submitted track\"));\n }\n }", "private static List<Vertex> doDijkstra(List<Vertex> vertexes) {\n\n\t\t// Zok, we have a graph constructed. Traverse.\n\t\tPriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(me);\n\t\tme.setMinDistance(0);\n\n\t\twhile (!vertexQueue.isEmpty()) {\n\t\t\tVertex v = vertexQueue.poll();\n\t\t\tdouble distance = v.getMinDistance() + 1;\n\n\t\t\tfor (Vertex neighbor : v.getAdjacencies()) {\n\t\t\t\tif (distance < neighbor.getMinDistance()) {\n\t\t\t\t\tneighbor.setMinDistance(distance);\n\t\t\t\t\tneighbor.setPrevious(v);\n\t\t\t\t\tvertexQueue.remove(neighbor);\n\t\t\t\t\tvertexQueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn vertexes;\n\t}", "public static void djikstra(int[][] graph, int src) {\n\t\t/* output array */\n\t\tint[] dist = new int[graph.length];\n\t\tboolean[] visited = new boolean[graph.length];\n\n\t\tfor (int i = 0; i < graph.length; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE;\n\t\t\tvisited[i] = false;\n\t\t}\n\n\t\tdist[src] = 0;\n\n\t\tfor (int i = 0; i < graph.length - 1; i++) {\n\n\t\t\t// Pick the minimum distance vertex from the set of vertices not\n\t\t\t// yet processed. u is always equal to src in first iteration.\n\t\t\tint u = findMinDistanceVertex(dist, visited);\n\t\t\t// Mark the picked vertex as processed\n\t\t\tvisited[u] = true;\n\t\t\t\n\t\t\tfor(int j = 0; j < graph.length; j++) {\n\t\t\t\t\n\t\t\t\t// Update dist[v] only if is not in sptSet, there is an edge from \n\t\t // u to v, and total weight of path from src to v through u is \n\t\t // smaller than current value of dist[v]\n\t\t\t\tif(!visited[j] && graph[u][j] != 0\n\t\t\t\t\t\t&& dist[u] != Integer.MAX_VALUE\n\t\t\t\t\t\t&& dist[u] + graph[u][j] < dist[j]) {\n\t\t\t\t\tdist[j] = dist[u] + graph[u][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintSolution(dist, graph.length);\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n private OptimizedItinerary doDijkstra(HipsterDirectedGraph<String,Long> graph, String origin, String destination) {\r\n log.info(String.format(\"----- Doing Dijkstra for origen: %s, and destination: %s -----\", origin, destination));\r\n SearchResult res = null;\r\n SearchProblem p = GraphSearchProblem\r\n .startingFrom(origin)\r\n .in(graph)\r\n .takeCostsFromEdges()\r\n .build();\r\n\r\n res= Hipster.createDijkstra(p).search(destination);\r\n WeightedNode node = (WeightedNode)res.getGoalNode();\r\n log.info(String.format(\"Best itineraries: %s, cost final: %s\", res.getOptimalPaths(), node.getCost()));\r\n \r\n return new OptimizedItinerary.Builder(res.getOptimalPaths())\r\n .setCost( Double.parseDouble(node.getCost().toString()))\r\n .from(origin)\r\n .to(destination)\r\n .build();\r\n }", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void connectNetwork(int src, int dest, boolean printPath)\r\n\t{\r\n\t\tint v = routers;\r\n\t\t\r\n\t\tint parent[] = new int[v];//parent node array\r\n\t\tint dist[] = new int[v];// distance array\r\n\t\tboolean visited[] = new boolean[v];// visited will be either true or false\r\n\t\t\r\n\t\t// initialize parent, distance arrays\r\n\t\tfor (int i = 0; i < v; i++ ) { \r\n\t\t\tvisited[i] = false;\r\n\t\t\tparent[i] = -1;\r\n\t\t\tdist[i] = Integer.MAX_VALUE;\r\n\t\t}\r\n\t\t\r\n\t\t// initialize the source distance as zero\r\n\t\tdist[src] = 0;\r\n\t\t\r\n\t\t// get minimum edge from the unvisited nodes\r\n\t\tfor (int count = 0; count < v-1; count++) { // loop for all v nodes\r\n\t\t\t\r\n\t\t\tint start = -1;\r\n\t\t\tint min = Integer.MAX_VALUE;\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < v; i++) {\r\n\t\t\t\tif (visited[i] == false && dist[i] < min) {\r\n\t\t\t\t\tmin = dist[i];\r\n\t\t\t\t\tstart = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// minimum distance is computed for all connected edges\r\n\t\t\tif (start == -1) \r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t// update the current node as visited\r\n\t\t\tvisited[start] = true;\r\n\t\t\t\r\n\t\t\t// update all adjacent nodes' distance array\r\n\t\t\tfor (int end = 0; end < v; end++) {\r\n\t\t\t\tif ((visited[end] != true) && (graph[start][end] != -1) &&\r\n\t\t\t\t\t\t(dist[start] != Integer.MAX_VALUE) &&\r\n\t\t\t\t\t\t(dist[start] + graph[start][end] < dist[end])) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tdist[end] = dist[start] + graph[start][end];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// start node is the parent node in BFS tree\r\n\t\t\t\t\tparent[end] = start;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\tif (dest != -1) {\r\n\t\t\t\r\n\t\t\t// Case#4: shortest path between source and destination nodes \r\n\t\t\tif (parent[dest] == -1) {\r\n\t\t\t\tSystem.out.println(\"There is no path from \" + (src+1) + \" to \" + (dest+1) + \" exists.\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Shortest distance from \" + (src+1) + \" to \" + (dest+1) + \" is: \" + dist[dest]);\r\n\t\t\t\tSystem.out.print(\"Corresponding Shortest Path is: \");\r\n\t\t\t\tprintNodes(parent, parent[dest], src);\r\n\t\t\t\tSystem.out.println(dest+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n System.out.println(\"The Shortest Distance from node you entered, \"+ (src+1) + \" are\\n\");\r\n //Printing shortest path length\r\n\t\t\tSystem.out.println(\"Destination\\tDistance\\n========================\");\r\n for (int i = 0; i < v; i++) {\r\n System.out.println(\"\\t\"+ (i+1) + \"\\t \"+ dist[i]); // Printing the node number and distance\r\n }\r\n \r\n\t\t\tif (printPath == true) {\r\n\t\t\t\t\r\n\t\t\t\t// case#2: Print all shortest paths from source node\r\n\t\t\t\tfor (int i = 0; i < v; i++) {\r\n\t\t\t\t\tif (i == src)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse if (parent[i] == -1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Shortest path from \" + (src+1) + \" to \" + (i+1) + \" doesn't exist.\");\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.print(\"Shortest Path from \" + (src+1) + \" to \" + (i+1) + \" is: \");\r\n\t\t\t\t\tprintNodes(parent, parent[i], src);\r\n\t\t\t\t\tSystem.out.println(i+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}" ]
[ "0.6960639", "0.66720814", "0.6628302", "0.6548933", "0.6476504", "0.6466855", "0.63152844", "0.63088113", "0.63044345", "0.62984824", "0.6288707", "0.6285818", "0.62123007", "0.6193454", "0.61861396", "0.6177962", "0.6155011", "0.6128771", "0.61156034", "0.6069939", "0.6062606", "0.6046503", "0.60401815", "0.60335076", "0.60161704", "0.6006948", "0.60027236", "0.60019106", "0.59927917", "0.59913325", "0.59893847", "0.59768957", "0.59657735", "0.5954479", "0.59522074", "0.5947134", "0.5941879", "0.5938977", "0.59308636", "0.5925752", "0.59078294", "0.59046924", "0.58996314", "0.58839804", "0.5875196", "0.5873908", "0.58657944", "0.58535457", "0.58416194", "0.5838579", "0.58383125", "0.5817181", "0.58134615", "0.5809422", "0.58074945", "0.58042824", "0.579965", "0.5796134", "0.57933503", "0.57774067", "0.5774067", "0.57636034", "0.5758712", "0.5757038", "0.57570136", "0.57526135", "0.57522297", "0.57433754", "0.5741241", "0.5735307", "0.5725748", "0.5723647", "0.57157576", "0.5713582", "0.57102334", "0.57026136", "0.5682636", "0.5680698", "0.5672809", "0.56715196", "0.5671148", "0.56701434", "0.5669183", "0.5666001", "0.56624156", "0.5658251", "0.56541693", "0.56406915", "0.56365246", "0.56343615", "0.5633448", "0.5630356", "0.563031", "0.56291795", "0.5628896", "0.5626625", "0.5624537", "0.5621935", "0.56119144", "0.56108147" ]
0.5796195
57
calls Dijkstra's algorithm on a pair of vertices in a more complex graph and checks its results
@Test public void testPublic16() { Graph<Integer> graph= TestGraphs.testGraph5(); List<Integer> shortestPath= new ArrayList<Integer>(); assertEquals(5, graph.Dijkstra(131, 351, shortestPath)); assertEquals("131 330 351", TestGraphs.listToString(shortestPath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Test public void testPublic14() {\n Graph<String> graph= TestGraphs.testGraph2();\n List<String> shortestPath= new ArrayList<String>();\n\n assertEquals(1, graph.Dijkstra(\"apple\", \"banana\", shortestPath));\n assertEquals(\"apple banana\", TestGraphs.listToString(shortestPath));\n\n assertEquals(2, graph.Dijkstra(\"apple\", \"cherry\", shortestPath));\n assertEquals(\"apple banana cherry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(3, graph.Dijkstra(\"apple\", \"date\", shortestPath));\n assertEquals(\"apple banana cherry date\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra(\"apple\", \"elderberry\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(5, graph.Dijkstra(\"apple\", \"fig\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(6, graph.Dijkstra(\"apple\", \"guava\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig guava\",\n TestGraphs.listToString(shortestPath));\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "void dijkstra(int[][] graph){\r\n int dist[] = new int[rideCount];\r\n Boolean sptSet[] = new Boolean[rideCount];\r\n\r\n for(int i = 0; i< rideCount; i++){\r\n dist[i] = Integer.MAX_VALUE;\r\n sptSet[i] = false;\r\n }\r\n\r\n dist[0] = 0;\r\n\r\n for(int count = 0; count< rideCount -1; count++){\r\n int u = minWeight(dist, sptSet);\r\n sptSet[u] = true;\r\n for(int v = 0; v< rideCount; v++){\r\n if (!sptSet[v] && graph[u][v] != 0 && dist[u] + graph[u][v] < dist[v]){\r\n dist[v] = dist[u] + graph[u][v];\r\n }\r\n }\r\n }\r\n printSolution(dist);\r\n }", "public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "public static int QTDelHeuristic1 (Graph<Integer,String> h) {\n\t\tint count = 0;\r\n\t\tboolean isQT = false;\r\n\t\t//h = Copy(g);\r\n\t\t//boolean moreToDo = true;\r\n\t\t\r\n\t\tIterator<Integer> a;\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\r\n\t\twhile (isQT == false) {\r\n\t\t\tisQT = true;\r\n\t\t\ta= h.getVertices().iterator();\r\n\t\t\twhile(a.hasNext()){\r\n\t\t\t\tInteger A = a.next();\r\n\t\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\t\tb = h.getNeighbors(A).iterator();\r\n\t\t\t\twhile(b.hasNext()){\r\n\t\t\t\t\tInteger B = b.next();\r\n\t\t\t\t\tc = h.getNeighbors(B).iterator();\r\n\t\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\t\tif (h.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\t\td = h.getNeighbors(C).iterator();\r\n\t\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\t\tisQT = false;\r\n\t\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t\t// requires 2 deletions\r\n\t\t\t\t\t\t\t\tcount += 2;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 2 + QTDelHeuristic1(h);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcount += 1;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 1 + QTDelHeuristic1(h);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\t\t\r\n\t\treturn count;\t\t\r\n\t}", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "public static void liveDemo() {\n Scanner in = new Scanner( System.in );\n float srcTank1, srcTank2, destTank;\n int alternetPaths;\n Graph mnfld = new Graph();\n boolean runSearch = true;\n\n //might need to limit query results, too large maybe?\n //newnodes = JDBC.graphInformation(); //returns arraylist of nodes\n //mnfld.setPipes(newnodes); //set nodes to the manifold\n //JDBC.insertConnections(mnfld);\n\n//\t\t /*\n//\t\t\tfor (int i = 0; i < newnodes.length(); i++) { //length might be wrong\n//\t\t\t\t//need to look for way to add edges by looking for neighbor nodes i think\n//\t\t\t\t//loop through nodes and create Edges\n//\t\t\t\t//might need new query\n//\t\t\t\tnewedges.addEdge(node1,node2,cost);\n//\t\t\t}\n//\n//\t\t\tmnfld.setConnections(newedges);\n//\n//\t\t\tup to this point, graph should be global to Dijkstra and unused.\n//\t\t\tloop until user leaves page\n//\t\t\tget input from user for tanks to transfer\n//\t\t\tfind shortest path between both tanks\n//\t\t\tend loop\n//\t\t\tthis will change depending how html works so not spending any time now on it\n//\t\t*/\n //shortestPath.runTest();\n\n shortestPath.loadGraph( mnfld );\n while (runSearch) {\n // Gets user input\n System.out.print( \"First Source Tank: \" );\n srcTank1 = in.nextFloat();\n System.out.print( \"Second Source Tank: \" );\n srcTank2 = in.nextFloat();\n System.out.print( \"Destination Tank: \" );\n destTank = in.nextFloat();\n System.out.print( \"Desired Number of Alternate Paths: \" );\n alternetPaths = in.nextInt();\n\n // Prints outputs\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"True shortest with alt paths\" );\n Dijkstra.findAltPaths( mnfld, alternetPaths, srcTank1, destTank );\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering used connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), true );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering only open connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), false );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Merge Lineup\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ) );\n System.out.println( \"\\t Original Lineup: \" );\n mnfld.getPipe( destTank ).printLine();\n System.out.println( \"\\t Merged Lineup: \" );\n Dijkstra.mergePaths( mnfld, srcTank2, mnfld.getPipe( destTank ).getPath(), mnfld.getPipe( destTank ) );\n System.out.print( \"\\nRun another search [1:Yes, 0:No] :: \" );\n if (in.nextInt() == 0) runSearch = false;\n else System.out.println( \"\\n\\n\\n\" );\n }\n\n\n }", "public void dijkstraAllPairs(boolean print) {\r\n int numSuccesses = 0;\r\n long totalTimeSuccesses = 0;\r\n if (print) System.out.println(\"Paths between all pairs of vertices using Dijkstra's algorithm:\");\r\n for (int i = 0; i < location.size(); i++) {\r\n for (int j = i+1; j < location.size(); j++) {\r\n long startTime = System.nanoTime();\r\n ArrayList<Vertex> pathIJ = dijkstraPath(i, j);\r\n long endTime = System.nanoTime();\r\n if (!pathIJ.isEmpty()) {\r\n numSuccesses++;\r\n totalTimeSuccesses += (endTime - startTime);\r\n }\r\n if (print) System.out.println(\"I = \" + i + \" J = \" + j + \" : \" + pathIJ.toString());\r\n }\r\n }\r\n System.out.println(\"Dijkstra's algorithm is successfull \" + numSuccesses + \"/\" + location.size()*(location.size()-1)/2 + \" times.\");\r\n if (numSuccesses != 0) {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is \" + totalTimeSuccesses/numSuccesses + \" nanoseconds.\");\r\n } else {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is N/A nanoseconds.\");\r\n }\r\n System.out.println(\"\");\r\n }", "@Test\r\n\tpublic void test_Big_Graph() {\n\t\tweighted_graph g = new WGraph_DS();\r\n\t\tint size = 1000*1000;\r\n\t\tint ten=1;\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tg.addNode(i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tint dest=i;\r\n\t\t\tg.connect(size-2, i, 0.23); \r\n\r\n\t\t\tif(i<size-1){\r\n\t\t\t\tg.connect(i,++dest,0.78);\r\n\t\t\t}\r\n\t\t\tif(i%2==0&&i<size-2) {\r\n\t\t\t\tg.connect(i,2+dest,0.94);\r\n\t\t\t}\t\r\n\r\n\t\t\tif(ten==i&&(i%2==0)) {\r\n\t\t\t\tfor (int j =0 ; j <size; j++) {\r\n\t\t\t\t\tg.connect(ten, j,0.56);\r\n\t\t\t\t\tg.connect(ten-2, j, 0.4);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tten=ten*10;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t\tweighted_graph_algorithms algo = new WGraph_Algo();\r\n\t\talgo.init(g);\r\n\t\tassertTrue(algo.isConnected());\r\n\t\tassertEquals(algo.shortestPathDist(0, 999998),0.23);\r\n\t\tassertEquals(algo.shortestPathDist(0, 8),0.46);\r\n\t\tint expected2 []= {6,999998,8};\r\n\t\tint actual2 [] = new int [3];\r\n\t\tint i=0;\r\n\t\tfor(node_info n :algo.shortestPath(6, 8)) {\r\n\t\t\tactual2[i++]=n.getKey();\r\n\t\t}\r\n\t\tassertArrayEquals(expected2,actual2);\r\n\r\n\t}", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "@Test\n public void testDijkstra() throws Exception {\n String graphFileName = \"algorithm/graph/shortestpath/weighted/weightedGraph.txt\";\n Graph graph = Graph.createGraphFromFile(WeightedShortestPath.class.getResource(\"/\").getPath() + File.separator +\n graphFileName);\n\n System.out.println(\"==============Graph before weighted shortest path found==============\");\n graph.printGraph();\n\n WeightedShortestPath.dijkstra(graph, graph.getVertex(\"v1\"));\n System.out.println(\"======Graph after weighted shortest path found by Dijkstra's algorithm=====\");\n graph.printGraph();\n\n System.out.println(\"===================Print the path to each vertex====================\");\n for (Vertex v: graph.getVertexMap().values()) {\n graph.printPath(v);\n System.out.println();\n }\n System.out.println();\n }", "public static void main(String[] args) {\n Digraph grph = new Digraph(5);\n grph.addEdge(0, 1);\n grph.addEdge(1, 2);\n grph.addEdge(2, 3);\n BreadthFirstDirectedPaths path1 = new BreadthFirstDirectedPaths(grph, 0);\n BreadthFirstDirectedPaths path2 = new BreadthFirstDirectedPaths(grph, 0);\n int len = -1;\n for (int i = 0; i < grph.V(); i++) {\n if (path1.hasPathTo(i) && path2.hasPathTo(i)) {\n if (len == -1) {\n len = path1.distTo(i);\n }\n if (path1.distTo(i) > len) {\n len = path1.distTo(i);\n }\n }\n }\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "public void testDijkstra() {\n \t\tfinal Dijkstra model = new Dijkstra();\n \t\tfinal Formula noDeadlocks = model.dijkstraPreventsDeadlocksAssertion();\n \t\tfinal Solution sol = solve(noDeadlocks, model.bounds(6,6,6));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 4344 18609\n //\t\tprimary variables: 444\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(444, sol.stats().primaryVariables());\n \t\tassertEquals(4344, sol.stats().variables());\n\t\tassertEquals(18609, sol.stats().clauses());\n \t}", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }", "public static void main(String[] args) {\n int vertices = Integer.parseInt(StdIn.readLine());\n //Storing vertex weights\n double[] vertW = new double[vertices];\n for(int i=0;i<vertices;i++)\n vertW[i] = Double.parseDouble(StdIn.readLine());\n //Reading in new graph, G**\n String[] Gstarstar = StdIn.readAllLines();\n //Making graph\n EdgeWeightedDigraph G = new EdgeWeightedDigraph(Gstarstar);\n //Dijkstra All Pairs\n DijkstraAllPairsSP DAP = new DijkstraAllPairsSP(G);\n //Printing output of paths\n for(int i=0; i<G.V(); i++){\n for(int j=0; j<G.V(); j++){\n if(!DAP.hasPath(i,j))\n StdOut.print(i+\" to \"+j+\"\\t\\tno path\");\n else{\n double newEW;\n double EW;\n Iterable<DirectedEdge> path = DAP.path(i,j);\n double totalWeight = 0;\n String sp = \"\"; //String that's going to form the path\n for(DirectedEdge x : path){\n newEW = x.weight();\n EW = newEW + vertW[x.to()] - vertW[x.from()]; //reverse calibrate\n totalWeight += EW;\n sp += \"\\t\"+x.from()+\"->\"+x.to()+\" \"+String.format(\"%.2f\",EW); //adding to path\n }\n StdOut.print(i+\" to \"+j+\"\\t(\"+String.format(\"%.2f\",totalWeight)+\") \");\n StdOut.print(sp);\n }\n StdOut.println();\n }\n StdOut.println();\n }\n }", "public static void main(String[] args) {\n\t\tString vertex=\"abcdefghij\";\n\t\tString edge=\"bdegachiabefbc\";\n\t\tchar[] vc=vertex.toCharArray();\n\t\tchar[] ec=edge.toCharArray();\n\t\tint[] v=new int[vc.length];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i]=vc[i]-'a'+1;\n\t\t}\n\t\tint[] e=new int[ec.length];\n\t\tfor (int i = 0; i < e.length; i++) {\n\t\t\te[i]=ec[i]-'a'+1;\n\t\t}\t\t\n\t\t\n\t\tDS_List ds_List=new DS_List(v.length);\n//\t\tfor (int i = 0; i < v.length; i++) {\n//\t\t\tds_List.make_set(v[i]);\n//\t\t}\n//\t\tfor (int i = 0; i < e.length; i=i+2) {\n//\t\t\tif (ds_List.find_set(e[i])!=ds_List.find_set(e[i+1])) {\n//\t\t\t\tds_List.union(e[i], e[i+1]);\n//\t\t\t}\n//\t\t}\n\t\tds_List.connect_components(v, e);\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tSystem.out.print(ds_List.find_set(v[i])+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(ds_List.same_component(v[1], v[2]));\n\t}", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "private static List<Vertex> doDijkstra(List<Vertex> vertexes) {\n\n\t\t// Zok, we have a graph constructed. Traverse.\n\t\tPriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(me);\n\t\tme.setMinDistance(0);\n\n\t\twhile (!vertexQueue.isEmpty()) {\n\t\t\tVertex v = vertexQueue.poll();\n\t\t\tdouble distance = v.getMinDistance() + 1;\n\n\t\t\tfor (Vertex neighbor : v.getAdjacencies()) {\n\t\t\t\tif (distance < neighbor.getMinDistance()) {\n\t\t\t\t\tneighbor.setMinDistance(distance);\n\t\t\t\t\tneighbor.setPrevious(v);\n\t\t\t\t\tvertexQueue.remove(neighbor);\n\t\t\t\t\tvertexQueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn vertexes;\n\t}", "public static ArrayList<edges<String, Double>> Dijkstra(String CHAR1, String CHAR2, graph<String,Float> g) {\n\t\tPriorityQueue<ArrayList<edges<String, Double>>> active = \n\t\t\tnew PriorityQueue<ArrayList<edges<String, Double>>>(10,new Comparator<ArrayList<edges<String, Double>>>() {\n\t\t\t\tpublic int compare(ArrayList<edges<String, Double>> path1, ArrayList<edges<String, Double>> path2) {\n\t\t\t\t\tedges<String, Double> dest1 = path1.get(path1.size() - 1);\n\t\t\t\t\tedges<String, Double> dest2 = path2.get(path2.size() - 1);\n\t\t\t\t\tif (!(dest1.getLabel().equals(dest2.getLabel())))\n\t\t\t\t\t\treturn dest1.getLabel().compareTo(dest2.getLabel());\n\t\t\t\t\treturn path1.size() - path2.size();\n\t\t\t\t}\n\t\t\t});\n\t\t\tSet<String> known = new HashSet<String>();\n\t\t\tArrayList<edges<String, Double>> begin = new ArrayList<edges<String, Double>>();\n\t\t\tbegin.add(new edges<String, Double>(CHAR1, 0.0));\n\t\t\tactive.add(begin);\t\t\n\t\t\twhile (!active.isEmpty()) {\n\t\t\t\tArrayList<edges<String, Double>> minPath = active.poll();\n\t\t\t\tedges<String, Double> endOfMinPath = minPath.get(minPath.size() - 1);\n\t\t\t\tString minDest = endOfMinPath.getDest();\n\t\t\t\tdouble minCost = endOfMinPath.getLabel();\n\t\t\t\tif (minDest.equals(CHAR2)) {\n\t\t\t\t\treturn minPath;\n\t\t\t\t}\n\t\t\t\tif (known.contains(minDest))\n\t\t\t\t\tcontinue;\n\t\t\t\tSet<edges<String,Float>> children = g.childrenOf(minDest);\n\t\t\t\tfor (edges<String, Float> e : children) {\n\t\t\t\t\tif (!known.contains(e.getDest())) {\n\t\t\t\t\t\tdouble newCost = minCost + e.getLabel();\n\t\t\t\t\t\tArrayList<edges<String, Double>> newPath = new ArrayList<edges<String, Double>>(minPath); \n\t\t\t\t\t\tnewPath.add(new edges<String, Double>(e.getDest(), newCost));\n\t\t\t\t\t\tactive.add(newPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tknown.add(minDest);\n\t\t\t}\n\t\t\treturn null;\n\t}", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "public void floyd(TripartiteGraph graph) throws Exception\n\t{\n\t\tint size = graph.numNodes();\n\t\tSparseMatrix matrix = (SparseMatrix) graph.matrix();\n\t\t// initialize dist\n\t\tfor (int i = 0; i < size; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t{\n\t\t\t\tif (!matrix.containRowCol(i, j))\n\t\t\t\t\tdist[i][j] = INF;\n\t\t\t\telse\n\t\t\t\t\tdist[i][j] = (int) matrix.at(i, j);\n\t\t\t}\n\t\t}\n\t\tfor (int k = 0; k < size; k++)\n\t\t{\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t\t{\n\t\t\t\t\tif (dist[i][k] != INF && dist[k][j] != INF\n\t\t\t\t\t\t\t&& dist[i][k] + dist[k][j] < dist[i][j])\n\t\t\t\t\t{\n\t\t\t\t\t\tdist[i][j] = dist[i][k] + dist[k][j];\n\t\t\t\t\t\tpath.set(i, j, k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "public static void main(String[] args) {\n\t\tint vertices = Integer.parseInt(args[0]);\n\t\tint edges = Integer.parseInt(args[1]);\n\t\tint seed = Integer.parseInt(args[2]);\n\t\tRandom random = new Random(seed);\n\n\t\tAdjMatrixEdgeWeightedDirectedGraph g = new AdjMatrixEdgeWeightedDirectedGraph(vertices);\n\t\tfor (int i = 0; i < edges; i++) {\n\t\t\tint v = random.nextInt(vertices);\n\t\t\tint w = random.nextInt(vertices);\n\t\t\tdouble weight = Math.round(100 * (random.nextDouble() - 0.15)) / 100.0;\n\t\t\tif (v == w) g.addEdge(new Edge(v, w, Math.abs(weight)));\n\t\t\telse g.addEdge(new Edge(v, w, weight));\n\t\t}\n\n\t\t// run Floyd-Warshall algorithm\n\t\tFloydWarshall spt = new FloydWarshall(g);\n\n\t\t// print all-pairs shortest path distances\n\t\tSystem.out.print(\" \");\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%6d \", v);\n\t\t}\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%3d: \", v);\n\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\tif (spt.hasPath(v, w)) System.out.printf(\"%6.2f \", spt.dist(v, w));\n\t\t\t\telse System.out.printf(\" Inf \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// print negative cycle\n\t\tif (spt.hasNegativeCycle()) {\n\t\t\tSystem.out.println(\"Negative cost cycle:\");\n\t\t\tfor (int v : spt.negativeCycle()) System.out.println(v);\n\t\t\tSystem.out.println();\n\t\t// print all-pairs shortest paths\n\t\t} else {\n\t\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\t\tif (spt.hasPath(v, w)) {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d (%5.2f) \", v, w, spt.dist(v, w));\n\t\t\t\t\t\tfor (Edge e : spt.path(v, w)) System.out.print(e + \" \");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d no path\\n\", v, w);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "@Test\n public void testDistantPoints() {\n // OK with 1000 visited nodes:\n MapMatching mapMatching = new MapMatching(hopper, algoOptions);\n List<GPXEntry> inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.23, 12.18),\n new GHPoint(51.45, 12.59));\n MatchResult mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(57650, mr.getMatchLength(), 1);\n assertEquals(2747796, mr.getMatchMillis(), 1);\n\n // not OK when we only allow a small number of visited nodes:\n AlgorithmOptions opts = AlgorithmOptions.start(algoOptions).maxVisitedNodes(1).build();\n mapMatching = new MapMatching(hopper, opts);\n try {\n mr = mapMatching.doWork(inputGPXEntries);\n fail(\"Expected sequence to be broken due to maxVisitedNodes being too small\");\n } catch (RuntimeException e) {\n assertTrue(e.getMessage().startsWith(\"Sequence is broken for submitted track\"));\n }\n }", "@Test public void testPublic17() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(8, graph.Dijkstra(131, 141, shortestPath));\n assertEquals(\"131 330 132 141\", TestGraphs.listToString(shortestPath));\n }", "public Square[] buildPath(GameBoard board, Player player) {\n\n // flag to check if we hit a goal location\n boolean goalVertex = false;\n\n // Queue of vertices to be checked\n Queue<Vertex> q = new LinkedList<Vertex>();\n\n // set each vertex to have a distance of -1\n for ( int i = 0; i < graph.length; i++ )\n graph[i] = new Vertex(i,-1);\n\n // get the start location, i.e. the player's location\n Vertex start = \n squareToVertex(board.getPlayerLoc(player.getPlayerNo()));\n start.dist = 0;\n q.add(start);\n\n // while there are still vertices to check\n while ( !goalVertex ) {\n\n // get the vertex and remove it;\n // we don't want to look at it again\n Vertex v = q.remove();\n\n // check if this vertex is at a goal row\n switch ( player.getPlayerNo() ) {\n case 0: if ( v.graphLoc >= 72 ) \n goalVertex = true; break;\n case 1: if ( v.graphLoc <= 8 ) \n goalVertex = true; break;\n case 2: if ( (v.graphLoc+1) % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n case 3: if ( v.graphLoc % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n }\n\n // if we're at a goal vertex, we don't need to calculate\n // its neighboors\n if ( !goalVertex ) {\n\n // retrieve all reachable ajacencies\n Square[] adjacencies = reachableAdjacentSquares\n (board, vertexToSquare(v, board), player.getPlayerNo());\n\n // for each adjacency...\n for ( Square s : adjacencies ) {\n\n // convert to graph location\n Vertex adjacent = squareToVertex(s); \n\n // modify the vertex if it hasn't been modified\n if ( adjacent.dist < 0 ) {\n adjacent.dist = v.dist+1;\n adjacent.path = v;\n q.add(adjacent);\n }\n }\n\n }\n else\n return returnPath(v,board);\n \n }\n // should never get here\n return null;\n }", "public ArrayList<Integer> path2Dest(int s, int t, int k, int method){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n d[s] = 0;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n int extractedVertex = minHeap.extractMin();\n\n if(extractedVertex==t) {\n break;\n }\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey =0;\n double currentKey=0;\n if(method==1) { //method 1\n newKey = d[extractedVertex] + edge.weight;\n currentKey = d[destination];\n }\n else{ //method 2\n newKey = d[extractedVertex] + edge.weight + coor[destination].distTo(coor[t])-coor[extractedVertex].distTo(coor[t]);\n currentKey = d[destination];\n }\n if(currentKey>=newKey){\n if(currentKey==newKey){ //if equal need to compare the value of key\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n //trace back the path using parent properties\n ArrayList<Integer> path = new ArrayList<>();\n if(parent[t]!=-1){\n path.add(t);\n while(parent[t]!= s) {\n path.add(0,parent[t]);\n t = parent[t];\n }\n path.add(0,s);\n }\n else\n path = null;\n return path;\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean connectsVertex(V v);", "private void compare_with_dijkstra(Weighting w) {\n final long seed = System.nanoTime();\n final int numQueries = 1000;\n\n Random rnd = new Random(seed);\n int numNodes = 100;\n GHUtility.buildRandomGraph(graph, rnd, numNodes, 2.2, true, speedEnc, null, 0.8, 0.8);\n GHUtility.addRandomTurnCosts(graph, seed, null, turnCostEnc, maxTurnCosts, turnCostStorage);\n\n long numStrictViolations = 0;\n for (int i = 0; i < numQueries; i++) {\n int source = rnd.nextInt(numNodes);\n int target = rnd.nextInt(numNodes);\n Path dijkstraPath = new Dijkstra(graph, w, TraversalMode.EDGE_BASED).calcPath(source, target);\n Path path = calcPath(source, target, ANY_EDGE, ANY_EDGE, w);\n assertEquals(dijkstraPath.isFound(), path.isFound(), \"dijkstra found/did not find a path, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n assertEquals(dijkstraPath.getWeight(), path.getWeight(), 1.e-6, \"weight does not match dijkstra, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n // we do not do a strict check because there can be ambiguity, for example when there are zero weight loops.\n // however, when there are too many deviations we fail\n if (\n Math.abs(dijkstraPath.getDistance() - path.getDistance()) > 1.e-6\n || Math.abs(dijkstraPath.getTime() - path.getTime()) > 10\n || !dijkstraPath.calcNodes().equals(path.calcNodes())) {\n numStrictViolations++;\n }\n }\n if (numStrictViolations > Math.max(1, 0.05 * numQueries)) {\n fail(\"Too many strict violations, seed: \" + seed + \" - \" + numStrictViolations + \" / \" + numQueries);\n }\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = sc.nextInt();\n\t\tint roadlines = sc.nextInt();\n\t\tsc.nextLine(); // for reading string in nextline\n\t\tEdgeWeightedGraph edge = new EdgeWeightedGraph(cities);\n\t\t// The Time Complexity is O(E)\n\t\t// The road lines is the number of edges\n\t\tfor (int i = 0; i < roadlines; i++) {\n\t\t\tString[] tokens = sc.nextLine().split(\" \");\n\t\t\tedge.addEdge(new Edge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]),\n\t\t\t\tDouble.parseDouble(tokens[2])));\n\t\t}\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t\tSystem.out.println(edge);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] input = sc.nextLine().split(\" \");\n\t\t\tDijkstraSP shortest = new DijkstraSP(\n edge, Integer.parseInt(input[0]));\n double distance = shortest.distTo(Integer.parseInt(input[1]));\n // The time complexity is O(1)\n if (!shortest.hasPathTo(Integer.parseInt(input[1]))) {\n \tSystem.out.println(\"No Path Found.\");\n } else {\n \tSystem.out.println(distance);\n }\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] str1 = sc.nextLine().split(\" \");\n\t\t\tboolean flag1 = false;\n\t\t\tboolean flag2 = false;\n\t\t\tdouble distance1 = 0.0;\n\t\t\tdouble distance2 = 0.0;\n\t\t\tDijkstraSP shortest1 = new DijkstraSP(edge, Integer.parseInt(str1[0]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest1.hasPathTo(Integer.parseInt(str1[1]))) {\n\t\t\t\tflag1 = true;\n\t\t\t\tdistance1 = shortest1.distance(Integer.parseInt(str1[1]));\n\t\t\t}\n\t\t\tDijkstraSP shortest2 = new DijkstraSP(edge, Integer.parseInt(str1[1]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest2.hasPathTo(Integer.parseInt(str1[2]))) {\n\t\t\t\tflag2 = true;\n\t\t\t\tdistance2 = shortest2.distance(Integer.parseInt(str1[2]));\n\t\t\t}\n\t\t\tdouble Distance = distance1 + distance2;\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (flag1 && flag2) {\n\t\t\t// Displays output upto 1 decimal point\n\t\t\tSystem.out.format(\"%.1f\", Distance);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n ArrayList<Integer> path = new ArrayList<>();\n for (Edge eachlink : shortest1.pathTo(Integer.parseInt(str1[1]))) {\n int either = eachlink.either();\n int other = eachlink.other(eachlink.either());\n if (!path.contains(other)) {\n path.add(other);\n }\n if (!path.contains(either)) {\n path.add(either);\n }\n }\n for (Edge eachlink1 : shortest2.pathTo(Integer.parseInt(str1[2]))) {\n int either1 = eachlink1.either();\n int other1 = eachlink1.other(eachlink1.either());\n if (!path.contains(other1)) {\n path.add(other1);\n }\n if (!path.contains(either1)) {\n path.add(either1);\n }\n }\n for (int everyval : path) {\n System.out.print(everyval + \" \");\n }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public Dijkstra(Grafo<K, Integer> grafo, Vertice<K, Integer> vertOrigem) {\n\t\t\n\t\tthis.vertices = grafo.getVertices();\n\t\tthis.vertOrigem = vertOrigem;\n\t\t\n\t\tint total = vertices.size();\n\t\tboolean visitado[] = new boolean[total];\n\t\tthis.solucao = new Object[total][2]; // [0] = distancia [1] = vertice adjacente\n\t\t\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tsolucao[i][0] = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint vIndex = vertices.indexOf(vertOrigem);\n\t\tsolucao[vIndex][0] = 0;\n\t\tsolucao[vIndex][1] = vertOrigem;\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tVertice<K, Integer> y = null;\n\t\t\t\n\t\t\tfor (int z = 0; z < total; z++) {\n\t\t\t\tif (visitado[z]) continue;\n\t\t\t\tif ((Integer)solucao[z][0] < min) {\n\t\t\t\t\tmin = (Integer)solucao[z][0];\n\t\t\t\t\ty = vertices.get(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (min == Integer.MAX_VALUE) break;\n\t\t\t\n\t\t\tint yIndex = vertices.indexOf(y);\n\t\t\t\n\t\t\tList<Aresta<K, Integer>> arestas = y.getArestas();\n\t\t\tfor (Aresta<K, Integer> a:arestas) {\n\t\t\t\t\n\t\t\t\tVertice<K, Integer> w = a.getVertices()[0];\n\t\t\t\tint wIndex = vertices.indexOf(w);\n\t\t\t\tif (visitado[wIndex]) continue;\n\t\t\t\t\n\t\t\t\tif ((Integer)solucao[yIndex][0] + a.getValor() < (Integer)solucao[wIndex][0]) {\n\t\t\t\t\tsolucao[wIndex][0] = (Integer)solucao[yIndex][0] + a.getValor();\n\t\t\t\t\tsolucao[wIndex][1] = y;\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tvisitado[yIndex] = true;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n generateAndSaveExampleGraph();\n\n\n /*\n * select graph for prepairing and handling by algorhytm\n * determine graph source from config.xml:\n * config case = ?\n * 1 - from matrix\n * 2 - from edges list\n * 3 - from xml\n * */\n //read configCase\n Integer configCase = 0;\n try {\n configCase = (Integer) XMLSerializer.read( \"config.xml\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n //determine case\n EuclidDirectedGraph graph = null;\n switch (configCase){\n case 1:\n graph = getGraphFromMatrix();\n break;\n case 2:\n graph = getGraphFromEdgesList();\n break;\n case 3:\n graph = getGraphFromXML();\n break;\n default:\n return;\n\n }\n //find all sources and sinks\n ArrayList<BoundsGraphVertex> sources = new ArrayList<>();\n ArrayList<BoundsGraphVertex> sinks = new ArrayList<>();\n //get all sources and sinks\n for (Map.Entry<BoundsGraphVertex, Map<BoundsGraphVertex, Double>> vertexEntry : graph.getMap().entrySet()) {\n //if there are no edges from vertex then its sink\n if (vertexEntry.getValue().isEmpty()) {\n sinks.add(vertexEntry.getKey());\n } else {\n //mark all vertexes which have incoming edges\n for (BoundsGraphVertex dest : vertexEntry.getValue().keySet()) {\n dest.setMarked(true);\n }\n }\n }\n //all unmarked vertexes are sources\n for (BoundsGraphVertex vertex : graph) {\n if (!vertex.isMarked()) sources.add(vertex);\n }\n\n /*\n * First algorithm: for each source-sink pair get path using euclid heuristics\n * */\n List<BoundsGraphVertex> minPath = null;\n Double minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n for (BoundsGraphVertex sink :\n sinks) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathWithHeuristics(graph, source, sink, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n\n }\n }\n\n /*\n * Second algorithm: for each source get better sink\n * */\n minPath = null;\n minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathToManySinks(graph, source, sinks, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n }\n try {\n XMLSerializer.write(minPath, \"output.xml\", false);\n XMLSerializer.write(minLength, \"output.xml\", true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "public static void PrimsAlgorithm(WeightedGraph graph) {\n System.out.println(\"______________________________Prim's Algorithm(Priority Queue)_____________________________\\n\");\n ArrayList<Edge> mst = new ArrayList<>();\n // initialize an array that will keep track of which vertices have been visited\n boolean[] visited = new boolean[graph.getVertices()];\n // initialize a PriorityQueue \n PriorityQueue<Edge> priorityQueue = new PriorityQueue<>();\n // mark the initial vertex as visited\n visited[0] = true;\n\n // for every edge connected to the source, add it to the PriorityQueue \n for (int i = 0; i < graph.getAdjacencylist(0).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(0).get(i));\n }\n\n // keep adding edges until the PriorityQueue is empty\n while (!priorityQueue.isEmpty()) {\n Edge e = priorityQueue.remove();\n\n // if we have already visited the opposite vertex, go to the next edge\n if (visited[e.getDestination()]) {\n continue;\n }\n\n //mark the opposite vertex as visited\n visited[e.getDestination()] = true;\n //Add an edge to the minimum spanning tree\n mst.add(e);\n\n // for every edge connected to the opposite vertex, add it to the PriorityQueue\n for (int i = 0; i < graph.getAdjacencylist(e.getDestination()).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(e.getDestination()).get(i));\n }\n\n }\n\n // if we haven't visited all of the vertices, return \n for (int i = 1; i < graph.getVertices(); i++) {\n if (!visited[i]) {\n System.out.println(\"Error! the graph is not connected.\");\n return;\n }\n }\n\n }", "@Test\n public void testShortestPathEstacoes() {\n completeMap = new Graph(false);\n incompleteMap = new Graph(false);\n\n completeMap.insertVertex(porto);\n Company.getParkRegistry().getParkMap().put(porto, portoL);\n completeMap.insertVertex(braga);\n Company.getParkRegistry().getParkMap().put(braga, bragaL);\n completeMap.insertVertex(vila);\n Company.getParkRegistry().getParkMap().put(vila, vilaL);\n completeMap.insertVertex(aveiro);\n Company.getParkRegistry().getParkMap().put(aveiro, aveiroL);\n completeMap.insertVertex(coimbra);\n Company.getParkRegistry().getParkMap().put(coimbra, coimbraL);\n completeMap.insertVertex(leiria);\n Company.getParkRegistry().getParkMap().put(leiria, leiriaL);\n\n completeMap.insertVertex(viseu);\n Company.getParkRegistry().getParkMap().put(viseu, viseuL);\n completeMap.insertVertex(guarda);\n Company.getParkRegistry().getParkMap().put(guarda, guardaL);\n completeMap.insertVertex(castelo);\n Company.getParkRegistry().getParkMap().put(castelo, casteloL);\n completeMap.insertVertex(lisboa);\n Company.getParkRegistry().getParkMap().put(lisboa, lisboaL);\n completeMap.insertVertex(faro);\n Company.getParkRegistry().getParkMap().put(faro, faroL);\n\n completeMap.insertEdge(porto, aveiro, c, 75);\n completeMap.insertEdge(porto, braga, c2, 60);\n completeMap.insertEdge(porto, vila, c3, 100);\n completeMap.insertEdge(viseu, guarda, c4, 75);\n completeMap.insertEdge(guarda, castelo, c5, 100);\n completeMap.insertEdge(aveiro, coimbra, c6, 60);\n completeMap.insertEdge(coimbra, lisboa, c7, 200);\n completeMap.insertEdge(coimbra, leiria, c8, 80);\n completeMap.insertEdge(aveiro, leiria, c9, 120);\n completeMap.insertEdge(leiria, lisboa, c10, 150);\n\n completeMap.insertEdge(aveiro, viseu, c11, 85);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n completeMap.insertEdge(lisboa, faro, c13, 280);\n\n incompleteMap = completeMap.clone();\n\n incompleteMap.removeEdge(aveiro, viseu);\n incompleteMap.removeEdge(leiria, castelo);\n incompleteMap.removeEdge(lisboa, faro);\n\n System.out.println(\"Test of shortest path\");\n\n LinkedList<String> shortPath = new LinkedList<>();\n double lenpath = 0;\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, l, shortPath);\n assertTrue(\"Length path should be 0 if vertex does not exist\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, porto, faro, shortPath);\n assertTrue(\"Length path should be 0 if there is no path\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, porto, shortPath);\n assertTrue(\"Number of nodes should be 1 if source and vertex are the same\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPath(incompleteMap, porto, lisboa, shortPath);\n assertTrue(\"Path between Porto and Lisboa should be 335 Km\", lenpath == 335);\n\n Iterator<String> it = shortPath.iterator();\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Lisboa\", it.next().equals(lisboa));\n completeMap.insertEdge(porto, lisboa, c, 10);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, braga, leiria, shortPath);\n assertEquals(\"Path between Braga and Leiria should be close to 152.89\", lenpath, 152, 1);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Braga\", it.next().equals(braga));\n assertTrue(\"then Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Leiria\", it.next().equals(leiria));\n\n shortPath.clear();\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, castelo, shortPath);\n assertEquals(\"Path between Porto and Castelo Branco should be close to 202.86\", lenpath, 202, 1);\n assertTrue(\"N. cities between Porto and Castelo Branco should be 5 \", shortPath.size() == 5);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Viseu\", it.next().equals(viseu));\n assertTrue(\"then Viseu\", it.next().equals(guarda));\n assertTrue(\"then Castelo Branco\", it.next().equals(castelo));\n\n //Changing Edge: aveiro-viseu with Edge: leiria-C.Branco \n //should change shortest path between porto and castelo Branco\n completeMap.removeEdge(aveiro, viseu);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n shortPath.clear();\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, castelo, shortPath);\n assertTrue(\"Path between Porto and Castelo Branco should now be 330 Km\", lenpath == 330);\n assertTrue(\"Path between Porto and Castelo Branco should be 4 cities\", shortPath.size() == 4);\n\n }", "@Test public void testPublic18() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(13, graph.Dijkstra(250, 141, shortestPath));\n assertEquals(\"250 351 132 141\", TestGraphs.listToString(shortestPath));\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test\n void testShortestPathDist(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(Double.compare(45,ga.shortestPathDist(1,4)) == 0);\n assertEquals(0,ga.shortestPathDist(1,1));\n assertEquals(-1,ga.shortestPathDist(1,200));\n }", "public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public static <V> Dictionary<V, DijkstraResult<V>> getShortestPathDijkstra(Graph<V> graph, V value) {\n V[] vertices = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[] distancias = new double[vertices.length];\n V[] camino = (V[]) new Object[vertices.length];\n int pos = buscarPosicion(value, vertices);\n\n for (int x = 0; x < vertices.length; x++) { // Se llenan los arreglos con la informacion de sus adyacentes.\n if (pos == x) {\n distancias[x] = 0;\n camino[x] = null;\n } else {\n if (matriz[pos][x] == -1) {\n distancias[x] = Integer.MAX_VALUE - 1;\n camino[x] = vertices[pos];\n } else {\n distancias[x] = matriz[pos][x];\n camino[x] = vertices[pos];\n }\n }\n }\n\n Set<V> revisados = new LinkedListSet<>();\n revisados.put(value);\n while (revisados.size() < vertices.length) {\n double menor = Integer.MAX_VALUE;\n V actual = null;\n for (int x = 0; x < vertices.length; x++) {\n if (distancias[x] < menor) {\n if (!revisados.isMember(vertices[x])) {\n menor = distancias[x];\n actual = vertices[x];\n }\n }\n }\n\n pos = buscarPosicion(actual, vertices);\n for (int x = 0; x < vertices.length; x++) { // Se recorre la matriz para buscar adyacencias.\n if (matriz[pos][x] != -1) { // Si existe arist\n if (menor + matriz[pos][x] < distancias[x]) {\n distancias[x] = menor + matriz[pos][x];\n camino[x] = actual;\n }\n }\n }\n revisados.put(actual);\n }\n Dictionary<V, DijkstraResult<V>> diccionario = new Hashtable<>();\n for (int x = 0; x < vertices.length; x++) {\n DijkstraResult<V> aux = new DijkstraResult<>(vertices[x], camino[x], distancias[x]);\n diccionario.put(vertices[x], aux);\n }\n return diccionario;\n }", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "@Test\r\n public void testAreAdjacent() {\r\n System.out.println(\"areAdjacent\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Object v2Element = 2;\r\n\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n Vertex v2 = instance.insertVertex(v2Element);\r\n\r\n Object edgeElement = \"A\";\r\n Edge e = instance.insertEdge(v1, v2, edgeElement);\r\n\r\n Object result = instance.areAdjacent(v1, v2);\r\n Object expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n }", "private static void search(graph M, graph D, Tuple[] h){\n\t\tint v = M.V[0];\n\t\tint q = 0; //q keeps track of the index in the Tuple array where a new tuple is placed\n\t\tfor(; q < h.length && h[q] != null; q++){\n\t\t\t;\t\t\t\n\t\t}\n\t\tfor(int i = 0; i < D.V.length; i++){\n\t\t\tint w = D.V[i];\n\t\t \tTuple t = new Tuple(v, w);\n\t\t\th[q] = t; //add a new tuple\n\t\t\tboolean OK = true;\n\t\t\tfor (int k = 0; k < M.V.length; k++){\n\t\t\t\tboolean shouldBreak = false;\n\t\t\t\tfor (int j = 0; j < M.V.length; j++){\n\t\t\t\t\tif (M.matrix[M.V[k]][M.V[j]] == 0){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tThis is part of the pseudo-code that I tried to incorporate\n\t\t\t\t\tI could not quite get it to work, I believe the problem is \n\t\t\t\t\tin the big if statement. Instead I wrote a different chunk of code\n\t\t\t\t\tthat determines in the th should be printed.\n\t\t\t\t\t*/\n// \t\t\t\t\tif ( (M.V[k] == v && searchH(M.V[j], h) != null) || (M.V[j] == v && searchH(M.V[k], h) != null) ){\n// \t\t\t\t\t\tif(D.matrix[searchH(M.V[k], h).y][searchH(M.V[j], h).y] == 0){\n// \t\t\t\t\t\t\tOK = false;\n// \t\t\t\t\t\t\tshouldBreak = true;\n// \t\t\t\t\t\t\tbreak;\n// \t\t\t\t\t\t}\n// \t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(shouldBreak == true){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OK == true){\n\t\t\t\tif(M.V.length == 1){\n\t\t\t\tboolean isGood = true;\n\t\t\t\t/*\n\t\t\t\tThis is what determines if h should be printed.\n\t\t\t\tEssentially it checks h against the adjacency matrices,\n\t\t\t\tand if the edges are present, it prints them out.\n\t\t\t\t*/\n\t\t\t\t\tfor(int g = 0; g < h.length && isGood == true; g++){\n\t\t\t\t\t\tfor(int f = g+1; f < h.length && isGood == true; f++){\n\t\t\t\t\t\t\tif(M.matrix[h[g].x][h[f].x] == 1 && D.matrix[h[g].y][h[f].y] == 0){\n\t\t\t\t\t\t\t\tisGood = false;\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\tif(isGood == true){\n\t\t\t\t\t\tSystem.out.println(printH(h));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tHere I rebuild the vertex arrays and attached them to a new graph\n\t\t\t\tfor use as an argument in the recursive call.\n\t\t\t\t*/\n\t\t\t\telse{\t\t\n\t\t\t\t\tint[] modelTemp = rebuildV(v, M.V);\n\t\t\t\t\tint[] dataTemp = rebuildV(D.V[i], D.V);\n\n\t\t\t\t\tTuple[] h2 = new Tuple[h.length];\n\t\t\t\t\tfor(int p = 0; p < h.length; p++){\n\t\t\t\t\t\th2[p] = h[p];\n\t\t\t\t\t}\n\t\t\t\t\tgraph M2 = new graph();\n\t\t\t\t\tgraph D2 = new graph();\n\t\t\t\t\t\n\t\t\t\t\tM2.V = modelTemp;\n\t\t\t\t\tD2.V = dataTemp;\n\t\t\t\t\tM2.matrix = M.matrix;\n\t\t\t\t\tD2.matrix = D.matrix;\n\t\t\t\t\t\n\t\t\t\t\t//recursive call\n\t\t\t\t\tsearch(M2, D2, h2);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n int n = 2100; //input the number of nodes\n int max = 10000;\n int graph[][] = Dijkstra2DArray(n);\n /*int graph[][]=new int[n][n];\n for(int i=0;i<n;i++) //test for the graph-2\n graph[i][i]=0;\n graph[0][1]=6;graph[1][0]=6;\n graph[0][2]=7;graph[2][0]=7;\n graph[0][3]=2;graph[3][0]=2;\n graph[0][4]=1;graph[4][0]=1;\n graph[1][2]=2;graph[2][1]=2;\n graph[1][3]=3;graph[3][1]=3;\n graph[1][4]=3;graph[4][1]=3;\n graph[2][3]=2;graph[3][2]=2;\n graph[2][4]=4;graph[4][2]=4;\n graph[3][4]=1;graph[4][3]=1;*/\n /*for(int i=0;i<n;i++) //test for the graph-1\n graph[i][i]=0;\n graph[0][1]=2;graph[1][0]=2;\n graph[0][2]=4;graph[2][0]=4;\n graph[0][3]=max;graph[3][0]=max;\n graph[0][4]=max;graph[4][0]=max;\n graph[0][5]=max;graph[5][0]=max;\n graph[0][6]=max;graph[6][0]=max;\n graph[0][7]=max;graph[7][0]=max;\n graph[1][2]=3;graph[2][1]=3;\n graph[1][3]=9;graph[3][1]=9;\n graph[1][4]=max;graph[4][1]=max;\n graph[1][5]=max;graph[5][1]=max;\n graph[1][6]=4;graph[6][1]=4;\n graph[1][7]=2;graph[7][1]=2;\n graph[2][3]=1;graph[3][2]=1;\n graph[2][4]=3;graph[4][2]=3;\n graph[2][5]=max;graph[5][2]=max;\n graph[2][6]=max;graph[6][2]=max;\n graph[2][7]=max;graph[7][2]=max;\n graph[3][4]=3;graph[4][3]=3;\n graph[3][5]=3;graph[5][3]=3;\n graph[3][6]=1;graph[6][3]=1;\n graph[3][7]=max;graph[7][3]=max;\n graph[4][5]=2;graph[5][4]=2;\n graph[4][6]=max;graph[6][4]=max;\n graph[4][7]=max;graph[7][4]=max;\n graph[5][6]=6;graph[6][5]=6;\n graph[5][7]=max;graph[7][5]=max;\n graph[6][7]=14;graph[7][6]=14;*/\n \n int result[][] = new int[n][n];\n int i, j, k, l, min, mark;\n boolean status[] = new boolean[n];\n long startTime = System.currentTimeMillis();\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n result[i][j] = graph[i][j];\n status[j] = false;\n }\n result[i][i] = 0;\n status[i] = true;\n for (k = 1; k < n; k++) {\n min = max;\n mark = i;\n for (l = 0; l < n; l++) {\n if ((!status[l]) && result[i][l] < min) {\n mark = l;\n min = result[i][l];\n }\n }\n status[mark] = true;\n for (l = 0; l < n; l++) {\n if ((!status[l]) && graph[mark][l] < max) {\n if (result[i][mark] + graph[mark][l] < result[i][l]) {\n result[i][l] = result[i][mark] + graph[mark][l];\n }\n }\n }\n }\n }\n long endTime = System.currentTimeMillis();\n System.out.println(\"Runtime:\" + (endTime - startTime) + \"ms\"); //test the runtime of this algorithm\n System.out.println(\"Result: \");\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n System.out.print(result[i][j] + \" \");\n }\n System.out.print(\"\\n\");\n }\n Problem2 p = new Problem2();\n System.out.println( p.BiDijkstra(graph, 0, 10));\n }", "public static void djikstra(int[][] graph, int src) {\n\t\t/* output array */\n\t\tint[] dist = new int[graph.length];\n\t\tboolean[] visited = new boolean[graph.length];\n\n\t\tfor (int i = 0; i < graph.length; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE;\n\t\t\tvisited[i] = false;\n\t\t}\n\n\t\tdist[src] = 0;\n\n\t\tfor (int i = 0; i < graph.length - 1; i++) {\n\n\t\t\t// Pick the minimum distance vertex from the set of vertices not\n\t\t\t// yet processed. u is always equal to src in first iteration.\n\t\t\tint u = findMinDistanceVertex(dist, visited);\n\t\t\t// Mark the picked vertex as processed\n\t\t\tvisited[u] = true;\n\t\t\t\n\t\t\tfor(int j = 0; j < graph.length; j++) {\n\t\t\t\t\n\t\t\t\t// Update dist[v] only if is not in sptSet, there is an edge from \n\t\t // u to v, and total weight of path from src to v through u is \n\t\t // smaller than current value of dist[v]\n\t\t\t\tif(!visited[j] && graph[u][j] != 0\n\t\t\t\t\t\t&& dist[u] != Integer.MAX_VALUE\n\t\t\t\t\t\t&& dist[u] + graph[u][j] < dist[j]) {\n\t\t\t\t\tdist[j] = dist[u] + graph[u][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintSolution(dist, graph.length);\n\t}", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "public static void main(String[] args) {\n\t\tVertex A = new Vertex(\"A\");\n\t\tVertex B = new Vertex(\"B\");\n\t\tVertex C = new Vertex(\"C\");\n\t\tVertex D = new Vertex(\"D\");\n\t\tVertex E = new Vertex(\"E\");\n\n\t\tA.adjacencies = new Edge[]{ new Edge(B, 10),\tnew Edge(C, 3) };\n\t\tB.adjacencies = new Edge[]{\tnew Edge(C, 1), \tnew Edge(D, 2)};\n\t\tC.adjacencies = new Edge[]{ new Edge(B, 4), \tnew Edge(D, 8),\tnew Edge(E, 2)};\n\t\tD.adjacencies = new Edge[]{ new Edge(E, 7)};\n\t\tE.adjacencies = new Edge[]{ new Edge(D, 9)};\n\t\tVertex[] vertices = { A,B,C,D,E };\n\t\t\n\t\tcomputePaths(A);\n\t\t\n\t\tfor (Vertex v : vertices)\n\t\t{\n\t\t System.out.println(\"Distance to \" + v + \": \" + v.minDistance);\n\t\t List<Vertex> path = getShortestPathTo(v);\n\t\t System.out.println(\"Path: \" + path);\n\t\t}\n\t}", "@Test\n public void getGraph1() throws Exception {\n try (final Graph g1 = dataset.getGraph(graph1).get()) {\n assertEquals(4, g1.size());\n\n assertTrue(g1.contains(alice, name, aliceName));\n assertTrue(g1.contains(alice, knows, bob));\n assertTrue(g1.contains(alice, member, null));\n assertTrue(g1.contains(null, name, secretClubName));\n }\n }", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.isEmpty() | !adjacentA.isEmpty() | !adjacentB.isEmpty()) {\r\n fail();\r\n } \r\n }", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "boolean hasIsVertexOf();", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "public static void main(String args[])\n\t{\n\t\tList<Vertex> v = new LinkedList<Vertex>();\n\t\tVertex v1 = new Vertex(1);\n\t\tVertex v2 = new Vertex(2);\n\t\tVertex v3 = new Vertex(3);\n \t\tVertex v4 = new Vertex(4);\n\t\t\n \t\t//Setting adjList for each vertex\n \t\tList<Vertex> adjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tadjList.add(v3);\n\t\tv1.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v4);\n\t\tv2.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tv3.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v3);\n\t\tv4.setAdjList(adjList);\n\t\t\n\t\tv.add(v1);\n\t\tv.add(v2);\n \t\tv.add(v3);\n\t\tv.add(v4);\n\n\t\tEdge e1 = new Edge(1, 2);\n\t\tList<Edge> e = new LinkedList<Edge>();\n\t\te.add(e1);\n\t\te1 = new Edge(1, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(2, 4);\n\t\te.add(e1);\n\t\te1 = new Edge(4, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(3, 2);\n\t\te.add(e1);\n\t\t\n\t\t\n\t\tGraph g = new Graph(v, e);\n\t\tg.bfs(v4);\n\t\t\n\t\t//v has all vertices\n\t\tg.unconnected(v2, v);\n\t}", "public abstract Multigraph buildMatchedGraph();", "private void connectVertex(IndoorVertex indoorV1, IndoorVertex indoorV2)\n {\n XYPos firstPos = indoorV1.getPosition();\n XYPos secondPos = indoorV2.getPosition();\n\n //Change in only X position means that the vertex's are East/West of eachother\n //Change in only Y position means that the vertex's are North/South of eachother\n if(firstPos.getX() > secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addWestConnection(indoorV2);\n indoorV2.addEastConnection(indoorV1);\n }\n else if(firstPos.getX() < secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addEastConnection(indoorV2);\n indoorV2.addWestConnection(indoorV1);\n }\n else if(firstPos.getY() > secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addSouthConnection(indoorV2);\n indoorV2.addNorthConnection(indoorV1);\n }\n else if(firstPos.getY() < secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addNorthConnection(indoorV2);\n indoorV2.addSouthConnection(indoorV1);\n }\n\n\n indoorV1.addConnection(indoorV2);\n indoorV2.addConnection(indoorV1);\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "@Test\n void test014_testGetConnectedComponents() {\n try {\n christmasBuddENetwork.addFriendship(\"Harry\", \"Prancer\");\n\n christmasBuddENetwork.addFriendship(\"Santa\", \"Rudolph\");\n christmasBuddENetwork.addFriendship(\"Comet\", \"Santa\");\n christmasBuddENetwork.addFriendship(\"Rudolph\", \"Comet\");\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Comet\");\n\n // There should be 2 connected components.\n Set<Graph> christmasComponents =\n christmasBuddENetwork.getConnectedComponents();\n int numComponents = christmasComponents.size();\n //\n if (numComponents != 2) {\n fail(\"\");\n }\n Iterator<Graph> christmasGraphIterator = christmasComponents.iterator();\n\n boolean firstCompFound = false;\n boolean secondCompFound = false;\n int componentsFound = 0;\n while (christmasGraphIterator.hasNext()) {\n Graph christmasGraph = christmasGraphIterator.next();\n componentsFound = componentsFound + 1;\n //\n if (christmasGraph.size() == 1) {\n if (firstCompFound == true) {\n fail(\"test014_testGetConnectedComponents(): FAILED! Duplicate \"\n + \"component (size 1) found! :(\");\n }\n Set<User> oneConnectedComponentVertices =\n christmasGraph.getAllVertices();\n ArrayList<String> componentUsersList = new ArrayList<String>();\n for (User userName : oneConnectedComponentVertices) {\n componentUsersList.add(userName.getName());\n System.out.println(userName.getName());\n }\n if ((!componentUsersList.contains(\"Harry\"))\n || (!componentUsersList.contains(\"Prancer\"))) {\n fail(\"test014_testGetConnectedComponents(): Failed! :( Did NOT \"\n + \"have Harry and Prancer\");\n } else {\n firstCompFound = true;\n\n }\n }\n\n if (christmasGraph.size() == 4) {\n if (secondCompFound == true) {\n fail(\"test014_testGetConnectedComponents: FAILED! Duplicate \"\n + \"component (size 4) found! :(\");\n }\n Set<User> secondConnectedComponentVertices =\n christmasGraph.getAllVertices();\n ArrayList<String> componentUsersList2 = new ArrayList<String>();\n for (User userName : secondConnectedComponentVertices) {\n componentUsersList2.add(userName.getName());\n }\n if ((!componentUsersList2.contains(\"santa\"))\n || (!componentUsersList2.contains(\"rudolph\"))\n || (!componentUsersList2.contains(\"comet\"))\n || (!componentUsersList2.contains(\"grinch\"))) {\n fail(\"test014_testGetConnectedComponents(): FAILED! Did NOT have \"\n + \"Santa, Rudolph, Comet, and Grinch!\");\n } else {\n secondCompFound = true;\n }\n }\n }\n\n if (componentsFound != 2) {\n fail(\"test014_testGetConnectedComponents(): Did NOT return 2 for the \"\n + \"connected components but instead returned: \" + componentsFound);\n }\n } catch (Exception e) {\n fail(\"test014_testGetConnectedComponents(): Failed! :(. Threw unexpected \"\n + \"exception\");\n }\n\n }", "@Test\n public void differentLinearGraphsTest() throws Exception {\n EventNode[] g1Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"d\" });\n\n EventNode[] g2Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"e\" });\n\n // ///////////////////\n // g1 and g2 are k-equivalent at first three nodes for k=1,2,3\n // respectively, but no further. Subsumption follows the same pattern.\n\n // \"INITIAL\" not at root:\n testKEqual(g1Nodes[0], g2Nodes[0], 1);\n testKEqual(g1Nodes[0], g2Nodes[0], 2);\n testKEqual(g1Nodes[0], g2Nodes[0], 3);\n testKEqual(g1Nodes[0], g2Nodes[0], 4);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 5);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 6);\n\n // \"a\" node at root:\n testKEqual(g1Nodes[1], g2Nodes[1], 1);\n testKEqual(g1Nodes[1], g2Nodes[1], 2);\n testKEqual(g1Nodes[1], g2Nodes[1], 3);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 4);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 5);\n\n // \"b\" node at root:\n testKEqual(g1Nodes[2], g2Nodes[2], 1);\n testKEqual(g1Nodes[2], g2Nodes[2], 2);\n testNotKEqual(g1Nodes[2], g2Nodes[2], 3);\n\n // \"c\" node at root:\n testKEqual(g1Nodes[3], g2Nodes[3], 1);\n testNotKEqual(g1Nodes[3], g2Nodes[3], 2);\n\n // \"d\" and \"e\" nodes at root:\n testNotKEqual(g1Nodes[4], g2Nodes[4], 1);\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "private ScheduleGrph initializeIdenticalTaskEdges(ScheduleGrph input) {\n\n\t\tScheduleGrph correctedInput = (ScheduleGrph) SerializationUtils.clone(input);\n\t\t// FORKS AND TODO JOINS\n\t\t/*\n\t\t * for (int vert : input.getVertices()) { TreeMap<Integer, List<Integer>> sorted\n\t\t * = new TreeMap<Integer, List<Integer>>(); for (int depend :\n\t\t * input.getOutNeighbors(vert)) { int edge = input.getSomeEdgeConnecting(vert,\n\t\t * depend); int weight = input.getEdgeWeightProperty().getValueAsInt(edge); if\n\t\t * (sorted.get(weight) != null) { sorted.get(weight).add(depend); } else {\n\t\t * ArrayList<Integer> a = new ArrayList(); a.add(depend); sorted.put(weight, a);\n\t\t * }\n\t\t * \n\t\t * } int curr = -1; for (List<Integer> l : sorted.values()) { for (int head : l)\n\t\t * {\n\t\t * \n\t\t * if (curr != -1) { correctedInput.addDirectedSimpleEdge(curr, head); } curr =\n\t\t * head; }\n\t\t * \n\t\t * } }\n\t\t */\n\n\t\tfor (int vert : input.getVertices()) {\n\t\t\tfor (int vert2 : input.getVertices()) {\n\t\t\t\tint vertWeight = input.getVertexWeightProperty().getValueAsInt(vert);\n\t\t\t\tint vert2Weight = input.getVertexWeightProperty().getValueAsInt(vert2);\n\n\t\t\t\tIntSet vertParents = input.getInNeighbors(vert);\n\t\t\t\tIntSet vert2Parents = input.getInNeighbors(vert2);\n\n\t\t\t\tIntSet vertChildren = input.getOutNeighbors(vert);\n\t\t\t\tIntSet vert2Children = input.getOutNeighbors(vert2);\n\n\t\t\t\tboolean childrenEqual = vertChildren.containsAll(vert2Children)\n\t\t\t\t\t\t&& vert2Children.containsAll(vertChildren);\n\n\t\t\t\tboolean parentEqual = vertParents.containsAll(vert2Parents) && vert2Parents.containsAll(vertParents);\n\n\t\t\t\tboolean inWeightsSame = true;\n\t\t\t\tfor (int parent : vertParents) {\n\t\t\t\t\tfor (int parent2 : vert2Parents) {\n\t\t\t\t\t\tif (parent == parent2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent, vert)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent2, vert2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!inWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tboolean outWeightsSame = true;\n\t\t\t\tfor (int child : vertChildren) {\n\t\t\t\t\tfor (int child2 : vert2Children) {\n\t\t\t\t\t\tif (child == child2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert, child)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert2, child2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!outWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tboolean alreadyEdge = correctedInput.areVerticesAdjacent(vert, vert2)\n\t\t\t\t\t\t|| correctedInput.areVerticesAdjacent(vert2, vert);\n\n\t\t\t\tif (vert != vert2 && vertWeight == vert2Weight && parentEqual && childrenEqual && inWeightsSame\n\t\t\t\t\t\t&& outWeightsSame && !alreadyEdge) {\n\t\t\t\t\tint edge = correctedInput.addDirectedSimpleEdge(vert, vert2);\n\t\t\t\t\tcorrectedInput.getEdgeWeightProperty().setValue(edge, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn correctedInput;\n\t}" ]
[ "0.6610097", "0.6584713", "0.65673155", "0.6480909", "0.644582", "0.63602316", "0.63554066", "0.63258713", "0.62789327", "0.623818", "0.6201396", "0.61970645", "0.618656", "0.6180613", "0.6153119", "0.61433613", "0.61294305", "0.61170137", "0.6103494", "0.6097593", "0.60406476", "0.6035652", "0.6035333", "0.60315007", "0.6028259", "0.6007183", "0.60025424", "0.6000973", "0.5995627", "0.5995135", "0.59892523", "0.59870577", "0.59829205", "0.5972961", "0.5966808", "0.5966101", "0.59572273", "0.59519404", "0.5950268", "0.59494865", "0.59404254", "0.5939043", "0.5937773", "0.5937324", "0.5925835", "0.5919484", "0.5915546", "0.5901363", "0.5893533", "0.58935297", "0.5890477", "0.58866954", "0.58835286", "0.58820575", "0.5881797", "0.5879768", "0.58779544", "0.5873237", "0.58665323", "0.5858952", "0.5856991", "0.58471406", "0.5846401", "0.58456856", "0.584334", "0.58390534", "0.583091", "0.58305067", "0.58122414", "0.580956", "0.58015645", "0.58013666", "0.5800805", "0.5800404", "0.5798682", "0.5795078", "0.5791753", "0.57904273", "0.5789944", "0.5777757", "0.5774349", "0.5764541", "0.57623535", "0.57616496", "0.57610273", "0.57585055", "0.5753992", "0.5750726", "0.57480454", "0.5736468", "0.5736317", "0.5735594", "0.5734305", "0.5732575", "0.57206655", "0.57191026", "0.57053816", "0.5701129", "0.5697105", "0.5696976" ]
0.58987176
48
calls Dijkstra's algorithm on another pair of vertices in a more complex graph and checks its results
@Test public void testPublic17() { Graph<Integer> graph= TestGraphs.testGraph5(); List<Integer> shortestPath= new ArrayList<Integer>(); assertEquals(8, graph.Dijkstra(131, 141, shortestPath)); assertEquals("131 330 132 141", TestGraphs.listToString(shortestPath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test public void testPublic14() {\n Graph<String> graph= TestGraphs.testGraph2();\n List<String> shortestPath= new ArrayList<String>();\n\n assertEquals(1, graph.Dijkstra(\"apple\", \"banana\", shortestPath));\n assertEquals(\"apple banana\", TestGraphs.listToString(shortestPath));\n\n assertEquals(2, graph.Dijkstra(\"apple\", \"cherry\", shortestPath));\n assertEquals(\"apple banana cherry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(3, graph.Dijkstra(\"apple\", \"date\", shortestPath));\n assertEquals(\"apple banana cherry date\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra(\"apple\", \"elderberry\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(5, graph.Dijkstra(\"apple\", \"fig\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(6, graph.Dijkstra(\"apple\", \"guava\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig guava\",\n TestGraphs.listToString(shortestPath));\n }", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "void dijkstra(int[][] graph){\r\n int dist[] = new int[rideCount];\r\n Boolean sptSet[] = new Boolean[rideCount];\r\n\r\n for(int i = 0; i< rideCount; i++){\r\n dist[i] = Integer.MAX_VALUE;\r\n sptSet[i] = false;\r\n }\r\n\r\n dist[0] = 0;\r\n\r\n for(int count = 0; count< rideCount -1; count++){\r\n int u = minWeight(dist, sptSet);\r\n sptSet[u] = true;\r\n for(int v = 0; v< rideCount; v++){\r\n if (!sptSet[v] && graph[u][v] != 0 && dist[u] + graph[u][v] < dist[v]){\r\n dist[v] = dist[u] + graph[u][v];\r\n }\r\n }\r\n }\r\n printSolution(dist);\r\n }", "public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "public static void liveDemo() {\n Scanner in = new Scanner( System.in );\n float srcTank1, srcTank2, destTank;\n int alternetPaths;\n Graph mnfld = new Graph();\n boolean runSearch = true;\n\n //might need to limit query results, too large maybe?\n //newnodes = JDBC.graphInformation(); //returns arraylist of nodes\n //mnfld.setPipes(newnodes); //set nodes to the manifold\n //JDBC.insertConnections(mnfld);\n\n//\t\t /*\n//\t\t\tfor (int i = 0; i < newnodes.length(); i++) { //length might be wrong\n//\t\t\t\t//need to look for way to add edges by looking for neighbor nodes i think\n//\t\t\t\t//loop through nodes and create Edges\n//\t\t\t\t//might need new query\n//\t\t\t\tnewedges.addEdge(node1,node2,cost);\n//\t\t\t}\n//\n//\t\t\tmnfld.setConnections(newedges);\n//\n//\t\t\tup to this point, graph should be global to Dijkstra and unused.\n//\t\t\tloop until user leaves page\n//\t\t\tget input from user for tanks to transfer\n//\t\t\tfind shortest path between both tanks\n//\t\t\tend loop\n//\t\t\tthis will change depending how html works so not spending any time now on it\n//\t\t*/\n //shortestPath.runTest();\n\n shortestPath.loadGraph( mnfld );\n while (runSearch) {\n // Gets user input\n System.out.print( \"First Source Tank: \" );\n srcTank1 = in.nextFloat();\n System.out.print( \"Second Source Tank: \" );\n srcTank2 = in.nextFloat();\n System.out.print( \"Destination Tank: \" );\n destTank = in.nextFloat();\n System.out.print( \"Desired Number of Alternate Paths: \" );\n alternetPaths = in.nextInt();\n\n // Prints outputs\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"True shortest with alt paths\" );\n Dijkstra.findAltPaths( mnfld, alternetPaths, srcTank1, destTank );\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering used connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), true );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering only open connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), false );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Merge Lineup\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ) );\n System.out.println( \"\\t Original Lineup: \" );\n mnfld.getPipe( destTank ).printLine();\n System.out.println( \"\\t Merged Lineup: \" );\n Dijkstra.mergePaths( mnfld, srcTank2, mnfld.getPipe( destTank ).getPath(), mnfld.getPipe( destTank ) );\n System.out.print( \"\\nRun another search [1:Yes, 0:No] :: \" );\n if (in.nextInt() == 0) runSearch = false;\n else System.out.println( \"\\n\\n\\n\" );\n }\n\n\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "public static int QTDelHeuristic1 (Graph<Integer,String> h) {\n\t\tint count = 0;\r\n\t\tboolean isQT = false;\r\n\t\t//h = Copy(g);\r\n\t\t//boolean moreToDo = true;\r\n\t\t\r\n\t\tIterator<Integer> a;\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\r\n\t\twhile (isQT == false) {\r\n\t\t\tisQT = true;\r\n\t\t\ta= h.getVertices().iterator();\r\n\t\t\twhile(a.hasNext()){\r\n\t\t\t\tInteger A = a.next();\r\n\t\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\t\tb = h.getNeighbors(A).iterator();\r\n\t\t\t\twhile(b.hasNext()){\r\n\t\t\t\t\tInteger B = b.next();\r\n\t\t\t\t\tc = h.getNeighbors(B).iterator();\r\n\t\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\t\tif (h.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\t\td = h.getNeighbors(C).iterator();\r\n\t\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\t\tisQT = false;\r\n\t\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t\t// requires 2 deletions\r\n\t\t\t\t\t\t\t\tcount += 2;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 2 + QTDelHeuristic1(h);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcount += 1;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 1 + QTDelHeuristic1(h);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\t\t\r\n\t\treturn count;\t\t\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "@Test\r\n\tpublic void test_Big_Graph() {\n\t\tweighted_graph g = new WGraph_DS();\r\n\t\tint size = 1000*1000;\r\n\t\tint ten=1;\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tg.addNode(i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tint dest=i;\r\n\t\t\tg.connect(size-2, i, 0.23); \r\n\r\n\t\t\tif(i<size-1){\r\n\t\t\t\tg.connect(i,++dest,0.78);\r\n\t\t\t}\r\n\t\t\tif(i%2==0&&i<size-2) {\r\n\t\t\t\tg.connect(i,2+dest,0.94);\r\n\t\t\t}\t\r\n\r\n\t\t\tif(ten==i&&(i%2==0)) {\r\n\t\t\t\tfor (int j =0 ; j <size; j++) {\r\n\t\t\t\t\tg.connect(ten, j,0.56);\r\n\t\t\t\t\tg.connect(ten-2, j, 0.4);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tten=ten*10;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t\tweighted_graph_algorithms algo = new WGraph_Algo();\r\n\t\talgo.init(g);\r\n\t\tassertTrue(algo.isConnected());\r\n\t\tassertEquals(algo.shortestPathDist(0, 999998),0.23);\r\n\t\tassertEquals(algo.shortestPathDist(0, 8),0.46);\r\n\t\tint expected2 []= {6,999998,8};\r\n\t\tint actual2 [] = new int [3];\r\n\t\tint i=0;\r\n\t\tfor(node_info n :algo.shortestPath(6, 8)) {\r\n\t\t\tactual2[i++]=n.getKey();\r\n\t\t}\r\n\t\tassertArrayEquals(expected2,actual2);\r\n\r\n\t}", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }", "public static void main(String[] args) {\n Digraph grph = new Digraph(5);\n grph.addEdge(0, 1);\n grph.addEdge(1, 2);\n grph.addEdge(2, 3);\n BreadthFirstDirectedPaths path1 = new BreadthFirstDirectedPaths(grph, 0);\n BreadthFirstDirectedPaths path2 = new BreadthFirstDirectedPaths(grph, 0);\n int len = -1;\n for (int i = 0; i < grph.V(); i++) {\n if (path1.hasPathTo(i) && path2.hasPathTo(i)) {\n if (len == -1) {\n len = path1.distTo(i);\n }\n if (path1.distTo(i) > len) {\n len = path1.distTo(i);\n }\n }\n }\n }", "public static ArrayList<edges<String, Double>> Dijkstra(String CHAR1, String CHAR2, graph<String,Float> g) {\n\t\tPriorityQueue<ArrayList<edges<String, Double>>> active = \n\t\t\tnew PriorityQueue<ArrayList<edges<String, Double>>>(10,new Comparator<ArrayList<edges<String, Double>>>() {\n\t\t\t\tpublic int compare(ArrayList<edges<String, Double>> path1, ArrayList<edges<String, Double>> path2) {\n\t\t\t\t\tedges<String, Double> dest1 = path1.get(path1.size() - 1);\n\t\t\t\t\tedges<String, Double> dest2 = path2.get(path2.size() - 1);\n\t\t\t\t\tif (!(dest1.getLabel().equals(dest2.getLabel())))\n\t\t\t\t\t\treturn dest1.getLabel().compareTo(dest2.getLabel());\n\t\t\t\t\treturn path1.size() - path2.size();\n\t\t\t\t}\n\t\t\t});\n\t\t\tSet<String> known = new HashSet<String>();\n\t\t\tArrayList<edges<String, Double>> begin = new ArrayList<edges<String, Double>>();\n\t\t\tbegin.add(new edges<String, Double>(CHAR1, 0.0));\n\t\t\tactive.add(begin);\t\t\n\t\t\twhile (!active.isEmpty()) {\n\t\t\t\tArrayList<edges<String, Double>> minPath = active.poll();\n\t\t\t\tedges<String, Double> endOfMinPath = minPath.get(minPath.size() - 1);\n\t\t\t\tString minDest = endOfMinPath.getDest();\n\t\t\t\tdouble minCost = endOfMinPath.getLabel();\n\t\t\t\tif (minDest.equals(CHAR2)) {\n\t\t\t\t\treturn minPath;\n\t\t\t\t}\n\t\t\t\tif (known.contains(minDest))\n\t\t\t\t\tcontinue;\n\t\t\t\tSet<edges<String,Float>> children = g.childrenOf(minDest);\n\t\t\t\tfor (edges<String, Float> e : children) {\n\t\t\t\t\tif (!known.contains(e.getDest())) {\n\t\t\t\t\t\tdouble newCost = minCost + e.getLabel();\n\t\t\t\t\t\tArrayList<edges<String, Double>> newPath = new ArrayList<edges<String, Double>>(minPath); \n\t\t\t\t\t\tnewPath.add(new edges<String, Double>(e.getDest(), newCost));\n\t\t\t\t\t\tactive.add(newPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tknown.add(minDest);\n\t\t\t}\n\t\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "public void testDijkstra() {\n \t\tfinal Dijkstra model = new Dijkstra();\n \t\tfinal Formula noDeadlocks = model.dijkstraPreventsDeadlocksAssertion();\n \t\tfinal Solution sol = solve(noDeadlocks, model.bounds(6,6,6));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 4344 18609\n //\t\tprimary variables: 444\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(444, sol.stats().primaryVariables());\n \t\tassertEquals(4344, sol.stats().variables());\n\t\tassertEquals(18609, sol.stats().clauses());\n \t}", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "public void dijkstraAllPairs(boolean print) {\r\n int numSuccesses = 0;\r\n long totalTimeSuccesses = 0;\r\n if (print) System.out.println(\"Paths between all pairs of vertices using Dijkstra's algorithm:\");\r\n for (int i = 0; i < location.size(); i++) {\r\n for (int j = i+1; j < location.size(); j++) {\r\n long startTime = System.nanoTime();\r\n ArrayList<Vertex> pathIJ = dijkstraPath(i, j);\r\n long endTime = System.nanoTime();\r\n if (!pathIJ.isEmpty()) {\r\n numSuccesses++;\r\n totalTimeSuccesses += (endTime - startTime);\r\n }\r\n if (print) System.out.println(\"I = \" + i + \" J = \" + j + \" : \" + pathIJ.toString());\r\n }\r\n }\r\n System.out.println(\"Dijkstra's algorithm is successfull \" + numSuccesses + \"/\" + location.size()*(location.size()-1)/2 + \" times.\");\r\n if (numSuccesses != 0) {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is \" + totalTimeSuccesses/numSuccesses + \" nanoseconds.\");\r\n } else {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is N/A nanoseconds.\");\r\n }\r\n System.out.println(\"\");\r\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "public ArrayList<Integer> path2Dest(int s, int t, int k, int method){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n d[s] = 0;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n int extractedVertex = minHeap.extractMin();\n\n if(extractedVertex==t) {\n break;\n }\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey =0;\n double currentKey=0;\n if(method==1) { //method 1\n newKey = d[extractedVertex] + edge.weight;\n currentKey = d[destination];\n }\n else{ //method 2\n newKey = d[extractedVertex] + edge.weight + coor[destination].distTo(coor[t])-coor[extractedVertex].distTo(coor[t]);\n currentKey = d[destination];\n }\n if(currentKey>=newKey){\n if(currentKey==newKey){ //if equal need to compare the value of key\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n //trace back the path using parent properties\n ArrayList<Integer> path = new ArrayList<>();\n if(parent[t]!=-1){\n path.add(t);\n while(parent[t]!= s) {\n path.add(0,parent[t]);\n t = parent[t];\n }\n path.add(0,s);\n }\n else\n path = null;\n return path;\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "public Dijkstra(Grafo<K, Integer> grafo, Vertice<K, Integer> vertOrigem) {\n\t\t\n\t\tthis.vertices = grafo.getVertices();\n\t\tthis.vertOrigem = vertOrigem;\n\t\t\n\t\tint total = vertices.size();\n\t\tboolean visitado[] = new boolean[total];\n\t\tthis.solucao = new Object[total][2]; // [0] = distancia [1] = vertice adjacente\n\t\t\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tsolucao[i][0] = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint vIndex = vertices.indexOf(vertOrigem);\n\t\tsolucao[vIndex][0] = 0;\n\t\tsolucao[vIndex][1] = vertOrigem;\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tVertice<K, Integer> y = null;\n\t\t\t\n\t\t\tfor (int z = 0; z < total; z++) {\n\t\t\t\tif (visitado[z]) continue;\n\t\t\t\tif ((Integer)solucao[z][0] < min) {\n\t\t\t\t\tmin = (Integer)solucao[z][0];\n\t\t\t\t\ty = vertices.get(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (min == Integer.MAX_VALUE) break;\n\t\t\t\n\t\t\tint yIndex = vertices.indexOf(y);\n\t\t\t\n\t\t\tList<Aresta<K, Integer>> arestas = y.getArestas();\n\t\t\tfor (Aresta<K, Integer> a:arestas) {\n\t\t\t\t\n\t\t\t\tVertice<K, Integer> w = a.getVertices()[0];\n\t\t\t\tint wIndex = vertices.indexOf(w);\n\t\t\t\tif (visitado[wIndex]) continue;\n\t\t\t\t\n\t\t\t\tif ((Integer)solucao[yIndex][0] + a.getValor() < (Integer)solucao[wIndex][0]) {\n\t\t\t\t\tsolucao[wIndex][0] = (Integer)solucao[yIndex][0] + a.getValor();\n\t\t\t\t\tsolucao[wIndex][1] = y;\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tvisitado[yIndex] = true;\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void compare_with_dijkstra(Weighting w) {\n final long seed = System.nanoTime();\n final int numQueries = 1000;\n\n Random rnd = new Random(seed);\n int numNodes = 100;\n GHUtility.buildRandomGraph(graph, rnd, numNodes, 2.2, true, speedEnc, null, 0.8, 0.8);\n GHUtility.addRandomTurnCosts(graph, seed, null, turnCostEnc, maxTurnCosts, turnCostStorage);\n\n long numStrictViolations = 0;\n for (int i = 0; i < numQueries; i++) {\n int source = rnd.nextInt(numNodes);\n int target = rnd.nextInt(numNodes);\n Path dijkstraPath = new Dijkstra(graph, w, TraversalMode.EDGE_BASED).calcPath(source, target);\n Path path = calcPath(source, target, ANY_EDGE, ANY_EDGE, w);\n assertEquals(dijkstraPath.isFound(), path.isFound(), \"dijkstra found/did not find a path, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n assertEquals(dijkstraPath.getWeight(), path.getWeight(), 1.e-6, \"weight does not match dijkstra, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n // we do not do a strict check because there can be ambiguity, for example when there are zero weight loops.\n // however, when there are too many deviations we fail\n if (\n Math.abs(dijkstraPath.getDistance() - path.getDistance()) > 1.e-6\n || Math.abs(dijkstraPath.getTime() - path.getTime()) > 10\n || !dijkstraPath.calcNodes().equals(path.calcNodes())) {\n numStrictViolations++;\n }\n }\n if (numStrictViolations > Math.max(1, 0.05 * numQueries)) {\n fail(\"Too many strict violations, seed: \" + seed + \" - \" + numStrictViolations + \" / \" + numQueries);\n }\n }", "@Test\n public void testDijkstra() throws Exception {\n String graphFileName = \"algorithm/graph/shortestpath/weighted/weightedGraph.txt\";\n Graph graph = Graph.createGraphFromFile(WeightedShortestPath.class.getResource(\"/\").getPath() + File.separator +\n graphFileName);\n\n System.out.println(\"==============Graph before weighted shortest path found==============\");\n graph.printGraph();\n\n WeightedShortestPath.dijkstra(graph, graph.getVertex(\"v1\"));\n System.out.println(\"======Graph after weighted shortest path found by Dijkstra's algorithm=====\");\n graph.printGraph();\n\n System.out.println(\"===================Print the path to each vertex====================\");\n for (Vertex v: graph.getVertexMap().values()) {\n graph.printPath(v);\n System.out.println();\n }\n System.out.println();\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "public boolean connectsVertex(V v);", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "public static void main(String[] args) {\n int vertices = Integer.parseInt(StdIn.readLine());\n //Storing vertex weights\n double[] vertW = new double[vertices];\n for(int i=0;i<vertices;i++)\n vertW[i] = Double.parseDouble(StdIn.readLine());\n //Reading in new graph, G**\n String[] Gstarstar = StdIn.readAllLines();\n //Making graph\n EdgeWeightedDigraph G = new EdgeWeightedDigraph(Gstarstar);\n //Dijkstra All Pairs\n DijkstraAllPairsSP DAP = new DijkstraAllPairsSP(G);\n //Printing output of paths\n for(int i=0; i<G.V(); i++){\n for(int j=0; j<G.V(); j++){\n if(!DAP.hasPath(i,j))\n StdOut.print(i+\" to \"+j+\"\\t\\tno path\");\n else{\n double newEW;\n double EW;\n Iterable<DirectedEdge> path = DAP.path(i,j);\n double totalWeight = 0;\n String sp = \"\"; //String that's going to form the path\n for(DirectedEdge x : path){\n newEW = x.weight();\n EW = newEW + vertW[x.to()] - vertW[x.from()]; //reverse calibrate\n totalWeight += EW;\n sp += \"\\t\"+x.from()+\"->\"+x.to()+\" \"+String.format(\"%.2f\",EW); //adding to path\n }\n StdOut.print(i+\" to \"+j+\"\\t(\"+String.format(\"%.2f\",totalWeight)+\") \");\n StdOut.print(sp);\n }\n StdOut.println();\n }\n StdOut.println();\n }\n }", "public Square[] buildPath(GameBoard board, Player player) {\n\n // flag to check if we hit a goal location\n boolean goalVertex = false;\n\n // Queue of vertices to be checked\n Queue<Vertex> q = new LinkedList<Vertex>();\n\n // set each vertex to have a distance of -1\n for ( int i = 0; i < graph.length; i++ )\n graph[i] = new Vertex(i,-1);\n\n // get the start location, i.e. the player's location\n Vertex start = \n squareToVertex(board.getPlayerLoc(player.getPlayerNo()));\n start.dist = 0;\n q.add(start);\n\n // while there are still vertices to check\n while ( !goalVertex ) {\n\n // get the vertex and remove it;\n // we don't want to look at it again\n Vertex v = q.remove();\n\n // check if this vertex is at a goal row\n switch ( player.getPlayerNo() ) {\n case 0: if ( v.graphLoc >= 72 ) \n goalVertex = true; break;\n case 1: if ( v.graphLoc <= 8 ) \n goalVertex = true; break;\n case 2: if ( (v.graphLoc+1) % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n case 3: if ( v.graphLoc % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n }\n\n // if we're at a goal vertex, we don't need to calculate\n // its neighboors\n if ( !goalVertex ) {\n\n // retrieve all reachable ajacencies\n Square[] adjacencies = reachableAdjacentSquares\n (board, vertexToSquare(v, board), player.getPlayerNo());\n\n // for each adjacency...\n for ( Square s : adjacencies ) {\n\n // convert to graph location\n Vertex adjacent = squareToVertex(s); \n\n // modify the vertex if it hasn't been modified\n if ( adjacent.dist < 0 ) {\n adjacent.dist = v.dist+1;\n adjacent.path = v;\n q.add(adjacent);\n }\n }\n\n }\n else\n return returnPath(v,board);\n \n }\n // should never get here\n return null;\n }", "public void floyd(TripartiteGraph graph) throws Exception\n\t{\n\t\tint size = graph.numNodes();\n\t\tSparseMatrix matrix = (SparseMatrix) graph.matrix();\n\t\t// initialize dist\n\t\tfor (int i = 0; i < size; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t{\n\t\t\t\tif (!matrix.containRowCol(i, j))\n\t\t\t\t\tdist[i][j] = INF;\n\t\t\t\telse\n\t\t\t\t\tdist[i][j] = (int) matrix.at(i, j);\n\t\t\t}\n\t\t}\n\t\tfor (int k = 0; k < size; k++)\n\t\t{\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t\t{\n\t\t\t\t\tif (dist[i][k] != INF && dist[k][j] != INF\n\t\t\t\t\t\t\t&& dist[i][k] + dist[k][j] < dist[i][j])\n\t\t\t\t\t{\n\t\t\t\t\t\tdist[i][j] = dist[i][k] + dist[k][j];\n\t\t\t\t\t\tpath.set(i, j, k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n generateAndSaveExampleGraph();\n\n\n /*\n * select graph for prepairing and handling by algorhytm\n * determine graph source from config.xml:\n * config case = ?\n * 1 - from matrix\n * 2 - from edges list\n * 3 - from xml\n * */\n //read configCase\n Integer configCase = 0;\n try {\n configCase = (Integer) XMLSerializer.read( \"config.xml\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n //determine case\n EuclidDirectedGraph graph = null;\n switch (configCase){\n case 1:\n graph = getGraphFromMatrix();\n break;\n case 2:\n graph = getGraphFromEdgesList();\n break;\n case 3:\n graph = getGraphFromXML();\n break;\n default:\n return;\n\n }\n //find all sources and sinks\n ArrayList<BoundsGraphVertex> sources = new ArrayList<>();\n ArrayList<BoundsGraphVertex> sinks = new ArrayList<>();\n //get all sources and sinks\n for (Map.Entry<BoundsGraphVertex, Map<BoundsGraphVertex, Double>> vertexEntry : graph.getMap().entrySet()) {\n //if there are no edges from vertex then its sink\n if (vertexEntry.getValue().isEmpty()) {\n sinks.add(vertexEntry.getKey());\n } else {\n //mark all vertexes which have incoming edges\n for (BoundsGraphVertex dest : vertexEntry.getValue().keySet()) {\n dest.setMarked(true);\n }\n }\n }\n //all unmarked vertexes are sources\n for (BoundsGraphVertex vertex : graph) {\n if (!vertex.isMarked()) sources.add(vertex);\n }\n\n /*\n * First algorithm: for each source-sink pair get path using euclid heuristics\n * */\n List<BoundsGraphVertex> minPath = null;\n Double minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n for (BoundsGraphVertex sink :\n sinks) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathWithHeuristics(graph, source, sink, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n\n }\n }\n\n /*\n * Second algorithm: for each source get better sink\n * */\n minPath = null;\n minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathToManySinks(graph, source, sinks, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n }\n try {\n XMLSerializer.write(minPath, \"output.xml\", false);\n XMLSerializer.write(minLength, \"output.xml\", true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static <V> Dictionary<V, DijkstraResult<V>> getShortestPathDijkstra(Graph<V> graph, V value) {\n V[] vertices = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[] distancias = new double[vertices.length];\n V[] camino = (V[]) new Object[vertices.length];\n int pos = buscarPosicion(value, vertices);\n\n for (int x = 0; x < vertices.length; x++) { // Se llenan los arreglos con la informacion de sus adyacentes.\n if (pos == x) {\n distancias[x] = 0;\n camino[x] = null;\n } else {\n if (matriz[pos][x] == -1) {\n distancias[x] = Integer.MAX_VALUE - 1;\n camino[x] = vertices[pos];\n } else {\n distancias[x] = matriz[pos][x];\n camino[x] = vertices[pos];\n }\n }\n }\n\n Set<V> revisados = new LinkedListSet<>();\n revisados.put(value);\n while (revisados.size() < vertices.length) {\n double menor = Integer.MAX_VALUE;\n V actual = null;\n for (int x = 0; x < vertices.length; x++) {\n if (distancias[x] < menor) {\n if (!revisados.isMember(vertices[x])) {\n menor = distancias[x];\n actual = vertices[x];\n }\n }\n }\n\n pos = buscarPosicion(actual, vertices);\n for (int x = 0; x < vertices.length; x++) { // Se recorre la matriz para buscar adyacencias.\n if (matriz[pos][x] != -1) { // Si existe arist\n if (menor + matriz[pos][x] < distancias[x]) {\n distancias[x] = menor + matriz[pos][x];\n camino[x] = actual;\n }\n }\n }\n revisados.put(actual);\n }\n Dictionary<V, DijkstraResult<V>> diccionario = new Hashtable<>();\n for (int x = 0; x < vertices.length; x++) {\n DijkstraResult<V> aux = new DijkstraResult<>(vertices[x], camino[x], distancias[x]);\n diccionario.put(vertices[x], aux);\n }\n return diccionario;\n }", "@Test\n public void testDistantPoints() {\n // OK with 1000 visited nodes:\n MapMatching mapMatching = new MapMatching(hopper, algoOptions);\n List<GPXEntry> inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.23, 12.18),\n new GHPoint(51.45, 12.59));\n MatchResult mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(57650, mr.getMatchLength(), 1);\n assertEquals(2747796, mr.getMatchMillis(), 1);\n\n // not OK when we only allow a small number of visited nodes:\n AlgorithmOptions opts = AlgorithmOptions.start(algoOptions).maxVisitedNodes(1).build();\n mapMatching = new MapMatching(hopper, opts);\n try {\n mr = mapMatching.doWork(inputGPXEntries);\n fail(\"Expected sequence to be broken due to maxVisitedNodes being too small\");\n } catch (RuntimeException e) {\n assertTrue(e.getMessage().startsWith(\"Sequence is broken for submitted track\"));\n }\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Test\n public void testShortestPathEstacoes() {\n completeMap = new Graph(false);\n incompleteMap = new Graph(false);\n\n completeMap.insertVertex(porto);\n Company.getParkRegistry().getParkMap().put(porto, portoL);\n completeMap.insertVertex(braga);\n Company.getParkRegistry().getParkMap().put(braga, bragaL);\n completeMap.insertVertex(vila);\n Company.getParkRegistry().getParkMap().put(vila, vilaL);\n completeMap.insertVertex(aveiro);\n Company.getParkRegistry().getParkMap().put(aveiro, aveiroL);\n completeMap.insertVertex(coimbra);\n Company.getParkRegistry().getParkMap().put(coimbra, coimbraL);\n completeMap.insertVertex(leiria);\n Company.getParkRegistry().getParkMap().put(leiria, leiriaL);\n\n completeMap.insertVertex(viseu);\n Company.getParkRegistry().getParkMap().put(viseu, viseuL);\n completeMap.insertVertex(guarda);\n Company.getParkRegistry().getParkMap().put(guarda, guardaL);\n completeMap.insertVertex(castelo);\n Company.getParkRegistry().getParkMap().put(castelo, casteloL);\n completeMap.insertVertex(lisboa);\n Company.getParkRegistry().getParkMap().put(lisboa, lisboaL);\n completeMap.insertVertex(faro);\n Company.getParkRegistry().getParkMap().put(faro, faroL);\n\n completeMap.insertEdge(porto, aveiro, c, 75);\n completeMap.insertEdge(porto, braga, c2, 60);\n completeMap.insertEdge(porto, vila, c3, 100);\n completeMap.insertEdge(viseu, guarda, c4, 75);\n completeMap.insertEdge(guarda, castelo, c5, 100);\n completeMap.insertEdge(aveiro, coimbra, c6, 60);\n completeMap.insertEdge(coimbra, lisboa, c7, 200);\n completeMap.insertEdge(coimbra, leiria, c8, 80);\n completeMap.insertEdge(aveiro, leiria, c9, 120);\n completeMap.insertEdge(leiria, lisboa, c10, 150);\n\n completeMap.insertEdge(aveiro, viseu, c11, 85);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n completeMap.insertEdge(lisboa, faro, c13, 280);\n\n incompleteMap = completeMap.clone();\n\n incompleteMap.removeEdge(aveiro, viseu);\n incompleteMap.removeEdge(leiria, castelo);\n incompleteMap.removeEdge(lisboa, faro);\n\n System.out.println(\"Test of shortest path\");\n\n LinkedList<String> shortPath = new LinkedList<>();\n double lenpath = 0;\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, l, shortPath);\n assertTrue(\"Length path should be 0 if vertex does not exist\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, porto, faro, shortPath);\n assertTrue(\"Length path should be 0 if there is no path\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, porto, shortPath);\n assertTrue(\"Number of nodes should be 1 if source and vertex are the same\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPath(incompleteMap, porto, lisboa, shortPath);\n assertTrue(\"Path between Porto and Lisboa should be 335 Km\", lenpath == 335);\n\n Iterator<String> it = shortPath.iterator();\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Lisboa\", it.next().equals(lisboa));\n completeMap.insertEdge(porto, lisboa, c, 10);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, braga, leiria, shortPath);\n assertEquals(\"Path between Braga and Leiria should be close to 152.89\", lenpath, 152, 1);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Braga\", it.next().equals(braga));\n assertTrue(\"then Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Leiria\", it.next().equals(leiria));\n\n shortPath.clear();\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, castelo, shortPath);\n assertEquals(\"Path between Porto and Castelo Branco should be close to 202.86\", lenpath, 202, 1);\n assertTrue(\"N. cities between Porto and Castelo Branco should be 5 \", shortPath.size() == 5);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Viseu\", it.next().equals(viseu));\n assertTrue(\"then Viseu\", it.next().equals(guarda));\n assertTrue(\"then Castelo Branco\", it.next().equals(castelo));\n\n //Changing Edge: aveiro-viseu with Edge: leiria-C.Branco \n //should change shortest path between porto and castelo Branco\n completeMap.removeEdge(aveiro, viseu);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n shortPath.clear();\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, castelo, shortPath);\n assertTrue(\"Path between Porto and Castelo Branco should now be 330 Km\", lenpath == 330);\n assertTrue(\"Path between Porto and Castelo Branco should be 4 cities\", shortPath.size() == 4);\n\n }", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static List<Vertex> doDijkstra(List<Vertex> vertexes) {\n\n\t\t// Zok, we have a graph constructed. Traverse.\n\t\tPriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(me);\n\t\tme.setMinDistance(0);\n\n\t\twhile (!vertexQueue.isEmpty()) {\n\t\t\tVertex v = vertexQueue.poll();\n\t\t\tdouble distance = v.getMinDistance() + 1;\n\n\t\t\tfor (Vertex neighbor : v.getAdjacencies()) {\n\t\t\t\tif (distance < neighbor.getMinDistance()) {\n\t\t\t\t\tneighbor.setMinDistance(distance);\n\t\t\t\t\tneighbor.setPrevious(v);\n\t\t\t\t\tvertexQueue.remove(neighbor);\n\t\t\t\t\tvertexQueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn vertexes;\n\t}", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "private ScheduleGrph initializeIdenticalTaskEdges(ScheduleGrph input) {\n\n\t\tScheduleGrph correctedInput = (ScheduleGrph) SerializationUtils.clone(input);\n\t\t// FORKS AND TODO JOINS\n\t\t/*\n\t\t * for (int vert : input.getVertices()) { TreeMap<Integer, List<Integer>> sorted\n\t\t * = new TreeMap<Integer, List<Integer>>(); for (int depend :\n\t\t * input.getOutNeighbors(vert)) { int edge = input.getSomeEdgeConnecting(vert,\n\t\t * depend); int weight = input.getEdgeWeightProperty().getValueAsInt(edge); if\n\t\t * (sorted.get(weight) != null) { sorted.get(weight).add(depend); } else {\n\t\t * ArrayList<Integer> a = new ArrayList(); a.add(depend); sorted.put(weight, a);\n\t\t * }\n\t\t * \n\t\t * } int curr = -1; for (List<Integer> l : sorted.values()) { for (int head : l)\n\t\t * {\n\t\t * \n\t\t * if (curr != -1) { correctedInput.addDirectedSimpleEdge(curr, head); } curr =\n\t\t * head; }\n\t\t * \n\t\t * } }\n\t\t */\n\n\t\tfor (int vert : input.getVertices()) {\n\t\t\tfor (int vert2 : input.getVertices()) {\n\t\t\t\tint vertWeight = input.getVertexWeightProperty().getValueAsInt(vert);\n\t\t\t\tint vert2Weight = input.getVertexWeightProperty().getValueAsInt(vert2);\n\n\t\t\t\tIntSet vertParents = input.getInNeighbors(vert);\n\t\t\t\tIntSet vert2Parents = input.getInNeighbors(vert2);\n\n\t\t\t\tIntSet vertChildren = input.getOutNeighbors(vert);\n\t\t\t\tIntSet vert2Children = input.getOutNeighbors(vert2);\n\n\t\t\t\tboolean childrenEqual = vertChildren.containsAll(vert2Children)\n\t\t\t\t\t\t&& vert2Children.containsAll(vertChildren);\n\n\t\t\t\tboolean parentEqual = vertParents.containsAll(vert2Parents) && vert2Parents.containsAll(vertParents);\n\n\t\t\t\tboolean inWeightsSame = true;\n\t\t\t\tfor (int parent : vertParents) {\n\t\t\t\t\tfor (int parent2 : vert2Parents) {\n\t\t\t\t\t\tif (parent == parent2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent, vert)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent2, vert2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!inWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tboolean outWeightsSame = true;\n\t\t\t\tfor (int child : vertChildren) {\n\t\t\t\t\tfor (int child2 : vert2Children) {\n\t\t\t\t\t\tif (child == child2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert, child)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert2, child2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!outWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tboolean alreadyEdge = correctedInput.areVerticesAdjacent(vert, vert2)\n\t\t\t\t\t\t|| correctedInput.areVerticesAdjacent(vert2, vert);\n\n\t\t\t\tif (vert != vert2 && vertWeight == vert2Weight && parentEqual && childrenEqual && inWeightsSame\n\t\t\t\t\t\t&& outWeightsSame && !alreadyEdge) {\n\t\t\t\t\tint edge = correctedInput.addDirectedSimpleEdge(vert, vert2);\n\t\t\t\t\tcorrectedInput.getEdgeWeightProperty().setValue(edge, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn correctedInput;\n\t}", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "public static void PrimsAlgorithm(WeightedGraph graph) {\n System.out.println(\"______________________________Prim's Algorithm(Priority Queue)_____________________________\\n\");\n ArrayList<Edge> mst = new ArrayList<>();\n // initialize an array that will keep track of which vertices have been visited\n boolean[] visited = new boolean[graph.getVertices()];\n // initialize a PriorityQueue \n PriorityQueue<Edge> priorityQueue = new PriorityQueue<>();\n // mark the initial vertex as visited\n visited[0] = true;\n\n // for every edge connected to the source, add it to the PriorityQueue \n for (int i = 0; i < graph.getAdjacencylist(0).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(0).get(i));\n }\n\n // keep adding edges until the PriorityQueue is empty\n while (!priorityQueue.isEmpty()) {\n Edge e = priorityQueue.remove();\n\n // if we have already visited the opposite vertex, go to the next edge\n if (visited[e.getDestination()]) {\n continue;\n }\n\n //mark the opposite vertex as visited\n visited[e.getDestination()] = true;\n //Add an edge to the minimum spanning tree\n mst.add(e);\n\n // for every edge connected to the opposite vertex, add it to the PriorityQueue\n for (int i = 0; i < graph.getAdjacencylist(e.getDestination()).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(e.getDestination()).get(i));\n }\n\n }\n\n // if we haven't visited all of the vertices, return \n for (int i = 1; i < graph.getVertices(); i++) {\n if (!visited[i]) {\n System.out.println(\"Error! the graph is not connected.\");\n return;\n }\n }\n\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = sc.nextInt();\n\t\tint roadlines = sc.nextInt();\n\t\tsc.nextLine(); // for reading string in nextline\n\t\tEdgeWeightedGraph edge = new EdgeWeightedGraph(cities);\n\t\t// The Time Complexity is O(E)\n\t\t// The road lines is the number of edges\n\t\tfor (int i = 0; i < roadlines; i++) {\n\t\t\tString[] tokens = sc.nextLine().split(\" \");\n\t\t\tedge.addEdge(new Edge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]),\n\t\t\t\tDouble.parseDouble(tokens[2])));\n\t\t}\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t\tSystem.out.println(edge);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] input = sc.nextLine().split(\" \");\n\t\t\tDijkstraSP shortest = new DijkstraSP(\n edge, Integer.parseInt(input[0]));\n double distance = shortest.distTo(Integer.parseInt(input[1]));\n // The time complexity is O(1)\n if (!shortest.hasPathTo(Integer.parseInt(input[1]))) {\n \tSystem.out.println(\"No Path Found.\");\n } else {\n \tSystem.out.println(distance);\n }\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] str1 = sc.nextLine().split(\" \");\n\t\t\tboolean flag1 = false;\n\t\t\tboolean flag2 = false;\n\t\t\tdouble distance1 = 0.0;\n\t\t\tdouble distance2 = 0.0;\n\t\t\tDijkstraSP shortest1 = new DijkstraSP(edge, Integer.parseInt(str1[0]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest1.hasPathTo(Integer.parseInt(str1[1]))) {\n\t\t\t\tflag1 = true;\n\t\t\t\tdistance1 = shortest1.distance(Integer.parseInt(str1[1]));\n\t\t\t}\n\t\t\tDijkstraSP shortest2 = new DijkstraSP(edge, Integer.parseInt(str1[1]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest2.hasPathTo(Integer.parseInt(str1[2]))) {\n\t\t\t\tflag2 = true;\n\t\t\t\tdistance2 = shortest2.distance(Integer.parseInt(str1[2]));\n\t\t\t}\n\t\t\tdouble Distance = distance1 + distance2;\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (flag1 && flag2) {\n\t\t\t// Displays output upto 1 decimal point\n\t\t\tSystem.out.format(\"%.1f\", Distance);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n ArrayList<Integer> path = new ArrayList<>();\n for (Edge eachlink : shortest1.pathTo(Integer.parseInt(str1[1]))) {\n int either = eachlink.either();\n int other = eachlink.other(eachlink.either());\n if (!path.contains(other)) {\n path.add(other);\n }\n if (!path.contains(either)) {\n path.add(either);\n }\n }\n for (Edge eachlink1 : shortest2.pathTo(Integer.parseInt(str1[2]))) {\n int either1 = eachlink1.either();\n int other1 = eachlink1.other(eachlink1.either());\n if (!path.contains(other1)) {\n path.add(other1);\n }\n if (!path.contains(either1)) {\n path.add(either1);\n }\n }\n for (int everyval : path) {\n System.out.print(everyval + \" \");\n }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "public static void djikstra(int[][] graph, int src) {\n\t\t/* output array */\n\t\tint[] dist = new int[graph.length];\n\t\tboolean[] visited = new boolean[graph.length];\n\n\t\tfor (int i = 0; i < graph.length; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE;\n\t\t\tvisited[i] = false;\n\t\t}\n\n\t\tdist[src] = 0;\n\n\t\tfor (int i = 0; i < graph.length - 1; i++) {\n\n\t\t\t// Pick the minimum distance vertex from the set of vertices not\n\t\t\t// yet processed. u is always equal to src in first iteration.\n\t\t\tint u = findMinDistanceVertex(dist, visited);\n\t\t\t// Mark the picked vertex as processed\n\t\t\tvisited[u] = true;\n\t\t\t\n\t\t\tfor(int j = 0; j < graph.length; j++) {\n\t\t\t\t\n\t\t\t\t// Update dist[v] only if is not in sptSet, there is an edge from \n\t\t // u to v, and total weight of path from src to v through u is \n\t\t // smaller than current value of dist[v]\n\t\t\t\tif(!visited[j] && graph[u][j] != 0\n\t\t\t\t\t\t&& dist[u] != Integer.MAX_VALUE\n\t\t\t\t\t\t&& dist[u] + graph[u][j] < dist[j]) {\n\t\t\t\t\tdist[j] = dist[u] + graph[u][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintSolution(dist, graph.length);\n\t}", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "@Test public void testPublic16() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(5, graph.Dijkstra(131, 351, shortestPath));\n assertEquals(\"131 330 351\", TestGraphs.listToString(shortestPath));\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "public static void main(String[] args) {\n\t\tint vertices = Integer.parseInt(args[0]);\n\t\tint edges = Integer.parseInt(args[1]);\n\t\tint seed = Integer.parseInt(args[2]);\n\t\tRandom random = new Random(seed);\n\n\t\tAdjMatrixEdgeWeightedDirectedGraph g = new AdjMatrixEdgeWeightedDirectedGraph(vertices);\n\t\tfor (int i = 0; i < edges; i++) {\n\t\t\tint v = random.nextInt(vertices);\n\t\t\tint w = random.nextInt(vertices);\n\t\t\tdouble weight = Math.round(100 * (random.nextDouble() - 0.15)) / 100.0;\n\t\t\tif (v == w) g.addEdge(new Edge(v, w, Math.abs(weight)));\n\t\t\telse g.addEdge(new Edge(v, w, weight));\n\t\t}\n\n\t\t// run Floyd-Warshall algorithm\n\t\tFloydWarshall spt = new FloydWarshall(g);\n\n\t\t// print all-pairs shortest path distances\n\t\tSystem.out.print(\" \");\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%6d \", v);\n\t\t}\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%3d: \", v);\n\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\tif (spt.hasPath(v, w)) System.out.printf(\"%6.2f \", spt.dist(v, w));\n\t\t\t\telse System.out.printf(\" Inf \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// print negative cycle\n\t\tif (spt.hasNegativeCycle()) {\n\t\t\tSystem.out.println(\"Negative cost cycle:\");\n\t\t\tfor (int v : spt.negativeCycle()) System.out.println(v);\n\t\t\tSystem.out.println();\n\t\t// print all-pairs shortest paths\n\t\t} else {\n\t\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\t\tif (spt.hasPath(v, w)) {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d (%5.2f) \", v, w, spt.dist(v, w));\n\t\t\t\t\t\tfor (Edge e : spt.path(v, w)) System.out.print(e + \" \");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d no path\\n\", v, w);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test public void testPublic18() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(13, graph.Dijkstra(250, 141, shortestPath));\n assertEquals(\"250 351 132 141\", TestGraphs.listToString(shortestPath));\n }", "@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }", "@Test\n void testShortestPathDist(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(Double.compare(45,ga.shortestPathDist(1,4)) == 0);\n assertEquals(0,ga.shortestPathDist(1,1));\n assertEquals(-1,ga.shortestPathDist(1,200));\n }", "public abstract Multigraph buildMatchedGraph();", "public static void main(String[] args) {\n\t\tString vertex=\"abcdefghij\";\n\t\tString edge=\"bdegachiabefbc\";\n\t\tchar[] vc=vertex.toCharArray();\n\t\tchar[] ec=edge.toCharArray();\n\t\tint[] v=new int[vc.length];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i]=vc[i]-'a'+1;\n\t\t}\n\t\tint[] e=new int[ec.length];\n\t\tfor (int i = 0; i < e.length; i++) {\n\t\t\te[i]=ec[i]-'a'+1;\n\t\t}\t\t\n\t\t\n\t\tDS_List ds_List=new DS_List(v.length);\n//\t\tfor (int i = 0; i < v.length; i++) {\n//\t\t\tds_List.make_set(v[i]);\n//\t\t}\n//\t\tfor (int i = 0; i < e.length; i=i+2) {\n//\t\t\tif (ds_List.find_set(e[i])!=ds_List.find_set(e[i+1])) {\n//\t\t\t\tds_List.union(e[i], e[i+1]);\n//\t\t\t}\n//\t\t}\n\t\tds_List.connect_components(v, e);\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tSystem.out.print(ds_List.find_set(v[i])+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(ds_List.same_component(v[1], v[2]));\n\t}", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "private void connectVertex(IndoorVertex indoorV1, IndoorVertex indoorV2)\n {\n XYPos firstPos = indoorV1.getPosition();\n XYPos secondPos = indoorV2.getPosition();\n\n //Change in only X position means that the vertex's are East/West of eachother\n //Change in only Y position means that the vertex's are North/South of eachother\n if(firstPos.getX() > secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addWestConnection(indoorV2);\n indoorV2.addEastConnection(indoorV1);\n }\n else if(firstPos.getX() < secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addEastConnection(indoorV2);\n indoorV2.addWestConnection(indoorV1);\n }\n else if(firstPos.getY() > secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addSouthConnection(indoorV2);\n indoorV2.addNorthConnection(indoorV1);\n }\n else if(firstPos.getY() < secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addNorthConnection(indoorV2);\n indoorV2.addSouthConnection(indoorV1);\n }\n\n\n indoorV1.addConnection(indoorV2);\n indoorV2.addConnection(indoorV1);\n }", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "public void calcSP(Graph g, Vertex source){\n // Algorithm:\n // 1. Take the unvisited node with minimum weight.\n // 2. Visit all its neighbours.\n // 3. Update the distances for all the neighbours (In the Priority Queue).\n // Repeat the process till all the connected nodes are visited.\n\n // clear existing info\n// System.out.println(\"Calc SP from vertex:\" + source.name);\n g.resetMinDistance();\n source.minDistance = 0;\n PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();\n queue.add(source);\n\n while(!queue.isEmpty()){\n Vertex u = queue.poll();\n for(Edge neighbour:u.neighbours){\n// System.out.println(\"Scanning vector: \"+neighbour.target.name);\n Double newDist = u.minDistance+neighbour.weight;\n\n // get new shortest path, empty existing path info\n if(neighbour.target.minDistance>newDist){\n // Remove the node from the queue to update the distance value.\n queue.remove(neighbour.target);\n neighbour.target.minDistance = newDist;\n\n // Take the path visited till now and add the new node.s\n neighbour.target.path = new ArrayList<>(u.path);\n neighbour.target.path.add(u);\n// System.out.println(\"Path\");\n// for (Vertex vv: neighbour.target.path) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n\n// System.out.println(\"Paths\");\n neighbour.target.pathCnt = 0;\n neighbour.target.paths = new ArrayList<ArrayList<Vertex>>();\n if (u.paths.size() == 0) {\n ArrayList<Vertex> p = new ArrayList<Vertex>();\n p.add(u);\n neighbour.target.paths.add(p);\n neighbour.target.pathCnt++;\n } else {\n for (ArrayList<Vertex> p : u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n// for (Vertex vv : p1) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n }\n\n //Reenter the node with new distance.\n queue.add(neighbour.target);\n }\n // get equal cost path, add into path list\n else if (neighbour.target.minDistance == newDist) {\n queue.remove(neighbour.target);\n for(ArrayList<Vertex> p: u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n queue.add(neighbour.target);\n }\n }\n }\n }", "@Test\r\n\tpublic void testInputA() {\r\n\t\t//where there is 2 vertices but only 1 edge\r\n\t\tCompetitionDijkstra map1 = new CompetitionDijkstra(\"input-A.txt\", 55,60,92);\r\n\t\tCompetitionFloydWarshall map2= new CompetitionFloydWarshall(\"input-A.txt\", 60,60,92);\r\n\t\tassertEquals(-1, map1.timeRequiredforCompetition());\r\n\t\tassertEquals(-1, map2.timeRequiredforCompetition()); \t\r\n\t}", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) throws IOException {\n File file = new File(args[0]);\r\n //FileOutputStream f = new FileOutputStream(\"prat_dfs_data2.txt\");\r\n //System.setOut(new PrintStream(f));\r\n BufferedReader reader = new BufferedReader(new FileReader(file));\r\n String line;\r\n line = reader.readLine();\r\n int nodecount = 0;\r\n HashMap <String , Integer> nodeMap = new HashMap <String , Integer>(); \r\n while ((line = reader.readLine()) != null ) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n if (!nodeMap.containsKey(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"))){\r\n nodeMap.put(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"), nodecount);\r\n nodecount++;\r\n }\r\n }\r\n reader.close();\r\n Vertex adjList[] = new Vertex[nodecount];\r\n Vertex sortVer[] = new Vertex[nodecount];\r\n for(int it = 0; it < nodecount; it++){\r\n adjList[it] = new Vertex(it);\r\n }\r\n nodeMap.forEach((k, v) -> adjList[v].val = k);\r\n File file2 = new File(args[1]);\r\n BufferedReader reader2 = new BufferedReader(new FileReader(file2));\r\n line = reader2.readLine();\r\n while ((line = reader2.readLine()) !=null) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n String source = data[0].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n String target = data[1].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n\r\n int weight = Integer.parseInt(data[2]);\r\n Vertex current = adjList[nodeMap.get(source)];\r\n Vertex newbie = new Vertex(nodeMap.get(target));\r\n current.countN++;\r\n current.co_occur += weight;\r\n if (adjList[nodeMap.get(source)].next == null){\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n else{\r\n current.next.prev = newbie;\r\n newbie.next = current.next;\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n Vertex current1 = adjList[nodeMap.get(target)];\r\n Vertex newbie1 = new Vertex(nodeMap.get(source));\r\n current1.co_occur += weight;\r\n current1.countN++;\r\n if (current1.next == null){\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n else{\r\n current1.next.prev = newbie1;\r\n newbie1.next = current1.next;\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n }\r\n reader2.close();\r\n \r\n for(int it = 0; it < nodecount; it++){\r\n sortVer[it] = new Vertex(adjList[it].id);\r\n sortVer[it].val = adjList[it].val;\r\n sortVer[it].co_occur = adjList[it].co_occur;\r\n }\r\n if (args[2].equals(\"average\")){\r\n double countdeg = 0;\r\n for(int it = 0; it<nodecount; it++){\r\n countdeg+= (double) adjList[it].countN;\r\n }\r\n countdeg = countdeg / (double) (nodecount);\r\n System.out.printf(\"%.2f\", countdeg);\r\n System.out.println();\r\n //long toc= System.nanoTime();\r\n //System.out.println((toc- startTime)/1000000000.0);\r\n }\r\n \r\n if(args[2].equals(\"rank\")){\r\n Graph.mergesort(sortVer, 0, nodecount-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n System.out.print(sortVer[0].val);\r\n for(int kk=1; kk<nodecount; kk++){\r\n System.out.print(\",\" + sortVer[kk].val.toString());\r\n }\r\n System.out.println();\r\n }\r\n if(args[2].equals(\"independent_storylines_dfs\")){\r\n boolean visited[] = new boolean[nodecount];\r\n int ind = 0;\r\n ArrayList<ArrayList<Vertex>> comps = new ArrayList<ArrayList<Vertex>>();\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n visited[it1] = false;\r\n }\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n if (visited[it1] == false){\r\n ArrayList<Vertex> temp = new ArrayList<Vertex>();\r\n Graph.dfs(it1, visited, ind, adjList, temp);\r\n ind++;\r\n Graph.mergesort2(temp, 0, temp.size()-1);\r\n comps.add(temp);\r\n }\r\n }\r\n Graph.mergesort3(comps, 0, comps.size()-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n for(int a1 = 0; a1 < ind; a1++){\r\n System.out.print(comps.get(a1).get(0).val);\r\n for(int j1 = 1; j1<comps.get(a1).size(); j1++){\r\n System.out.print(\",\" + comps.get(a1).get(j1).val);\r\n }\r\n System.out.println();\r\n }\r\n }\r\n }", "@Test\n public void differentLinearGraphsTest() throws Exception {\n EventNode[] g1Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"d\" });\n\n EventNode[] g2Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"e\" });\n\n // ///////////////////\n // g1 and g2 are k-equivalent at first three nodes for k=1,2,3\n // respectively, but no further. Subsumption follows the same pattern.\n\n // \"INITIAL\" not at root:\n testKEqual(g1Nodes[0], g2Nodes[0], 1);\n testKEqual(g1Nodes[0], g2Nodes[0], 2);\n testKEqual(g1Nodes[0], g2Nodes[0], 3);\n testKEqual(g1Nodes[0], g2Nodes[0], 4);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 5);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 6);\n\n // \"a\" node at root:\n testKEqual(g1Nodes[1], g2Nodes[1], 1);\n testKEqual(g1Nodes[1], g2Nodes[1], 2);\n testKEqual(g1Nodes[1], g2Nodes[1], 3);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 4);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 5);\n\n // \"b\" node at root:\n testKEqual(g1Nodes[2], g2Nodes[2], 1);\n testKEqual(g1Nodes[2], g2Nodes[2], 2);\n testNotKEqual(g1Nodes[2], g2Nodes[2], 3);\n\n // \"c\" node at root:\n testKEqual(g1Nodes[3], g2Nodes[3], 1);\n testNotKEqual(g1Nodes[3], g2Nodes[3], 2);\n\n // \"d\" and \"e\" nodes at root:\n testNotKEqual(g1Nodes[4], g2Nodes[4], 1);\n }", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static <V> Graph<V> getMinimumSpanningTreePrim(Graph<V> graph) {\n V[] array = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[][] matrizCopia = new double[array.length][array.length]; //Se hace una copia del array. Sino, se modificaria en el grafo original.\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n matrizCopia[x][y] = matriz[x][y];\n }\n }\n\n boolean[] revisados = new boolean[array.length]; // Arreglo de booleanos que marca los valores por donde ya se paso.\n Set<V> conjuntoRevisados = new LinkedListSet<>(); //Conjunto donde se guardan los vertices por donde ya se paso\n Graph<V> nuevo = new AdjacencyMatrix<>(graph.isDirected(), true);\n\n if (array.length > 0) { // Grafo no vacio\n\n revisados[0] = true;\n conjuntoRevisados.put(array[0]);\n nuevo.addNode(array[0]);\n\n double menorArista = 50000;\n V verticeOrigen = null;\n V verticeDestino = null;\n\n while (conjuntoRevisados.size() != array.length) { // mientras hayan vertices sin revisar\n\n Iterator<V> it1 = conjuntoRevisados.iterator(); //Se recorren todos los vertices guardados\n while (it1.hasNext()) {\n\n V aux = it1.next();\n int posArray = buscarPosicion(aux, array);\n for (int x = 0; x < array.length; x++) {\n\n if (matrizCopia[posArray][x] != -1) { //Si existe arista\n //Si los 2 vertices no estan en el arbol, para evitar un ciclo\n if (!(conjuntoRevisados.isMember(aux) && conjuntoRevisados.isMember(array[x]))) {\n if (matrizCopia[posArray][x] < menorArista) {\n menorArista = matrizCopia[posArray][x];\n if (!graph.isDirected()) {\n matrizCopia[x][posArray] = -1;\n }\n verticeOrigen = aux;\n verticeDestino = array[x];\n }\n }\n }\n }\n }\n\n if (verticeOrigen != null) {\n if (!nuevo.contains(verticeDestino)) {\n nuevo.addNode(verticeDestino);\n if (!conjuntoRevisados.isMember(verticeDestino)) {\n conjuntoRevisados.put(verticeDestino);\n }\n revisados[buscarPosicion(verticeDestino, array)] = true;\n }\n nuevo.addEdge(verticeOrigen, verticeDestino, menorArista);\n\n verticeOrigen = null;\n menorArista = 50000;\n } else {\n for (int x = 0; x < array.length; x++) {\n if (revisados[x] == false) {\n conjuntoRevisados.put(array[x]);\n nuevo.addNode(array[x]);\n }\n }\n }\n }\n }\n return nuevo;\n }", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }", "boolean hasIsVertexOf();", "private static void search(graph M, graph D, Tuple[] h){\n\t\tint v = M.V[0];\n\t\tint q = 0; //q keeps track of the index in the Tuple array where a new tuple is placed\n\t\tfor(; q < h.length && h[q] != null; q++){\n\t\t\t;\t\t\t\n\t\t}\n\t\tfor(int i = 0; i < D.V.length; i++){\n\t\t\tint w = D.V[i];\n\t\t \tTuple t = new Tuple(v, w);\n\t\t\th[q] = t; //add a new tuple\n\t\t\tboolean OK = true;\n\t\t\tfor (int k = 0; k < M.V.length; k++){\n\t\t\t\tboolean shouldBreak = false;\n\t\t\t\tfor (int j = 0; j < M.V.length; j++){\n\t\t\t\t\tif (M.matrix[M.V[k]][M.V[j]] == 0){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tThis is part of the pseudo-code that I tried to incorporate\n\t\t\t\t\tI could not quite get it to work, I believe the problem is \n\t\t\t\t\tin the big if statement. Instead I wrote a different chunk of code\n\t\t\t\t\tthat determines in the th should be printed.\n\t\t\t\t\t*/\n// \t\t\t\t\tif ( (M.V[k] == v && searchH(M.V[j], h) != null) || (M.V[j] == v && searchH(M.V[k], h) != null) ){\n// \t\t\t\t\t\tif(D.matrix[searchH(M.V[k], h).y][searchH(M.V[j], h).y] == 0){\n// \t\t\t\t\t\t\tOK = false;\n// \t\t\t\t\t\t\tshouldBreak = true;\n// \t\t\t\t\t\t\tbreak;\n// \t\t\t\t\t\t}\n// \t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(shouldBreak == true){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OK == true){\n\t\t\t\tif(M.V.length == 1){\n\t\t\t\tboolean isGood = true;\n\t\t\t\t/*\n\t\t\t\tThis is what determines if h should be printed.\n\t\t\t\tEssentially it checks h against the adjacency matrices,\n\t\t\t\tand if the edges are present, it prints them out.\n\t\t\t\t*/\n\t\t\t\t\tfor(int g = 0; g < h.length && isGood == true; g++){\n\t\t\t\t\t\tfor(int f = g+1; f < h.length && isGood == true; f++){\n\t\t\t\t\t\t\tif(M.matrix[h[g].x][h[f].x] == 1 && D.matrix[h[g].y][h[f].y] == 0){\n\t\t\t\t\t\t\t\tisGood = false;\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\tif(isGood == true){\n\t\t\t\t\t\tSystem.out.println(printH(h));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tHere I rebuild the vertex arrays and attached them to a new graph\n\t\t\t\tfor use as an argument in the recursive call.\n\t\t\t\t*/\n\t\t\t\telse{\t\t\n\t\t\t\t\tint[] modelTemp = rebuildV(v, M.V);\n\t\t\t\t\tint[] dataTemp = rebuildV(D.V[i], D.V);\n\n\t\t\t\t\tTuple[] h2 = new Tuple[h.length];\n\t\t\t\t\tfor(int p = 0; p < h.length; p++){\n\t\t\t\t\t\th2[p] = h[p];\n\t\t\t\t\t}\n\t\t\t\t\tgraph M2 = new graph();\n\t\t\t\t\tgraph D2 = new graph();\n\t\t\t\t\t\n\t\t\t\t\tM2.V = modelTemp;\n\t\t\t\t\tD2.V = dataTemp;\n\t\t\t\t\tM2.matrix = M.matrix;\n\t\t\t\t\tD2.matrix = D.matrix;\n\t\t\t\t\t\n\t\t\t\t\t//recursive call\n\t\t\t\t\tsearch(M2, D2, h2);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected boolean tryToConnectNode(IWeightedGraph<GraphNode, WeightedEdge> graph, GraphNode node,\r\n\t\t\tQueue<GraphNode> nodesToWorkOn) {\r\n\t\tboolean connected = false;\r\n\r\n\t\tfor (GraphNode otherNodeInGraph : graph.getVertices()) {\r\n\t\t\t// End nodes can not have a edge towards another node and the target\r\n\t\t\t// node must not be itself. Also there must not already be an edge\r\n\t\t\t// in the graph.\r\n\t\t\t// && !graph.containsEdge(node, nodeInGraph) has to be added\r\n\t\t\t// or loops occur which lead to a crash. This leads to the case\r\n\t\t\t// where no\r\n\t\t\t// alternative routes are being stored inside the pathsToThisNode\r\n\t\t\t// list. This is because of the use of a Queue, which loses the\r\n\t\t\t// memory of which nodes were already connected.\r\n\t\t\tif (!node.equals(otherNodeInGraph) && !this.startNode.equals(otherNodeInGraph)\r\n\t\t\t\t\t&& !graph.containsEdge(node, otherNodeInGraph)) {\r\n\r\n\t\t\t\t// Every saved path to this node is checked if any of these\r\n\t\t\t\t// produce a suitable effect set regarding the preconditions of\r\n\t\t\t\t// the current node.\r\n\t\t\t\tfor (WeightedPath<GraphNode, WeightedEdge> pathToListNode : node.pathsToThisNode) {\r\n\t\t\t\t\tif (areAllPreconditionsMet(otherNodeInGraph.preconditions, node.getEffectState(pathToListNode))) {\r\n\t\t\t\t\t\tconnected = true;\r\n\r\n\t\t\t\t\t\taddEgdeWithWeigth(graph, node, otherNodeInGraph, new WeightedEdge(),\r\n\t\t\t\t\t\t\t\tnode.action.generateCost(this.goapUnit));\r\n\r\n\t\t\t\t\t\totherNodeInGraph.addGraphPath(pathToListNode,\r\n\t\t\t\t\t\t\t\taddNodeToGraphPath(graph, pathToListNode, otherNodeInGraph));\r\n\r\n\t\t\t\t\t\tnodesToWorkOn.add(otherNodeInGraph);\r\n\r\n\t\t\t\t\t\t// break; // TODO: Possible Change: If enabled then only\r\n\t\t\t\t\t\t// one Path from the currently checked node is\r\n\t\t\t\t\t\t// transferred to another node. All other possible Paths\r\n\t\t\t\t\t\t// will not be considered and not checked.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn connected;\r\n\t}", "@Test\n public void testShortestDistance2() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 3);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n List<Vertex> expectedPath = new ArrayList<>();\n expectedPath.add(v1);\n expectedPath.add(v2);\n expectedPath.add(v3);\n\n assertTrue(g.edge(e1));\n assertTrue(g.vertex(v1));\n\n v1.updateName(\"test\");\n assertEquals(\"test\", v1.name());\n\n assertEquals(expectedPath, g.shortestPath(v1, v3));\n }", "public static void main(String[] args) {\n\t\tVertex A = new Vertex(\"A\");\n\t\tVertex B = new Vertex(\"B\");\n\t\tVertex C = new Vertex(\"C\");\n\t\tVertex D = new Vertex(\"D\");\n\t\tVertex E = new Vertex(\"E\");\n\n\t\tA.adjacencies = new Edge[]{ new Edge(B, 10),\tnew Edge(C, 3) };\n\t\tB.adjacencies = new Edge[]{\tnew Edge(C, 1), \tnew Edge(D, 2)};\n\t\tC.adjacencies = new Edge[]{ new Edge(B, 4), \tnew Edge(D, 8),\tnew Edge(E, 2)};\n\t\tD.adjacencies = new Edge[]{ new Edge(E, 7)};\n\t\tE.adjacencies = new Edge[]{ new Edge(D, 9)};\n\t\tVertex[] vertices = { A,B,C,D,E };\n\t\t\n\t\tcomputePaths(A);\n\t\t\n\t\tfor (Vertex v : vertices)\n\t\t{\n\t\t System.out.println(\"Distance to \" + v + \": \" + v.minDistance);\n\t\t List<Vertex> path = getShortestPathTo(v);\n\t\t System.out.println(\"Path: \" + path);\n\t\t}\n\t}", "@Test\n public void getGraph1() throws Exception {\n try (final Graph g1 = dataset.getGraph(graph1).get()) {\n assertEquals(4, g1.size());\n\n assertTrue(g1.contains(alice, name, aliceName));\n assertTrue(g1.contains(alice, knows, bob));\n assertTrue(g1.contains(alice, member, null));\n assertTrue(g1.contains(null, name, secretClubName));\n }\n }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;" ]
[ "0.65393347", "0.65377915", "0.6490433", "0.64120257", "0.6406734", "0.63605", "0.6335511", "0.6320843", "0.6304001", "0.62634313", "0.62437826", "0.62361556", "0.61987144", "0.6196342", "0.6192406", "0.6158901", "0.6153992", "0.61360824", "0.6122647", "0.6118045", "0.60848093", "0.60806215", "0.60709685", "0.60654116", "0.6063961", "0.60388976", "0.60357904", "0.6022743", "0.6017506", "0.60096234", "0.60024434", "0.5995172", "0.5972513", "0.5967093", "0.5964176", "0.5963596", "0.5962598", "0.59622246", "0.5952986", "0.59512556", "0.59454", "0.594315", "0.5941475", "0.59387004", "0.5935361", "0.59332246", "0.5924305", "0.59214044", "0.5919179", "0.591389", "0.5911449", "0.5908547", "0.5906677", "0.5906047", "0.5897504", "0.58943355", "0.5893797", "0.5892583", "0.5892009", "0.588913", "0.58799803", "0.5877124", "0.5876617", "0.586918", "0.5863602", "0.5860124", "0.5847495", "0.58466595", "0.5829905", "0.5827799", "0.5825869", "0.5825274", "0.5819513", "0.580454", "0.5803211", "0.5801128", "0.5800488", "0.5782272", "0.57815796", "0.5779524", "0.5773694", "0.5771141", "0.5768683", "0.5767515", "0.57608426", "0.5759502", "0.5756174", "0.5748422", "0.57477254", "0.5744412", "0.5743781", "0.5743352", "0.5741306", "0.57371515", "0.57325786", "0.57322496", "0.5731586", "0.5728453", "0.57239056", "0.5720029" ]
0.58452255
68
calls Dijkstra's algorithm on another pair of vertices in a more complex graph and checks its results
@Test public void testPublic18() { Graph<Integer> graph= TestGraphs.testGraph5(); List<Integer> shortestPath= new ArrayList<Integer>(); assertEquals(13, graph.Dijkstra(250, 141, shortestPath)); assertEquals("250 351 132 141", TestGraphs.listToString(shortestPath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test public void testPublic14() {\n Graph<String> graph= TestGraphs.testGraph2();\n List<String> shortestPath= new ArrayList<String>();\n\n assertEquals(1, graph.Dijkstra(\"apple\", \"banana\", shortestPath));\n assertEquals(\"apple banana\", TestGraphs.listToString(shortestPath));\n\n assertEquals(2, graph.Dijkstra(\"apple\", \"cherry\", shortestPath));\n assertEquals(\"apple banana cherry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(3, graph.Dijkstra(\"apple\", \"date\", shortestPath));\n assertEquals(\"apple banana cherry date\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra(\"apple\", \"elderberry\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(5, graph.Dijkstra(\"apple\", \"fig\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(6, graph.Dijkstra(\"apple\", \"guava\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig guava\",\n TestGraphs.listToString(shortestPath));\n }", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "void dijkstra(int[][] graph){\r\n int dist[] = new int[rideCount];\r\n Boolean sptSet[] = new Boolean[rideCount];\r\n\r\n for(int i = 0; i< rideCount; i++){\r\n dist[i] = Integer.MAX_VALUE;\r\n sptSet[i] = false;\r\n }\r\n\r\n dist[0] = 0;\r\n\r\n for(int count = 0; count< rideCount -1; count++){\r\n int u = minWeight(dist, sptSet);\r\n sptSet[u] = true;\r\n for(int v = 0; v< rideCount; v++){\r\n if (!sptSet[v] && graph[u][v] != 0 && dist[u] + graph[u][v] < dist[v]){\r\n dist[v] = dist[u] + graph[u][v];\r\n }\r\n }\r\n }\r\n printSolution(dist);\r\n }", "public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "public static void liveDemo() {\n Scanner in = new Scanner( System.in );\n float srcTank1, srcTank2, destTank;\n int alternetPaths;\n Graph mnfld = new Graph();\n boolean runSearch = true;\n\n //might need to limit query results, too large maybe?\n //newnodes = JDBC.graphInformation(); //returns arraylist of nodes\n //mnfld.setPipes(newnodes); //set nodes to the manifold\n //JDBC.insertConnections(mnfld);\n\n//\t\t /*\n//\t\t\tfor (int i = 0; i < newnodes.length(); i++) { //length might be wrong\n//\t\t\t\t//need to look for way to add edges by looking for neighbor nodes i think\n//\t\t\t\t//loop through nodes and create Edges\n//\t\t\t\t//might need new query\n//\t\t\t\tnewedges.addEdge(node1,node2,cost);\n//\t\t\t}\n//\n//\t\t\tmnfld.setConnections(newedges);\n//\n//\t\t\tup to this point, graph should be global to Dijkstra and unused.\n//\t\t\tloop until user leaves page\n//\t\t\tget input from user for tanks to transfer\n//\t\t\tfind shortest path between both tanks\n//\t\t\tend loop\n//\t\t\tthis will change depending how html works so not spending any time now on it\n//\t\t*/\n //shortestPath.runTest();\n\n shortestPath.loadGraph( mnfld );\n while (runSearch) {\n // Gets user input\n System.out.print( \"First Source Tank: \" );\n srcTank1 = in.nextFloat();\n System.out.print( \"Second Source Tank: \" );\n srcTank2 = in.nextFloat();\n System.out.print( \"Destination Tank: \" );\n destTank = in.nextFloat();\n System.out.print( \"Desired Number of Alternate Paths: \" );\n alternetPaths = in.nextInt();\n\n // Prints outputs\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"True shortest with alt paths\" );\n Dijkstra.findAltPaths( mnfld, alternetPaths, srcTank1, destTank );\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering used connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), true );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Lineup Considering only open connections\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ), false );\n mnfld.getPipe( destTank ).printLine();\n mnfld.restoreDroppedConnections();\n\n Dijkstra.resetCosts( mnfld );\n System.out.println( \"Merge Lineup\" );\n Dijkstra.findMinPaths( mnfld, mnfld.getPipe( srcTank1 ) );\n System.out.println( \"\\t Original Lineup: \" );\n mnfld.getPipe( destTank ).printLine();\n System.out.println( \"\\t Merged Lineup: \" );\n Dijkstra.mergePaths( mnfld, srcTank2, mnfld.getPipe( destTank ).getPath(), mnfld.getPipe( destTank ) );\n System.out.print( \"\\nRun another search [1:Yes, 0:No] :: \" );\n if (in.nextInt() == 0) runSearch = false;\n else System.out.println( \"\\n\\n\\n\" );\n }\n\n\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "public static int QTDelHeuristic1 (Graph<Integer,String> h) {\n\t\tint count = 0;\r\n\t\tboolean isQT = false;\r\n\t\t//h = Copy(g);\r\n\t\t//boolean moreToDo = true;\r\n\t\t\r\n\t\tIterator<Integer> a;\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\r\n\t\twhile (isQT == false) {\r\n\t\t\tisQT = true;\r\n\t\t\ta= h.getVertices().iterator();\r\n\t\t\twhile(a.hasNext()){\r\n\t\t\t\tInteger A = a.next();\r\n\t\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\t\tb = h.getNeighbors(A).iterator();\r\n\t\t\t\twhile(b.hasNext()){\r\n\t\t\t\t\tInteger B = b.next();\r\n\t\t\t\t\tc = h.getNeighbors(B).iterator();\r\n\t\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\t\tif (h.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\t\td = h.getNeighbors(C).iterator();\r\n\t\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\t\tisQT = false;\r\n\t\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t\t// requires 2 deletions\r\n\t\t\t\t\t\t\t\tcount += 2;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 2 + QTDelHeuristic1(h);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcount += 1;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 1 + QTDelHeuristic1(h);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\t\t\r\n\t\treturn count;\t\t\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "public Dijkstra(Graph graph, int firstVertexPortNum)\n {\n this.graph = graph;\n Set<String> vertexKeys = this.graph.vertexKeys();\n \n this.initialVertexPortNum = firstVertexPortNum;\n this.predecessors = new HashMap<String, String>();\n this.distances = new HashMap<String, Integer>();\n this.availableVertices = new PriorityQueue<Vertex>(vertexKeys.size(), new Comparator<Vertex>()\n {\n // compare weights of these two vertices.\n public int compare(Vertex v1, Vertex v2)\n {\n \t// errors are here.\n int weightOne = Dijkstra.this.distances.get(v1.convertToString(v1.getVertexPortNum())); // distances stored by portnum in string form.\n int weightTwo = Dijkstra.this.distances.get(v2.convertToString(v2.getVertexPortNum())); // distances stored by portnum in string form.\n return weightOne - weightTwo; // return the modified weight of the two vertices.\n }\n });\n \n this.visitedVertices = new HashSet<Vertex>();\n \n // for each Vertex in the graph\n for(String key: vertexKeys)\n {\n this.predecessors.put(key, null);\n this.distances.put(key, Integer.MAX_VALUE); // assuming that the distance of this is infinity.\n }\n \n \n //the distance from the initial vertex to itself is 0\n this.distances.put(convertToString(initialVertexPortNum), 0); \n \n //and seed initialVertex's neighbors\n Vertex initialVertex = this.graph.getVertex(convertToString(initialVertexPortNum)); // converted portnum to String to make this work.\n ArrayList<Edge> initialVertexNeighbors = initialVertex.getSquad();\n for(Edge e : initialVertexNeighbors)\n {\n Vertex other = e.getNeighbor(initialVertex);\n this.predecessors.put(convertToString(other.getVertexPortNum()), convertToString(initialVertexPortNum));\n this.distances.put(convertToString(other.getVertexPortNum()), e.getWeight()); // converted portnum to String to make this work.\n this.availableVertices.add(other); // add to available vertices.\n }\n \n this.visitedVertices.add(initialVertex); // add to list of visited vertices.\n \n // apply Dijkstra's algorithm to the overlay.\n processOverlay();\n \n }", "boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "@Test\r\n\tpublic void test_Big_Graph() {\n\t\tweighted_graph g = new WGraph_DS();\r\n\t\tint size = 1000*1000;\r\n\t\tint ten=1;\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tg.addNode(i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tint dest=i;\r\n\t\t\tg.connect(size-2, i, 0.23); \r\n\r\n\t\t\tif(i<size-1){\r\n\t\t\t\tg.connect(i,++dest,0.78);\r\n\t\t\t}\r\n\t\t\tif(i%2==0&&i<size-2) {\r\n\t\t\t\tg.connect(i,2+dest,0.94);\r\n\t\t\t}\t\r\n\r\n\t\t\tif(ten==i&&(i%2==0)) {\r\n\t\t\t\tfor (int j =0 ; j <size; j++) {\r\n\t\t\t\t\tg.connect(ten, j,0.56);\r\n\t\t\t\t\tg.connect(ten-2, j, 0.4);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tten=ten*10;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t\tweighted_graph_algorithms algo = new WGraph_Algo();\r\n\t\talgo.init(g);\r\n\t\tassertTrue(algo.isConnected());\r\n\t\tassertEquals(algo.shortestPathDist(0, 999998),0.23);\r\n\t\tassertEquals(algo.shortestPathDist(0, 8),0.46);\r\n\t\tint expected2 []= {6,999998,8};\r\n\t\tint actual2 [] = new int [3];\r\n\t\tint i=0;\r\n\t\tfor(node_info n :algo.shortestPath(6, 8)) {\r\n\t\t\tactual2[i++]=n.getKey();\r\n\t\t}\r\n\t\tassertArrayEquals(expected2,actual2);\r\n\r\n\t}", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }", "public static void main(String[] args) {\n Digraph grph = new Digraph(5);\n grph.addEdge(0, 1);\n grph.addEdge(1, 2);\n grph.addEdge(2, 3);\n BreadthFirstDirectedPaths path1 = new BreadthFirstDirectedPaths(grph, 0);\n BreadthFirstDirectedPaths path2 = new BreadthFirstDirectedPaths(grph, 0);\n int len = -1;\n for (int i = 0; i < grph.V(); i++) {\n if (path1.hasPathTo(i) && path2.hasPathTo(i)) {\n if (len == -1) {\n len = path1.distTo(i);\n }\n if (path1.distTo(i) > len) {\n len = path1.distTo(i);\n }\n }\n }\n }", "public static ArrayList<edges<String, Double>> Dijkstra(String CHAR1, String CHAR2, graph<String,Float> g) {\n\t\tPriorityQueue<ArrayList<edges<String, Double>>> active = \n\t\t\tnew PriorityQueue<ArrayList<edges<String, Double>>>(10,new Comparator<ArrayList<edges<String, Double>>>() {\n\t\t\t\tpublic int compare(ArrayList<edges<String, Double>> path1, ArrayList<edges<String, Double>> path2) {\n\t\t\t\t\tedges<String, Double> dest1 = path1.get(path1.size() - 1);\n\t\t\t\t\tedges<String, Double> dest2 = path2.get(path2.size() - 1);\n\t\t\t\t\tif (!(dest1.getLabel().equals(dest2.getLabel())))\n\t\t\t\t\t\treturn dest1.getLabel().compareTo(dest2.getLabel());\n\t\t\t\t\treturn path1.size() - path2.size();\n\t\t\t\t}\n\t\t\t});\n\t\t\tSet<String> known = new HashSet<String>();\n\t\t\tArrayList<edges<String, Double>> begin = new ArrayList<edges<String, Double>>();\n\t\t\tbegin.add(new edges<String, Double>(CHAR1, 0.0));\n\t\t\tactive.add(begin);\t\t\n\t\t\twhile (!active.isEmpty()) {\n\t\t\t\tArrayList<edges<String, Double>> minPath = active.poll();\n\t\t\t\tedges<String, Double> endOfMinPath = minPath.get(minPath.size() - 1);\n\t\t\t\tString minDest = endOfMinPath.getDest();\n\t\t\t\tdouble minCost = endOfMinPath.getLabel();\n\t\t\t\tif (minDest.equals(CHAR2)) {\n\t\t\t\t\treturn minPath;\n\t\t\t\t}\n\t\t\t\tif (known.contains(minDest))\n\t\t\t\t\tcontinue;\n\t\t\t\tSet<edges<String,Float>> children = g.childrenOf(minDest);\n\t\t\t\tfor (edges<String, Float> e : children) {\n\t\t\t\t\tif (!known.contains(e.getDest())) {\n\t\t\t\t\t\tdouble newCost = minCost + e.getLabel();\n\t\t\t\t\t\tArrayList<edges<String, Double>> newPath = new ArrayList<edges<String, Double>>(minPath); \n\t\t\t\t\t\tnewPath.add(new edges<String, Double>(e.getDest(), newCost));\n\t\t\t\t\t\tactive.add(newPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tknown.add(minDest);\n\t\t\t}\n\t\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "public void testDijkstra() {\n \t\tfinal Dijkstra model = new Dijkstra();\n \t\tfinal Formula noDeadlocks = model.dijkstraPreventsDeadlocksAssertion();\n \t\tfinal Solution sol = solve(noDeadlocks, model.bounds(6,6,6));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 4344 18609\n //\t\tprimary variables: 444\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(444, sol.stats().primaryVariables());\n \t\tassertEquals(4344, sol.stats().variables());\n\t\tassertEquals(18609, sol.stats().clauses());\n \t}", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "public void dijkstraAllPairs(boolean print) {\r\n int numSuccesses = 0;\r\n long totalTimeSuccesses = 0;\r\n if (print) System.out.println(\"Paths between all pairs of vertices using Dijkstra's algorithm:\");\r\n for (int i = 0; i < location.size(); i++) {\r\n for (int j = i+1; j < location.size(); j++) {\r\n long startTime = System.nanoTime();\r\n ArrayList<Vertex> pathIJ = dijkstraPath(i, j);\r\n long endTime = System.nanoTime();\r\n if (!pathIJ.isEmpty()) {\r\n numSuccesses++;\r\n totalTimeSuccesses += (endTime - startTime);\r\n }\r\n if (print) System.out.println(\"I = \" + i + \" J = \" + j + \" : \" + pathIJ.toString());\r\n }\r\n }\r\n System.out.println(\"Dijkstra's algorithm is successfull \" + numSuccesses + \"/\" + location.size()*(location.size()-1)/2 + \" times.\");\r\n if (numSuccesses != 0) {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is \" + totalTimeSuccesses/numSuccesses + \" nanoseconds.\");\r\n } else {\r\n System.out.println(\"The average time taken by Dijkstra's algorithm on successful runs is N/A nanoseconds.\");\r\n }\r\n System.out.println(\"\");\r\n }", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "public ArrayList<Integer> path2Dest(int s, int t, int k, int method){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n d[s] = 0;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n int extractedVertex = minHeap.extractMin();\n\n if(extractedVertex==t) {\n break;\n }\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey =0;\n double currentKey=0;\n if(method==1) { //method 1\n newKey = d[extractedVertex] + edge.weight;\n currentKey = d[destination];\n }\n else{ //method 2\n newKey = d[extractedVertex] + edge.weight + coor[destination].distTo(coor[t])-coor[extractedVertex].distTo(coor[t]);\n currentKey = d[destination];\n }\n if(currentKey>=newKey){\n if(currentKey==newKey){ //if equal need to compare the value of key\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n //trace back the path using parent properties\n ArrayList<Integer> path = new ArrayList<>();\n if(parent[t]!=-1){\n path.add(t);\n while(parent[t]!= s) {\n path.add(0,parent[t]);\n t = parent[t];\n }\n path.add(0,s);\n }\n else\n path = null;\n return path;\n }", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "public Dijkstra(Grafo<K, Integer> grafo, Vertice<K, Integer> vertOrigem) {\n\t\t\n\t\tthis.vertices = grafo.getVertices();\n\t\tthis.vertOrigem = vertOrigem;\n\t\t\n\t\tint total = vertices.size();\n\t\tboolean visitado[] = new boolean[total];\n\t\tthis.solucao = new Object[total][2]; // [0] = distancia [1] = vertice adjacente\n\t\t\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tsolucao[i][0] = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint vIndex = vertices.indexOf(vertOrigem);\n\t\tsolucao[vIndex][0] = 0;\n\t\tsolucao[vIndex][1] = vertOrigem;\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tVertice<K, Integer> y = null;\n\t\t\t\n\t\t\tfor (int z = 0; z < total; z++) {\n\t\t\t\tif (visitado[z]) continue;\n\t\t\t\tif ((Integer)solucao[z][0] < min) {\n\t\t\t\t\tmin = (Integer)solucao[z][0];\n\t\t\t\t\ty = vertices.get(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (min == Integer.MAX_VALUE) break;\n\t\t\t\n\t\t\tint yIndex = vertices.indexOf(y);\n\t\t\t\n\t\t\tList<Aresta<K, Integer>> arestas = y.getArestas();\n\t\t\tfor (Aresta<K, Integer> a:arestas) {\n\t\t\t\t\n\t\t\t\tVertice<K, Integer> w = a.getVertices()[0];\n\t\t\t\tint wIndex = vertices.indexOf(w);\n\t\t\t\tif (visitado[wIndex]) continue;\n\t\t\t\t\n\t\t\t\tif ((Integer)solucao[yIndex][0] + a.getValor() < (Integer)solucao[wIndex][0]) {\n\t\t\t\t\tsolucao[wIndex][0] = (Integer)solucao[yIndex][0] + a.getValor();\n\t\t\t\t\tsolucao[wIndex][1] = y;\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tvisitado[yIndex] = true;\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void compare_with_dijkstra(Weighting w) {\n final long seed = System.nanoTime();\n final int numQueries = 1000;\n\n Random rnd = new Random(seed);\n int numNodes = 100;\n GHUtility.buildRandomGraph(graph, rnd, numNodes, 2.2, true, speedEnc, null, 0.8, 0.8);\n GHUtility.addRandomTurnCosts(graph, seed, null, turnCostEnc, maxTurnCosts, turnCostStorage);\n\n long numStrictViolations = 0;\n for (int i = 0; i < numQueries; i++) {\n int source = rnd.nextInt(numNodes);\n int target = rnd.nextInt(numNodes);\n Path dijkstraPath = new Dijkstra(graph, w, TraversalMode.EDGE_BASED).calcPath(source, target);\n Path path = calcPath(source, target, ANY_EDGE, ANY_EDGE, w);\n assertEquals(dijkstraPath.isFound(), path.isFound(), \"dijkstra found/did not find a path, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n assertEquals(dijkstraPath.getWeight(), path.getWeight(), 1.e-6, \"weight does not match dijkstra, from: \" + source + \", to: \" + target + \", seed: \" + seed);\n // we do not do a strict check because there can be ambiguity, for example when there are zero weight loops.\n // however, when there are too many deviations we fail\n if (\n Math.abs(dijkstraPath.getDistance() - path.getDistance()) > 1.e-6\n || Math.abs(dijkstraPath.getTime() - path.getTime()) > 10\n || !dijkstraPath.calcNodes().equals(path.calcNodes())) {\n numStrictViolations++;\n }\n }\n if (numStrictViolations > Math.max(1, 0.05 * numQueries)) {\n fail(\"Too many strict violations, seed: \" + seed + \" - \" + numStrictViolations + \" / \" + numQueries);\n }\n }", "@Test\n public void testDijkstra() throws Exception {\n String graphFileName = \"algorithm/graph/shortestpath/weighted/weightedGraph.txt\";\n Graph graph = Graph.createGraphFromFile(WeightedShortestPath.class.getResource(\"/\").getPath() + File.separator +\n graphFileName);\n\n System.out.println(\"==============Graph before weighted shortest path found==============\");\n graph.printGraph();\n\n WeightedShortestPath.dijkstra(graph, graph.getVertex(\"v1\"));\n System.out.println(\"======Graph after weighted shortest path found by Dijkstra's algorithm=====\");\n graph.printGraph();\n\n System.out.println(\"===================Print the path to each vertex====================\");\n for (Vertex v: graph.getVertexMap().values()) {\n graph.printPath(v);\n System.out.println();\n }\n System.out.println();\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "public static void main(String[] args) {\n\t\tint[][] edges = {{0,1},{1,2},{1,3},{4,5}};\n\t\tGraph graph = createAdjacencyList(edges, true);\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) unDirected : \"+getNumberOfConnectedComponents(graph));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency List) Directed: \"+getNumberOfConnectedComponents(createAdjacencyList(edges, false)));\n\t\t\n\t\t//Shortest Distance & path\n\t\tint[][] edgesW = {{0,1,1},{1,2,4},{2,3,1},{0,3,3},{0,4,1},{4,3,1}};\n\t\tgraph = createAdjacencyList(edgesW, true);\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(graph, 0, 3));\n\t\t\n\t\t//Graph represented in Adjacency Matrix\n\t\tint[][] adjacencyMatrix = {{0,1,0,0,1,0},{1,0,1,1,0,0},{0,1,0,1,0,0},{0,1,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};\n\t\t\n\t\t// Connected components or Friends circle\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Recursive: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\t\tSystem.out.println(\"Number of connected graphs(Adjacency Matrix) unDirected Iterative: \"+getNumberOfConnectedComponents(adjacencyMatrix));\n\n\t\tSystem.out.println(\"Shortest distance : \"+ getShortestDistance(adjacencyMatrix, 0, 3));\n\t\t\n\t\t// Number of Islands\n\t\tint[][] islandGrid = {{1,1,0,1},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Recursive: \"+ getNumberOfIslands(islandGrid));\n\t\t// re-initialize\n\t\tint[][] islandGridIterative = {{1,1,0,0},{0,1,0,0},{0,0,1,1},{0,1,1,0}};\n\t\tSystem.out.println(\"Number of islands Iterative: \"+ getNumberOfIslandsIterative(islandGridIterative));\n\n\n\t}", "public boolean connectsVertex(V v);", "@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }", "public static void main(String[] args) {\n int vertices = Integer.parseInt(StdIn.readLine());\n //Storing vertex weights\n double[] vertW = new double[vertices];\n for(int i=0;i<vertices;i++)\n vertW[i] = Double.parseDouble(StdIn.readLine());\n //Reading in new graph, G**\n String[] Gstarstar = StdIn.readAllLines();\n //Making graph\n EdgeWeightedDigraph G = new EdgeWeightedDigraph(Gstarstar);\n //Dijkstra All Pairs\n DijkstraAllPairsSP DAP = new DijkstraAllPairsSP(G);\n //Printing output of paths\n for(int i=0; i<G.V(); i++){\n for(int j=0; j<G.V(); j++){\n if(!DAP.hasPath(i,j))\n StdOut.print(i+\" to \"+j+\"\\t\\tno path\");\n else{\n double newEW;\n double EW;\n Iterable<DirectedEdge> path = DAP.path(i,j);\n double totalWeight = 0;\n String sp = \"\"; //String that's going to form the path\n for(DirectedEdge x : path){\n newEW = x.weight();\n EW = newEW + vertW[x.to()] - vertW[x.from()]; //reverse calibrate\n totalWeight += EW;\n sp += \"\\t\"+x.from()+\"->\"+x.to()+\" \"+String.format(\"%.2f\",EW); //adding to path\n }\n StdOut.print(i+\" to \"+j+\"\\t(\"+String.format(\"%.2f\",totalWeight)+\") \");\n StdOut.print(sp);\n }\n StdOut.println();\n }\n StdOut.println();\n }\n }", "public Square[] buildPath(GameBoard board, Player player) {\n\n // flag to check if we hit a goal location\n boolean goalVertex = false;\n\n // Queue of vertices to be checked\n Queue<Vertex> q = new LinkedList<Vertex>();\n\n // set each vertex to have a distance of -1\n for ( int i = 0; i < graph.length; i++ )\n graph[i] = new Vertex(i,-1);\n\n // get the start location, i.e. the player's location\n Vertex start = \n squareToVertex(board.getPlayerLoc(player.getPlayerNo()));\n start.dist = 0;\n q.add(start);\n\n // while there are still vertices to check\n while ( !goalVertex ) {\n\n // get the vertex and remove it;\n // we don't want to look at it again\n Vertex v = q.remove();\n\n // check if this vertex is at a goal row\n switch ( player.getPlayerNo() ) {\n case 0: if ( v.graphLoc >= 72 ) \n goalVertex = true; break;\n case 1: if ( v.graphLoc <= 8 ) \n goalVertex = true; break;\n case 2: if ( (v.graphLoc+1) % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n case 3: if ( v.graphLoc % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n }\n\n // if we're at a goal vertex, we don't need to calculate\n // its neighboors\n if ( !goalVertex ) {\n\n // retrieve all reachable ajacencies\n Square[] adjacencies = reachableAdjacentSquares\n (board, vertexToSquare(v, board), player.getPlayerNo());\n\n // for each adjacency...\n for ( Square s : adjacencies ) {\n\n // convert to graph location\n Vertex adjacent = squareToVertex(s); \n\n // modify the vertex if it hasn't been modified\n if ( adjacent.dist < 0 ) {\n adjacent.dist = v.dist+1;\n adjacent.path = v;\n q.add(adjacent);\n }\n }\n\n }\n else\n return returnPath(v,board);\n \n }\n // should never get here\n return null;\n }", "public void floyd(TripartiteGraph graph) throws Exception\n\t{\n\t\tint size = graph.numNodes();\n\t\tSparseMatrix matrix = (SparseMatrix) graph.matrix();\n\t\t// initialize dist\n\t\tfor (int i = 0; i < size; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t{\n\t\t\t\tif (!matrix.containRowCol(i, j))\n\t\t\t\t\tdist[i][j] = INF;\n\t\t\t\telse\n\t\t\t\t\tdist[i][j] = (int) matrix.at(i, j);\n\t\t\t}\n\t\t}\n\t\tfor (int k = 0; k < size; k++)\n\t\t{\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < size; j++)\n\t\t\t\t{\n\t\t\t\t\tif (dist[i][k] != INF && dist[k][j] != INF\n\t\t\t\t\t\t\t&& dist[i][k] + dist[k][j] < dist[i][j])\n\t\t\t\t\t{\n\t\t\t\t\t\tdist[i][j] = dist[i][k] + dist[k][j];\n\t\t\t\t\t\tpath.set(i, j, k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n generateAndSaveExampleGraph();\n\n\n /*\n * select graph for prepairing and handling by algorhytm\n * determine graph source from config.xml:\n * config case = ?\n * 1 - from matrix\n * 2 - from edges list\n * 3 - from xml\n * */\n //read configCase\n Integer configCase = 0;\n try {\n configCase = (Integer) XMLSerializer.read( \"config.xml\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n //determine case\n EuclidDirectedGraph graph = null;\n switch (configCase){\n case 1:\n graph = getGraphFromMatrix();\n break;\n case 2:\n graph = getGraphFromEdgesList();\n break;\n case 3:\n graph = getGraphFromXML();\n break;\n default:\n return;\n\n }\n //find all sources and sinks\n ArrayList<BoundsGraphVertex> sources = new ArrayList<>();\n ArrayList<BoundsGraphVertex> sinks = new ArrayList<>();\n //get all sources and sinks\n for (Map.Entry<BoundsGraphVertex, Map<BoundsGraphVertex, Double>> vertexEntry : graph.getMap().entrySet()) {\n //if there are no edges from vertex then its sink\n if (vertexEntry.getValue().isEmpty()) {\n sinks.add(vertexEntry.getKey());\n } else {\n //mark all vertexes which have incoming edges\n for (BoundsGraphVertex dest : vertexEntry.getValue().keySet()) {\n dest.setMarked(true);\n }\n }\n }\n //all unmarked vertexes are sources\n for (BoundsGraphVertex vertex : graph) {\n if (!vertex.isMarked()) sources.add(vertex);\n }\n\n /*\n * First algorithm: for each source-sink pair get path using euclid heuristics\n * */\n List<BoundsGraphVertex> minPath = null;\n Double minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n for (BoundsGraphVertex sink :\n sinks) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathWithHeuristics(graph, source, sink, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n\n }\n }\n\n /*\n * Second algorithm: for each source get better sink\n * */\n minPath = null;\n minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathToManySinks(graph, source, sinks, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n }\n try {\n XMLSerializer.write(minPath, \"output.xml\", false);\n XMLSerializer.write(minLength, \"output.xml\", true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static <V> Dictionary<V, DijkstraResult<V>> getShortestPathDijkstra(Graph<V> graph, V value) {\n V[] vertices = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[] distancias = new double[vertices.length];\n V[] camino = (V[]) new Object[vertices.length];\n int pos = buscarPosicion(value, vertices);\n\n for (int x = 0; x < vertices.length; x++) { // Se llenan los arreglos con la informacion de sus adyacentes.\n if (pos == x) {\n distancias[x] = 0;\n camino[x] = null;\n } else {\n if (matriz[pos][x] == -1) {\n distancias[x] = Integer.MAX_VALUE - 1;\n camino[x] = vertices[pos];\n } else {\n distancias[x] = matriz[pos][x];\n camino[x] = vertices[pos];\n }\n }\n }\n\n Set<V> revisados = new LinkedListSet<>();\n revisados.put(value);\n while (revisados.size() < vertices.length) {\n double menor = Integer.MAX_VALUE;\n V actual = null;\n for (int x = 0; x < vertices.length; x++) {\n if (distancias[x] < menor) {\n if (!revisados.isMember(vertices[x])) {\n menor = distancias[x];\n actual = vertices[x];\n }\n }\n }\n\n pos = buscarPosicion(actual, vertices);\n for (int x = 0; x < vertices.length; x++) { // Se recorre la matriz para buscar adyacencias.\n if (matriz[pos][x] != -1) { // Si existe arist\n if (menor + matriz[pos][x] < distancias[x]) {\n distancias[x] = menor + matriz[pos][x];\n camino[x] = actual;\n }\n }\n }\n revisados.put(actual);\n }\n Dictionary<V, DijkstraResult<V>> diccionario = new Hashtable<>();\n for (int x = 0; x < vertices.length; x++) {\n DijkstraResult<V> aux = new DijkstraResult<>(vertices[x], camino[x], distancias[x]);\n diccionario.put(vertices[x], aux);\n }\n return diccionario;\n }", "@Test\n public void testDistantPoints() {\n // OK with 1000 visited nodes:\n MapMatching mapMatching = new MapMatching(hopper, algoOptions);\n List<GPXEntry> inputGPXEntries = createRandomGPXEntries(\n new GHPoint(51.23, 12.18),\n new GHPoint(51.45, 12.59));\n MatchResult mr = mapMatching.doWork(inputGPXEntries);\n\n assertEquals(57650, mr.getMatchLength(), 1);\n assertEquals(2747796, mr.getMatchMillis(), 1);\n\n // not OK when we only allow a small number of visited nodes:\n AlgorithmOptions opts = AlgorithmOptions.start(algoOptions).maxVisitedNodes(1).build();\n mapMatching = new MapMatching(hopper, opts);\n try {\n mr = mapMatching.doWork(inputGPXEntries);\n fail(\"Expected sequence to be broken due to maxVisitedNodes being too small\");\n } catch (RuntimeException e) {\n assertTrue(e.getMessage().startsWith(\"Sequence is broken for submitted track\"));\n }\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Test\n public void testShortestPathEstacoes() {\n completeMap = new Graph(false);\n incompleteMap = new Graph(false);\n\n completeMap.insertVertex(porto);\n Company.getParkRegistry().getParkMap().put(porto, portoL);\n completeMap.insertVertex(braga);\n Company.getParkRegistry().getParkMap().put(braga, bragaL);\n completeMap.insertVertex(vila);\n Company.getParkRegistry().getParkMap().put(vila, vilaL);\n completeMap.insertVertex(aveiro);\n Company.getParkRegistry().getParkMap().put(aveiro, aveiroL);\n completeMap.insertVertex(coimbra);\n Company.getParkRegistry().getParkMap().put(coimbra, coimbraL);\n completeMap.insertVertex(leiria);\n Company.getParkRegistry().getParkMap().put(leiria, leiriaL);\n\n completeMap.insertVertex(viseu);\n Company.getParkRegistry().getParkMap().put(viseu, viseuL);\n completeMap.insertVertex(guarda);\n Company.getParkRegistry().getParkMap().put(guarda, guardaL);\n completeMap.insertVertex(castelo);\n Company.getParkRegistry().getParkMap().put(castelo, casteloL);\n completeMap.insertVertex(lisboa);\n Company.getParkRegistry().getParkMap().put(lisboa, lisboaL);\n completeMap.insertVertex(faro);\n Company.getParkRegistry().getParkMap().put(faro, faroL);\n\n completeMap.insertEdge(porto, aveiro, c, 75);\n completeMap.insertEdge(porto, braga, c2, 60);\n completeMap.insertEdge(porto, vila, c3, 100);\n completeMap.insertEdge(viseu, guarda, c4, 75);\n completeMap.insertEdge(guarda, castelo, c5, 100);\n completeMap.insertEdge(aveiro, coimbra, c6, 60);\n completeMap.insertEdge(coimbra, lisboa, c7, 200);\n completeMap.insertEdge(coimbra, leiria, c8, 80);\n completeMap.insertEdge(aveiro, leiria, c9, 120);\n completeMap.insertEdge(leiria, lisboa, c10, 150);\n\n completeMap.insertEdge(aveiro, viseu, c11, 85);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n completeMap.insertEdge(lisboa, faro, c13, 280);\n\n incompleteMap = completeMap.clone();\n\n incompleteMap.removeEdge(aveiro, viseu);\n incompleteMap.removeEdge(leiria, castelo);\n incompleteMap.removeEdge(lisboa, faro);\n\n System.out.println(\"Test of shortest path\");\n\n LinkedList<String> shortPath = new LinkedList<>();\n double lenpath = 0;\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, l, shortPath);\n assertTrue(\"Length path should be 0 if vertex does not exist\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, porto, faro, shortPath);\n assertTrue(\"Length path should be 0 if there is no path\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, porto, shortPath);\n assertTrue(\"Number of nodes should be 1 if source and vertex are the same\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPath(incompleteMap, porto, lisboa, shortPath);\n assertTrue(\"Path between Porto and Lisboa should be 335 Km\", lenpath == 335);\n\n Iterator<String> it = shortPath.iterator();\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Lisboa\", it.next().equals(lisboa));\n completeMap.insertEdge(porto, lisboa, c, 10);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, braga, leiria, shortPath);\n assertEquals(\"Path between Braga and Leiria should be close to 152.89\", lenpath, 152, 1);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Braga\", it.next().equals(braga));\n assertTrue(\"then Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Leiria\", it.next().equals(leiria));\n\n shortPath.clear();\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, castelo, shortPath);\n assertEquals(\"Path between Porto and Castelo Branco should be close to 202.86\", lenpath, 202, 1);\n assertTrue(\"N. cities between Porto and Castelo Branco should be 5 \", shortPath.size() == 5);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Viseu\", it.next().equals(viseu));\n assertTrue(\"then Viseu\", it.next().equals(guarda));\n assertTrue(\"then Castelo Branco\", it.next().equals(castelo));\n\n //Changing Edge: aveiro-viseu with Edge: leiria-C.Branco \n //should change shortest path between porto and castelo Branco\n completeMap.removeEdge(aveiro, viseu);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n shortPath.clear();\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, castelo, shortPath);\n assertTrue(\"Path between Porto and Castelo Branco should now be 330 Km\", lenpath == 330);\n assertTrue(\"Path between Porto and Castelo Branco should be 4 cities\", shortPath.size() == 4);\n\n }", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static List<Vertex> doDijkstra(List<Vertex> vertexes) {\n\n\t\t// Zok, we have a graph constructed. Traverse.\n\t\tPriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(me);\n\t\tme.setMinDistance(0);\n\n\t\twhile (!vertexQueue.isEmpty()) {\n\t\t\tVertex v = vertexQueue.poll();\n\t\t\tdouble distance = v.getMinDistance() + 1;\n\n\t\t\tfor (Vertex neighbor : v.getAdjacencies()) {\n\t\t\t\tif (distance < neighbor.getMinDistance()) {\n\t\t\t\t\tneighbor.setMinDistance(distance);\n\t\t\t\t\tneighbor.setPrevious(v);\n\t\t\t\t\tvertexQueue.remove(neighbor);\n\t\t\t\t\tvertexQueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn vertexes;\n\t}", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "private ScheduleGrph initializeIdenticalTaskEdges(ScheduleGrph input) {\n\n\t\tScheduleGrph correctedInput = (ScheduleGrph) SerializationUtils.clone(input);\n\t\t// FORKS AND TODO JOINS\n\t\t/*\n\t\t * for (int vert : input.getVertices()) { TreeMap<Integer, List<Integer>> sorted\n\t\t * = new TreeMap<Integer, List<Integer>>(); for (int depend :\n\t\t * input.getOutNeighbors(vert)) { int edge = input.getSomeEdgeConnecting(vert,\n\t\t * depend); int weight = input.getEdgeWeightProperty().getValueAsInt(edge); if\n\t\t * (sorted.get(weight) != null) { sorted.get(weight).add(depend); } else {\n\t\t * ArrayList<Integer> a = new ArrayList(); a.add(depend); sorted.put(weight, a);\n\t\t * }\n\t\t * \n\t\t * } int curr = -1; for (List<Integer> l : sorted.values()) { for (int head : l)\n\t\t * {\n\t\t * \n\t\t * if (curr != -1) { correctedInput.addDirectedSimpleEdge(curr, head); } curr =\n\t\t * head; }\n\t\t * \n\t\t * } }\n\t\t */\n\n\t\tfor (int vert : input.getVertices()) {\n\t\t\tfor (int vert2 : input.getVertices()) {\n\t\t\t\tint vertWeight = input.getVertexWeightProperty().getValueAsInt(vert);\n\t\t\t\tint vert2Weight = input.getVertexWeightProperty().getValueAsInt(vert2);\n\n\t\t\t\tIntSet vertParents = input.getInNeighbors(vert);\n\t\t\t\tIntSet vert2Parents = input.getInNeighbors(vert2);\n\n\t\t\t\tIntSet vertChildren = input.getOutNeighbors(vert);\n\t\t\t\tIntSet vert2Children = input.getOutNeighbors(vert2);\n\n\t\t\t\tboolean childrenEqual = vertChildren.containsAll(vert2Children)\n\t\t\t\t\t\t&& vert2Children.containsAll(vertChildren);\n\n\t\t\t\tboolean parentEqual = vertParents.containsAll(vert2Parents) && vert2Parents.containsAll(vertParents);\n\n\t\t\t\tboolean inWeightsSame = true;\n\t\t\t\tfor (int parent : vertParents) {\n\t\t\t\t\tfor (int parent2 : vert2Parents) {\n\t\t\t\t\t\tif (parent == parent2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent, vert)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent2, vert2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!inWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tboolean outWeightsSame = true;\n\t\t\t\tfor (int child : vertChildren) {\n\t\t\t\t\tfor (int child2 : vert2Children) {\n\t\t\t\t\t\tif (child == child2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert, child)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert2, child2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!outWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tboolean alreadyEdge = correctedInput.areVerticesAdjacent(vert, vert2)\n\t\t\t\t\t\t|| correctedInput.areVerticesAdjacent(vert2, vert);\n\n\t\t\t\tif (vert != vert2 && vertWeight == vert2Weight && parentEqual && childrenEqual && inWeightsSame\n\t\t\t\t\t\t&& outWeightsSame && !alreadyEdge) {\n\t\t\t\t\tint edge = correctedInput.addDirectedSimpleEdge(vert, vert2);\n\t\t\t\t\tcorrectedInput.getEdgeWeightProperty().setValue(edge, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn correctedInput;\n\t}", "public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }", "public static void PrimsAlgorithm(WeightedGraph graph) {\n System.out.println(\"______________________________Prim's Algorithm(Priority Queue)_____________________________\\n\");\n ArrayList<Edge> mst = new ArrayList<>();\n // initialize an array that will keep track of which vertices have been visited\n boolean[] visited = new boolean[graph.getVertices()];\n // initialize a PriorityQueue \n PriorityQueue<Edge> priorityQueue = new PriorityQueue<>();\n // mark the initial vertex as visited\n visited[0] = true;\n\n // for every edge connected to the source, add it to the PriorityQueue \n for (int i = 0; i < graph.getAdjacencylist(0).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(0).get(i));\n }\n\n // keep adding edges until the PriorityQueue is empty\n while (!priorityQueue.isEmpty()) {\n Edge e = priorityQueue.remove();\n\n // if we have already visited the opposite vertex, go to the next edge\n if (visited[e.getDestination()]) {\n continue;\n }\n\n //mark the opposite vertex as visited\n visited[e.getDestination()] = true;\n //Add an edge to the minimum spanning tree\n mst.add(e);\n\n // for every edge connected to the opposite vertex, add it to the PriorityQueue\n for (int i = 0; i < graph.getAdjacencylist(e.getDestination()).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(e.getDestination()).get(i));\n }\n\n }\n\n // if we haven't visited all of the vertices, return \n for (int i = 1; i < graph.getVertices(); i++) {\n if (!visited[i]) {\n System.out.println(\"Error! the graph is not connected.\");\n return;\n }\n }\n\n }", "@Override\r\n\tpublic boolean isConnected(GraphStructure graph) {\r\n\t\tgetDepthFirstSearchTraversal(graph);\r\n\t\tif(pathList.size()==graph.getNumberOfVertices()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = sc.nextInt();\n\t\tint roadlines = sc.nextInt();\n\t\tsc.nextLine(); // for reading string in nextline\n\t\tEdgeWeightedGraph edge = new EdgeWeightedGraph(cities);\n\t\t// The Time Complexity is O(E)\n\t\t// The road lines is the number of edges\n\t\tfor (int i = 0; i < roadlines; i++) {\n\t\t\tString[] tokens = sc.nextLine().split(\" \");\n\t\t\tedge.addEdge(new Edge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]),\n\t\t\t\tDouble.parseDouble(tokens[2])));\n\t\t}\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t\tSystem.out.println(edge);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] input = sc.nextLine().split(\" \");\n\t\t\tDijkstraSP shortest = new DijkstraSP(\n edge, Integer.parseInt(input[0]));\n double distance = shortest.distTo(Integer.parseInt(input[1]));\n // The time complexity is O(1)\n if (!shortest.hasPathTo(Integer.parseInt(input[1]))) {\n \tSystem.out.println(\"No Path Found.\");\n } else {\n \tSystem.out.println(distance);\n }\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] str1 = sc.nextLine().split(\" \");\n\t\t\tboolean flag1 = false;\n\t\t\tboolean flag2 = false;\n\t\t\tdouble distance1 = 0.0;\n\t\t\tdouble distance2 = 0.0;\n\t\t\tDijkstraSP shortest1 = new DijkstraSP(edge, Integer.parseInt(str1[0]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest1.hasPathTo(Integer.parseInt(str1[1]))) {\n\t\t\t\tflag1 = true;\n\t\t\t\tdistance1 = shortest1.distance(Integer.parseInt(str1[1]));\n\t\t\t}\n\t\t\tDijkstraSP shortest2 = new DijkstraSP(edge, Integer.parseInt(str1[1]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest2.hasPathTo(Integer.parseInt(str1[2]))) {\n\t\t\t\tflag2 = true;\n\t\t\t\tdistance2 = shortest2.distance(Integer.parseInt(str1[2]));\n\t\t\t}\n\t\t\tdouble Distance = distance1 + distance2;\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (flag1 && flag2) {\n\t\t\t// Displays output upto 1 decimal point\n\t\t\tSystem.out.format(\"%.1f\", Distance);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n ArrayList<Integer> path = new ArrayList<>();\n for (Edge eachlink : shortest1.pathTo(Integer.parseInt(str1[1]))) {\n int either = eachlink.either();\n int other = eachlink.other(eachlink.either());\n if (!path.contains(other)) {\n path.add(other);\n }\n if (!path.contains(either)) {\n path.add(either);\n }\n }\n for (Edge eachlink1 : shortest2.pathTo(Integer.parseInt(str1[2]))) {\n int either1 = eachlink1.either();\n int other1 = eachlink1.other(eachlink1.either());\n if (!path.contains(other1)) {\n path.add(other1);\n }\n if (!path.contains(either1)) {\n path.add(either1);\n }\n }\n for (int everyval : path) {\n System.out.print(everyval + \" \");\n }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "@Test public void testPublic17() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(8, graph.Dijkstra(131, 141, shortestPath));\n assertEquals(\"131 330 132 141\", TestGraphs.listToString(shortestPath));\n }", "public static void djikstra(int[][] graph, int src) {\n\t\t/* output array */\n\t\tint[] dist = new int[graph.length];\n\t\tboolean[] visited = new boolean[graph.length];\n\n\t\tfor (int i = 0; i < graph.length; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE;\n\t\t\tvisited[i] = false;\n\t\t}\n\n\t\tdist[src] = 0;\n\n\t\tfor (int i = 0; i < graph.length - 1; i++) {\n\n\t\t\t// Pick the minimum distance vertex from the set of vertices not\n\t\t\t// yet processed. u is always equal to src in first iteration.\n\t\t\tint u = findMinDistanceVertex(dist, visited);\n\t\t\t// Mark the picked vertex as processed\n\t\t\tvisited[u] = true;\n\t\t\t\n\t\t\tfor(int j = 0; j < graph.length; j++) {\n\t\t\t\t\n\t\t\t\t// Update dist[v] only if is not in sptSet, there is an edge from \n\t\t // u to v, and total weight of path from src to v through u is \n\t\t // smaller than current value of dist[v]\n\t\t\t\tif(!visited[j] && graph[u][j] != 0\n\t\t\t\t\t\t&& dist[u] != Integer.MAX_VALUE\n\t\t\t\t\t\t&& dist[u] + graph[u][j] < dist[j]) {\n\t\t\t\t\tdist[j] = dist[u] + graph[u][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintSolution(dist, graph.length);\n\t}", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "@Test public void testPublic16() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(5, graph.Dijkstra(131, 351, shortestPath));\n assertEquals(\"131 330 351\", TestGraphs.listToString(shortestPath));\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "public static void main(String[] args) {\n\t\tint vertices = Integer.parseInt(args[0]);\n\t\tint edges = Integer.parseInt(args[1]);\n\t\tint seed = Integer.parseInt(args[2]);\n\t\tRandom random = new Random(seed);\n\n\t\tAdjMatrixEdgeWeightedDirectedGraph g = new AdjMatrixEdgeWeightedDirectedGraph(vertices);\n\t\tfor (int i = 0; i < edges; i++) {\n\t\t\tint v = random.nextInt(vertices);\n\t\t\tint w = random.nextInt(vertices);\n\t\t\tdouble weight = Math.round(100 * (random.nextDouble() - 0.15)) / 100.0;\n\t\t\tif (v == w) g.addEdge(new Edge(v, w, Math.abs(weight)));\n\t\t\telse g.addEdge(new Edge(v, w, weight));\n\t\t}\n\n\t\t// run Floyd-Warshall algorithm\n\t\tFloydWarshall spt = new FloydWarshall(g);\n\n\t\t// print all-pairs shortest path distances\n\t\tSystem.out.print(\" \");\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%6d \", v);\n\t\t}\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\tSystem.out.printf(\"%3d: \", v);\n\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\tif (spt.hasPath(v, w)) System.out.printf(\"%6.2f \", spt.dist(v, w));\n\t\t\t\telse System.out.printf(\" Inf \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// print negative cycle\n\t\tif (spt.hasNegativeCycle()) {\n\t\t\tSystem.out.println(\"Negative cost cycle:\");\n\t\t\tfor (int v : spt.negativeCycle()) System.out.println(v);\n\t\t\tSystem.out.println();\n\t\t// print all-pairs shortest paths\n\t\t} else {\n\t\t\tfor (int v = 0; v < g.V(); v++) {\n\t\t\t\tfor (int w = 0; w < g.V(); w++) {\n\t\t\t\t\tif (spt.hasPath(v, w)) {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d (%5.2f) \", v, w, spt.dist(v, w));\n\t\t\t\t\t\tfor (Edge e : spt.path(v, w)) System.out.print(e + \" \");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.printf(\"%d to %d no path\\n\", v, w);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }", "@Test\n void testShortestPathDist(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(Double.compare(45,ga.shortestPathDist(1,4)) == 0);\n assertEquals(0,ga.shortestPathDist(1,1));\n assertEquals(-1,ga.shortestPathDist(1,200));\n }", "public abstract Multigraph buildMatchedGraph();", "public static void main(String[] args) {\n\t\tString vertex=\"abcdefghij\";\n\t\tString edge=\"bdegachiabefbc\";\n\t\tchar[] vc=vertex.toCharArray();\n\t\tchar[] ec=edge.toCharArray();\n\t\tint[] v=new int[vc.length];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i]=vc[i]-'a'+1;\n\t\t}\n\t\tint[] e=new int[ec.length];\n\t\tfor (int i = 0; i < e.length; i++) {\n\t\t\te[i]=ec[i]-'a'+1;\n\t\t}\t\t\n\t\t\n\t\tDS_List ds_List=new DS_List(v.length);\n//\t\tfor (int i = 0; i < v.length; i++) {\n//\t\t\tds_List.make_set(v[i]);\n//\t\t}\n//\t\tfor (int i = 0; i < e.length; i=i+2) {\n//\t\t\tif (ds_List.find_set(e[i])!=ds_List.find_set(e[i+1])) {\n//\t\t\t\tds_List.union(e[i], e[i+1]);\n//\t\t\t}\n//\t\t}\n\t\tds_List.connect_components(v, e);\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tSystem.out.print(ds_List.find_set(v[i])+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(ds_List.same_component(v[1], v[2]));\n\t}", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "private void connectVertex(IndoorVertex indoorV1, IndoorVertex indoorV2)\n {\n XYPos firstPos = indoorV1.getPosition();\n XYPos secondPos = indoorV2.getPosition();\n\n //Change in only X position means that the vertex's are East/West of eachother\n //Change in only Y position means that the vertex's are North/South of eachother\n if(firstPos.getX() > secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addWestConnection(indoorV2);\n indoorV2.addEastConnection(indoorV1);\n }\n else if(firstPos.getX() < secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addEastConnection(indoorV2);\n indoorV2.addWestConnection(indoorV1);\n }\n else if(firstPos.getY() > secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addSouthConnection(indoorV2);\n indoorV2.addNorthConnection(indoorV1);\n }\n else if(firstPos.getY() < secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addNorthConnection(indoorV2);\n indoorV2.addSouthConnection(indoorV1);\n }\n\n\n indoorV1.addConnection(indoorV2);\n indoorV2.addConnection(indoorV1);\n }", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "public void calcSP(Graph g, Vertex source){\n // Algorithm:\n // 1. Take the unvisited node with minimum weight.\n // 2. Visit all its neighbours.\n // 3. Update the distances for all the neighbours (In the Priority Queue).\n // Repeat the process till all the connected nodes are visited.\n\n // clear existing info\n// System.out.println(\"Calc SP from vertex:\" + source.name);\n g.resetMinDistance();\n source.minDistance = 0;\n PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();\n queue.add(source);\n\n while(!queue.isEmpty()){\n Vertex u = queue.poll();\n for(Edge neighbour:u.neighbours){\n// System.out.println(\"Scanning vector: \"+neighbour.target.name);\n Double newDist = u.minDistance+neighbour.weight;\n\n // get new shortest path, empty existing path info\n if(neighbour.target.minDistance>newDist){\n // Remove the node from the queue to update the distance value.\n queue.remove(neighbour.target);\n neighbour.target.minDistance = newDist;\n\n // Take the path visited till now and add the new node.s\n neighbour.target.path = new ArrayList<>(u.path);\n neighbour.target.path.add(u);\n// System.out.println(\"Path\");\n// for (Vertex vv: neighbour.target.path) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n\n// System.out.println(\"Paths\");\n neighbour.target.pathCnt = 0;\n neighbour.target.paths = new ArrayList<ArrayList<Vertex>>();\n if (u.paths.size() == 0) {\n ArrayList<Vertex> p = new ArrayList<Vertex>();\n p.add(u);\n neighbour.target.paths.add(p);\n neighbour.target.pathCnt++;\n } else {\n for (ArrayList<Vertex> p : u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n// for (Vertex vv : p1) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n }\n\n //Reenter the node with new distance.\n queue.add(neighbour.target);\n }\n // get equal cost path, add into path list\n else if (neighbour.target.minDistance == newDist) {\n queue.remove(neighbour.target);\n for(ArrayList<Vertex> p: u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n queue.add(neighbour.target);\n }\n }\n }\n }", "@Test\r\n\tpublic void testInputA() {\r\n\t\t//where there is 2 vertices but only 1 edge\r\n\t\tCompetitionDijkstra map1 = new CompetitionDijkstra(\"input-A.txt\", 55,60,92);\r\n\t\tCompetitionFloydWarshall map2= new CompetitionFloydWarshall(\"input-A.txt\", 60,60,92);\r\n\t\tassertEquals(-1, map1.timeRequiredforCompetition());\r\n\t\tassertEquals(-1, map2.timeRequiredforCompetition()); \t\r\n\t}", "@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) throws IOException {\n File file = new File(args[0]);\r\n //FileOutputStream f = new FileOutputStream(\"prat_dfs_data2.txt\");\r\n //System.setOut(new PrintStream(f));\r\n BufferedReader reader = new BufferedReader(new FileReader(file));\r\n String line;\r\n line = reader.readLine();\r\n int nodecount = 0;\r\n HashMap <String , Integer> nodeMap = new HashMap <String , Integer>(); \r\n while ((line = reader.readLine()) != null ) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n if (!nodeMap.containsKey(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"))){\r\n nodeMap.put(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"), nodecount);\r\n nodecount++;\r\n }\r\n }\r\n reader.close();\r\n Vertex adjList[] = new Vertex[nodecount];\r\n Vertex sortVer[] = new Vertex[nodecount];\r\n for(int it = 0; it < nodecount; it++){\r\n adjList[it] = new Vertex(it);\r\n }\r\n nodeMap.forEach((k, v) -> adjList[v].val = k);\r\n File file2 = new File(args[1]);\r\n BufferedReader reader2 = new BufferedReader(new FileReader(file2));\r\n line = reader2.readLine();\r\n while ((line = reader2.readLine()) !=null) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n String source = data[0].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n String target = data[1].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n\r\n int weight = Integer.parseInt(data[2]);\r\n Vertex current = adjList[nodeMap.get(source)];\r\n Vertex newbie = new Vertex(nodeMap.get(target));\r\n current.countN++;\r\n current.co_occur += weight;\r\n if (adjList[nodeMap.get(source)].next == null){\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n else{\r\n current.next.prev = newbie;\r\n newbie.next = current.next;\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n Vertex current1 = adjList[nodeMap.get(target)];\r\n Vertex newbie1 = new Vertex(nodeMap.get(source));\r\n current1.co_occur += weight;\r\n current1.countN++;\r\n if (current1.next == null){\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n else{\r\n current1.next.prev = newbie1;\r\n newbie1.next = current1.next;\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n }\r\n reader2.close();\r\n \r\n for(int it = 0; it < nodecount; it++){\r\n sortVer[it] = new Vertex(adjList[it].id);\r\n sortVer[it].val = adjList[it].val;\r\n sortVer[it].co_occur = adjList[it].co_occur;\r\n }\r\n if (args[2].equals(\"average\")){\r\n double countdeg = 0;\r\n for(int it = 0; it<nodecount; it++){\r\n countdeg+= (double) adjList[it].countN;\r\n }\r\n countdeg = countdeg / (double) (nodecount);\r\n System.out.printf(\"%.2f\", countdeg);\r\n System.out.println();\r\n //long toc= System.nanoTime();\r\n //System.out.println((toc- startTime)/1000000000.0);\r\n }\r\n \r\n if(args[2].equals(\"rank\")){\r\n Graph.mergesort(sortVer, 0, nodecount-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n System.out.print(sortVer[0].val);\r\n for(int kk=1; kk<nodecount; kk++){\r\n System.out.print(\",\" + sortVer[kk].val.toString());\r\n }\r\n System.out.println();\r\n }\r\n if(args[2].equals(\"independent_storylines_dfs\")){\r\n boolean visited[] = new boolean[nodecount];\r\n int ind = 0;\r\n ArrayList<ArrayList<Vertex>> comps = new ArrayList<ArrayList<Vertex>>();\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n visited[it1] = false;\r\n }\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n if (visited[it1] == false){\r\n ArrayList<Vertex> temp = new ArrayList<Vertex>();\r\n Graph.dfs(it1, visited, ind, adjList, temp);\r\n ind++;\r\n Graph.mergesort2(temp, 0, temp.size()-1);\r\n comps.add(temp);\r\n }\r\n }\r\n Graph.mergesort3(comps, 0, comps.size()-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n for(int a1 = 0; a1 < ind; a1++){\r\n System.out.print(comps.get(a1).get(0).val);\r\n for(int j1 = 1; j1<comps.get(a1).size(); j1++){\r\n System.out.print(\",\" + comps.get(a1).get(j1).val);\r\n }\r\n System.out.println();\r\n }\r\n }\r\n }", "@Test\n public void differentLinearGraphsTest() throws Exception {\n EventNode[] g1Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"d\" });\n\n EventNode[] g2Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"e\" });\n\n // ///////////////////\n // g1 and g2 are k-equivalent at first three nodes for k=1,2,3\n // respectively, but no further. Subsumption follows the same pattern.\n\n // \"INITIAL\" not at root:\n testKEqual(g1Nodes[0], g2Nodes[0], 1);\n testKEqual(g1Nodes[0], g2Nodes[0], 2);\n testKEqual(g1Nodes[0], g2Nodes[0], 3);\n testKEqual(g1Nodes[0], g2Nodes[0], 4);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 5);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 6);\n\n // \"a\" node at root:\n testKEqual(g1Nodes[1], g2Nodes[1], 1);\n testKEqual(g1Nodes[1], g2Nodes[1], 2);\n testKEqual(g1Nodes[1], g2Nodes[1], 3);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 4);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 5);\n\n // \"b\" node at root:\n testKEqual(g1Nodes[2], g2Nodes[2], 1);\n testKEqual(g1Nodes[2], g2Nodes[2], 2);\n testNotKEqual(g1Nodes[2], g2Nodes[2], 3);\n\n // \"c\" node at root:\n testKEqual(g1Nodes[3], g2Nodes[3], 1);\n testNotKEqual(g1Nodes[3], g2Nodes[3], 2);\n\n // \"d\" and \"e\" nodes at root:\n testNotKEqual(g1Nodes[4], g2Nodes[4], 1);\n }", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static <V> Graph<V> getMinimumSpanningTreePrim(Graph<V> graph) {\n V[] array = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[][] matrizCopia = new double[array.length][array.length]; //Se hace una copia del array. Sino, se modificaria en el grafo original.\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n matrizCopia[x][y] = matriz[x][y];\n }\n }\n\n boolean[] revisados = new boolean[array.length]; // Arreglo de booleanos que marca los valores por donde ya se paso.\n Set<V> conjuntoRevisados = new LinkedListSet<>(); //Conjunto donde se guardan los vertices por donde ya se paso\n Graph<V> nuevo = new AdjacencyMatrix<>(graph.isDirected(), true);\n\n if (array.length > 0) { // Grafo no vacio\n\n revisados[0] = true;\n conjuntoRevisados.put(array[0]);\n nuevo.addNode(array[0]);\n\n double menorArista = 50000;\n V verticeOrigen = null;\n V verticeDestino = null;\n\n while (conjuntoRevisados.size() != array.length) { // mientras hayan vertices sin revisar\n\n Iterator<V> it1 = conjuntoRevisados.iterator(); //Se recorren todos los vertices guardados\n while (it1.hasNext()) {\n\n V aux = it1.next();\n int posArray = buscarPosicion(aux, array);\n for (int x = 0; x < array.length; x++) {\n\n if (matrizCopia[posArray][x] != -1) { //Si existe arista\n //Si los 2 vertices no estan en el arbol, para evitar un ciclo\n if (!(conjuntoRevisados.isMember(aux) && conjuntoRevisados.isMember(array[x]))) {\n if (matrizCopia[posArray][x] < menorArista) {\n menorArista = matrizCopia[posArray][x];\n if (!graph.isDirected()) {\n matrizCopia[x][posArray] = -1;\n }\n verticeOrigen = aux;\n verticeDestino = array[x];\n }\n }\n }\n }\n }\n\n if (verticeOrigen != null) {\n if (!nuevo.contains(verticeDestino)) {\n nuevo.addNode(verticeDestino);\n if (!conjuntoRevisados.isMember(verticeDestino)) {\n conjuntoRevisados.put(verticeDestino);\n }\n revisados[buscarPosicion(verticeDestino, array)] = true;\n }\n nuevo.addEdge(verticeOrigen, verticeDestino, menorArista);\n\n verticeOrigen = null;\n menorArista = 50000;\n } else {\n for (int x = 0; x < array.length; x++) {\n if (revisados[x] == false) {\n conjuntoRevisados.put(array[x]);\n nuevo.addNode(array[x]);\n }\n }\n }\n }\n }\n return nuevo;\n }", "@Test public void testPublic12() {\n Graph<Integer> graph= new Graph<Integer>();\n int i;\n\n // note this adds the adjacent vertices in the process\n for (i= 0; i < 10; i++)\n graph.addEdge(i, i + 1, 1);\n graph.addEdge(10, 0, 1);\n\n for (Integer vertex : graph.getVertices())\n assertTrue(graph.isInCycle(vertex));\n }", "public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }", "boolean hasIsVertexOf();", "private static void search(graph M, graph D, Tuple[] h){\n\t\tint v = M.V[0];\n\t\tint q = 0; //q keeps track of the index in the Tuple array where a new tuple is placed\n\t\tfor(; q < h.length && h[q] != null; q++){\n\t\t\t;\t\t\t\n\t\t}\n\t\tfor(int i = 0; i < D.V.length; i++){\n\t\t\tint w = D.V[i];\n\t\t \tTuple t = new Tuple(v, w);\n\t\t\th[q] = t; //add a new tuple\n\t\t\tboolean OK = true;\n\t\t\tfor (int k = 0; k < M.V.length; k++){\n\t\t\t\tboolean shouldBreak = false;\n\t\t\t\tfor (int j = 0; j < M.V.length; j++){\n\t\t\t\t\tif (M.matrix[M.V[k]][M.V[j]] == 0){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tThis is part of the pseudo-code that I tried to incorporate\n\t\t\t\t\tI could not quite get it to work, I believe the problem is \n\t\t\t\t\tin the big if statement. Instead I wrote a different chunk of code\n\t\t\t\t\tthat determines in the th should be printed.\n\t\t\t\t\t*/\n// \t\t\t\t\tif ( (M.V[k] == v && searchH(M.V[j], h) != null) || (M.V[j] == v && searchH(M.V[k], h) != null) ){\n// \t\t\t\t\t\tif(D.matrix[searchH(M.V[k], h).y][searchH(M.V[j], h).y] == 0){\n// \t\t\t\t\t\t\tOK = false;\n// \t\t\t\t\t\t\tshouldBreak = true;\n// \t\t\t\t\t\t\tbreak;\n// \t\t\t\t\t\t}\n// \t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(shouldBreak == true){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OK == true){\n\t\t\t\tif(M.V.length == 1){\n\t\t\t\tboolean isGood = true;\n\t\t\t\t/*\n\t\t\t\tThis is what determines if h should be printed.\n\t\t\t\tEssentially it checks h against the adjacency matrices,\n\t\t\t\tand if the edges are present, it prints them out.\n\t\t\t\t*/\n\t\t\t\t\tfor(int g = 0; g < h.length && isGood == true; g++){\n\t\t\t\t\t\tfor(int f = g+1; f < h.length && isGood == true; f++){\n\t\t\t\t\t\t\tif(M.matrix[h[g].x][h[f].x] == 1 && D.matrix[h[g].y][h[f].y] == 0){\n\t\t\t\t\t\t\t\tisGood = false;\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\tif(isGood == true){\n\t\t\t\t\t\tSystem.out.println(printH(h));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tHere I rebuild the vertex arrays and attached them to a new graph\n\t\t\t\tfor use as an argument in the recursive call.\n\t\t\t\t*/\n\t\t\t\telse{\t\t\n\t\t\t\t\tint[] modelTemp = rebuildV(v, M.V);\n\t\t\t\t\tint[] dataTemp = rebuildV(D.V[i], D.V);\n\n\t\t\t\t\tTuple[] h2 = new Tuple[h.length];\n\t\t\t\t\tfor(int p = 0; p < h.length; p++){\n\t\t\t\t\t\th2[p] = h[p];\n\t\t\t\t\t}\n\t\t\t\t\tgraph M2 = new graph();\n\t\t\t\t\tgraph D2 = new graph();\n\t\t\t\t\t\n\t\t\t\t\tM2.V = modelTemp;\n\t\t\t\t\tD2.V = dataTemp;\n\t\t\t\t\tM2.matrix = M.matrix;\n\t\t\t\t\tD2.matrix = D.matrix;\n\t\t\t\t\t\n\t\t\t\t\t//recursive call\n\t\t\t\t\tsearch(M2, D2, h2);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected boolean tryToConnectNode(IWeightedGraph<GraphNode, WeightedEdge> graph, GraphNode node,\r\n\t\t\tQueue<GraphNode> nodesToWorkOn) {\r\n\t\tboolean connected = false;\r\n\r\n\t\tfor (GraphNode otherNodeInGraph : graph.getVertices()) {\r\n\t\t\t// End nodes can not have a edge towards another node and the target\r\n\t\t\t// node must not be itself. Also there must not already be an edge\r\n\t\t\t// in the graph.\r\n\t\t\t// && !graph.containsEdge(node, nodeInGraph) has to be added\r\n\t\t\t// or loops occur which lead to a crash. This leads to the case\r\n\t\t\t// where no\r\n\t\t\t// alternative routes are being stored inside the pathsToThisNode\r\n\t\t\t// list. This is because of the use of a Queue, which loses the\r\n\t\t\t// memory of which nodes were already connected.\r\n\t\t\tif (!node.equals(otherNodeInGraph) && !this.startNode.equals(otherNodeInGraph)\r\n\t\t\t\t\t&& !graph.containsEdge(node, otherNodeInGraph)) {\r\n\r\n\t\t\t\t// Every saved path to this node is checked if any of these\r\n\t\t\t\t// produce a suitable effect set regarding the preconditions of\r\n\t\t\t\t// the current node.\r\n\t\t\t\tfor (WeightedPath<GraphNode, WeightedEdge> pathToListNode : node.pathsToThisNode) {\r\n\t\t\t\t\tif (areAllPreconditionsMet(otherNodeInGraph.preconditions, node.getEffectState(pathToListNode))) {\r\n\t\t\t\t\t\tconnected = true;\r\n\r\n\t\t\t\t\t\taddEgdeWithWeigth(graph, node, otherNodeInGraph, new WeightedEdge(),\r\n\t\t\t\t\t\t\t\tnode.action.generateCost(this.goapUnit));\r\n\r\n\t\t\t\t\t\totherNodeInGraph.addGraphPath(pathToListNode,\r\n\t\t\t\t\t\t\t\taddNodeToGraphPath(graph, pathToListNode, otherNodeInGraph));\r\n\r\n\t\t\t\t\t\tnodesToWorkOn.add(otherNodeInGraph);\r\n\r\n\t\t\t\t\t\t// break; // TODO: Possible Change: If enabled then only\r\n\t\t\t\t\t\t// one Path from the currently checked node is\r\n\t\t\t\t\t\t// transferred to another node. All other possible Paths\r\n\t\t\t\t\t\t// will not be considered and not checked.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn connected;\r\n\t}", "@Test\n public void testShortestDistance2() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 3);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n List<Vertex> expectedPath = new ArrayList<>();\n expectedPath.add(v1);\n expectedPath.add(v2);\n expectedPath.add(v3);\n\n assertTrue(g.edge(e1));\n assertTrue(g.vertex(v1));\n\n v1.updateName(\"test\");\n assertEquals(\"test\", v1.name());\n\n assertEquals(expectedPath, g.shortestPath(v1, v3));\n }", "public static void main(String[] args) {\n\t\tVertex A = new Vertex(\"A\");\n\t\tVertex B = new Vertex(\"B\");\n\t\tVertex C = new Vertex(\"C\");\n\t\tVertex D = new Vertex(\"D\");\n\t\tVertex E = new Vertex(\"E\");\n\n\t\tA.adjacencies = new Edge[]{ new Edge(B, 10),\tnew Edge(C, 3) };\n\t\tB.adjacencies = new Edge[]{\tnew Edge(C, 1), \tnew Edge(D, 2)};\n\t\tC.adjacencies = new Edge[]{ new Edge(B, 4), \tnew Edge(D, 8),\tnew Edge(E, 2)};\n\t\tD.adjacencies = new Edge[]{ new Edge(E, 7)};\n\t\tE.adjacencies = new Edge[]{ new Edge(D, 9)};\n\t\tVertex[] vertices = { A,B,C,D,E };\n\t\t\n\t\tcomputePaths(A);\n\t\t\n\t\tfor (Vertex v : vertices)\n\t\t{\n\t\t System.out.println(\"Distance to \" + v + \": \" + v.minDistance);\n\t\t List<Vertex> path = getShortestPathTo(v);\n\t\t System.out.println(\"Path: \" + path);\n\t\t}\n\t}", "@Test\n public void getGraph1() throws Exception {\n try (final Graph g1 = dataset.getGraph(graph1).get()) {\n assertEquals(4, g1.size());\n\n assertTrue(g1.contains(alice, name, aliceName));\n assertTrue(g1.contains(alice, knows, bob));\n assertTrue(g1.contains(alice, member, null));\n assertTrue(g1.contains(null, name, secretClubName));\n }\n }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;" ]
[ "0.65393347", "0.65377915", "0.6490433", "0.64120257", "0.6406734", "0.63605", "0.6335511", "0.6320843", "0.6304001", "0.62634313", "0.62437826", "0.62361556", "0.61987144", "0.6196342", "0.6192406", "0.6158901", "0.6153992", "0.61360824", "0.6122647", "0.6118045", "0.60848093", "0.60806215", "0.60709685", "0.60654116", "0.6063961", "0.60388976", "0.60357904", "0.6022743", "0.6017506", "0.60096234", "0.60024434", "0.5995172", "0.5972513", "0.5967093", "0.5964176", "0.5963596", "0.5962598", "0.59622246", "0.5952986", "0.59512556", "0.59454", "0.594315", "0.5941475", "0.59387004", "0.5935361", "0.59332246", "0.5924305", "0.59214044", "0.5919179", "0.591389", "0.5911449", "0.5908547", "0.5906677", "0.5906047", "0.5897504", "0.58943355", "0.5893797", "0.5892583", "0.5892009", "0.588913", "0.58799803", "0.5877124", "0.5876617", "0.586918", "0.5863602", "0.5860124", "0.5847495", "0.58466595", "0.58452255", "0.5829905", "0.5827799", "0.5825869", "0.5825274", "0.5819513", "0.580454", "0.5801128", "0.5800488", "0.5782272", "0.57815796", "0.5779524", "0.5773694", "0.5771141", "0.5768683", "0.5767515", "0.57608426", "0.5759502", "0.5756174", "0.5748422", "0.57477254", "0.5744412", "0.5743781", "0.5743352", "0.5741306", "0.57371515", "0.57325786", "0.57322496", "0.5731586", "0.5728453", "0.57239056", "0.5720029" ]
0.5803211
75
examples showing read only, write only and read write attributes
public String getReadWriteAttribute();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isWriteAccess();", "boolean isReadAccess();", "public void setReadWriteOnMyLatestView()\n {\n \t m_acl = \tm_acl | (1<<2);\n }", "@Override\n\tpublic boolean isReadWrite() {\n\t\treturn true;\n\t}", "@Override\n public boolean hasReadAccess() {\n return true;\n }", "@Override\n\tpublic void setReadOnly(boolean readonly) {\n\t\t\n\t}", "boolean isReadOnly();", "boolean isReadOnly();", "public boolean isReadOnly();", "public boolean isReadOnly();", "public boolean isReadOnly();", "public abstract boolean isReadOnly();", "public boolean isWriteable();", "public void setReadOnly(boolean isReadOnly);", "protected boolean isReadOnly()\n {\n return true;\n }", "boolean canWrite();", "boolean isWritePermissionGranted();", "@Override\n\tpublic boolean isReadOnly() {\n\t\treturn false;\n\t}", "public void makeReadOnly();", "int getPermissionWrite();", "@Override\n\tpublic boolean getCanWrite()\n\t{\n\t\treturn false;\n\t}", "public boolean isReadOnly() {\n\t\treturn false;\n\t}", "public void makeReadOnly()\n {\n m_readOnly = true;\n }", "public void makeReadOnly()\n {\n m_readOnly = true;\n }", "public boolean isReadOnly() {\n checkNotUnknown();\n return (flags & ATTR_READONLY_ANY) == ATTR_READONLY;\n }", "@Override\n\tpublic void setReadOnly(boolean readOnly) {\n\t}", "abstract void onWriteable();", "@Override\n public void setReadOnly(boolean readonly) {\n // do nothing\n }", "@XmlAttribute\n public Boolean isReadOnly() {\n return readOnly;\n }", "public void setReadOnly(Boolean readOnly) {\n this.readOnly = readOnly;\n }", "public interface DynamicReadOnly {\n\n default ReadOnly getReadOnly(final String fieldName) {\n return ReadOnly.NOT_SET;\n }\n\n void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange);\n\n boolean isAllowOnlyVisualChange();\n\n enum ReadOnly {\n /**\n * isAllowOnlyVisualChange() is false.\n */\n NOT_SET,\n\n /**\n * isAllowOnlyVisualChange() is true and the property is readonly.\n */\n TRUE,\n\n /**\n * isAllowOnlyVisualChange() is true and the property is NOT readonly.\n */\n FALSE\n }\n}", "public boolean hasReadOnly() {\n checkNotUnknown();\n return (flags & ATTR_READONLY_ANY) != 0;\n }", "public boolean canReadWriteOnMyLatestView()\n {\n \t \treturn getAccessBit(2);\n }", "boolean readOnly();", "boolean readOnly();", "public void setReadonly(String readonly) {\n this.readonly = readonly;\n }", "public boolean canReadAndWrite() {\n\t\t//We can read and write in any state that we can read.\n\t\treturn canWrite();\n\t}", "public interface PlexusIoResourceAttributes\n{\n boolean isOwnerReadable();\n \n boolean isOwnerWritable();\n \n boolean isOwnerExecutable();\n \n boolean isGroupReadable();\n\n boolean isGroupWritable();\n \n boolean isGroupExecutable();\n \n boolean isWorldReadable();\n\n boolean isWorldWritable();\n \n boolean isWorldExecutable();\n\n /**\n * Gets the unix user id.\n * @return The unix user id, may be null (\"not set\"), even on unix\n */\n Integer getUserId();\n \n /**\n * Gets the unix group id.\n * @return The unix group id, may be null (\"not set\"), even on unix\n */\n Integer getGroupId();\n\n String getUserName();\n \n String getGroupName();\n \n int getOctalMode();\n \n String getOctalModeString();\n \n PlexusIoResourceAttributes setOwnerReadable( boolean flag );\n\n PlexusIoResourceAttributes setOwnerWritable( boolean flag );\n\n PlexusIoResourceAttributes setOwnerExecutable( boolean flag );\n\n PlexusIoResourceAttributes setGroupReadable( boolean flag );\n\n PlexusIoResourceAttributes setGroupWritable( boolean flag );\n\n PlexusIoResourceAttributes setGroupExecutable( boolean flag );\n\n PlexusIoResourceAttributes setWorldReadable( boolean flag );\n\n PlexusIoResourceAttributes setWorldWritable( boolean flag );\n\n PlexusIoResourceAttributes setWorldExecutable( boolean flag );\n\n PlexusIoResourceAttributes setUserId( Integer uid );\n\n PlexusIoResourceAttributes setGroupId( Integer gid );\n\n PlexusIoResourceAttributes setUserName( String name );\n\n PlexusIoResourceAttributes setGroupName( String name );\n \n PlexusIoResourceAttributes setOctalMode( int mode );\n \n PlexusIoResourceAttributes setOctalModeString( String mode );\n}", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "public void setReadOnly(boolean readOnly) {\n this.readOnly = readOnly;\n }", "public void setReadOnly(boolean readOnly) {\n this.readOnly = readOnly;\n }", "@Test\n public void testPermissions() throws IOException {\n Note note = notebook.createNote(\"note1\", anonymous);\n NotebookAuthorization notebookAuthorization = notebook.getNotebookAuthorization();\n // empty owners, readers or writers means note is public\n Assert.assertEquals(notebookAuthorization.isOwner(note.getId(), new HashSet(Arrays.asList(\"user2\"))), true);\n Assert.assertEquals(notebookAuthorization.isReader(note.getId(), new HashSet(Arrays.asList(\"user2\"))), true);\n Assert.assertEquals(notebookAuthorization.isRunner(note.getId(), new HashSet(Arrays.asList(\"user2\"))), true);\n Assert.assertEquals(notebookAuthorization.isWriter(note.getId(), new HashSet(Arrays.asList(\"user2\"))), true);\n notebookAuthorization.setOwners(note.getId(), new HashSet(Arrays.asList(\"user1\")));\n notebookAuthorization.setReaders(note.getId(), new HashSet(Arrays.asList(\"user1\", \"user2\")));\n notebookAuthorization.setRunners(note.getId(), new HashSet(Arrays.asList(\"user3\")));\n notebookAuthorization.setWriters(note.getId(), new HashSet(Arrays.asList(\"user1\")));\n Assert.assertEquals(notebookAuthorization.isOwner(note.getId(), new HashSet(Arrays.asList(\"user2\"))), false);\n Assert.assertEquals(notebookAuthorization.isOwner(note.getId(), new HashSet(Arrays.asList(\"user1\"))), true);\n Assert.assertEquals(notebookAuthorization.isReader(note.getId(), new HashSet(Arrays.asList(\"user4\"))), false);\n Assert.assertEquals(notebookAuthorization.isReader(note.getId(), new HashSet(Arrays.asList(\"user2\"))), true);\n Assert.assertEquals(notebookAuthorization.isRunner(note.getId(), new HashSet(Arrays.asList(\"user3\"))), true);\n Assert.assertEquals(notebookAuthorization.isRunner(note.getId(), new HashSet(Arrays.asList(\"user2\"))), false);\n Assert.assertEquals(notebookAuthorization.isWriter(note.getId(), new HashSet(Arrays.asList(\"user2\"))), false);\n Assert.assertEquals(notebookAuthorization.isWriter(note.getId(), new HashSet(Arrays.asList(\"user1\"))), true);\n // Test clearing of permissions\n notebookAuthorization.setReaders(note.getId(), Sets.<String>newHashSet());\n Assert.assertEquals(notebookAuthorization.isReader(note.getId(), new HashSet(Arrays.asList(\"user2\"))), true);\n Assert.assertEquals(notebookAuthorization.isReader(note.getId(), new HashSet(Arrays.asList(\"user4\"))), true);\n notebook.removeNote(note.getId(), anonymous);\n }", "public void setReadonly(boolean readonly) {\n\t\tthis.readonly = readonly;\n\t}", "@JSProperty\n boolean isReadOnly();", "int getPermissionRead();", "public void testTogglingEnabledWithDirectWritingPreservesContent() {\r\n \t\tfinal ITextRidget ridget = getRidget();\r\n \t\tfinal Text control = getWidget();\r\n \r\n \t\tridget.setDirectWriting(true);\r\n \r\n \t\tassertTrue(ridget.isDirectWriting());\r\n \r\n \t\tbean.setProperty(\"abcd\");\r\n \t\tridget.bindToModel(bean, TestBean.PROPERTY);\r\n \t\tridget.updateFromModel();\r\n \r\n \t\tassertEquals(\"abcd\", control.getText());\r\n \t\tassertEquals(\"abcd\", ridget.getText());\r\n \t\tassertEquals(\"abcd\", bean.getProperty());\r\n \r\n \t\tridget.setEnabled(false);\r\n \r\n \t\tassertEquals(\"\", control.getText());\r\n \t\tassertEquals(\"abcd\", ridget.getText());\r\n \t\tassertEquals(\"abcd\", bean.getProperty());\r\n \r\n \t\tridget.setEnabled(true);\r\n \r\n \t\tassertEquals(\"abcd\", control.getText());\r\n \t\tassertEquals(\"abcd\", ridget.getText());\r\n \t\tassertEquals(\"abcd\", bean.getProperty());\r\n \t}", "public void setRead(){\n \tthis.isRead = true;\n }", "protected final boolean isReadOnly()\n {\n return m_readOnly;\n }", "public void testisReadOnly() {\n assertTrue(\"Failed to return the value correctly.\", loopReadOnly.isReadOnly());\n }", "public boolean getReadOnly() {\n return readOnly;\n }", "public Object getReadWriteObjectProperty() {\r\n return readWriteObjectProperty;\r\n }", "public final String getReadOnlyAttribute() {\n return getAttributeValue(\"readonly\");\n }", "public final boolean isReadOnly() {\n\t\treturn m_info.isReadOnly();\n\t}", "public static void main(String[] args) throws IOException\r\n\t\t{\n\t\t\tFile f = new File(\"sample.txt\");\r\n\t\t\t// create a file\r\n\t\t\tboolean s = f.createNewFile();\r\n\t\t\tif(s==true)\r\n\t\t\t\tSystem.out.println(\"New File Created\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"File already available\");\r\n\t\t\t\r\n\t\t\t//check that, File created can be writable or not?\r\n\t\t\tif(f.canWrite()==true)\r\n\t\t\t\t\tSystem.out.println(\"file can be written\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"file cant be written\");\r\n\t\t\t\r\n\t\t\t//change the attribute of the file to read-only\r\n\t\t\tf.setReadOnly();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\\nattribute of the file changed:>\\n\");\r\n\t\t\t\r\n\t\t\t//check that, File created can be writable or not?\r\n\t\t\tif(f.canWrite()==true)\r\n\t\t\t\t\tSystem.out.println(\"file can be written\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"file cant be written\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public void setReadOnly(boolean readOnly) {\n _readOnly = (readOnly) ? Boolean.TRUE : Boolean.FALSE;\n }", "public boolean isReadOnly(SrvSession sess, DeviceContext ctx)\n throws IOException {\n return false;\n }", "public boolean isReadOnly(String label)\n {\n return true;\n }", "@Override\n public boolean canEdit(Context context, Item item) throws java.sql.SQLException\n {\n // can this person write to the item?\n return authorizeService.authorizeActionBoolean(context, item, Constants.WRITE, true);\n }", "interface ReadWritePolicy {\n\tpublic void acquireRead() throws InterruptedException;\n\tpublic void releaseRead();\n\tpublic void acquireWrite() throws InterruptedException;\n\tpublic void releaseWrite();\n}", "private void t1() {\n // read and write to the same region: just want the write effect\n writeProtected();\n readProtected();\n }", "void writeLegacyPermissionStateTEMP();", "@Test\n\tpublic void testSetAttribute_UpdateMode() throws NamingException {\n\t\t// Set original attribute value\n\t\tAttribute attribute = new BasicAttribute(\"cn\", \"john doe\");\n\t\ttested.setAttribute(attribute);\n\n\t\t// Set to update mode\n\t\ttested.setUpdateMode(true);\n\n\t\t// Perform test - update the attribute\n\t\tAttribute updatedAttribute = new BasicAttribute(\"cn\", \"nisse hult\");\n\t\ttested.setAttribute(updatedAttribute);\n\n\t\t// Verify result\n\t\tModificationItem[] mods = tested.getModificationItems();\n\t\tassertEquals(1, mods.length);\n\t\tassertEquals(DirContext.REPLACE_ATTRIBUTE, mods[0].getModificationOp());\n\n\t\tAttribute modificationAttribute = mods[0].getAttribute();\n\t\tassertEquals(\"cn\", modificationAttribute.getID());\n\t\tassertEquals(\"nisse hult\", modificationAttribute.get());\n\t}", "public boolean isReadOnly() {\n return this.getUpdateCount() == 0;\n }", "public boolean isReadOnly() {\n return type == TransactionType.READ_ONLY;\n }", "public boolean isReadOnly() {\r\n return this.readOnly;\r\n }", "public boolean isMaybeReadOnly() {\n checkNotUnknown();\n return (flags & ATTR_READONLY) != 0;\n }", "public boolean isReadOnly() {\r\n\t\treturn readOnly;\r\n\t}", "void setAccessible(boolean accessible);", "AtomicDataAttributes createAtomicDataAttributes();", "public boolean isReadOnly() {\n return readOnly;\n }", "public boolean isNotReadOnly() {\n checkNotUnknown();\n return (flags & ATTR_READONLY_ANY) == ATTR_NOTREADONLY;\n }", "private DynamoOperation(Context context, int myAddress, int nodeCount, int replicationCount, int readQuorum, int writeQuorum){\n\t\tdbHelper = new DBHelper(context);\n\t\tdynamoRing = DynamoRing.createAndGetInstance(nodeCount);\n\t\tMY_ADDRESS = myAddress;\n\t\tREPLICATION_COUNT = replicationCount;\n\t\tREAD_QUORUM = readQuorum;\n\t\tWRITE_QUORUM = writeQuorum;\n\t\tsync();\n\t}", "public void setReadonly(boolean v) {\n\t\treadonly = v;\n\t}", "public interface ReadOnlyAttractionList {\n\n /**\n * Returns an unmodifiable view of the attraction list.\n * This list will not contain any duplicate attractions.\n */\n ObservableList<Attraction> getAttractionList();\n\n}", "public interface AccessManager {\n\n /**\n * predefined action constants\n */\n public String READ_ACTION = javax.jcr.Session.ACTION_READ;\n public String REMOVE_ACTION = javax.jcr.Session.ACTION_REMOVE;\n public String ADD_NODE_ACTION = javax.jcr.Session.ACTION_ADD_NODE;\n public String SET_PROPERTY_ACTION = javax.jcr.Session.ACTION_SET_PROPERTY;\n\n public String[] READ = new String[] {READ_ACTION};\n public String[] REMOVE = new String[] {REMOVE_ACTION};\n\n /**\n * Determines whether the specified <code>permissions</code> are granted\n * on the item with the specified path.\n *\n * @param parentState The node state of the next existing ancestor.\n * @param relPath The relative path pointing to the non-existing target item.\n * @param actions An array of actions that need to be checked.\n * @return <code>true</code> if the actions are granted; otherwise <code>false</code>\n * @throws ItemNotFoundException if the target item does not exist\n * @throws RepositoryException if another error occurs\n */\n boolean isGranted(NodeState parentState, Path relPath, String[] actions) throws ItemNotFoundException, RepositoryException;\n\n /**\n * Determines whether the specified <code>permissions</code> are granted\n * on the item with the specified path.\n *\n * @param itemState\n * @param actions An array of actions that need to be checked.\n * @return <code>true</code> if the actions are granted; otherwise <code>false</code>\n * @throws ItemNotFoundException if the target item does not exist\n * @throws RepositoryException if another error occurs\n */\n boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException;\n\n\n /**\n * Returns true if the existing item with the given <code>ItemId</code> can\n * be read.\n *\n * @param itemState\n * @return\n * @throws ItemNotFoundException\n * @throws RepositoryException\n */\n boolean canRead(ItemState itemState) throws ItemNotFoundException, RepositoryException;\n\n /**\n * Returns true if the existing item state can be removed.\n *\n * @param itemState\n * @return\n * @throws ItemNotFoundException\n * @throws RepositoryException\n */\n boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException;\n\n /**\n * Determines whether the subject of the current context is granted access\n * to the given workspace.\n *\n * @param workspaceName name of workspace\n * @return <code>true</code> if the subject of the current context is\n * granted access to the given workspace; otherwise <code>false</code>.\n * @throws NoSuchWorkspaceException if a workspace with the given name does not exist.\n * @throws RepositoryException if another error occurs\n */\n boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException;\n}", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "@Test\n public void testReadWriteBoolean() {\n System.out.println(\"readBoolean\");\n ByteArray instance = new ByteArray();\n \n instance.writeBoolean(true, 0);\n instance.writeBoolean(false, 1);\n instance.writeBoolean(true, instance.compacity());\n \n assertEquals(true, instance.readBoolean(0));\n assertEquals(false, instance.readBoolean(1));\n assertEquals(true, instance.readBoolean(instance.compacity() - 1));\n \n instance.writeBoolean(true, 1);\n assertEquals(true, instance.readBoolean(1));\n }", "public boolean isReadonly() {\n\t\treturn readonly;\n\t}", "public interface ReadOnlyWhatNow {\n\n UniqueTagList getUniqueTagList();\n\n UniqueTaskList getUniqueTaskList();\n\n /**\n * Returns an unmodifiable view of tasks list\n */\n List<ReadOnlyTask> getTaskList();\n\n /**\n * Returns an unmodifiable view of tags list\n */\n List<Tag> getTagList();\n\n}", "public boolean isReadOnly()\n {\n return SystemProps.IsReadOnlyProperty(this.getPropertyID());\n }", "public boolean isWritable() {\n return accessControl != null && accessControl.getOpenStatus().isOpen() && !sandboxed;\n }", "@DISPID(9)\n\t// = 0x9. The runtime will prefer the VTID if present\n\t@VTID(18)\n\tboolean readOnly();", "public Value setAttributes(boolean dontenum, boolean dontdelete, boolean readonly) {\n checkNotUnknown();\n Value r = new Value(this);\n r.flags &= ~ATTR;\n if (dontdelete)\n r.flags |= ATTR_DONTDELETE;\n else\n r.flags |= ATTR_NOTDONTDELETE;\n if (readonly)\n r.flags |= ATTR_READONLY;\n else\n r.flags |= ATTR_NOTREADONLY;\n if (dontenum)\n r.flags |= ATTR_DONTENUM;\n else\n r.flags |= ATTR_NOTDONTENUM;\n return canonicalize(r);\n }", "@Test\n public void isWritableFalse_noneWritableWriteNameFalse() {\n AtRule ar = new AtRule(\"test\", new CustomExpressionNotWritable(), new CustomBlockNotWritable());\n ar.shouldWriteName(false);\n assertThat(ar.isWritable()).isFalse();\n }", "public boolean ownWrite(Object data);", "public Value setReadOnly() {\n checkNotUnknown();\n if (isReadOnly())\n return this;\n Value r = new Value(this);\n r.flags &= ~ATTR_READONLY_ANY;\n r.flags |= ATTR_READONLY;\n return canonicalize(r);\n }", "public boolean isReadOnly() {\n return _readOnly != null && _readOnly;\n }", "@ProvidedBy(ODocumentWrapperProvider.class)\n@EntityType(value = OSecurityShared.RESTRICTED_CLASSNAME)\npublic interface IORestricted extends IODocumentWrapper {\n\t\n\t@EntityProperty(\"_allow\")\n\tpublic Set<OIdentifiable> getAllowAll();\n\t@EntityProperty(\"_allow\")\n\tpublic IORestricted setAllowAll(Set<OIdentifiable> identifiables);\n\t\n\tpublic default IORestricted addToAllowAll(OIdentifiable identifiable) {\n\t\treturn setAllowAll(addSafely(getAllowAll(), identifiable));\n\t}\n\t\n\tpublic default IORestricted remoteFromAllowAll(OIdentifiable identifiable) {\n\t\treturn setAllowAll(removeSafely(getAllowAll(), identifiable));\n\t}\n\t\n\t@EntityProperty(\"_allowRead\")\n\tpublic Set<OIdentifiable> getAllowRead();\n\t@EntityProperty(\"_allowRead\")\n\tpublic IORestricted setAllowRead(Set<OIdentifiable> identifiables);\n\t\n\tpublic default IORestricted addToAllowRead(OIdentifiable identifiable) {\n\t\treturn setAllowRead(addSafely(getAllowRead(), identifiable));\n\t}\n\t\n\tpublic default IORestricted remoteFromAllowRead(OIdentifiable identifiable) {\n\t\treturn setAllowRead(removeSafely(getAllowRead(), identifiable));\n\t}\n\t\n\t@EntityProperty(\"_allowUpdate\")\n\tpublic Set<OIdentifiable> getAllowUpdate();\n\t@EntityProperty(\"_allowUpdate\")\n\tpublic IORestricted setAllowUpdate(Set<OIdentifiable> identifiables);\n\t\n\tpublic default IORestricted addToAllowUpdate(OIdentifiable identifiable) {\n\t\treturn setAllowUpdate(addSafely(getAllowUpdate(), identifiable));\n\t}\n\t\n\tpublic default IORestricted remoteFromAllowUpdate(OIdentifiable identifiable) {\n\t\treturn setAllowUpdate(removeSafely(getAllowUpdate(), identifiable));\n\t}\n\t\n\t@EntityProperty(\"_allowDelete\")\n\tpublic Set<OIdentifiable> getAllowDelete();\n\t@EntityProperty(\"_allowDelete\")\n\tpublic IORestricted setAllowDelete(Set<OIdentifiable> identifiables);\n\t\n\tpublic default IORestricted addToAllowDelete(OIdentifiable identifiable) {\n\t\treturn setAllowDelete(addSafely(getAllowDelete(), identifiable));\n\t}\n\t\n\tpublic default IORestricted remoteFromAllowDelete(OIdentifiable identifiable) {\n\t\treturn setAllowDelete(removeSafely(getAllowDelete(), identifiable));\n\t}\n\t\n\tpublic static Set<OIdentifiable> addSafely(Set<OIdentifiable> set, OIdentifiable identifiable) {\n\t\tif(set==null) set = new HashSet<OIdentifiable>();\n\t\tset.add(identifiable);\n\t\treturn set;\n\t}\n\t\n\tpublic static Set<OIdentifiable> removeSafely(Set<OIdentifiable> set, OIdentifiable identifiable) {\n\t\tif(set==null) return set;\n\t\tset.remove(identifiable);\n\t\treturn set;\n\t}\n}", "boolean shouldModify();", "public String getReadonlyFlag() {\n return readonlyFlag;\n }", "public void testOSReadOnly() throws Exception {\n // start with some simple checks\n setAutoCommit(false);\n Statement stmt = createStatement();\n JDBC.assertFullResultSet(stmt.executeQuery(\n \"select count(*) from foo\"), new String[][] {{\"512\"}});\n stmt.executeUpdate(\"delete from foo where a = 1\");\n JDBC.assertFullResultSet(stmt.executeQuery(\n \"select count(*) from foo\"), new String[][] {{\"384\"}});\n rollback();\n JDBC.assertFullResultSet(stmt.executeQuery(\n \"select count(*) from foo\"), new String[][] {{\"512\"}});\n stmt.executeUpdate(\"insert into foo select * from foo where a = 1\");\n JDBC.assertFullResultSet(stmt.executeQuery(\n \"select count(*) from foo\"), new String[][] {{\"640\"}});\n commit();\n stmt.executeUpdate(\"delete from foo where a = 1\");\n JDBC.assertFullResultSet(stmt.executeQuery(\n \"select count(*) from foo\"), new String[][] {{\"384\"}});\n rollback();\n JDBC.assertFullResultSet(stmt.executeQuery(\n \"select count(*) from foo\"), new String[][] {{\"640\"}});\n setAutoCommit(false);\n \n TestConfiguration.getCurrent().shutdownDatabase();\n \n // so far, we were just playing. Now for the test.\n String phDbName = getPhysicalDbName();\n // copy the database to one called 'readOnly'\n copyDatabaseOnOS(phDbName, \"readOnly\");\n // change filePermissions on readOnly, to readonly.\n changeFilePermissions(\"readOnly\");\n \n DataSource ds = JDBCDataSource.getDataSource();\n JDBCDataSource.setBeanProperty(ds, \n \"databaseName\", \"singleUse/readOnly\");\n assertReadDB(ds);\n assertExpectedInsertBehaviour(ds, false, 10, \"will fail\");\n shutdownDB(ds);\n \n // copy the database to one called 'readWrite' \n // this will have the default read/write permissions upon\n // copying\n copyDatabaseOnOS(\"readOnly\", \"readWrite\");\n ds = JDBCDataSource.getDataSource();\n JDBCDataSource.setBeanProperty(ds, \"databaseName\", \"singleUse/readWrite\");\n assertReadDB(ds);\n assertExpectedInsertBehaviour(ds, true, 20, \"will go in\");\n shutdownDB(ds);\n \n // do it again...\n copyDatabaseOnOS(\"readWrite\", \"readOnly2\");\n // change filePermissions on readOnly, to readonly.\n changeFilePermissions(\"readOnly2\");\n \n ds = JDBCDataSource.getDataSource();\n JDBCDataSource.setBeanProperty(ds, \n \"databaseName\", \"singleUse/readOnly2\");\n assertReadDB(ds);\n assertExpectedInsertBehaviour(ds, false, 30, \"will also fail\");\n shutdownDB(ds);\n \n // testharness will try to remove the original db; put it back\n copyDatabaseOnOS(\"readOnly2\", phDbName);\n }", "@Override\n\tpublic void setAccessModifier(AccessModifier modifier) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@Override\r\n\t\tpublic boolean isReadOnly() throws SQLException {\n\t\t\treturn false;\r\n\t\t}", "public void setFieldReadAccess() {\n\n\t\tif (!AccessManager.canReadSmsPredefiniDescription())\n\t\t\ttypeFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.canReadSmsPredefiniDescription())\n\t\t\tobjetFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.canReadSmsPredefiniDescription())\n\t\t\tmessageFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.isAdmin())\n\t\t\tdeletedEntityBoxFilterBox.setVisible(false);\n\t}", "public boolean writeAttributeFile();", "public void setAttributeWritesAreCached(boolean status);", "boolean isWritable();", "@Override\n\tpublic boolean isReadOnly(int arg0) throws SQLException {\n\t\treturn false;\n\t}", "@Test\n public void testSetEditable() {\n writeBanner(getMethodName());\n }", "public void setFieldReadAccess() {\n\n\t\tif (!AccessManager.canReadPersonnelIdentification())\n\t\t\tpersonnel_nomFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.canReadCentreDiagTraitDescription())\n\t\t\tcdt_nomFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.canReadCandidatureFormationRegionApprobation())\n\t\t\tapprouveeRegionFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.canReadCandidatureFormationGtcApprobation())\n\t\t\tapprouveeGTCFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.canReadDistrictSanteDescription())\n\t\t\tdistrictsante_nomFilterBox.setVisible(false);\n\n\t\tif (!AccessManager.isAdmin())\n\t\t\tdeletedEntityBoxFilterBox.setVisible(false);\n\t}" ]
[ "0.70512164", "0.67237884", "0.6644765", "0.66112036", "0.6571987", "0.6567176", "0.6563968", "0.6563968", "0.655013", "0.655013", "0.655013", "0.65018123", "0.64926577", "0.64904445", "0.64595544", "0.6428641", "0.63287663", "0.6272095", "0.6263519", "0.6248", "0.6228325", "0.61916023", "0.61302286", "0.61302286", "0.61276215", "0.61206347", "0.60457426", "0.6015936", "0.59363216", "0.59089893", "0.5905206", "0.58894897", "0.5888825", "0.5843357", "0.5843357", "0.5828239", "0.58240116", "0.581368", "0.5801256", "0.5777143", "0.5777143", "0.57671136", "0.57360804", "0.5735878", "0.57256305", "0.5706077", "0.5683363", "0.5680129", "0.56776905", "0.567588", "0.56753916", "0.565619", "0.5630619", "0.5629807", "0.56190616", "0.5614696", "0.5605213", "0.5599874", "0.5592625", "0.5584699", "0.5577202", "0.55732924", "0.5562718", "0.5562156", "0.55602354", "0.5559683", "0.5559323", "0.5557885", "0.5550486", "0.55256295", "0.5516094", "0.5486267", "0.547632", "0.5463171", "0.5446651", "0.54371417", "0.54343754", "0.5431813", "0.54210806", "0.5417451", "0.5406639", "0.5406302", "0.53970534", "0.5394481", "0.53933465", "0.53782153", "0.53770196", "0.53752494", "0.5374804", "0.5354723", "0.5354346", "0.53462386", "0.5345548", "0.5327297", "0.5321286", "0.531661", "0.5313794", "0.5304227", "0.5294827", "0.52920973" ]
0.72393113
0
data is passed into the constructor
public ExamsAdapter(AppCompatActivity context, List<Exam> data) { this.LayoutInflater = LayoutInflater.from(context); this.context = context; this.mData = data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@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 initData() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "public mainData() {\n }", "public Model(DataHandler data){\n //assign the data parameter to the instance\n //level variable data. The scope of the parameter\n //is within the method and that is where the JVM \n //looks first for a variable or parameter so we \n //need to specify that the instance level variable \n //is to be used by using the keyword 'this' followed \n //by the '.' operator.\n this.data = data;\n }", "public Data() {\n }", "public Data() {\n }", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "public Data() {}", "private void initData() {\n\n }", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "private Noder(E data) {\n this.data = data;\n }", "private void initData(){\n\n }", "public Data() {\n \n }", "@Override\r\n\tpublic void initData() {\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "private void initData() {\n }", "private void initData() {\n\t}", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "protected @Override\r\n abstract void initData();", "public void initData(){\r\n \r\n }", "public void initData() {\n }", "public void initData() {\n }", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public ChangeData()\r\n\t\t{\r\n\t\t}", "public InitialData(){}", "public DataMessage(final Object data){\n\t\tthis.data=data;\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public DesastreData() { //\r\n\t}", "private void InitData() {\n\t}", "void initData(){\n }", "private Node( T data_ )\n {\n data = data_;\n parent = this;\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void InitData() {\n }", "private Cell(E data) {\n Cell.this.data = data;\n }", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "public StringData1() {\n }", "private SimpleBuildingJob(BuildingJobData data) {\n\t\tsuper(data.getDx(), data.getDy());\n\t\ttype = data.getType();\n\t\ttime = data.getTime();\n\t\tmaterial = data.getMaterial();\n\t\tdirection = data.getDirection();\n\t\tsearch = data.getSearchType();\n\t\tname = data.getName();\n\t\ttakeMaterialFromMap = data.isTakeMaterialFromMap();\n\t\tfoodOrder = data.getFoodOrder();\n\t}", "void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}", "public SensorData() {\n\n\t}", "@Override\r\n\tprotected void setData(Object data) {\n\t\t\r\n\t}", "public Node(Object data) {\n\t\t\tthis.data = data;\n\t\t}", "public Node(T data) {\r\n this.data = data;\r\n }", "Data() {\n\t\t// dia = 01;\n\t\t// mes = 01;\n\t\t// ano = 1970;\n\t\tthis(1, 1, 1970); // usar um construtor dentro de outro\n\t}", "public Node(T data) {\n\n this.data = data;\n\n\n }", "public StringData() {\n\n }", "protected abstract D createData();", "private void initialData() {\n\n }", "public LineData()\n\t{\n\t}", "public Node(T data){\n this.data = data;\n }", "public RegisterNewData() {\n }", "public Node(T data) {this.data = data;}", "public TradeData() {\r\n\r\n\t}", "private void parseData() {\n\t\t\r\n\t}", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "public Matchdata()\n {\n }", "private void initData() {\n getCourse();\n// getMessage();\n\n }", "public Data(SearchTree<Software> dataStructure){\n administratorMyArray = new ArrayList<>();\n IDList = new ArrayList<>();\n products = dataStructure;\n money=0.0;\n }", "public Node(E data) {\n this.data = data;\n }", "public Data() {\n initComponents();\n getData();\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Node(E data) {\r\n\t\tthis.data = data;\r\n\t}", "private void fillData()\n {\n\n }", "public StreamData(String name)\n {\n _data = new LinkedList<byte[]>();\n this.Name = name;\n this.Length = 0;\n }", "private TigerData() {\n initFields();\n }", "public FilterData() {\n }", "public Data (String name, int type) {\n\t\tthis.name = name;\n\t\tthis.type = type;\n\t\tstream = new MyReader();\n\t}", "public CompanyData() {\r\n }", "public CreateStatus(DataMap data)\n {\n super(data, null);\n }", "public PassPinDataItem() {\n }", "public NetworkData() {\n }", "public CompositeData()\r\n {\r\n }", "public Data(String data){\n String[] dataAux = data.split(\"/\");\n dia = Integer.parseInt(dataAux[0]);\n mes = Integer.parseInt(dataAux[1]);\n ano = Integer.parseInt(dataAux[2]);\n }", "public DummyModel(String data) {\n textData = data;\n }", "protected void loadData()\n {\n }", "public ListingData() {\r\n\t\tsuper();\r\n\t}", "private PassedData(Parcel p) {\n this.a = p.readInt();\n this.b = p.readLong();\n this.c = p.readString();\n }", "private Node(E dataItem)\n {\n data = dataItem;\n next = null;\n }", "protected Node(T dataPortion) {\n data = dataPortion;\n next = null;\n }", "public UserData() {\n }", "public void setData(Object data) {\r\n this.data = data;\r\n }", "void setData(T data) {\n\t\tthis.data = data;\n\t}", "public LocationData()\n {\n }", "public Coordinate(int x, int y, int data){\r\n this.x = x;\r\n this.y = y;\r\n this.data = data;\r\n }", "CreationData creationData();", "protected UserWordData() {\n\n\t}" ]
[ "0.75066525", "0.75066525", "0.7500069", "0.7500069", "0.7500069", "0.7500069", "0.7500069", "0.7500069", "0.7443239", "0.7433293", "0.7433293", "0.73854136", "0.7359438", "0.7341959", "0.73134995", "0.73134995", "0.7303543", "0.7290602", "0.72723377", "0.72721577", "0.72721577", "0.72721577", "0.7265292", "0.72530323", "0.724274", "0.722997", "0.72297704", "0.7209124", "0.71775454", "0.7128299", "0.70387167", "0.70285773", "0.7019868", "0.7018514", "0.7018514", "0.701122", "0.70029944", "0.70022815", "0.6984708", "0.6968704", "0.6968704", "0.696838", "0.6953215", "0.69401306", "0.6932438", "0.6898495", "0.6871475", "0.681317", "0.67616695", "0.67608684", "0.67090744", "0.6704104", "0.6699774", "0.664813", "0.6578683", "0.65760994", "0.6570827", "0.6560127", "0.65548986", "0.65496135", "0.6541045", "0.653364", "0.6531357", "0.6503566", "0.648753", "0.64864165", "0.64825535", "0.64751184", "0.64705616", "0.64568853", "0.64294", "0.64141333", "0.6368035", "0.63665795", "0.63569975", "0.63361984", "0.62986255", "0.62980247", "0.628906", "0.62823284", "0.62726355", "0.62570405", "0.6256395", "0.6243345", "0.6241662", "0.62267095", "0.6220145", "0.62162906", "0.6209326", "0.6200587", "0.6195408", "0.619442", "0.61939734", "0.61873424", "0.6180302", "0.61771804", "0.6168729", "0.61644804", "0.6149366", "0.6148449", "0.61469877" ]
0.0
-1
inflates the row layout from xml when needed
@Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.inflate(R.layout.exam_row, parent, false); return new ViewHolder(view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void inflateTextLayout(View row, BeadInfo beadInfo) {\n\t\tTextView colorCodeTV = (TextView) row.findViewById(R.id.colorNumber);\n\t\tif (colorCodeTV != null){\n\t\t\tString colorCode = beadInfo.getColorCode();\n\t\t\tif (colorCode != null){\n\t\t\t\tcolorCodeTV.setText(colorCode);\n\t\t\t}\n\t\t}\n\t\tLocation loc = beadInfo.getLocation(); \n\t\tif (loc != null){\n\t\t\tString wing = loc.getWing();\n\t\t\tString locRow = String.valueOf(loc.getRow());\n\t\t\tString locCol = String.valueOf(loc.getCol());\n\t\t\tString quantity = String.valueOf(beadInfo.getQuantity());\n\n\t\t\tTextView wingTV = (TextView) row.findViewById(R.id.beadLocationWing);\n\t\t\tif (wingTV != null){\n\t\t\t\twingTV.setText(wing);\n\t\t\t}\n\t\t\tTextView locRowTV = (TextView) row.findViewById(R.id.beadLocationRow);\n\t\t\tif (locRowTV != null){\n\t\t\t\tlocRowTV.setText(locRow);\n\t\t\t}\n\t\t\tTextView locColTV = (TextView) row.findViewById(R.id.beadLocationColumn);\n\t\t\tif (locColTV != null){\n\t\t\t\tlocColTV.setText(locCol);\n\t\t\t}\n\t\t\tTextView quantityTV = (TextView) row.findViewById(R.id.beadQuantity);\n\t\t\tif (quantityTV != null){\n\t\t\t\tquantityTV.setText(quantity);\n\t\t\t}\n\n\n\n\t\t}\n\n\t\t\n\t}", "public void onFinishInflate() {\n AppMethodBeat.i(103009);\n if (getChildCount() > 0) {\n View childAt = getChildAt(0);\n if (!(childAt instanceof RadarSpecialTableLayout)) {\n childAt = null;\n }\n this.pCL = (RadarSpecialTableLayout) childAt;\n }\n AppMethodBeat.o(103009);\n }", "private void inflateThumbnailLayout(View row, BeadInfo beadInfo) {\n\t\tTextView colorCodeTV = (TextView) row.findViewById(R.id.colorNumber);\n\t\tif (colorCodeTV != null){\n\t\t\tString colorCode = beadInfo.getColorCode();\n\t\t\tif (colorCode != null){\n\t\t\t\tcolorCodeTV.setText(colorCode);\n\t\t\t\timageInserter = new BitmapInserter();\n\t\t\t\timageInserter.setLocation((ImageView) row.findViewById(R.id.beadIconColumn));\n\t\t\t\timageInserter.setStorage(new File(APPFOLDER, IMAGEFOLDER));\n\t\t\t\timageInserter.execute(colorCode);\n\t\t\t}\n\t\t}\n\t}", "private void inflateView() {\n\t\tLog.v(T, \"inflateView\");\n\t\tif (!isInEditMode()) {\n\t\t\tString inflaterService = Context.LAYOUT_INFLATER_SERVICE;\n\n\t\t\tLayoutInflater layoutInflater = (LayoutInflater) getContext()\n\t\t\t\t\t.getSystemService(inflaterService);\n\t\t\tlayoutInflater.inflate(R.layout.dms_coordinate, this, true);\n\n\t\t\t// Get child control references\n\t\t\teditDegrees = (EditText) findViewById(R.id.editDegrees);\n\t\t\teditMinutes = (EditText) findViewById(R.id.editMinutes);\n\t\t\teditSeconds = (EditText) findViewById(R.id.editSeconds);\n\t\t}\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View layout = inflater.inflate(R.layout.custom_row, container, false);\n recyclerView = (RecyclerView) layout.findViewById(R.id.rv);\n adapter = new WebCrawlerRecyclerViewAdapter(getActivity(), getData());\n recyclerView.setAdapter(adapter);\n LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());\n layoutManager.setOrientation(LinearLayoutManager.VERTICAL);\n recyclerView.setLayoutManager(layoutManager);\n return layout;\n\n }", "protected View inflateRow(ViewHolder holder){\n View row = null;\n switch (type)\n {\n case TYPE_TEXT_USER:\n row = inflater.inflate(textUserRowResId, null);\n holder.readStatus = (ImageSwitcher) row.findViewById(R.id.read_status);\n holder.readStatus.setFactory(new ViewSwitcher.ViewFactory() {\n @Override\n public View makeView() {\n ImageView imageView = new ImageView(mActivity.getApplicationContext());\n imageView.setScaleType(ImageView.ScaleType.CENTER);\n return imageView;\n }\n });\n holder.readStatus.setInAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_in));\n holder.readStatus.setOutAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_out));\n holder.txtContent = (TextView) row.findViewById(R.id.txt_content);\n\n break;\n\n case TYPE_TEXT_FRIEND:\n\n row = inflater.inflate(textFriendRowResId, null);\n\n holder.txtContent = (TextView) row.findViewById(R.id.txt_content);\n\n break;\n\n case TYPE_IMAGE_USER:\n row = inflater.inflate(imageUserRowResId, null);\n holder.readStatus = (ImageSwitcher) row.findViewById(R.id.read_status);\n\n holder.readStatus.setFactory(new ViewSwitcher.ViewFactory() {\n @Override\n public View makeView() {\n ImageView imageView = new ImageView(mActivity.getApplicationContext());\n imageView.setScaleType(ImageView.ScaleType.CENTER);\n return imageView;\n }\n });\n holder.readStatus.setInAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_in));\n holder.readStatus.setOutAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_out));\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n\n break;\n\n case TYPE_IMAGE_FRIEND:\n row = inflater.inflate(imageFriendRowResId, null);\n\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n break;\n\n case TYPE_LOCATION_USER:\n row = inflater.inflate(locationUserResId, null);\n holder.readStatus = (ImageSwitcher) row.findViewById(R.id.read_status);\n holder.readStatus.setFactory(new ViewSwitcher.ViewFactory() {\n @Override\n public View makeView() {\n ImageView imageView = new ImageView(mActivity.getApplicationContext());\n imageView.setScaleType(ImageView.ScaleType.CENTER);\n return imageView;\n }\n });\n holder.readStatus.setInAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_in));\n holder.readStatus.setOutAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_out));\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n\n break;\n\n case TYPE_LOCATION_FRIEND:\n row = inflater.inflate(locationFriendRowResId, null);\n\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n\n break;\n }\n\n return row;\n }", "private void getRows() {\n int count = metroTileView.getChildCount();\n for (int i=0; i<count; i++) {\n LinearLayout layout = (LinearLayout) metroTileView.getChildAt(i);\n rows.add(layout);\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.layout_true_false_row, container, false);\n }", "@Override\n\tpublic View getView(final int position, View row, ViewGroup parent) {\n\t\tif (row == null) {\n\t\t\tLayoutInflater inflater = context.getLayoutInflater();\n\t\t\trow = inflater.inflate(LayoutId, parent, false);\n\t\t}\n\n\t\treturn row;\n\t}", "@Override\n public void initialiseUiRows() {\n }", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "protected static XmlElement getRowXml(XmlElement xml)\n {\n XmlElement xmlTemp = xml;\n while (xmlTemp.getElement(TAG_ROW) == null)\n {\n xmlTemp = xmlTemp.getParent();\n if (xmlTemp == null)\n {\n return null;\n }\n }\n return xmlTemp.getElement(TAG_ROW);\n }", "private View initView(int position, View convertView, ViewGroup parent) {\n View row = convertView;\n if (row == null) {\n LayoutInflater inflater = ((Activity) context).getLayoutInflater();\n row = inflater.inflate(resourceId, parent, false);\n }\n Scenario record = getItem(position);\n if (record != null) {\n TextView scenarioId = (TextView) row.findViewById(R.id.rowScenarioId);\n TextView scenarioName = (TextView) row.findViewById(R.id.rowScenarioName);\n TextView scenarioFileName = (TextView) row.findViewById(R.id.rowScenarioFile);\n TextView scenarioMime = (TextView) row.findViewById(R.id.rowScenarioMime);\n\n if (scenarioId != null) {\n scenarioId.setText(Integer.toString(record.getScenarioId()));\n }\n if (scenarioName != null) {\n scenarioName.setText(record.getScenarioName());\n }\n if (scenarioFileName != null) {\n scenarioFileName.setText(record.getFileName());\n }\n if (scenarioMime != null) {\n scenarioMime.setText(record.getMimeType());\n }\n }\n return row;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\t\tLayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\tView view = inflater.inflate(R.layout.list_item_table_row_read, parent, false);\n\t\t\tSet<Entry<String, JsonElement>> set = mTableRows[position].getAsJsonObject().entrySet();\n\t\t\tLinearLayout layoutItem = (LinearLayout) view.findViewById(R.id.layoutItem);\n\t\t\t//Loop through each data item in the row and create a layout with the key and \n\t\t\t//value displayed in TextViews within it\n\t\t\tfor (Entry<String, JsonElement> entry : set) {\n\t\t\t\tLog.i(TAG, entry.getKey());\t\t\t\t\n\t\t\t\tRelativeLayout rowLayout = new RelativeLayout(mContext);\n\t\t\t\tRelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\t\t\t\t\n\t\t\t\trowLayout.setLayoutParams(params);\t\t\t\t\n\t\t\t\tTextView lblKey = new TextView(mContext);\n\t\t\t\tlblKey.setText(entry.getKey());\t\t\t\t\n\t\t\t\tRelativeLayout.LayoutParams keyParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\t\tkeyParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n\t\t\t\tkeyParams.leftMargin = 20;\n\t\t\t\tlblKey.setLayoutParams(keyParams);\t\t\t\t\n\t\t\t\tTextView lblValue = new TextView(mContext);\t\t\t\t\n\t\t\t\tRelativeLayout.LayoutParams valueParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\t\tvalueParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);\n\t\t\t\tlblValue.setLayoutParams(valueParams);\n\t\t\t\t//Limit the amount of text we show so the UI isn't dirty\n\t\t\t\tInputFilter[] FilterArray = new InputFilter[1];\n\t\t\t\tFilterArray[0] = new InputFilter.LengthFilter(25);\n\t\t\t\tlblValue.setFilters(FilterArray);\n\t\t\t\tlblValue.setText(entry.getValue().getAsString());\n\t\t\t\tlblValue.setGravity(Gravity.RIGHT);\n\t\t\t\trowLayout.addView(lblKey);\n\t\t\t\trowLayout.addView(lblValue);\n\t\t\t\tlayoutItem.addView(rowLayout);\n\t\t\t}\t\t\t\n\t\t\treturn view;\n\t\t}", "@Override\n\tpublic View newView(Context arg0, Cursor arg1, ViewGroup arg2) {\n\t\tView row = (View) inflater.inflate(R.layout.list_row, arg2, false);\n\t\treturn row;\n\t}", "public void fillTheLayout() {\n for (int i = 0; i < ROW_COUNT; i++) {\n //these are horizontal linear layouts that will be part of the vertical linear layout, shown in XML\n LinearLayout sublinearLayout = new LinearLayout(this);\n LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.WRAP_CONTENT);\n layoutParams.weight = 1;\n\n sublinearLayout.setLayoutParams(layoutParams);\n //center align the contents\n sublinearLayout.setGravity(Gravity.CENTER);\n sublinearLayout.setPadding(PADDING, PADDING, PADDING, PADDING);\n\n for (int j = 0; j < COLUMN_COUNT; j++) {\n\n// Add the gifImageViews to the linear layout created above\n GifImageView gifImageView = new GifImageView(this);\n LinearLayout.LayoutParams imageViewlayoutParam = new LinearLayout.LayoutParams(\n ViewGroup.LayoutParams.WRAP_CONTENT,\n ViewGroup.LayoutParams.WRAP_CONTENT);\n imageViewlayoutParam.weight = 1;\n\n gifImageView.setLayoutParams(imageViewlayoutParam);\n //this padding helps in showing the white boundaries\n gifImageView.setPadding(PADDING, PADDING, PADDING, PADDING);\n //Similar to storing in row-major form, used that logic to set id's\n gifImageView.setId(i * COLUMN_COUNT + j);\n //main activity implements the onClick\n gifImageView.setOnClickListener(this);\n Block block = new Block(gifImageView);\n block.display();\n arrayList.add(block);\n sublinearLayout.addView(gifImageView);\n\n }\n linearLayout.addView(sublinearLayout);\n }\n //change grid's color, after initialising the layout\n changeColor();\n }", "private void setUpLayout() {\n myLinearLayout=(LinearLayout)rootView.findViewById(R.id.container_wartaMingguan);\n\n // Add LayoutParams\n params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n myLinearLayout.setOrientation(LinearLayout.VERTICAL);\n params.setMargins(0, 10, 0, 0);\n\n // Param untuk deskripsi\n paramsDeskripsi = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n myLinearLayout.setOrientation(LinearLayout.VERTICAL);\n paramsDeskripsi.setMargins(0, 0, 0, 0);\n\n tableParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);\n rowTableParams = new TableLayout.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n\n // Untuk tag \"warta\"\n LinearLayout rowLayout = new LinearLayout(getActivity());\n rowLayout.setOrientation(LinearLayout.HORIZONTAL);\n\n // Membuat linear layout vertical untuk menampung kata-kata\n LinearLayout colLayout = new LinearLayout(getActivity());\n colLayout.setOrientation(LinearLayout.VERTICAL);\n colLayout.setPadding(0, 5, 0, 0);\n }", "@Override\n public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n\n if (viewType == TYPE_ITEM) {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_row,parent,false); //Inflating the layout\n\n ViewHolder vhItem = new ViewHolder(v,viewType); //Creating ViewHolder and passing the object of type view\n\n return vhItem; // Returning the created object\n\n //inflate your layout and pass it to view holder\n\n } else if (viewType == TYPE_HEADER) {\n\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.header,parent,false); //Inflating the layout\n\n ViewHolder vhHeader = new ViewHolder(v,viewType); //Creating ViewHolder and passing the object of type view\n\n return vhHeader; //returning the object created\n\n\n }\n return null;\n\n }", "@Override\n protected void onFinishInflate() {\n super.onFinishInflate();\n\n //'this' refers to the LinearLayout, cause we are currently in LinearLayout\n\n //access the day UI element\n mTextDate = (TextView) this.findViewById(R.id.tv_day);\n\n //access the month UI element\n mTextMonth = (TextView) this.findViewById(R.id.tv_month);\n\n //access the year UI element\n mTextYear = (TextView) this.findViewById(R.id.tv_year);\n\n //setOnTouchListener on the UI elements\n\n mTextDate.setOnTouchListener(this);\n mTextMonth.setOnTouchListener(this);\n mTextYear.setOnTouchListener(this);\n\n //get the current date from the Calendar\n int date = mCalendar.get(Calendar.DATE);\n\n //get current month\n int month = mCalendar.get(Calendar.MONTH);\n\n //get current year\n int year = mCalendar.get(Calendar.YEAR);\n\n //pass the date, month and year to update method which will update the UI\n update(date, month, year, 0, 0, 0);\n\n\n }", "public RowListaCustomAdapter ( Context c, ArrayList<Row>data){\n Log.v(TAG, \"Construir Adaptador\");\n this.data = data;\n inflater = LayoutInflater.from(c);\n\n }", "com.google.monitoring.dashboard.v1.RowLayout getRowLayout();", "private void initView() {\n\n LayoutInflater inflater = getLayoutInflater();\n final int screenWidth = MyUtils.getScreenMetrics(this).widthPixels;\n final int screenHeight = MyUtils.getScreenMetrics(this).heightPixels;\n for (int i = 0; i < 3; i++) {\n ViewGroup layout = (ViewGroup) inflater.inflate(\n R.layout.content_layout, myHorizontal, false);\n layout.getLayoutParams().width = screenWidth;\n TextView textView = (TextView) layout.findViewById(R.id.title);\n textView.setText(\"page \" + (i + 1));\n layout.setBackgroundColor(Color.rgb(255 / (i + 1), 255 / (i + 1), 0));\n createList(layout);\n myHorizontal.addView(layout);\n }\n }", "public final void onFinishInflate() {\n super.onFinishInflate();\n TextView textView = (TextView) findViewById(C0126R.C0129id.title);\n this.f110062a = textView;\n C1280ps.m19893a(textView, \"excludeViewFromChangeBounds\");\n this.f110062a.setTag(C0126R.C0129id.summary_expander_transition_name, \"summaryField\");\n TextView textView2 = (TextView) findViewById(C0126R.C0129id.subtitle);\n this.f110063b = textView2;\n textView2.setTag(C0126R.C0129id.summary_expander_transition_name, \"summaryField\");\n LinearLayout linearLayout = (LinearLayout) findViewById(C0126R.C0129id.collapsed_image_container);\n this.f110064c = linearLayout;\n linearLayout.setTag(C0126R.C0129id.summary_expander_transition_name, \"summaryField\");\n LinearLayout linearLayout2 = (LinearLayout) findViewById(C0126R.C0129id.expanded_image_container);\n this.f110065d = linearLayout2;\n linearLayout2.setTag(C0126R.C0129id.summary_expander_transition_name, \"summaryField\");\n this.f110066e = (ImageView) findViewById(C0126R.C0129id.expand_collapse_icon);\n ImageWithCaptionView imageWithCaptionView = (ImageWithCaptionView) findViewById(C0126R.C0129id.tooltip_view);\n this.f110068g = imageWithCaptionView;\n imageWithCaptionView.setDefaultImageResId(bkfr.m105543a(getContext(), (int) ErrorInfo.TYPE_SDU_MEMORY_FULL, -1));\n this.f110068g.setOnClickListener(this);\n }", "protected abstract ReadCell<DataType> createItemCell(LayoutInflater inflater, View convertView, ViewGroup parent);", "@Override\n protected void onFinishInflate() {\n mRootView = getChildAt(0);\n super.onFinishInflate();\n }", "private void inflateRV(String latlng) {\n GridLayoutManager layoutManager = new GridLayoutManager(this, 2);\n //StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL);\n rvRestaurant.setHasFixedSize(true);\n rvRestaurant.setLayoutManager(layoutManager);\n\n (new AsyncTaskGetJSON(HomeActivity.this, rvRestaurant)).execute(latlng);\n\n }", "@Override\n public View getView(int position, View ConvertView, ViewGroup parent){ ///position starts from zero,one and goes on, parent would be the layout we want to display all elements\n View row=ConvertView; //to optimize we inflate the item only first else we recycle the view using converterView\n if(row==null) {\n LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\n //**View of which we want to convert to java view object\n row = inflater.inflate(R.layout.single_row, parent, false);\n }\n //*****From row view we can access the view items and populate it data\n ImageView imageView = (ImageView)row.findViewById(R.id.imageView);\n TextView myDiscription=(TextView)row.findViewById(R.id.myDescription);\n TextView myTitle=(TextView)row.findViewById(R.id.mytitle);\n\n imageView.setImageResource(images[position]); //postion will incremented automaticlly as views will populate\n myDiscription.setText(description[position]);\n myTitle.setText(titles[position]);\n\n return row;\n }", "private View createDarkCell(){\n return LayoutInflater.from(this.context).inflate(R.layout.back, this.tableRoot, false);\n }", "private void prepareViews() {\n mTextViewHeader = (TextView) mHeaderView.findViewById(R.id.tv_text_header_enhanced_listview);\n mTextViewFooter = (TextView) mFooterView.findViewById(R.id.tv_text_footer_enhanced_listview);\n mTextViewTime = (TextView) mHeaderView.findViewById(R.id.tv_time_update_header);\n\n mArrowHeader = mHeaderView.findViewById(R.id.arrow_header);\n mArrowFooter = mFooterView.findViewById(R.id.arrow_footer);\n\n mPbHeader = mHeaderView.findViewById(R.id.pb_header_enhanced_listview);\n mPbFooter = mFooterView.findViewById(R.id.pb_footer_enhanced_listview);\n\n }", "public void onFinishInflate() {\n super.onFinishInflate();\n this.mIconView = (ImageView) findViewById(R.id.icon);\n this.mTitleView = (TextView) findViewById(R.id.title);\n this.mSummaryView = (TextView) findViewById(R.id.summary);\n this.mSlidingButton = findViewById(R.id.sliding_button);\n }", "private View getCustomView(int position, View convertView, ViewGroup parent) {\n\n /********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/\n View row = inflater.inflate(R.layout.spinner_item_white, parent, false);\n\n TextView tv_item_name = (TextView) row.findViewById(R.id.tv_item_name);\n// ImageView iv_spinner_icon = (ImageView) row.findViewById(R.id.iv_spinner_icon);\n\n tv_item_name.setText(arrayList.get(position));\n// iv_spinner_icon.setImageResource(arrayIcons.getResourceId(position, -1));\n return row;\n }", "public ViewGroup getRowLayout(View rowView) {\r\n LinearLayout rowLayout = mLayout.getContainerRowLayout();\r\n rowLayout.addView(rowView);\r\n return rowLayout;\r\n }", "private void castLayoutElements() {\n linlaHeaderProgress = (LinearLayout) view.findViewById(R.id.linlaHeaderProgress);\n listPrinters = (RecyclerView) view.findViewById(R.id.listPrinters);\n linlaEmpty = (LinearLayout) view.findViewById(R.id.linlaEmpty);\n \n /* CONFIGURE THE RECYCLERVIEW */\n listPrinters.setHasFixedSize(true);\n LinearLayoutManager llm = new LinearLayoutManager(getActivity());\n llm.setOrientation(LinearLayoutManager.VERTICAL);\n listPrinters.setLayoutManager(llm);\n }", "@Override\n public CustomViewHolder onCreateViewHolder(ViewGroup parent, int type)\n {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_view, null, false);\n return new CustomViewHolder(view);\n }", "@Override\n public void init(LayoutInflater inflater, ViewGroup parent) {\n mView = inflater.inflate(R.layout.project_task_layout, parent, false);\n mTaskList = (ExpandableListView) mView.findViewById(R.id.task_list);\n// mTaskList.setHasFixedSize(true);\n// final LinearLayoutManager mLayoutManager = new LinearLayoutManager(inflater.getContext());\n// mTaskList.setLayoutManager(mLayoutManager);\n mProjectName = (TextView) mView.findViewById(R.id.project_name);\n\n final LinearLayout linearLayout = (LinearLayout) mView.findViewById(R.id.collapse_layout);\n\n mProjectName.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(linearLayout.getVisibility() == View.VISIBLE)\n collapse(linearLayout);\n else\n expand(linearLayout);\n\n }\n });\n\n mTaskList.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {\n @Override\n public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {\n // We call collapseGroupWithAnimation(int) and\n // expandGroupWithAnimation(int) to animate group\n // expansion/collapse.\n if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n return parent.expandGroup(groupPosition, true);\n }else\n\n return true;\n }\n });\n\n\n }", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n\n View view;\n\n view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_service_text, parent, false);\n\n mview=view;\n return new ViewHolder(view); // Inflater means reading a layout XML\n }", "@Override\n public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { //RECETA\n // create a new view\n LayoutInflater inflater = LayoutInflater.from (parent.getContext());\n View v = inflater.inflate(R.layout.row_layout, parent, false);\n // set the view's size, margins, paddings and layout parameters\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }", "private void initView() {\n // set layout for recycle view\n //hasFixedSize true if adapter changes cannot affect the size of the RecyclerView\n recyclerView.setHasFixedSize(true);\n // this layout can be vertical or horizontal by change the second param\n // of LinearLayoutManager, and display up to down by set the third param false\n LinearLayoutManager layoutManager = new LinearLayoutManager(this,\n LinearLayoutManager.VERTICAL, false);\n\n recyclerView.setLayoutManager(layoutManager);\n importData();\n // set adapter for recycle view\n recyclerView.setAdapter(alarmAdapter);\n }", "private void initView(){\n\n btnBack = (ImageView)findViewById(R.id.btnBack);\n btnQuit = (ImageView)findViewById(R.id.btnQuit);\n btnQuit.setVisibility(View.GONE);\n\n title = (TextView)this.findViewById(R.id.title);\n title.setText(R.string.assetInquire);\n barCode = (EditText)findViewById(R.id.barCode);\n\n loadAssetData = (ListView)findViewById(R.id.loadAssetData);\n\n hs_ledger_hslist = (HorizontalScrollView)findViewById(R.id.hs_ledger_hslist);\n initListViewHead(R.id.tv_list_table_tvhead1, false, rowName[0]);\n initListViewHead(R.id.tv_list_table_tvhead2, false, rowName[1]);\n initListViewHead(R.id.tv_list_table_tvhead3, false, rowName[2]);\n initListViewHead(R.id.tv_list_table_tvhead4, false, rowName[3]);\n initListViewHead(R.id.tv_list_table_tvhead5, false, rowName[4]);\n\n lvx = (ListViewEx)findViewById(R.id.lv_table_lvLedgerList);\n\n lvx.inital(R.layout.list_table_inquire, row, new int[]{\n R.id.tv_list_table_tvhead1,\n R.id.tv_list_table_tvhead2,\n R.id.tv_list_table_tvhead3,\n R.id.tv_list_table_tvhead4,\n R.id.tv_list_table_tvhead5\n });\n\n if (barCodeStr!=null&&!barCodeStr.trim().equals(\"\")){\n barCode.setText(barCodeStr);\n selBarCode();\n }\n }", "public FXMLTuple inflate()\n {\n FXMLLoader loader = new FXMLLoader(resource);\n try {\n return new FXMLTuple(loader.load(), loader.getController());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "public void inflate(){\n\t\tInflateTextContent();\n\t\tif(tempData.get(\"Media_Type\").equals(\"1\")){\n\t\t\tgenerateMediaView();\n\t\t}else if(tempData.get(\"Media_Type\").equals(\"2\")){\n\t\t\tprocessURL(2);\n\t\t}else if(tempData.get(\"Media_Type\").equals(\"3\")){\n\t\t\tprocessURL(3);\n\t\t}\t\n\t}", "@Override \n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.article_reader_layout, container, false);\n textView = (TextView)view.findViewById(R.id.text) ;\n return view;\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tinflater = LayoutInflater.from(getApplicationContext());\n\t}", "@Override\n\tprotected int initView() {\n\t\treturn R.layout.activity_zhusu_detail;\n\t}", "public void onFinishInflate() {\n super.onFinishInflate();\n this.mTextAndBackground = (ViewGroup) findViewById(C0622R.C0625id.text_and_background);\n ColorDrawable colorDrawable = (ColorDrawable) this.mTextAndBackground.getBackground();\n this.mBackgroundColor = colorDrawable.getColor();\n this.mTextAndBackground.setBackground(new RippleDrawable(ColorStateList.valueOf(Themes.getAttrColor(getContext(), 16843820)), colorDrawable, null));\n this.mTitleView = (TextView) this.mTextAndBackground.findViewById(C0622R.C0625id.title);\n this.mTextView = (TextView) this.mTextAndBackground.findViewById(C0622R.C0625id.text);\n }", "private void rowIterator(LinearLayout row, Bitmap image) {\n\n for (int position = 0; position < row.getChildCount(); position++) {\n\n ImageView placeHolder = (ImageView) row.getChildAt(position);\n\n if ( isPlaceHolderImage(placeHolder)) {\n placeHolder.setId(imagemid);\n //place_holder.setImageBitmap(Bitmap.createScaledBitmap(image,160,110,true));\n placeHolder.setImageBitmap(image);\n return;\n }\n }\n }", "boolean hasRowLayout();", "@Override\n protected void onFinishInflate() {\n super.onFinishInflate();\n mTitleContent = (TextView) findViewById(R.id.title_content);\n mLeftTv = (TextView) findViewById(R.id.title_left_tv);\n mRightTv = (TextView) findViewById(R.id.title_right_tv);\n mRightImg = (ImageView) findViewById(R.id.title_right_img);\n mMessageView = (RelativeLayout) findViewById(R.id.toolbar_message_view);\n mUnReadImg = (ImageView) findViewById(R.id.toolbar_message_unread_img);\n }", "public void loadIngredients(){\n llingerdientDetails.removeAllViews();\n for(int i = 0; i < llDishes.getChildCount();i++) {\n\n ((LinearLayout) llDishes.getChildAt(i).findViewById(R.id.llborderColor)).setBackgroundColor(Color.parseColor(\"#00800000\"));\n\n }\n //llborderColor_ingredients.setBackgroundColor(Color.parseColor(\"#800000\"));\n for(Dish dish: dinnerModel.getDishes()){\n\n for (Ingredient ing : dish.getIngredients()) {\n\n View ingtredientsItemView = layoutInflater.inflate(R.layout.ingredients_item_view,null);\n TextView txtingredientName = (TextView)ingtredientsItemView.findViewById(R.id.txtIngredientName);\n TextView txtingredientUnit = (TextView)ingtredientsItemView.findViewById(R.id.txtIngredientUnit);\n TextView txtingredientqty = (TextView)ingtredientsItemView.findViewById(R.id.txtIngredientqty);\n txtingredientName.setText(ing.getName());\n txtingredientqty.setText(Double.toString(Double.parseDouble(ing.getQuantity()) * dinnerModel.getNumberOfGuests()));\n txtingredientUnit.setText(ing.getUnit());\n llingerdientDetails.addView(ingtredientsItemView);\n }\n }\n }", "public void onFinishInflate() {\n super.onFinishInflate();\n this.mTvMain = (TextView) findViewById(R.id.tv_main);\n this.mTvSub = (TextView) findViewById(R.id.tv_second);\n this.mIvIcon = (ImageView) findViewById(R.id.iv_icon);\n this.mIvIcon.setVisibility(8);\n this.mTvSub.setMovementMethod(ScrollingMovementMethod.getInstance());\n }", "@Override\n public View newView(Context context, Cursor cursor, ViewGroup parent) {\n //inflate(XmlPullParser parser, ViewGroup root, boolean attachToRoot)\n //Inflate a new view hierarchy from the specified XML node\n return LayoutInflater.from(context).inflate(R.layout.list_item, parent, false);\n }", "public RowAdapter(Activity a, ArrayList pc_no_array, ArrayList lab_no_array,ArrayList status_array,ArrayList date_array,ArrayList desc_array) {\n activity = a;\n this.pc_no_array = pc_no_array;\n this.lab_no_array = lab_no_array;\n RowAdapter.status_array = status_array;\n this.date_array = date_array;\n this.desc_array = desc_array;\n inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\n }", "@Override\n public View newView (Context context, Cursor cursor, ViewGroup parent) {\n return LayoutInflater.from(context).inflate(R.layout.fragment_city_list_row, parent, false);\n }", "protected void inflate() {\n matrix.walkInOptimizedOrder(inflateVisitor);\n }", "@Override\n protected int getNormalLayoutResId() {\n return itemCommonBinder.layout;\n }", "public View getCustomView(int position, View convertView, ViewGroup parent) {\n \n /********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/\n \t\n View row = inflater.inflate(R.layout.spinner_rows, parent, false);\n \n /***** Get each Model object from Arraylist ********/\n tempValues = null;\n tempValues = (Province) data.get(position);\n \n TextView label = (TextView)row.findViewById(R.id.customprovince);\n //TextView sub = (TextView)row.findViewById(R.id.sub);\n /* if(position==0){\n // Default selected Spinner item\n label.setText(\"Please select company\");\n }\n else\n { // Set values for spinner each row\n label.setText(tempValues.getProvince_name());\n } */ \n label.setText(tempValues.getProvince_name());\n return row;\n }", "public void onFinishInflate() {\n super.onFinishInflate();\n bringChildToFront(this.menuButton);\n this.buttonsCount = getChildCount();\n createLabels();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n convertView = inflater.inflate(R.layout.fragment_homecircles, container, false);\n init();\n return convertView;\n }", "public void layout() {\n TitleLayout ll1 = new TitleLayout(getContext(), sourceIconView, titleTextView);\n\n // All items in ll1 are vertically centered\n ll1.setGravity(Gravity.CENTER_VERTICAL);\n ll1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n ll1.addView(sourceIconView);\n ll1.addView(titleTextView);\n\n // Container layout for all the items\n if (mainLayout == null) {\n mainLayout = new LinearLayout(getContext());\n mainLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n mainLayout.setPadding(adaptSizeToDensity(LEFT_PADDING),\n adaptSizeToDensity(TOP_PADDING),\n adaptSizeToDensity(RIGHT_PADDING),\n adaptSizeToDensity(BOTTOM_PADDING));\n mainLayout.setOrientation(LinearLayout.VERTICAL);\n }\n\n mainLayout.addView(ll1);\n\n if(syncModeSet) {\n mainLayout.addView(syncModeSpinner);\n }\n\n this.addView(mainLayout);\n }", "public LinearLayout rootView(){\n buttonIndex = 0;\n buttonPayIndex = 0;\n buttonFunctionIndex = 0;\n\n\n LinearLayout lrl = new LinearLayout(getContext());\n LinearLayout.LayoutParams rlp = new LinearLayout.LayoutParams(\n LinearLayout.LayoutParams.MATCH_PARENT,\n LinearLayout.LayoutParams.MATCH_PARENT);\n rlp.setMargins(0,5,0,0);\n lrl.setLayoutParams(rlp);\n lrl.setOrientation(LinearLayout.VERTICAL);\n lrl.setBackgroundColor(getResources().getColor(R.color.colorPrimary));\n lrl.setWeightSum(rows);\n\n for(int index = 0; index < rows; index++){\n lrl.addView(createLinearLayout());\n }\n return lrl;\n }", "public TableLayout loadUserList(ArrayList<User> row, String [] cv, int columnCount){\n TableLayout.LayoutParams tableLayoutParams = new TableLayout.LayoutParams();\n TableLayout tableLayout = new TableLayout(this);\n\n\n // 2) create tableRow params\n TableRow.LayoutParams tableRowParams = new TableRow.LayoutParams();\n tableRowParams.setMargins(5, 5, 5, 5);\n tableRowParams.weight = 1;\n\n int count = 1;\n\n for (int i = 0; i < rowCount; i++)\n {\n // 3) create tableRow\n TableRow tableRow = new TableRow(this);\n\n\n for (int j= 0; j <= columnCount; j++)\n {\n // 4) create textView\n TextView textView = new TextView(this);\n EditText editText = new EditText(this);\n editText.setBackgroundColor(Color.TRANSPARENT);\n editText.setGravity(Gravity.CENTER);\n editText.setEnabled(false);\n\n // textView.setText(String.valueOf(j));\n textView.setBackgroundColor(Color.WHITE);\n textView.setGravity(Gravity.CENTER);\n\n\n\n if (i ==0 && j==0)\n {\n textView.setText(\"No/Info\");\n tableRow.addView(textView, tableRowParams);\n }\n else if(i==0)\n {\n\n textView.setText(cv[j-1]);\n tableRow.addView(textView, tableRowParams);\n }\n else if( j==0)\n {\n\n textView.setText(Integer.toString(count));\n tableRow.addView(textView, tableRowParams);\n count = count +1;\n }\n else\n {\n // \"Tên người dùng\", \"Email\", \"Ngày sinh\",\"Giới tính\", \"Loại tài khoản\",\n ;\n switch (j){\n case 1:\n editText.setText(row.get(i).name);\n tableRow.addView(editText, tableRowParams);\n break;\n case 2:\n editText.setText(row.get(i).email);\n tableRow.addView(editText, tableRowParams);\n break;\n case 3:\n editText.setText(row.get(i).date);\n tableRow.addView(editText, tableRowParams);\n break;\n case 4:\n editText.setText(row.get(i).gender);\n tableRow.addView(editText, tableRowParams);\n break;\n case 5:\n editText.setText(row.get(i).role);\n tableRow.addView(editText, tableRowParams);\n break;\n\n case 6:\n Button btn=new Button(this);\n btn.setId(1);\n btn.setText(\"Ban\");\n btn.setLayoutParams(new TableLayout.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT));\n tableRow.addView(btn, tableRowParams);\n break;\n case 7:\n Button btn2=new Button(this);\n btn2.setId(2);\n btn2.setText(\"Change\");\n btn2.setLayoutParams(new TableLayout.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT));\n tableRow.addView(btn2, tableRowParams);\n break;\n default:\n break;\n\n }\n\n\n }\n\n }\n\n // 6) add tableRow to tableLayout\n tableLayout.addView(tableRow, tableLayoutParams);\n }\n\n return tableLayout;\n\n\n // --------------------------end of headers ----------------------\n\n }", "public void onFinishInflate() {\n super.onFinishInflate();\n this.logo = findViewById(C1167R.C1170id.channel_logo);\n this.logoTitle = findViewById(C1167R.C1170id.logo_title);\n this.actionsHint = findViewById(C1167R.C1170id.actions_hint);\n this.sponsoredChannelBackground = findViewById(C1167R.C1170id.sponsored_channel_background);\n this.channelViewMainLinearLayout = findViewById(C1167R.C1170id.main_linear_layout);\n }", "@Override\n\tpublic int bindLayout() {\n\t\treturn R.layout.activity_init;\n\t}", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tif (mObjView == null) {\n\t\t\tmObjView = inflater.inflate(R.layout.jeep_airset, container, false);\n\t\t\tinit();\n\t\t}\n\n\t\treturn mObjView;\n\t}", "@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)\n public void init(View v) {\n\n LinearLayout li1 = (LinearLayout) v.findViewById(R.id.table_main);\n\n TableRow tbrow0 = new TableRow(getActivity());\n tbrow0.setPadding(10, 15, 15, 15);\n\n TextView tv0 = new TextView(getActivity());\n tv0.setText(\" Sl.No \");\n tv0.setTextSize(20);\n tv0.setTextColor(Color.BLACK);\n tbrow0.addView(tv0);\n\n TextView tv1 = new TextView(getActivity());\n tv1.setText(\" Name \");\n tv1.setTextSize(20);\n tv1.setTextColor(Color.BLACK);\n tbrow0.addView(tv1);\n\n TextView tv2 = new TextView(getActivity());\n tv2.setText(\" Field \");\n tv2.setTextSize(20);\n tv2.setTextColor(Color.BLACK);\n tbrow0.addView(tv2);\n\n li1.addView(tbrow0);\n\n\n for (int i = 0; i < name.length; i++) {\n TableRow tbrow = new TableRow(getActivity());\n TextView t1v = new TextView(getActivity());\n\n ShapeDrawable shape = new ShapeDrawable(new RectShape());\n shape.getPaint().setColor(Color.RED);\n shape.getPaint().setStyle(Paint.Style.STROKE);\n shape.getPaint().setStrokeWidth(3);\n\n tbrow.setPadding(10, 15, 15, 15);\n // Assign the created border to EditText widget\n // tbrow.setBackground(shape);\n t1v.setText(\"\" + i);\n t1v.setTextColor(Color.BLACK);\n t1v.setGravity(Gravity.CENTER);\n\n tbrow.addView(t1v);\n TextView t2v = new TextView(getActivity());\n t2v.setText(name[i] + i);\n t2v.setTextColor(Color.BLACK);\n t2v.setGravity(Gravity.CENTER);\n tbrow.addView(t2v);\n\n TableRow.LayoutParams lparams = new TableRow.LayoutParams(400, ViewGroup.LayoutParams.WRAP_CONTENT);\n EditText edT_v = new EditText(getActivity());\n edT_v.setLayoutParams(lparams);\n edT_v.setBackground(shape);\n\n edT_v.setTextColor(Color.BLACK);\n edT_v.setGravity(Gravity.CENTER);\n\n\n tbrow.addView(edT_v);\n li1.addView(tbrow);\n }\n\n }", "@Override\n public rViewHolder onCreateViewHolder(ViewGroup parent, int viewType)\n {\n View view = mInflater.inflate(R.layout.recycler_row, parent, false);\n return new rViewHolder(view);\n }", "@NonNull\n @Override\n public HorizontalViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {\n View view= LayoutInflater.from(context).inflate(R.layout.row_data,null);\n return new HorizontalViewHolder(view);\n }", "protected void onLoadLayout(View view) {\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.activity_recetas, parent, false);\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Purchase purchase = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n ViewHolder viewHolder; // view lookup cache stored in tag\n\n final View result;\n\n if (convertView == null) {\n\n viewHolder = new ViewHolder();\n LayoutInflater inflater = LayoutInflater.from(getContext());\n convertView = inflater.inflate(R.layout.history_purchase, parent, false);\n viewHolder.purchaseID = (TextView) convertView.findViewById(R.id.purchase_id);\n viewHolder.purchaseDate = (TextView) convertView.findViewById(R.id.purchase_date);\n viewHolder.totalPrice = (TextView) convertView.findViewById(R.id.purchase_price);\n viewHolder.paidPrice = (TextView) convertView.findViewById(R.id.purchase_paid_price);\n viewHolder.purchaseProducts = (LinearLayout) convertView.findViewById(R.id.purchase_prdsucts);\n viewHolder.item = (LinearLayout) convertView.findViewById(R.id.item);\n\n result=convertView;\n\n convertView.setTag(viewHolder);\n } else {\n viewHolder = (ViewHolder) convertView.getTag();\n result=convertView;\n }\n\n viewHolder.purchaseID.setText(purchase.getUuid().toString().substring(0, 6));\n viewHolder.purchaseDate.setText(purchase.getDateString());\n viewHolder.totalPrice.setText(String.format (\"%.2f\", purchase.getTotalPrice()) +\"€\");\n viewHolder.paidPrice.setText(String.format (\"%.2f\", purchase.getPaidPrice()) +\"€\");\n viewHolder.purchaseProducts.removeAllViews();\n\n for(int i = 0; i < purchase.getProducts().size(); i++){\n TextView textView = new TextView(this.mContext);\n textView.setText(purchase.getProducts().get(i).getName() + \" - \" + String.format (\"%.2f\", purchase.getProducts().get(i).getPrice())+\"€\");\n textView.setTextSize((float) 17);\n textView.setTextColor(Color.parseColor(\"#003845\"));\n Typeface font = Typeface.createFromAsset(mContext.getAssets(), \"raleway.ttf\");\n textView.setTypeface(font);\n\n LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n params.setMargins(0,0,0,10);\n textView.setLayoutParams(params);\n\n viewHolder.purchaseProducts.addView(textView);\n }\n\n //EXTRA FEATURE\n viewHolder.item.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n LinearLayout itemView = (LinearLayout) v;\n TextView objectID = (TextView) itemView.findViewById(R.id.purchase_id);\n\n Toast.makeText(mContext, \"ID: \" + objectID.getText(), Toast.LENGTH_SHORT).show();\n\n Preferences preferences = new Preferences(mContext);\n ArrayList<Purchase> history = new ArrayList<>();\n try {\n history = preferences.getPurchases();\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n ArrayList<Product> newProducts = new ArrayList<>();\n for(int i=0; i<history.size(); i++){\n String id = history.get(i).getUuid().toString().substring(0, 6);\n if(objectID.getText().equals(id)){\n newProducts = history.get(i).getProducts();\n break;\n }\n }\n\n try {\n ArrayList<Product> basketP = null;\n basketP = preferences.getBasket();\n\n if (basketP.size() + newProducts.size() <= 10) {\n for (int i = 0; i < newProducts.size(); i++) {\n basketP.add(newProducts.get(i));\n }\n\n preferences.saveBasket(basketP);\n Toast.makeText(mContext, \"Products added to your basket with success.\", Toast.LENGTH_SHORT).show();\n }\n else{\n Toast.makeText(mContext, \"You can only have 10 items in basket.\", Toast.LENGTH_SHORT).show();\n }\n\n } catch (JSONException e) {\n Toast.makeText(mContext, \"There was a problem adding products to basket, please try again.\", Toast.LENGTH_LONG).show();\n }\n }\n });\n\n return convertView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.layout_number_full,container,false);\n itemView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n\tpublic TiUIView createView(Activity activity)\n\t{\n\t\tif (placeholder) {\n\n\t\t\t// Placeholder for header or footer, do not create view.\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new RowView(this);\n\t}", "@Override\n public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n initRow1();\n setScrollRow2();\n if(typeSprint.equals(getString(R.string.mon1_col2_row1))){\n initRow2(getString(R.string.mon1_col2_row1)\n ,getString(R.string.mon1_col2_row2),getString(R.string.mon1_col2_row3),\n getString(R.string.mon1_col2_row4),\n getString(R.string.mon1_col2_row5),getString(R.string.mon1_col2_row6),\n getString(R.string.mon1_col2_row7),getString(R.string.mon1_col2_row8));\n } else if( typeSprint.equals(getString(R.string.mon1_col3_row1))){\n initRow2(getString(R.string.mon1_col3_row1)\n ,getString(R.string.mon1_col3_row2),getString(R.string.mon1_col3_row3),\n getString(R.string.mon1_col3_row4),\n getString(R.string.mon1_col3_row5),getString(R.string.mon1_col3_row6),\n getString(R.string.mon1_col3_row7),getString(R.string.mon1_col3_row8));\n } else if( typeSprint.equals(getString(R.string.mon1_col4_row1))){\n initRow2(getString(R.string.mon1_col4_row1)\n ,getString(R.string.mon1_col4_row2),getString(R.string.mon1_col4_row3),\n getString(R.string.mon1_col4_row4),\n getString(R.string.mon1_col4_row5),getString(R.string.mon1_col4_row6),\n getString(R.string.mon1_col4_row7),getString(R.string.mon1_col4_row8));\n }\n else if( typeSprint.equals(getString(R.string.mon1_col5_row1))){\n initRow2(getString(R.string.mon1_col5_row1)\n ,getString(R.string.mon1_col5_row2),getString(R.string.mon1_col5_row3),\n getString(R.string.mon1_col5_row4),\n getString(R.string.mon1_col5_row5),getString(R.string.mon1_col5_row6),\n getString(R.string.mon1_col5_row7),getString(R.string.mon1_col5_row8));\n } else if( typeSprint.equals(getString(R.string.tue1_col2_row1))){\n initRow2(getString(R.string.tue1_col2_row1)\n ,getString(R.string.tue1_col2_row2),getString(R.string.tue1_col2_row3),\n getString(R.string.tue1_col2_row4),\n getString(R.string.tue1_col2_row5),getString(R.string.tue1_col2_row6),\n getString(R.string.tue1_col2_row7),getString(R.string.tue1_col2_row8));\n } else if( typeSprint.equals(getString(R.string.mon2_col2_row1))){\n initRow2(getString(R.string.mon2_col2_row1)\n ,getString(R.string.mon2_col2_row2),getString(R.string.mon2_col2_row3),\n getString(R.string.mon2_col2_row4),\n getString(R.string.mon2_col2_row5),getString(R.string.mon2_col2_row6),\n getString(R.string.mon2_col2_row7),getString(R.string.mon2_col2_row8));\n } else if( typeSprint.equals(getString(R.string.thu2_col2_row1))){\n initRow2(getString(R.string.thu2_col2_row1)\n ,getString(R.string.thu2_col2_row2),getString(R.string.thu2_col2_row3),\n getString(R.string.thu2_col2_row4),\n getString(R.string.thu2_col2_row5),getString(R.string.thu2_col2_row6),\n getString(R.string.thu2_col2_row7),getString(R.string.thu2_col2_row8));\n }\n else if( typeSprint.equals(getString(R.string.fri2_col3_row1))){\n initRow2(getString(R.string.fri2_col3_row1)\n ,getString(R.string.fri2_col3_row2),getString(R.string.fri2_col3_row3),\n getString(R.string.fri2_col3_row4),\n getString(R.string.fri2_col3_row5),getString(R.string.fri2_col3_row6),\n getString(R.string.fri2_col3_row7),getString(R.string.fri2_col3_row8));\n }if( typeSprint.equals(getString(R.string.fri2_col2_row1))){\n initRow2(getString(R.string.fri2_col2_row1)\n ,getString(R.string.fri2_col2_row2),getString(R.string.fri2_col2_row3),\n getString(R.string.fri2_col2_row4),\n getString(R.string.fri2_col2_row5),getString(R.string.fri2_col2_row6),\n getString(R.string.fri2_col2_row7),getString(R.string.fri2_col2_row8));\n }\n\n\n }", "private View inflateSectionView(RecyclerView parent) {\n trace();\n return LayoutInflater.from(parent.getContext())\n .inflate(R.layout.app_list_section, parent, false);\n }", "private void createAndAddViews() {\n \t\t// Create the layout parameters for each field\n \t\tfinal LinearLayout.LayoutParams labelParams = new LinearLayout.LayoutParams(\n \t\t\t\t0, LayoutParams.WRAP_CONTENT, 0.3f);\n \t\tlabelParams.gravity = Gravity.RIGHT;\n \t\tlabelParams.setMargins(0, 25, 0, 0);\n \t\tfinal LinearLayout.LayoutParams valueParams = new LinearLayout.LayoutParams(\n \t\t\t\t0, LayoutParams.WRAP_CONTENT, 0.7f);\n \t\tvalueParams.gravity = Gravity.LEFT;\n \t\tvalueParams.setMargins(0, 25, 0, 0);\n \n \t\t// Add a layout and text views for each property\n \t\tfor (final StockProperty property : m_propertyList) {\n \t\t\tLog.d(TAG, \"Adding row for property: \" + property.getPropertyName());\n \n \t\t\t// Create a horizontal layout for the label and value\n \t\t\tfinal LinearLayout layout = new LinearLayout(this);\n \t\t\tlayout.setLayoutParams(new LinearLayout.LayoutParams(\n \t\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));\n \n \t\t\t// Create a TextView for the label\n \t\t\tfinal TextView label = new TextView(this);\n \t\t\tlabel.setLayoutParams(labelParams);\n \t\t\tlabel.setText(property.getLabelText());\n \t\t\tlabel.setTextAppearance(this, android.R.style.TextAppearance_Medium);\n \t\t\tlayout.addView(label);\n \n \t\t\t// Configure and add the value TextView (created when the property\n \t\t\t// was constructed)\n \t\t\tfinal TextView value = property.getView();\n \t\t\tvalue.setLayoutParams(valueParams);\n \t\t\tvalue.setHint(\"None\");\n \t\t\tvalue.setTextAppearance(this, android.R.style.TextAppearance_Medium);\n \t\t\tvalue.setTypeface(null, Typeface.BOLD);\n \t\t\tlayout.addView(value);\n \n \t\t\t// Add the row to the main layout\n \t\t\tm_resultsLayout.addView(layout);\n \t\t}\n \t}", "static public View inflateLayout(int Presid,View PlayoutView) //~1410I~\r\n { //~1410I~\r\n if (Dump.Y) Dump.println(\"AView:inflateLayout2 res=\"+Integer.toHexString(Presid)+\",view=\"+PlayoutView.toString());//~@@@@R~\r\n \tAG.setCurrentView(Presid,PlayoutView); //~1410I~\r\n return PlayoutView; //~1410I~\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\tView v=inflater.inflate(R.layout.notepad_main, container, false);\r\n\t\tbody=(LineEditText) v.findViewById(R.id.body);\r\n\t\tdel=(Button) v.findViewById(R.id.delAll);\r\n\t\tdel.setOnClickListener(this);\r\n\t\treturn v;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\t\n\t\tView arrangeOrderLayout = inflater.inflate(R.layout.arrange_order, container, false);\n\t\tinitButton(arrangeOrderLayout);\n\t\tinitListView(arrangeOrderLayout);\n\t\treturn arrangeOrderLayout;\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tView layout3_item = inflater.inflate(R.layout.layout4_lvitem,null);\n\t\treturn layout3_item;\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent)\n {\n //position = position of array element\n //this function will pick the first value of array\n //we give it the theme of a single row\n //it implements that theme, makes a row graphic and returns back to OS\n //OS prints it on screen\n //we make an xml file\n //supply data to this function\n //and create the custom list\n //this code runs for every element in the array\n View row=null;\n LayoutInflater li = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n //OS uses this service to display graphic\n //We customise the theme and use that service to display our theme\n //only one function to get system services and modiffy it\n //we can either learn all the names of internal services\n //or you press ctrl plus space after context.\n row = li.inflate(R.layout.activity_custom_list,parent,false);\n ImageView iv = (ImageView)row.findViewById(R.id.imageView); //row - pehli line ka variable\n //xml se row bana\n\n TextView tv1 = (TextView)row.findViewById(R.id.textView1);\n TextView tv2 = (TextView)row.findViewById(R.id.textView2);\n tv1.setText(nameArray[position]);\n tv2.setText(infoArray[position]);\n\n if(position%2==0)\n iv.setImageResource(android.R.drawable.star_big_on);\n else\n iv.setImageResource(android.R.drawable.star_big_off);\n\n return row;\n\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.read_layout,container,false);\n mContext = view.getContext();\n if(readPresenter ==null)\n readPresenter = new ReadPresenter(getContext(),this);\n initUI(view);\n return view;\n\n }", "public void addRow(String itemName, String itemPrice, String username) {\n LinearLayout parentLayout = findViewById(R.id.itemList);\n\n // Create layout for new item\n LinearLayout l = new LinearLayout(this);\n l.setOrientation(LinearLayout.HORIZONTAL);\n LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100);\n layoutParams.bottomMargin = 10;\n l.setBackgroundResource(R.drawable.customborder);\n l.setLayoutParams(layoutParams);\n\n // Create item_name textview\n TextView name_textview = new TextView(this);\n name_textview.setText(itemName);\n name_textview.setTextSize(24);\n LinearLayout.LayoutParams nameParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n nameParams.weight = 1;\n name_textview.setLayoutParams(nameParams);\n\n // Create price textview\n TextView price_textview = new TextView(this);\n price_textview.setText(\"$\"+itemPrice);\n price_textview.setTextSize(24);\n LinearLayout.LayoutParams priceParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n priceParams.weight = 1;\n price_textview.setLayoutParams(priceParams);\n\n // Create username textview\n TextView username_textview = new TextView(this);\n username_textview.setText(username);\n username_textview.setTextSize(24);\n LinearLayout.LayoutParams usernameParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n usernameParams.weight = 1;\n username_textview.setLayoutParams(usernameParams);\n\n // Add views to layout\n l.addView(name_textview);\n l.addView(price_textview);\n l.addView(username_textview);\n parentLayout.addView(l);\n\n }", "@Override\n public listAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n // create a new view\n LayoutInflater inflater = LayoutInflater.from(parent.getContext());\n View v = inflater.inflate(R.layout.row_layout, parent, false);\n // set the view's size, margins, paddings and layout parameters\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "private void initViews() {\n user_name = (LinearLayout)findViewById(R.id.user_name);\n user_photo = (LinearLayout)findViewById(R.id.user_photo);\n user_sex = (LinearLayout)findViewById(R.id.user_sex);\n user_notes = (LinearLayout)findViewById(R.id.user_notes);\n name = (TextView)findViewById(R.id.name);\n sex = (TextView)findViewById(R.id.sex);\n notes = (TextView)findViewById(R.id.notes);\n email = (TextView)findViewById(R.id.email);\n photo = (ImageView)findViewById(R.id.photo);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_four_in_row, container, false);\n board = new Board(numberOfRows, numberOfColumns);\n viewHolder = new ViewHolder();\n initUi(view);\n buildCells();\n boardView.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n switch (motionEvent.getAction()) {\n case MotionEvent.ACTION_POINTER_UP:\n case MotionEvent.ACTION_UP: {\n int col = colAtX(motionEvent.getX());\n if (col != -1)\n drop(col);\n }\n }\n return true;\n }\n });\n\n viewHolder.redPlayerWinTextView.setText(\"0\");\n viewHolder.yellowPlayerWinTextView.setText(\"0\");\n viewHolder.turnIndicatorImageView.setImageResource(resourceForTurn());\n\n viewHolder.resetButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (snackbar != null){\n snackbar.dismiss();\n }\n reset();\n }\n });\n return view;\n }", "public void setSoundBoardLayout() {\n\n soundBoardList = new SoundBoardListType();\n soundBoardList = db.getAllSoundboards();\n soundBoardNames = new ArrayList();\n\n for (int i = 0; i < soundBoardList.getSoundBoardList().size(); i++) {\n soundBoardNames.add(soundBoardList.getSoundBoardList().get(i).getSoundBoardName());\n }\n\n soundBoardNames.add(\"+\");\n setContentView(R.layout.main_grid);\n GridView gridView = (GridView) findViewById(R.id.soundboardgrid);\n\n soundBoardListAdapter = new ArrayAdapter<String>(this, R.layout.main_sbrowtext, soundBoardNames);\n gridView.setAdapter(soundBoardListAdapter);\n gridView.setOnItemClickListener(openSoundBoardListener);\n gridView.setOnItemLongClickListener(editSoundBoardListener);\n gridView.setBackgroundColor(Color.BLACK);\n gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);\n gridView.getSelector().setAlpha(100);\n\n }", "private void initLayouts() {\n mRelativeLayout1WA = findViewById(R.id.history_layout_one_week_ago);\n mRelativeLayout6DA = findViewById(R.id.history_layout_six_days_ago);\n mRelativeLayout5DA = findViewById(R.id.history_layout_five_days_ago);\n mRelativeLayout4DA = findViewById(R.id.history_layout_four_days_ago);\n mRelativeLayout3DA = findViewById(R.id.history_layout_three_days_ago);\n mRelativeLayout2DA = findViewById(R.id.history_layout_two_days_ago);\n mRelativeLayoutY = findViewById(R.id.history_layout_yesterday);\n\n layoutsList.add(mRelativeLayoutY);\n layoutsList.add(mRelativeLayout2DA);\n layoutsList.add(mRelativeLayout3DA);\n layoutsList.add(mRelativeLayout4DA);\n layoutsList.add(mRelativeLayout5DA);\n layoutsList.add(mRelativeLayout6DA);\n layoutsList.add(mRelativeLayout1WA);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.day_layout, container,false);\n setPieMap(v);\n loadDatas();\n simulator();\n return v;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\tv = inflater.inflate(R.layout.wisata, container, false);\r\n \r\n\t\t\r\n\t\t\r\n\t\treturn v;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.item_error, container, false);\n ImageButton b = (ImageButton) v.findViewById(R.id.button_reload_feed);\n\n if (mParent != null) {\n b.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n mParent.launchParser();\n }\n });\n }\n\n return v;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@Override\n protected void loadViewLayout() {\n setContentView(R.layout.ui_imgs_graffit);\n }", "@Override\n\tprotected void loadXml() {\n\t\tsetContentView(R.layout.activity_my_message);\n\t}", "@Override\n public View newView(Context context, Cursor cursor, ViewGroup parent) {\n return LayoutInflater.from(context).inflate(R.layout.todo_row, parent, false);\n }", "@Override\n protected void onLayout(boolean changed, int l, int t, int r, int b) {\n Log.v(TAG, \"onLayout l = \" + l + \"; t = \" + t + \"; r = \" + r + \"; b = \" + b);\n int count = getChildCount();\n int x = l;\n int y = t;\n for(int i = 0; i < count; i++){\n View child = (View)getChildAt(i);\n child.layout(x, y, x + r, y + b);\n x = x + r;\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.activity_click_product_layout, container, false);\n\n ivList=view.findViewById(R.id.iv_list);\n txtProductDescription=view.findViewById(R.id.txt_productDescription);\n txtShowOfeerPrice=view.findViewById(R.id.txt_showOfferPrice);\n txtShowPrice=view.findViewById(R.id.txt_showPrice);\n txtTitleName=view.findViewById(R.id.tv_list_name);\n edtEnterPinCode=view.findViewById(R.id.edt_enterPinCode);\n\n return view;\n }" ]
[ "0.645677", "0.6258364", "0.622229", "0.61107755", "0.60473514", "0.6013297", "0.59874105", "0.59793854", "0.5914407", "0.58773446", "0.5855177", "0.5851475", "0.5804275", "0.5747948", "0.5723981", "0.56306106", "0.5621535", "0.5604664", "0.5578105", "0.5576324", "0.555116", "0.55477303", "0.554185", "0.55260724", "0.55224144", "0.5521978", "0.54929996", "0.5440011", "0.54247934", "0.5415741", "0.5411068", "0.5410932", "0.5405517", "0.54046977", "0.5397782", "0.53891563", "0.5373334", "0.5363626", "0.53435796", "0.53351396", "0.53287774", "0.5315359", "0.5303277", "0.52982444", "0.52979803", "0.52946335", "0.5293818", "0.52708894", "0.52631766", "0.5253217", "0.5232454", "0.52265954", "0.52121377", "0.520659", "0.52027494", "0.5202347", "0.5192779", "0.5189484", "0.5189433", "0.51889926", "0.51800984", "0.51709867", "0.5170121", "0.5165937", "0.5162668", "0.516082", "0.51591843", "0.514897", "0.5142383", "0.5141916", "0.5127805", "0.5125285", "0.5123571", "0.51229286", "0.51222163", "0.51190275", "0.51117104", "0.51078594", "0.5101862", "0.5091568", "0.5090232", "0.50877273", "0.5086598", "0.508274", "0.50814575", "0.50786084", "0.5076822", "0.5075465", "0.50722706", "0.50670296", "0.5064054", "0.50596285", "0.5058445", "0.505665", "0.5054615", "0.50537384", "0.50516987", "0.50460386", "0.5044669", "0.5043162", "0.50387144" ]
0.0
-1
binds the data to the TextView in each row
@Override public void onBindViewHolder(ViewHolder holder, final int position) { holder.exam_title.setText(mData.get(position).getName()); holder.teacher_exam_name.setText(mData.get(position).getTeacherEmail()); holder.exam_layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(context , ExamSettingsActivity.class); i.putExtra("id" ,mData.get(position).getId() ) ; i.putExtra("max_score" ,mData.get(position).getMaxScore() ) ; i.putExtra("name" ,mData.get(position).getName() ) ; i.putExtra("teacher_email" ,mData.get(position).getTeacherEmail() ) ; context.startActivity(i); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void populateTextViews() {\n full_name_tv.setText(contact.getFullName());\n school_tv.setText(contact.getSchool());\n department_tv.setText(getDepartmentString());\n email.setText(contact.getEmail());\n number_tv.setText(contact.getNumber());\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}", "public void addData(){\n Typeface mtypeFace = Typeface.createFromAsset(getAssets(),\n \"fonts/Lato-Regular.ttf\");\n if (dummy != 0) {\n dummy--;\n }\n int value = dummy;\n for (int i = value; i < repdataresponselist.size()&&i<(dummy+20); i++)\n\n {\nvalue++;\n /** Create a TableRow dynamically **/\n\n tr = new TableRow(this);\n /*if (i % 2 == 0) {*/\n/*\n } else {\n tr.setBackgroundResource(R.color.grey);\n\n }*/\n ReportsDataResponse reportdataobj=repdataresponselist.get(i);\n ArrayList<String> responsestrarr=new ArrayList<>();\n responsestrarr.add(reportdataobj.getBkRefid());\n\n responsestrarr.add(reportdataobj.getStatus());\n responsestrarr.add(reportdataobj.getSource());\n\n responsestrarr.add(reportdataobj.getBookingtype());\n\n responsestrarr.add(reportdataobj.getBookingdate());\n responsestrarr.add(reportdataobj.getPNR());\n responsestrarr.add(reportdataobj.getName());\n responsestrarr.add(reportdataobj.getAirline());\n responsestrarr.add(reportdataobj.getFrom());\n responsestrarr.add(reportdataobj.getTo());\n responsestrarr.add(reportdataobj.getClasstype());\n responsestrarr.add(reportdataobj.getTriptype());\n responsestrarr.add(reportdataobj.getTotalpax());\n responsestrarr.add(reportdataobj.getTotalfare());\n\n for (int j = 0; j < 14; j++) {\n\ntry {\n\n tr.setLayoutParams(new LayoutParams(\n\n LayoutParams.FILL_PARENT,\n\n LayoutParams.WRAP_CONTENT));\n\n /** Creating a TextView to add to the row **/\n companyTV = new TextView(this);\n\n\n\n\n companyTV.setText(responsestrarr.get(j));\n\n companyTV.setTextColor(Color.parseColor(\"#000000\"));\n\n companyTV.setTypeface(mtypeFace);\n\n companyTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));\n\n if(j==1)\n {\n\n switch(responsestrarr.get(j)) {\n case \"Confirmed\":\n companyTV.setBackgroundColor(Color.parseColor(\"#fdba52\"));\n\n break;\n case \"Ticketed\":\n companyTV.setBackgroundColor(Color.parseColor(\"#b9eeb9\"));\n\n break;\n case \"Cancelled\":\n companyTV.setBackgroundColor(Color.parseColor(\"#f6bcbc\"));\n\n break;\n case \"Booking Started\":\n companyTV.setBackgroundColor(Color.parseColor(\"#e6c295\"));\n\n break;\n\n }\n }\n\n\n switch (j)\n {\n case 2:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n case 3:\n companyTV.setPadding(50, 30, 5, 30);\n break;\n case 7:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n case 8:\n companyTV.setPadding(25, 30, 5, 30);\n break;\n case 12:\n companyTV.setPadding(70, 30, 5, 30);\n break;\n case 13:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n\n /* case 11:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n case 12:\n companyTV.setPadding(40, 30, 5, 30);\n break;*/\n default:\n companyTV.setPadding(20, 30, 5, 30);\n\n break;\n\n\n\n\n\n\n\n }\n\n\n tr.addView(companyTV); // Adding textView to tablerow.\n\n tl.addView(tr, new TableLayout.LayoutParams(\n\n LayoutParams.FILL_PARENT,\n\n LayoutParams.WRAP_CONTENT));\n}\ncatch (Exception e)\n{\n e.printStackTrace();\n}\n\n\n }\n\n }\n dummy=value;\ntabledata=getHtmlData();\n\n }", "private void addData(){\n\n for (Recipe obj : frecipes)\n {\n /** Create a TableRow dynamically **/\n tr = new TableRow(this);\n tr.setLayoutParams(new TableRow.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n\n /** Creating a TextView to add to the row **/\n name = new TextView(this);\n name.setText(obj.getName());\n name.setWidth(320);\n name.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);\n name.setPadding(5, 5, 5, 5);\n tr.addView(name); // Adding textView to tablerow.\n\n // Add the TableRow to the TableLayout\n tl.addView(tr, new TableLayout.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n }\n }", "public void populateTerms(){\n\n //clear existing view\n table.removeAllViews();\n\n //get existing Terms from Database\n ArrayList<List> allTerms = getTerms();\n\n //fill TableLayout with existing Terms\n for (List<String> list : allTerms){\n\n TableRow row = new TableRow(TermsActivity.this);\n TextView idCol = new TextView(TermsActivity.this);\n TextView nameCol = new TextView(TermsActivity.this);\n TextView startCol = new TextView(TermsActivity.this);\n TextView spaceCol = new TextView(TermsActivity.this);\n TextView endCol = new TextView(TermsActivity.this);\n Button detailBtn = new Button(TermsActivity.this);\n\n //convert dates\n long start = Long.valueOf(list.get(2));\n long end = Long.valueOf(list.get(3));\n\n idCol.setText(list.get(0));\n idCol.setMinWidth(120);\n final String idNum = idCol.getText().toString();\n nameCol.setText(list.get(1));\n nameCol.setMinWidth(250);\n startCol.setText(new SimpleDateFormat(\"MM/dd/yyyy\", Locale.US).format(new Date(start)));\n startCol.setMinWidth(250);\n spaceCol.setMinWidth(45);\n endCol.setText(new SimpleDateFormat(\"MM/dd/yyyy\", Locale.US).format(new Date(end)));\n endCol.setMinWidth(250);\n\n detailBtn.setText(\"Details\");\n detailBtn.setPadding(15,0, 0, 0);\n detailBtn.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v){\n\n //put term data into Shared Preferences to send to next activity\n editor.putString(\"term\", idNum);\n editor.commit();\n\n //switch to Details activity\n Intent intent = new Intent(v.getContext(), TermDetailsActivity.class);\n v.getContext().startActivity(intent);\n }\n });\n\n row.addView(idCol);\n row.addView(nameCol);\n row.addView(startCol);\n row.addView(spaceCol);\n row.addView(endCol);\n row.addView(detailBtn);\n table.addView(row);\n }\n }", "private void displayDetails(){\n Intent intent=getIntent();\n message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);\n\n // The ArrayList that holds the row data\n ArrayList<Object> row;\n // ask the database manager to retrieve the row with the given rowID\n row = dbHelper.getRowAsArray(message);\n Log.w(\"rows\", row.toString());\n try{\n // update the form fields to hold the retrieved data\n String sn = (String)row.get(0);\n String fn = (String)row.get(1);\n String cn = (String)row.get(2);\n String em= (String)row.get(3);\n String ad = (String)row.get(4);\n\n SnameTextView.setText(sn);\n FnameTextView.setText(fn);\n cellnumbTextView.setText(cn);\n emailsTextView.setText(em);\n homeATextView.setText(ad);\n }catch (Exception e){\n Log.e(\"Retrieve Error\", e.toString());\n e.printStackTrace();\n }\n\n\n Cursor cursor = dbHelper.fetchCountriesByName(message);\n\n // The desired columns to be bound\n String[] columns = new String[] {\n ContactsDbAdapter.KEY_SURNAME,\n ContactsDbAdapter.KEY_NAME,\n ContactsDbAdapter.KEY_CELLNUM,\n ContactsDbAdapter.KEY_EMAILADDR,\n ContactsDbAdapter.KEY_HOMEADDR\n };\n\n // the XML defined views which the data will be bound to\n int[] to = new int[] {\n R.id.FNdetails_text_view,\n R.id.LNdetails_text_view,\n R.id.cellDetails_text_view,\n R.id.EmailDetails_text_view,\n R.id.homedetails_text_view,\n };\n\n // create the adapter using the cursor pointing to the desired data\n //as well as the layout information\n dataAdapter = new SimpleCursorAdapter(\n this, R.layout.activity_details,\n cursor,\n columns,\n to,\n 0);\n\n\n\n\n }", "private void fillData() {\n\t\tmCursor = dbHelper.getResultsByTime();\n\t\tstartManagingCursor(mCursor);\n\n\t\tdataListAdapter = new SimpleCursorAdapter(this, R.layout.row, mCursor,\n\t\t\t\tFROM, TO);\n\t\tmConversationView.setAdapter(dataListAdapter);\n\t}", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\t\tLayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\tView view = inflater.inflate(R.layout.list_item_table_row_read, parent, false);\n\t\t\tSet<Entry<String, JsonElement>> set = mTableRows[position].getAsJsonObject().entrySet();\n\t\t\tLinearLayout layoutItem = (LinearLayout) view.findViewById(R.id.layoutItem);\n\t\t\t//Loop through each data item in the row and create a layout with the key and \n\t\t\t//value displayed in TextViews within it\n\t\t\tfor (Entry<String, JsonElement> entry : set) {\n\t\t\t\tLog.i(TAG, entry.getKey());\t\t\t\t\n\t\t\t\tRelativeLayout rowLayout = new RelativeLayout(mContext);\n\t\t\t\tRelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\t\t\t\t\n\t\t\t\trowLayout.setLayoutParams(params);\t\t\t\t\n\t\t\t\tTextView lblKey = new TextView(mContext);\n\t\t\t\tlblKey.setText(entry.getKey());\t\t\t\t\n\t\t\t\tRelativeLayout.LayoutParams keyParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\t\tkeyParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n\t\t\t\tkeyParams.leftMargin = 20;\n\t\t\t\tlblKey.setLayoutParams(keyParams);\t\t\t\t\n\t\t\t\tTextView lblValue = new TextView(mContext);\t\t\t\t\n\t\t\t\tRelativeLayout.LayoutParams valueParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\t\tvalueParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);\n\t\t\t\tlblValue.setLayoutParams(valueParams);\n\t\t\t\t//Limit the amount of text we show so the UI isn't dirty\n\t\t\t\tInputFilter[] FilterArray = new InputFilter[1];\n\t\t\t\tFilterArray[0] = new InputFilter.LengthFilter(25);\n\t\t\t\tlblValue.setFilters(FilterArray);\n\t\t\t\tlblValue.setText(entry.getValue().getAsString());\n\t\t\t\tlblValue.setGravity(Gravity.RIGHT);\n\t\t\t\trowLayout.addView(lblKey);\n\t\t\t\trowLayout.addView(lblValue);\n\t\t\t\tlayoutItem.addView(rowLayout);\n\t\t\t}\t\t\t\n\t\t\treturn view;\n\t\t}", "private void populateResultsUI(){\n\n totalPayTextView.setText(Double.toString(totalPay));\n totalTipTextView.setText(Double.toString(totalTip));\n totalPerPersonTextView.setText(Double.toString(totalPerPerson));\n }", "public void populateListView() {\n Cursor scores = myDb.getAllData();\n\n String[] columns = new String[]{\n myDb.COL_2,\n myDb.COL_3,\n myDb.COL_4,\n myDb.COL_5\n };\n\n int[] boundTo = new int[]{\n R.id.topScore,\n R.id.topCount,\n R.id.bottomScore,\n R.id.bottomCount\n };\n\n simpleCursorAdapter = new SimpleCursorAdapter(this,\n R.layout.history_list,\n scores,\n columns,\n boundTo,\n 0);\n scoreHistory.setAdapter(simpleCursorAdapter);\n\n// topScore.setTypeface(numberFont);\n// topCount.setTypeface(numberFont);\n// bottomScore.setTypeface(numberFont);\n// bottomCount.setTypeface(numberFont);\n\n\n }", "public void fillTextView(){\n\n data += \"Distance: \" + Math.round(distanceValue * 1000) / 1000.0 + \"\\n\";\n data += \"minSpeed: \" + minSpeed +\"\\n\";\n data += \"maxSpeed: \" + maxSpeed +\"\\n\";\n data += \"Avg Speed: \"+ Math.round(averageSpeed * 1000) / 1000.0 +\"\\n\";\n data += \"minAltitude: \"+minAlt +\"\\n\";\n data += \"maxAltitude: \"+maxAlt+\"\\n\";\n data += \"Avg Alt: \"+Math.round(averageAlt * 1000) / 1000.0 +\"\\n\";\n\n textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);\n textView.setText(data);\n\n }", "private void bindGridView(View root) {\n ListView listView = (ListView) root.findViewById(R.id.DBList);\n\n readDBrow();\n final Long[] elements = rowsMap.keySet().toArray(new Long[]{});\n\n Log.d(Utils.getTag(this), \"keyset has \" + elements.length + \" elements\");\n ArrayAdapter adapter = new ArrayAdapter<Long>(savingActivity, R.layout.my_two_line_listitem, elements) {\n @NonNull\n @Override\n public View getView(int position, View convertView, @NonNull ViewGroup parent) {\n\n if (convertView == null)\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.my_two_line_listitem, parent, false);\n\n TextView tvTitle = (TextView) convertView.findViewById(android.R.id.text1);\n if (tvTitle != null) tvTitle.setText(rowsMap.get(getItem(position))[0]);\n\n TextView tvSubTitle = (TextView) convertView.findViewById(android.R.id.text2);\n if (tvSubTitle != null) tvSubTitle.setText(rowsMap.get(getItem(position))[1]);\n\n return convertView;\n }\n };\n\n listView.setAdapter(adapter);\n adapter.notifyDataSetChanged();\n\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n public void onItemClick(AdapterView<?> parent, View v, int position, long id) {\n showRowOptions((Long) parent.getAdapter().getItem(position));\n }\n });\n }", "@Override\n\t public void bindView(View view, Context context, Cursor cursor) {\n\t //final String text = convertToString(cursor);\n\t //((TextView) view).setText(text);\n\t final int itemColumnIndex = cursor.getColumnIndexOrThrow(ItemsDbAdapter.COL_WORD);\n\t TextView text1 = (TextView) view.findViewById(R.id.text1);\n\t text1.setText(cursor.getString(itemColumnIndex));\n\t }", "private void initData(View view) {\n /*\n * the array of item which need to show in gridview\n * it contains string and a picture\n * */\n ArrayList<HashMap<String, Object>> mList = new ArrayList<HashMap<String, Object>>();\n\n\n /**\n * download info from local database\n * */\n ContentResolver contentResolver = mContext.getContentResolver();\n Uri uri = Uri.parse(\"content://com.example.root.libapp_v1.SQLiteModule.Bookpage.BookpageProvider/bookpage\");\n Cursor cursor = contentResolver.query(uri, null, null, null, null);\n if (cursor != null) {\n while (cursor.moveToNext()) {\n HashMap<String, Object> map = new HashMap<String, Object>();\n String bookname = cursor.getString(cursor.getColumnIndex(\"name\"));\n map.put(\"image\", mImgUrl+\"bookimg_\"+bookname+\".png\");\n map.put(\"text\", bookname);\n mList.add(map);\n }\n /**\n * use the new data to show in gridview\n * */\n initGridView(view, mList);\n }\n cursor.close();\n }", "private void setInfo(int row)\n {\n String ID=table.getModel().getValueAt(row, 0).toString();\n String Name=table.getModel().getValueAt(row, 1).toString(); \n idText.setText(ID);\n nameText.setText(Name);\n }", "public TableLayout loadUserList(ArrayList<User> row, String [] cv, int columnCount){\n TableLayout.LayoutParams tableLayoutParams = new TableLayout.LayoutParams();\n TableLayout tableLayout = new TableLayout(this);\n\n\n // 2) create tableRow params\n TableRow.LayoutParams tableRowParams = new TableRow.LayoutParams();\n tableRowParams.setMargins(5, 5, 5, 5);\n tableRowParams.weight = 1;\n\n int count = 1;\n\n for (int i = 0; i < rowCount; i++)\n {\n // 3) create tableRow\n TableRow tableRow = new TableRow(this);\n\n\n for (int j= 0; j <= columnCount; j++)\n {\n // 4) create textView\n TextView textView = new TextView(this);\n EditText editText = new EditText(this);\n editText.setBackgroundColor(Color.TRANSPARENT);\n editText.setGravity(Gravity.CENTER);\n editText.setEnabled(false);\n\n // textView.setText(String.valueOf(j));\n textView.setBackgroundColor(Color.WHITE);\n textView.setGravity(Gravity.CENTER);\n\n\n\n if (i ==0 && j==0)\n {\n textView.setText(\"No/Info\");\n tableRow.addView(textView, tableRowParams);\n }\n else if(i==0)\n {\n\n textView.setText(cv[j-1]);\n tableRow.addView(textView, tableRowParams);\n }\n else if( j==0)\n {\n\n textView.setText(Integer.toString(count));\n tableRow.addView(textView, tableRowParams);\n count = count +1;\n }\n else\n {\n // \"Tên người dùng\", \"Email\", \"Ngày sinh\",\"Giới tính\", \"Loại tài khoản\",\n ;\n switch (j){\n case 1:\n editText.setText(row.get(i).name);\n tableRow.addView(editText, tableRowParams);\n break;\n case 2:\n editText.setText(row.get(i).email);\n tableRow.addView(editText, tableRowParams);\n break;\n case 3:\n editText.setText(row.get(i).date);\n tableRow.addView(editText, tableRowParams);\n break;\n case 4:\n editText.setText(row.get(i).gender);\n tableRow.addView(editText, tableRowParams);\n break;\n case 5:\n editText.setText(row.get(i).role);\n tableRow.addView(editText, tableRowParams);\n break;\n\n case 6:\n Button btn=new Button(this);\n btn.setId(1);\n btn.setText(\"Ban\");\n btn.setLayoutParams(new TableLayout.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT));\n tableRow.addView(btn, tableRowParams);\n break;\n case 7:\n Button btn2=new Button(this);\n btn2.setId(2);\n btn2.setText(\"Change\");\n btn2.setLayoutParams(new TableLayout.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT));\n tableRow.addView(btn2, tableRowParams);\n break;\n default:\n break;\n\n }\n\n\n }\n\n }\n\n // 6) add tableRow to tableLayout\n tableLayout.addView(tableRow, tableLayoutParams);\n }\n\n return tableLayout;\n\n\n // --------------------------end of headers ----------------------\n\n }", "private void setUpTextViews() {\n // Find views\n TextView userName0 = (TextView) findViewById(R.id.user_name_0);\n TextView userInfo0 = (TextView) findViewById(R.id.user_info_0);\n TextView userName1 = (TextView) findViewById(R.id.user_name_1);\n TextView userInfo1 = (TextView) findViewById(R.id.user_info_1);\n TextView userName2 = (TextView) findViewById(R.id.user_name_2);\n TextView userInfo2 = (TextView) findViewById(R.id.user_info_2);\n\n // Set text\n userName0.setText(mGroupMembers.get(0).getString(ParseConstants.KEY_FIRST_NAME));\n userInfo0.setText(mGroupMembers.get(0).getString(ParseConstants.KEY_AGE) +\n \" : : \" +\n (mGroupMembers.get(0).getString(ParseConstants.KEY_HOMETOWN)));\n\n userName1.setText(mGroupMembers.get(1).getString(ParseConstants.KEY_FIRST_NAME));\n userInfo1.setText(mGroupMembers.get(1).getString(ParseConstants.KEY_AGE) +\n \" : : \" +\n (mGroupMembers.get(1).getString(ParseConstants.KEY_HOMETOWN)));\n\n userName2.setText(mGroupMembers.get(2).getString(ParseConstants.KEY_FIRST_NAME));\n userInfo2.setText(mGroupMembers.get(2).getString(ParseConstants.KEY_AGE) +\n \" : : \" +\n (mGroupMembers.get(2).getString(ParseConstants.KEY_HOMETOWN)));\n }", "@Override\n public void bindView(View view, Context context, Cursor data) {\n TextView svcIdTextView = view.findViewById(R.id.text_iteminvoices_svcid);\n TextView medicalServicesTextView = view.findViewById(R.id.text_iteminvoices_medicalservices);\n TextView medicationTextView = view.findViewById(R.id.text_iteminvoices_mediction);\n TextView costTextView = view.findViewById(R.id.text_iteminvoices_cost);\n\n int svcIdColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_SVC_ID);\n int medicalServicesColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_MEDICAL_SERVICES);\n int medicationColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_MEDICATION);\n int costColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_COST);\n\n String svcId = data.getString(svcIdColumnIndex);\n String medicalServices = data.getString(medicalServicesColumnIndex);\n String medication = data.getString(medicationColumnIndex);\n String cost = data.getString(costColumnIndex);\n\n svcIdTextView.setText(svcId);\n medicalServicesTextView.setText(medicalServices);\n medicationTextView.setText(medication);\n costTextView.setText(cost);\n\n/*\n\n int dateOfSvcColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_DATE_OF_SVC);\n int invoiceColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_INVOICE_DATE);\n int dateDueColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_DATE_DUE);\n int billToNameColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_BILL_TO_NAME);\n int billToAddressColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_BILL_TO_ADDRESS);\n int billToPhoneColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_BILL_TO_PHONE);\n int billToFaxColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_BILL_TO_FAX);\n int billToEmailColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_BILL_TO_EMAIL);\n\n int supTotalColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_SUBTOTAL);\n int taxRateColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_TAX_RATE);\n int totalTaxColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_TOTAL_TAX);\n int otherColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_OTHER);\n int totalColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_TOTAL);\n int questionsNameColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_QUESTIONS_NAME);\n int questionsEmailColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_QUESTIONS_EMAIL);\n int questionsPhoneColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_QUESTIONS_PHONE);\n int questionsWebColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_QUESTIONS_WEB);\n int procedureColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_PROCEDURE);\n int patientIdColumnIndex = data.getColumnIndex(ImsContract.InvoicesEntry.COLUMN_PATIENT_ID);\n\n\n String dateOfSvc = data.getString(dateOfSvcColumnIndex);\n String invoice = data.getString(invoiceColumnIndex);\n String dateDue = data.getString(dateDueColumnIndex);\n String billToName = data.getString(billToNameColumnIndex);\n String billToAddress = data.getString(billToAddressColumnIndex);\n String billToPhone = data.getString(billToPhoneColumnIndex);\n String billToFax = data.getString(billToFaxColumnIndex);\n String billToEmail = data.getString(billToEmailColumnIndex);\n String svcId = data.getString(svcIdColumnIndex);\n String medicalServices = data.getString(medicalServicesColumnIndex);\n String medication = data.getString(medicationColumnIndex);\n String cost = data.getString(costColumnIndex);\n String supTotal = data.getString(supTotalColumnIndex);\n String taxRate = data.getString(taxRateColumnIndex);\n String totalTax = data.getString(totalTaxColumnIndex);\n String other = data.getString(otherColumnIndex);\n String total = data.getString(totalColumnIndex);\n String questionsName = data.getString(questionsNameColumnIndex);\n String questionsEmail = data.getString(questionsEmailColumnIndex);\n String questionsPhone = data.getString(questionsPhoneColumnIndex);\n String questionsWeb = data.getString(questionsWebColumnIndex);\n String procedure = data.getString(procedureColumnIndex);\n String patientId = data.getString(patientIdColumnIndex);\n\n\n dateOfSvcTextView.setText(dateOfSvc);\n invoiceDateTextView.setText(invoice);\n dateDueTextView.setText(dateDue);\n\n billFixEditText.setText(billToFax);\n billNameEditText.setText(billToName);\n billAddressEditText.setText(billToAddress);\n billEmailEditText.setText(billToEmail);\n billPhoneEditText.setText(billToPhone);\n\n svcIdEditText.setText(svcId);\n medicalServicesEditText.setText(medicalServices);\n medicationEditText.setText(medication);\n costEditText.setText(cost);\n subtotalEditText.setText(supTotal);\n taxRateEditText.setText(taxRate);\n totalTaxEditText.setText(totalTax);\n otherEditText.setText(other);\n totalEditText.setText(total);\n\n questionsNameEditText.setText(questionsName);\n questionsPhoneEditText.setText(questionsPhone);\n questionEmailEditText.setText(questionsEmail);\n questionsWebEditText.setText(questionsWeb);\n procedureEditText.setText(procedure);\n*/\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n TextView tanggal = (TextView) view.findViewById(R.id.tanggal);\n TextView Pemasukan = (TextView) view.findViewById(R.id.Dana);\n TextView keterangan = (TextView) view.findViewById(R.id.keterangan);\n // Read the pet attributes from the Cursor for the current pet\n String editTanggal = cursor.getString(cursor.getColumnIndex(tabeldb.listtabeldb.COL_1_Pemasukan));\n double editPemasukan = cursor.getInt(cursor.getColumnIndex(tabeldb.listtabeldb.COL_2_Pemasukan));\n String editKeterangan= cursor.getString(cursor.getColumnIndex(tabeldb.listtabeldb.COL_3_Pemasukan));\n\n // Update the TextViews with the attributes for the current pet\n DecimalFormat decim = new DecimalFormat(\"#,###.##\");\n tanggal.setText(editTanggal);\n Pemasukan.setText(decim.format(editPemasukan));\n keterangan.setText(editKeterangan);\n }", "@Override\r\n\t\t\tpublic View getView(int position, View convertView,\r\n\t\t\t\t\tViewGroup parent) {\n\t\t\t\tTableLayout tl=new TableLayout(ShouZhiActivity.this);\r\n\t\t\t\t//tl.setOrientation(TableLayout.HORIZONTAL);\r\n\t\t\t\ttl.setShrinkAllColumns(false);\r\n\t\t\t\t\r\n\t\t\t\t TableRow tr=new TableRow(ShouZhiActivity.this);\r\n\t\t\t\t for(int j=0;j<4;j++)\r\n\t\t\t\t { TextView tv=new TextView(ShouZhiActivity.this);\r\n\t\t\t\t if(j==0||j==1||j==2){\t\r\n\t\t\t\t\t if(j==1){\r\n\t\t\t\t\t\ttv.setWidth(110);\r\n\t\t\t\t\t\ttv.setPadding(20, 20, 5, 5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t if(j==0){\r\n\t\t\t\t\t\ttv.setWidth(110);\r\n\t\t\t\t\t\ttv.setPadding(0, 20, 5, 5);}\r\n\t\t\t\t\t if(j==2){\r\n\t\t\t\t\t\ttv.setWidth(110);\r\n\t\t\t\t\t\ttv.setPadding(20, 20, 5, 5);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t else{\r\n\t\t\t\t\t\ttv.setWidth(140);\r\n\t\t\t\t\t\ttv.setPadding(20, 15, 5, 5);\r\n\t\t\t\t\t}\r\n\t\t\t\t tv.setText(bl.get(position)[j]);\r\n\t\t\t\t tr.setLayoutParams(new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,\r\n\t\t\t\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT));\r\n\t\t\t\t\t\ttv.setEllipsize(TruncateAt.END);\r\n\t\t\t\t\t\ttv.setTextSize(14);\r\n\t\t\t\t\t\ttv.setSingleLine(true);\r\n\t\t\t\t\t\ttv.setGravity(Gravity.CENTER);\r\n\t\t\t\t\t\ttv.setTextColor(ShouZhiActivity.this.getResources().getColor(R.color.black));\t\r\n\t\t\t\t\t\ttr.addView(tv);}\r\n\t\t\t\t\t\ttl.addView(tr);\r\n\t\t\t\t\t\treturn tl;\r\n\t\t\t}", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n\n TextView name = (TextView) view.findViewById(R.id.label3nazwa);\n TextView date = (TextView) view.findViewById(R.id.label1data);\n TextView type = (TextView) view.findViewById(R.id.label2typ);\n TextView value = (TextView) view.findViewById(R.id.label4wartosc);\n // Extract properties from cursor\n String nazwa = cursor.getString(cursor.getColumnIndexOrThrow(\"nazwa\"));\n String typ_id = cursor.getString(cursor.getColumnIndexOrThrow(\"typ_id\"));\n String data = cursor.getString(cursor.getColumnIndexOrThrow(\"data\"));\n String wartosc = cursor.getString(cursor.getColumnIndexOrThrow(\"wartosc\"));\n // Populate fields with extracted properties\n name.setText(nazwa);\n date.setText(data);\n type.setText(typ_id);\n value.setText(wartosc);\n }", "@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)\n public void init(View v) {\n\n LinearLayout li1 = (LinearLayout) v.findViewById(R.id.table_main);\n\n TableRow tbrow0 = new TableRow(getActivity());\n tbrow0.setPadding(10, 15, 15, 15);\n\n TextView tv0 = new TextView(getActivity());\n tv0.setText(\" Sl.No \");\n tv0.setTextSize(20);\n tv0.setTextColor(Color.BLACK);\n tbrow0.addView(tv0);\n\n TextView tv1 = new TextView(getActivity());\n tv1.setText(\" Name \");\n tv1.setTextSize(20);\n tv1.setTextColor(Color.BLACK);\n tbrow0.addView(tv1);\n\n TextView tv2 = new TextView(getActivity());\n tv2.setText(\" Field \");\n tv2.setTextSize(20);\n tv2.setTextColor(Color.BLACK);\n tbrow0.addView(tv2);\n\n li1.addView(tbrow0);\n\n\n for (int i = 0; i < name.length; i++) {\n TableRow tbrow = new TableRow(getActivity());\n TextView t1v = new TextView(getActivity());\n\n ShapeDrawable shape = new ShapeDrawable(new RectShape());\n shape.getPaint().setColor(Color.RED);\n shape.getPaint().setStyle(Paint.Style.STROKE);\n shape.getPaint().setStrokeWidth(3);\n\n tbrow.setPadding(10, 15, 15, 15);\n // Assign the created border to EditText widget\n // tbrow.setBackground(shape);\n t1v.setText(\"\" + i);\n t1v.setTextColor(Color.BLACK);\n t1v.setGravity(Gravity.CENTER);\n\n tbrow.addView(t1v);\n TextView t2v = new TextView(getActivity());\n t2v.setText(name[i] + i);\n t2v.setTextColor(Color.BLACK);\n t2v.setGravity(Gravity.CENTER);\n tbrow.addView(t2v);\n\n TableRow.LayoutParams lparams = new TableRow.LayoutParams(400, ViewGroup.LayoutParams.WRAP_CONTENT);\n EditText edT_v = new EditText(getActivity());\n edT_v.setLayoutParams(lparams);\n edT_v.setBackground(shape);\n\n edT_v.setTextColor(Color.BLACK);\n edT_v.setGravity(Gravity.CENTER);\n\n\n tbrow.addView(edT_v);\n li1.addView(tbrow);\n }\n\n }", "private void fillData() {\n\tparname.setText(UpStudentController.getName());\r\n\tparphone.setText(UpStudentController.getPhone());\r\n\tparmail.setText(UpStudentController.getMail());\r\n\taddres.setText(UpStudentController.getAdr());\r\n\tlocation.setText(UpStudentController.getLoc());\r\n\tkazi.setText(UpStudentController.getOc());\r\n\ttaifa.setText(UpStudentController.getNat());\r\n\t}", "public void addData(View view) {\n int numCompanies = companies.length;\n TableLayout tl = view.findViewById(R.id.tableLayout);\n Log.d(\"TableViewFragment\", \"addData() invoked\");\n for (int i = 0; i < numCompanies; i++) {\n Log.d(\"TableViewFragment\", \"addData()\" + (i));\n TableRow tr = new TableRow(getContext());\n tr.setLayoutParams(getLayoutParams());\n tr.addView(getTextView(i + 1, companies[i], Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(getContext(), R.color.colorAccent)));\n tr.addView(getTextView(i + numCompanies, os[i], Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(getContext(), R.color.colorAccent)));\n tl.addView(tr, getTblLayoutParams());\n }\n }", "private void bindAllViewElements() {\n\t\tseatingInfoList = (LinearLayoutForListView) findViewById(R.id.ticket_detail_view_seating_info_list);\n\t\tqrCodeButton = (Button) findViewById(R.id.ticket_detail_view_view_qr_code_btn);\n\t\tpdfButton = (Button) findViewById(R.id.ticket_detail_view_view_pdf_btn);\n\n\t\tdnrNumberValue = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_reference_number_value);\n\t\tpnrNumberValue = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_resevation_code_value);\n\t\t//paymentMethod = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_payment_method_TextView);\n\t\t//paymentMethodValue = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_payment_method_value);\n\t\ttotalPriceValue = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_total_price_value);\n\t\tinsurance = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_insurance_TextView);\n\t\tinsuranceValue = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_insurance_value);\n\t\ttariffValue = (TextView) findViewById(R.id.ticket_detail_view_booking_detail_tariff_value);\n\n\t\ttariffDetail = (TextView) findViewById(R.id.ticket_detail_view_tariff_details_TextView);\n\n\t\tdeliveryMethodValue = (TextView) findViewById(R.id.ticket_detail_view_delivery_method_value);\n\t\tdeliveryMethodInfo = (TextView) findViewById(R.id.ticket_detail_view_delivery_method_info_TextView);\n\t\tdeliveryMethodInfoDetail1 = (TextView) findViewById(R.id.ticket_detail_view_delivery_method_info_detail1_TextView);\n\t\tdeliveryMethodInfoDetail2 = (TextView) findViewById(R.id.ticket_detail_view_delivery_method_info_detail2_TextView);\n\n\t\texchangeButton = (Button) findViewById(R.id.ticket_detail_view_view_exchange_btn);\n\t\tcancelButton = (Button) findViewById(R.id.ticket_detail_view_view_cancel_btn);\n\n\t\ttitle = (TextView) findViewById(R.id.ticket_detail_view_title);\n\n\t\tstationList = (LinearLayoutForListView) findViewById(R.id.ticket_detail_view_station_list);\n\t\trooView = findViewById(R.id.ticket_detail_root_view);\n\t\trooView.setVisibility(View.VISIBLE);\n\t\tprogressBar = (LinearLayout)findViewById(R.id.tickets_detail_view_progressBarLayout);\n\t\terrorLayout = (LinearLayout) findViewById(R.id.tickets_detail_view_service_error_Layout);\n\t\t\n\t\terrorTextview = (TextView) findViewById(R.id.tickets_detail_view_retrieving_real_time_service_error_textview);\n\t\t\n\t\trunProgressBar();\n\t\t\n\t\tbindAllListeners();\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View row = convertView;\n RecordHolder holder = null;\n // Check if an existing view is being reused, otherwise inflate the view\n if (row == null) {\n LayoutInflater inflater = ((Activity) context).getLayoutInflater();\n row = inflater.inflate(id,parent,false);\n holder = new RecordHolder();\n holder.tvName = (TextView) row.findViewById(R.id.tvName);\n row.setTag(holder);\n }\n Cursos c = data.get(position);\n holder.tvName.setText(c.getNombre_curso());\n\n return row;\n }", "private TableLayout createTableLayout(String [] rv, String [] cv,int rowCount, int columnCount) {\n TableLayout.LayoutParams tableLayoutParams = new TableLayout.LayoutParams();\n TableLayout tableLayout = new TableLayout(this);\n tableLayout.setBackgroundColor(Color.BLACK);\n\n // 2) create tableRow params\n TableRow.LayoutParams tableRowParams = new TableRow.LayoutParams();\n tableRowParams.setMargins(1, 1, 1, 1);\n tableRowParams.weight = 1;\n\n for (int i = 0; i < rowCount; i++) {\n // 3) create tableRow\n TableRow tableRow = new TableRow(this);\n tableRow.setBackgroundColor(Color.BLACK);\n\n for (int j= 0; j < columnCount; j++) {\n // 4) create textView\n TextView textView = new TextView(this);\n // textView.setText(String.valueOf(j));\n textView.setBackgroundColor(Color.WHITE);\n textView.setGravity(Gravity.CENTER);\n\n String s1 = Integer.toString(i);\n String s2 = Integer.toString(j);\n String s3 = s1 + s2;\n int id = Integer.parseInt(s3);\n Log.d(\"TAG\", \"-___>\" + id);\n if (i ==0 && j==0){\n textView.setText(\"Name\");\n } else if(i==0){\n Log.d(\"TAAG\", \"set Column Headers\");\n textView.setText(cv[j-1]);\n }else if( j==0){\n Log.d(\"TAAG\", \"Set Row Headers\");\n textView.setText(rv[i-1]);\n }else if(j==4) {\n textView.setText(\"\"+totalmarks.get(i));\n // check id=23\n } else if(j==3){\n textView.setText(\"\"+englishmarks[i]);\n }else if(j==2) {\n textView.setText(\"\"+sciencemarks[i]);\n } else if(j==1) {\n textView.setText(\"\"+mathsmarks[i]);\n } else{\n textView.setText(\"\" + id);\n }\n // 5) add textView to tableRow\n tableRow.addView(textView, tableRowParams);\n }\n // 6) add tableRow to tableLayout\n tableLayout.addView(tableRow, tableLayoutParams);\n }\n\n return tableLayout;\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n tableLayoutChat.removeAllViews();\n for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {\n //getting artist;\n ChatMessage chatMessage = postSnapshot.getValue(ChatMessage.class);\n String theMessege=chatMessage.getMessage();\n String theSender=chatMessage.getSender();\n String theTime=chatMessage.getTime();\n\n\n TableRow header=new TableRow(AcceptedTaskActivity.this);\n ViewGroup.MarginLayoutParams params = new ViewGroup.MarginLayoutParams(\n ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n header.setLayoutParams(params);\n\n TextView sender = new TextView(AcceptedTaskActivity.this);\n sender.setGravity(Gravity.LEFT);\n if (theSender.equals(userName)){\n sender.setTextColor(Color.BLUE);\n }\n else{\n sender.setTextColor(Color.GREEN);\n }\n sender.setText(theSender);\n\n TextView time = new TextView(AcceptedTaskActivity.this);\n time.setGravity(Gravity.LEFT);\n time.setTextColor(Color.GRAY);\n time.setText(theTime);\n //Log.d(\"theTime\",theTime);\n\n\n TableRow body=new TableRow(AcceptedTaskActivity.this);\n body.setLayoutParams(params);\n TextView message = new TextView(AcceptedTaskActivity.this);\n message.setGravity(Gravity.LEFT);\n\n message.setText(theMessege);\n\n TableRow spacing=new TableRow(AcceptedTaskActivity.this);\n spacing.setLayoutParams(params);\n TextView space = new TextView(AcceptedTaskActivity.this);\n\n\n header.addView(sender);\n header.addView(time);\n body.addView(message);\n spacing.addView(space);\n\n tableLayoutChat.addView(header, params);\n tableLayoutChat.addView(body, params);\n tableLayoutChat.addView(spacing,params);\n scrolview.fullScroll(ScrollView.FOCUS_DOWN);\n\n }\n\n }", "public void showDataBase(){\n List<Mission> missions = appDatabase.myDao().getMissions();\n\n\n String info = \"\";\n\n for(Mission mis : missions){\n int id = mis.getId();\n String name = mis.getName();\n String diffic = mis.getDifficulty();\n int pong = mis.getPoints();\n String desc = mis.getDescription();\n\n info = info+\"Id : \" + id + \"\\n\" + \"Name : \" + name + \"\\n\" + \"Difficulty : \" + diffic + \"\\n\" + \"Points : \" + pong + \"\\n\" + \"Description: \" + desc + \"\\n\\n\";\n }\n\n TextView databaseData = (TextView)getView().findViewById(R.id.DatabaseData);\n databaseData.setText(info);\n\n //Toggle visibility for the textview containing the data\n if(databaseData.getVisibility() == View.VISIBLE)\n databaseData.setVisibility(View.GONE);\n else\n databaseData.setVisibility(View.VISIBLE);\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n c.moveToPosition(position);\n holder.tv1.setText(c.getInt(0)+\"\");\n holder.tv2.setText(c.getString(1));\n holder.tv3.setText(c.getString(2));\n }", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, final int arg2,\r\n\t\t\t\t\tlong arg3) {\n\t\t\t\tTableLayout tl=(TableLayout)arg1;\r\n\t\t\t\tTableRow tr=(TableRow)tl.getChildAt(0);\r\n\t\t\t\tfor(int i=0;i<4;i++){\r\n\t\t\t\t\tfinal TextView tv=(TextView)tr.getChildAt(i);\r\n\t\t\t\t\tTextPaint mTextPaint=tv.getPaint();\r\n\t\t\t\t\tfinal float textWidth=mTextPaint.measureText(bl.get(arg2)[i]);\r\n\t\t\t\t\tif(i==1){\r\n\t\t\t\t\t\tif(textWidth>84.0){\r\n\t\t\t\t\t\t\ttv.setOnClickListener(new View.OnClickListener() {\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\tisubject=bl.get(arg2)[0];\r\n\t\t\t\t\t\t\t\t\tiamount=bl.get(arg2)[1];\r\n\t\t\t\t\t\t\t\t\timode=bl.get(arg2)[2];\r\n\t\t\t\t\t\t\t\t\tidate=bl.get(arg2)[3];\r\n\t\t\t\t\t\t\t\t\tshowDialog(DETAIL_DIALOG);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(i==0||i==2){\r\n\t\t\t\t\t\tif(textWidth>100.0){\r\n\t\t\t\t\t\t tv.setOnClickListener(new View.OnClickListener() {\t\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t\t\t\t\tisubject=bl.get(arg2)[0];\r\n\t\t\t\t\t\t\t\tiamount=bl.get(arg2)[1];\r\n\t\t\t\t\t\t\t\timode=bl.get(arg2)[2];\r\n\t\t\t\t\t\t\t\tidate=bl.get(arg2)[3];\r\n\t\t\t\t\t\t\t\tshowDialog(DETAIL_DIALOG);\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}\r\n\t\t\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\n\n\t\tLayoutInflater inflater=activity.getLayoutInflater();\n\n\t\tif(convertView == null){\n\n\t\t\tconvertView=inflater.inflate(R.layout.column_row, null);\n }\n\t\t \n\t\ttxtFirst=(TextView) convertView.findViewById(R.id.idView);\n\t\ttxtSecond=(TextView) convertView.findViewById(R.id.dateView);\n\t\ttxtThird=(TextView) convertView.findViewById(R.id.discriptionView);\n\t\ttxtFourth=(TextView) convertView.findViewById(R.id.amountView);\n\n\t\tHashMap<String, String> map=list.get(position);\n\t\ttxtFirst.setText(map.get(FIRST_COLUMN));\n\t\ttxtSecond.setText(map.get(SECOND_COLUMN));\n\t\ttxtThird.setText(map.get(THIRD_COLUMN));\n\t\ttxtFourth.setText(map.get(FOURTH_COLUMN));\n\n\t\treturn convertView;\n\t}", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\t ViewHolder viewholder = null;\n\n\t\t\t if(convertView == null)\n\t {\n\t\t\t\t viewholder = new ViewHolder();\n\t convertView = mInflater.inflate(R.layout.dialog_edit_bill_item, null);\n\t \n\t viewholder.textView1 = (TextView)convertView.findViewById(R.id.diaTextView1);\n\t \n\t convertView.setTag(viewholder);\n\t }else\n\t {\n\t \t viewholder = (ViewHolder)convertView.getTag();\n\t }\n\n\t\t\t viewholder.textView1.setText(data[position]);\n\t return convertView;\n\t\t}", "@Override\n public void onBindViewHolder(DetailAdapter.ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n //holder.mTextView.setText(mDataset[position]);\n holder.informacion.setText(mDataset[position]); //informacion es el dato que nos entrega el arreglo\n }", "private void initObjects() {\n databaseHelper = new DatabaseHelper(activity);\n currentUser = databaseHelper.getAllUser().get(userIndex);\n\n textViewName.setText(userName);\n textViewEmail.setText(currentUser.getEmail());\n textViewPhone.setText(currentUser.getNumber());\n double rent = currentUser.getRent();\n String rentStr = new Double(rent).toString();\n textViewRent.setText(rentStr);\n textViewChores.setText(currentUser.getChores());\n\n /*for(int i=0; i<listUsers.size(); i++){\n TextView textView = new TextView(this);\n final int passingInt = i;\n textView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n String testMsg = listUsers.get(passingInt).getName();\n Log.d(\"User Clicked: \", testMsg);\n\n Intent editUserIntent = new Intent(EditChosenUserActivity.this, EditChosenUserActivity.class);\n }\n });\n\n textView.setTextSize(60.0f);\n textView.setText(listUsers.get(i).getName());\n users_list.addView(textView);\n }*/\n }", "@Override\r\n protected void onPostExecute(Cursor result)\r\n {\r\n super.onPostExecute(result);\r\n \r\n result.moveToFirst(); // move to the first item \r\n \r\n // get the column index for each data item\r\n int nameIndex = result.getColumnIndex(\"name\");\r\n int phoneIndex = result.getColumnIndex(\"phone\");\r\n int emailIndex = result.getColumnIndex(\"email\");\r\n int streetIndex = result.getColumnIndex(\"street\");\r\n int cityIndex = result.getColumnIndex(\"city\");\r\n \r\n // fill TextViews with the retrieved data\r\n nameTextView.setText(result.getString(nameIndex));\r\n phoneTextView.setText(result.getString(phoneIndex));\r\n emailTextView.setText(result.getString(emailIndex));\r\n streetTextView.setText(result.getString(streetIndex));\r\n cityTextView.setText(result.getString(cityIndex));\r\n \r\n result.close(); // close the result cursor\r\n databaseConnector.close(); // close database connection\r\n }", "private void fillData() {\n String[] from = new String[] {\n NOMBRE_OBJETO,\n DESCRIPCION,\n TEXTURA\n };\n // Campos de la interfaz a los que mapeamos\n int[] to = new int[] {\n R.id.txtNombreObjeto,\n R.id.txtDescripcion,\n R.id.imgIconoObjeto\n };\n getLoaderManager().initLoader(OBJETOS_LOADER, null, this);\n ListView lvObjetos = (ListView) findViewById(R.id.listaObjetos);\n adapter = new SimpleCursorAdapter(this, R.layout.activity_tiendaobjetos_filaobjeto, null, from, to, 0);\n lvObjetos.setAdapter(adapter);\n }", "@Override\n public void onClick(View v) {\n Cursor c=myDatabase.queryStudent();\n if (c!=null){\n StringBuilder sb=new StringBuilder();\n //that means there\n while (c.moveToNext()){\n int sno=c.getInt(0);\n String sname=c.getString(1);\n String scourse=c.getString(2);\n sb.append(sno+\":\"+sname+\":\"+scourse+\"\\n\");\n }\n //let us apply on textview\n tv.setText(sb.toString());\n }\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n TextView Ename = (TextView) view.findViewById(R.id.Ename);\n TextView Designation = (TextView) view.findViewById(R.id.Designation);\n TextView Salary = (TextView) view.findViewById(R.id.Salary);\n // Extract properties from cursor\n String ename = cursor.getString(cursor.getColumnIndexOrThrow(\"ename\"));\n String designation = cursor.getString(cursor.getColumnIndexOrThrow(\"designation\"));\n int salary = cursor.getInt(cursor.getColumnIndexOrThrow(\"salary\"));\n\n ImageView imgView =(ImageView)view.findViewById(R.id.ImageView01);\n\n\n imgView.setImageResource(R.drawable.ic_launcher);\n\n\n\n\n\n // Populate fields with extracted properties\n Ename.setText(ename);\n Designation.setText(designation);\n Salary.setText(String.valueOf(salary));\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 }", "public View getView(int position, View convertView, ViewGroup parent){\n\n\t\t// assign the view we are converting to a local variable\n\t\tView v = convertView;\n\n\t\t// first check to see if the view is null. if so, we have to inflate it.\n\t\t// to inflate it basically means to render, or show, the view.\n\t\tif (v == null) {\n\t\t\tLayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\tv = inflater.inflate(R.layout.list_item, null);\n\t\t}\n\n\t\t/*\n\t\t * Recall that the variable position is sent in as an argument to this method.\n\t\t * The variable simply refers to the position of the current object in the list. (The ArrayAdapter\n\t\t * iterates through the list we sent it)\n\t\t * \n\t\t * Therefore, i refers to the current Item object.\n\t\t */\n\t\titem i = objects.get(position);\n\n\t\tif (i != null) {\n\n\t\t\t// This is how you obtain a reference to the TextViews.\n\t\t\t// These TextViews are created in the XML files we defined.\n\n\t\t\tTextView tn = (TextView) v.findViewById(R.id.tnLabel);\n\t\t\tTextView tnd = (TextView) v.findViewById(R.id.tnData);\n\t\t\tTextView dt = (TextView) v.findViewById(R.id.dtLabel);\n\t\t\tTextView dtd = (TextView) v.findViewById(R.id.dtData);\n\t\t\tTextView at = (TextView) v.findViewById(R.id.atLabel);\n\t\t\tTextView atd = (TextView) v.findViewById(R.id.atData);\n\n\t\t\t// check to see if each individual textview is null.\n\t\t\t// if not, assign some text\n\t\t\tif (tn != null){\n\t\t\t\ttn.setText(\"Train Number: \");\n\t\t\t}\n\t\t\tif (tnd != null){\n\t\t\t\ttnd.setText(i.getTrainNum());\n\t\t\t}\n\t\t\tif (dt != null){\n\t\t\t\tdt.setText(\"Departure Time: \");\n\t\t\t}\n\t\t\tif (dtd != null){\n\t\t\t\tdtd.setText(i.getDepTime());\n\t\t\t}\n\t\t\tif (at != null){\n\t\t\t\tat.setText(\"Arrival Time: \");\n\t\t\t}\n\t\t\tif (atd != null){\n\t\t\t\tatd.setText(i.getArrTime());\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// the view must be returned to our activity\n\t\treturn v;\n\n\t}", "@Override\n public void run() {\n receivedTextView6.setText(str5);\n receivedTextView5.setText(str4);\n receivedTextView4.setText(str3);\n receivedTextView3.setText(str2);\n receivedTextView2.setText(str1);\n receivedTextView1.setText(str0);\n }", "public void viewdata(View view){\n\n viewall.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n Cursor data = dbHandler.getSeller();\n if(data.getCount() == 0){\n\n showMessage(\"Error\",\"Nothing found\");\n return;\n }\n\n StringBuffer buffer = new StringBuffer();\n\n while (data.moveToNext()){\n\n buffer.append(\"User Name\" +data.getString(0)+ \"\\n\");\n buffer.append(\"Password\" +data.getString(1)+ \"\\n\");\n buffer.append(\"Email\" +data.getString(2)+\"\\n\");\n buffer.append(\"Seller Name\" +data.getString(3)+\"\\n\");\n buffer.append(\"Contatct\" +data.getString(4)+\"\\n\\n\");\n\n //ShowableListMenu(\"Data\",buffer.toString());\n showMessage(\"Data\",buffer.toString());\n\n }\n\n }\n });\n\n\n }", "private void addDataToTable() {\n\n /* Get the main table from the xml */\n TableLayout mainTable = (TableLayout) findViewById(R.id.mainTable);\n\n /* Retrieve which products need to be displayed */\n int product_type = getIntent().getExtras().getInt(\"product_type\");\n String[] product_types_array = getResources().getStringArray(product_type);\n\n /* Retrieve product images for the above list of products */\n int[] product_images = getIntent().getExtras().getIntArray(\"product_images\");\n\n /* Loop through to add each product details in the table */\n for (int i = 0; i < product_types_array.length; i++) {\n\n TableRow tableRow = new TableRow(this);\n TableRow.LayoutParams tableRowParams =\n new TableRow.LayoutParams\n (TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n tableRow.setLayoutParams(tableRowParams);\n tableRow.setPadding(20, 20, 20, 20);\n\n // Initialize Linearlayout to set product name and images\n LinearLayout product_desc = new LinearLayout(this);\n product_desc.setId(R.id.product_linearlayout);\n product_desc.setOrientation(LinearLayout.VERTICAL);\n product_desc.setGravity(Gravity.START);\n product_desc.setPadding(10,0,10,0);\n\n // initialize string to separate product type\n String[] pn_str = product_types_array[i].split(\";\");\n // initialize string to get product name\n String prod_name_str = pn_str[0];\n // initialize string to get product color\n String prod_color = pn_str[1];\n\n /* Product Name Details */\n TextView textView_PN = new TextView(this);\n textView_PN.setText(prod_name_str);\n textView_PN.setWidth(350);\n textView_PN.setHeight(50);\n textView_PN.setId(R.id.product_name);\n textView_PN.setGravity(Gravity.CENTER_HORIZONTAL);\n textView_PN.setTypeface(null, Typeface.BOLD);\n textView_PN.setTextSize(13);\n textView_PN.setPadding(0, 0, 0, 0);\n product_desc.addView(textView_PN);\n\n /* Product Color */\n TextView textView_PC = new TextView(this);\n textView_PC.setText(\"Color : \" + prod_color);\n textView_PC.setId(R.id.product_color);\n textView_PC.setGravity(Gravity.CENTER_HORIZONTAL);\n textView_PC.setTypeface(null, Typeface.BOLD);\n textView_PC.setTextSize(13);\n textView_PC.setPadding(10, 10, 10, 10);\n product_desc.addView(textView_PC);\n\n /* Product Image Details */\n ImageView imageView = new ImageView(this);\n imageView.setImageResource(product_images[i]);\n imageView.setId(R.id.product_image);\n imageView.setPadding(20, 20, 20, 20);\n product_desc.addView(imageView);\n\n // add row in table\n tableRow.addView(product_desc, new TableRow.LayoutParams\n (TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT, 1.0f));\n\n /* LinearLayout for checkboxes */\n LinearLayout product_types = new LinearLayout(this);\n product_types.setOrientation(LinearLayout.VERTICAL);\n product_types.setGravity(Gravity.CENTER_VERTICAL);\n\n int box_type_value = decide_type(prod_name_str);\n\n /* show all products item with checkbox */\n if( box_type_value != -1){\n\n String[] product_modules_array = getResources().getStringArray(box_type_value);\n\n /* Loop for printing multiple checkboxes */\n for (int j = 0; j < product_modules_array.length; j++) {\n\n CheckBox checkBox = new CheckBox(this);\n checkBox.setTextSize(13);\n checkBox.setText(product_modules_array[j]);\n checkBox.setChecked(false);\n checkBox.setId(count);\n\n /* check condition if particular item name belongs to product hashmap */\n if (to_refer_each_item.containsKey(i)) {\n (to_refer_each_item.get(i)).add(count);\n } else {\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n arrayList.add(count);\n to_refer_each_item.put(i, arrayList);\n }\n count++;\n product_types.addView(checkBox);\n }\n }\n tableRow.addView(product_types, new TableRow.LayoutParams\n (TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT,1.0f));\n mainTable.addView(tableRow);\n }\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tView row = convertView;\n\t\t\n\t\tif(row == null){\n\t\t\tLayoutInflater inflater = context.getLayoutInflater();\n\t\t\trow = inflater.inflate(R.layout.item_total_average, null);\n\t\t\t\n\t\t\t// configure RecordHolder\n\t\t\tViewHolder viewHolder = new ViewHolder();\n\t\t\tviewHolder.txtTitle = (TextView) row.findViewById(R.id.total_average_title);\n\t\t\tviewHolder.txtValue = (TextView) row.findViewById(R.id.total_average_value);\n\t\t\trow.setTag(viewHolder);\t\t\t\n\t\t}\n\t\t\n\t\t// fill data\n\t\tViewHolder holder = (ViewHolder) row.getTag();\n\t\tTuple values = data.get(position);\n\t\tholder.txtTitle.setText(values.getValue1());\n\t\tholder.txtValue.setText(values.getValue2());\n\t\t\n\t\treturn row;\n\t}", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n TextView txtTitle = (TextView) view.findViewById(R.id.schoolTitle);\n TextView txtSchoolNo = (TextView) view.findViewById(R.id.schoolNo);\n TextView txtMajor = (TextView) view.findViewById(R.id.schoolMajor);\n TextView txtStartDate = (TextView) view.findViewById(R.id.schoolStartDate);\n TextView txtEndDate = (TextView) view.findViewById(R.id.schoolEndDate);\n TextView txtLocation = (TextView) view.findViewById(R.id.schoolLocation);\n TextView txtStatus = (TextView) view.findViewById(R.id.schoolStatus);\n\n // Extract properties from cursor\n String mTitle = cursor.getString(cursor.getColumnIndexOrThrow(\"school_title\"));\n String mSchoolNo = cursor.getString(cursor.getColumnIndexOrThrow(\"school_cardno\"));\n String mMajor = cursor.getString(cursor.getColumnIndexOrThrow(\"school_major\"));\n String mStartDate = cursor.getString(cursor.getColumnIndexOrThrow(\"start_date\"));\n String mEndDate = cursor.getString(cursor.getColumnIndexOrThrow(\"end_date\"));\n String mLocation = cursor.getString(cursor.getColumnIndexOrThrow(\"school_location\"));\n String mStatus = cursor.getString(cursor.getColumnIndexOrThrow(\"status\"));\n // Populate fields with extracted properties\n txtTitle.setText(mTitle);\n txtSchoolNo.setText(mSchoolNo);\n txtMajor.setText(mMajor);\n txtStartDate.setText(mStartDate);\n txtEndDate.setText(mEndDate);\n txtLocation.setText(mLocation);\n txtStatus.setText(mStatus);\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Item item = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_layout, parent, false);\n }\n\n // Lookup view for data population\n TextView tvName = convertView.findViewById(R.id.item_textview);\n TextView tvNum = convertView.findViewById(R.id.num_textview);\n\n // TODO\n // Set the text used by tvName and tvNum using the data object\n // This will need to updated once the entity model has been updated\n tvName.setText(item.getName());\n tvNum.setText(item.getNum());\n\n // Return the completed view to render on screen\n return convertView;\n }", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n Holder holder=new Holder();\n View rowView;\n rowView = inflater.inflate(R.layout.teamrow, null);\n holder.tv=(TextView) rowView.findViewById(R.id.teamrowitem);\n holder.tv.setText(result.get(position).get(\"title\"));\n Log.d(\"adapter\",result.get(position).get(\"title\"));\n\n\n\n\n return rowView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View view = super.getView(position, convertView, parent);\n\n // Initialize a TextView for ListView each Item\n TextView tv = (TextView) view.findViewById(android.R.id.text1);\n\n // Set the text color of TextView (ListView Item)\n tv.setTextColor(Color.BLACK);\n\n // Generate ListView Item using TextView\n return view;\n }", "private void displayData() {\n int j = finalList.size() - 1;\n\n while (j >= 0) {\n Log.d(\"j\", \"\" + j);\n SleepNormalRow normalRow = new SleepNormalRow(\n finalList.get(j).getDateOfSleep(),\n finalList.get(j).getDurationString(),\n finalList.get(j).getSleepTimeToWakeTime());\n recyclerViewItems.add(normalRow);\n j--;\n }\n\n adapter = new SleepAdapter(SleepActivity.this, recyclerViewItems);\n mRecyclerView.setAdapter(adapter);\n\n }", "@Override\r\n public void onBindViewHolder(MyViewHolder holder, int position) {\r\n // - get element from your dataset at this position\r\n // - replace the contents of the view with that element\r\n holder.textView_longitude.setText(dataset.get(position).dataLongitude);\r\n holder.textView_latitude.setText(dataset.get(position).dataLatitude);\r\n holder.textView_speed.setText(dataset.get(position).dataSpeed);\r\n holder.textView_time.setText(dataset.get(position).dataTime);\r\n\r\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n //Find fields to populate in inflated template\n TextView sportClubFirstName = (TextView)view.findViewById(R.id.firstNameTextView);\n TextView sportClubLastName = (TextView)view.findViewById(R.id.lastNameTextView);\n TextView sportClubSport = (TextView)view.findViewById(R.id.sportTextView);\n //Extract properties from cursor\n String firstName = cursor.getString(cursor.getColumnIndexOrThrow(MemberEntry.COLUMN_FIRST_NAME));\n String lastName = cursor.getString(cursor.getColumnIndexOrThrow(MemberEntry.COLUMN_LAST_NAME));\n String sportName = cursor.getString(cursor.getColumnIndexOrThrow(MemberEntry.COLUMN_SPORT));\n //Populate fields with extracted properties\n sportClubFirstName.setText(firstName);\n sportClubLastName.setText(lastName);\n sportClubSport.setText(sportName);\n }", "public void setDataCount(TextView textView, int i) {\n textView.setText(Html.fromHtml(getContext().getString(R.string.activities_destination_record_count, new Object[]{Integer.valueOf(i)})));\n }", "private void inflateTextLayout(View row, BeadInfo beadInfo) {\n\t\tTextView colorCodeTV = (TextView) row.findViewById(R.id.colorNumber);\n\t\tif (colorCodeTV != null){\n\t\t\tString colorCode = beadInfo.getColorCode();\n\t\t\tif (colorCode != null){\n\t\t\t\tcolorCodeTV.setText(colorCode);\n\t\t\t}\n\t\t}\n\t\tLocation loc = beadInfo.getLocation(); \n\t\tif (loc != null){\n\t\t\tString wing = loc.getWing();\n\t\t\tString locRow = String.valueOf(loc.getRow());\n\t\t\tString locCol = String.valueOf(loc.getCol());\n\t\t\tString quantity = String.valueOf(beadInfo.getQuantity());\n\n\t\t\tTextView wingTV = (TextView) row.findViewById(R.id.beadLocationWing);\n\t\t\tif (wingTV != null){\n\t\t\t\twingTV.setText(wing);\n\t\t\t}\n\t\t\tTextView locRowTV = (TextView) row.findViewById(R.id.beadLocationRow);\n\t\t\tif (locRowTV != null){\n\t\t\t\tlocRowTV.setText(locRow);\n\t\t\t}\n\t\t\tTextView locColTV = (TextView) row.findViewById(R.id.beadLocationColumn);\n\t\t\tif (locColTV != null){\n\t\t\t\tlocColTV.setText(locCol);\n\t\t\t}\n\t\t\tTextView quantityTV = (TextView) row.findViewById(R.id.beadQuantity);\n\t\t\tif (quantityTV != null){\n\t\t\t\tquantityTV.setText(quantity);\n\t\t\t}\n\n\n\n\t\t}\n\n\t\t\n\t}", "public void ViewAllData(View v){\n Cursor res = myDB.viewAllData();\n // if there are no data\n if (res.getCount() == 0) {\n // show an error message\n showMessage(\"Error\", \"Nothing found\");\n return;\n }\n\n StringBuffer buffer = new StringBuffer();\n while(res.moveToNext()){\n buffer.append(\"Id :\" + res.getString(0) + \"\\n\");\n buffer.append(\"Name :\" + res.getString(1) + \"\\n\");\n buffer.append(\"Surname :\" + res.getString(2) + \"\\n\");\n buffer.append(\"Marks :\" + res.getString(3) + \"\\n\\n\");\n }\n\n // then show all the data inside the buffer\n showMessage(\"Data\", buffer.toString());\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n View view = super.getView(position,convertView,parent);\n\n // Convert the view as a TextView widget\n TextView tv = (TextView) view;\n\n //tv.setTextColor(Color.DKGRAY);\n\n // Set the layout parameters for TextView widget\n RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(\n RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT\n );\n tv.setLayoutParams(lp);\n\n // Get the TextView LayoutParams\n RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)tv.getLayoutParams();\n\n // Set the width of TextView widget (item of GridView)\n /*\n IMPORTANT\n Adjust the TextView widget width depending\n on GridView width and number of columns.\n\n GridView width / Number of columns = TextView width.\n\n Also calculate the GridView padding, margins, vertical spacing\n and horizontal spacing.\n */\n\n\n Resources r = reports2.this.getResources();\n int px = (int) (TypedValue.applyDimension(\n TypedValue.COMPLEX_UNIT_DIP, 100, r.getDisplayMetrics()));\n // tv.setLayoutParams(new GridView.LayoutParams((width/10)*6, 50));\n\n // if (position==0 || position==5) {\n // params.width = px/2; // getPixelsFromDPs(EpiloghEid.this,168);\n // tv.setLayoutParams(new GridView.LayoutParams((px*6), 100));\n // }else{\n params.width = px; // getPixelsFromDPs(EpiloghEid.this,168);\n // }\n\n\n // Set the TextView layout parameters\n tv.setLayoutParams(params);\n\n // Display TextView text in center position\n tv.setGravity(Gravity.CENTER);\n\n // Set the TextView text font family and text size\n tv.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);\n tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);\n\n // Set the TextView text (GridView item text)\n tv.setText(values.get(position));\n\n // Set the TextView background color\n tv.setBackgroundColor(Color.parseColor(\"#d9d5dc\"));\n\n // Return the TextView widget as GridView item\n return tv;\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n View view = super.getView(position,convertView,parent);\n\n // Convert the view as a TextView widget\n TextView tv = (TextView) view;\n\n //tv.setTextColor(Color.DKGRAY);\n\n // Set the layout parameters for TextView widget\n RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(\n RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT\n );\n tv.setLayoutParams(lp);\n\n // Get the TextView LayoutParams\n RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)tv.getLayoutParams();\n\n // Set the width of TextView widget (item of GridView)\n /*\n IMPORTANT\n Adjust the TextView widget width depending\n on GridView width and number of columns.\n\n GridView width / Number of columns = TextView width.\n\n Also calculate the GridView padding, margins, vertical spacing\n and horizontal spacing.\n */\n\n\n Resources r = reports2.this.getResources();\n int px = (int) (TypedValue.applyDimension(\n TypedValue.COMPLEX_UNIT_DIP, 100, r.getDisplayMetrics()));\n // tv.setLayoutParams(new GridView.LayoutParams((width/10)*6, 50));\n\n // if (position==0 || position==5) {\n // params.width = px/2; // getPixelsFromDPs(EpiloghEid.this,168);\n // tv.setLayoutParams(new GridView.LayoutParams((px*6), 100));\n // }else{\n params.width = px; // getPixelsFromDPs(EpiloghEid.this,168);\n // }\n\n\n // Set the TextView layout parameters\n tv.setLayoutParams(params);\n\n // Display TextView text in center position\n tv.setGravity(Gravity.CENTER);\n\n // Set the TextView text font family and text size\n tv.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);\n tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);\n\n // Set the TextView text (GridView item text)\n tv.setText(values.get(position));\n\n // Set the TextView background color\n tv.setBackgroundColor(Color.parseColor(\"#d9d5dc\"));\n\n // Return the TextView widget as GridView item\n return tv;\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n View view = super.getView(position,convertView,parent);\n\n // Convert the view as a TextView widget\n TextView tv = (TextView) view;\n\n //tv.setTextColor(Color.DKGRAY);\n\n // Set the layout parameters for TextView widget\n RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(\n RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT\n );\n tv.setLayoutParams(lp);\n\n // Get the TextView LayoutParams\n RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)tv.getLayoutParams();\n\n // Set the width of TextView widget (item of GridView)\n /*\n IMPORTANT\n Adjust the TextView widget width depending\n on GridView width and number of columns.\n\n GridView width / Number of columns = TextView width.\n\n Also calculate the GridView padding, margins, vertical spacing\n and horizontal spacing.\n */\n\n\n Resources r = reports2.this.getResources();\n int px = (int) (TypedValue.applyDimension(\n TypedValue.COMPLEX_UNIT_DIP, 100, r.getDisplayMetrics()));\n // tv.setLayoutParams(new GridView.LayoutParams((width/10)*6, 50));\n\n // if (position==0 || position==5) {\n // params.width = px/2; // getPixelsFromDPs(EpiloghEid.this,168);\n // tv.setLayoutParams(new GridView.LayoutParams((px*6), 100));\n // }else{\n params.width = px; // getPixelsFromDPs(EpiloghEid.this,168);\n // }\n\n\n // Set the TextView layout parameters\n tv.setLayoutParams(params);\n\n // Display TextView text in center position\n tv.setGravity(Gravity.CENTER);\n\n // Set the TextView text font family and text size\n tv.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);\n tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);\n\n // Set the TextView text (GridView item text)\n tv.setText(values.get(position));\n\n // Set the TextView background color\n tv.setBackgroundColor(Color.parseColor(\"#d9d5dc\"));\n\n // Return the TextView widget as GridView item\n return tv;\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n TextView subcode = (TextView) view.findViewById(R.id.subjectCodeListView);\n TextView subname = (TextView) view.findViewById(R.id.subjectNameListView);\n // Extract properties from cursor\n String subjectcode = cursor.getString(0);\n String subjectname = cursor.getString(1);\n // Populate fields with extracted properties\n subcode.setText(subjectcode);\n subname.setText(subjectname);\n }", "public void showData(){\n listName.setText(this.listName);\n listDescription.setText(this.description);\n Double Total = Lists.getInstance().getLists(this.listName).getTotal();\n listTotal.setText(pending.toString());\n\n this.data = FXCollections.observableArrayList(Lists.getInstance().getLists(this.listName).getItems());\n articleColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"name\")\n );\n quantityColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"quantity\")\n );\n priceColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"price\")\n );\n totalColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"total\")\n );\n stateColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"state\")\n );\n this.itemsTable.setItems(data);\n\n }", "@Override\n public void onBindViewHolder(MyViewHolder viewHolder, int i) {\n viewHolder.name.setText(ps.get(i).getName());\n viewHolder.schar.setText(ps.get(i).getScharr());\n viewHolder.schdep.setText(ps.get(i).getSchdep());\n viewHolder.actar.setText(ps.get(i).getActarr());\n viewHolder.actdep.setText(ps.get(i).getActdep());\n viewHolder.tnum.setText(ps.get(i).getNumber());\n\n\n\n }", "private void populateUI() {\n\n tipPercentTextView.setText(Double.toString(tipPercent));\n noPersonsTextView.setText(Integer.toString(noPersons));\n populateResultsUI();\n }", "private void displayData() {\n dataBase = mHelper.getWritableDatabase();\n Cursor mCursor = dataBase.rawQuery(\"SELECT * FROM \"\n + DbHelper.TABLE_NAME, null);\n\n userId.clear();\n user_fName.clear();\n user_lName.clear();\n user_size.clear();\n user_pay.clear();\n user_produce.clear();\n user_genre.clear();\n if (mCursor.moveToFirst()) {\n do {\n userId.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_ID)));\n user_fName.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_FNAME)));\n user_lName.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_LNAME)));\n user_size.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_SIZE)));\n user_pay.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_PAY)));\n user_produce.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_PRODUCE)));\n user_genre.add(mCursor.getString(mCursor.getColumnIndex(DbHelper.KEY_GENRE)));\n\n } while (mCursor.moveToNext());\n }\n DisplayAdapter disadpt = new DisplayAdapter(DisplayActivity.this, userId, user_fName, user_lName, user_size, user_pay, user_produce, user_genre);\n userList.setAdapter(disadpt);\n mCursor.close();\n }", "private void displayContactDetails() {\n bindTextViews();\n populateTextViews();\n }", "@Override\n public void onBindViewHolder(MyAdapter.ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n View holder1, holder2, holder3, holder4;\n holder1 = holder.mView.findViewById(R.id.subText);\n holder2 = holder.mView.findViewById(R.id.dueDateText);\n // holder3 = holder.mView.findViewById(R.id.gradeText);\n// holder4 = holder.mView.findViewById(R.id.descText);\n if (mDataset.get(position).getCourse() != null) {\n ((TextView) holder1).setText(mDataset.get(position).getCourse().getSub());\n }\n if (mDataset.get(position).getDueDate() != null) {\n ((TextView) holder2).setText((CharSequence) mDataset.get(position).getDueDate());\n }\n // ((TextView) holder3).setText(mDataset.get(position).get);\n// ((TextView) holder4).setText(mDataset[position]);\n //.setText(mDataset[position]));\n //setText(mDataset[position]);\n }", "private void updateText() {\n updateDateText();\n\n TextView weightText = findViewById(R.id.tvWeight);\n TextView lowerBPText = findViewById(R.id.tvLowerBP);\n TextView upperBPText = findViewById(R.id.tvUpperBP);\n\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n\n double weight = mUser.weight.getWeightByDate(mDate.getTime());\n int upperBP = mUser.bloodPressure.getUpperBPByDate(mDate.getTime());\n int lowerBP = mUser.bloodPressure.getLowerBPByDate(mDate.getTime());\n\n weightText.setText(String.format(Locale.getDefault(), \"Paino\\n%.1f\", weight));\n lowerBPText.setText(String.format(Locale.getDefault(), \"AlaP\\n%d\", lowerBP));\n upperBPText.setText(String.format(Locale.getDefault(), \"YläP\\n%d\", upperBP));\n\n ((EditText)findViewById(R.id.etWeight)).setText(\"\");\n ((EditText)findViewById(R.id.etLowerBP)).setText(\"\");\n ((EditText)findViewById(R.id.etUpperBP)).setText(\"\");\n }", "@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\taProgressDialog.dismiss();\n\n\t\t\ttry {\n\t\t\t\taJSONArray = aJSONObject.getJSONArray(\"Value\");\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tint size = aJSONArray.length();\n\n\t\t\tfor (int I = 0; I < size; I++) {\n\n\t\t\t\tString productName = null, soldQuantity = null, soldAmount = null;\n\t\t\t\tJSONObject mJSONObject;\n\t\t\t\ttry {\n\t\t\t\t\tmJSONObject = aJSONArray.getJSONObject(I);\n\t\t\t\t\tproductName = mJSONObject.getString(\"productName\");\n\t\t\t\t\tsoldQuantity = mJSONObject.getString(\"sellQuantity\");\n\t\t\t\t\tsoldAmount = mJSONObject.getString(\"totalPrice\");\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t// TableRow aRow = new TableRow(this);\n\t\t\t\tTableRow aRow = new TableRow(TargetProducts.this);\n\n\t\t\t\taRow.setLayoutParams(new LayoutParams(\n\t\t\t\t\t\tLayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));\n\n\t\t\t\tTextView column1 = new TextView(TargetProducts.this);\n\t\t\t\tTextView column2 = new TextView(TargetProducts.this);\n\t\t\t\tTextView column3 = new TextView(TargetProducts.this);\n\n\t\t\t\tcolumn1.setText(productName);\n\t\t\t\tcolumn1.setGravity(Gravity.CENTER);\n\t\t\t\tcolumn1.setPadding(2, 0, 2, 0);\n\t\t\t\tcolumn1.setTextSize(15);\n\t\t\t\tcolumn1.setBackgroundColor(Color.parseColor(\"#dcdcdc\"));\n\t\t\t\tcolumn1.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\t\tcolumn2.setText(soldQuantity);\n\t\t\t\tcolumn2.setGravity(Gravity.CENTER);\n\t\t\t\tcolumn2.setPadding(2, 0, 2, 0);\n\t\t\t\tcolumn2.setTextSize(15);\n\t\t\t\tcolumn2.setBackgroundColor(Color.parseColor(\"#d3d3d3\"));\n\t\t\t\tcolumn2.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\t\tcolumn3.setText(soldAmount);\n\t\t\t\tcolumn3.setGravity(Gravity.CENTER);\n\t\t\t\tcolumn3.setPadding(2, 0, 2, 0);\n\t\t\t\tcolumn3.setTextSize(15);\n\t\t\t\tcolumn3.setBackgroundColor(Color.parseColor(\"#cac9c9\"));\n\t\t\t\tcolumn3.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\t\taRow.addView(column1);\n\t\t\t\taRow.addView(column2);\n\t\t\t\taRow.addView(column3);\n\n\t\t\t\tmyTableLayout.addView(aRow);\n\t\t\t}\n\n\t\t}", "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 }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n TextView textViewListName = view.findViewById(R.id.textView_list_name);\n TextView textViewListNumber = view.findViewById(R.id.textView_list_Number);\n TextView textViewListDescription = view.findViewById(R.id.textView_sub_name);\n\n // Extract properties from cursor\n int getID = cursor.getInt(cursor.getColumnIndexOrThrow(\"food_calories\"));\n String getName = cursor.getString(cursor.getColumnIndexOrThrow(\"food_name\"));\n String getDescription = cursor.getString(cursor.getColumnIndexOrThrow(\"food_description\"));\n\n // Populate fields with extracted properties\n textViewListName.setText(getName);\n textViewListNumber.setText(String.valueOf(getID));\n textViewListDescription.setText(String.valueOf(getDescription));\n }", "@Override\n\tpublic void setData() {\n\t\tsuper.setData();\n\t\tif (!isAdult) {\n\t\t\ttv_title1.setText(\"作息规律\");\n\t\t\ttv_title2.setText(\"对人态度\");\n\t\t\ttv_title3.setText(\"学习专注\");\n\t\t\ttv_title4.setText(\"爱心善意\");\n\t\t\ttv_title5.setText(\"尊师重教\");\n\t\t\ttv_title6.setText(\"思考行动\");\n\t\t\ttv_title7.setText(\"其 它\");\n\t\t}\n\t\tif (isYesterday) {\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.add(Calendar.DATE, -1);\n\t\t\ttime = new SimpleDateFormat(\"yyyy-MM-dd \").format(cal.getTime());\n\n\t\t} else {\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.add(Calendar.DATE, -2);\n\t\t\ttime = new SimpleDateFormat(\"yyyy-MM-dd \").format(cal.getTime());\n\t\t}\n\t\tHttpUtils.searchTable(UserInfo.instance().getUid(), time, time,\n\t\t\t\tisAdult, this, this);\n\t}", "public void generate(GridLayout glr, List<String> inpg){\n\t\ttry{\n\t\t\tif(glr.getRowCount()<1){\n\t\t\t\tfor(int i=0; i<clmn; i++){\n\t\t\t\t\ttv.add(new TextView(this));\n\t\t\t\t\ttv.get(tv.size()-1).setId(id); id++;\n\t\t\t\t\trw.add(GridLayout.spec(0));\n\t\t\t\t\tcl.add(GridLayout.spec(i));\n\t\t\t\t\tglp.add(new GridLayout.LayoutParams(rw.get(i), cl.get(i)));\n\t\t\t\t\tglp.get(glp.size()-1).setGravity(Gravity.FILL);\n\t\t\t\t\ttv.get(tv.size()-1).setLayoutParams(glp.get(glp.size()-1));\n\t\t\t\t\ttv.get(tv.size()-1).setPadding(25,10,25,10);\n\t\t\t\t\tGradientDrawable gd = new GradientDrawable();\n\t\t\t\t\tgd.setColor(Color.WHITE);\n\t\t\t\t\tgd.setCornerRadius(5);\n\t\t\t\t\tgd.setStroke(10, BROWN);\n\t\t\t\t\ttv.get(tv.size()-1).setBackgroundDrawable(gd);\n\t\t\t\t\ttv.get(tv.size()-1).setTextSize(25);\n\t\t\t\t\ttv.get(tv.size()-1).setTextColor(Color.BLACK);\n\t\t\t\t\ttv.get(tv.size()-1).setText(dt.get(i));\n\t\t\t\t\ttv.get(tv.size()-1).setGravity(Gravity.CENTER);\n\t\t\t\t\tglr.addView(tv.get(tv.size()-1), glp.get(glp.size()-1));\n\t\t\t\t}\n\t\t\t}\n\t\t\tint iref = glr.getRowCount()*clmn;\n\t\t\tint rc = glr.getRowCount();\n\t\t\tfor(int i=0; i<inpg.size(); i++){\n\t\t\t\tint r = i/clmn+rc;\n\t\t\t\trw.add(GridLayout.spec(r));\n\t\t\t\tint c = (i)-(r-rc)*clmn;\n\t\t\t\tcl.add(GridLayout.spec(c));\n\t\t\t\tGradientDrawable gd = new GradientDrawable();\n\t\t\t\tgd.setColor(Color.WHITE); // Changes this drawbale to use a single color instead of a gradient\n\t\t\t\tgd.setCornerRadius(5);\n\t\t\t\tgd.setStroke(10, BROWN);\n\t\t\t\tglp.add(new GridLayout.LayoutParams(rw.get(rw.size()-1), cl.get(cl.size()-1)));\n\t\t\t\tglp.get(glp.size()-1).setGravity(Gravity.FILL);\n\n\t\t\t\tswitch(dt.get(c)){\n\n\t\t\t\t\tcase(\"TOTAL\"):\n\t\t\t\t\tcase(\"DUE\"):\n\t\t\t\t\t\ttve.add(new TextView(this));\n\t\t\t\t\t\ttve.get(tve.size()-1).setId(id); id++;\n\t\t\t\t\t\ttve.get(tve.size()-1).setLayoutParams(glp.get(glp.size()-1));\n\t\t\t\t\t\ttve.get(tve.size()-1).setPadding(25,10,25,10);\n\t\t\t\t\t\ttve.get(tve.size()-1).setBackgroundDrawable(gd);\n\t\t\t\t\t\ttve.get(tve.size()-1).setGravity(Gravity.CENTER);\n\t\t\t\t\t\ttve.get(tve.size()-1).setTextSize(20);\n\t\t\t\t\t\ttve.get(tve.size()-1).setTextColor(Color.BLACK);\n\t\t\t\t\t\ttve.get(tve.size()-1).setText(inpg.get(i));\n\t\t\t\t\t\tcv.add(tve.get(tve.size()-1));\n\t\t\t\t\t\tcv.get(cv.size()-1).setTag(i+iref);\n\t\t\t\t\t\tglr.addView(tve.get(tve.size()-1), glp.get(glp.size()-1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tet.add(new EditText(this));\n\t\t\t\t\t\tet.get(et.size()-1).setId(id); id++;\n\t\t\t\t\t\tet.get(et.size()-1).setLayoutParams(glp.get(glp.size()-1));\n\t\t\t\t\t\tet.get(et.size()-1).setPadding(25,10,25,10);\n\t\t\t\t\t\tet.get(et.size()-1).setBackgroundDrawable(gd);\n\t\t\t\t\t\tet.get(et.size()-1).setGravity(Gravity.CENTER);\n\t\t\t\t\t\tet.get(et.size()-1).setTextSize(20);\n\t\t\t\t\t\tet.get(et.size()-1).setHint(dth.get(c));\n\t\t\t\t\t\tet.get(et.size()-1).setText(inpg.get(i));\n\t\t\t\t\t\tet.get(et.size()-1).setOnFocusChangeListener(this);\n\t\t\t\t\t\tet.get(et.size()-1).setTag(i+iref);\n\t\t\t\t\t\tcv.add(et.get(et.size()-1));\n\t\t\t\t\t\tglr.addView(et.get(et.size()-1), glp.get(glp.size()-1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tswitch(dt.get(c)){\n\n\t\t\t\t\t//case(\"DATE\"):\n\t\t\t\t\tcase(\"TIME\"):\n\t\t\t\t\tcase(\"RATE\"):\n\t\t\t\t\tcase(\"TRVL\"):\n\t\t\t\t\tcase(\"PAID\"):\n\t\t\t\t\t\tet.get(et.size()-1).setInputType(number0);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase(\"DUE\"):\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tDouble grn = Double.valueOf(tve.get(tve.size()-1).getText().toString().substring(1, tve.get(tve.size()-1).length()));\n\t\t\t\t\t\t\tif(grn>0){tve.get(tve.size()-1).setTextColor(Color.RED);}\n\t\t\t\t\t\t\tif(grn<=0){tve.get(tve.size()-1).setTextColor(Color.GREEN);}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception e){\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tToast.makeText(getBaseContext(), e.getMessage(), Toast.LENGTH_LONG).show();\n\t\t}\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 }", "private void createAndAddViews() {\n \t\t// Create the layout parameters for each field\n \t\tfinal LinearLayout.LayoutParams labelParams = new LinearLayout.LayoutParams(\n \t\t\t\t0, LayoutParams.WRAP_CONTENT, 0.3f);\n \t\tlabelParams.gravity = Gravity.RIGHT;\n \t\tlabelParams.setMargins(0, 25, 0, 0);\n \t\tfinal LinearLayout.LayoutParams valueParams = new LinearLayout.LayoutParams(\n \t\t\t\t0, LayoutParams.WRAP_CONTENT, 0.7f);\n \t\tvalueParams.gravity = Gravity.LEFT;\n \t\tvalueParams.setMargins(0, 25, 0, 0);\n \n \t\t// Add a layout and text views for each property\n \t\tfor (final StockProperty property : m_propertyList) {\n \t\t\tLog.d(TAG, \"Adding row for property: \" + property.getPropertyName());\n \n \t\t\t// Create a horizontal layout for the label and value\n \t\t\tfinal LinearLayout layout = new LinearLayout(this);\n \t\t\tlayout.setLayoutParams(new LinearLayout.LayoutParams(\n \t\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));\n \n \t\t\t// Create a TextView for the label\n \t\t\tfinal TextView label = new TextView(this);\n \t\t\tlabel.setLayoutParams(labelParams);\n \t\t\tlabel.setText(property.getLabelText());\n \t\t\tlabel.setTextAppearance(this, android.R.style.TextAppearance_Medium);\n \t\t\tlayout.addView(label);\n \n \t\t\t// Configure and add the value TextView (created when the property\n \t\t\t// was constructed)\n \t\t\tfinal TextView value = property.getView();\n \t\t\tvalue.setLayoutParams(valueParams);\n \t\t\tvalue.setHint(\"None\");\n \t\t\tvalue.setTextAppearance(this, android.R.style.TextAppearance_Medium);\n \t\t\tvalue.setTypeface(null, Typeface.BOLD);\n \t\t\tlayout.addView(value);\n \n \t\t\t// Add the row to the main layout\n \t\t\tm_resultsLayout.addView(layout);\n \t\t}\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\n public View getView(int position, View ConvertView, ViewGroup parent){ ///position starts from zero,one and goes on, parent would be the layout we want to display all elements\n View row=ConvertView; //to optimize we inflate the item only first else we recycle the view using converterView\n if(row==null) {\n LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\n //**View of which we want to convert to java view object\n row = inflater.inflate(R.layout.single_row, parent, false);\n }\n //*****From row view we can access the view items and populate it data\n ImageView imageView = (ImageView)row.findViewById(R.id.imageView);\n TextView myDiscription=(TextView)row.findViewById(R.id.myDescription);\n TextView myTitle=(TextView)row.findViewById(R.id.mytitle);\n\n imageView.setImageResource(images[position]); //postion will incremented automaticlly as views will populate\n myDiscription.setText(description[position]);\n myTitle.setText(titles[position]);\n\n return row;\n }", "public void setupTextFields(View v) {\n other = (EditText) v.findViewById(R.id.eText_Notes);\n totalTotes = (EditText) v.findViewById(R.id.eText_NumStacked);\n\n other.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 }\n\n @Override\n public void afterTextChanged(Editable s) {\n ((ScoutFormActivity) getActivity()).getScoutForm().setENOTES_COLUMN(other.getText().toString());\n }\n });\n\n totalTotes.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 }\n\n @Override\n public void afterTextChanged(Editable s) {\n ((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSTOTAL_COLUMN(totalTotes.getText().toString());\n }\n });\n }", "public void fetRowList() {\n try {\n data.clear();\n if (rsAllEntries != null) {\n ObservableList row = null;\n //Iterate Row\n while (rsAllEntries.next()) {\n row = FXCollections.observableArrayList();\n //Iterate Column\n for (int i = 1; i <= rsAllEntries.getMetaData().getColumnCount(); i++) {\n row.add(rsAllEntries.getString(i));\n }\n data.add(row);\n }\n //connects table with list\n table.setItems(data);\n // cell instances are generated for Order Status column and then colored\n customiseStatusCells();\n\n } else {\n warning.setText(\"No rows to display\");\n }\n } catch (SQLException ex) {\n System.out.println(\"Failure getting row data from SQL \");\n }\n }", "private void updateView() {\n model.inlezenHighscore();\n for (int i = 0; i < 10; i++) {\n view.getNaamLabels(i).setText(model.getNaam(i));\n view.getScoreLabels(i).setText(model.getScores(i));\n }\n }", "private void loadRec() {\n\t\tString test = \"ID, Name, Amount, Price\\n\";\n\t\t//formatting for string to load into the screen\n\t\tfor(int i=0 ; i< t.items.size() ; i++) {\n\t\t\ttest += (i+1) + \" \" + t.items.get(i).name +\", \" \n\t\t\t\t\t+ t.items.get(i).amount + \n\t\t\t\t\t\", $\"+ t.items.get(i).price +\"\\n\";\n\t\t}\n\t\tthis.reciet.setText(test);\n\t}", "public void updateTextViews() {\n // Set the inputs according to the initial input from the entry.\n //TextView dateTextView = (TextView) findViewById(R.id.date_textview);\n //dateTextView.setText(DateUtils.formatDateTime(getApplicationContext(), mEntry.getStart(), DateUtils.FORMAT_SHOW_DATE));\n\n EditText dateEdit = (EditText) findViewById(R.id.date_text_edit);\n dateEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_ABBREV_ALL));\n\n EditText startTimeEdit = (EditText) findViewById(R.id.start_time_text_edit);\n startTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_SHOW_TIME));\n\n EditText endTimeEdit = (EditText) findViewById(R.id.end_time_text_edit);\n endTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getEnd(), DateUtils.FORMAT_SHOW_TIME));\n\n\n TextView descriptionView = (TextView) findViewById(R.id.description);\n descriptionView.setText(mEntry.getDescription());\n\n\n enableSendButtonIfPossible();\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tLayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);\n\t\t\tView v=inflater.inflate(R.layout.custom, null);\n\t\t\t\n\t\t\ttv1=(TextView)v.findViewById(R.id.text1);\n\t\t\ttv1.setText(names[position]);\n\t\t\t\n\t\t\t\n\t\t\ttv2=(TextView)v.findViewById(R.id.text2);\n\t\t\ttv2.setText(phones[position]);\n\t\t\t\n\t\t\t\n\t\t\treturn v;\n\t\t}", "@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\taProgressDialog.dismiss();\n\n\t\t\t// Toast.makeText(TargetProducts.this, aJSONObject.toString(),\n\t\t\t// Toast.LENGTH_LONG).show();\n\n\t\t\ttry {\n\t\t\t\taJSONArray = aJSONObject.getJSONArray(\"Value\");\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tint size = aJSONArray.length();\n\n\t\t\tfor (int I = 0; I < size; I++) {\n\n\t\t\t\tString productName = null, soldQuantity = null, soldAmount = null;\n\t\t\t\tJSONObject mJSONObject;\n\t\t\t\ttry {\n\t\t\t\t\tmJSONObject = aJSONArray.getJSONObject(I);\n\t\t\t\t\tproductName = mJSONObject.getString(\"productName\");\n\t\t\t\t\tsoldQuantity = mJSONObject.getString(\"sellQuantity\");\n\t\t\t\t\tsoldAmount = mJSONObject.getString(\"totalPrice\");\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t// TableRow aRow = new TableRow(this);\n\t\t\t\tTableRow aRow = new TableRow(TargetProducts.this);\n\n\t\t\t\taRow.setLayoutParams(new LayoutParams(\n\t\t\t\t\t\tLayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));\n\n\t\t\t\tTextView column1 = new TextView(TargetProducts.this);\n\t\t\t\tTextView column2 = new TextView(TargetProducts.this);\n\t\t\t\tTextView column3 = new TextView(TargetProducts.this);\n\n\t\t\t\tcolumn1.setText(productName);\n\t\t\t\tcolumn1.setGravity(Gravity.CENTER);\n\t\t\t\tcolumn1.setPadding(2, 0, 2, 0);\n\t\t\t\tcolumn1.setTextSize(15);\n\t\t\t\tcolumn1.setBackgroundColor(Color.parseColor(\"#dcdcdc\"));\n\t\t\t\tcolumn1.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\t\tcolumn2.setText(soldQuantity);\n\t\t\t\tcolumn2.setGravity(Gravity.CENTER);\n\t\t\t\tcolumn2.setPadding(2, 0, 2, 0);\n\t\t\t\tcolumn2.setTextSize(15);\n\t\t\t\tcolumn2.setBackgroundColor(Color.parseColor(\"#d3d3d3\"));\n\t\t\t\tcolumn2.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\t\tcolumn3.setText(soldAmount);\n\t\t\t\tcolumn3.setGravity(Gravity.CENTER);\n\t\t\t\tcolumn3.setPadding(2, 0, 2, 0);\n\t\t\t\tcolumn3.setTextSize(15);\n\t\t\t\tcolumn3.setBackgroundColor(Color.parseColor(\"#cac9c9\"));\n\t\t\t\tcolumn3.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\t\taRow.addView(column1);\n\t\t\t\taRow.addView(column2);\n\t\t\t\taRow.addView(column3);\n\n\t\t\t\tmyTableLayout.addView(aRow);\n\t\t\t}\n\n\t\t}", "@Override\n public void setView(View row){\n TextView uid = row.findViewById(R.id.user_uid);\n TextView name = row.findViewById(R.id.user_name);\n TextView agender = row.findViewById(R.id.user_agender);\n\n uid.setText(\"UID: \" + this.id);\n name.setText(this.name);\n agender.setText(this.gender + \", DOB: \" + this.dob);\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder viewHolder;\n if(convertView == null){\n viewHolder = new ViewHolder();\n LayoutInflater lukesInflater = LayoutInflater.from(getContext());\n convertView = lukesInflater.inflate(R.layout.infolink_row, parent, false);\n viewHolder.urlTitle = (TextView) convertView.findViewById(R.id.urlTitle);\n viewHolder.urlText = (TextView) convertView.findViewById(R.id.urlText);\n convertView.setTag(viewHolder);\n }else{\n viewHolder = (ViewHolder) convertView.getTag();\n }\n\n //Populate the data into the view using data object\n\n InfoLink infoLink = getItem(position);\n\n\n viewHolder.urlTitle.setText(infoLink.getDisplayName());\n viewHolder.urlText.setText(infoLink.getUrl());\n\n viewHolder.urlTitle.setTextColor(Color.DKGRAY);\n viewHolder.urlText.setTextColor(Color.DKGRAY);\n\n return convertView;\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 public View getView(int position, View convertView, ViewGroup parent){\n View view = super.getView(position, convertView, parent);\n\n // Initialize a TextView for ListView each Item\n TextView tv = (TextView) view.findViewById(android.R.id.text1);\n\n // Set the text color of TextView (ListView Item)\n tv.setTextColor(Color.WHITE);\n // Generate ListView Item using TextView\n return view;\n }", "void bind(int listIndex){\n cursor.moveToPosition(listIndex);\n\n projectName = cursor.getString(cursor.getColumnIndex(Contract.TABLE_PROJECT.COLUMN_NAME_TITLE));\n numberOfTask = cursor.getString(cursor.getColumnIndex(Contract.TABLE_PROJECT.COLUMN_NAME_NUMBER_OF_TASKS));\n projectId = cursor.getInt(cursor.getColumnIndex(Contract.TABLE_PROJECT._ID));\n\n if(numberOfTask.equals(\"0\")){\n if (excelExportButton.getVisibility()==View.VISIBLE)\n excelExportButton.setVisibility(View.INVISIBLE);\n\n }else {\n if(numberOfTask.equals(\"1\")){\n itemProjectName.setText(projectName + \" ( \" + numberOfTask + \" task )\");\n }\n else{\n itemProjectName.setText(projectName + \" ( \" + numberOfTask + \" tasks )\");\n }\n\n if (excelExportButton.getVisibility()==View.INVISIBLE)\n excelExportButton.setVisibility(View.VISIBLE);\n }\n }", "@Override\n public View getView(final int i, View convertView, ViewGroup parent) {\n\n if (convertView == null) {\n li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n convertView = li.inflate(R.layout.row_speaker, null);\n h = new ViewHolder(convertView);\n convertView.setTag(h);\n\n } else {\n h = (ViewHolder) convertView.getTag();\n }\n\n\n //___________________set data___________________\n h.sl.setText(list.get(i).sl+\". \");\n h.name.setText( list.get(i).name);\n h.topic.setText(list.get(i).topicExtra);\n\n\n /* h.theme.setText(list.get(i).themeExtra);\n h.country.setText(list.get(i).countryExtra);\n h.digit.setText(list.get(i).digitExtra);*/\n\n // hideBlankTextView();\n\n\n h.cardView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n A.setPerson(list.get(i));\n DialogFragment dialog = new InfoDialog();\n dialog.show(((AppCompatActivity) context).getSupportFragmentManager(), \"dialog\");\n }\n });\n return convertView;\n }", "private void fillData() {\n table.setRowList(data);\n }", "private void update_text() {\n\n if(i < text_data.length) {\n i++;\n // text_data.setText(String.valueOf(i)); = avoid the RunTime error\n myHandler.post(myRunnable); // relate this to a Runnable\n } else {\n myTimer.cancel(); // stop the timer\n return;\n }\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n History user = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.activity_riwayat2, parent, false);\n }\n // Lookup view for data population\n TextView tvTanggal = (TextView) convertView.findViewById(R.id.tanggalTextViewID);\n TextView tvRS = (TextView) convertView.findViewById(R.id.RSTextViewID);\n TextView tvPoli = (TextView) convertView.findViewById(R.id.PoliTextViewID);\n // Populate the data into the template view using the data object\n tvTanggal.setText(user.ambilTanggalHis());\n tvRS.setText(user.ambilNamaRSHis());\n tvPoli.setText(user.ambilNamaPoliHis());\n // Return the completed view to render on screen\n return convertView;\n }", "public void populateDetails() {\n\n txtpn_NameHeading.setText(selStudent.getfName() + \" \" + selStudent.getlName());\n\n txtpn_RacesComplete.setText(String.valueOf(dataCur.countNumberRaces(selStudent.getId())));\n txtpn_DaysAbsent.setText(String.valueOf(selStudent.getAttend()));\n txtpn_AgeGroup.setText(String.valueOf(selStudent.getAge()));\n\n }", "public void updateViews() {\n textView.setText(contactName);\n\n }", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n Holder holder=new Holder();\n View rowView;\n\n rowView = inflater.inflate(R.layout.sample_gridlayout, null);\n holder.os_text =(TextView) rowView.findViewById(R.id.os_texts);\n holder.os_img =(ImageView) rowView.findViewById(R.id.os_images);\n\n holder.os_text.setText(result[position]);\n holder.os_img.setImageResource(imageId[position]);\n\n rowView.setOnClickListener(new OnClickListener() {\n double years;\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n switch (result[position]){\n case \"Java\": years = 8;\n break;\n case \"Python\": years = 6;\n break;\n case \"C\": years = 6;\n break;\n case \"Embedded\": years = 6;\n break;\n case \"C++\": years = 6;\n break;\n case \"XML\": years = 0.25;\n break;\n case \"JavaScript\": years = 1;\n break;\n case \"IAM\": years = 1;\n break;\n case \"SQL\": years = 7;\n break;\n case \"Automation\": years = 3;\n break;\n }\n Toast.makeText(context, result[position]+\" Experience: \"+years+ \" years\", Toast.LENGTH_SHORT).show();\n }\n });\n\n return rowView;\n }", "private void loadData() {\n\n // connect the table column with the attributes of the patient from the Queries class\n id_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"pstiantID\"));\n name_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n date_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"reserveDate\"));\n time_In_editTable.setCellValueFactory(new PropertyValueFactory<>(\"reserveTime\"));\n\n try {\n\n // database related code \"MySql\"\n ps = con.prepareStatement(\"select * from visitInfo \");\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n\n // load data to the observable list\n editOL.add(new Queries(new SimpleStringProperty(rs.getString(\"id\")),\n new SimpleStringProperty(rs.getString(\"patiantID\")),\n new SimpleStringProperty(rs.getString(\"patiant_name\")),\n new SimpleStringProperty(rs.getString(\"visit_type\")),\n new SimpleStringProperty(rs.getString(\"payment_value\")),\n new SimpleStringProperty(rs.getString(\"reserve_date\")),\n new SimpleStringProperty(rs.getString(\"reserve_time\")),\n new SimpleStringProperty(rs.getString(\"attend_date\")),\n new SimpleStringProperty(rs.getString(\"attend_time\")),\n new SimpleStringProperty(rs.getString(\"payment_date\")),\n new SimpleStringProperty(rs.getString(\"attend\")),\n new SimpleStringProperty(rs.getString(\"attend_type\"))\n\n ));\n }\n\n // assigning the observable list to the table\n table_view_in_edit.setItems(editOL);\n\n ps.close();\n rs.close();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "private void populateFriendsTables(){\r\n TableLayout tl = (TableLayout) findViewById(R.id.friendTable);\r\n tl.removeAllViews();\r\n TableRow row, titleRow;\r\n TextView view, titleViewEmail, tileViewButton;\r\n\r\n List<String> friends = (List<String>) mFriendData.get(\"friends\");\r\n\r\n titleRow = new TableRow(getApplicationContext());\r\n titleViewEmail = new TextView(getApplicationContext());\r\n titleViewEmail.setText(\"Friend Email\");\r\n titleViewEmail.setPadding(20, 20, 20, 20);\r\n\r\n tileViewButton = new TextView(getApplicationContext());\r\n tileViewButton.setText(\"Remove\");\r\n tileViewButton.setPadding(20, 20, 20, 20);\r\n\r\n titleRow.addView(titleViewEmail);\r\n titleRow.addView(tileViewButton);\r\n\r\n tl.addView(titleRow);\r\n for (String email : friends) {\r\n row = new TableRow(getApplicationContext());\r\n view = new TextView(getApplicationContext());\r\n view.setText(email);\r\n view.setPadding(20, 20, 20, 20);\r\n\r\n TextView button = new Button(getApplicationContext());\r\n button.setText(\"Remove Friend\");\r\n button.setPadding(20, 20, 20, 20);\r\n\r\n row.addView(view);\r\n row.addView(button);\r\n tl.addView(row);\r\n }\r\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View view = super.getView(position, convertView, parent);\n\n // Initialize a TextView for ListView each Item\n TextView tv = (TextView) view.findViewById(android.R.id.text1);\n\n // Set the text color of TextView (ListView Item)\n tv.setTextColor(Color.BLACK);\n\n // Generate ListView Item using TextView\n return view;\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n\n LayoutInflater myCustomInflater = LayoutInflater.from(getContext());\n View customView = myCustomInflater.inflate(R.layout.customrow, parent, false);\n\n\n TextView startOdo = (TextView) customView.findViewById(R.id.startOdo);\n TextView endOdo = (TextView) customView.findViewById(R.id.endOdo);\n TextView date = (TextView) customView.findViewById(R.id.date);\n TextView note = (TextView) customView.findViewById(R.id.note);\n\n String startOdo1 = String.valueOf(getItem(position).getStartOdo());\n String endOdo1 = String.valueOf(getItem(position).getEndOdo());\n String date1 = getItem(position).getDate();\n String note1 = getItem(position).getNote();\n\n\n startOdo.setText(\"Starting Odometer: \" + startOdo1);\n endOdo.setText(\"Ending Odometer: \" + endOdo1);\n date.setText(\"Date: \" + date1);\n note.setText(note1);\n\n return customView;\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n holder.tv.setText(arr.get(position));\n\n // .setText(arr[position]);\n // ((ImageView)temp.findViewById(R.id.iconimage)).setImageResource(ico[position]);\n\n }", "public void update() {\r\n\t\tfor (int i = 0; i < myRows; i++)\r\n\t\t\tfor (int j = 0; j < myColumns; j++)\r\n\t\t\t\tsetCellText(cellArray[i][j]);\r\n\t}", "public void llenar2(ArrayList<String> values1,ArrayList<String[]> values,String txt){\n this.txt.setText(txt);\n DefaultTableModel t=new DefaultTableModel();\n for (int i = 0; i < values1.size(); i++) {\n t.addColumn(values1.get(i));\n }\n this.tv.setModel(t);\n for (int i = 0; i < values.size(); i++) {\n String array[]=values.get(i);\n t.addRow(array);\n \n }\n this.tv.setModel(t);\n \n \n \n }" ]
[ "0.69829375", "0.68891174", "0.65017015", "0.6434036", "0.642142", "0.6320036", "0.6301487", "0.6276643", "0.6273005", "0.6236405", "0.6231051", "0.6228581", "0.6194826", "0.61860275", "0.61670893", "0.615411", "0.6153998", "0.61536145", "0.61521024", "0.6126667", "0.61048436", "0.6088843", "0.60782874", "0.6023813", "0.6006761", "0.5999072", "0.5994128", "0.5986667", "0.59836674", "0.5981843", "0.5978563", "0.5964968", "0.5963301", "0.5954331", "0.59536886", "0.59466183", "0.5944917", "0.5939877", "0.593292", "0.5931869", "0.5923145", "0.59219164", "0.5920292", "0.590417", "0.58975506", "0.5864458", "0.58626896", "0.5860652", "0.5854632", "0.5853026", "0.58424866", "0.5838786", "0.58368325", "0.5835575", "0.58296645", "0.5823806", "0.5823806", "0.5823806", "0.5820235", "0.5814358", "0.58092415", "0.5809082", "0.58035964", "0.5802758", "0.579883", "0.5781679", "0.57772493", "0.57689816", "0.57686335", "0.5749715", "0.5749179", "0.5744123", "0.5741376", "0.5715344", "0.5706927", "0.57035154", "0.5703186", "0.5699441", "0.56978405", "0.5697198", "0.5691308", "0.5689487", "0.5687768", "0.5682798", "0.5675936", "0.56755716", "0.56696373", "0.5667269", "0.56650907", "0.5664407", "0.5643091", "0.5642554", "0.5640762", "0.563643", "0.56337535", "0.56333876", "0.56307214", "0.56301546", "0.56264895", "0.56245506", "0.5622962" ]
0.0
-1
total number of rows
@Override public int getItemCount() { return mData.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int totalRowsCount();", "int getRowsCount();", "public int getTotalRows();", "int getRowsAmount();", "public int getNumRows() {\n\t\treturn NUM_ROWS; \n\t}", "public abstract int getNumOfRows();", "public abstract int getNumRows();", "public int getRowsCount() {\n return rows_.size();\n }", "public int getRowsCount() {\n return rows_.size();\n }", "public int getNumRows() { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getter for the number of rows\n\t\treturn numRows; \n\t}", "public int getNumRows () {\n\t\treturn numrows_;\n\t}", "public int getRows() {\n\t\treturn NUM_OF_ROWS;\n\t}", "public int getNumRows() { return numRows; }", "public int getRowCount() {\r\n\t\treturn(noOfRows);\r\n\t}", "public int getRowCount();", "public int getNumRows() {\n\t\treturn numRows;\n\t}", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "private int numRows(){\n return attrTable.getModel().getRowCount();\n }", "public int getRowCount() {\r\n //return outputs.length;\r\n return NUM_ROW;\r\n }", "public int getNumRows() {\n return numRows;\n }", "public int getNumRows() {\n return numRows;\n }", "public int size() {\n return numberOfRows();\n }", "public int getRowCount()\n {\n return numRows;\n }", "public int getTotalRowCount() {\r\n return totalRowCount;\r\n }", "public int getNumberOfRows() {\n return this.numberOfRows;\n }", "public int getnRows() {\n return nRows;\n }", "public int getnRows() {\n return nRows;\n }", "public int numberOfRows(){\n SQLiteDatabase db = this.getReadableDatabase();\n int numRows = (int) DatabaseUtils.queryNumEntries(db,TABLE_NAME);\n return numRows;\n }", "public int getRowCount() {\n\t\treturn(data.length);\n\t}", "int countRows() throws IOException {\n Scan s = new Scan();\n ResultScanner rs = tbl.getScanner(s);\n int i = 0;\n while(rs.next() !=null) {\n i++;\n }\n return i;\n }", "int getTotalsRowCount();", "public int getRowCount() { return this.underlying.getRowCount(); }", "public int numberOfRows() {\n\t\treturn rowCount;\n\t}", "private int getJTableNumberOfRows() {\n\n\t\tint count = 0; /* create a integer object for rows count */\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(DATABASE_URL, UserName_SQL, Password_SQL);\n\t\t\tstatement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(\"SELECT COUNT(*) as numberOfRows FROM invoice\");\n\t\t\tresultSet.next();\n\t\t\tcount = resultSet.getInt(\"numberOfRows\");\n\t\t\tresultSet.close();\n\t\t} // end try\n\t\tcatch (SQLException sqlException) {\n\t\t\tsqlException.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t} // end catch\n\t\tfinally // ensure statement and connection are closed properly\n\t\t{\n\t\t\ttry {\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t} // end try\n\t\t\tcatch (Exception exception) {\n\t\t\t\texception.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} // end catch\n\t\t} // end finally\n\t\treturn count; /* return the result of rows count */\n\t}", "public int getRowCount() {\r\n return this.data.length;\r\n }", "public int getActualRowCount() {\r\n int ret = 0;\r\n if (rows != null) ret = rows.size();\r\n return ret;\r\n }", "public int resultCount(){\n\n int c = 0;\n\n try{\n if(res.last()){\n c = res.getRow();\n res.beforeFirst();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return c;\n }", "public int getRows();", "public int getRows();", "int totalRows(){\n return row;\n }", "public int rowCount() {\n\t\treturn n_;\n\t}", "public int getRowCount() {\n return _data.size();\n }", "public int getRowCount()\n\t{\n\t\treturn datas.size();\n\t}", "double getRowCount();", "public int getRowCount() {\n\t\treturn(data.size());\n\t}", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n\t\treturn this.records.size();\n\t}", "@Override\n\tpublic int getNumRows() {\n\t\treturn 0;\n\t}", "public int rows() {\n\treturn rows;\n}", "public int getRowCount() {\n return data.size();\n }", "public int getRowCount() {\n return data.length;\n }", "int getRows();", "int getRows();", "@Transactional\n\t\tpublic Long getNumberRows (){\n\t\t\n\t\t\treturn pharmacyRepository1.getNumberOfRows();\n\t\t\t\n\t\t}", "public long getNRowsTotal() {\n return cGetNRowsTotal(this.cObject);\n }", "@Override\n\t\tpublic int getRowCount() \n\t\t{\n\t\t\treturn tables.size();\n\t\t}", "public int getRowSize() {\n \t\treturn this.rows;\n \t}", "public int getRowCount()\r\n\t{\r\n\t\treturn rowCount;\r\n\t}", "int getNumberOfRows() {\n lock.readLock().lock();\n try {\n return extensionPointPluginMap.rowMap().size();\n } finally {\n lock.readLock().unlock();\n }\n }", "public int getRowCount()\n\t{\n\t\treturn m_data.rows.size();\n\t}", "public int numberOfRows(){\n int numRows = (int) DatabaseUtils.queryNumEntries(db, TRACKINGS_TABLE_NAME);\n return numRows;\n }", "public int getRows()\n\t{\n\t\treturn rows;\n\t}", "public int getRowCount() {\n return noeuds.size();\n }", "public int getRowCount() {\n return 0;\n }", "@Override\r\n\tpublic long getTotalRows() {\n\t\treturn warehouseDao.getTotalRows();\r\n\t}", "@Override\r\n\tpublic int getRowCount() {\n\t\treturn rowData.length;\r\n\t}", "public int getRowCount() {\r\n return this.rowCount;\r\n }", "public int getRowCount(){\n return dataEntries.length;\n }", "int rowCount();", "@Override\n public int getRowCount() {\n \n return data.size();\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn records.size();\n\t}", "public int getNumRows() {\n\t\treturn this.subset.length;\n\t}", "public int total(){\n int rows = 0;\n \n try {\n rs = stmt.executeQuery \n (\"SELECT * FROM JEREMY.TICKET\");\n while (rs.next()) {rows++;}\n System.out.println(\"There are \"+ rows + \" record in the table\"); \n \n } catch (Exception e) {}\n \n return rows;\n }", "public int getRowCount() {\n return this.rowCount;\n }", "@Override\r\n public int getRowCount() {\n if (leitores != null) {\r\n return leitores.size();\r\n }\r\n return 0;\r\n }", "public int getRowCount() {\n\t\treturn rowcount;\n\t}", "public static int rowCount() {\n\t return sheet.getPhysicalNumberOfRows();\n\t}", "@Override\r\n public int getRowCount() {\n return this.rowData.size();\r\n }", "public int getRows() {\n\treturn rows;\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn rowData.size();\n\t}", "@Override\n public int getRowCount() {\n return this.data.length;\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn data.length;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn data.length;\n\t}", "public static int RowCount()\r\n\t{\r\n\t\treturn wrksheet.getRows();\r\n\t}", "public int getRowCount()\n {\n return al.size();\n }", "@Override\r\n\tpublic int getRowCount() {\n\t\t\r\n\t\treturn variableData.size();\r\n\t}", "public int getRows() {\n\t\treturn rows;\n\t}", "public int getRows() {\n\t\treturn rows;\n\t}", "public int getRowCount() {\n if (rowBuilder_ == null) {\n return row_.size();\n } else {\n return rowBuilder_.getCount();\n }\n }", "public int getRowCount() {\n if (rowBuilder_ == null) {\n return row_.size();\n } else {\n return rowBuilder_.getCount();\n }\n }" ]
[ "0.89423", "0.8816092", "0.8756285", "0.83867955", "0.826321", "0.8253855", "0.82385814", "0.8223367", "0.813764", "0.80901676", "0.806456", "0.80634147", "0.80603546", "0.8012233", "0.7973971", "0.79449266", "0.79239774", "0.79239774", "0.79239774", "0.79239774", "0.79239774", "0.79239774", "0.79239774", "0.79187477", "0.79165345", "0.78954744", "0.78954744", "0.787209", "0.7869677", "0.7865936", "0.7863243", "0.7847828", "0.7847828", "0.78190917", "0.781285", "0.78098345", "0.7807746", "0.7804547", "0.77874625", "0.7786358", "0.7758551", "0.77461916", "0.77429044", "0.77424127", "0.77424127", "0.77380383", "0.77260375", "0.77213657", "0.7713713", "0.770821", "0.77000666", "0.7685215", "0.7685215", "0.7685215", "0.7685215", "0.7685215", "0.7685215", "0.7671131", "0.76577103", "0.76486516", "0.7643908", "0.7640068", "0.7638655", "0.7638655", "0.76261526", "0.7618294", "0.76177806", "0.7617056", "0.7613704", "0.7608602", "0.76078916", "0.7602616", "0.75951755", "0.7591753", "0.75908965", "0.7588797", "0.7588495", "0.7578705", "0.7576107", "0.7565837", "0.7556519", "0.75512236", "0.75457895", "0.75342155", "0.7527505", "0.75253457", "0.75106597", "0.7498647", "0.7498612", "0.7498525", "0.7485869", "0.74843025", "0.74822074", "0.74822074", "0.7470514", "0.7470262", "0.7467684", "0.7462442", "0.7462442", "0.7461483", "0.7461483" ]
0.0
-1
TODO Autogenerated method stub if(D) Log.d(TAG, "task, currentPercent: " + currentPercent);
@Override public void run() { if(currentPercent > MAX_PERCENT) { stopPressAnimation(); return; } refreshChart(); currentPercent ++; pressAnimationTimer.postDelayed(pressAnimationTask, PRESS_ANIMATION_DURATION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Double getProgressPercent();", "public double getPercent() {\r\n\t\treturn percent;\r\n\t}", "public void setPercent(double percent) {\r\n\t\tthis.percent = percent;\r\n\t}", "@Override\r\n\t\tpublic void onTick(long millisUntilFinished, int percent) {\n\t\t\ttime.setText(StringUtil\r\n\t\t\t\t\t.getSpannStringAbountSize(millisUntilFinished));\r\n\t\t\tif (currentPercent != null) {\r\n\t\t\t\tcurrentPercent.getCurrentPercen(millisUntilFinished,percent);\r\n\t\t\t}\r\n\t\t}", "public float getPercent() {\n return percent;\n }", "public void setPercent(float value) {\n this.percent = value;\n }", "@Override\n public String toString() {\n return 100 * current / total + \"%\";\n }", "public double getPercent() { return this.percentage; }", "@Override\n\tpublic int estimateCurrentProgress() {\n\t\treturn counter.getCurrent();\n\t}", "public boolean thisFinishPercent(int percent){\r\n\t\tint thisPercent = (int)(100.0 * (double)currentAlpha / targetAlpha);\r\n\t\tif(percent >= thisPercent){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void setProgress(int percent) {\n setProgress((float) percent / 100);\n }", "public void setPercent(int percent) {\n\t\tdouble multiplier = Math.pow((double) percent, CURVE)\n\t\t\t\t/ Math.pow(100.00d, CURVE);\n\t\tLog.v(TAG, \"setting percent to: \" + percent + \" via multiplier: \"\n\t\t\t\t+ multiplier);\n\t\tsetMeters(((MAX_METERS - MIN_METERS) * multiplier) + MIN_METERS);\n\t}", "public int getOverallProgressPercent() {\n return overallProgressPercent;\n }", "public void setOverallProgressPercent(int value) {\n this.overallProgressPercent = value;\n }", "public Float completionPercent() {\n return this.completionPercent;\n }", "public static int toPercent(int current, int max) {\n return (int)Math.ceil((double)current * 100D / (double)max);\n }", "@Override\n public void onProgress(float percent, SpeedTestReport report) {\n System.out.println(\"[PROGRESS] progress : \" + percent + \"%\");\n System.out.println(\"[PROGRESS] rate in octet/s : \" + report.getTransferRateOctet());\n System.out.println(\"[PROGRESS] rate in bit/s : \" + report.getTransferRateBit());\n }", "@Override\n\t\t\t\t\t\tpublic void onLoading(long count, long current) {\n\t\t\t\t\t\t\tsuper.onLoading(count, current);\n\t\t\t\t\t\t\tprocess_tv.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\tint process = (int) (current*100/count);\n\t\t\t\t\t\t\tprocess_tv.setText(\"下载进度:\"+process+\"%\");\n\t\t\t\t\t\t}", "private void updateProgressBar() {\n\t\tdouble current = model.scannedCounter;\n\t\tdouble total = model.fileCounter;\n\t\tdouble percentage = (double)(current/total);\n\t\t\n\t\t//Update Progress indicators\n\t\ttxtNumCompleted.setText((int) current + \" of \" + (int) total + \" Completed (\" + Math.round(percentage*100) + \"%)\");\n\t\tprogressBar.setProgress(percentage);\n\t}", "public float getProgressPct() {\n return (float) currentCompactedKVs / getTotalCompactingKVs();\n }", "public void setExecutionPercentage(double percentage);", "@Override\n\t\t\tpublic void onBufferingUpdate(MediaPlayer mp, int percent) {\n\t\t\t\tLog.d(this.getClass().getName(), \"percent: \" + percent);\n\t\t\t\tprogressBar.setSecondaryProgress(percent);\n\t\t\t}", "public int percentSaveDone() {\n if (isSaveDone()) {\n return 100;\n }\n return percent;\n }", "public void setPercentComplete(double percentComplete) {\n\t\t\n\t}", "@Test\n public void currentProgressTest() {\n\n smp.checkAndFillGaps();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n smp.increaseCurrentProgress();\n\n assertEquals(5, smp.getCurrentProgress());\n assertEquals(30, smp.getUnitsTotal() - smp.getCurrentProgress());\n assertEquals(Float.valueOf(30), smp.getEntriesCurrentPace().lastEntry().getValue());\n assertTrue(smp.getEntriesCurrentPace().size() > 0);\n assertFalse(smp.isFinished());\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MMM-YY\", Locale.getDefault());\n\n for (Map.Entry<Date, Float> entry : smp.getEntriesCurrentPace().entrySet()) {\n System.out.println(dateFormat.format(entry.getKey()) + \" : \" + entry.getValue());\n }\n\n\n for (int i = 0; i < 30; i++) {\n smp.increaseCurrentProgress();\n }\n\n assertTrue(smp.isFinished());\n\n smp.increaseCurrentProgress();\n\n assertEquals(Float.valueOf(0), smp.getEntriesCurrentPace().lastEntry().getValue());\n\n }", "private void setProgressPercent(Integer integer) {\n\t\t\n\t}", "public double getPercentCompleted() {\n\t\treturn -1;\n\t}", "public final long getCurrentProgress() {\n /*\n r9 = this;\n int r0 = r9.getState()\n r1 = 1\n r2 = 0\n if (r0 == r1) goto L_0x0012\n r1 = 2\n if (r0 == r1) goto L_0x0019\n r1 = 3\n if (r0 == r1) goto L_0x0014\n r1 = 4\n if (r0 == r1) goto L_0x0014\n L_0x0012:\n r0 = r2\n goto L_0x0032\n L_0x0014:\n long r0 = r9.getTargetProgress()\n goto L_0x0032\n L_0x0019:\n java.lang.String r0 = \"current_value\"\n long r0 = r9.getLong(r0)\n java.lang.String r4 = \"quest_state\"\n long r4 = r9.getLong(r4)\n r6 = 6\n int r8 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1))\n if (r8 == 0) goto L_0x0032\n java.lang.String r4 = \"initial_value\"\n long r4 = r9.getLong(r4)\n long r0 = r0 - r4\n L_0x0032:\n java.lang.String r4 = \"MilestoneRef\"\n int r5 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))\n if (r5 >= 0) goto L_0x003e\n java.lang.String r0 = \"Current progress should never be negative\"\n com.google.android.gms.games.internal.zzbd.m3401e(r4, r0)\n r0 = r2\n L_0x003e:\n long r2 = r9.getTargetProgress()\n int r5 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))\n if (r5 <= 0) goto L_0x004f\n java.lang.String r0 = \"Current progress should never exceed target progress\"\n com.google.android.gms.games.internal.zzbd.m3401e(r4, r0)\n long r0 = r9.getTargetProgress()\n L_0x004f:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.games.quest.zzb.getCurrentProgress():long\");\n }", "public static int getProgressPercentage(long currentDuration, long totalDuration){\r\n Double percentage = (double) 0;\r\n \r\n long currentSeconds = (int) (currentDuration / 1000);\r\n long totalSeconds = (int) (totalDuration / 1000);\r\n \r\n // calculating percentage\r\n percentage =(((double)currentSeconds)/totalSeconds)*100;\r\n \r\n // return percentage\r\n return percentage.intValue();\r\n }", "public int getPercentageComplete() {\n\t\tlong rawPercentage = (100*(System.currentTimeMillis() - startingTime))/(duration);\n\t\treturn rawPercentage >= 100 ? 100 : (int) rawPercentage;\n\t}", "public int getPercentage() {\r\n return Percentage;\r\n }", "@Override\n\t\t\tpublic void onLoading(long total, long current, boolean isUploading) {\n\t\t\t\tsuper.onLoading(total, current, isUploading);\n\t\t\t\tprogress_horizonta_pro.setProgress((int) (current / (float) total * 100));\n\t\t\t\tdown_jd_tv.setText(\"已下载:\"\n\t\t\t\t\t\t+ (int) (current / (float) total * 100) + \"%\");\n\t\t\t}", "private double calculatePercentProgress(BigDecimal projectId) {\r\n log.debug(\"calculatePercentProgress.START\");\r\n ModuleDao moduleDao = new ModuleDao();\r\n LanguageDao languageDao = new LanguageDao();\r\n List<Module> modules = moduleDao.getModuleByProject(projectId);\r\n double totalCurrentLoc = 0;\r\n double totalCurrentPage = 0;\r\n double totalCurrentTestCase = 0;\r\n double totalCurrentSheet = 0;\r\n\r\n double totalPlannedLoc = 0;\r\n double totalPlannedPage = 0;\r\n double totalPlannedTestCase = 0;\r\n double totalPlannedSheet = 0;\r\n for (int i = 0; i < modules.size(); i++) {\r\n Language language = languageDao.getLanguageById(modules.get(i).getPlannedSizeUnitId());\r\n if (language.getSizeUnit().toUpperCase().contains(Constant.LOC.toUpperCase())) {\r\n totalCurrentLoc += modules.get(i).getActualSize().doubleValue();\r\n totalPlannedLoc += modules.get(i).getPlannedSize().doubleValue();\r\n }\r\n\r\n if (language.getSizeUnit().toUpperCase().contains(Constant.TESTCASE.toUpperCase())) {\r\n totalCurrentTestCase += modules.get(i).getActualSize().doubleValue();\r\n totalPlannedTestCase += modules.get(i).getPlannedSize().doubleValue();\r\n }\r\n\r\n if (language.getSizeUnit().toUpperCase().contains(Constant.PAGE_WORD.toUpperCase())) {\r\n totalCurrentPage += modules.get(i).getActualSize().doubleValue();\r\n totalPlannedPage += modules.get(i).getPlannedSize().doubleValue();\r\n }\r\n if (language.getSizeUnit().toUpperCase().contains(Constant.SHEET_EXCEL.toUpperCase())) {\r\n totalCurrentSheet += modules.get(i).getActualSize().doubleValue();\r\n totalPlannedSheet += modules.get(i).getPlannedSize().doubleValue();\r\n }\r\n\r\n }\r\n\r\n double percentProgress = ((totalCurrentLoc * Constant.LOC_WEIGHT)\r\n + (totalCurrentTestCase * Constant.TESTCASE_WEIGHT) + (totalCurrentPage * Constant.PAGE_WEIGHT) + (totalCurrentSheet * Constant.PAGE_WEIGHT))\r\n / ((totalPlannedLoc * Constant.LOC_WEIGHT) + (totalPlannedTestCase * Constant.TESTCASE_WEIGHT)\r\n + (totalPlannedPage * Constant.PAGE_WEIGHT) + (totalPlannedSheet * Constant.PAGE_WEIGHT)) * 100;\r\n\r\n return Math.round(percentProgress * 100.0) / 100.0;\r\n }", "@Override\n\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\tboolean fromUser) {\n\t\t\tcustomPercent = progress / 100.0;\n\t\t\tupdateCustom();\n\t\t\t\n\t\t}", "public int getProgressPercentage(long currentDuration, long totalDuration){\n\t\tDouble percentage = (double) 0;\n\t\t\n\t\tlong currentSeconds = (int) (currentDuration / 1000);\n\t\tlong totalSeconds = (int) (totalDuration / 1000);\n\t\t\n\t\t// calculating percentage\n\t\tpercentage =(((double)currentSeconds)/totalSeconds)*100;\n\t\t\n\t\t// return percentage\n\t\treturn percentage.intValue();\n\t}", "public void done(Integer percentDone) {\n if (percentDone == 100) {\n mApp.updateDialogProgress(percentDone, \"Finishing..\");\n } else {\n mApp.updateDialogProgress(percentDone, \"Uploading: \" + percentDone + \"%\");\n }\n }", "@SuppressLint(\"DefaultLocale\")\n @Override\n public void onSeriesItemAnimationProgress(float percentComplete, float currentPosition) {\n float percentFilled = ((currentPosition - seriesItem1.getMinValue()) / (seriesItem1.getMaxValue() - seriesItem1.getMinValue()));\n //se lo pasamos al TextView\n tvPorciento.setText(String.format(\"%.0f%%\", percentFilled * 100f));\n }", "public String percentageProgress(float goalSavings, float currGoalPrice) {\n float percentageProgress = (goalSavings / currGoalPrice) * 100;\n DecimalFormat df = new DecimalFormat(\"#.##\");\n df.setRoundingMode(RoundingMode.CEILING);\n return \"[\" + df.format(percentageProgress) + \"%]\";\n }", "public void setCurrentCpuFailoverResourcesPercent(int currentCpuFailoverResourcesPercent) {\r\n this.currentCpuFailoverResourcesPercent = currentCpuFailoverResourcesPercent;\r\n }", "@Override\n\tpublic void execute()\n\t{\n\t\tintake.set(percentage);\n\t}", "public Number getPercentageComplete()\r\n {\r\n return (m_percentageComplete);\r\n }", "public Float percentComplete() {\n return this.percentComplete;\n }", "@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tprogressBar.setVisibility(View.VISIBLE);\n\n\t\t\t// updating progress bar value\n\t\t\tprogressBar.setProgress(progress[0]);\n\n\t\t\t// updating percentage value\n\t\t\ttxtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n\t\t}", "public int percent() {\n\t\tdouble meters = meters();\n\t\tif (meters < MIN_METERS) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn (int) (Math.pow((meters - MIN_METERS)\n\t\t\t\t/ (MAX_METERS - MIN_METERS) * Math.pow(100, CURVE),\n\t\t\t\t1.000d / CURVE));\n\t}", "@Override\n\tpublic void onUpdate(String currentTime, int percent) {\n\t\tMessage msg = new Message();\n\t\tmsg.what = UPDATE_DURATION;\n\t\tmsg.obj = currentTime;\n\t\tmsg.arg1 = percent;\n\t\tmHandler.sendMessage(msg);\t// Send message\n\t}", "public double getPercentage() {\n\t\treturn this.percentage;\n\t}", "public void setCurrentMemoryFailoverResourcesPercent(int currentMemoryFailoverResourcesPercent) {\r\n this.currentMemoryFailoverResourcesPercent = currentMemoryFailoverResourcesPercent;\r\n }", "@FloatRange(from = 0, to = 1) float getProgress();", "@NotNull private GridCacheDatabaseSharedManager.CheckpointProgress updateCurrentCheckpointProgress() {\n final CheckpointProgress curr;\n\n synchronized (this) {\n curr = scheduledCp;\n\n curr.state(LOCK_TAKEN);\n\n if (curr.reason == null)\n curr.reason = \"timeout\";\n\n // It is important that we assign a new progress object before checkpoint mark in page memory.\n scheduledCp = new CheckpointProgress(checkpointFreq);\n\n curCpProgress = curr;\n }\n return curr;\n }", "public double getPercentRem(){\n return ((double)freeSpace / (double)totalSpace) * 100d;\n }", "private int getCompleteProgress()\n {\n int complete = (int)(getProgress() * 100);\n \n if (complete >= 100)\n complete = 100;\n \n return complete;\n }", "public double getProgress()\n {\n return ((double)getCount() / (double)getGoal());\n }", "@Override\n\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\tboolean fromUser) {\n\t\tfloat percent=((float)progress*2)/10.0f;\n\t\tvol_cur_percent=MIN_VOL+percent;\n\t\ttv_vol_pro.setText(CUR_VOL+(int)(vol_cur_percent*100)+\"%\");\n\t\t\n\t}", "double getChangePercent() {\n\t return 100 - (currentPrice * 100 / previousClosingPrice);\n\t }", "public void updateProgress(int remaining, int total) {\n try {\n setProgress.invoke(bossBar, ((double) remaining) / ((double) total));\n } catch (IllegalAccessException | InvocationTargetException ex) {\n Bukkit.getLogger().log(Level.SEVERE, \"An error occurred while updating boss bar progress, are you using Minecraft 1.9 or higher?\", ex);\n }\n }", "@Override\n public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {\n TextView txtV_graduacao = inf.findViewById(R.id.textView11);\n txtV_graduacao.setText(\"\"+progress+\" %\");\n }", "public void setPercentageComplete(Number percentComplete)\r\n {\r\n m_percentageComplete = percentComplete;\r\n }", "public Double percentComplete() {\n return this.percentComplete;\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n progressBar.setVisibility(View.VISIBLE);\n\n // updating progress bar value\n progressBar.setProgress(progress[0]);\n\n // updating percentage value\n txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "public double getPercentComplete() {\n\t\tthis.percent_complete = ((double) lines_produced / (double) height) * 100.0;\n\t\treturn this.percent_complete;\n\t}", "public final void mT__16() throws RecognitionException {\n try {\n int _type = T__16;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../com.pellcorp.mydsl/src-gen/com/pellcorp/mydsl/parser/antlr/internal/InternalMyDsl.g:14:7: ( 'percentage' )\n // ../com.pellcorp.mydsl/src-gen/com/pellcorp/mydsl/parser/antlr/internal/InternalMyDsl.g:14:9: 'percentage'\n {\n match(\"percentage\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public final void mT__216() throws RecognitionException {\n try {\n int _type = T__216;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:214:8: ( 'percentage' )\n // InternalMyDsl.g:214:10: 'percentage'\n {\n match(\"percentage\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "int getRemainderPercent();", "@Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount());\n mProgressBar.setProgress((int) progress);\n }", "public void updateProBar(double percentTime) {\n double total = matchProgressBar.getMaximum() - matchProgressBar.getMinimum();\n int calc = (int) (percentTime * total);\n matchProgressBar.setValue(calc);\n }", "double getpercentage() {\n return this.percentage;\n }", "public double getPercentThreshold()\n {\n return percentThreshold;\n }", "public void update(float percent){\n\t\tint sFrame = state[stateIndex].startframe;\n\t\tint eFrame = state[stateIndex].endFrame;\n\n\t\tinterpol += percent;\n\t\tif(interpol >= 1.0){\n\t\t\tinterpol -= 1.0f;\n\t\t\tcFrame++;\n\t\t\tif(cFrame >= eFrame)\n\t\t\t\tcFrame = sFrame;\n\t\t\tnFrame = cFrame + 1;\n\t\t\tif(nFrame >= eFrame)\n\t\t\t\tnFrame = sFrame;\n\t\t}\n\t}", "@Override\n\t\t\t\t\t\t\t\t\tpublic void downLoadCurrProcess(String Percentage) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "public float getProgress() {\n // Depends on the total number of tuples\n return 0;\n }", "java.lang.String getPercentage();", "public int getProgress() {\n return Math.round(mProgress);\n }", "public String percentComplete() {\r\n\tdouble percent = ((double) bytesRead / (double) bytesLength);\r\n\tpercent *= 100;\r\n\treturn fmt.format(percent);\r\n }", "private void updateProgressBar(int currentPoints){\n\n progressBar.setProgress(currentPoints);\n\n switch(currentPoints){\n case 1:\n progressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\n break;\n case 2:\n progressBar.getProgressDrawable().setColorFilter(Color.parseColor(\"#FF6600\"), PorterDuff.Mode.SRC_IN);\n\n break;\n case 3:\n progressBar.getProgressDrawable().setColorFilter(Color.parseColor(\"#FFFF66\"), PorterDuff.Mode.SRC_IN);\n\n break;\n case 4:\n progressBar.getProgressDrawable().setColorFilter(Color.GREEN, PorterDuff.Mode.SRC_IN);\n\n break;\n case 5:\n progressBar.getProgressDrawable().setColorFilter(Color.parseColor(\"#2C6700\"), PorterDuff.Mode.SRC_IN);\n\n }\n\n\n\n }", "public void onclickpercent(View v){\n Button b = (Button) v;\n String temp;\n double t;\n String y;\n displayscreen = screen.getText().toString();\n displayscreen2 = screen2.getText().toString();\n if (displayscreen.equals(\"\") && displayscreen2.equals(\"\")) //handle if display is empty\n return;\n else if (displayscreen.equals(\"\") && !displayscreen2.equals(\"\")) {\n temp = screen2.getText().toString();\n if (temp.contains(\"+\") || temp.contains(\"-\") || temp.contains(\"x\") || temp.contains(\"÷\")){ //handle if user inserts only operators\n return;}\n t = Double.valueOf(temp) /100.0;\n y=df2.format(t);\n screen.setText(y);\n String z=\"%\";\n screen2.setText(temp+z);\n }\n else\n {\n temp = screen.getText().toString();\n t = Double.valueOf(temp) /100.0;\n y=df2.format(t);\n screen.setText(y);\n String z=\"%\";\n screen2.setText(temp+z);\n }\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n pDialog.setProgress(progress[0]);\n\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "public void setProgress(final int percentage, final String user) {\r\n\t\tif (this.statusBar != null) {\r\n\t\t\tif (this.progressBarUser == null || user == null || this.progressBarUser.equals(user)) {\r\n\t\t\t\tif (percentage > 99 | percentage == 0)\r\n\t\t\t\t\tthis.progressBarUser = null;\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.progressBarUser = user;\r\n\r\n\t\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\t\tthis.statusBar.setProgress(percentage);\r\n\t\t\t\t\tif (this.taskBarItem != null) {\r\n\t\t\t\t\t\tif (user == null)\r\n\t\t\t\t\t\t\tthis.taskBarItem.setProgressState(SWT.DEFAULT);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthis.taskBarItem.setProgressState(GDE.IS_MAC ? SWT.PAUSED : SWT.NORMAL);\r\n\r\n\t\t\t\t\t\tthis.taskBarItem.setProgress(percentage);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tDataExplorer.this.statusBar.setProgress(percentage);\r\n\t\t\t\t\t\t\tif (DataExplorer.this.taskBarItem != null) {\r\n\t\t\t\t\t\t\t\tif (user == null)\r\n\t\t\t\t\t\t\t\t\tDataExplorer.this.taskBarItem.setProgressState(SWT.DEFAULT);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tDataExplorer.this.taskBarItem.setProgressState(GDE.IS_MAC ? SWT.PAUSED : SWT.NORMAL);\r\n\r\n\t\t\t\t\t\t\t\tDataExplorer.this.taskBarItem.setProgress(percentage);\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.progessPercentage = percentage;\r\n\t\t\t\tif (percentage >= 100) DataExplorer.this.resetProgressBar();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static int validatePercent(int percent) {\n\t\tif(percent > 100) {\n\t\t\treturn 100;\n\t\t}\n\t\telse if(percent < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn percent;\n\t\t}\n\t}", "public String toString() {\n return String.format(\"%.1f%%\", getPercentage());\n }", "@IcalProperty(pindex = PropertyInfoIndex.PERCENT_COMPLETE,\n jname = \"percentComplete\",\n todoProperty = true)\n public void setPercentComplete(final Integer val) {\n percentComplete = val;\n }", "public int getProgress() {\n\t\treturn activeQuest.getThreshold() - getRemaining();\n\t}", "private void updateProgress() {\n progressBar.setProgress( (1.0d * currentQuestion) / numQuestions);\n }", "public double getMainPercentage(){return mainPercentage;}", "public double getProgressFraction() {\n return (double) schedule.getSteps() / config.getSimulationIterations();\n }", "public int getProgress();", "@Override\n \t\tprotected Void doInBackground(Void... params) \n \t\t{\n \t\t\ttry \n \t\t\t{\n \t\t\t\twhile(m_progress < 100) {\n \t\t\t\t\t//Get the current thread's token\n \t\t\t\t\tsynchronized (this) \n \t\t\t\t\t{\n \t\t\t\t\t\tthis.wait();\n \t\t\t\t\t\t//Set the current progress. \n \t\t\t\t\t\t//This value is going to be passed to the onProgressUpdate() method.\n \t\t\t\t\t\tpublishProgress(m_progress);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} \n \t\t\tcatch (InterruptedException e) \n \t\t\t{\n \t\t\t\te.printStackTrace();\n \t\t\t}\n \t\t\treturn null;\n \t\t}", "@ApiModelProperty(value = \"Percentage for the Detailed Estimate Deduction\")\n\n\t@Min(0)\n\tpublic Integer getPercentage() {\n\t\treturn percentage;\n\t}", "public BigDecimal getUsagePercentage() {\n return this.usagePercentage;\n }", "public final EObject entryRulePERCENT() throws RecognitionException {\n EObject current = null;\n\n EObject iv_rulePERCENT = null;\n\n\n try {\n // InternalMLRegression.g:1269:48: (iv_rulePERCENT= rulePERCENT EOF )\n // InternalMLRegression.g:1270:2: iv_rulePERCENT= rulePERCENT EOF\n {\n newCompositeNode(grammarAccess.getPERCENTRule()); \n pushFollow(FOLLOW_1);\n iv_rulePERCENT=rulePERCENT();\n\n state._fsp--;\n\n current =iv_rulePERCENT; \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 }", "@Override\n\t\t\tpublic void onProgressChanged(SeekArc seekArc, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\tprog = progress;\n\t\t\t}", "public void progressMade();", "public abstract void setPercentDead(double percent);", "public final void mPERCENT() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = PERCENT;\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:433:8: ( '%' )\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:433: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}", "public int getProgress() {\n long d = executable.getParent().getEstimatedDuration();\n if(d<0) return -1;\n \n int num = (int)((System.currentTimeMillis()-startTime)*100/d);\n if(num>=100) num=99;\n return num;\n }", "public float getPercentage() {\r\n\t\tif(!isValid)\r\n\t\t\treturn -1;\r\n\t\treturn percentage;\r\n\t}", "private void setProgress(String what)\n {\n if (progressBar != null)\n {\n double elapsed = (System.currentTimeMillis() - startMs) / 1000.;\n String etl = String.format(\"Elapsed: %4.0f\", elapsed);\n progressBar.setEstTime(etl);\n progressBar.setWorkingOn(what);\n progressBar.setProgress(-1);\n }\n }", "public void setChangeRateFactor(double percent) {\r\n\t\tchangeRateFactor = Math.abs(percent);\r\n\t}", "private void updateTaskActivityLabel()\r\n {\r\n setLabelValue(\"Tile Downloads \" + myActiveQueryCounter.intValue());\r\n setProgress(myDoneQueryCounter.doubleValue() / myTotalSinceLastAllDoneCounter.doubleValue());\r\n }", "private void percent()\n\t{\n\t\tDouble percent;\t\t//holds the right value percentage of the left value\n\t\tString newText = \"\";//Holds the updated text \n\t\tif(calc.getLeftValue ( ) != 0.0 && Fun != null)\n\t\t{\n\t\t\tsetRightValue();\n\t\t\tpercent = calc.getRightValue() * 0.01 * calc.getLeftValue();\n\t\t\tleftValue = calc.getLeftValue();\n\t\t\tnewText += leftValue;\n\t\t\tswitch (Fun)\n\t\t\t{\n\t\t\t\tcase ADD:\n\t\t\t\t\tnewText += \" + \";\n\t\t\t\t\tbreak;\n\t\t\t\tcase SUBTRACT:\n\t\t\t\t\tnewText += \" - \";\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIVIDE:\n\t\t\t\t\tnewText += \" / \";\n\t\t\t\t\tbreak;\n\t\t\t\tcase MULTIPLY:\n\t\t\t\t\tnewText += \" * \";\n\t\t\t\t\tbreak;\n\t\t\t}//end switch\n\t\t\t\n\t\t\tnewText += \" \" + percent;\n\t\t\tentry.setText(newText);\n\t\t\t\n\t\t}//end if\n\t\t\n\t}", "public String percentCompleteCountQATasks() {\n\t\tint fixed = closedQATasks().count();\n\t\tint total = qaTasks().count();\n\t\t\n return percentCompleteStringFromDouble(((double)fixed/(double)total) * 100);\n\t}", "public final float getMovementPercent() {\r\n\t\treturn movementPercent;\r\n\t}" ]
[ "0.6550668", "0.6475624", "0.6468302", "0.64647305", "0.64455473", "0.63600105", "0.6357154", "0.63524264", "0.63434285", "0.6285324", "0.6273655", "0.6165916", "0.6126069", "0.6088788", "0.60693276", "0.5989124", "0.5954816", "0.59467065", "0.59262633", "0.5907465", "0.59069794", "0.59034324", "0.5886831", "0.5872454", "0.5849564", "0.5847369", "0.58416206", "0.5806232", "0.5776153", "0.57747287", "0.5750067", "0.57252103", "0.572118", "0.5702879", "0.5680801", "0.567681", "0.5671483", "0.56683385", "0.5667116", "0.5662019", "0.5659271", "0.5658632", "0.5627491", "0.56229293", "0.55991775", "0.55737036", "0.556374", "0.5563308", "0.5560387", "0.55566", "0.55536205", "0.55440634", "0.5539467", "0.5537031", "0.55329555", "0.55301166", "0.55272645", "0.55164987", "0.5513336", "0.5512351", "0.5502587", "0.55014586", "0.5501076", "0.5494472", "0.548941", "0.54843885", "0.54783857", "0.5476914", "0.54572004", "0.5456916", "0.54531115", "0.54362047", "0.5427245", "0.54235137", "0.5417332", "0.5414351", "0.5413788", "0.5406206", "0.5395397", "0.53951263", "0.5389395", "0.53870875", "0.5382658", "0.5382061", "0.5375231", "0.5374924", "0.5371463", "0.53714246", "0.5367918", "0.53655833", "0.53640914", "0.53634995", "0.53613615", "0.535925", "0.53579986", "0.53576344", "0.5355636", "0.53542495", "0.53429717", "0.53394103", "0.53349644" ]
0.0
-1
TODO: filter service name Get potentially registered service
@Override public <ITF> Optional<ITF> getService(Class<ITF> itfClass, String servicePath) { return IRegistryProvider.INSTANCE.getService(itfClass, servicePath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getServiceName();", "java.lang.String getServiceName();", "Object getService(String serviceName);", "String getServiceName();", "String getServiceName();", "public Object getService(String serviceName);", "public String getServiceName();", "public abstract String getServiceName();", "java.lang.String getService();", "java.lang.String getService();", "java.lang.String getService();", "Object getService(String serviceName, boolean checkExistence);", "public final Service getService(final String name) {\r\n Service x, y;\r\n\r\n for (x = this.m_services[name.hashCode()\r\n & (this.m_services.length - 1)]; x != null; x = x.m_next) {\r\n for (y = x; y != null; y = y.m_equal) {\r\n if (name.equals(y.m_name))\r\n return y;\r\n }\r\n }\r\n\r\n return null;\r\n }", "protected abstract String getATiempoServiceName();", "public Service getService(final String serviceName) {\n final String[] arr = serviceName.split(\"::\");\n if (arr.length != 2) {\n logger.error(\n \"Servicename didnt match pattern 'archive::service': {}\",\n serviceName);\n return null;\n }\n final Archive archive = getArchive(arr[0]);\n if (archive != null) {\n return archive.getService(arr[1]);\n }\n logger.error(\"Could not find archive '{}'\", arr[0]);\n return null;\n }", "net.zyuiop.ovhapi.api.objects.services.Service getServiceNameServiceInfos(java.lang.String serviceName) throws java.io.IOException;", "public java.lang.String getServiceName(){\n return localServiceName;\n }", "public ServiceInstance lookupInstance(String serviceName);", "public String getService() {\n\t\treturn service.get();\n\t}", "public String getService() {\n return service;\n }", "public String getService() {\n return service;\n }", "public String getService() {\n return service;\n }", "public String getServiceName()\r\n {\r\n return serviceName;\r\n }", "public String getService(){\n\t\t return service;\n\t}", "ClassOfService getClassOfService();", "public String getServiceName()\n {\n return serviceName;\n }", "public List<CatalogService> getService(String service);", "public abstract ServiceLocator find(String name);", "public static String getServiceName() {\n\t\treturn serviceName;\n\t}", "public static String getServiceName() {\n\t\treturn serviceName;\n\t}", "public String getServiceName() {\n return serviceName;\n }", "net.zyuiop.ovhapi.api.objects.license.windows.Windows getServiceName(java.lang.String serviceName) throws java.io.IOException;", "public String getServiceName(){\n return serviceName;\n }", "public String getServiceName() {\r\n return this.serviceName;\r\n }", "public String getServiceName() {\n return serviceName;\n }", "public String getServiceName() {\n return this.serviceName;\n }", "public String getService() {\n return this.service;\n }", "public String getService() {\n return this.service;\n }", "public String getService() {\n return this.service;\n }", "public java.lang.CharSequence getService() {\n return service;\n }", "public static Object getService(String name, ServletContext sc) {\r\n\t\tAppContextWrapper acw = new ServletContextWrapper(sc);\r\n\t\tServiceFacade serviceFacade = new ServiceFacade();\r\n\t\tServiceFactory serviceFactory = serviceFacade.getServiceFactory(acw);\r\n\t\treturn serviceFactory.getService(name, acw);\r\n\t}", "public String getServiceName() {\n return this.serviceName;\n }", "public java.lang.CharSequence getService() {\n return service;\n }", "public String getServiceName()\n {\n return this.mServiceName;\n }", "boolean hasServiceName();", "boolean hasServiceName();", "private Optional<String> toServiceName(String cf) {\n assert cf.startsWith(SERVICES_PREFIX);\n int index = cf.lastIndexOf(\"/\") + 1;\n if (index < cf.length()) {\n String prefix = cf.substring(0, index);\n if (prefix.equals(SERVICES_PREFIX)) {\n String sn = cf.substring(index);\n if (Checks.isClassName(sn))\n return Optional.of(sn);\n }\n }\n return Optional.empty();\n }", "public Object getService() {\n return service;\n }", "public ServiceName getServiceName() {\n return serviceName;\n }", "private Service getService() {\n return service;\n }", "public interface ServiceProvider {\n\n /**\n * This method allows to define a priority for a registered ServiceProvider instance. When multiple providers are\n * registered in the system the provider with the highest priority value is taken.\n *\n * @return the provider's priority (default is 0).\n */\n int getPriority();\n\n /**\n * Access a list of services, given its type. The bootstrap mechanism should\n * order the instance for precedence, hereby the most significant should be\n * first in order. If no such services are found, an empty list should be\n * returned.\n *\n * @param serviceType the service type.\n * @return The instance to be used, never {@code null}\n */\n <T> List<T> getServices(Class<T> serviceType);\n\n /**\n * Access a single service, given its type. The bootstrap mechanism should\n * order the instance for precedence, hereby the most significant should be\n * first in order and returned. If no such services are found, null is\n * returned.\n *\n * @param serviceType the service type.\n * @return The instance, (with highest precedence) or {@code null}, if no such service is available.\n */\n default <T> T getService(Class<T> serviceType) {\n return getServices(serviceType).stream().findFirst().orElse(null);\n }\n}", "String getServiceRef();", "public Service getServiceForName(String name) throws SessionQueryException\n {\n Service returnedService = null;\n\n try\n {\n ComponentStruct component = getSessionManagementAdminService().getComponent(name);\n returnedService = new Service(name, component.isRunning, component.isMaster);\n }\n catch(Exception e)\n {\n throw new SessionQueryException(String.format(\"Could not receive service for %s.\", name), e);\n }\n\n return returnedService;\n }", "java.lang.String getServiceId();", "private ServiceType getServiceType(String serviceTypeName){\n for(ServiceType serviceType: servicesFromSP)\n if(serviceTypeName.equals(serviceType.getServiceName() + \" / \" + serviceType.getHourlyRate() + \" $/H\"))\n return(serviceType);\n return(new ServiceType());\n }", "public java.lang.String getServiceName() {\n java.lang.Object ref = serviceName_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n serviceName_ = s;\n }\n return s;\n }\n }", "public java.lang.String getServiceName() {\n java.lang.Object ref = serviceName_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n serviceName_ = s;\n }\n return s;\n }\n }", "String getService_id();", "private static interface Service {}", "public java.lang.String getOSGiServiceIdentifier();", "protected abstract String getAtiempoServiceNameEnReversa();", "private String getServiceName(Descriptors.ServiceDescriptor descriptor ) {\r\n return descriptor.getFullName();\r\n }", "private DFAgentDescription[] findService(String name, String type) {\n\t\ttry {\n\t\t\tServiceDescription filter = new ServiceDescription();\n\t\t\tfilter.setName(name);\n\t\t\tfilter.setType(type);\n\n\t\t\tDFAgentDescription dfd = new DFAgentDescription();\n\t\t\tdfd.addServices(filter);\n\n\t\t\tDFAgentDescription[] results = DFService.search(this, dfd);\n\t\t\treturn results;\n\n\t\t} catch (FIPAException e) {\n\t\t\tLOG.error(\"exception while searching service {}:{} : {}\", name, type, e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public static Service getServiseByName(ArrayList<Service> services ,String name){\r\n for(Service service:services){\r\n if(service.getName().equalsIgnoreCase(name)){\r\n return service;\r\n }\r\n }\r\n return null;\r\n }", "public String getOSGiServiceIdentifier();", "public Service getService(Object serviceKey) throws RemoteException {\n Service theService = (Service) serviceList.get(serviceKey);\n return theService;\n }", "public static String getServiceName(MessageContext msgCtx) throws AxisFault {\n\n Object serviceParam = msgCtx.getProperty(FIXConstants.FIX_SERVICE_NAME);\n if (serviceParam != null) {\n String serviceName = serviceParam.toString();\n if (serviceName != null && !serviceName.equals(\"\")) {\n return serviceName;\n }\n }\n\n Map<String, String> trpHeaders = (Map) msgCtx.getProperty(MessageContext.TRANSPORT_HEADERS);\n //try to get the service from the transport headers\n if (trpHeaders != null) {\n String serviceName = (trpHeaders.get(FIXConstants.FIX_MESSAGE_SERVICE));\n if (serviceName != null) {\n return serviceName;\n }\n }\n throw new AxisFault(\"Unable to find a valid service for the message\");\n }", "private Object obtainService(String osgiURL)\r\n\t\t\t\tthrows InvalidSyntaxException {\r\n\t\t\tOSGiURLParser urlParser = new OSGiURLParser(osgiURL);\r\n\t\t\ttry {\r\n\t\t\t\turlParser.parse();\r\n\t\t\t}\r\n\t\t\tcatch (IllegalStateException stateException) {\r\n\t\t\t\tlogger.log(Level.SEVERE, \"An exception occurred while trying to parse this osgi URL\", stateException);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tif (urlParser.getServiceInterface() == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\treturn getService(m_bundleContext, urlParser);\r\n\t\t}", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getTypeOfService(){\n\treturn typeOfService;\n}", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n }\n }", "public String getTypeOfService(){\n\t\treturn typeOfService;\n\t}", "String getServiceId();", "public java.lang.String getServiceName() {\n java.lang.Object ref = serviceName_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n serviceName_ = s;\n return s;\n }\n }", "<V> V getService(String serviceName, Class<V> targetType, boolean checkExistence);", "boolean hasService();", "boolean hasService();", "boolean hasService();", "boolean hasService();", "boolean hasService();", "@Override\n public String getServiceEndpoint(String serviceName) {\n return serviceEndpoints.get(serviceName);\n }", "public YangString getServiceValue() throws JNCException {\n return (YangString)getValue(\"service\");\n }", "public YangString getServiceValue() throws JNCException {\n return (YangString)getValue(\"service\");\n }", "@Override\r\n\tpublic sn.ucad.master.assurance.bo.Service consulterService(Integer idService) {\n\t\tService service= (Service) serviceRepository.findOne(idService);\r\n\t\tif(service==null) throw new RuntimeException(\"Service introuvable\");\r\n\t\treturn (sn.ucad.master.assurance.bo.Service) service;\r\n\t}", "go.micro.runtime.RuntimeOuterClass.Service getServices(int index);", "go.micro.runtime.RuntimeOuterClass.Service getServices(int index);", "public java.lang.String getServiceName() {\n java.lang.Object ref = serviceName_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n serviceName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getServiceName() {\n java.lang.Object ref = serviceName_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n serviceName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Service getService() {\n\t\treturn _service;\n\t}", "public boolean getUseGlobalService();", "public String getServiceID();", "public java.lang.String getServiceName() {\n java.lang.Object ref = serviceName_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n serviceName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "ServicesPackage getServicesPackage();", "@Override\r\n\tpublic Object getServiceObject(IMyxName name) {\n\t\tif (name.equals(INTERFACE_NAME_IN_GUISYNCHRONIZER))\r\n\t\t\treturn this;\r\n\t\telse if(name.equals(INTERFACE_NAME_OUT_CLIENTSERVICE))\r\n\t\t\treturn clientService;\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String printServiceInfo() {\n\t\treturn serviceName;\n\t}", "@Override\n public ServiceName getServiceName() {\n return ServiceName.DARK_SKY;\n }", "go.micro.runtime.RuntimeOuterClass.Service getService();" ]
[ "0.77034914", "0.77034914", "0.7566403", "0.7530779", "0.7530779", "0.7515987", "0.7405252", "0.7389607", "0.72752434", "0.72752434", "0.72752434", "0.7154827", "0.70445365", "0.69402516", "0.6927956", "0.6893487", "0.6827101", "0.6800125", "0.6752891", "0.67497396", "0.67497396", "0.67497396", "0.6743553", "0.6730685", "0.6690329", "0.66862434", "0.66569424", "0.6647493", "0.6637447", "0.6637447", "0.66248894", "0.6603666", "0.660332", "0.65821874", "0.65310055", "0.6524079", "0.6504042", "0.6504042", "0.6504042", "0.64880025", "0.647358", "0.645784", "0.64501333", "0.6449482", "0.64315945", "0.64315945", "0.64290386", "0.6424557", "0.6412065", "0.63943934", "0.6393475", "0.6387775", "0.63749343", "0.63489896", "0.6337575", "0.6309114", "0.6309114", "0.62937576", "0.6279824", "0.62651855", "0.62621826", "0.6261402", "0.6250787", "0.62431955", "0.624189", "0.6237484", "0.62373877", "0.6232753", "0.62285846", "0.62285846", "0.62285846", "0.6225004", "0.62102133", "0.62102133", "0.62102133", "0.619723", "0.618194", "0.6180287", "0.61747235", "0.61737156", "0.61737156", "0.61737156", "0.61737156", "0.61737156", "0.6171701", "0.6169362", "0.6169362", "0.6150008", "0.61396605", "0.61396605", "0.6128587", "0.6128587", "0.6123674", "0.6099686", "0.60805446", "0.6079448", "0.6075829", "0.6068928", "0.60665846", "0.60537565", "0.60508573" ]
0.0
-1
Adds given frame to animation
public void addFrame(AnimationFrame frame) { this.frames.add(frame); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addFrame(final Image image) {\n\t\tframes.add(new AnimFrame(image));\n\t}", "public void addFrame(Point newFrame)\n {\n frames.add(newFrame);\n }", "public void addFrame(Frame frame) throws BowlingException\r\n\t{\r\n\t\tif(frames.size()==10)\r\n\t\t\tthrow new BowlingException();\r\n\t\telse\r\n\t\t\tframes.add(frame);\r\n\t\t\t\r\n\t\t//to be implemented\r\n\t\t\r\n\t\t\r\n\t}", "private void addFrame() {\n String name = selectString(\"What is the name of this frame?\");\n ReferenceFrame frame = selectFrame(\"What frame are you defining this frame relative to?\");\n double v = selectDouble(\"How fast is this frame moving (as a fraction of c)?\", -1, 1);\n try {\n frame.boost(name, v);\n System.out.println(\"Frame added!\");\n } catch (NameInUseException e) {\n System.out.println(\"A frame with that name already exists!\");\n } catch (FasterThanLightException e) {\n System.out.println(\"Nothing can move as quickly as light!\");\n }\n }", "void addKeyframe(IKeyframe keyframe);", "public void addAnimation(Animation anim) {\n\t\tif(!inAnimList(anim)) {\n\t\t\tanimList.add(anim);\n\t\t\tanimation = anim; // set it as the current one\n\t\t\t//connect(anim,SIGNAL(frameChanged()),this,SLOT(repaint()));\n\t\t\trepaint();\n\t\t}\n\t}", "public synchronized void addAnimation(AnimationBase a) {\n addAnimation(a, 1);\n }", "private void addAnimation(NodeAnimation animation) {\n\t\tlog.finest(\"Adding animation\");\n\t\t\n\t\tanimations.addFirst(animation);\n\t}", "public void addKeyFrame() throws IOException{\n\t\tkeyFrameList.add(captureCurrentFrame());\n\t\n\t\tif(keyFrameList.size() > 1 && timer != null){ \n\t\t\tupdateTimer();\n\t\t}else{\n\t\t\tmakeTimer(); \n\t\t}\n\t}", "public void add(AnimationReader animation) throws IOException {\n\t\tfor (int frameIndex = 0; frameIndex < animation.getFrameCount(); frameIndex++) {\n\t\t\tBufferedImage bi = animation.getNextFrame(false);\n\t\t\tfloat duration = (float) animation.getFrameDuration();\n\t\t\taddFrame(duration, bi, null);\n\t\t}\n\t}", "public Frame3.Builder addFrame(Frame3 frame) {\n\t\t\treturn addFrame(frame, FramePosition.CENTRE);\n\t\t}", "public void addAnimation(Animation animation) {\n if (this.animationExists(animation.getClass())) return;\n\n animations.add(animation);\n }", "private void selectFrame()\n\t{\n\t\t// Increment the animation frame\n\t\tif ((long) Game.getTimeMilli() - frameStart >= interval)\n\t\t{\n\t\t\tsetFrame(currFrame+1);\n\t\t}\n\t\t// Get the path to the current frame's image\n\t\tsetFramePath();\n\t\t// If the image frame doesn't exist...\n\t\tif (!GraphicsManager.getResManager().resExists(currFramePath))\n\t\t{\n\t\t\tif (isLooping())\n\t\t\t{\n\t\t\t\tsetFrame(1);\n\t\t\t\tsetFramePath();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisFinished = true;\n\t\t\t}\n\t\t}\n\t}", "private void animate() {\r\n\t\tif (spriteCounter > 50) {\r\n\t\t\tanimationFrame = 0;\r\n\t\t} else {\r\n\t\t\tanimationFrame = -16;\r\n\t\t}\r\n\t\t\r\n\t\tif (spriteCounter > 100) {\r\n\t\t\tspriteCounter = 0;\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tspriteCounter++;\r\n\t\tsetImage((Graphics2D) super.img.getGraphics());\r\n\t}", "public void setFrame(int frame)\n\t{\n\t\tisFinished = false;\n\t\tcurrFrame = frame;\n\t\tframeStart = (long) Game.getTimeMilli();\n\t}", "public void nextFrame() {\r\n if (frame < maxFrames - 1) {\r\n frame++;\r\n } else {\r\n frame = 0;\r\n }\r\n }", "public void addAnimation(Animation animation) {\n // Insert into the animations list by start time\n int startTime = animation.getStartTime();\n if (!animations.containsKey(startTime)) {\n animations.put(startTime, Collections.synchronizedList(new ArrayList<Animation>()));\n }\n \n animations.get(startTime).add(animation);\n \n // Also insert by element because it's way easier to render that way\n if (animation instanceof ElementAnimation) {\n ElementAnimation e = (ElementAnimation) animation;\n \n for (ElementController controller : e.getElements()) {\n if (!animationsByElement.containsKey(controller)) {\n animationsByElement.put(controller, Collections.synchronizedSet(new TreeSet<Animation>()));\n }\n \n animationsByElement.get(controller).add(animation);\n }\n }\n }", "public Animation(ArrayList frames) {\n\t\t// Set the frames\n\t\tthis.frames = frames;\n\t}", "public synchronized void addAnimation(AnimationBase a, int repeats) {\n a.setAnimationManager(this);\n // System.out.println(\"AnimationManager:\\n>> animation added!\");\n \n a.setNumberOfRepeats(repeats);\n \n //NEW\n // animations.add(a);\n addedAnims.add(a);\n \n if (repaintThread != null) {\n // oldTime = System.nanoTime();\n oldTime = 0;\n repaintThread.start();\n }\n }", "@Override\n\tpublic void draw() {\n\t\tfloat delta = Gdx.graphics.getDeltaTime();\n\t\ti+= delta;\n\t\timage.setRegion(animation.getKeyFrame(i, true));\n\t\t//this.getSpriteBatch().draw(animation.getKeyFrame(i, true), 0, 0);\n\t\t\n\t\tGdx.app.log(\"tag\", \"delta = \" + i);\n\t\t\n\t\tsuper.draw();\n\t}", "private void createAnimation () {\n // KeyFrame frame = new KeyFrame(Duration.millis(MILLISECOND_DELAY), e -> myManager.step());\n // myAnimation = new Timeline();\n // myAnimation.setCycleCount(Timeline.INDEFINITE);\n // myAnimation.getKeyFrames().add(frame);\n }", "public void pushAnimation(Animation animation) {\n animationsToInitialize.add(animation);\n }", "public AnimFrame(Image image) {\n\t\t\tthis.image = image;\n\t\t}", "public void incrementFrameNumber()\n {\n\tframeNumber++;\n }", "public void setFrame(int value) {\r\n this.frame = value;\r\n }", "void update() {\n rectToBeDrawn = new Rect((frameNumber * frameSize.x)-1, 0,(frameNumber * frameSize.x + frameSize.x) - 1, frameSize.x);\n\n //now the next frame\n frameNumber++;\n\n //don't try and draw frames that don't exist\n if(frameNumber == numFrames){\n frameNumber = 0;//back to the first frame\n }\n }", "@Override\n\tpublic void addFrom(Frame f) {\n\t\tint arr[][];\n\n\t\tif (f instanceof GrayImage) {\n\t\t\tarr = ((GrayImage)f).getFrame();\n\t\t}\n\n\t\telse {\n\t\t\treturn;\n\t\t}\n\n\t\tint x[] = new int[1];\n\n\t\tif (arr.length == this.frame.length && arr[0].length == this.frame[0].length) {\n\t\t\tfor (int i = 0; i<this.frame.length;i++) {\n\t\t\t\tfor (int j = 0; j<this.frame[0].length;j++) {\n\t\t\t\t\tx = f.getPixel(i, j);\n\t\t\t\t\tif ( this.frame[i][j] + x[0] > 255*255) {\n\t\t\t\t\t\tthis.frame[i][j] = 255*255;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.frame[i][j] = this.frame[i][j] + x[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public void newFrameAt(int offset) {\n framePointers.push(runStack.size()-offset);\n }", "public void computeAnimationFrame(int frame) {\n\t\tFont f = fnt[(frame < nSteps) ? frame : (nSteps - 1)];\r\n\t\ttxt.setFont(f);\r\n\t\tStopSize.set(f.getSize());\r\n\t}", "public Frame3.Builder addFrame(Frame3 frame, FramePosition position) {\n\t\t\tif (managedInstance.frame3s == null) {\n\t\t\t\tmanagedInstance.frame3s = new ArrayList<Frame3>();\n\t\t\t}\n\t\t\tConsumer<Frame3> f = obj -> {\n\t\t\t\tmanagedInstance.frame3s.add(obj);\n\t\t\t};\n\t\t\treturn new Frame3.Builder(this, f, frame, position);\n\t\t}", "public void putFrame()\n {\n if (currImage != null)\n {\n super.putFrame(currImage, faceRects, new Scalar(0, 255, 0), 0);\n }\n }", "public void setFrame(String frame){\r\n\t\taddAttribute(new PointingElement(\"frame\",frame));\r\n\t}", "public synchronized void addUniqueAnimation(AnimationBase a) {\n addUniqueAnimation(a, 1);\n }", "public void addAnimationDef(AnimationDef newDef) {\n getAdapter().add(newDef);\n }", "private KeyFrame addNewKeyFrame(){\n return new KeyFrame(Duration.millis(1000), e -> {\n\n //Performs a check on the width of the board to see if it should run concurrently or not\n if (board.getWidth() < 600) {\n gOL.nextGeneration();\n } else {\n\n //Does a check to see if threadWorkers executorService has been shut down for any reason.\n //Runs nextGenerationConcurrent if it is still active, or normally if not.\n if (!threadWorker.getShutDownStatus()) {\n gOL.nextGenerationConcurrent();\n } else {\n gOL.nextGeneration();\n }\n }\n\n draw();\n gOL.incrementGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n });\n }", "public void newFrameAt(int offset){\n runStack.newFrameAt(offset);\n }", "public void addFreezeFrame()\n{\n int index = Collections.binarySearch(_freezeFrames, getTime());\n if(index<0)\n _freezeFrames.add(-index - 1, getTime());\n}", "public void setFrame(double anX, double aY, double aWidth, double aHeight)\n{\n setFrameXY(anX, aY);\n setFrameSize(aWidth, aHeight);\n}", "public synchronized void addFrame(float duration, BufferedImage bi,\n\t\t\tMap<String, Object> settings) throws IOException {\n\t\tif (closed)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"this writer has already been closed\");\n\t\tint relativeDuration = (int) (duration * DEFAULT_TIME_SCALE + .5);\n\n\t\tvideoTrack.validateSize(bi.getWidth(), bi.getHeight());\n\t\tlong startPosition = out.getBytesWritten();\n\t\twriteFrame(out, bi, settings);\n\t\tlong byteSize = out.getBytesWritten() - startPosition;\n\t\tVideoSample sample = new VideoSample(relativeDuration,\n\t\t\t\tout.getBytesWritten() - byteSize, byteSize);\n\t\tvideoTrack.addSample(sample);\n\t}", "public void processFrame(float deltaTime);", "protected abstract void animate(int anim);", "public void buildFrame();", "private String addAnimation() {\n\t\t// Three Parameters: AnimNumber, AnimName, AnimArgument\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|anim\");\n\t\tif (!parameters[0].equals(\"0\")) {\n\t\t\ttag.append(parameters[0]);\n\t\t}\n\t\ttag.append(\":\" + parameters[1]);\n\t\tif (parameters.length > 2) {\n\t\t\ttag.append(\" \" + parameters[2]);\n\t\t}\n\t\treturn tag.toString();\n\n\t}", "public abstract void animationStarted();", "private void animateLeft(){\n if(frame == 1){\n setImage(run1_l);\n }\n else if(frame == 2){\n setImage(run2_l);\n }\n else if(frame == 3){\n setImage(run3_l);\n }\n else if(frame == 4){\n setImage(run4_l);\n }\n else if(frame == 5){\n setImage(run5_l);\n }\n else if(frame == 6){\n setImage(run6_l);\n }\n else if(frame == 7){\n setImage(run7_l);\n }\n else if(frame == 8){\n setImage(run8_l);\n frame =1;\n return;\n }\n frame ++;\n }", "private void addSubframes(\n int index, org.chromium.components.paint_preview.common.proto.PaintPreview.PaintPreviewFrameProto value) {\n value.getClass();\n ensureSubframesIsMutable();\n subframes_.add(index, value);\n }", "void startAnimation();", "private void animateRight(){\n if(frame == 1){\n setImage(run1);\n }\n else if(frame == 2){\n setImage(run2);\n }\n else if(frame == 3){\n setImage(run3);\n }\n else if(frame == 4){\n setImage(run4);\n }\n else if(frame == 5){\n setImage(run5);\n }\n else if(frame == 6){\n setImage(run6);\n }\n else if(frame == 7){\n setImage(run7);\n }\n else if(frame == 8){\n setImage(run8);\n frame =1;\n return;\n }\n frame ++;\n }", "public void setFrame(ChessFrame f)\n {\n frame = f;\n }", "public Frame3.Builder addFrame(String frameCode, GennyToken serviceToken) throws Exception {\n\n\t\t\treturn addFrame(frameCode, FramePosition.CENTRE, serviceToken);\n\t\t}", "public void PlayAnimation(Animation animation) {\r\n // If this animation is already running, do not restart it.\r\n if (Animation() == animation)\r\n return;\r\n\r\n // Start the new animation.\r\n this.animation = animation;\r\n this.frameIndex = 0;\r\n this.time = 0.0f;\r\n }", "public Frame3.Builder addFrame(Frame3... frames) {\n\t\t\tfor (Frame3 frame : frames) {\n\t\t\t\taddFrame(frame, FramePosition.CENTRE);\n\t\t\t}\n\t\t\treturn this;\n\t\t}", "public abstract void animation(double seconds);", "public void setFrame(int newFrame) {\r\n if (newFrame < maxFrames) {\r\n frame = newFrame;\r\n }\r\n }", "public void animation(Animation animation) {\n this.getAnimation().setAs(animation);\n this.getFlags().flag(Flag.ANIMATION);\n }", "public void setFrameY(double aY) { double y = _y + aY - getFrameY(); setY(y); }", "protected void animate(GreenfootImage[] images, int currentFrame)\n {\n setImage(images[currentFrame]);\n }", "public void addChildFrame(JFrame frame);", "public void setFrameX(double anX) { double x = _x + anX - getFrameX(); setX(x); }", "private Animation<TextureRegion> createWalkingAnimation(MyCumulusGame game) {\n Texture walkingTexture = game.getAssetManager().get(\"bird.png\");\n TextureRegion[][] walkingRegion = TextureRegion.split(walkingTexture, walkingTexture.getWidth() / 3, walkingTexture.getHeight()/3);\n\n TextureRegion[] frames = new TextureRegion[2]; //todo change to accomodate any color of bird\n System.arraycopy(walkingRegion[0], 0, frames, 0, 2);\n\n return new Animation<TextureRegion>(FRAME_TIME, frames);\n }", "public void setFrame(BufferedImage frame) {\r\n\t\tplayer = frame;\r\n\t}", "private void addSubframes(org.chromium.components.paint_preview.common.proto.PaintPreview.PaintPreviewFrameProto value) {\n value.getClass();\n ensureSubframesIsMutable();\n subframes_.add(value);\n }", "public void addRotation(int frame, Quaternion rotation) {\r\n // copy the quaternion, avoid sharing quaternion rotations.\r\n\r\n Quaternion copy = new Quaternion(rotation);\r\n if (frame + 1 > rotationFrames.size()) {\r\n int numElements = frame + 1 - rotationFrames.size();\r\n rotationFrames.ensureCapacity(frame + 1);\r\n for (int i = 0; i < numElements; ++i) {\r\n rotationFrames.add(null);\r\n }\r\n }\r\n\r\n rotationFrames.set(frame, copy);\r\n }", "public void animate()\n\t{\n\t\tanimation.read();\n\t}", "FRAME createFRAME();", "@Override\n public void animate() {\n }", "@Override\n public void run() {\n AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();\n frameAnimation.start();\n }", "public void onAnimationStart(Animation arg0) {\n\t}", "public void startAnimation() {\n animationStart = System.currentTimeMillis();\n }", "public void setAnimaciones( ){\n\n int x= 0;\n Array<TextureRegion> frames = new Array<TextureRegion>();\n for(int i=1;i<=8;i++){\n frames.add(new TextureRegion(atlas.findRegion(\"demon01\"), x, 15, 16, 15));\n x+=18;\n }\n this.parado = new Animation(1 / 10f, frames);//5 frames por segundo\n setBounds(0, 0, 18, 15);\n\n }", "void insertView(ViewFrame view);", "public synchronized void addFrame(float duration, File image)\n\t\t\tthrows IOException {\n\t\tif (closed)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"this writer has already been closed\");\n\n\t\tint relativeTime = (int) (duration * DEFAULT_TIME_SCALE + .5);\n\t\tvideoTrack.addFrame(relativeTime, image);\n\t}", "public void loadAnimation( int[] newSequence )\n\t{\n\t\tanimation.load( newSequence );\n\t}", "public Frame3.Builder addFrame(List<Frame3> frames, FramePosition position) {\n\t\t\tfor (Frame3 frame : frames) {\n\t\t\t\taddFrame(frame, position);\n\t\t\t}\n\t\t\treturn this;\n\t\t}", "public void onAnimationStart(Animation animation) {\n\r\n }", "public void onAdd2Scene() {\n\t\tAnimation src = getSourceAnimation();\n\t\tif( src != null ) {\n\t\t\tadd2Scene(src, getSourceAnimation().actFrame);\n\t\t\tlog.info(\" adding frame from {}\", vm.cutInfo);\n\t\t}\n\t\t\n\t}", "public void addStar() {\n\n\t\t\n\t\tString html = \"<img id='award-big-button' src='/gwt-resources/images/awards/star_big.png' class='animated \" + getRandomAnimationIn() + \"'/>\";\n\t\t_starPanel.add(new HTML(html));\n\t\tnew Timer() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal Element bigImage = DOM.getElementById(\"award-big-button\");\n\t\t\t\tif(bigImage != null) {\n\t\t\t\t\tbigImage.addClassName(\"animated slideOutUp\");\n\t\t\t\t\tnew Timer() {\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tbigImage.removeFromParent();\n\t\t\t\t\t\t}\n\t\t\t\t\t}.schedule(1500);\n\t\t\t\t}\n\t\t\t}\n\t\t}.schedule(2000);\n\t\t\n\t\tsetStars(_stars + 1, true);\n\t}", "public void onAnimationStart(Animation animation) {\n }", "@Override\n\t\t\t\t\t\t\tpublic void onAnimationStart(Animation arg0) {\n\n\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void onAnimationStart(Animation arg0) {\n\n\t\t\t\t\t\t\t}", "private void setFramePath()\n\t{\n\t\tcurrFramePath = location + \"/\" + currentSet + \"/\" + \"frame\"\n\t\t\t\t+ Integer.toString(currFrame) + \".png\";\n\t}", "void setCurrentFrame(int frameNum) {\n this.currFrame = frameNum;\n }", "public void nextFrame() {\r\n frame++;\r\n if( frame > lastEditFrame + frameDelay ) {\r\n // The last transaction is 'done'\r\n transaction = null;\r\n }\r\n }", "private void draw() {\n frames++;\n MainFrame.singleton().draw();\n }", "public void setFrameXY(double anX, double aY) { setFrameX(anX); setFrameY(aY); }", "void editKeyframe(IKeyframe newKeyframe);", "public void nextFrame() {\n\t\tfor (int i = 0; i < numFlakes; i++) {\n\t\t\tflakes[i].nextFrame();\n\t\t}\n\t}", "@Override\n\tpublic void draw() {\n\t\tdouble t = System.currentTimeMillis();\n\t\tdouble dt = t - currentTime;\n\t\tcurrentTime = t;\n\n\t\t// Fetch current animation\n\t\tBaseAnimation animation = AnimationManager.getInstance().getCurrentAnimation();\n\t\tif (animation == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Draw animation frame with delta time\n\t\tanimation.draw(dt);\n\n\t\t// Send image to driver\n\t\tdriver.displayImage(animation.getImage());\n\n\t\t// Display previews\n\t\tbackground(0);\n\t\tif (ledPreviewEnabled) {\n\t\t\timage(preview.renderPreview(animation.getImage()), 0, 0);\n\t\t} else {\n\t\t\ttextAlign(CENTER);\n\t\t\ttextSize(16);\n\t\t\ttext(\"Press W to preview the animation.\", previewRect.width/2, previewRect.height/2);\n\t\t}\n\t\t\n\t\tif (sourcePreviewEnabled && BaseCanvasAnimation.class.isAssignableFrom(animation.getClass())) {\n\t\t\timage(((BaseCanvasAnimation) animation).getCanvasImage(), 0, 0);\n\t\t} else if (sourcePreviewEnabled) {\n\n\t\t\t// Copy animation image (else the animation image gets resized)\n\t\t\t// and scale it for better visibility\n\t\t\tPImage sourcePreview = animation.getImage().get();\n\t\t\tsourcePreview.resize(130, 405);\n\n\t\t\timage(sourcePreview, 0, 0);\n\t\t}\n\n\t}", "public Frame3.Builder addFrame(List<Frame3> frames) {\n\t\t\tfor (Frame3 frame : frames) {\n\t\t\t\taddFrame(frame, FramePosition.CENTRE);\n\t\t\t}\n\t\t\treturn this;\n\t\t}", "public boolean onCreateAnimation(Rect appFrame, Rect curRect) {\n if (appFrame == null) {\n return false;\n }\n setTargetRect(new Rect(0, 0, appFrame.width(), appFrame.height()));\n return super.onCreateAnimation(appFrame, curRect);\n }", "Frame createFrame();", "@Override\r\n\t\t\tpublic void onAnimationStart(Animation arg0) {\n\t\t\t\t\r\n\t\t\t}", "private void setAnimation(View viewToAnimate, int position)\n{\n // If the bound view wasn't previously displayed on screen, it's animated\n if (position > lastPosition)\n {\n Animation animation = AnimationUtils.loadAnimation(context, R.anim.push_in);\n viewToAnimate.startAnimation(animation);\n lastPosition = position;\n }\n}", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tif (frameTick > 30) {\n\t\t\tframeTick = 0;\n\t\t\tframeState = (frameState + 1) % 2;\n\t\t}\n\t\tgc.drawImage(imageFrame.get(frameState), position.first - GameCanvas.getCurrentInstance().getStartX(),\n\t\t\t\tposition.second);\n\t\tframeTick++;\n\t}", "@Override\n\tpublic void onAnimationStart(Animation arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onAnimationStart(Animation arg0) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onAnimationStart(Animation arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onAnimationStart(Animation arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onAnimationStart(Animation arg0) {\n\n\t\t\t}", "public void startAnimation() {\n timer.start();\n }" ]
[ "0.7289002", "0.70395464", "0.68624246", "0.68538463", "0.6741677", "0.66980666", "0.65528333", "0.651318", "0.6330423", "0.6316948", "0.6297398", "0.62807596", "0.627911", "0.62455976", "0.62277865", "0.62168163", "0.6202847", "0.6067413", "0.60472506", "0.59119487", "0.58975834", "0.5881173", "0.58569664", "0.5834694", "0.5830821", "0.58241326", "0.581312", "0.57860017", "0.5782294", "0.57794684", "0.57744086", "0.5764338", "0.5763823", "0.5746799", "0.573844", "0.57372665", "0.57164466", "0.569725", "0.56753236", "0.56701314", "0.56622314", "0.5660102", "0.5635532", "0.5633001", "0.56303006", "0.56225497", "0.56149125", "0.56125385", "0.5610296", "0.56012654", "0.5600267", "0.5596069", "0.557887", "0.55783623", "0.5550068", "0.5547071", "0.5533352", "0.55054575", "0.5498201", "0.54948354", "0.54734147", "0.5463225", "0.5462716", "0.54615945", "0.5457116", "0.5440552", "0.54399717", "0.543681", "0.543587", "0.54278666", "0.54190516", "0.54102236", "0.5393889", "0.538761", "0.5385634", "0.5385609", "0.5384706", "0.53815436", "0.5376067", "0.5376067", "0.53663284", "0.53614724", "0.5347419", "0.53441465", "0.5339621", "0.533581", "0.5335422", "0.5324144", "0.5321615", "0.5306248", "0.53023636", "0.52863306", "0.52845174", "0.52783924", "0.5276934", "0.5276934", "0.5275946", "0.5275946", "0.5266759", "0.52565813" ]
0.79570436
0
Created by ProdigalWang on 2017/3/6.
public interface IStartView { void showStartInfo(String url); void goMainActivity(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n public void init() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo38117a() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\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 mo4359a() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "private void init() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void init() {}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\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}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n protected void init() {\n }", "private void m50366E() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n public void initialize() { \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "public void mo6081a() {\n }", "Petunia() {\r\n\t\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n public void initialize() {\n \n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "private void strin() {\n\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void init() {\n\n\n\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\t}" ]
[ "0.6332959", "0.6163705", "0.5962934", "0.59436125", "0.59436125", "0.5943195", "0.5848984", "0.58364975", "0.58210284", "0.5813531", "0.57799906", "0.57691264", "0.5763226", "0.57600224", "0.57412046", "0.571184", "0.5705291", "0.57039607", "0.56964636", "0.56870544", "0.5683593", "0.56831306", "0.5681499", "0.56737804", "0.5666199", "0.5661976", "0.5653163", "0.5648944", "0.5648944", "0.5648944", "0.5648944", "0.5648944", "0.5648944", "0.5628504", "0.5628504", "0.5628504", "0.5628504", "0.5628504", "0.5612202", "0.56120265", "0.56095153", "0.56093955", "0.5598953", "0.5567141", "0.55626076", "0.5562272", "0.5562272", "0.55566776", "0.55566776", "0.55540603", "0.55538905", "0.55487084", "0.55487084", "0.55392045", "0.55392045", "0.55392045", "0.5538205", "0.5535309", "0.55343556", "0.55310404", "0.55271196", "0.55157965", "0.55079573", "0.55064785", "0.5497802", "0.5497339", "0.5497339", "0.5497339", "0.5497221", "0.5494887", "0.54896665", "0.54884374", "0.54884374", "0.54884374", "0.5476801", "0.5476149", "0.5476149", "0.5476149", "0.5476149", "0.5476149", "0.5476149", "0.5476149", "0.5468374", "0.54608464", "0.5451672", "0.5451062", "0.5445549", "0.54396397", "0.54381067", "0.5437499", "0.54348546", "0.5434667", "0.5413127", "0.53928286", "0.53928286", "0.53928286", "0.5389261", "0.53834397", "0.5374373", "0.5372059", "0.5360311" ]
0.0
-1
Creates new form EditarVenda
public EditarVenda() { initComponents(); URL caminhoIcone = getClass().getResource("/mklivre/icone/icone2.png"); Image iconeTitulo = Toolkit.getDefaultToolkit().getImage(caminhoIcone); this.setIconImage(iconeTitulo); conexao = ModuloConexao.conector(); codigoCliente.setEnabled(false); lucro.setEnabled(false); valorLiquidoML.setEnabled(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VendaView(int idVenda) throws SQLException {\n initComponents();\n\n jTextFieldIDFuncionario.setEnabled(false);\n jTextFieldNomeCliente.setEnabled(false);\n jTextFieldNomeFuncionario.setEnabled(false);\n// jTextFieldNotaFiscal.setEnabled(false);\n jTextFieldNumeroParcelas.setEnabled(false);\n jTextFieldValorVenda.setEnabled(false);\n jFormattedTextDataVenda.setEnabled(false);\n jTextFieldIDCliente.setEnabled(false);\n int idVenda1 = idVenda;\n buscarPressedEnter();\n\n if (idVenda != -1) {\n textFieldIDVenda.setText(\"\" + idVenda1);\n\n Connection connection;\n try {\n connection = new ConnectionFactory().getConnection();\n\n VendaDAO vendaDAO = new VendaDAO(connection);\n modeloVenda1 = vendaDAO.buscaPorId(Long.parseLong(String.valueOf(idVenda1)));\n\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ClienteDAO clienteDAO = new ClienteDAO(connection);\n ParcelaDAO parcelasDao = new ParcelaDAO(connection);\n List<ModeloParcela> modeloParcelas = new ArrayList<ModeloParcela>();\n\n if (null == pedidoDAO.buscaPorVenda(Integer.parseInt(String.valueOf(modeloVenda1.getId())))) {\n\n } else {\n modeloPedido1 = pedidoDAO.buscaPorVenda(Integer.parseInt(String.valueOf(modeloVenda1.getId())));\n\n idPedidoClasse = modeloPedido1.getId();\n viewProdutoPedidos = pedidoDAO.buscarPedidoproduto(Integer.parseInt(String.valueOf(idPedidoClasse)));\n modeloParcelas = parcelasDao.listaPorIdVenda(modeloVenda1.getId());\n listarParcelas(modeloParcelas);\n PreencherTabela();\n PreencherTabela2();\n }\n\n FuncionarioDAO funcionarioDAO = new FuncionarioDAO(connection);\n ModeloFuncionario modeloFuncionario = new ModeloFuncionario();\n\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n ModeloCliente modeloCliente = new ModeloCliente();\n modeloFuncionario = funcionarioDAO.buscaPorId(modeloVenda1.getIdfuncionario());\n modeloCliente = clienteDAO.buscaPorId(modeloVenda1.getIdcliente());\n System.out.println(modeloVenda1.getIdcliente());\n jTextFieldIDFuncionario.setText(\"\" + modeloFuncionario.getId());\n jTextFieldNomeFuncionario.setText(modeloFuncionario.getNome());\n jFormattedTextDataVenda.setText(format.format(modeloVenda1.getDataVenda()));\n\n jTextFieldIDCliente.setText(\"\" + modeloCliente.getId());\n jTextFieldNomeCliente.setText(\"\" + modeloCliente.getNome());\n jTextFieldNotaFiscal.setText(modeloVenda1.getNotaFiscal());\n\n jTextFieldValorVenda.setText(\"\" + modeloVenda1.getValorVenda());\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(rootPane, ex);\n Logger.getLogger(VendaView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n }", "public frmVenda() {\n initComponents();\n }", "public frmTelaVendas() {\n initComponents();\n this.carrinho = new CarrinhoDeCompras();\n listaItens.setModel(this.lista);\n }", "public void editar() {\n try {\n ClienteDao fdao = new ClienteDao();\n fdao.Atualizar(cliente);\n\n JSFUtil.AdicionarMensagemSucesso(\"Cliente editado com sucesso!\");\n\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n }", "public VentasGUI() {\n initComponents();\n btnEliminarVenta.setEnabled(false);\n tablaVentasDefault = (DefaultTableModel) tablaVentas.getModel();\n tablaProductosDefault = (DefaultTableModel) tablaProductos.getModel();\n\n \n \n txtDesde.setToolTipText(\"Ver ventas desde la fecha\");\n txtDesde.setDateFormatString(\"dd/MM/yyyy\");\n txtHasta.setToolTipText(\"Ver ventas hasta la fecha\");\n txtHasta.setDateFormatString(\"dd/MM/yyyy\");\n txtDesde.getDateEditor().setEnabled(false);\n txtHasta.getDateEditor().setEnabled(false);\n txtHasta.setDate(Calendar.getInstance().getTime());\n\n SimpleDateFormat formatoDelTexto = new SimpleDateFormat(\"dd/MM/yyyy\");\n String strFecha = \"01/01/2015\";\n Date fecha = null;\n try {\n\n fecha = formatoDelTexto.parse(strFecha);\n\n } catch (ParseException ex) {\n\n ex.printStackTrace();\n\n }\n txtDesde.setDate(fecha);\n }", "public ViewCreatePagamento() {\n initComponents();\n clientesDAO cDAO = DaoFactory.createClientesDao(); \n matriculaDAO mDAO = DaoFactory.createMatriculaDao();\n \n cmbIDClientes.addItem(null);\n cDAO.findAll().forEach((p) -> {\n cmbIDClientes.addItem(p.getNome());\n });\n \n \n txtDataAtual.setText(DateFormat.getDateInstance().format(new Date()));\n }", "public MostraVenta(String idtrasp, Object[][] clienteM1, Object[][] vendedorM1, String idmarc, String responsable,ListaTraspaso panel)\n{\n this.padre = panel;\n this.clienteM = clienteM1;\n this.vendedorM = vendedorM1;\n this.idtraspaso= idtrasp;\n this.idmarca=idmarc;\n//this.tipoenvioM = new String[]{\"INGRESO\", \"TRASPASO\"};\n String tituloTabla =\"Detalle Venta\";\n // padre=panel;\n String nombreBoton1 = \"Registrar\";\n String nombreBoton2 = \"Cancelar\";\n // String nombreBoton3 = \"Eliminar Empresa\";\n\n setId(\"win-NuevaEmpresaForm1\");\n setTitle(tituloTabla);\n setWidth(400);\n setMinWidth(ANCHO);\n setHeight(250);\n setLayout(new FitLayout());\n setPaddings(WINDOW_PADDING);\n setButtonAlign(Position.CENTER);\n setCloseAction(Window.CLOSE);\n setPlain(true);\n\n but_aceptar = new Button(nombreBoton1);\n but_cancelar = new Button(nombreBoton2);\n // addButton(but_aceptarv);\n addButton(but_aceptar);\n addButton(but_cancelar);\n\n formPanelCliente = new FormPanel();\n formPanelCliente.setBaseCls(\"x-plain\");\n //formPanelCliente.setLabelWidth(130);\n formPanelCliente.setUrl(\"save-form.php\");\n formPanelCliente.setWidth(ANCHO);\n formPanelCliente.setHeight(ALTO);\n formPanelCliente.setLabelAlign(Position.LEFT);\n\n formPanelCliente.setAutoWidth(true);\n\n\ndat_fecha1 = new DateField(\"Fecha\", \"d-m-Y\");\n fechahoy = new Date();\n dat_fecha1.setValue(fechahoy);\n dat_fecha1.setReadOnly(true);\n\ncom_vendedor = new ComboBox(\"Vendedor al que enviamos\", \"idempleado\");\ncom_cliente = new ComboBox(\"Clientes\", \"idcliente\");\n//com_tipo = new ComboBox(\"Tipo Envio\", \"idtipo\");\n initValues1();\n\n\n\n formPanelCliente.add(dat_fecha1);\n// formPanelCliente.add(com_tipo);\n// formPanelCliente.add(tex_nombreC);\n// formPanelCliente.add(tex_codigoBarra);\n // formPanelCliente.add(tex_codigoC);\nformPanelCliente.add(com_vendedor);\n formPanelCliente.add(com_cliente);\n add(formPanelCliente);\nanadirListenersTexfield();\n addListeners();\n\n }", "public EditarDados(Produto dados) {\n \tthis.dados = dados;\n initComponents();\n setLocationRelativeTo(null);\n }", "private void azzeraInsertForm() {\n\t\tviewInserimento.getCmbbxTipologia().setSelectedIndex(-1);\n\t\tviewInserimento.getTxtFieldDataI().setText(\"\");\n\t\tviewInserimento.getTxtFieldValore().setText(\"\");\n\t\tviewInserimento.getTxtFieldDataI().setBackground(Color.white);\n\t\tviewInserimento.getTxtFieldValore().setBackground(Color.white);\n\t}", "public FrmCrearEmpleado() {\n initComponents();\n tFecha.setDate(new Date());\n }", "@FXML\r\n private void editar(ActionEvent event) {\n selecionado = tabelaCliente.getSelectionModel()\r\n .getSelectedItem();\r\n\r\n //Se tem algum cliente selecionado\r\n if (selecionado != null) { //tem clienteonado\r\n //Pegar os dados do cliente e jogar nos campos do\r\n //formulario\r\n textFieldNumeroCliente.setText(\r\n String.valueOf( selecionado.getIdCliente() ) );\r\n textfieldNome.setText( selecionado.getNome() ); \r\n textFieldEmail.setText(selecionado.getEmail());\r\n textFieldCpf.setText(selecionado.getCpf());\r\n textFieldRg.setText(selecionado.getRg());\r\n textFieldRua.setText(selecionado.getRua());\r\n textFieldCidade.setText(selecionado.getCidade());\r\n textFieldBairro.setText(selecionado.getBairro());\r\n textFieldNumeroCasa.setText(selecionado.getNumeroCasa());\r\n textFieldDataDeNascimento.setValue(selecionado.getDataNascimemto());\r\n textFieldTelefone1.setText(selecionado.getTelefone1());\r\n textFieldTelefone2.setText(selecionado.getTelefone2());\r\n textFieldCep.setText(selecionado.getCep());\r\n \r\n \r\n \r\n }else{ //não tem cliente selecionado na tabela\r\n mensagemErro(\"Selecione um cliente.\");\r\n }\r\n\r\n }", "public static void inserir(Venda venda)\r\n throws Exception {\r\n venda.setId(totalVenda++);\r\n listaVenda.add(venda);\r\n }", "@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}", "public de_gestionar_contrato_añadir() {\n initComponents();\n lbl_error_nombre_cliente.setVisible(false);\n lbl_error_numero_contrato.setVisible(false);\n lbl_error_fecha_inicio.setVisible(false);\n lbl.setVisible(false);\n lbl_fecha_expira_contrato.setVisible(false);\n\n // detectar cambio en jdateChoser (fecha de inicio en agregar contrato)\n fecha_inicio_contrato.getDateEditor().addPropertyChangeListener(\n new PropertyChangeListener() {\n @Override\n public void propertyChange(PropertyChangeEvent e) {\n if (\"date\".equals(e.getPropertyName())) {\n System.out.println(e.getPropertyName()\n + \": \" + (Date) e.getNewValue());\n if(fecha_inicio_contrato.getDate()!=null){\n lbl_fecha_expira_contrato.setText(toma_fecha(fecha_inicio_contrato).substring(0,6)+String.valueOf(Integer.parseInt(toma_fecha(fecha_inicio_contrato).substring(6))+1));\n lbl.setVisible(true);\n lbl_fecha_expira_contrato.setVisible(true);\n }\n }else{\n lbl_fecha_expira_contrato.setText(\"\");\n lbl_error_fecha_inicio.setVisible(false);\n lbl.setVisible(false);\n lbl_fecha_expira_contrato.setVisible(false);\n }\n }\n });\n this.add(fecha_inicio_contrato);\n \n deshabilitarPegar();\n }", "public void editarMateria() {\n materia.setIdDepartamento(departamento);\n ejbFacade.edit(materia);\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.execute(\"PF('MateriaEditDialog').hide()\");\n ejbFacade.limpiarCache();\n items = ejbFacade.findAll();\n departamento = new Departamento();\n materia = new Materia();\n// FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se editó con éxito\"));\n// requestContext.execute(\"PF('mensajeRegistroExitoso').show()\");\n\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se editó con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n\n requestContext.update(\"MateriaListForm\");\n requestContext.update(\"MateriaCreateForm\");\n\n }", "public void editarTbagendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.editTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento editado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado ediçãos do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n\n }", "public creacionempresa() {\n initComponents();\n mostrardatos();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n vendasLancamento = new javax.swing.JPanel();\n labelCodProd = new javax.swing.JLabel();\n txtCodProd = new javax.swing.JTextField();\n ButtonFinalVenda = new javax.swing.JButton();\n PaneVendas = new javax.swing.JScrollPane();\n TableVendas = new javax.swing.JTable();\n ButtonIncluir = new javax.swing.JButton();\n ButtonExcluir = new javax.swing.JButton();\n labelPagamento = new javax.swing.JLabel();\n labelCliente = new javax.swing.JLabel();\n TextCliente = new javax.swing.JTextField();\n btnCancelar = new javax.swing.JButton();\n ButtonConsultar = new javax.swing.JToggleButton();\n labelData = new javax.swing.JLabel();\n txtData = new javax.swing.JTextField();\n txtValorPagamento = new javax.swing.JTextField();\n textConsultaCliente = new javax.swing.JTextField();\n\n labelCodProd.setText(\"Cód. Produto\");\n\n txtCodProd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtCodProdActionPerformed(evt);\n }\n });\n\n ButtonFinalVenda.setText(\"Finalizar Venda\");\n ButtonFinalVenda.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ButtonFinalVendaActionPerformed(evt);\n }\n });\n\n TableVendas.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Código\", \"Modelo\", \"Marca\", \"Tamanho\", \"Cor\", \"Preço\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.Float.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, true, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n TableVendas.setName(\"tableVendasElement\"); // NOI18N\n TableVendas.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n TableVendasMouseClicked(evt);\n }\n });\n PaneVendas.setViewportView(TableVendas);\n\n ButtonIncluir.setText(\"Incluir\");\n ButtonIncluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ButtonIncluirActionPerformed(evt);\n }\n });\n\n ButtonExcluir.setText(\"Excluir\");\n ButtonExcluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ButtonExcluirActionPerformed(evt);\n }\n });\n\n labelPagamento.setText(\"A Pagar:\");\n\n labelCliente.setText(\"Id Cliente\");\n\n TextCliente.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n TextClienteActionPerformed(evt);\n }\n });\n\n btnCancelar.setText(\"Cancelar\");\n btnCancelar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelarActionPerformed(evt);\n }\n });\n\n ButtonConsultar.setText(\"Consultar\");\n ButtonConsultar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ButtonConsultarActionPerformed(evt);\n }\n });\n\n labelData.setText(\"Data:\");\n\n txtData.setEditable(false);\n txtData.setFocusable(false);\n\n txtValorPagamento.setEditable(false);\n txtValorPagamento.setText(\"0,0\");\n txtValorPagamento.setFocusable(false);\n txtValorPagamento.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtValorPagamentoActionPerformed(evt);\n }\n });\n\n textConsultaCliente.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n textConsultaClienteMouseClicked(evt);\n }\n });\n textConsultaCliente.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n textConsultaClienteActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout vendasLancamentoLayout = new javax.swing.GroupLayout(vendasLancamento);\n vendasLancamento.setLayout(vendasLancamentoLayout);\n vendasLancamentoLayout.setHorizontalGroup(\n vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(labelCodProd)\n .addComponent(labelCliente))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtCodProd, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)\n .addComponent(TextCliente))\n .addGap(27, 27, 27)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(ButtonIncluir)\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addComponent(ButtonConsultar)\n .addGap(34, 34, 34)\n .addComponent(textConsultaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(41, Short.MAX_VALUE))\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addComponent(btnCancelar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(ButtonExcluir, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(ButtonFinalVenda)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(labelPagamento)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(labelData)\n .addGap(25, 25, 25)))\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtData, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtValorPagamento, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(8, 8, 8))\n .addComponent(PaneVendas))\n .addContainerGap())\n );\n vendasLancamentoLayout.setVerticalGroup(\n vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, vendasLancamentoLayout.createSequentialGroup()\n .addGap(35, 35, 35)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtCodProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(labelCodProd)\n .addComponent(ButtonIncluir))\n .addGap(16, 16, 16)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(labelCliente)\n .addComponent(TextCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(ButtonConsultar)\n .addComponent(textConsultaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(22, 22, 22)\n .addComponent(PaneVendas, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(ButtonExcluir)\n .addComponent(ButtonFinalVenda)\n .addComponent(btnCancelar))\n .addGap(82, 82, 82))\n .addGroup(vendasLancamentoLayout.createSequentialGroup()\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(labelPagamento)\n .addComponent(txtValorPagamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(vendasLancamentoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(labelData)\n .addComponent(txtData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(60, 60, 60))))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(vendasLancamento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(vendasLancamento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n }", "public EmpresaEditView(String codigo, JDesktopPane index) {\n super(\"EDITAR EMPRESA\");\n index.add(this);\n initComponents();\n EmpresaDAO dao = new EmpresaDAO();\n EmpresaBEAN empresas = dao.get(codigo);\n txtNome.setText(empresas.getNome());\n txtEndereco.setText(empresas.getEndereco());\n txtBairro.setText(empresas.getBairro());\n txtCodigo.setText(empresas.getCodigo());\n txtCnpj.setText(empresas.getCnpj());\n txtTelefone.setText(empresas.getTelefone());\n txtLogradouro.setText(empresas.getLogradouro());\n selectEstado.setSelectedItem(empresas.getEstado());\n\n }", "private void modi() { \n try {\n cvo.getId_cliente();\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.actualizar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Modificado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para Modificar registro!\");\n }\n }", "public crud_empleados() {\n initComponents();\n txt_usuario1.setEditable(false);\n Mostrar();\n \n\n\n }", "public FrmCadastroVenda(JDesktopPane desktop, int permissao, int op, String nota) {\r\n\t\tsuper();\r\n\t\tthis.desk = desktop;\r\n\t\tthis.permissao = permissao;\r\n\t\tthis.op = op;\r\n\t\tinitialize();\r\n\t\ttxtCnpjCliente.setEditable(false);\r\n\t\ttxtCnpjRepresentada.setEditable(false);\r\n\t\ttxtVendedor.setEditable(false);\r\n\t\tchkComissionado.setEnabled(false);\r\n\t\ttxtVlFinal.setEditable(false);\r\n\t\ttxtVlFinal2.setEditable(false);\r\n\t\tif(getOp()==0){//Novo cadastro\r\n\r\n\t\t}else{//Exibir dados\r\n\t\t\tif(getPermissao()==1){\r\n\t\t\t\tabaPrincipal.addTab(\"Comissão\", null, abaComissao, null);\t\r\n\t\t\t\tajustaDados(nota);\r\n\t\t\t\tdesabilitaCampos();\r\n\t\t\t\tif(txtComissao.getText().equals(\"R$ 0,00\")){\r\n\t\t\t\t\ttxtComissao.setEditable(true);\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttxtComissao.setEditable(false);\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tajustaDados(nota);\r\n\t\t\t\tdesabilitaCampos();\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Venda() {\n initComponents();\n }", "public Venda() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jblLogo = new javax.swing.JLabel();\n nome = new javax.swing.JLabel();\n txtNome = new javax.swing.JTextField();\n endereço = new javax.swing.JLabel();\n Cidade = new javax.swing.JLabel();\n txtCiddade = new javax.swing.JTextField();\n JbtnSair = new javax.swing.JButton();\n codClient = new javax.swing.JLabel();\n txtCodProduto = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jComboBox1 = new javax.swing.JComboBox<>();\n JbtnSair1 = new javax.swing.JButton();\n nome1 = new javax.swing.JLabel();\n txtNome1 = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n nome2 = new javax.swing.JLabel();\n txtNome2 = new javax.swing.JTextField();\n jScrollPane2 = new javax.swing.JScrollPane();\n tblDetalhesVenda = new javax.swing.JTable();\n JbtnSair2 = new javax.swing.JButton();\n jLabel4 = new javax.swing.JLabel();\n nome3 = new javax.swing.JLabel();\n txtNome3 = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Venda\");\n setBackground(new java.awt.Color(204, 204, 204));\n setResizable(false);\n\n jPanel1.setToolTipText(\"Venda\");\n\n jblLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Pacote_imagens/Camada 2.png\"))); // NOI18N\n\n nome.setText(\"Cód. Produto:\");\n\n txtNome.setToolTipText(\"\");\n txtNome.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtNomeActionPerformed(evt);\n }\n });\n\n endereço.setText(\"Tamanho:\");\n\n Cidade.setText(\"ID Cliente:\");\n\n txtCiddade.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtCiddadeActionPerformed(evt);\n }\n });\n\n JbtnSair.setText(\"Cancelar\");\n JbtnSair.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JbtnSairActionPerformed(evt);\n }\n });\n\n codClient.setText(\"Nome Produto:\");\n\n txtCodProduto.setEditable(false);\n txtCodProduto.setBackground(new java.awt.Color(255, 255, 255));\n txtCodProduto.setToolTipText(\"\");\n txtCodProduto.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtCodProdutoActionPerformed(evt);\n }\n });\n\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"IMAGEM\");\n jLabel1.setToolTipText(\"\");\n jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n\n jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"---\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\" }));\n\n JbtnSair1.setText(\"Comprar\");\n JbtnSair1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JbtnSair1ActionPerformed(evt);\n }\n });\n\n nome1.setText(\"Valor:\");\n\n txtNome1.setEditable(false);\n txtNome1.setBackground(new java.awt.Color(255, 255, 255));\n txtNome1.setToolTipText(\"\");\n txtNome1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtNome1ActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"Nome Cliente:\");\n\n nome2.setText(\"Quantidade: \");\n\n txtNome2.setEditable(false);\n txtNome2.setBackground(new java.awt.Color(255, 255, 255));\n txtNome2.setToolTipText(\"\");\n txtNome2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtNome2ActionPerformed(evt);\n }\n });\n\n jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Detalhes da venda\"));\n\n tblDetalhesVenda.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"Produtos\", \"Quantidade\", \"Valor Item\"\n }\n ));\n jScrollPane2.setViewportView(tblDetalhesVenda);\n\n JbtnSair2.setText(\"Carrinho\");\n JbtnSair2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JbtnSair2ActionPerformed(evt);\n }\n });\n\n jLabel4.setFont(new java.awt.Font(\"Arial Black\", 1, 14)); // NOI18N\n jLabel4.setText(\"CARRINHO DE COMPRAS\");\n\n nome3.setText(\"Valor Total:\");\n\n txtNome3.setEditable(false);\n txtNome3.setBackground(new java.awt.Color(255, 255, 255));\n txtNome3.setToolTipText(\"\");\n txtNome3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtNome3ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(353, 353, 353)\n .addComponent(nome3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtNome3, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGap(41, 41, 41)\n .addComponent(jblLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(Cidade, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtCiddade, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGap(2, 2, 2)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(nome)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(codClient)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtCodProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(endereço)\n .addComponent(nome1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(nome2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(20, 20, 20)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtNome1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtNome2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 127, Short.MAX_VALUE))\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addComponent(JbtnSair2)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(JbtnSair)\n .addGap(18, 18, 18)\n .addComponent(JbtnSair1)\n .addGap(30, 30, 30)))\n .addGap(388, 388, 388))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(9, 9, 9)\n .addComponent(jblLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(29, 29, 29)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Cidade, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtCiddade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(13, 13, 13)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(10, 10, 10)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(codClient, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtCodProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(endereço)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nome2)\n .addComponent(txtNome2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(7, 7, 7)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nome1)\n .addComponent(txtNome1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(JbtnSair2, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(53, 53, 53)))\n .addComponent(jLabel4)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(15, 15, 15)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtNome3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(nome3))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(JbtnSair, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(JbtnSair1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(41, 41, 41))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 571, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void iniciarVentana()\n {\n this.setVisible(true);\n //Centramos la ventana\n this.setLocationRelativeTo(null);\n //Colocamos icono a la ventana\n this.setIconImage(Principal.getLogo());\n //Agregamos Hint al campo de texto\n txt_Nombre.setUI(new Hint(\"Nombre del Archivo\"));\n //ocultamos los componentes de la barra de progreso general\n lblGeneral.setVisible(false);\n barraGeneral.setVisible(false);\n //ocultamos la barra de progreso de archivo\n barra.setVisible(false);\n //deshabiltamos el boton de ElimianrArchivo\n btnEliminarArchivo.setEnabled(false);\n //deshabilitamos el boton de enviar\n btnaceptar.setEnabled(false);\n //Creamos el modelo para la tabla\n modelo=new DefaultTableModel(new Object[][]{},new Object[]{\"nombre\",\"tipo\",\"peso\"})\n {\n //sobreescribimos metodo para prohibir la edicion de celdas\n @Override\n public boolean isCellEditable(int i, int i1) {\n return false;\n }\n \n };\n //Agregamos el modelo a la tabla\n tablaArchivos.setModel(modelo);\n //Quitamos el reordenamiento en la cabecera de la tabla\n tablaArchivos.getTableHeader().setReorderingAllowed(false);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n apagarVenda = new javax.swing.JButton();\n jLabel14 = new javax.swing.JLabel();\n jLabel36 = new javax.swing.JLabel();\n lucro = new javax.swing.JTextField();\n jLabel34 = new javax.swing.JLabel();\n codigoCliente = new javax.swing.JTextField();\n custoNaMadri = new javax.swing.JTextField();\n jLabel35 = new javax.swing.JLabel();\n jLabel28 = new javax.swing.JLabel();\n valorLiquidoML = new javax.swing.JTextField();\n jLabel29 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n dataVenda = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n precoVendido = new javax.swing.JTextField();\n jLabel15 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n jLabel18 = new javax.swing.JLabel();\n jLabel16 = new javax.swing.JLabel();\n jLabel19 = new javax.swing.JLabel();\n codigoPeca = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n jLabel21 = new javax.swing.JLabel();\n jLabel20 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n cadastroObservacoes = new javax.swing.JTextArea();\n jLabel6 = new javax.swing.JLabel();\n tarifaDoML = new javax.swing.JTextField();\n jLabel22 = new javax.swing.JLabel();\n porcentagemDoMercadoLivre = new javax.swing.JTextField();\n quantidadeVendida = new javax.swing.JTextField();\n botAtualizar = new javax.swing.JButton();\n botaoEntrarIniciall1 = new javax.swing.JButton();\n nomePeca = new javax.swing.JTextField();\n valorFrete = new javax.swing.JTextField();\n jLabel30 = new javax.swing.JLabel();\n jLabel23 = new javax.swing.JLabel();\n jLabel25 = new javax.swing.JLabel();\n jLabel31 = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n jLabel24 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n jLabel27 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jLabel37 = new javax.swing.JLabel();\n jLabel26 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n mostrarNivel = new javax.swing.JLabel();\n acessoUser = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"EDITAR VENDA\");\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowActivated(java.awt.event.WindowEvent evt) {\n formWindowActivated(evt);\n }\n });\n getContentPane().setLayout(null);\n\n apagarVenda.setBackground(new java.awt.Color(0, 0, 0));\n apagarVenda.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n apagarVenda.setForeground(new java.awt.Color(255, 255, 255));\n apagarVenda.setText(\"APAGAR\");\n apagarVenda.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n apagarVendaActionPerformed(evt);\n }\n });\n apagarVenda.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n apagarVendaKeyPressed(evt);\n }\n });\n getContentPane().add(apagarVenda);\n apagarVenda.setBounds(300, 640, 160, 40);\n\n jLabel14.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/APAGAR.png\"))); // NOI18N\n getContentPane().add(jLabel14);\n jLabel14.setBounds(440, 610, 80, 70);\n\n jLabel36.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel36.setForeground(new java.awt.Color(255, 255, 255));\n jLabel36.setText(\"LUCRO\");\n getContentPane().add(jLabel36);\n jLabel36.setBounds(280, 350, 70, 17);\n\n lucro.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n lucro.setText(\"0,00\");\n lucro.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n lucroFocusGained(evt);\n }\n });\n lucro.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n lucroActionPerformed(evt);\n }\n });\n lucro.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n lucroKeyPressed(evt);\n }\n });\n getContentPane().add(lucro);\n lucro.setBounds(280, 380, 140, 30);\n\n jLabel34.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel34.setForeground(new java.awt.Color(255, 255, 255));\n jLabel34.setText(\"CÓDIGO DA VENDA\");\n getContentPane().add(jLabel34);\n jLabel34.setBounds(480, 350, 180, 17);\n\n codigoCliente.setEditable(false);\n codigoCliente.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n codigoCliente.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n codigoClienteFocusGained(evt);\n }\n });\n codigoCliente.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n codigoClienteActionPerformed(evt);\n }\n });\n codigoCliente.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n codigoClienteKeyPressed(evt);\n }\n });\n getContentPane().add(codigoCliente);\n codigoCliente.setBounds(480, 380, 140, 30);\n\n custoNaMadri.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n custoNaMadri.setText(\"0,00\");\n custoNaMadri.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n custoNaMadriFocusGained(evt);\n }\n });\n custoNaMadri.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n custoNaMadriActionPerformed(evt);\n }\n });\n custoNaMadri.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n custoNaMadriKeyPressed(evt);\n }\n });\n getContentPane().add(custoNaMadri);\n custoNaMadri.setBounds(30, 380, 190, 30);\n\n jLabel35.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel35.setForeground(new java.awt.Color(255, 255, 255));\n jLabel35.setText(\"PREÇO DE CUSTO NA MADRI\");\n getContentPane().add(jLabel35);\n jLabel35.setBounds(30, 350, 210, 17);\n\n jLabel28.setFont(new java.awt.Font(\"Tahoma\", 1, 21)); // NOI18N\n jLabel28.setForeground(new java.awt.Color(255, 255, 255));\n jLabel28.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel28.setText(\"EDITAR VENDA\");\n getContentPane().add(jLabel28);\n jLabel28.setBounds(260, 10, 320, 60);\n\n valorLiquidoML.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n valorLiquidoML.setText(\"0,00\");\n valorLiquidoML.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n valorLiquidoMLFocusGained(evt);\n }\n });\n valorLiquidoML.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n valorLiquidoMLActionPerformed(evt);\n }\n });\n valorLiquidoML.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n valorLiquidoMLKeyPressed(evt);\n }\n });\n getContentPane().add(valorLiquidoML);\n valorLiquidoML.setBounds(480, 300, 140, 30);\n\n jLabel29.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel29.setForeground(new java.awt.Color(255, 255, 255));\n jLabel29.setText(\"VALOR LÍQUIDO DO MERCADO LIVRE\");\n getContentPane().add(jLabel29);\n jLabel29.setBounds(480, 270, 270, 17);\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(255, 255, 255));\n jLabel2.setText(\"PORCENTAGEM DO MERCADO LIVRE\");\n getContentPane().add(jLabel2);\n jLabel2.setBounds(480, 190, 270, 17);\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(255, 255, 255));\n jLabel3.setText(\"DATA\");\n getContentPane().add(jLabel3);\n jLabel3.setBounds(280, 110, 100, 17);\n\n dataVenda.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n dataVenda.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n dataVendaFocusGained(evt);\n }\n });\n dataVenda.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n dataVendaKeyPressed(evt);\n }\n });\n getContentPane().add(dataVenda);\n dataVenda.setBounds(280, 140, 140, 30);\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(255, 255, 255));\n jLabel4.setText(\"QUANTIDADE VENDIDA\");\n getContentPane().add(jLabel4);\n jLabel4.setBounds(480, 110, 190, 17);\n\n precoVendido.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n precoVendido.setText(\"0,00\");\n precoVendido.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n precoVendidoFocusGained(evt);\n }\n });\n precoVendido.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n precoVendidoKeyPressed(evt);\n }\n });\n getContentPane().add(precoVendido);\n precoVendido.setBounds(280, 220, 140, 30);\n\n jLabel15.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel15.setForeground(new java.awt.Color(255, 0, 0));\n jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel15.setText(\"*\");\n getContentPane().add(jLabel15);\n jLabel15.setBounds(230, 330, 40, 60);\n\n jLabel17.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel17.setForeground(new java.awt.Color(255, 0, 0));\n jLabel17.setText(\"*\");\n getContentPane().add(jLabel17);\n jLabel17.setBounds(330, 100, 30, 40);\n\n jLabel18.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel18.setForeground(new java.awt.Color(255, 0, 0));\n jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel18.setText(\"*\");\n getContentPane().add(jLabel18);\n jLabel18.setBounds(660, 110, 20, 22);\n\n jLabel16.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel16.setForeground(new java.awt.Color(255, 0, 0));\n jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel16.setText(\"*\");\n getContentPane().add(jLabel16);\n jLabel16.setBounds(90, 100, 30, 40);\n\n jLabel19.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel19.setForeground(new java.awt.Color(255, 255, 255));\n jLabel19.setText(\"CÓDIGO\");\n getContentPane().add(jLabel19);\n jLabel19.setBounds(30, 110, 70, 17);\n\n codigoPeca.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n codigoPeca.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n codigoPecaFocusLost(evt);\n }\n });\n codigoPeca.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n codigoPecaKeyPressed(evt);\n }\n });\n getContentPane().add(codigoPeca);\n codigoPeca.setBounds(30, 140, 130, 30);\n\n jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/MER-LIVRE.png\"))); // NOI18N\n getContentPane().add(jLabel5);\n jLabel5.setBounds(715, 5, 70, 75);\n\n jLabel21.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel21.setForeground(new java.awt.Color(255, 255, 255));\n jLabel21.setText(\"OBSERVAÇÕES\");\n getContentPane().add(jLabel21);\n jLabel21.setBounds(30, 430, 200, 17);\n\n jLabel20.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel20.setForeground(new java.awt.Color(255, 255, 255));\n jLabel20.setText(\"TARIFA DO MERCADO LIVRE\");\n getContentPane().add(jLabel20);\n jLabel20.setBounds(30, 270, 210, 17);\n\n cadastroObservacoes.setColumns(20);\n cadastroObservacoes.setFont(new java.awt.Font(\"Tahoma\", 0, 16)); // NOI18N\n cadastroObservacoes.setRows(5);\n cadastroObservacoes.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n cadastroObservacoesKeyPressed(evt);\n }\n });\n jScrollPane1.setViewportView(cadastroObservacoes);\n\n getContentPane().add(jScrollPane1);\n jScrollPane1.setBounds(30, 460, 730, 140);\n\n jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/Sem título.png\"))); // NOI18N\n jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n getContentPane().add(jLabel6);\n jLabel6.setBounds(-4, 0, 150, 80);\n\n tarifaDoML.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n tarifaDoML.setText(\"0,00\");\n tarifaDoML.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n tarifaDoMLFocusGained(evt);\n }\n });\n tarifaDoML.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n tarifaDoMLKeyPressed(evt);\n }\n });\n getContentPane().add(tarifaDoML);\n tarifaDoML.setBounds(30, 300, 140, 30);\n\n jLabel22.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel22.setForeground(new java.awt.Color(255, 255, 255));\n jLabel22.setText(\"PREÇO DE VENDA\");\n getContentPane().add(jLabel22);\n jLabel22.setBounds(280, 190, 150, 17);\n\n porcentagemDoMercadoLivre.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n porcentagemDoMercadoLivre.setText(\"11,00\");\n porcentagemDoMercadoLivre.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n porcentagemDoMercadoLivreFocusGained(evt);\n }\n });\n porcentagemDoMercadoLivre.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n porcentagemDoMercadoLivreActionPerformed(evt);\n }\n });\n porcentagemDoMercadoLivre.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n porcentagemDoMercadoLivreKeyPressed(evt);\n }\n });\n getContentPane().add(porcentagemDoMercadoLivre);\n porcentagemDoMercadoLivre.setBounds(480, 220, 140, 30);\n\n quantidadeVendida.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n quantidadeVendida.setText(\"1\");\n quantidadeVendida.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n quantidadeVendidaFocusGained(evt);\n }\n });\n quantidadeVendida.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n quantidadeVendidaKeyPressed(evt);\n }\n });\n getContentPane().add(quantidadeVendida);\n quantidadeVendida.setBounds(480, 140, 140, 30);\n\n botAtualizar.setBackground(new java.awt.Color(0, 0, 0));\n botAtualizar.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n botAtualizar.setForeground(new java.awt.Color(255, 255, 255));\n botAtualizar.setText(\"ATUALIZAR\");\n botAtualizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botAtualizarActionPerformed(evt);\n }\n });\n botAtualizar.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n botAtualizarKeyPressed(evt);\n }\n });\n getContentPane().add(botAtualizar);\n botAtualizar.setBounds(30, 640, 160, 40);\n\n botaoEntrarIniciall1.setBackground(new java.awt.Color(0, 0, 0));\n botaoEntrarIniciall1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n botaoEntrarIniciall1.setForeground(new java.awt.Color(255, 255, 255));\n botaoEntrarIniciall1.setText(\"PESQUISAR\");\n botaoEntrarIniciall1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoEntrarIniciall1ActionPerformed(evt);\n }\n });\n botaoEntrarIniciall1.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n botaoEntrarIniciall1KeyPressed(evt);\n }\n });\n getContentPane().add(botaoEntrarIniciall1);\n botaoEntrarIniciall1.setBounds(560, 640, 160, 40);\n\n nomePeca.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n nomePeca.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n nomePecaFocusGained(evt);\n }\n });\n nomePeca.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n nomePecaKeyPressed(evt);\n }\n });\n getContentPane().add(nomePeca);\n nomePeca.setBounds(30, 220, 210, 30);\n\n valorFrete.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n valorFrete.setText(\"0,00\");\n valorFrete.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n valorFreteFocusGained(evt);\n }\n });\n valorFrete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n valorFreteActionPerformed(evt);\n }\n });\n valorFrete.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n valorFreteKeyPressed(evt);\n }\n });\n getContentPane().add(valorFrete);\n valorFrete.setBounds(280, 300, 140, 30);\n\n jLabel30.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel30.setForeground(new java.awt.Color(255, 255, 255));\n jLabel30.setText(\"VALOR DO FRETE\");\n getContentPane().add(jLabel30);\n jLabel30.setBounds(280, 270, 140, 17);\n\n jLabel23.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel23.setForeground(new java.awt.Color(255, 255, 255));\n jLabel23.setText(\"NOME\");\n getContentPane().add(jLabel23);\n jLabel23.setBounds(30, 190, 150, 17);\n\n jLabel25.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel25.setForeground(new java.awt.Color(255, 0, 0));\n jLabel25.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel25.setText(\"*\");\n getContentPane().add(jLabel25);\n jLabel25.setBounds(400, 170, 40, 60);\n\n jLabel31.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel31.setForeground(new java.awt.Color(255, 0, 0));\n jLabel31.setText(\"*\");\n getContentPane().add(jLabel31);\n jLabel31.setBounds(750, 160, 30, 80);\n\n jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/fundo preto.png\"))); // NOI18N\n jLabel12.setMinimumSize(new java.awt.Dimension(1057, 340));\n jLabel12.setPreferredSize(new java.awt.Dimension(1057, 350));\n getContentPane().add(jLabel12);\n jLabel12.setBounds(-80, 4, 760, 77);\n\n jLabel24.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel24.setForeground(new java.awt.Color(255, 0, 0));\n jLabel24.setText(\"*\");\n getContentPane().add(jLabel24);\n jLabel24.setBounds(90, 170, 30, 60);\n\n jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/PROCURA HEHE.png\"))); // NOI18N\n getContentPane().add(jLabel13);\n jLabel13.setBounds(700, 610, 80, 70);\n\n jLabel27.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel27.setForeground(new java.awt.Color(255, 0, 0));\n jLabel27.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel27.setText(\"*\");\n getContentPane().add(jLabel27);\n jLabel27.setBounds(230, 250, 40, 60);\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/fundo preto.png\"))); // NOI18N\n jLabel1.setMinimumSize(new java.awt.Dimension(1057, 340));\n jLabel1.setPreferredSize(new java.awt.Dimension(1057, 350));\n getContentPane().add(jLabel1);\n jLabel1.setBounds(140, 4, 760, 77);\n\n jLabel37.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel37.setForeground(new java.awt.Color(255, 0, 0));\n jLabel37.setText(\"*\");\n getContentPane().add(jLabel37);\n jLabel37.setBounds(420, 250, 30, 60);\n\n jLabel26.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/atua.png\"))); // NOI18N\n getContentPane().add(jLabel26);\n jLabel26.setBounds(170, 610, 80, 70);\n\n jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/FUNDO AMARELO.jpg\"))); // NOI18N\n getContentPane().add(jLabel11);\n jLabel11.setBounds(0, -331, 810, 430);\n\n jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/RS.png\"))); // NOI18N\n getContentPane().add(jLabel7);\n jLabel7.setBounds(310, 10, 610, 530);\n\n jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/RS.png\"))); // NOI18N\n getContentPane().add(jLabel8);\n jLabel8.setBounds(320, 340, 570, 530);\n\n jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/RS.png\"))); // NOI18N\n getContentPane().add(jLabel9);\n jLabel9.setBounds(-20, 450, 570, 530);\n\n jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/RS.png\"))); // NOI18N\n getContentPane().add(jLabel10);\n jLabel10.setBounds(0, 0, 570, 530);\n\n mostrarNivel.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n mostrarNivel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n mostrarNivel.setText(\"5\");\n getContentPane().add(mostrarNivel);\n mostrarNivel.setBounds(520, 130, 50, 70);\n\n acessoUser.setFont(new java.awt.Font(\"Tahoma\", 1, 10)); // NOI18N\n acessoUser.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n acessoUser.setText(\"ADMIN\");\n getContentPane().add(acessoUser);\n acessoUser.setBounds(520, 220, 70, 60);\n\n setBounds(427, 5, 790, 716);\n }", "public GestaoFormando() {\n \n initComponents();\n listarEquipamentos();\n listarmapainscritos();\n }", "public Venda() {\n }", "@RequestMapping(value = \"/create\", method = RequestMethod.POST)\n public ModelAndView create(@RequestParam(\"horasalida\") Date horasalida,@RequestParam(\"horallegada\") Date horallegada,@RequestParam(\"aeropuerto_idaeropuerto\") Long aeropuerto_idaeropuerto,\n \t\t@RequestParam(\"aeropuerto_idaeropuerto2\") Long aeropuerto_idaeropuerto2,@RequestParam(\"avion_idavion\") Long avion_idavion) {\n Vuelo post=new Vuelo();\n post.setHorallegada(horallegada);\n post.setHorasalida(horasalida);\n\t\t\n post.setAeropuerto_idaeropuerto(aeropuerto_idaeropuerto);\n post.setAeropuerto_idaeropuerto2(aeropuerto_idaeropuerto2);\n post.setAvion_idavion(avion_idavion);\n repository.save(post);\n return new ModelAndView(\"redirect:/vuelos\");\n }", "public void editarProveedor() {\n try {\n proveedorFacadeLocal.edit(proTemporal);\n this.proveedor = new Proveedor();\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Proveedor editado\", \"Proveedor editado\"));\n } catch (Exception e) {\n \n }\n\n }", "public TelaRegistroVendas() {\n initComponents();\n }", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "public VistaCrearPedidoAbonado() {\n initComponents();\n errorLabel.setVisible(false);\n controlador = new CtrlVistaCrearPedidoAbonado(this);\n }", "public String editar()\r\n/* 59: */ {\r\n/* 60: 74 */ if ((getMotivoLlamadoAtencion() != null) && (getMotivoLlamadoAtencion().getIdMotivoLlamadoAtencion() != 0)) {\r\n/* 61: 75 */ setEditado(true);\r\n/* 62: */ } else {\r\n/* 63: 77 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 64: */ }\r\n/* 65: 79 */ return \"\";\r\n/* 66: */ }", "public void createAgendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.createTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento cadastrado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado cadastro do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n }", "private static void CrearVenda (BaseDades bd, int idproducte, int quantitat) {\n Producte prod = bd.consultarUnProducte(idproducte);\n java.sql.Date dataActual = getCurrentDate();//Data SQL\n if (prod != null) {\n if (bd.actualitzarStock(prod, quantitat, dataActual)>0) {//Hi ha estoc\n String taula = \"VENDES\";\n int idvenda = bd.obtenirUltimID(taula);\n Venda ven = new Venda(idvenda, prod.getIdproducte(), dataActual, quantitat);\n \n if (bd.inserirVenda(ven)>0)\n System.out.println(\"VENDA INSERIDA...\");\n } else\n System.out.println(\"NO ES POT FER LA VENDA, NO HI HA ESTOC...\");\n \n } else {\n System.out.println(\"NO HI HA EL PRODUCTE\");\n }\n }", "public Editar_Entrada() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setResizable(false);\n this.setTitle(\"CPU System Service S.A.S - FACTURAS DE ENTRADA\");\n //CargarCmbCliente();\n txtSec.setEnabled(false);\n txtIdCli.setEnabled(false);\n traerDatos();\n txtEstado.setEnabled(false);\n txtGarantia.setEnabled(false);\n }", "private void insertar() {\n try {\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.insertar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Ingresado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para guardar registro!\");\n }\n }", "public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}", "public void SalvarNovaPessoa(){\r\n \r\n\t\tpessoaModel.setUsuarioModel(this.usuarioController.GetUsuarioSession());\r\n \r\n\t\t//INFORMANDO QUE O CADASTRO FOI VIA INPUT\r\n\t\tpessoaModel.setOrigemCadastro(\"I\");\r\n \r\n\t\tpessoaRepository.SalvarNovoRegistro(this.pessoaModel);\r\n \r\n\t\tthis.pessoaModel = null;\r\n \r\n\t\tUteis.MensagemInfo(\"Registro cadastrado com sucesso\");\r\n \r\n\t}", "public frmOrdenacao() {\n initComponents();\n setResizable(false);\n ordenacaoControle = new OrdenacaoControle();\n }", "public Agenda() {\n initComponents();\n \n Deshabilitar();\n LlenarTabla();\n \n }", "public void modificar() {\n try {\n if(!fecha.equals(null)){\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n \n calendar.setTime((Date) this.fecha);\n this.Selected.setApel_fecha_sesion(calendar.getTime());\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.IME_APELACIONES(2, Selected); \n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.Selected.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"1\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue modificada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n this.Selected = new ApelacionesBean();\n addMessage(\"Guadado Exitosamente\", 1);\n }else\n {\n addMessage(\"Es requerida la fecha\",1 );\n }\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al insertar el registro, contacte al administrador del sistema\", 1);\n }\n }", "public frmVerzamelingBeheer() {\n try {\n initComponents();\n \n lblId.setVisible(false);\n\n pnlEdit.setVisible(false);\n\n for (VerzamelingsType type : TypeService.GetAllTypes()) {\n cmbType.addItem(new VerzamelingsType(type.getId(), type.getNaam()));\n cmbEditType.addItem(new VerzamelingsType(type.getId(), type.getNaam()));\n }\n\n \n for (Categorie categorie : CategorieService.GetAllCategories()) {\n cmbCategorie.addItem(new Categorie(categorie.getId(), categorie.getNaam()));\n cmbEditCategorie.addItem(new Categorie(categorie.getId(), categorie.getNaam()));\n }\n \n //vertaling voor JOptionpane\n UIManager.put(\"OptionPane.cancelButtonText\", \"Annuleren\");\n UIManager.put(\"OptionPane.noButtonText\", \"Nee\");\n UIManager.put(\"OptionPane.okButtonText\", \"Oke\");\n UIManager.put(\"OptionPane.yesButtonText\", \"Ja\");\n \n this.setTitle(\"Verzamelingen beheren - Verzamelingenbeheer\");\n \n ShowEditItems(false);\n RefreshList();\n }\n catch (ExceptionInInitializerError ex)\n {\n JOptionPane.showMessageDialog(null, \"Er kan geen verbinding worden gemaakt met de database (\" + ex.getMessage() + \").\", \"Fout\", ERROR_MESSAGE);\n System.exit(1);\n }\n\n }", "public CrearQuedadaVista() {\n }", "public FrmInsertar() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel2 = new javax.swing.JLabel();\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n txtPesquisa = new javax.swing.JTextField();\n btnBusca = new javax.swing.JButton();\n txtQunatidade = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n txtValorItem = new javax.swing.JTextField();\n txtValorTotal = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tabelaPesquisa = new javax.swing.JTable();\n jLabel7 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n tabelaItemVenda = new javax.swing.JTable();\n btnFinalizar = new javax.swing.JButton();\n btnAdicionar = new javax.swing.JButton();\n txtCodProduto = new javax.swing.JTextField();\n jLabel8 = new javax.swing.JLabel();\n btnAbirVenda = new javax.swing.JButton();\n txtCodFuncionario = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n txtCodVenda = new javax.swing.JTextField();\n jLabel9 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Formulario de Venda\");\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 0, 30)); // NOI18N\n jLabel2.setText(\"VENDAS\");\n\n jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n jLabel1.setText(\"Produto:\");\n\n txtPesquisa.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtPesquisaActionPerformed(evt);\n }\n });\n\n btnBusca.setText(\"Busca\");\n btnBusca.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnBuscaActionPerformed(evt);\n }\n });\n\n txtQunatidade.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n txtQunatidadeFocusGained(evt);\n }\n });\n txtQunatidade.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtQunatidadeKeyReleased(evt);\n }\n });\n\n jLabel3.setText(\"Qtd:\");\n\n jLabel4.setText(\"Valor por item:\");\n\n txtValorItem.setEnabled(false);\n\n txtValorTotal.setEnabled(false);\n\n jLabel5.setText(\"Valor total:\");\n\n tabelaPesquisa.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n tabelaPesquisa.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tabelaPesquisaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tabelaPesquisa);\n\n jLabel7.setText(\"Itens da venda:\");\n\n tabelaItemVenda.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n jScrollPane2.setViewportView(tabelaItemVenda);\n\n btnFinalizar.setText(\"FINALIZAR VENDA\");\n btnFinalizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnFinalizarActionPerformed(evt);\n }\n });\n\n btnAdicionar.setText(\"ADD\");\n btnAdicionar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAdicionarActionPerformed(evt);\n }\n });\n\n jLabel8.setText(\"Cod Produto:\");\n\n btnAbirVenda.setText(\"Abrir Venda\");\n btnAbirVenda.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAbirVendaActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(39, 39, 39)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 660, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(txtPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btnAbirVenda)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8)\n .addComponent(txtCodProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnBusca))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGap(312, 312, 312)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(txtQunatidade, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(41, 41, 41)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(txtValorItem, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnAdicionar)))))\n .addComponent(jLabel1)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btnFinalizar)\n .addGap(112, 112, 112)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(53, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(26, 26, 26)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel8))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtQunatidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtValorItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnAdicionar)\n .addComponent(txtCodProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(btnAbirVenda, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnBusca))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel7)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(79, 79, 79))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(btnFinalizar, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(21, 21, 21))))\n );\n\n txtCodFuncionario.setEnabled(false);\n\n jLabel6.setText(\"Cod Func\");\n\n txtCodVenda.setEnabled(false);\n\n jLabel9.setText(\"Cod Venda\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(38, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addGap(144, 144, 144)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtCodVenda, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel9))\n .addGap(39, 39, 39)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(txtCodFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(34, 34, 34))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addComponent(jLabel9)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtCodVenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel6)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtCodFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addGap(20, 20, 20)))\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(76, 76, 76))\n );\n\n setSize(new java.awt.Dimension(846, 714));\n setLocationRelativeTo(null);\n }", "public FormInserir() {\n initComponents();\n }", "public telaCadastro() {\n initComponents();\n populaTabela();\n }", "public Ventaform() {\n initComponents();\n }", "@GetMapping(\"/cliente/new\")\n\tpublic String newCliente(Model model) {\n\t\tmodel.addAttribute(\"cliente\", new Cliente());\n\t\tControllerHelper.setEditMode(model, false);\n\t\t\n\t\t\n\t\treturn \"cadastro-cliente\";\n\t\t\n\t}", "@Override\r\n\tpublic void actualizar(int id_evento_vista, Object datos) {\r\n\t\t//Borra lo anterior\r\n \t\r\n \t jFormattedTextFieldPiso.setText(\"\");\r\n jFormattedTextFieldNumero.setText(\"\");\r\n jFormattedTextFieldTipo.setText(\"\");\r\n \r\n\t\t\r\n\t\tif(id_evento_vista == EventoVista.ALTA_HABITACION_EXITO){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Se ha creado la Habitacion con exito\", \"Nuevo Habitacion\", JOptionPane.INFORMATION_MESSAGE);\t\t\r\n\t\t}\t\r\n\t\r\n\t\telse if (id_evento_vista == EventoVista.ALTA_HABITACION_FALLO){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"ERROR!! Ha ocurrido un error con la BD\", \"Nuevo Habitacion\", JOptionPane.ERROR_MESSAGE);\r\n\t\t}\r\n\t\t\r\n\t}", "public CrearPedidos() {\n initComponents();\n }", "public FrmDepartamentos() {\n initComponents();\n setLocationRelativeTo(this);\n this.jTexCodigo.requestFocus();\n }", "public SalidaCajaForm() {\n\t\tinicializarComponentes();\n }", "public void SalvarNovaArtista() {\n\n\t\tartistaModel.setUsuarioModel(this.usuarioController.GetUsuarioSession());\n\n\t\tartistaRepository.SalvarNovoRegistro(this.artistaModel);\n\n\t\tUteis.MensagemInfo(\"Registro cadastrado com sucesso\");\n\n\t\tartistaModel = null;\n\t}", "public CadastroProdutoNew() {\n initComponents();\n }", "public void editHandler(View v) {\n LinearLayout vwParentRow = (LinearLayout)v.getParent();\n TextView id =(TextView) vwParentRow.findViewById(R.id._id);\n Intent intent = new Intent(Hates.this, Formulario.class);\n\n intent.putExtra(C_MODO, C_EDITAR);\n intent.putExtra(C_TIPO, love_hate);\n intent.putExtra(mDbHelper.ID, Long.valueOf((String)id.getText()));\n\n\n this.startActivityForResult(intent, C_EDITAR);\n }", "@Override\r\n\tprotected void agregarObjeto() {\r\n\t\t// opcion 1 es agregar nuevo justificativo\r\n\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (AGREGANDO)\");\r\n\t\tthis.opcion = 1;\r\n\t\tactivarFormulario();\r\n\t\tlimpiarTabla();\r\n\t\tthis.panelBotones.habilitar();\r\n\t}", "public frm_tutor_subida_prueba() {\n }", "public ControleVendas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) tabelaVendas.getModel();\n tabelaVendas.setRowSorter(new TableRowSorter(modelo));\n atualizarTabela();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTblDptos = new javax.swing.JTable();\n jSeparator1 = new javax.swing.JSeparator();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jBtnAgregar = new javax.swing.JButton();\n jBtnVer = new javax.swing.JButton();\n jBtnEliminar = new javax.swing.JButton();\n jBtnAdicionar = new javax.swing.JButton();\n jTexCodigo = new javax.swing.JTextField();\n jTexNombre = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"CRUD Departamentos\");\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosed(java.awt.event.WindowEvent evt) {\n formWindowClosed(evt);\n }\n });\n\n jTblDptos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTblDptos);\n\n jLabel1.setText(\"Código:\");\n\n jLabel2.setText(\"Nombre:\");\n\n jBtnAgregar.setText(\"Agregar Dpto\");\n\n jBtnVer.setText(\"Ver Dpto\");\n jBtnVer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBtnVerActionPerformed(evt);\n }\n });\n\n jBtnEliminar.setText(\"Eliminar Dpto\");\n jBtnEliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBtnEliminarActionPerformed(evt);\n }\n });\n\n jBtnAdicionar.setText(\"Adicionar Dpto\");\n jBtnAdicionar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBtnAdicionarActionPerformed(evt);\n }\n });\n\n jTexCodigo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTexCodigoActionPerformed(evt);\n }\n });\n jTexCodigo.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n jTexCodigoKeyTyped(evt);\n }\n });\n\n jTexNombre.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n jTexNombreKeyTyped(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jSeparator1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTexNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTexCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 366, Short.MAX_VALUE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(71, 71, 71)\n .addComponent(jBtnVer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jBtnAdicionar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jBtnAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jBtnEliminar)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n\n layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBtnAdicionar, jBtnAgregar, jBtnEliminar, jBtnVer});\n\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jTexCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jTexNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jBtnVer)\n .addComponent(jBtnAdicionar)\n .addComponent(jBtnAgregar)\n .addComponent(jBtnEliminar))\n .addContainerGap(16, Short.MAX_VALUE))\n );\n\n pack();\n }", "@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\r\n private void initComponents() {\r\n\r\n jLabel1 = new javax.swing.JLabel();\r\n txtId = new javax.swing.JTextField();\r\n jLabel2 = new javax.swing.JLabel();\r\n cbTipo = new javax.swing.JComboBox<>();\r\n jLabel3 = new javax.swing.JLabel();\r\n txtDataEmissao = new javax.swing.JFormattedTextField();\r\n jLabel4 = new javax.swing.JLabel();\r\n txtDiasEntrega = new javax.swing.JFormattedTextField();\r\n jLabel5 = new javax.swing.JLabel();\r\n txtPedido = new javax.swing.JTextField();\r\n jLabel6 = new javax.swing.JLabel();\r\n cbClientes = new javax.swing.JComboBox<>();\r\n jLabel7 = new javax.swing.JLabel();\r\n txtUsuario = new javax.swing.JTextField();\r\n btnBuscaPedido = new javax.swing.JButton();\r\n btnCadastrar = new javax.swing.JButton();\r\n btnExcluir = new javax.swing.JButton();\r\n btnAlterar = new javax.swing.JButton();\r\n btnConfirmar = new javax.swing.JButton();\r\n btnCancelar = new javax.swing.JButton();\r\n jLabel8 = new javax.swing.JLabel();\r\n cbOrcamento = new javax.swing.JComboBox<>();\r\n btnVoltar1 = new javax.swing.JButton();\r\n jLabel9 = new javax.swing.JLabel();\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r\n setTitle(\"Cadastra pedidos\");\r\n setResizable(false);\r\n\r\n jLabel1.setText(\"Id\");\r\n\r\n txtId.setEnabled(false);\r\n\r\n jLabel2.setText(\"Tipo\");\r\n\r\n cbTipo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Proprio\", \"Terceiro\" }));\r\n cbTipo.setEnabled(false);\r\n\r\n jLabel3.setText(\"Data de emissão\");\r\n\r\n txtDataEmissao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter()));\r\n txtDataEmissao.setText(\"dd/MM/yyyy\");\r\n txtDataEmissao.setEnabled(false);\r\n\r\n jLabel4.setText(\"Entrega em\");\r\n\r\n txtDiasEntrega.setEnabled(false);\r\n\r\n jLabel5.setText(\"Nº do pedido\");\r\n\r\n txtPedido.setEnabled(false);\r\n\r\n jLabel6.setText(\"Cliente\");\r\n\r\n cbClientes.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\r\n cbClientes.setEnabled(false);\r\n\r\n jLabel7.setText(\"Usuario\");\r\n\r\n txtUsuario.setEnabled(false);\r\n\r\n btnBuscaPedido.setText(\"Busca de pedidos\");\r\n btnBuscaPedido.setEnabled(false);\r\n btnBuscaPedido.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnBuscaPedidoActionPerformed(evt);\r\n }\r\n });\r\n\r\n btnCadastrar.setText(\"Cadastrar\");\r\n btnCadastrar.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnCadastrarActionPerformed(evt);\r\n }\r\n });\r\n\r\n btnExcluir.setText(\"Excluir\");\r\n btnExcluir.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnExcluirActionPerformed(evt);\r\n }\r\n });\r\n\r\n btnAlterar.setText(\"Alterar\");\r\n btnAlterar.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnAlterarActionPerformed(evt);\r\n }\r\n });\r\n\r\n btnConfirmar.setText(\"Confirmar\");\r\n btnConfirmar.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnConfirmarActionPerformed(evt);\r\n }\r\n });\r\n\r\n btnCancelar.setText(\"Fechar\");\r\n btnCancelar.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnCancelarActionPerformed(evt);\r\n }\r\n });\r\n\r\n jLabel8.setText(\"Orçamento\");\r\n\r\n cbOrcamento.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\r\n cbOrcamento.setEnabled(false);\r\n\r\n btnVoltar1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagens/undo.png\"))); // NOI18N\r\n btnVoltar1.setText(\"Voltar\");\r\n btnVoltar1.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnVoltar1ActionPerformed(evt);\r\n }\r\n });\r\n\r\n jLabel9.setText(\"dias\");\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\r\n getContentPane().setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addContainerGap()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(jLabel1)\r\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGroup(layout.createSequentialGroup()\r\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(48, 48, 48)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(txtPedido)\r\n .addComponent(txtUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)\r\n .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(cbTipo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\r\n .addGap(18, 18, 18)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel4)\r\n .addComponent(jLabel3)\r\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGap(23, 23, 23)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(cbOrcamento, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(cbClientes, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(txtDataEmissao, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)\r\n .addGroup(layout.createSequentialGroup()\r\n .addComponent(txtDiasEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\r\n .addComponent(jLabel9)\r\n .addGap(0, 0, Short.MAX_VALUE))))\r\n .addGroup(layout.createSequentialGroup()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(btnCadastrar, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)\r\n .addComponent(btnExcluir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(btnBuscaPedido, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(btnAlterar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addGap(18, 18, 18)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(btnVoltar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(btnConfirmar, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\r\n .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(1, 1, 1)))\r\n .addContainerGap())\r\n );\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addContainerGap()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jLabel1)\r\n .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel3)\r\n .addComponent(txtDataEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGap(16, 16, 16)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jLabel2)\r\n .addComponent(cbTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel4)\r\n .addComponent(txtDiasEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel9))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jLabel5)\r\n .addComponent(txtPedido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel6)\r\n .addComponent(cbClientes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(jLabel7)\r\n .addComponent(txtUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(jLabel8)\r\n .addComponent(cbOrcamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(btnCadastrar)\r\n .addComponent(btnConfirmar)\r\n .addComponent(btnAlterar))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(btnCancelar)\r\n .addComponent(btnVoltar1)\r\n .addComponent(btnExcluir)\r\n .addComponent(btnBuscaPedido))\r\n .addContainerGap())\r\n );\r\n\r\n pack();\r\n }", "public vistaEjemplo() {\n initComponents();\n con=new Conexion();\n data = new Datas(con);\n usuario = new Usuario();\n jTApellido.setEnabled(false);\n jTMail.setEnabled(false);\n jTNombre.setEnabled(false);\n jTPassword.setEnabled(false);\n JdcFechaDeEntrada.setEnabled(false);\n jBPdf.setEnabled(false);\n }", "public void editar(AplicacionOferta aplicacionOferta){\n try{\n aplicacionOfertaDao.edit(aplicacionOferta);\n }catch(Exception e){\n Logger.getLogger(AplicacionOfertaServicio.class.getName()).log(Level.SEVERE, null, e);\n }\n }", "public void actualizar_registro() {\n try {\n iC.nombre = fecha;\n\n String [] data = txtidReg.getText().toString().split(\":\");\n Long id = Long.parseLong(data[1].trim());\n\n int conteo1 = Integer.parseInt(cap_1.getText().toString());\n int conteo2 = Integer.parseInt(cap_2.getText().toString());\n int conteoT = Integer.parseInt(cap_ct.getText().toString());\n\n conteoTab cl = iC.oneId(id);\n\n conteoTab c = new conteoTab();\n\n c.setFecha(cl.getFecha());\n c.setEstado(cl.getEstado());\n c.setIdConteo(cl.getIdConteo());\n c.setIdSiembra(cl.getIdSiembra());\n c.setCama(cl.getCama());\n c.setIdBloque(cl.getIdBloque());\n c.setBloque(cl.getBloque());\n c.setIdVariedad(cl.getIdVariedad());\n c.setVariedad(cl.getVariedad());\n c.setCuadro(cl.getCuadro());\n c.setConteo1(conteo1);\n c.setConteo4(conteo2);\n c.setTotal(conteoT);\n c.setPlantas(cl.getPlantas());\n c.setArea(cl.getArea());\n c.setCuadros(cl.getCuadros());\n c.setIdUsuario(cl.getIdUsuario());\n if(cl.getEstado().equals(\"0\")) {\n iC.update(id, c);\n }else{\n Toast.makeText(this, \"El registro no se puede actualizar por que ya ha sido enviado\", Toast.LENGTH_LONG).show();\n }\n\n Intent i = new Intent(this,ActivityDetalles.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(i);\n }catch (Exception ex){\n Toast.makeText(this, \"exception al actualizar el registro \\n \\n\"+ex.toString(), Toast.LENGTH_SHORT).show();\n }\n }", "public String crea() {\n c.setId(0);\n clienteDAO.crea(c); \n //Post-Redirect-Get\n return \"visualiza?faces-redirect=true&id=\"+c.getId();\n }", "public ArticulosAdd() {\n initComponents();\n Sistema.lblNotificacion.setText(\"Ingreso Artítuclos\");\n this.setLocationRelativeTo(null);\n\n Date date = new Date();\n\n dtDesde.setDate(date);\n dtHasta.setDate(date);\n\n articulos.searchArticulo(cboArticulos, \"\", 0, 1000, 0);\n }", "public void insertar() {\r\n if (vista.jTNombreempresa.getText().equals(\"\") || vista.jTTelefono.getText().equals(\"\") || vista.jTRFC.getText().equals(\"\") || vista.jTDireccion.getText().equals(\"\")) {\r\n JOptionPane.showMessageDialog(null, \"Faltan Datos: No puedes dejar cuadros en blanco\");//C.P.M Verificamos si las casillas esta vacia si es asi lo notificamos\r\n } else {//C.P.M de lo contrario prosegimos\r\n modelo.setNombre(vista.jTNombreempresa.getText());//C.P.M mandamos las variabes al modelo \r\n modelo.setDireccion(vista.jTDireccion.getText());\r\n modelo.setRfc(vista.jTRFC.getText());\r\n modelo.setTelefono(vista.jTTelefono.getText());\r\n \r\n Error = modelo.insertar();//C.P.M Ejecutamos el metodo del modelo \r\n if (Error.equals(\"\")) {//C.P.M Si el modelo no regresa un error es que todo salio bien\r\n JOptionPane.showMessageDialog(null, \"Se guardo exitosamente la configuracion\");//C.P.M notificamos a el usuario\r\n vista.dispose();//C.P.M y cerramos la vista\r\n } else {//C.P.M de lo contrario \r\n JOptionPane.showMessageDialog(null, Error);//C.P.M notificamos a el usuario el error\r\n }\r\n }\r\n }", "public Editar_Encargado() {\n \n initComponents();\n //Mandamos a llamar el metodo que carga el Grid;\n CargarTabla();\n\n }", "public VistaPedido() {\n initComponents();\n }", "public TelaAgendaConsulta() {\n initComponents();\n }", "public VistaInicial crearventanaInicial(){\n if(vistaInicial==null){\n vistaInicial = new VistaInicial();\n }\n return vistaInicial;\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n btnConsultar = new javax.swing.JButton();\n btnSalir = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n pais = new javax.swing.JTextField();\n provincia = new javax.swing.JTextField();\n region = new javax.swing.JTextField();\n ciudad = new javax.swing.JTextField();\n direccion = new javax.swing.JTextField();\n comida = new javax.swing.JTextField();\n hotel = new javax.swing.JTextField();\n jLabel9 = new javax.swing.JLabel();\n vaciar = new javax.swing.JButton();\n id = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n setResizable(false);\n\n jLabel1.setText(\"Turista\");\n\n btnConsultar.setText(\"consultar\");\n btnConsultar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnConsultarActionPerformed(evt);\n }\n });\n\n btnSalir.setText(\"salir al menú principal\");\n btnSalir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSalirActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"País\");\n\n jLabel3.setText(\"Provincia\");\n\n jLabel4.setText(\"Región\");\n\n jLabel5.setText(\"Ciudad\");\n\n jLabel6.setText(\"Direccion\");\n\n jLabel7.setText(\"Comida\");\n\n jLabel8.setText(\"Hotel\");\n\n pais.setEditable(false);\n\n provincia.setEditable(false);\n\n region.setEditable(false);\n\n ciudad.setEditable(false);\n\n direccion.setEditable(false);\n\n comida.setEditable(false);\n\n hotel.setEditable(false);\n\n jLabel9.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel9.setText(\"CONSULTAR LUGAR TURÍSTICO POR TURISTA\");\n\n vaciar.setText(\"vaciar\");\n vaciar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n vaciarActionPerformed(evt);\n }\n });\n\n id.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n idActionPerformed(evt);\n }\n });\n id.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n idKeyReleased(evt);\n }\n public void keyTyped(java.awt.event.KeyEvent evt) {\n idKeyTyped(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(63, 63, 63)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel9)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel5)\n .addComponent(jLabel6)\n .addComponent(jLabel7)\n .addComponent(jLabel8))\n .addGap(28, 28, 28)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(ciudad, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(region, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(provincia, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(pais, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(hotel, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)\n .addComponent(comida)\n .addComponent(direccion)))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(28, 28, 28))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(vaciar)\n .addGap(26, 26, 26)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(id, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btnConsultar))\n .addGroup(layout.createSequentialGroup()\n .addGap(91, 91, 91)\n .addComponent(btnSalir)))))\n .addContainerGap(66, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel9)\n .addGap(17, 17, 17)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(btnConsultar)\n .addComponent(id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(pais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(24, 24, 24)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(provincia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(region, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(30, 30, 30)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(ciudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(37, 37, 37)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(direccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(40, 40, 40)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(comida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(32, 32, 32)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8)\n .addComponent(hotel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnSalir)\n .addComponent(vaciar))\n .addContainerGap())\n );\n\n pack();\n }", "public IfrViagem() {\n initComponents();\n v = new Viagem();\n criarViagem();\n\n Formatacao.formatarData(ftfDataSaida);\n Formatacao.formatarHora(ftfHoraSaida);\n Formatacao.formatarData(ftfDataRetorno);\n Formatacao.formatarHora(ftfHoraRetorno);\n Formatacao.formatarReal(ftfValorViagem);\n\n }", "@FXML\r\n public void ventas(ActionEvent e) throws IOException {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/Ventas/FormVentas.fxml\"));\r\n Parent root1 = (Parent) fxmlLoader.load();\r\n Stage stage = new Stage();\r\n stage.setScene(new Scene(root1));\r\n stage.setTitle(\"MEVECOM <>\");\r\n stage.setResizable(false);\r\n stage.show();\r\n //Cerrar ventana actual\r\n Stage actual = (Stage) btnSalir.getScene().getWindow();\r\n actual.close();\r\n }", "public void dialogoEditarUsuario() {\n vEditarUsuario = new V_EditarUsuario(new JFrame(), true);\n vEditarUsuario.setVisible(true);\n }", "public FrmNuevoEmpleado() {\n initComponents();\n }", "public AddFeriado(java.awt.Frame parent, boolean modal,String modo,String fecha,String usu) {\r\n initComponents();\r\n setLocationRelativeTo(null);\r\n mode = modo;\r\n usuario = usu; \r\n fec = fecha;\r\n \r\n if(\"INS\".equals(modo)){\r\n titulo.setText(\"Ingresar Feriado\"); \r\n txtFecha.setText(Formato.FechaHoy3()); \r\n }else{\r\n titulo.setText(\"Modificar Feriado\"); \r\n Feriados fer = FeriadosControlador.recFer(fec);\r\n txtFecha.setText(fer.getTf_fec_nh());\r\n txtFecha.setEnabled(false);\r\n txtDes.setText(fer.getTf_descrip());\r\n } \r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n vista = inflater.inflate(R.layout.fragment_edit_competencia, container, false);\n\n updateUi();\n listenBotonUpdateCompetition();\n llenarSpinnerGenero();\n llenarSpinnerEstado();\n loadaDataCompetition();\n\n return vista;\n }", "@Override\n\tpublic void editar(Contato contato) {\n\t\tthis.dao.editar(contato);\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n txtNombre = new javax.swing.JTextField();\n txtDireccion = new javax.swing.JTextField();\n txtTelefono = new javax.swing.JTextField();\n txtEmail = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n txtApellido = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTableAgenda = new javax.swing.JTable();\n btnNuevo = new javax.swing.JButton();\n btnEliminar = new javax.swing.JButton();\n btnGuardar = new javax.swing.JButton();\n btnActualizar = new javax.swing.JButton();\n btnCancelar = new javax.swing.JButton();\n jPanel3 = new javax.swing.JPanel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n txtSobrenombre = new javax.swing.JTextField();\n jDcalendario = new com.toedter.calendar.JDateChooser();\n txtFechaRegistro = new javax.swing.JTextField();\n txtRelacion = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Datos Personales\"));\n\n jLabel1.setText(\"Nombre\");\n\n jLabel2.setText(\"Dirección\");\n\n jLabel3.setText(\"Email\");\n\n jLabel4.setText(\"Teléfono\");\n\n txtNombre.setBackground(new java.awt.Color(255, 255, 255));\n\n txtDireccion.setBackground(new java.awt.Color(255, 255, 255));\n\n txtTelefono.setBackground(new java.awt.Color(255, 255, 255));\n\n txtEmail.setBackground(new java.awt.Color(255, 255, 255));\n\n jLabel5.setText(\"Apellido\");\n\n txtApellido.setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel4)\n .addComponent(jLabel3)\n .addComponent(jLabel5))\n .addGap(64, 64, 64)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jTableAgenda.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null}\n },\n new String [] {\n \"Nombre\", \"Apellido\", \"Direccion\", \"Telefono\", \"E-mail\", \"Sobrenombre\", \"Cumpleaños\", \"Relacion\", \"Fecha de registro\"\n }\n ));\n jTableAgenda.setColumnSelectionAllowed(true);\n jTableAgenda.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTableAgendaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTableAgenda);\n\n btnNuevo.setText(\"Nuevo\");\n btnNuevo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNuevoActionPerformed(evt);\n }\n });\n\n btnEliminar.setText(\"Eliminar\");\n btnEliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEliminarActionPerformed(evt);\n }\n });\n\n btnGuardar.setText(\"Guardar\");\n btnGuardar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnGuardarActionPerformed(evt);\n }\n });\n\n btnActualizar.setText(\"Actualizar\");\n btnActualizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnActualizarActionPerformed(evt);\n }\n });\n\n btnCancelar.setText(\"Cancelar\");\n btnCancelar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelarActionPerformed(evt);\n }\n });\n\n jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Otros\"));\n\n jLabel6.setText(\"Sobrenombre\");\n\n jLabel7.setText(\"Cumpleaños\");\n\n jLabel8.setText(\"Relacion\");\n\n jLabel9.setText(\"Fecha de registro\");\n\n txtSobrenombre.setBackground(new java.awt.Color(255, 255, 255));\n\n jDcalendario.setBackground(new java.awt.Color(255, 255, 255));\n jDcalendario.setForeground(new java.awt.Color(255, 255, 255));\n\n txtFechaRegistro.setBackground(new java.awt.Color(255, 255, 255));\n\n txtRelacion.setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addComponent(jLabel9)\n .addGap(18, 18, 18)\n .addComponent(txtFechaRegistro, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(jLabel8)\n .addComponent(jLabel7))\n .addGap(41, 41, 41)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtSobrenombre, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jDcalendario, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtRelacion))))\n .addGap(142, 142, 142))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtSobrenombre, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addGap(14, 14, 14)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel7)\n .addComponent(jDcalendario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8)\n .addComponent(txtRelacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9)\n .addComponent(txtFechaRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(37, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jScrollPane1)\n .addContainerGap())\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btnNuevo)\n .addGap(28, 28, 28)\n .addComponent(btnGuardar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnEliminar)\n .addGap(46, 46, 46)\n .addComponent(btnActualizar)\n .addGap(42, 42, 42)\n .addComponent(btnCancelar)\n .addGap(32, 32, 32))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnNuevo)\n .addComponent(btnGuardar)\n .addComponent(btnEliminar)\n .addComponent(btnActualizar)\n .addComponent(btnCancelar))\n .addContainerGap())\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void iniciarDatos(Cliente pCliente, int pOpcionForm, FrmClienteLec pFrmPadre) {\n frmPadre = pFrmPadre;\n clienteActual = new Cliente();\n opcionForm = pOpcionForm;\n this.txtNombre.setEditable(true); // colocar txtNombre que se pueda editar \n this.txtApellido.setEditable(true); // colocar txtNombre que se pueda editar \n this.txtDui.setEditable(true); // colocar txtNombre que se pueda editar \n this.txtNumero.setEditable(true); // colocar txtNombre que se pueda editar \n switch (pOpcionForm) {\n case FormEscOpcion.CREAR:\n btnOk.setText(\"Nuevo\"); // modificar el texto del boton btnOk a \"Nuevo\" cuando la pOpcionForm sea CREAR\n this.btnOk.setMnemonic('N'); // modificar la tecla de atajo del boton btnOk a la letra N\n this.setTitle(\"Crear un nuevo Cliente\"); // modificar el titulo de la pantalla de FrmRolEsc\n break;\n case FormEscOpcion.MODIFICAR:\n btnOk.setText(\"Modificar\"); // modificar el texto del boton btnOk a \"Modificar\" cuando la pOpcionForm sea MODIFICAR\n this.btnOk.setMnemonic('M'); // modificar la tecla de atajo del boton btnOk a la letra M\n this.setTitle(\"Modificar el Cliente\"); // modificar el titulo de la pantalla de FrmRolEsc\n llenarControles(pCliente);\n break;\n case FormEscOpcion.ELIMINAR:\n btnOk.setText(\"Eliminar\");// modificar el texto del boton btnOk a \"Eliminar\" cuando la pOpcionForm sea ELIMINAR\n this.btnOk.setMnemonic('E'); // modificar la tecla de atajo del boton btnOk a la letra E\n this.setTitle(\"Eliminar el Cliente\"); // modificar el titulo de la pantalla de FrmRolEsc\n this.txtNombre.setEditable(false); // deshabilitar la caja de texto txtNombre\n this.txtApellido.setEditable(false);\n this.txtDui.setEditable(false);\n this.txtNumero.setEditable(false);\n llenarControles(pCliente);\n break;\n case FormEscOpcion.VER:\n btnOk.setText(\"Ver\"); // modificar el texto del boton btnOk a \"Ver\" cuando la pOpcionForm sea VER\n btnOk.setVisible(false); // ocultar el boton btnOk cuando pOpcionForm sea opcion VER\n this.setTitle(\"Ver el Cliente\"); // modificar el titulo de la pantalla de FrmRolEsc\n this.txtNombre.setEditable(false); // deshabilitar la caja de texto txtNombre\n this.txtApellido.setEditable(false);\n this.txtDui.setEditable(false);\n this.txtNumero.setEditable(false);\n llenarControles(pCliente);\n break;\n default:\n break;\n }\n }", "public void CrearNew(ActionEvent e) {\n List<Pensum> R = ejbFacade.existePensumID(super.getSelected().getIdpensum());\n if(R.isEmpty()){\n super.saveNew(e);\n }else{\n new Auxiliares().setMsj(3,\"PENSUM ID YA EXISTE\");\n }\n }", "private void iniFormEditar()\r\n\t{\r\n\t\tthis.operacion = Variables.OPERACION_EDITAR;\r\n\t\t\r\n\t\t/*Verificamos que tenga permisos*/\r\n\t\tboolean permisoNuevoEditar = this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_CONCILIACION, VariablesPermisos.OPERACION_NUEVO_EDITAR);\r\n\t\t\r\n\t\tif(permisoNuevoEditar){\r\n\t\t\t\r\n\t\t\tthis.btnEditar.setVisible(false);\r\n\t\t\tthis.conciliar.setVisible(true);\r\n\t\t\tthis.btnEliminar.setVisible(false);\r\n\t\t\tthis.conciliar.setCaption(\"Guardar\");\r\n\t\t\t\r\n\t\t\tthis.nroDocum.setEnabled(false);\r\n\t\t\tthis.fecDoc.setEnabled(true);\r\n\t\t\tthis.observaciones.setEnabled(true);\r\n\t\t\t\r\n\t\t\tthis.botones.setWidth(\"187\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\r\n\t\t\t/*Mostramos mensaje Sin permisos para operacion*/\r\n\t\t\tMensajes.mostrarMensajeError(Variables.USUSARIO_SIN_PERMISOS);\r\n\t\t}\r\n\t}", "@Override\n protected void carregaObjeto() throws ViolacaoRegraNegocioException {\n entidade.setNome( txtNome.getText() );\n entidade.setDescricao(txtDescricao.getText());\n entidade.setTipo( txtTipo.getText() );\n entidade.setValorCusto(new BigDecimal((String) txtCusto.getValue()));\n entidade.setValorVenda(new BigDecimal((String) txtVenda.getValue()));\n \n \n }", "public Venda(String codigoVenda, int quantidadeTotalVenda, int valorFrete, double valorTotalVenda, String dataVenda, int idEndereco, int idUsuario, int idStatus, int idPagamento) {\r\n this.codigoVenda = codigoVenda;\r\n this.quantidadeTotalVenda = quantidadeTotalVenda;\r\n this.valorFrete = valorFrete;\r\n this.valorTotalVenda = valorTotalVenda;\r\n this.dataVenda = dataVenda;\r\n this.idEndereco = idEndereco;\r\n this.idUsuario = idUsuario;\r\n this.idStatus = idStatus;\r\n this.idPagamento = idPagamento;\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel3 = new javax.swing.JLabel();\n viewDateAtual = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jLabel15 = new javax.swing.JLabel();\n jTextField7 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jLabel17 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tabProdVen = new javax.swing.JTable();\n addProd = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n bPesquisa = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jComboBox2 = new javax.swing.JComboBox<>();\n\n setClosable(true);\n setForeground(java.awt.Color.black);\n setIconifiable(true);\n setMaximizable(true);\n setResizable(true);\n setTitle(\"Venda\");\n\n jLabel3.setText(\"Data:\");\n\n jLabel5.setText(\"Cliente:\");\n\n jTextField1.setText(\"Nome do cliente\");\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n jLabel15.setText(\"Valor Total:\");\n\n jTextField7.setText(\"R$:\");\n\n jButton1.setText(\"Salvar\");\n\n jButton2.setText(\"Limpar\");\n\n jButton3.setText(\"Cancelar\");\n\n jLabel17.setText(\"VENDA\");\n\n tabProdVen.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Produto\", \"Quantidade\", \"Unidade\", \"Valor\"\n }\n ));\n tabProdVen.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n jScrollPane1.setViewportView(tabProdVen);\n\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n bPesquisa.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bPesquisaActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Forma de pagamento:\");\n\n jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Dinheiro\", \"Crédito\", \"Débito\", \"Cheque\" }));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton3))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel5))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(72, 72, 72)\n .addComponent(viewDateAtual, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 314, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 389, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jComboBox2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel15)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(176, 176, 176)\n .addComponent(jLabel17))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(addProd, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(viewDateAtual, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addComponent(bPesquisa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(addProd))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel15)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1)\n .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(42, 42, 42)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(23, 23, 23))\n );\n\n pack();\n }", "@Override\n public void onClick(View v) {\n etProducto.setError(null);\n etCantidad.setError(null);\n etDescripcion.setError(null);\n String producto = etProducto.getText().toString(),\n CantidadComoCadena = etCantidad.getText().toString(),\n descripcion = etDescripcion.getText().toString();\n if (\"\".equals(producto)) {\n etProducto.setError(\"Escribe el producto a comprar\");\n etProducto.requestFocus();\n return;\n }\n if (\"\".equals(CantidadComoCadena)) {\n etCantidad.setError(\"Escribe la cantidad de la venta\");\n etCantidad.requestFocus();\n return;\n }\n if (\"\".equals(descripcion)) {\n etDescripcion.setError(\"Escribe la descripción de la venta\");\n etDescripcion.requestFocus();\n return;\n }\n\n // Ver si es un entero\n int cantidad;\n try {\n cantidad = Integer.parseInt(etCantidad.getText().toString());\n } catch (NumberFormatException e) {\n etCantidad.setError(\"Escribe la cantidad\");\n etCantidad.requestFocus();\n return;\n }\n // Ya pasó la validación\n Venta nuevaVenta = new Venta(producto,cantidad,descripcion);\n long id = ventasController.nuevaVenta(nuevaVenta);\n if (id == -1) {\n // De alguna manera ocurrió un error\n Toast.makeText(AgregarMascotaActivity.this, \"Error al guardar. Intenta de nuevo\", Toast.LENGTH_SHORT).show();\n } else {\n // Terminar\n finish();\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabelProduto = new javax.swing.JLabel();\n jCampoProduto = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jCampoDescricao = new javax.swing.JTextField();\n jBotaoIncluir = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTabela = new javax.swing.JTable();\n jbotaoAlterar = new javax.swing.JButton();\n jbotaoApagar = new javax.swing.JButton();\n\n setClosable(true);\n setIconifiable(true);\n setMaximizable(true);\n setTitle(\"Cadastro\");\n\n jLabelProduto.setText(\"Nome do Produto:\");\n\n jLabel1.setText(\"Descrição:\");\n\n jBotaoIncluir.setText(\"Incluir\");\n jBotaoIncluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBotaoIncluirActionPerformed(evt);\n }\n });\n\n jTabela.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"ID\", \"Produto\", \"Descrição\"\n }\n ));\n jTabela.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTabelaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTabela);\n\n jbotaoAlterar.setText(\"Alterar\");\n jbotaoAlterar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbotaoAlterarActionPerformed(evt);\n }\n });\n\n jbotaoApagar.setText(\"Apagar\");\n jbotaoApagar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbotaoApagarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelProduto)\n .addComponent(jCampoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(34, 34, 34)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jCampoDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jBotaoIncluir))\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbotaoAlterar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbotaoApagar)\n .addContainerGap(18, Short.MAX_VALUE))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(48, 48, 48)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelProduto)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jCampoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jCampoDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jBotaoIncluir)\n .addComponent(jbotaoAlterar)\n .addComponent(jbotaoApagar))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "public FormCadastroAutomovel() {\n initComponents();\n }", "public agregarArticulo(String user, String password, String vend, String codigoVend) {\n initComponents();\n usu = user;\n contra = password;\n\n try {\n model = new ConnectionTableDB(usu, contra, \"adv_facturacion\", \"SELECT tipo_producto from tipo_producto\", false);\n\n for (int i = 0; i < model.getRowCount(); i++) {\n tipo.addItem(String.valueOf(model.getValueAt(i, 0)));\n }\n //this.getContentPane().setBackground(Color.white);\n } catch (SQLException ex) {\n Logger.getLogger(agregarArticulo.class.getName()).log(Level.SEVERE, null, ex);\n }\n model.desconectar();\n }", "public String editar()\r\n/* 86: */ {\r\n/* 87:112 */ if (getDimensionContable().getId() != 0)\r\n/* 88: */ {\r\n/* 89:113 */ this.dimensionContable = this.servicioDimensionContable.cargarDetalle(this.dimensionContable.getId());\r\n/* 90:114 */ String[] filtro = { \"indicadorValidarDimension\" + getDimension(), \"true\" };\r\n/* 91:115 */ this.listaCuentaContableBean.agregarFiltro(filtro);\r\n/* 92:116 */ this.listaCuentaContableBean.setIndicadorSeleccionarTodo(true);\r\n/* 93:117 */ verificaDimension();\r\n/* 94:118 */ setEditado(true);\r\n/* 95: */ }\r\n/* 96: */ else\r\n/* 97: */ {\r\n/* 98:120 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 99: */ }\r\n/* 100:123 */ return \"\";\r\n/* 101: */ }", "public TareasEvento() {\n initComponents();\n setTitle (\"Tareas\");\n mostrardatos(jTextField1.getText());\n \n }", "@RequestMapping(value = { \"/new\" }, method = RequestMethod.POST)\n\tpublic String saveEntity(@Valid ENTITY tipoConsumo, BindingResult result, ModelMap model,\n\t\t\t@RequestParam(required = false) Integer idEstadia) {\n\t\ttry{\n\t\n\t\t\tif (result.hasErrors()) {\n\t\t\t\treturn viewBaseLocation + \"/form\";\n\t\t\t}\n\t\n\t\t\tabm.guardar(tipoConsumo);\n\t\n\t\t\tif(idEstadia != null){\n\t\t\t\tmodel.addAttribute(\"idEstadia\", idEstadia);\n\t\t\t}\n\t\n\t\t\tmodel.addAttribute(\"success\", \"La creaci&oacuten se realiz&oacute correctamente.\");\n\t\t\t\n\t\t} catch(Exception e) {\n\t\t\tmodel.addAttribute(\"success\", \"La creaci&oacuten no pudo realizarse.\");\n\t\t}\n\t\tmodel.addAttribute(\"loggedinuser\", getPrincipal());\n\t\treturn \"redirect:list\";\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTextField1 = new javax.swing.JTextField();\n lbValor = new javax.swing.JLabel();\n lbValorTotal = new javax.swing.JLabel();\n TpDados = new javax.swing.JTabbedPane();\n PanelDadosGerais = new javax.swing.JPanel();\n lbUsuario = new javax.swing.JLabel();\n lbCliente = new javax.swing.JLabel();\n cbCliente = new javax.swing.JComboBox();\n Cbusuario = new javax.swing.JComboBox();\n lbData = new javax.swing.JLabel();\n PanelItensVenda = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblProduto = new javax.swing.JTable();\n btnAdiciona = new javax.swing.JButton();\n btnRemove = new javax.swing.JButton();\n btnFecharVenda = new javax.swing.JButton();\n\n jTextField1.setText(\"jTextField1\");\n\n setClosable(true);\n setIconifiable(true);\n setMaximizable(true);\n setTitle(\"Vendas\");\n\n lbValor.setText(\"Valor Total:\");\n\n lbUsuario.setText(\"Usuario: \");\n\n lbCliente.setText(\"Cliente:\");\n\n cbCliente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Selecione o Cliente\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n cbCliente.setToolTipText(\"Selecione o Cliente\");\n\n Cbusuario.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Selecione o Usuário\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n lbData.setText(\"jLabel2\");\n\n javax.swing.GroupLayout PanelDadosGeraisLayout = new javax.swing.GroupLayout(PanelDadosGerais);\n PanelDadosGerais.setLayout(PanelDadosGeraisLayout);\n PanelDadosGeraisLayout.setHorizontalGroup(\n PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PanelDadosGeraisLayout.createSequentialGroup()\n .addGroup(PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PanelDadosGeraisLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lbUsuario)\n .addComponent(lbCliente))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cbCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(Cbusuario, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(PanelDadosGeraisLayout.createSequentialGroup()\n .addGap(384, 384, 384)\n .addComponent(lbData)))\n .addContainerGap(397, Short.MAX_VALUE))\n );\n PanelDadosGeraisLayout.setVerticalGroup(\n PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PanelDadosGeraisLayout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(lbData)\n .addGap(30, 30, 30)\n .addGroup(PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Cbusuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lbUsuario))\n .addGap(28, 28, 28)\n .addGroup(PanelDadosGeraisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cbCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lbCliente))\n .addContainerGap(101, Short.MAX_VALUE))\n );\n\n TpDados.addTab(\"Dados Gerais\", PanelDadosGerais);\n\n tblProduto.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Nome Produto\", \"Valor Unitário\"\n }\n ));\n jScrollPane1.setViewportView(tblProduto);\n tblProduto.getColumnModel().getColumn(1).setResizable(false);\n\n btnAdiciona.setText(\"Adicionar Produto\");\n btnAdiciona.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAdicionaActionPerformed(evt);\n }\n });\n\n btnRemove.setText(\"Remover Produto\");\n btnRemove.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnRemoveActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout PanelItensVendaLayout = new javax.swing.GroupLayout(PanelItensVenda);\n PanelItensVenda.setLayout(PanelItensVendaLayout);\n PanelItensVendaLayout.setHorizontalGroup(\n PanelItensVendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PanelItensVendaLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 126, Short.MAX_VALUE)\n .addGroup(PanelItensVendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnAdiciona, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnRemove, javax.swing.GroupLayout.Alignment.TRAILING))\n .addGap(110, 110, 110))\n );\n PanelItensVendaLayout.setVerticalGroup(\n PanelItensVendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PanelItensVendaLayout.createSequentialGroup()\n .addContainerGap(15, Short.MAX_VALUE)\n .addGroup(PanelItensVendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(PanelItensVendaLayout.createSequentialGroup()\n .addGap(13, 13, 13)\n .addComponent(btnAdiciona)\n .addGap(26, 26, 26)\n .addComponent(btnRemove)))\n .addGap(117, 117, 117))\n );\n\n TpDados.addTab(\"Itens da Venda\", PanelItensVenda);\n\n btnFecharVenda.setText(\"Concluir Venda\");\n btnFecharVenda.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnFecharVendaActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(TpDados))\n .addGroup(layout.createSequentialGroup()\n .addGap(229, 229, 229)\n .addComponent(btnFecharVenda)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lbValor)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(lbValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(63, 63, 63)))\n .addGap(19, 19, 19))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(TpDados, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(lbValor))\n .addComponent(lbValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(67, 67, 67)\n .addComponent(btnFecharVenda)\n .addContainerGap(184, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n botonCancelarProveedor = new javax.swing.JButton();\n bGuardar = new javax.swing.JButton();\n jLabel14 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n campoId = new javax.swing.JTextField();\n campoMarca = new javax.swing.JTextField();\n campoNombre = new javax.swing.JTextField();\n campoApellidos = new javax.swing.JTextField();\n campoTelefono = new javax.swing.JTextField();\n campoDireccion = new javax.swing.JTextField();\n campoEmail = new javax.swing.JTextField();\n campoIdZapato = new javax.swing.JTextField();\n campoCantidad = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n setTitle(\"ANDREA S.A. DE C.V.\");\n setResizable(false);\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n jPanel1.setMaximumSize(new java.awt.Dimension(421, 437));\n jPanel1.setPreferredSize(new java.awt.Dimension(421, 437));\n\n jLabel1.setBackground(new java.awt.Color(255, 0, 0));\n jLabel1.setFont(new java.awt.Font(\"Arial\", 1, 18)); // NOI18N\n jLabel1.setText(\"AGREGAR PROVEEDOR\");\n\n jLabel2.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(255, 0, 0));\n jLabel2.setText(\"ID:\");\n\n jLabel3.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(255, 0, 0));\n jLabel3.setText(\"NOMBRE (S):\");\n\n jLabel4.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(255, 0, 0));\n jLabel4.setText(\"MARCA:\");\n\n jLabel5.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel5.setForeground(new java.awt.Color(255, 0, 0));\n jLabel5.setText(\"APELLIDOS:\");\n\n jLabel6.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel6.setForeground(new java.awt.Color(255, 0, 0));\n jLabel6.setText(\"TELEFONO FIJO:\");\n\n botonCancelarProveedor.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n botonCancelarProveedor.setForeground(new java.awt.Color(255, 0, 0));\n botonCancelarProveedor.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/zapateria/vista/tachee.png\"))); // NOI18N\n botonCancelarProveedor.setText(\"CANCELAR\");\n botonCancelarProveedor.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botonCancelarProveedorActionPerformed(evt);\n }\n });\n\n bGuardar.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n bGuardar.setForeground(new java.awt.Color(255, 0, 0));\n bGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/zapateria/vista/iconoGuardar.png\"))); // NOI18N\n bGuardar.setText(\"GUARDAR\");\n bGuardar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bGuardarActionPerformed(evt);\n }\n });\n\n jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel14.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/zapateria/vista/iconoAgregar.png\"))); // NOI18N\n\n jLabel8.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel8.setForeground(new java.awt.Color(255, 0, 0));\n jLabel8.setText(\"DIRECCION:\");\n\n jLabel9.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel9.setForeground(new java.awt.Color(255, 0, 0));\n jLabel9.setText(\"E-MAIL:\");\n\n jLabel10.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel10.setForeground(new java.awt.Color(255, 0, 0));\n jLabel10.setText(\"ID ZAPATO:\");\n\n jLabel11.setFont(new java.awt.Font(\"Arial\", 1, 12)); // NOI18N\n jLabel11.setForeground(new java.awt.Color(255, 0, 0));\n jLabel11.setText(\"CANTIDAD:\");\n\n campoId.setBackground(java.awt.Color.white);\n campoId.setEditable(false);\n campoId.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n campoIdActionPerformed(evt);\n }\n });\n\n campoMarca.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n campoMarcaKeyTyped(evt);\n }\n });\n\n campoNombre.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n campoNombreKeyTyped(evt);\n }\n });\n\n campoApellidos.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n campoApellidosKeyTyped(evt);\n }\n });\n\n campoTelefono.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n campoTelefonoKeyTyped(evt);\n }\n });\n\n campoIdZapato.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n campoIdZapatoKeyTyped(evt);\n }\n });\n\n campoCantidad.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n campoCantidadKeyTyped(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel8)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel9)\n .addGap(18, 18, 18)\n .addComponent(campoEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoTelefono)\n .addGap(205, 205, 205))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel10)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoIdZapato, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(53, 53, 53)\n .addComponent(jLabel11)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoId, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(63, 63, 63)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoNombre))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(campoApellidos, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap())))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(101, 101, 101)\n .addComponent(jLabel1)\n .addGap(38, 38, 38)\n .addComponent(jLabel14)\n .addContainerGap(37, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(50, 50, 50)\n .addComponent(botonCancelarProveedor)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(bGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(45, 45, 45))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addGap(21, 21, 21)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoApellidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(jLabel14)))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoIdZapato, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(campoCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(botonCancelarProveedor)\n .addComponent(bGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(34, 34, 34))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "@RequestMapping(\"/cadastrodeevento\")\n\tpublic ModelAndView cadastroevento() {\n\t\tModelAndView mv = new ModelAndView(\"CadastroEvento\");\n\t\tmv.addObject(new Evento());\n\t\t\n\t\t\n\t\t\n\t\treturn mv;\n\t}" ]
[ "0.67010075", "0.6538181", "0.6533826", "0.6423423", "0.6377682", "0.6308433", "0.6298194", "0.62978417", "0.629395", "0.6293785", "0.6240486", "0.6236329", "0.6224935", "0.6219679", "0.61976564", "0.618712", "0.6175008", "0.6172676", "0.6167844", "0.6144113", "0.61419815", "0.61417854", "0.6124229", "0.6124229", "0.6119788", "0.6117306", "0.6116334", "0.6115285", "0.6099483", "0.6092512", "0.6077015", "0.60604715", "0.6044617", "0.6035571", "0.6027318", "0.6021306", "0.60195273", "0.601716", "0.60095984", "0.6002447", "0.59960884", "0.5992862", "0.5989143", "0.59782964", "0.5972184", "0.5946812", "0.59298676", "0.59287137", "0.5903843", "0.58957565", "0.5890194", "0.5889185", "0.588669", "0.588424", "0.5876198", "0.58760834", "0.5867082", "0.58570534", "0.58517414", "0.584891", "0.58488", "0.58412147", "0.5831362", "0.58263063", "0.5824528", "0.5822135", "0.5816624", "0.58117527", "0.5807285", "0.5802318", "0.57928824", "0.5786283", "0.5784938", "0.57829356", "0.57829064", "0.57696056", "0.57679325", "0.5767863", "0.5766264", "0.5765283", "0.5763865", "0.5762958", "0.57602525", "0.5757924", "0.5752091", "0.5750908", "0.5747902", "0.5744695", "0.5742706", "0.5738823", "0.57386994", "0.57366234", "0.57266444", "0.57221586", "0.57221305", "0.57202446", "0.57188034", "0.5717871", "0.5716098", "0.57142174" ]
0.70384485
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { apagarVenda = new javax.swing.JButton(); jLabel14 = new javax.swing.JLabel(); jLabel36 = new javax.swing.JLabel(); lucro = new javax.swing.JTextField(); jLabel34 = new javax.swing.JLabel(); codigoCliente = new javax.swing.JTextField(); custoNaMadri = new javax.swing.JTextField(); jLabel35 = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); valorLiquidoML = new javax.swing.JTextField(); jLabel29 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); dataVenda = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); precoVendido = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); codigoPeca = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); cadastroObservacoes = new javax.swing.JTextArea(); jLabel6 = new javax.swing.JLabel(); tarifaDoML = new javax.swing.JTextField(); jLabel22 = new javax.swing.JLabel(); porcentagemDoMercadoLivre = new javax.swing.JTextField(); quantidadeVendida = new javax.swing.JTextField(); botAtualizar = new javax.swing.JButton(); botaoEntrarIniciall1 = new javax.swing.JButton(); nomePeca = new javax.swing.JTextField(); valorFrete = new javax.swing.JTextField(); jLabel30 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel31 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel37 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); mostrarNivel = new javax.swing.JLabel(); acessoUser = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("EDITAR VENDA"); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } }); getContentPane().setLayout(null); apagarVenda.setBackground(new java.awt.Color(0, 0, 0)); apagarVenda.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N apagarVenda.setForeground(new java.awt.Color(255, 255, 255)); apagarVenda.setText("APAGAR"); apagarVenda.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { apagarVendaActionPerformed(evt); } }); apagarVenda.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { apagarVendaKeyPressed(evt); } }); getContentPane().add(apagarVenda); apagarVenda.setBounds(300, 640, 160, 40); jLabel14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/APAGAR.png"))); // NOI18N getContentPane().add(jLabel14); jLabel14.setBounds(440, 610, 80, 70); jLabel36.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel36.setForeground(new java.awt.Color(255, 255, 255)); jLabel36.setText("LUCRO"); getContentPane().add(jLabel36); jLabel36.setBounds(280, 350, 70, 17); lucro.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N lucro.setText("0,00"); lucro.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { lucroFocusGained(evt); } }); lucro.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { lucroActionPerformed(evt); } }); lucro.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { lucroKeyPressed(evt); } }); getContentPane().add(lucro); lucro.setBounds(280, 380, 140, 30); jLabel34.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel34.setForeground(new java.awt.Color(255, 255, 255)); jLabel34.setText("CÓDIGO DA VENDA"); getContentPane().add(jLabel34); jLabel34.setBounds(480, 350, 180, 17); codigoCliente.setEditable(false); codigoCliente.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N codigoCliente.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { codigoClienteFocusGained(evt); } }); codigoCliente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { codigoClienteActionPerformed(evt); } }); codigoCliente.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { codigoClienteKeyPressed(evt); } }); getContentPane().add(codigoCliente); codigoCliente.setBounds(480, 380, 140, 30); custoNaMadri.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N custoNaMadri.setText("0,00"); custoNaMadri.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { custoNaMadriFocusGained(evt); } }); custoNaMadri.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { custoNaMadriActionPerformed(evt); } }); custoNaMadri.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { custoNaMadriKeyPressed(evt); } }); getContentPane().add(custoNaMadri); custoNaMadri.setBounds(30, 380, 190, 30); jLabel35.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel35.setForeground(new java.awt.Color(255, 255, 255)); jLabel35.setText("PREÇO DE CUSTO NA MADRI"); getContentPane().add(jLabel35); jLabel35.setBounds(30, 350, 210, 17); jLabel28.setFont(new java.awt.Font("Tahoma", 1, 21)); // NOI18N jLabel28.setForeground(new java.awt.Color(255, 255, 255)); jLabel28.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel28.setText("EDITAR VENDA"); getContentPane().add(jLabel28); jLabel28.setBounds(260, 10, 320, 60); valorLiquidoML.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N valorLiquidoML.setText("0,00"); valorLiquidoML.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { valorLiquidoMLFocusGained(evt); } }); valorLiquidoML.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { valorLiquidoMLActionPerformed(evt); } }); valorLiquidoML.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { valorLiquidoMLKeyPressed(evt); } }); getContentPane().add(valorLiquidoML); valorLiquidoML.setBounds(480, 300, 140, 30); jLabel29.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel29.setForeground(new java.awt.Color(255, 255, 255)); jLabel29.setText("VALOR LÍQUIDO DO MERCADO LIVRE"); getContentPane().add(jLabel29); jLabel29.setBounds(480, 270, 270, 17); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("PORCENTAGEM DO MERCADO LIVRE"); getContentPane().add(jLabel2); jLabel2.setBounds(480, 190, 270, 17); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("DATA"); getContentPane().add(jLabel3); jLabel3.setBounds(280, 110, 100, 17); dataVenda.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N dataVenda.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { dataVendaFocusGained(evt); } }); dataVenda.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { dataVendaKeyPressed(evt); } }); getContentPane().add(dataVenda); dataVenda.setBounds(280, 140, 140, 30); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("QUANTIDADE VENDIDA"); getContentPane().add(jLabel4); jLabel4.setBounds(480, 110, 190, 17); precoVendido.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N precoVendido.setText("0,00"); precoVendido.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { precoVendidoFocusGained(evt); } }); precoVendido.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { precoVendidoKeyPressed(evt); } }); getContentPane().add(precoVendido); precoVendido.setBounds(280, 220, 140, 30); jLabel15.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel15.setForeground(new java.awt.Color(255, 0, 0)); jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel15.setText("*"); getContentPane().add(jLabel15); jLabel15.setBounds(230, 330, 40, 60); jLabel17.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel17.setForeground(new java.awt.Color(255, 0, 0)); jLabel17.setText("*"); getContentPane().add(jLabel17); jLabel17.setBounds(330, 100, 30, 40); jLabel18.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel18.setForeground(new java.awt.Color(255, 0, 0)); jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel18.setText("*"); getContentPane().add(jLabel18); jLabel18.setBounds(660, 110, 20, 22); jLabel16.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel16.setForeground(new java.awt.Color(255, 0, 0)); jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel16.setText("*"); getContentPane().add(jLabel16); jLabel16.setBounds(90, 100, 30, 40); jLabel19.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel19.setForeground(new java.awt.Color(255, 255, 255)); jLabel19.setText("CÓDIGO"); getContentPane().add(jLabel19); jLabel19.setBounds(30, 110, 70, 17); codigoPeca.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N codigoPeca.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { codigoPecaFocusLost(evt); } }); codigoPeca.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { codigoPecaKeyPressed(evt); } }); getContentPane().add(codigoPeca); codigoPeca.setBounds(30, 140, 130, 30); jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/MER-LIVRE.png"))); // NOI18N getContentPane().add(jLabel5); jLabel5.setBounds(715, 5, 70, 75); jLabel21.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel21.setForeground(new java.awt.Color(255, 255, 255)); jLabel21.setText("OBSERVAÇÕES"); getContentPane().add(jLabel21); jLabel21.setBounds(30, 430, 200, 17); jLabel20.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel20.setForeground(new java.awt.Color(255, 255, 255)); jLabel20.setText("TARIFA DO MERCADO LIVRE"); getContentPane().add(jLabel20); jLabel20.setBounds(30, 270, 210, 17); cadastroObservacoes.setColumns(20); cadastroObservacoes.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N cadastroObservacoes.setRows(5); cadastroObservacoes.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { cadastroObservacoesKeyPressed(evt); } }); jScrollPane1.setViewportView(cadastroObservacoes); getContentPane().add(jScrollPane1); jScrollPane1.setBounds(30, 460, 730, 140); jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Sem título.png"))); // NOI18N jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); getContentPane().add(jLabel6); jLabel6.setBounds(-4, 0, 150, 80); tarifaDoML.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N tarifaDoML.setText("0,00"); tarifaDoML.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { tarifaDoMLFocusGained(evt); } }); tarifaDoML.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { tarifaDoMLKeyPressed(evt); } }); getContentPane().add(tarifaDoML); tarifaDoML.setBounds(30, 300, 140, 30); jLabel22.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel22.setForeground(new java.awt.Color(255, 255, 255)); jLabel22.setText("PREÇO DE VENDA"); getContentPane().add(jLabel22); jLabel22.setBounds(280, 190, 150, 17); porcentagemDoMercadoLivre.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N porcentagemDoMercadoLivre.setText("11,00"); porcentagemDoMercadoLivre.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { porcentagemDoMercadoLivreFocusGained(evt); } }); porcentagemDoMercadoLivre.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { porcentagemDoMercadoLivreActionPerformed(evt); } }); porcentagemDoMercadoLivre.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { porcentagemDoMercadoLivreKeyPressed(evt); } }); getContentPane().add(porcentagemDoMercadoLivre); porcentagemDoMercadoLivre.setBounds(480, 220, 140, 30); quantidadeVendida.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N quantidadeVendida.setText("1"); quantidadeVendida.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { quantidadeVendidaFocusGained(evt); } }); quantidadeVendida.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { quantidadeVendidaKeyPressed(evt); } }); getContentPane().add(quantidadeVendida); quantidadeVendida.setBounds(480, 140, 140, 30); botAtualizar.setBackground(new java.awt.Color(0, 0, 0)); botAtualizar.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N botAtualizar.setForeground(new java.awt.Color(255, 255, 255)); botAtualizar.setText("ATUALIZAR"); botAtualizar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botAtualizarActionPerformed(evt); } }); botAtualizar.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { botAtualizarKeyPressed(evt); } }); getContentPane().add(botAtualizar); botAtualizar.setBounds(30, 640, 160, 40); botaoEntrarIniciall1.setBackground(new java.awt.Color(0, 0, 0)); botaoEntrarIniciall1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N botaoEntrarIniciall1.setForeground(new java.awt.Color(255, 255, 255)); botaoEntrarIniciall1.setText("PESQUISAR"); botaoEntrarIniciall1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botaoEntrarIniciall1ActionPerformed(evt); } }); botaoEntrarIniciall1.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { botaoEntrarIniciall1KeyPressed(evt); } }); getContentPane().add(botaoEntrarIniciall1); botaoEntrarIniciall1.setBounds(560, 640, 160, 40); nomePeca.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N nomePeca.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { nomePecaFocusGained(evt); } }); nomePeca.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { nomePecaKeyPressed(evt); } }); getContentPane().add(nomePeca); nomePeca.setBounds(30, 220, 210, 30); valorFrete.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N valorFrete.setText("0,00"); valorFrete.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { valorFreteFocusGained(evt); } }); valorFrete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { valorFreteActionPerformed(evt); } }); valorFrete.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { valorFreteKeyPressed(evt); } }); getContentPane().add(valorFrete); valorFrete.setBounds(280, 300, 140, 30); jLabel30.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel30.setForeground(new java.awt.Color(255, 255, 255)); jLabel30.setText("VALOR DO FRETE"); getContentPane().add(jLabel30); jLabel30.setBounds(280, 270, 140, 17); jLabel23.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel23.setForeground(new java.awt.Color(255, 255, 255)); jLabel23.setText("NOME"); getContentPane().add(jLabel23); jLabel23.setBounds(30, 190, 150, 17); jLabel25.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel25.setForeground(new java.awt.Color(255, 0, 0)); jLabel25.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel25.setText("*"); getContentPane().add(jLabel25); jLabel25.setBounds(400, 170, 40, 60); jLabel31.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel31.setForeground(new java.awt.Color(255, 0, 0)); jLabel31.setText("*"); getContentPane().add(jLabel31); jLabel31.setBounds(750, 160, 30, 80); jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/fundo preto.png"))); // NOI18N jLabel12.setMinimumSize(new java.awt.Dimension(1057, 340)); jLabel12.setPreferredSize(new java.awt.Dimension(1057, 350)); getContentPane().add(jLabel12); jLabel12.setBounds(-80, 4, 760, 77); jLabel24.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel24.setForeground(new java.awt.Color(255, 0, 0)); jLabel24.setText("*"); getContentPane().add(jLabel24); jLabel24.setBounds(90, 170, 30, 60); jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/PROCURA HEHE.png"))); // NOI18N getContentPane().add(jLabel13); jLabel13.setBounds(700, 610, 80, 70); jLabel27.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel27.setForeground(new java.awt.Color(255, 0, 0)); jLabel27.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel27.setText("*"); getContentPane().add(jLabel27); jLabel27.setBounds(230, 250, 40, 60); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/fundo preto.png"))); // NOI18N jLabel1.setMinimumSize(new java.awt.Dimension(1057, 340)); jLabel1.setPreferredSize(new java.awt.Dimension(1057, 350)); getContentPane().add(jLabel1); jLabel1.setBounds(140, 4, 760, 77); jLabel37.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel37.setForeground(new java.awt.Color(255, 0, 0)); jLabel37.setText("*"); getContentPane().add(jLabel37); jLabel37.setBounds(420, 250, 30, 60); jLabel26.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/atua.png"))); // NOI18N getContentPane().add(jLabel26); jLabel26.setBounds(170, 610, 80, 70); jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/FUNDO AMARELO.jpg"))); // NOI18N getContentPane().add(jLabel11); jLabel11.setBounds(0, -331, 810, 430); jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/RS.png"))); // NOI18N getContentPane().add(jLabel7); jLabel7.setBounds(310, 10, 610, 530); jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/RS.png"))); // NOI18N getContentPane().add(jLabel8); jLabel8.setBounds(320, 340, 570, 530); jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/RS.png"))); // NOI18N getContentPane().add(jLabel9); jLabel9.setBounds(-20, 450, 570, 530); jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/RS.png"))); // NOI18N getContentPane().add(jLabel10); jLabel10.setBounds(0, 0, 570, 530); mostrarNivel.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N mostrarNivel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); mostrarNivel.setText("5"); getContentPane().add(mostrarNivel); mostrarNivel.setBounds(520, 130, 50, 70); acessoUser.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N acessoUser.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); acessoUser.setText("ADMIN"); getContentPane().add(acessoUser); acessoUser.setBounds(520, 220, 70, 60); setBounds(427, 5, 790, 716); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public quotaGUI() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public FrmMenu() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73195875", "0.7291065", "0.7291065", "0.7291065", "0.7286258", "0.7248489", "0.7213822", "0.7208757", "0.7195916", "0.7190243", "0.7184025", "0.71591616", "0.7148041", "0.70930153", "0.7080625", "0.7056986", "0.6987694", "0.69770867", "0.6955136", "0.69538426", "0.69452894", "0.6942365", "0.6935255", "0.69317245", "0.6928022", "0.6924961", "0.6924691", "0.6911908", "0.6911051", "0.6892464", "0.6892285", "0.6890819", "0.6890592", "0.688895", "0.6882979", "0.68822217", "0.688142", "0.68779635", "0.68758005", "0.6873809", "0.6871587", "0.68597937", "0.6855975", "0.68553025", "0.685517", "0.68546903", "0.6853679", "0.6852941", "0.6852941", "0.68433666", "0.6837067", "0.68358743", "0.6828493", "0.68284714", "0.6826015", "0.6824099", "0.68229824", "0.68168867", "0.6816564", "0.6810073", "0.68090576", "0.6808398", "0.68083", "0.68070155", "0.6803015", "0.6794736", "0.67938805", "0.6792195", "0.6790488", "0.67894924", "0.67889225", "0.6787931", "0.67813647", "0.6766285", "0.676601", "0.6765171", "0.67574227", "0.6755563", "0.6752438", "0.6752084", "0.6742885", "0.67392796", "0.6737635", "0.6736323", "0.67334515", "0.67276573", "0.67266935", "0.6719731", "0.6715714", "0.6715036", "0.67141175", "0.6708368", "0.6707287", "0.6703903", "0.67010856", "0.6700051", "0.6698535", "0.66982317", "0.66940516", "0.6691627", "0.6689702" ]
0.0
-1
Local interface for Enterprise Bean: CSActsWorker
public interface CSActsWorkerLocal extends javax.ejb.EJBLocalObject { /** * Returns the cdFipsWrkr. * @return String */ public String getCdFipsWrkr(); /** * Returns the cdWrkrType. * @return String */ public String getCdWrkrType(); /** * Returns the csActsWorkerInquiry. * @return CSActsWorkerInquiry */ public CSActsWorkerInquiry getCsActsWorkerInquiry(); /** * getEntityContext */ public javax.ejb.EntityContext getEntityContext(); /** * Returns the idEmail. * @return String */ public String getIdEmail(); /** * Returns the idWrkr. * @return String */ public String getIdWrkr(); /** * Returns the idWrkrLogon. * @return String */ public String getIdWrkrLogon(); /** * Returns the myEntityCtx. * @return javax.ejb.EntityContext */ public javax.ejb.EntityContext getMyEntityCtx(); /** * Returns the nbFaxWorker. * @return String */ public String getNbFaxWorker(); /** * Returns the nbTelWorker. * @return String */ public String getNbTelWorker(); /** * Returns the nmWrkr. * @return String */ public String getNmWrkr(); /** * Returns the tmLunchEnd. * @return String */ public String getTmLunchEnd(); /** * Returns the tmLunchStart. * @return String */ public String getTmLunchStart(); /** * Returns the tmWorkEnd. * @return String */ public String getTmWorkEnd(); /** * Returns the tmWorkStart. * @return String */ public String getTmWorkStart(); /** * Sets the cdFipsWrkr. * @param cdFipsWrkr The cdFipsWrkr to set */ public void setCdFipsWrkr(String cdFipsWrkr); /** * Sets the cdWrkrType. * @param cdWrkrType The cdWrkrType to set */ public void setCdWrkrType(String cdWrkrType); /** * Sets the csActsWorkerInquiry. * @param csActsWorkerInquiry The csActsWorkerInquiry to set */ public void setCsActsWorkerInquiry(CSActsWorkerInquiry csActsWorkerInquiry); /** * setEntityContext */ public void setEntityContext(javax.ejb.EntityContext ctx); /** * Sets the idEmail. * @param idEmail The idEmail to set */ public void setIdEmail(String idEmail); /** * Sets the idWrkr. * @param idWrkr The idWrkr to set */ public void setIdWrkr(String idWrkr); /** * Sets the idWrkrLogon. * @param idWrkrLogon The idWrkrLogon to set */ public void setIdWrkrLogon(String idWrkrLogon); /** * Sets the myEntityCtx. * @param myEntityCtx The myEntityCtx to set */ public void setMyEntityCtx(javax.ejb.EntityContext myEntityCtx); /** * Sets the nbFaxWorker. * @param nbFaxWorker The nbFaxWorker to set */ public void setNbFaxWorker(String nbFaxWorker); /** * Sets the nbTelWorker. * @param nbTelWorker The nbTelWorker to set */ public void setNbTelWorker(String nbTelWorker); /** * Sets the nmWrkr. * @param nmWrkr The nmWrkr to set */ public void setNmWrkr(String nmWrkr); /** * Sets the tmLunchEnd. * @param tmLunchEnd The tmLunchEnd to set */ public void setTmLunchEnd(String tmLunchEnd); /** * Sets the tmLunchStart. * @param tmLunchStart The tmLunchStart to set */ public void setTmLunchStart(String tmLunchStart); /** * Sets the tmWorkEnd. * @param tmWorkEnd The tmWorkEnd to set */ public void setTmWorkEnd(String tmWorkEnd); /** * Sets the tmWorkStart. * @param tmWorkStart The tmWorkStart to set */ public void setTmWorkStart(String tmWorkStart); /** * Returns the actsWorkerEntityBean. * @return ActsWorkerEntityBean */ public ActsWorkerEntityBean getActsWorkerEntityBean(); /** * Sets the actsWorkerEntityBean. * @param actsWorkerEntityBean The actsWorkerEntityBean to set */ public void setActsWorkerEntityBean(ActsWorkerEntityBean actsWorkerEntityBean); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface WorkService {\n}", "public interface Worker {\n\n\tvoid activate(String filteredClassValue);\n\n\tvoid stop();\n\n}", "public interface WorkConsumerService{\n\n /**\n * Consumes a single work unit.\n * <p>\n * Blocks for 15 s or until a work unit becomes consumable, if there is currently none. \n * \n */\n void consumeWorkUnit();\n\n /**\n * Returns the total number of consumed work units by the engine instance at hand since\n * the engine's last deployment.\n */\n long getConsumedWorkUnits();\n\n}", "public interface WorkerService {\n\n boolean statusWriteBack(@Nullable Worker worker, @Nullable String taskId);\n}", "public interface WorkManager extends InitBean, DestroyBean {\r\n\r\n\t/**\r\n\t * This method allow you to assign given work to a worker available if no\r\n\t * Worker is available then it will create new and assign to the worker.\r\n\t * \r\n\t * @param work\r\n\t */\r\n\tvoid allocateWorker(Work work);\r\n\r\n\t/**\r\n\t * This method will release all workers registered under this maager.\r\n\t */\r\n\tvoid releaseAllWorkers();\r\n\r\n\t/**\r\n\t * This method will release the @param worker registered with this Manager.\r\n\t * \r\n\t * @param worker\r\n\t */\r\n\tvoid releaseWorker(Worker worker);\r\n\r\n\t/**\r\n\t * This method will register the @param worker passed to it with the\r\n\t * Manager.\r\n\t * \r\n\t * @param worker\r\n\t */\r\n\tvoid registerWorker(Worker worker);\r\n\r\n\t/**\r\n\t * This method allow you to assign given work to a deamon worker available\r\n\t * if no deamon Worker is available then it will create new and assign to\r\n\t * the worker.\r\n\t * \r\n\t * @param work\r\n\t */\r\n\tvoid allocateDeamonWorker(Work work);\r\n\r\n\t/**\r\n\t * This will return number of worker created using this manager.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tint numberOfWorkers();\r\n\r\n\t/**\r\n\t * This will return number of working workers.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tint numberOfWorkingWorkers();\r\n}", "@Override\n\tpublic void myWork() {\n\t\t\n\t}", "public interface CompensatableWork {\n\n /**\n * A method implementing work which can be confirmed and/or compensated by ConfirmationHandler and CompensationHandler.\n */\n void execute();\n\n}", "public ServiceExampleWorker() {\n super(\"ServiceExampleWorker\");\n shouldExecute = true;\n messageBinder = new IMessageBinder.Stub() {\n private List<ISubscriber> subscriberList = new ArrayList<>();\n\n @Override\n public void addSubscriber(ISubscriber subscriber) throws RemoteException {\n subscriberList.add(subscriber);\n }\n\n @Override\n public void removeSubscriber(ISubscriber subscriber) throws RemoteException {\n subscriberList.remove(subscriber);\n }\n\n @Override\n public void sendUpdate(String data) throws RemoteException {\n for (ISubscriber subscriber : subscriberList) {\n subscriber.send(data);\n }\n }\n\n @Override\n public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {\n\n }\n };\n }", "public interface ISimpleWorkExecManager extends IAsyncWorkExecManager<IAsyncWorker, IAsyncWorker>\n{\n\n\tpublic static final ISimpleWorkExecManager INSTANCE = new SimpleWorkExecManagerImpl();\n}", "public interface IJobService {\n\n void process();\n\n}", "public interface JobManager {\n /**\n * Add a job to the execution queue.\n * @param job encapsulation of the execution data.\n * @return the unique id of the job.\n */\n String submitJob(JPPFJob job);\n\n /**\n * Add a task job to the execution queue.\n * @param job encapsulation of the execution data.\n * @param listener an optional listener to receive job status change notifications, may be null.\n * @return the unique id of the job.\n */\n String submitJob(JPPFJob job, JobStatusListener listener);\n\n /**\n * Add an existing job back into the execution queue.\n * @param job encapsulation of the execution data.\n * @return the unique id of the job.\n */\n String resubmitJob(JPPFJob job);\n\n /**\n * Determine whether there is a client connection available for execution.\n * @return true if at least one connection is available, false otherwise.\n */\n boolean hasAvailableConnection();\n\n /**\n * Determine whether local execution is enabled on this client.\n * @return <code>true</code> if local execution is enabled, <code>false</code> otherwise.\n */\n boolean isLocalExecutionEnabled();\n\n /**\n * Specify whether local execution is enabled on this client.\n * @param localExecutionEnabled <code>true</code> to enable local execution, <code>false</code> otherwise\n */\n void setLocalExecutionEnabled(final boolean localExecutionEnabled);\n\n /**\n * Get the list of available connections.\n * @return a vector of connections instances.\n */\n Vector<JPPFClientConnection> getAvailableConnections();\n\n /**\n * Get a listener to the status of the managed connections.\n * @return a {@link ClientConnectionStatusListener} instance.\n */\n ClientConnectionStatusListener getClientConnectionStatusListener();\n\n /**\n * Close this job manager and all the resources it uses.\n */\n void close();\n\n /**\n * Reset this job manager.\n */\n void reset();\n\n /**\n * Cancel the job with the specified id.\n * @param jobId the id of the job to cancel.\n * @return a <code>true</code> when cancel was successful <code>false</code> otherwise.\n * @throws Exception if any error occurs.\n */\n boolean cancelJob(String jobId) throws Exception;\n\n /**\n * Get the current load-balancer settings.\n * @return a {@link LoadBalancingInformation} instance, which encapsulates a load-balancing alfgorithm name, along with its parameters.\n */\n public LoadBalancingInformation getLoadBalancerSettings();\n\n /**\n * Change the load balancer settings for the client.\n * @param algorithm the name of load-balancing alogrithm to use.\n * @param parameters the algorithm's parameters, if any. The parmeter names are assumed no to be prefixed.\n * @throws Exception if any error occurs or if the algorithm name is {@code null} or not known.\n */\n public void setLoadBalancerSettings(final String algorithm, final Properties parameters) throws Exception;\n}", "public void createWorker(Worker worker){\n }", "worker(long workOn) {\n this.workOn = workOn;\n }", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "public interface ExecutorService {\n\n\n /**\n * beat 心跳\n * @return\n */\n public ReturnT<String> beat();\n\n\n public ReturnT<String> idleBeat(int jobId);\n\n\n /**\n * kill 掉某个job\n * @param jobId\n * @return\n */\n public ReturnT<String> kill(int jobId);\n\n\n /**\n * 记录掉某个日志\n * @param logDateTim\n * @param logId\n * @param fromLineNum\n * @return\n */\n public ReturnT<LogResult> log(long logDateTim, int logId, int fromLineNum);\n\n\n /**\n * 执行某个任务\n * @param triggerParam\n * @return\n */\n public ReturnT<String> run(TriggerParam triggerParam);\n\n}", "public interface Work {\n}", "public interface Master extends Runnable{\n\n /**\n * bind port and begin to accept request\n */\n void bind(WorkerPool workerPool);\n\n /**\n * handle the income requests ,accept and register to worker thread\n */\n void handleRequest();\n}", "public abstract String getWorkerName();", "void consumeWorkUnit();", "public String getWorker() {\r\n\t\treturn \"\" + name + \" : \" + execAction();\t\t\t // a worker operates\r\n\t}", "public abstract ScheduledExecutorService getWorkExecutor();", "public interface IJobshelper {\n\n\t/**\n\t * Can do some initialization for task like file location, Emailer list, Emailer\n\t * message etc This is used to set some configuration for this Job and should be\n\t * using some properties file so that each Job could use specific configuration\n\t * \n\t * @throws JobExecutionException\n\t */\n\tpublic void initialJobContext(String configFileName) throws JobExecutionException;\n\n}", "public interface WorkerListener {\n /**\n * Notifies the listener about successful completion of the auction.\n * @param result result of the auction evaluation.\n * @param clientId id of the client, who won the auction.\n */\n public void onCompletion(Auction.AuctionResult result, int clientId);\n\n /**\n * Notifies the listener about an error, which occurred during the auction.\n * @param errorMessage error message.\n */\n public void onError(String errorMessage);\n}", "public interface Worker extends WorkerModel, PersistedModel {\n /*\n * NOTE FOR DEVELOPERS:\n *\n * Never modify this interface directly. Add methods to {@link com.liferay.docs.servicebuilder.model.impl.WorkerImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.\n */\n}", "@Override\n public void canWorkerRun(Map<Class<?>, Object> ejbs) throws ServiceExecutionFailedException {\n }", "GetWorkerResult getWorker(GetWorkerRequest getWorkerRequest);", "public interface ICompilerWorker extends IWorker {\n}", "public interface IWorker {\n void work() throws IOException;\n}", "public interface BINHaystackWorkerParent extends BInterface\n{\n public static final Type TYPE = Sys.loadType(BINHaystackWorkerParent.class);\n\n /**\n * Handle a network exception that occured when running a chore.\n */\n public void handleNetworkException(WorkerChore chore, CallNetworkException e);\n\n public BStatus getStatus();\n}", "public interface Manager<W extends Worker> extends Runnable {\n\n /**\n * This method should be called whenever we expect this manager to shut itself and\n * all its spawned processes down\n */\n void shutdown();\n\n /**\n * This method is called by a worker within its bounds to signify that\n * the given worker has completed its work and can now be assigned new tasks\n * @param worker the worker\n */\n void done(W worker);\n\n /**\n * Works just like {@link #done(Worker)} but signals that the assigned task was not\n * successfully performed\n * @param worker the worker\n */\n void fail(W worker);\n\n /**\n * This will signal the manager that a worker was interrupted. It is up to the manager to\n * decide whether this was intentional or by mistake\n * @param worker the worker that was interrupted\n */\n void interrupted(W worker);\n\n}", "public interface Worker {\n /**\n * Execute some code\n */\n void doWork();\n}", "public interface Job {\n\n public enum Status {\n IDLE,\n RUNNING,\n SUCCESS,\n ERROR,\n FAIL\n }\n\n /**\n * @return the job ID.\n */\n public default JobId getId() {\n return getContext().getId();\n }\n\n /**\n * @return the job status\n */\n public Status getStatus();\n\n /**\n * @return the job priority\n */\n public Priority getPriority();\n\n /**\n * @return The context of this job.\n */\n public JobContext getContext();\n\n /**\n * Run the job using the {@link XProcEngine}.\n */\n public void run(XProcEngine engine);\n\n}", "void setTechStuff(com.hps.july.persistence.Worker aTechStuff) throws java.rmi.RemoteException;", "public WorkerController(){\r\n\t}", "public CoreWorker getCoreWorker(String worker){ \n\t if(worker == null){ \n\t return null; \n\t } \n\t if(worker.equalsIgnoreCase(\"Controller\")) { \n\t return new WHControllerDAO(); \n\t } \n\t else if(worker.equalsIgnoreCase(\"Action\")){ \n\t return new ActionDAO(); \n\t } \n\t return null; \n\t }", "public void work() {\n\t}", "public void work() {\n\t}", "@WorkerThread\n public abstract void zzaso();", "public interface Work {\n \n public static final int UNDETERMINED_AMOUNT = -1;\n \n /**\n * Calling this method causes the work to be performed, similar to run() in Runnable.\n * The implementation of this method must regularly call mayContinue()\n * on its ContinuationArbiter, and terminate ASAP if it returns false.\n *\n * The Work may receive an InterruptedException if it is aborted during execution.\n * is free to throw an InterruptedException if it is interrupted\n * (wich will be ignored), or it may catch the exception and exit nicely.\n */\n public void execute() throws InterruptedException;\n \n /**\n * The WorkManager will call this method to designate a ContinuationArbiter \n * to the Work before it executes the Work. The Work must then use that \n * arbiter regularly during execution to ask if it may continue \n * and to signal progress.\n * The Work must make sure that calls to the arbiter occur only in the execution Thread.\n *\n * @post The Work only calls mayContinue on the designated ContinuationArbiter.\n */\n public void setContinuationArbiter(ContinuationArbiter arbiter);\n \n /**\n * Returns a description of the work (to be shown in the GUI).\n * WorkManager will only call this method on the same thread as execute, \n * so it is not required to make this method threadsafe with regard to execute.\n */\n public String getDescription();\n \n /**\n * Returns the total amount of Work to be done.\n * Note that the WorkManager expects an amount of work has been done\n * on each call of mayContinue().\n * Must return a positive integer value or UNDETERMINED_AMOUNT.\n * WorkManager will only call this method on the same thread as execute, \n * so it is not required to make this method threadsafe with regard to execute.\n */\n public int getTotalAmount();\n \n /**\n * Returns the amount of Work that has been done already.\n * Must return a positive integer value or UNDETERMINED_AMOUNT.\n * WorkManager will only call this method on the same thread as execute, \n * so it is not required to make this method threadsafe with regard to execute.\n */\n public int getAmountDone();\n \n /**\n * Returns whether this work can cope with interrupts when an abort is requested.\n * If false, the Work will not receive interrupts from the WorkManager, and \n * the only effect of an abort will be that mayContinue returns false.\n */\n public boolean isInterruptible();\n \n /**\n * Returns whether this work can be aborted by the user.\n * This is only reflected in the GUI. Programs can always (try to) abort a Work, \n * regardless of the value of the abortable property.\n * Aborting a Work only has effect when the work calls mayContinue()\n * (which will return false) or while it is waiting (it will be interrupted).\n */\n public boolean isAbortable();\n \n /**\n * Returns whether this work can be paused by the user.\n * This is only reflected in the GUI. Programs can always (try to) pause a Work, \n * regardless of the value of the pausable property.\n * Aborting a Work only has effect when the work calls mayContinue(),\n * which will not return until the Work is unpaused.\n */\n public boolean isPausable();\n}", "public interface BaseJob {\n Object start();\n\n Object initJob(Map<String, Object> param);\n\n Object stop();\n}", "public interface ExecutionContext {\n}", "abstract void doJob();", "public interface JobService {\n boolean registerJob(Job job);\n\n boolean deleteJob(String domain, String jobId);\n\n List<JobWrapper> listJob(String domain);\n\n JobWrapper readJob(String domain, String jobId);\n\n NodeResult readNodeResult(String domain, String jobId, String ip);\n\n boolean runJob(String domain, String jobId);\n\n}", "public interface SchedulerProvider {\n Scheduler background();\n Scheduler ui();\n}", "@Override // ohos.workscheduler.IWorkScheduler\r\n /* Code decompiled incorrectly, please refer to instructions dump. */\r\n public boolean sendRemote(ohos.rpc.IRemoteObject r5) throws ohos.rpc.RemoteException {\r\n /*\r\n r4 = this;\r\n ohos.rpc.MessageParcel r4 = ohos.rpc.MessageParcel.obtain()\r\n ohos.rpc.MessageParcel r0 = ohos.rpc.MessageParcel.obtain()\r\n ohos.rpc.MessageOption r1 = new ohos.rpc.MessageOption\r\n r2 = 0\r\n r1.<init>(r2)\r\n java.lang.String r3 = \"ohos.workscheduler.IWorkScheduler\"\r\n boolean r3 = r4.writeInterfaceToken(r3) // Catch:{ RemoteException -> 0x0033 }\r\n if (r3 != 0) goto L_0x001d\r\n L_0x0016:\r\n r4.reclaim()\r\n r0.reclaim()\r\n return r2\r\n L_0x001d:\r\n boolean r3 = r4.writeRemoteObject(r5)\r\n if (r3 != 0) goto L_0x0024\r\n goto L_0x0016\r\n L_0x0024:\r\n r3 = 4\r\n boolean r5 = r5.sendRequest(r3, r4, r0, r1)\r\n if (r5 == 0) goto L_0x003c\r\n int r5 = r0.readInt()\r\n r2 = r5\r\n goto L_0x003c\r\n L_0x0031:\r\n r5 = move-exception\r\n goto L_0x004c\r\n L_0x0033:\r\n ohos.hiviewdfx.HiLogLabel r5 = ohos.workscheduler.WorkSchedulerProxy.LOG_LABEL // Catch:{ all -> 0x0031 }\r\n java.lang.String r1 = \"RemoteException\"\r\n java.lang.Object[] r3 = new java.lang.Object[r2] // Catch:{ all -> 0x0031 }\r\n ohos.hiviewdfx.HiLog.error(r5, r1, r3) // Catch:{ all -> 0x0031 }\r\n L_0x003c:\r\n r4.reclaim()\r\n r0.reclaim()\r\n if (r2 != 0) goto L_0x0046\r\n r4 = 1\r\n return r4\r\n L_0x0046:\r\n ohos.rpc.RemoteException r4 = new ohos.rpc.RemoteException\r\n r4.<init>()\r\n throw r4\r\n L_0x004c:\r\n r4.reclaim()\r\n r0.reclaim()\r\n throw r5\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: ohos.workscheduler.WorkSchedulerProxy.sendRemote(ohos.rpc.IRemoteObject):boolean\");\r\n }", "Value worker(String main, String address);", "public void scheduleJobs();", "@Override // ohos.workscheduler.IWorkScheduler\r\n /* Code decompiled incorrectly, please refer to instructions dump. */\r\n public void onWorkStart(ohos.workscheduler.WorkInfo r6) throws ohos.rpc.RemoteException {\r\n /*\r\n r5 = this;\r\n ohos.rpc.MessageParcel r0 = ohos.rpc.MessageParcel.obtain()\r\n ohos.rpc.MessageParcel r1 = ohos.rpc.MessageParcel.obtain()\r\n ohos.rpc.MessageOption r2 = new ohos.rpc.MessageOption\r\n r3 = 0\r\n r2.<init>(r3)\r\n java.lang.String r4 = \"ohos.workscheduler.IWorkScheduler\"\r\n boolean r4 = r0.writeInterfaceToken(r4)\r\n if (r4 != 0) goto L_0x001d\r\n r0.reclaim()\r\n r1.reclaim()\r\n return\r\n L_0x001d:\r\n r0.writeSequenceable(r6) // Catch:{ RemoteException | ParcelException -> 0x0031 }\r\n ohos.rpc.IRemoteObject r5 = r5.remote // Catch:{ RemoteException | ParcelException -> 0x0031 }\r\n r6 = 1\r\n boolean r5 = r5.sendRequest(r6, r0, r1, r2) // Catch:{ RemoteException | ParcelException -> 0x0031 }\r\n if (r5 == 0) goto L_0x003a\r\n int r5 = r1.readInt() // Catch:{ RemoteException | ParcelException -> 0x0031 }\r\n r3 = r5\r\n goto L_0x003a\r\n L_0x002f:\r\n r5 = move-exception\r\n goto L_0x0049\r\n L_0x0031:\r\n ohos.hiviewdfx.HiLogLabel r5 = ohos.workscheduler.WorkSchedulerProxy.LOG_LABEL // Catch:{ all -> 0x002f }\r\n java.lang.String r6 = \"onWorkStart Exception\"\r\n java.lang.Object[] r2 = new java.lang.Object[r3] // Catch:{ all -> 0x002f }\r\n ohos.hiviewdfx.HiLog.error(r5, r6, r2) // Catch:{ all -> 0x002f }\r\n L_0x003a:\r\n r0.reclaim()\r\n r1.reclaim()\r\n if (r3 != 0) goto L_0x0043\r\n return\r\n L_0x0043:\r\n ohos.rpc.RemoteException r5 = new ohos.rpc.RemoteException\r\n r5.<init>()\r\n throw r5\r\n L_0x0049:\r\n r0.reclaim()\r\n r1.reclaim()\r\n throw r5\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: ohos.workscheduler.WorkSchedulerProxy.onWorkStart(ohos.workscheduler.WorkInfo):void\");\r\n }", "void allocateWorker(Work work);", "@Override\r\n\tpublic void executer() {\n\t}", "public Worker(){\n\n }", "public interface LongProcessOperations \n{\n ServoConRemote.LongProcessPackage.Status Completed ();\n\n //message is empty on success\n String Message ();\n double Progress ();\n void Detach ();\n}", "com.hps.july.persistence.Worker getTechStuff() throws java.rmi.RemoteException, javax.ejb.FinderException;", "@MBean(objectName = \"MassIndexer\",\n description = \"Component that rebuilds the index from the cached data\")\npublic interface MassIndexer {\n\n //TODO Add more parameters here, like timeout when it will be implemented\n //(see ISPN-1313, and ISPN-1042 for task cancellation)\n @ManagedOperation(description = \"Starts rebuilding the index\", displayName = \"Rebuild index\")\n void start();\n\n}", "@javax.ejb.Remote\npublic interface EjbApi\n{\n public String compute( String d1, String d2 );\n}", "public abstract String getWorkerString();", "public interface Service extends Runnable {\n\n}", "public interface Executor {\n void setTask(Task task);\n Task getTask();\n void startTask();\n}", "public abstract void engineWork() throws Exception;", "public RunProcDefJob() {\n\t}", "public interface WorkflowExecutionListener {}", "public InstrumentedWorkerTask(gw.pl.persistence.core.BundleProvider bundleProvider) {\n this((java.lang.Void)null);\n com.guidewire.pl.system.entity.proxy.BeanProxy.initNewBeanInstance(this, bundleProvider.getBundle(), java.util.Arrays.asList());\n }", "public interface MainUpdateInteractor {\n void execute();\n}", "public interface AttachmentNames\n{\n // ------------------------------------------------------------------------------||\n // Contracts --------------------------------------------------------------------||\n // ------------------------------------------------------------------------------||\n \n /**\n * Name of the asynchronous {@link ExecutorService} used to process incoming\n * async invocations\n */\n String ASYNC_INVOCATION_PROCESSOR = \"org.jboss.ejb3.async.\" + ExecutorService.class.getSimpleName();\n}", "public interface SchedulerService {\n\n /**\n * Schedule cron jobs.\n */\n void scheduleCronJobs() throws WorkflowException;\n\n}", "private void scheduleJob() {\n\n }", "public interface TaskStartHandler2 {\n\n Object process(OperationContext context);\n}", "WorkingTask getWorkingTask();", "public interface UndecoratedWorker {\r\n\r\n /**\r\n * Checks if the worker can move to a specific <code>Tile</code>.\r\n * @param t Variable that indicates the <code>Tile</code> at issue.\r\n * @return A boolean: <code>true</code> if the \"move\" operation is available, otherwise <code>false</code>.\r\n */\r\n boolean canMove(Tile t);\r\n\r\n /**\r\n * Handles the \"move\" operation of the worker.\r\n * @param t Variable that indicates the <code>Tile</code> at issue.\r\n */\r\n void move(Tile t);\r\n\r\n /**\r\n * Checks if the worker can build a block on a specific <code>Tile</code>.\r\n * @param t Variable that indicates the <code>Tile</code> at issue.\r\n * @return A boolean: <code>true</code> if the \"build\" operation is available, otherwise <code>false</code>.\r\n */\r\n boolean canBuildBlock(Tile t);\r\n\r\n /**\r\n * Handles the \"build block\" operation of the worker.\r\n * @param t Variable that indicates the <code>Tile</code> at issue.\r\n */\r\n void buildBlock(Tile t);\r\n\r\n /**\r\n * Checks if the worker can build a dome on a specific <code>Tile</code>.\r\n * @param t Variable that indicates the <code>Tile</code> at issue.\r\n * @return A boolean: <code>true</code> if the \"build dome\" operation is available, otherwise <code>false</code>.\r\n */\r\n boolean canBuildDome(Tile t);\r\n\r\n /**\r\n * Handles the \"build dome\" operation of the worker.\r\n * @param t Variable that indicates the <code>Tile</code> at issue.\r\n */\r\n void buildDome(Tile t);\r\n\r\n /**\r\n * Gets the position of the worker at issue.\r\n * @return The <code>Tile</code> where the worker is positioned upon.\r\n */\r\n Tile getPosition();\r\n\r\n /**\r\n * Sets the position of a worker in a specified <code>Tile</code>.\r\n * @param t The destination <code>Tile</code> where the worker must be put on.\r\n */\r\n void setPosition(Tile t);\r\n\r\n /**\r\n * Checks the GodPower of the worker associated.\r\n * @return A boolean: <code>true</code> if GodPower at issue is active,\r\n * otherwise <code>false</code>.\r\n */\r\n boolean getGodPower();\r\n\r\n /**\r\n * Sets the GodPower of the worker associated.\r\n * @param b A boolean: <code>true</code> if the GodPower at issue is active,\r\n * otherwise <code>false</code>.\r\n */\r\n void setGodPower(boolean b);\r\n\r\n /**\r\n * Gets the particular conditions of specific Gods.\r\n * @return The conditions class is where the info about particular conditions of specific Gods\r\n * is stored.\r\n */\r\n Conditions getConditions();\r\n\r\n /**\r\n * Handles the use of the GodPower of specific Gods.\r\n * @param use A boolean: <code>true</code> if the worker activates a particular condition,\r\n * otherwise <code>false</code>.\r\n */\r\n void useGodPower(boolean use);\r\n\r\n /**\r\n * Checks which player the worker at issue is associated to.\r\n * @return An integer that represents the player ID which the worker is associated with.\r\n */\r\n int getBelongToPlayer();\r\n\r\n /**\r\n * Check if any winning condition is satisfied.\r\n * <p></p>\r\n * The main win condition is for the worker of the player to \"move\" from a level 2 block to a level 3 block.\r\n * <p></p>\r\n * @param initialTile Variable that represents the initial <code>Tile</code> of the \"move\" operation.\r\n * @return A boolean: <code>true</code> if any winning condition is satisfied,\r\n * otherwise <code>false</code>.\r\n */\r\n boolean checkWin(Tile initialTile);\r\n\r\n /**\r\n * Brings the worker to the next state in the turn.\r\n */\r\n void nextState();\r\n\r\n /**\r\n * Sets the worker to a particular state in the turn.\r\n * @param state Variable that represents the index of the state in the turn.\r\n * <p>\r\n * If index equals 0: waiting;\r\n * <p>\r\n * If index equals 1: moving;\r\n * <p>\r\n * If index equals 2: building;\r\n * <p>\r\n * If index equals 3: using another worker;\r\n * <p>\r\n */\r\n void setState(int state);\r\n\r\n /**\r\n * Gets the state in the specified turn.\r\n * @return An integer that represents the number of the state in the turn.\r\n * <p>\r\n * If index equals 0: waiting;\r\n * <p>\r\n * If index equals 1: moving;\r\n * <p>\r\n * If index equals 2: building;\r\n * <p>\r\n * If index equals 3: using another worker;\r\n * <p>\r\n */\r\n int getState();\r\n\r\n /**\r\n * Analyzes all the adjacent tiles near the position of the worker.\r\n * @return A list of all the adjacent tiles near the position of the worker.\r\n */\r\n List<Tile> getAdjacentTiles();\r\n\r\n}", "public interface JobScheduleService {\n void addJobScheduleHistory(JobContext jobInfo, ScheduleStatusEnum scheduleStatus);\n}", "void allocateDeamonWorker(Work work);", "public interface WorkloadManagementService\n{\n /**\n * @return for a given project a WorkloadManager object. Also applicable for older INCEpTION\n * version where the workload feature was not present. Also, if no entity can be found,\n * a new entry will be created and returned.\n * @param aProject\n * a project\n */\n WorkloadManager loadOrCreateWorkloadManagerConfiguration(Project aProject);\n\n WorkloadManagerExtension<?> getWorkloadManagerExtension(Project aProject);\n\n void saveConfiguration(WorkloadManager aManager);\n\n List<AnnotationDocument> listAnnotationDocumentsForSourceDocumentInState(\n SourceDocument aSourceDocument, AnnotationDocumentState aState);\n\n Long getNumberOfUsersWorkingOnADocument(SourceDocument aDocument);\n}", "@Override\n\tpublic void submitJobEmployee(int je_id, String caller) {\n\n\t}", "public interface WorkerJvmStateService {\n\n Boolean insert(WorkerJvmStateInfo jvmMonitorInfo);\n\n List<WorkerJvmStateInfo> getLatestList();\n\n WorkerJvmStateInfo getLatestByWorkerId(Long workerId);\n\n List<WorkerJvmStateInfo> getListByWorkerIdForQuery(@Param(\"workerId\") Long workerId, @Param(\"startTime\") Date startTime, @Param(\"endTime\") Date endTime);\n}", "public interface CSCallBack {\n public void process(String status);\n}", "void secondarySetTechStuff(com.hps.july.persistence.Worker aTechStuff) throws java.rmi.RemoteException;", "public Worker<Void> getLoadWorker();", "public Job getJob();", "public interface Job {\n\n /** unique id for this job that is used as a reference in the service methods */\n String getId();\n\n /** job executor identification that has acquired this job and is going to execute it */\n String getLockOwner();\n\n /** in case this is a timer, it is the time that the timer should fire, in case this \n * is a message, it is null. */\n Date getDueDate();\n\n /** in case this is a timer, it is the time that the timer should fire, in case this \n * is a message, it is null.\n * @deprecated call {@link #getDueDate()} instead */\n @Deprecated\n Date getDuedate();\n\n /** exception that occurred during the last execution of this job. The transaction \n * of the job execution is rolled back. A synchronization is used to create \n * a separate transaction to update the exception and decrement the retries. */\n String getException();\n\n /** number of retries left. This is only decremented when an exception occurs during job \n * execution. The transaction of the job execution is rolled back. A synchronization is used to create \n * a separate transaction to update the exception and decrement the retries. */\n int getRetries();\n\n /** indicates if this job should be executed separate from any other job \n * in the same process instance */\n boolean isExclusive();\n\n /** the related execution */\n Execution getExecution();\n\n /** the related process instance */\n Execution getProcessInstance();\n\n Date getLockExpirationTime();\n\n}", "public String get_worker() {\n return this._worker;\n }", "public interface Scheduler {\n\n void schedule();\n\n}", "public interface CommonDispatcher extends javax.ejb.EJBObject {\n\t\n\t/**\n\t * An example business method\n\t * \n\t * @throws EJBException\n\t * Thrown if method fails due to system-level error.\n\t */\n\tpublic DataHolder processRequest(DataHolder indataholder) throws java.rmi.RemoteException;\n\tpublic ProcessResult processRequest(VTObject inputDTO) throws java.rmi.RemoteException;\n\t//public DataHolder processRequest(DataHolder indataholder) throws java.rmi.RemoteException;\n}", "public interface Executor<Work extends Runnable> {\n void execute(Work work);\n\n void shutdown();\n\n void addWorks(Work work);\n\n void removeWorks(int num);\n\n int getWorkSize();\n}", "protected String xCB() { return ScheduledJobCB.class.getName(); }", "public interface SchedulerProvider {\n\n Scheduler ui();\n\n Scheduler computation();\n\n Scheduler io();\n\n}", "interface Workshop{\n\tabstract public void work();\n}", "@Override\n public String getType() {\n return Const.JOB;\n }", "void work();", "public interface BeanInvoker<T> {\n\n default void invoke(T param) throws Exception {\n ManagedContext requestContext = Arc.container().requestContext();\n if (requestContext.isActive()) {\n invokeBean(param);\n } else {\n try {\n requestContext.activate();\n invokeBean(param);\n } finally {\n requestContext.terminate();\n }\n }\n }\n\n void invokeBean(T param) throws Exception;\n\n}", "BackgroundWorker (String page, String name, String type, Context context) {this.page=page; this.name=name; this.type=type; this.context=context; flag=2;}", "public interface Constellation {\n\n /**\n * Submit an activity.\n *\n * The submitted Activity will be inserted into Constellation and executed if and when a suitable Executor is found. An\n * ActivityIdentifier is returned that can be used to refer to this submitted Activity at a later moment in time.\n *\n * It is up to the user to make sure that this constellation instance has a suitable executor, or, if the contexts don't\n * match, an executor that can be stolen from. In some cases, the system can detect that no suitable executor can be found. In\n * those cases, it throws an exception.\n *\n * @param activity\n * the Activity to submit\n * @exception NoSuitableExecutorException\n * is thrown when the system has detected that no suitable executor can be found.\n * @return ActivityIdentifier that can be used to refer to the submitted Activity.\n */\n public ActivityIdentifier submit(Activity activity) throws NoSuitableExecutorException;\n\n /**\n * Send an event.\n *\n * @param e\n * the Event to send.\n */\n public void send(Event e);\n\n /**\n * Activate this Constellation implementation.\n *\n * Constellation instances start out in in inactive state when they are created. This allows the application to configure\n * Constellation (for example, by setting up the desired combination of distributed and local constellation instances).\n *\n * Upon activation, the Constellation instance will activate all sub-constellations, and activate its own executors, steal\n * pools, event queues, etc.\n *\n * @return if the Constellation was activated.\n */\n public boolean activate();\n\n /**\n * Terminate Constellation.\n *\n * When terminating all sub-constellations will be terminated. Termination may also block until all other running\n * constellation instances in a Pool have also decided to terminate.\n */\n public void done();\n\n /**\n * Returns <code>true</code> if this Constellation instance is the master, <code>false</code> otherwise.\n *\n * @return whether this Constellation instance is the master.\n */\n public boolean isMaster();\n\n /**\n * Returns a unique identifier for this Constellation instance.\n *\n * This identifier can be used to uniquely refer to a running Constellation instance.\n *\n * @return a string that uniquely identifies this Constellation instance.\n */\n public ConstellationIdentifier identifier();\n\n /**\n * Creates a {@link Timer} with the specified device, thread, and action name.\n *\n * @param device\n * the device name\n * @param thread\n * the thread name\n * @param action\n * the action name\n * @return the Timer object\n */\n public Timer getTimer(String device, String thread, String action);\n\n /**\n * Creates a {@link Timer} without device, thread, or action name.\n *\n * @return the Timer object\n */\n public Timer getTimer();\n\n /**\n * Returns the overall timer.\n *\n * This timer needs to be started and stopped by the main program.\n *\n * @return the overall timer.\n */\n public Timer getOverallTimer();\n}", "public interface Executor<E>{\n\t\tvoid execute(E object);\n\t}", "public GetJobs() {\r\n\t\tsuper();\r\n\t}", "public interface ITask extends PropertyChangeListener{\n\tvoid execute();\n\tvoid interrupt();\n\tboolean toBeRemoved();\n\n\t//Using update tick\n\tboolean updateTick();\n\n\t//Using time\n\t//long getWaittime();\n\t//long getEndtime();\n\n\n}", "public interface PostExecutionThread {\n Scheduler getScheduler();\n}", "public interface PostExecutionThread {\n Scheduler getScheduler();\n}", "public interface PostExecutionThread {\n Scheduler getScheduler();\n}", "public interface SchedulerProvider {\r\n\r\n Scheduler computation();\r\n\r\n Scheduler io();\r\n\r\n Scheduler ui();\r\n}", "protected abstract void work();" ]
[ "0.70601654", "0.69669116", "0.6927135", "0.6858945", "0.6764302", "0.6448627", "0.6422548", "0.6372248", "0.6350892", "0.6331331", "0.6298812", "0.6235078", "0.62081105", "0.6198998", "0.6198998", "0.6147439", "0.6146071", "0.6132504", "0.6122055", "0.61195976", "0.61022764", "0.60894954", "0.6084514", "0.6083947", "0.6040499", "0.6029626", "0.60058516", "0.6005238", "0.59973377", "0.59873533", "0.5974165", "0.59429044", "0.59318215", "0.5920072", "0.58874965", "0.5886826", "0.58655024", "0.58655024", "0.5862126", "0.585561", "0.58423394", "0.58360225", "0.5823078", "0.58191043", "0.58176756", "0.5817512", "0.58118206", "0.5810725", "0.580814", "0.57900435", "0.5785005", "0.5784997", "0.57723445", "0.57667184", "0.5756075", "0.57467705", "0.5746298", "0.5742007", "0.57365525", "0.5735556", "0.57339686", "0.5732601", "0.57147014", "0.57137513", "0.56968147", "0.56963634", "0.5691303", "0.5661846", "0.5659919", "0.56533957", "0.5645964", "0.56437063", "0.5642804", "0.56414247", "0.5637155", "0.56345266", "0.5632574", "0.5630182", "0.56284416", "0.56248546", "0.56114686", "0.5601417", "0.5594326", "0.55911744", "0.55888975", "0.55820125", "0.55761015", "0.5568425", "0.5561183", "0.5560809", "0.55576956", "0.55509454", "0.554632", "0.5542251", "0.5536598", "0.5534008", "0.5534008", "0.5534008", "0.5530346", "0.55285645" ]
0.6898305
3
/ Based on the request message from client, respond in a particular way. Received requests can be: USER details related USERS ADD NAME HOST PORT > request the webserver to add a user (with name NAME) to the DB. USERS REQ > request the webserver a complete list of all users registered FILE details related (for each user) (try and deserialize it and see if it holds) > register given serialized TreeNode in the system. FILES REQ NAME > request TreeNode for NAME. USERS EXIT NAME > request the webserver to delete a user (with name NAME), as he is going to exit > also webserver will delete the TreeNode associated w/ NAME.
private byte[] getBytesToSendBack(ServerDataEvent dataEvent) { /* Default response. */ byte[] response = "ACK".getBytes(); /* First try and see if it's a TreeNode sent. */ TreeNode root = null; try { root = (TreeNode)SerializationHelper.deserialize(dataEvent.data); } catch (ClassNotFoundException | IOException e) {} /* If we've got a root, then we received a TreeNode register request. */ if (root != null) { String userName = root.toString(); logger.debug("Request received: TreeNode upload for " + userName); /* Adding as byte[] array is easier, as it doesn't require * serialization again for requests, just send it. */ dataEvent.server.addUserFiles(userName, dataEvent.data); } else { String request = new String(dataEvent.data); logger.debug("Request received: " + request); String[] strs = request.split(" "); if (strs[0].equals("USERS")) { if (strs[1].equals("ADD")) { assert(strs.length == 5); dataEvent.server.addUser(strs[2], strs[3], Integer.parseInt(strs[4])); } else if (strs[1].equals("REQ")) { response = dataEvent.server.getUsers().getBytes(); } else if (strs[1].equals("EXIT")) { assert(strs.length == 3); dataEvent.server.removeUser(strs[2]); dataEvent.server.removeUserFiles(strs[2]); } logger.debug("Users are: " + dataEvent.server.getUsers()); } else if(strs[0].equals("FILES")) { if (strs[1].equals("REQ")) { String userName = strs[2]; logger.debug("Server received FILES REQ for " + userName); response = dataEvent.server.getUserFiles(userName); } } } return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Message handleRequest(Message request){\n\n Message error = new Message(Message.GENERIC_ERROR);\n\n switch (request.getId()){\n\n case Message.LOGIN:\n return handleLogin(request);\n case Message.CREATE_DOCUMENT:\n return handleCreate(request);\n case Message.REMOVE_INVITE:\n controlServer.removeInvite(request.getUserName(),request.getDocumentName());\n return request;\n case Message.PORTIONS:\n System.out.println(\"HANDLER pre-handle: \" +request.getDocumentName());\n request.setSectionNumbers(controlServer.getPortions(request.getDocumentName()));\n return request;\n case Message.ADMINS:\n Message response = new Message(Message.ADMINS);\n response.setStringVector(new Vector<>(controlServer.getAdmins(request.getDocumentName())));\n return response;\n case Message.USERS:\n request.setStringVector(controlServer.getUserNames());\n return request;\n case Message.INVITATION:\n controlServer.addAdmin(request.getDocumentName(),request.getReceiver());\n controlServer.addInvite(request.getReceiver(),request.getDocumentName());\n request.setId(Message.INVITE_SENT);\n return request;\n case Message.GET_INVITES:\n String owner = request.getUserName();\n request.setStringVector(controlServer.getUserData(owner).getInvites());\n return request;\n case Message.GET_USERDATA:\n return handleGetUserData(request);\n case Message.LOCK:\n if(!controlServer.lock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.LOCK_NOK);\n else\n request.setId(Message.LOCK_OK);\n return request;\n case Message.UNLOCK:\n if(controlServer.unlock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.UNLOCK_OK);\n return request;\n case Message.EDIT:\n String DocumentName = request.getDocumentName();\n int SectionNumbers = request.getSectionNumbers();\n request.setText(controlServer.getSection(DocumentName,SectionNumbers));\n return request;\n case Message.END_EDIT:\n controlServer.editDoc(request.getDocumentName(),request.getSectionNumbers(),request.getText());\n return request;\n case Message.PRINT:\n request.setText(controlServer.getDocumentString(request.getDocumentName()));\n return request;\n case Message.SHOW:\n String text = controlServer.getSection(request.getDocumentName(),request.getSectionNumbers());\n request.setText(text);\n return request;\n default:\n controlServer.showMessage(\"unknown request\");\n break;\n }return error;\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n String userPath = request.getServletPath();\r\n\r\n // para probar la conexion al ejb\r\n if(userPath.equals(\"/empleados\")){\r\n obtenerEmpleados(request, response);\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/xml\");\r\n String departname = request.getParameter(\"deptname\");\r\n String type = request.getParameter(\"type\");\r\n // get department obj from name\r\n DepartInt dObj = new DepartImpl();\r\n Department deprtObj = new Department();\r\n deprtObj.setName(departname);\r\n List depts = dObj.getDepartByName(deprtObj);\r\n\r\n UserInt cObj=null;\r\n if(type.trim().equals(\"admin\") || type.trim().equals(\"staff\")) cObj = new StaffImpl();\r\n else cObj = new TraineeImpl();\r\n \r\n List users = cObj.GetAllUserDepartActive((Department) depts.get(0));\r\n System.out.println(\"Length=\"+users.size());\r\n PrintWriter out = response.getWriter();\r\n out.print(\"<users>\");\r\n for (int i = 0; i < users.size(); i++) {\r\n out.print(\"<user>\");\r\n out.print(\"<c_name>\");\r\n out.print(((User) users.get(i)).getName());\r\n out.print(\"</c_name>\");\r\n out.print(\"<pass>\");\r\n out.print(((User) users.get(i)).getPass());\r\n out.print(\"</pass>\");\r\n out.print(\"<email>\");\r\n out.print(((User) users.get(i)).getEmail());\r\n out.print(\"</email>\");\r\n out.print(\"<intake>\");\r\n out.print(((User) users.get(i)).getIntake());\r\n out.print(\"</intake>\");\r\n out.print(\"<isadmin>\");\r\n out.print(((User) users.get(i)).getIsAdmin());\r\n out.print(\"</isadmin>\");\r\n out.print(\"</user>\");\r\n }\r\n out.print(\"</users>\");\r\n }", "public void onlinerequest() {\r\n int size = Server.getUsers().size();\r\n \r\n try {\r\n this.output.flush();\r\n this.output.writeUTF(\"ONLINE\");\r\n this.output.flush();\r\n this.output.writeUTF(Integer.toString(size));\r\n this.output.flush();\r\n// Log.print(\"Sending the data\");\r\n for(int x = 0; x < Server.getUsers().size(); x++){\r\n if(Server.getUsers().get(x).getName().equals(this.name)){\r\n this.output.writeUTF(Server.getUsers().get(x).getName() + \" (You)\");\r\n }\r\n else{\r\n this.output.writeUTF(Server.getUsers().get(x).getName());\r\n this.output.flush();\r\n }\r\n \r\n \r\n }\r\n// Log.print(\"Successfully sent\");\r\n } catch (IOException ex) {\r\n Log.error(ex.getMessage());\r\n }\r\n }", "public void doGet(HttpServletRequest req, HttpServletResponse res)\n\t\t\tthrows ServletException, IOException {\n\t\tThread userSideCheck = new Thread(this);\n\t\t/*\n\t\t * starts thread that determines which users are no longer connected -\n\t\t * removes those users from the list\n\t\t */\n\t\tuserSideCheck.start();\n\n\t\tStringBuffer out = new StringBuffer(\"\");\n\t\tString[] messages = new String[chatData.size()];\n\t\tChatMessage temp;\n\t\t// get the session\n\t\tHttpSession session = req.getSession(true);\n\t\tString user = (String) session.getValue(\"com.mrstover.name\");\n\t\tint count = messages.length;\n\t\tString[] users;\n\t\tint x = 0;\n\n\t\t// set content type and other response header fields first\n\t\tres.setContentType(\"text/html\");\n\n\t\t// then write the data of the response\n\t\tout.append(\"<HEAD>\");\n\t\tout\n\t\t\t\t.append(\"<TITLE>ChatServlet Output </TITLE><META HTTP-EQUIV='Refresh'\"\n\t\t\t\t\t\t+ \" CONTENT='10;url=\"\n\t\t\t\t\t\t+ thisServlet\n\t\t\t\t\t\t+ \"'></HEAD>\"\n\t\t\t\t\t\t+ \"<BODY BGCOLOR='#FFFFFF'>\");\n\t\tout.append(\"<TABLE CELLPADDING=5 CELLSPACING=5 BORDER=0 WIDTH=700>\");\n\t\tout.append(\"<TR VALIGN='TOP'><TD WIDTH=50><TD WIDTH=300><TD WIDTH=80 \"\n\t\t\t\t+ \"ALIGN='CENTER' ROWSPAN=\" + (count + 1) + \">\"\n\t\t\t\t+ \"<FONT SIZE='+2'><B>Users</B></FONT><BR>\");\n\t\tusers = getUsers();\n\t\t// first, print column that holds names of all current users\n\t\twhile (x < users.length)\n\t\t\tout.append(users[x++] + \"<BR>\");\n\t\tout.append(\"</TD></TR>\");\n\t\t/*\n\t\t * write a row for each message, but only if current user is registered\n\t\t * as a reciever\n\t\t */\n\t\tif (user != null) {\n\n\t\t\twhile (--count >= 0) {\n\t\t\t\ttemp = (ChatMessage) chatData.elementAt(count);\n\t\t\t\tif (temp.checkReceiver(user))\n\t\t\t\t\tout.append(\"<TR VALIGN='TOP'><TD><B>\" + temp.getSender()\n\t\t\t\t\t\t\t+ \"</B></TD><TD>\" + temp.getMessage()\n\t\t\t\t\t\t\t+ \"</TD></TR>\");\n\t\t\t\telse if (temp.getSender().equals(user))\n\t\t\t\t\tout.append(\"<TR VALIGN='TOP'><TD><B>\" + temp.getSender()\n\t\t\t\t\t\t\t+ \"</B></TD><TD>\" + temp.getMessage()\n\t\t\t\t\t\t\t+ \"</TD></TR>\");\n\t\t\t}\n\t\t}\n\t\tout.append(\"</TABLE>\");\n\t\tout.append(\"<A NAME='bottom'></BODY></HTML>\");\n\t\toutputToBrowser(res, out.toString());\n\t}", "@Override\r\n\tprotected byte[] handleSpecificRequest(String request) {\r\n\t\tif (!Utils.isEmpty(request)) {\r\n\t\t\tlogger.info(\"$$$$$$$$$$$$Message received at Tracking Server:\" + request);\r\n\t\t\tif (request.startsWith(NODE_REQUEST_TO_SERVER.FILE_LIST.name())) {\r\n\t\t\t\thandleFileUpdateMessage(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FIND.name())) {\r\n\t\t\t\tString peers = handleFindFileRequest(request);\r\n\t\t\t\treturn Utils.stringToByte((Utils.isEmpty(peers) ? SharedConstants.COMMAND_FAILED\r\n\t\t\t\t\t\t: SharedConstants.COMMAND_SUCCESS) + SharedConstants.COMMAND_PARAM_SEPARATOR + peers);\r\n\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FAILED_PEERS.name())) {\r\n\t\t\t\thandleFailedPeerRequest(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Utils.stringToByte(SharedConstants.INVALID_COMMAND);\r\n\r\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n\r\n String sUserId = request.getParameter(\"u\");\r\n String type = request.getParameter(\"t\");\r\n \r\n JSONObject db = new JSONObject();\r\n PrintWriter out = response.getWriter();\r\n try {\r\n if (sUserId == null || sUserId.isEmpty() || type == null || type.isEmpty()) {\r\n db = new JSONObject();\r\n db.put(\"error\", \"Invalid input\");\r\n db.put(\"details\", \"Datos invalidos\");\r\n } else {\r\n Integer userId = Integer.valueOf(sUserId);\r\n db.put(\"lines\", getLines());\r\n db.put(\"categories\", getCategories());\r\n db.put(\"clients\", getClients(userId, type));\r\n db.put(\"agents\", getAgents(userId, type));\r\n db.put(\"products\", getProducts());\r\n db.put(\"product_specs\", getProductSpecs());\r\n db.put(\"new_products\", getCatalogNewProducts());\r\n db.put(\"promos\", getCatalogPromos());\r\n }\r\n } catch (Exception e) {\r\n db = new JSONObject();\r\n db.put(\"error\", e.getMessage());\r\n db.put(\"details\", ExceptionUtils.getStackTrace(e));\r\n } finally {\r\n out.write(db.toJSONString());\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n response.setContentType(\"application/json\");\r\n String username = SessionUtils.getUsername(request);\r\n if (username == null) {\r\n response.sendRedirect(\"index.html\");\r\n }\r\n try (PrintWriter out = response.getWriter()) {\r\n Gson gson = new Gson();\r\n GameManager gameManager = ServletUtils.getGameManager(getServletContext());\r\n int msgVersion = ServletUtils.getIntParameter(request, Constants.ALIES_MSG_VERSION_PARAMETER);\r\n if (msgVersion > Constants.INT_PARAMETER_ERROR) {\r\n Game game = gameManager.getGame(SessionUtils.getGameName(request));\r\n Alies alies = game.getAliesByName(username);\r\n List<CandidateForDecoding> agentList = alies.getCandidacies();\r\n if (agentList.size() != 0){\r\n MsgAndVersion mav = new MsgAndVersion(agentList, alies.getVersion());\r\n String json = gson.toJson(mav);\r\n out.println(json);\r\n out.flush();\r\n }\r\n }\r\n response.setStatus(200);\r\n }\r\n }", "@Override\r\n\tpublic Node processEvent(Document doc, HttpServletRequest request) {\r\n\t\t//precheck\r\n\t\tElement resp = doc.createElement(\"user\");\r\n\t\tint id_user = -1;\r\n\t\ttry{\r\n\t\t\tid_user = Integer.parseInt(request.getParameter(\"id_user\"));\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex){\r\n\t\t\treturn createDefaultResponse(doc, \"user\", \"status\" , \"ERR\" , \"message\", \"Wrong user id\");\r\n\t\t}\r\n\t\tDBUsers dbu = new DBUsers();\r\n\t\tVector v = dbu.executeQuery(\"id_user = \"+id_user);\r\n\t\tif(v == null){\r\n\t\t\treturn createDefaultResponse(doc, \"user\", \"status\" , \"ERR\" , \"message\", \"Wrong user id\");\r\n\t\t}\r\n\t\tdbu = (DBUsers) v.iterator().next();\r\n\t\r\n\r\n\t\tString name = request.getParameter(\"name\");\r\n\t\tif(name != null){\r\n\t\t\tdbu.set(\"name\", name);\r\n\t\t}\r\n\t\t//check attributes\r\n\t\t/*if(name == null || email == null){\r\n\t\t\treturn createDefaultResponse(doc, \"user\", \"status\" , \"ERR\" , \"message\", \"Request parameters missing\");\r\n\t\t}\r\n\t\t\r\n\t\tString ee = request.getAttribute(\"\");\r\n\t\t*/\r\n\r\n\t\tif(dbu.write()){\r\n\t\t\treturn createDefaultResponse(doc, \"user\", \"status\" , \"OK\" , \"message\", \"Success\");\r\n\t\t}else{\r\n\t\t\treturn createDefaultResponse(doc, \"user\", \"status\" , \"ERR\" , \"message\", \"Database connection error\");\r\n\t\t}\r\n\r\n\t}", "public ObjectNode getLoggableMessage(HttpServletRequest httpServletRequest, HttpServletResponse response) {\n\t\tObjectMapper mapper = new ObjectMapper();\n\n\t\tObjectNode ecs = mapper.createObjectNode();\n\n\t\t// client\n\t\t// client.address can contain comma separated list of IP\n\t\t// client.ip should contain the FIRST IP Address in that comma separated list\n\t\tObjectNode client = mapper.createObjectNode();\n\t\tString clientAddress = getClientIpAddress(httpServletRequest);\n\t\tclient.put(\"address\", clientAddress);\n\t\tclient.put(\"ip\", clientAddress.split(\",\")[0].trim());\n\n\t\t// client.user\n\t\tUser user = (User) httpServletRequest.getAttribute(String.valueOf(User.class));\n\t\tif (user != null) {\n\t\t\tObjectNode userNode = mapper.createObjectNode();\n\t\t\tuserNode.put(\"email\", user.getEmail());\n\t\t\tuserNode.put(\"id\", user.getId().toString());\n\t\t\tuserNode.put(\"name\", user.getUsername());\n\t\t\tuserNode.set(\"roles\", mapper.valueToTree(user.getRoles()));\n\t\t\tclient.set(\"user\", userNode);\n\t\t}\n\n\t\tecs.set(\"client\", client);\n\n\t\t// url\n\t\tString uri = httpServletRequest.getRequestURI();\n\t\tString fullURL = httpServletRequest.getRequestURL().toString();\n\n\t\t// if this is a forwarded Error Request, we'll have to rebuild the full URL\n\t\tif (httpServletRequest.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI) != null) {\n\t\t\turi = (String) httpServletRequest.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);\n\t\t\ttry {\n\t\t\t\tURL rebuiltURL = new URL(httpServletRequest.getRequestURL().toString());\n\t\t\t\tString host = rebuiltURL.getHost();\n\t\t\t\tString userInfo = rebuiltURL.getUserInfo();\n\t\t\t\tString scheme = rebuiltURL.getProtocol();\n\t\t\t\tint port = rebuiltURL.getPort();\n\t\t\t\tString query = (String) httpServletRequest.getAttribute(RequestDispatcher.FORWARD_QUERY_STRING);\n\t\t\t\tURI rebuiltURI = new URI(scheme, userInfo, host, port, uri, query, null);\n\t\t\t\tfullURL = rebuiltURI.toString();\n\t\t\t}\n\t\t\tcatch (MalformedURLException | URISyntaxException ignored) {\n\n\t\t\t}\n\t\t}\n\t\tObjectNode url = mapper.createObjectNode();\n\t\turl.put(\"path\", uri);\n\t\turl.put(\"full\", fullURL);\n\n\t\t// parse the full URL to fill out the other bits\n\t\ttry {\n\t\t\tURL parsedURL = new URL(fullURL);\n\t\t\turl.put(\"scheme\", parsedURL.getProtocol());\n\t\t\turl.put(\"port\", parsedURL.getPort());\n\t\t}\n\t\tcatch (MalformedURLException ignored) {\n\n\t\t}\n\n\t\tif (httpServletRequest.getQueryString() != null) {\n\t\t\turl.put(\"query\", httpServletRequest.getQueryString());\n\t\t}\n\n\t\tecs.set(\"url\", url);\n\n\t\t// http\n\t\tObjectNode http = mapper.createObjectNode();\n\n\t\t// http.request\n\t\tObjectNode httpRequest = mapper.createObjectNode();\n\t\thttpRequest.put(\"method\", httpServletRequest.getMethod());\n\t\tString referrer = httpServletRequest.getHeader(\"referrer\");\n\t\tif (referrer != null) {\n\t\t\thttpRequest.put(\"referrer\", referrer);\n\t\t}\n\t\thttp.set(\"request\", httpRequest);\n\n\t\t// http.response\n\t\tObjectNode httpResponse = mapper.createObjectNode();\n\t\thttpResponse.put(\"status_code\", String.valueOf(response.getStatus()));\n\t\thttp.set(\"response\", httpResponse);\n\n\t\tecs.set(\"http\", http);\n\n\t\t// useragent\n\t\tObjectNode userAgent = mapper.createObjectNode();\n\t\tuserAgent.put(\"original\", httpServletRequest.getHeader(\"User-Agent\"));\n\t\tecs.set(\"user_agent\", userAgent);\n\n\t\t// service\n\t\tObjectNode service = mapper.createObjectNode();\n\t\tservice.put(\"type\", \"igsn\");\n\t\tservice.put(\"name\", \"igsn-registry\");\n\t\tservice.put(\"kind\", \"event\");\n\t\tecs.set(\"service\", service);\n\n\t\t// custom metadata_registry fields\n\t\tObjectNode metadataRegistry = mapper.createObjectNode();\n\t\tRequest request = (Request) httpServletRequest.getAttribute(String.valueOf(Request.class));\n\t\tif (request != null) {\n\t\t\tmetadataRegistry.set(\"request\", mapper.valueToTree(request));\n\t\t}\n\t\tecs.set(\"metadata_registry\", metadataRegistry);\n\n\t\t// event\n\t\tObjectNode event = mapper.createObjectNode();\n\t\tevent.put(\"category\", \"web\");\n\t\tevent.put(\"action\", determineEventAction(httpServletRequest));\n\t\tString outcome = (response.getStatus() < 200 || response.getStatus() > 299) ? \"failure\" : \"success\";\n\t\tevent.put(\"outcome\", outcome);\n\t\tecs.set(\"event\", event);\n\n\t\t// message\n\t\tString defaultMessage = String.format(\"%s %s %s\", httpServletRequest.getMethod(), uri, response.getStatus());\n\t\tString exceptionMessage = (String) httpServletRequest.getAttribute(ExceptionMessage);\n\t\tecs.put(\"message\",\n\t\t\t\texceptionMessage != null && !exceptionMessage.trim().equals(\"\") ? exceptionMessage : defaultMessage);\n\n\t\treturn ecs;\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n RS = new RegistroSitio();\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n configuracion conf = new configuracion();\r\n ServletContext context;\r\n context = request.getServletContext();\r\n String ruta = context.getResource(\"\").getPath();\r\n\r\n URL url = new URL(\"http://\" + conf.obtenerServer(\"servidor\", ruta) + conf.leerProp(\"sConsultaUsuario\", ruta));\r\n PublicadorConsultarUsuarioService webService = new PublicadorConsultarUsuarioService(url);\r\n this.port = webService.getPublicadorConsultarUsuarioPort();\r\n\r\n if (request.getSession().getAttribute(\"usuario_logueado\") == null) {\r\n request.setAttribute(\"mensaje\", \"No existe una sesion en el sistema\");\r\n request.getRequestDispatcher(\"/Vistas/Mensaje_Recibido.jsp\").forward(request, response);\r\n } else {\r\n List<DtUsuario> lista = this.port.listarUsuarios().getLista();\r\n request.setAttribute(\"usuarios\", lista);\r\n String browserDetails = request.getHeader(\"User-Agent\");\r\n String IP; \r\n try(final DatagramSocket socket = new DatagramSocket()){\r\n socket.connect(InetAddress.getByName(\"8.8.8.8\"), 10002);\r\n IP = socket.getLocalAddress().getHostAddress();\r\n } \r\n String URL = \"http://\" + RS.obtenerIP() + \"/CulturarteWeb/SeguirUsuario\";\r\n RS.ObtenerRegistro(browserDetails, IP, URL);\r\n request.getRequestDispatcher(\"Vistas/SeguirUsuario.jsp\").forward(request, response);\r\n }\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\tString uid1=request.getParameter(\"uid1\");\n\t\t\tString uid2=request.getParameter(\"uid2\");\n\t\t\tString uidentity=request.getParameter(\"uidentity\");\n\t\t\t\n\t\t\tSystem.out.println(\"message:\"+uid2);\n\t\t\t\n\t\t\tif(uidentity.charAt(0)=='2')\n\t\t\t{\n\t\t\t\tString order=request.getParameter(\"order\");\n\t\t\t\tif(order==\"0\")\n\t\t\t\t{\n\t\t\t\tmessage m=new message();\n\t\t\t\tm.setMuid1(uid1);\n\t\t\t\tm.setMuid2(uid2);\n\t\t\t\tm.setMtext(\"邀请评价\");\n\t\t\t\tm.setMsituation('0');\n\t\t\t\ttry {\n\t\t\t\t\tnew messageDAO().addMessage(m);\n\t\t\t\t} catch (SQLException 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}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmessage m=new message();\n\t\t\t\t\tm.setMuid1(uid1);\n\t\t\t\t\tm.setMuid2(uid2);\n\t\t\t\t\tm.setMtext(\"申请项目\");\n\t\t\t\t\tm.setMsituation('0');\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew messageDAO().addMessage(m);\n\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmessage m=new message();\n\t\t\t\tm.setMuid1(uid1);\n\t\t\t\tm.setMuid2(uid2);\n\t\t\t\tm.setMtext(\"邀请加入\");\n\t\t\t\tm.setMsituation('0');\n\t\t\t\ttry {\n\t\t\t\t\tnew messageDAO().addMessage(m);\n\t\t\t\t} catch (SQLException 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}\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n\r\n Usuarios usuario = null;\r\n String clienteIdStr = request.getParameter(\"Identificacion\");\r\n int clienteId = 0;\r\n if (clienteIdStr != null && !clienteIdStr.equals(\"\")) {\r\n clienteId = Integer.parseInt(clienteIdStr);\r\n }\r\n String action = request.getParameter(\"action\");\r\n String name = request.getParameter(\"nombre\");\r\n String apellido = request.getParameter(\"apellido\");\r\n String correoElectronico = request.getParameter(\"correo\");\r\n String telefonoStr = request.getParameter(\"telefono\");\r\n int telefono = 0;\r\n if (telefonoStr != null && !telefonoStr.equals(\"\")) {\r\n telefono = Integer.parseInt(telefonoStr);\r\n }\r\n String direccion = request.getParameter(\"direccion\");\r\n\r\n usuario = new Usuarios(clienteId, name, apellido, correoElectronico, telefono, direccion);\r\n if (\"Agregar\".equalsIgnoreCase(action)) {\r\n usuariosFacade.create(usuario);\r\n //usuariosFacade.clear();\r\n\r\n } else if (\"Editar\".equalsIgnoreCase(action)) {\r\n usuariosFacade.edit(usuario);\r\n\r\n } else if (\"Eliminar\".equalsIgnoreCase(action)) {\r\n usuariosFacade.remove(usuario);\r\n\r\n } else if (\"Buscar\".equalsIgnoreCase(action)) {\r\n usuario = usuariosFacade.find(clienteId);\r\n }\r\n \r\n request.setAttribute(\"cliente\", usuario);\r\n request.setAttribute(\"allClientes\", usuariosFacade.findAll());\r\n request.getRequestDispatcher(\"Cliente.jsp\").forward(request, response);\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n int user_id = 1;// get from session\n boolean isAdmin = true;//get from sssion\n\n int reguser_id, admin_id, message_id;\n String message;\n Messages dto = new Messages();\n\n if (isAdmin) {\n dto.setAdmin_id(user_id);\n dto.setSender(0);\n } else {\n dto.setUser_id(user_id);\n dto.setSender(1);\n\n }\n\n PrintWriter out = response.getWriter();\n try {\n String jsonString = \"\";\n BufferedReader br\n = new BufferedReader(new InputStreamReader(request.getInputStream()));\n String line;\n //String json = \"\";\n while ((line = br.readLine()) != null) {\n jsonString += line;\n //System.out.println(\"recieve\" + jsonString);\n }\n //System.out.println(jsonString != null);\n if (jsonString != null) {\n System.out.println(jsonString);\n JSONObject obj = new JSONObject(jsonString);\n\n reguser_id = obj.getInt(\"student_id\");\n \n admin_id = obj.getInt(\"teacher_id\"); \n \n message_id = obj.getInt(\"message_id\");\n \n MessageDbManager mDB = new MessageDbManager();\n ArrayList<Messages> list = mDB.getAllMessagesAfterID(reguser_id, admin_id, message_id);\n System.out.println(list);\n if(list!=null)\n {\n \n JSONArray json = new JSONArray(list);\n out.print(json.toString());\n System.out.println(json.toString());\n// for(Messages m : list){\n// JSONObject json=new JSONObject(m);\n// out.print(json.toString());\n// System.out.println(json.toString());\n// }\n \n }\n else\n {\n out.print(\"null\");\n }\n\n }\n\n }catch(Exception ex){\n ex.printStackTrace();\n } \n finally {\n \n out.close();\n }\n\n }", "private @NotNull Writer handleUserTask(@NotNull Message message, @NotNull SocketChannel clientChannel)\n throws InvalidQueryException {\n logger.debug(\"handling user query\");\n try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(message.getData());\n ObjectInputStream input = new ObjectInputStream(byteArrayInputStream)) {\n\n int typeOfQuery = input.readInt();\n Path path = Paths.get((String) input.readObject());\n\n if (typeOfQuery == NetworkConstants.LIST_QUERY) {\n logger.debug(\"User asked for list directory\");\n return new ListQueryHandler(path).handleListQuery(clientChannel);\n }\n if (typeOfQuery == NetworkConstants.GET_QUERY) {\n logger.debug(\"User asked for get file\");\n return new GetQueryHandler(path).handleGetQuery(clientChannel);\n }\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n throw new InvalidQueryException();\n }", "public void handleMessageFromClient (Object msg, ConnectionToClient client) \r\n { \r\n\t Envelope en=(Envelope)msg;\r\n\t User user=null;\r\n\t int write=0;\r\n\t String str=msg.toString();\r\n try{\r\n\t Statement stmt = conn.createStatement();\r\n\r\n\t if((en.getTask()).equals(\"login\")) //search Login\r\n\t {\r\n\t\t logInMod showfiles=(logInMod)en.getObject();\r\n\t\t file f;\r\n\t\t String username;\r\n\t\t String pass;\r\n\t\t String mail;\r\n\t\t int status;\r\n\t\t ArrayList<file> files=new ArrayList<>();\r\n\t\t String re = \"SELECT * FROM users WHERE users.username= '\"+(showfiles.getUserName()+\"' AND users.password='\"+showfiles.getPassword()+\"'\");\r\n\t\t rs = stmt.executeQuery(re);\r\n\t\t \r\n\t\t if(rs.next()==true)\r\n\t\t { \r\n\t\t\t username=rs.getString(1);\r\n\t\t\t pass=rs.getString(2);\r\n\t\t\t mail=rs.getString(3);\r\n\t\t\t status=rs.getInt(4);\r\n\t\t\t String re2 = \"SELECT * FROM files WHERE files.username= '\"+(showfiles.getUserName()+\"'\");\r\n\t\t\t\trs1 = stmt.executeQuery(re2);\r\n\t\t\t\twhile(rs1.next()==true)\r\n\t\t\t\t {\r\n\t\t\t\t\t f=new file(rs1.getString(2),rs1.getString(3));\r\n\t\t\t\t\t files.add(f);\r\n\t\t\t\t }\r\n\t \t user = new User(username,pass,mail,status,files);\r\n\t \t en=new Envelope(user,\"log in handle\");\r\n\t \t client.sendToClient(en);\r\n\t\t }\r\n\t\t\r\n\t\t else \r\n\t\t\t client.sendToClient(\"Not found User\");\r\n\t }\r\n\t\r\n\t if(en.getTask().equals(\"forgotPass\"))\r\n\t {\r\n\t\t forgetPassCon forgot=(forgetPassCon)en.getObject();\r\n\t\t String re = \"SELECT * FROM users WHERE users.email= '\"+(forgot.getUserMail()+\"'\");\r\n\t\t rs = stmt.executeQuery(re);\r\n\t\t if(rs.next()==true)\r\n\t\t {\r\n\t\t\t client.sendToClient(\"we found the mail!\");\r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t else\r\n\t\t\t client.sendToClient(\"mail doesn't exists\");\r\n\t }\r\n\t \r\n\tif(en.getTask().equals(\"log in status\"))\r\n\t{\r\n\t User userloged=(User)en.getObject();\r\n\t String upd = \"UPDATE users SET status= '1' WHERE users.username = '\"+(userloged.getUsreName()+\"' AND users.password='\"+userloged.getUpassword())+\"'\";\r\n\t stmt.executeUpdate(upd);\r\n controller.SetLog(userloged,\"login\"); //update the login serverLogGui\r\n\t}\r\n if(en.getTask().equals(\"log out status\"))\r\n\t{\r\n\t User userloged=(User)en.getObject();\r\n\t String upd = \"UPDATE users SET status= '0' WHERE users.username = '\"+(userloged.getUsreName()+\"' AND users.password='\"+userloged.getUpassword())+\"'\";\r\n\t stmt.executeUpdate(upd);\r\n\t controller.SetLog(userloged,\"logout\"); //update the logout serverLogGui\r\n }\r\n if(en.getTask().equals(\"show user interest groups\"))\r\n {\r\n \tinterestGroups s= null;\r\n \tinterestGroups s2= null;\r\n \tuser=(User)en.getObject();\r\n \tArrayList<interestGroups> interestGroup=new ArrayList<>();\r\n \tArrayList<interestGroups> allGroup=new ArrayList<>();\r\n \tString re=\"select * from test.interstgroups where interstgroups.username= '\"+user.getUserName() +\"'\";\r\n \t rs = stmt.executeQuery(re);\r\n \t while(rs.next()==true)\r\n \t {\r\n \t\ts=new interestGroups(rs.getString(2));\r\n \t\tinterestGroup.add(s);\r\n \t\r\n \t }\r\n \t user.setInterestGroupInDB(interestGroup);\r\n \t String temp;\r\n \t String re2=\"select distinct groupname from test.interstgroups\";\r\n \t rs = stmt.executeQuery(re2);\r\n \t while(rs.next()==true)\r\n \t {\r\n \t\t temp = rs.getString(1);\r\n \t\t s2=new interestGroups(temp);\r\n \t\t allGroup.add(s2);\r\n \t }\r\n \t user.setAllGroupInDB(allGroup);\r\n \t en=new Envelope(user,\"show user interest groups\");\r\n \t\t client.sendToClient(en);\r\n \t \r\n }\r\n\t \r\n\t \r\n }\r\n catch (SQLException e) {\r\n \te.printStackTrace();\r\n } \r\n catch (IOException e) {\r\n e.printStackTrace();}\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n request.setCharacterEncoding(\"UTF-8\");\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.setContentType(\"text;charset=UTF-8\");\n Locale locale = request.getLocale();\n String action = request.getParameter(\"action\");\n User user = Server.getSession(request);\n\n if (User.isValid(user)) {\n if (action == null) {\n //redirect to somewhere\n } else if (action.equals(\"friend\")) {\n String requestedUserId = request.getParameter(\"id\");\n String groupNames = request.getParameter(\"groups\");\n String requestMessage = request.getParameter(\"message\");\n String[] requiredFields = {requestedUserId, groupNames};\n if (!Util.areEmpty(requiredFields)) {\n if (friendAlreadyAdded(user, requestedUserId)) {\n String message = I18n.getString(locale, \"request.AlreadyCompleted\");\n response.getWriter().write(\"fail;\".concat(message));\n } else {\n Group.process(\n user,\n groupNames, new Query());\n Request friendRequest = new Request(\n Request.FRIENDSHIP,\n user.getId(),\n requestedUserId, requestMessage, groupNames);\n if (friendRequest.isDuplicate(new Query())) {\n String message = I18n.getString(locale, \"request.isDuplicate\");\n response.getWriter().write(\"fail;\".concat(message));\n } else {\n DAO dao = new Query();\n dao.open();\n try {\n dao.set(friendRequest);\n dao.commit();\n String message = I18n.getString(locale, \"request.success\");\n response.getWriter().write(\"success;\".concat(message));\n } catch (Exception e) {\n dao.rollBack();\n } finally {\n dao.closeSession();\n }\n }\n }\n } else {\n response.getWriter().write(HttpServletResponse.SC_NO_CONTENT);\n }\n } else if (action.equals(\"acceptFriend\")) {\n String requestId = request.getParameter(\"requestId\");\n String groupCSV = request.getParameter(\"groups\");\n String[] requiredFields = {requestId, groupCSV};\n\n if (!Util.areEmpty(requiredFields)) {\n DAO dao = new Query();\n dao.open();\n try {\n Request friendRequest = (Request) dao.get(\n Request.class,\n requestId);\n if (friendRequest != null) {\n if (user.getId() == friendRequest.getToId()) {\n if (friendRequest.getType().equals(Request.FRIENDSHIP)) {\n if (friendAlreadyAdded(user, friendRequest)) {\n String message = I18n.getString(locale, \"request.AlreadyCompleted\");\n response.getWriter().write(\"fail;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n dao.commit();\n } else {\n User sender = (User) friendRequest.getFrom();\n for (String groupNameFrom : friendRequest.getGroupNamesArray()) {\n if (isValid(groupNameFrom)) {\n GroupMembership membershipFrom = new GroupMembership(\n user,\n Group.get(sender, groupNameFrom, new Query()));\n dao.set(membershipFrom);\n }\n }\n String[] groupNamesTo = groupCSV.split(\";\");\n for (String groupNameTo : groupNamesTo) {\n if (isValid(groupNameTo)) {\n GroupMembership membershipTo = new GroupMembership(\n sender,\n Group.get(user, groupNameTo, new Query()));\n dao.set(membershipTo);\n }\n }\n String message = I18n.getString(locale, \"request.accepted\");\n response.getWriter().write(\"success;\".concat(message).concat(\" \".concat(sender.getName())) + \";\".concat(friendRequest.getIdString()));\n dao.delete(friendRequest);\n dao.commit();\n }\n } else {\n Server.failed(response, locale);\n }\n }\n } else {\n Server.failed(response, locale);\n }\n } catch (Exception e) {\n //e.printStackTrace();\n dao.rollBack();\n } finally {\n dao.closeSession();\n }\n } else {\n response.getWriter().write(HttpServletResponse.SC_NO_CONTENT);\n }\n } else if (action.equals(\"rejectFriend\")) {\n String requestId = request.getParameter(\"requestId\");\n if (requestId != null) {\n DAO dao = new Query();\n dao.open();\n try {\n Request friendRequest = (Request) dao.get(Request.class, requestId);\n if (friendRequest != null) {\n if (friendRequest.getToId() == user.getId()) {\n if (friendRequest.getType().equals(Request.FRIENDSHIP)) {\n String message = I18n.getString(locale, \"request.Rejected\");\n response.getWriter().write(\"success;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n dao.delete(friendRequest);\n return;\n }\n }\n }\n String message = I18n.getString(locale, \"request.fail\");\n response.getWriter().write(\"fail;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n } catch (Exception e) {\n //e.printStackTrace();\n } finally {\n dao.close();\n }\n }\n } else if (action.equals(\"unfriend\")) {\n String friendName = request.getParameter(\"id\");\n if (user.unfriend(friendName, new Query())) {\n String message = I18n.getString(locale, \"request.Unfriend\");\n response.getWriter().write(\"success;\".concat(message));\n } else {\n Server.failed(response, locale);\n }\n } else {\n Server.failed(response, locale);\n }\n } else {\n Util.redirectToLogin(request, response);\n }\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\t \n\t\t\t // Getting the data from the JSON POST request\n\n\t\t\t try {\n\t\t\t\t \n\t\t\t\t // Declaring the variables to get the data from the multiple JSON POST requests\n\t\t\t\t\t\n\t\t\t\t StringBuilder newJsonBuff = new StringBuilder();\n\t\t\t\t String newLine = null; \n\t\t\t \n\t\t\t BufferedReader reader = req.getReader();\n\t\t\t while ((newLine = reader.readLine()) != null)\n\t\t\t \t newJsonBuff.append(newLine);\n\t\t\t \n\t\t\t // Creating the JSON object\n\t\t\t \n\t\t\t JSONObject jsonObject = new JSONObject(newJsonBuff.toString());\n\t\t\t \n\t\t\t //Creating the user object from the JSON object\n\t\t\t \n\t\t\t user newUser = new user(jsonObject);\n\n\t\t\t // Calling the method from the user Class to handle the user\n\t\t\t \n\t\t\t user._userLog (newUser.userPassword,newUser.userEmail, newUser.type,newUser.update);\n\t\t\t \n\t\t\t //Printing a message to be able to know when a user logs in\n\t\t\t \n\t\t\t user._print(newUser.userPassword,newUser.userEmail, newUser.type);\n\t\t\t\t \t\t\t \t \n\t\t\t }\n\t\t\t \n\t\t\t //Catching the error\n\n\t \t\t catch (Exception e) { \n\t\t \n\t \t\t\t System.out.println(\"Error with the doPost method in the ServletUsers class\"); \n\t \t\t\n\t \t\t} \t\t\n\t}", "public void readRegisterRequest() {\n\t\tMessagingNodesList mNodeList = node.getCurrentMessagingNodesList();\n\t\tiStream = new ByteArrayInputStream(marshalledBytes);\t\n\t\tdin = new DataInputStream(new BufferedInputStream(iStream));\n\t\ttry {\n\t\t\t//Reading IP Address\n\t\t\tint ipAddressLength = din.readInt();\n\t\t\tbyte[] ipAddrBytes = new byte[ipAddressLength];\n\t\t\tdin.readFully(ipAddrBytes);\n\t\t\tString ipAddress = new String(ipAddrBytes);\n\t\t\tint portNumber = din.readInt();\n\t\t\tdin.readLong();\n\t\t\tiStream.close(); din.close();\n\t\t\t\n\t\t\tString additionalInfo=\"\", statusCode=\"FAILURE\";\n\t\t\tif(!ipAddress.contentEquals( originSocket.getInetAddress().getHostName())) {\n\t\t\t\tadditionalInfo =\"Registration request failed. The registration request has an IP which does not match the IP of the machine it came from.\";\n\t\t\t}\n\t\t\tif(mNodeList==null) {\t//handles null list issue if list has not been created yet\n\t\t\t\tMessagingNodesList mnl = new MessagingNodesList();\n\t\t\t\tmnl.addNode(ipAddress, portNumber,originSocket);\n\t\t\t\tadditionalInfo =\"Registration request successful. The number of messaging nodes currently constituting the overlay is (\" + mnl.getSize() +\").\";\n\t\t\t\tstatusCode = \"SUCCESS\";\n\t\t\t\tnode.setMessagingNodesList(mnl);\n\t\t\t}\n\t\t\telse if (mNodeList.searchFor(ipAddress,portNumber)){\t\t//Checks if the node was already registered\n\t\t\t\tadditionalInfo =\"Registration request failed for \"+ipAddress+\". The node being added was already registered in the registry.\";\n\t\t\t}\n\t\t\telse { // Else add the Node \n\t\t\t\tmNodeList.addNode(ipAddress, portNumber,originSocket);\n\t\t\t\tadditionalInfo =\"Registration request successful. The number of messaging nodes currently constituting the overlay is (\" + mNodeList.getSize() +\").\";\n\t\t\t\tstatusCode = \"SUCCESS\";\n\t\t\t}\n\t\t\tif(statusCode.contentEquals(\"FAILURE\")) System.out.println(additionalInfo);\n\n\t\t\tnode.decreaseNeededConnects();\n\t\t\tif(node.getNumberNeededPeers() == 0) {\n\t\t\t\tSystem.out.println(\"All connections are established. Number of connections: \"+(node.getCurrentMessagingNodesList().getSize()));\n\t\t\t}\n\t\t\t//Now sending a RegisterResponse\n\t\t\tMessage response = new RegisterResponse(statusCode, additionalInfo);\n\t\t\tSocket senderSocket = new Socket(ipAddress, portNumber);\n\t\t\tnode.getConnections().addConnection(ipAddress, senderSocket);\n\t\t\tnew TCPSender(senderSocket, response);\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Failed to read message. \"); \n\t\t}\n\t}", "protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\tString username = req.getParameter(\"username\");\n\t\t\n\t\tString result = LogStorage.retrieveUserEntries(username);\n\t\t\n\t\t//Sennd response back\n\t\tresp.setContentType(\"text/xml; charset=UTF-8\");\n\t\tresp.setStatus(HttpServletResponse.SC_OK);\n\t\tresp.getWriter().write(result);\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void run() {\r\n\t\t//prendo gli streams per comunicare con il server\r\n\t\tDataOutputStream writer = ClientMain.WRITER;\r\n\t\tDataInputStream reader = ClientMain.READER;\r\n\t\t\r\n\t\t//creo la richiesta di look up\r\n\t\tJSONObject request = new JSONObject();\r\n\t\trequest.put(\"OP\", \"LOOKUP\");\r\n\t\trequest.put(\"ID\", nickname);\r\n\t\t\t\t\r\n\t\t//variabili per gestire la riposta del server\r\n\t\tString response = null;\r\n\t\tJSONObject responseJSON = null;\r\n\t\t\t\t\t\t\t\t\r\n\t\ttry {\r\n\t\t\t//mando la richiesta\r\n\t\t\twriter.writeUTF(request.toJSONString());\r\n\t\t\twriter.flush();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t//ricevo la risposta\r\n\t\t\tresponse = reader.readUTF();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//trasformo in formato JSON la risposta ricevuta dal server\r\n\t\t\tresponseJSON = \t(JSONObject) new JSONParser().parse(response);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t//se c'è qualche problema di comunicazione con il server\r\n\t\t\t//o se non è possibile parsare il messaggio ricevuto\r\n\t\t\te.printStackTrace();\r\n\t\t\t//termino il client\r\n\t\t\tClientMain.cleanUp();\r\n\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t//controllo l'esito della risposta\r\n\t\tOperations esito = Operations.valueOf((String) responseJSON.get(\"OP\"));\r\n\t\tif (esito==Operations.OP_OK) {\r\n\t\t\t//prendo il responso della ricerca\r\n\t\t\tString msg = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msg);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//prendo il messaggio di errore trasmesso dal server\r\n\t\t\tString msgErr = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msgErr);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tresponse.setContentType(\"text/html\");\n\t\trequest.setCharacterEncoding(\"utf-8\");\n\t\tString to_user_chat_id = request.getParameter(\"to_user_chat_id\");\n\t\tString reason = request.getParameter(\"reason\");\n\t\tint user_id = Integer.valueOf(request.getParameter(\"user_id\"));\n\t\tString user_name = request.getParameter(\"user_name\");\n\t\tString user_avatar = request.getParameter(\"user_avatar\");\n\t\tString from_circle = request.getParameter(\"from_circle\");\n\t\tString user_chat_id = request.getParameter(\"user_chat_id\");\n\t\tUserFriendInviteMessage message = new UserFriendInviteMessage();\n\t\tmessage.setTo_user_chat_id(to_user_chat_id);\n\t\tmessage.setUser_id(user_id);\n\t\tUserFriendInviteMessageDao dao = UserFriendInviteMessageDaoFactory\n\t\t\t\t.getInstance();\n\t\tboolean result = dao.getMessage(message);\n\t\tUserFriendDao userDao = UserFriendDaoFactory.getInstance();\n\t\tUserFriend user = new UserFriend();\n\t\tuser.setUser_id(user_id);\n\t\tuser.setUser_friend_chat_id(to_user_chat_id);\n\t\tboolean userResult = userDao.getUser(user);\n\t\tif (!result && !userResult) {\n\t\t\tEasemobMessages.addUserFriendInvite(to_user_chat_id, reason,\n\t\t\t\t\tuser_id, user_name, user_avatar, from_circle, user_chat_id);\n\t\t\tdao.addMessage(message);\n\t\t}\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tparams.put(\"rt\", 1);\n\t\tPrintWriter out = response.getWriter();\n\t\tout.print(params);\n\t\tout.flush();\n\t\tout.close();\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n \n JSONObj json = new JSONObj();\n \n try {\n String username = request.getParameter(\"username\");\n int password = Integer.parseInt(request.getParameter(\"password\"));\n String usertype = request.getParameter(\"usertype\");\n \n Class.forName(Connect.driver); //load the driver\n Connection db = DriverManager.getConnection(Connect.url, Connect.user, Connect.pass);\n\n if (db!=null) {\n String sqlText = \"SELECT username FROM \\\"User\\\" WHERE username LIKE ?\";\n PreparedStatement ps = db.prepareStatement(sqlText);\n ps.setString(1,username);\n ResultSet results = ps.executeQuery(); // A megadott felhasznalonev keresese:\n if (results != null && results.next()) { // Foglalt?\n json.setErrorMessage(\"A megadott felhasználónév már foglalt.\");\n } else { // Szabad? Akkor felvetel az adatbazisba!\n sqlText = \"SELECT id FROM \\\"UserType\\\" WHERE name=?\";\n ps = db.prepareStatement(sqlText);\n ps.setString(1,usertype);\n results = ps.executeQuery();\n if (results != null && results.next()) {\n \n sqlText = \"INSERT INTO \\\"User\\\" (username, password, \\\"usertypeID\\\") VALUES (?, ?, ?)\";\n ps = db.prepareStatement(sqlText);\n ps.setString(1,username);\n ps.setInt(2,password);\n ps.setInt(3,results.getInt(1));\n ps.executeUpdate();\n json.setOKMessage(\"Sikeres regisztráció!\");\n } else json.setErrorMessage(\"Ismeretlen felhasználói típus.\");\n }\n results.close();\n db.close();\n } else json.setServerError(); // adatbazis nem erheto el\n\n } catch (Exception e) {\n json.setDBError(); // adatbazis hiba\n } finally {\n json.write(out); // Osszeallitott JSON kiirasa az outputra\n out.close();\n }\n }", "private void handleClient() {\n\t\t//Socket link = null;\n\t\tRequestRecord reqRec = new RequestRecord();\n\t\tResponder respondR = new Responder();\n\t\t\n\t\ttry {\n\t\t\t// STEP 1 : accepting client request in client socket\n\t\t\t//link = servSock.accept(); //-----> already done in *ThreadExecutor*\n\t\t\t\n\t\t\t// STEP 2 : creating i/o stream for socket\n\t\t\tScanner input = new Scanner(link.getInputStream());\n\t\t\tdo{\n\t\t\t\t//PrintWriter output = new PrintWriter(link.getOutputStream(),true);\n\t\t\t\t//DataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\t\t\tint numMsg = 0;\n\t\t\t\tString msg = input.nextLine();\n\t\t\t\t\n\t\t\t\t//to write all requests to a File\n\t\t\t\tFileOutputStream reqFile = new FileOutputStream(\"reqFile.txt\");\n\t\t\t\tDataOutputStream dat = new DataOutputStream(reqFile);\n\t\t\t\t\n\t\t\t\t// STEP 4 : listening iteratively till close string send\n\t\t\t\twhile(msg.length()>0){\n\t\t\t\t\tnumMsg++;\n\t\t\t\t\tdat.writeChars(msg + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"\\nNew Message Received\");\n\t\t\t\t\tif(reqRec.setRecord(msg)==false)\n\t\t\t\t\t\tSystem.out.println(\"\\n-----\\nMsg#\"+numMsg+\": \"+msg+\":Error with Request Header Parsing\\n-----\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Msg#\" + numMsg + \": \" + msg);\n\t\t\t\t\tmsg = input.nextLine();\n\t\t\t\t};\n\t\t\t\tdat.writeChars(\"\\n-*-*-*-*-*-*-*-*-*-*-*-*-*-\\n\\n\");\n\t\t\t\tdat.close();\n\t\t\t\treqFile.close();\n\t\t\t\tSystem.out.println(\"---newEST : \" + reqRec.getResource());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n==========Send HTTP Response for Get Request of\\n\"+reqRec.getResource()+\"\\n***********\\n\");\n\t\t\t\tif(respondR.sendHTTPResponseGET(reqRec.getResource(), link)==true)//RES, ds)==true)\n\t\t\t\t\tSystem.out.println(\"-----------Resource Read\");\n\t\t\t\tSystem.out.println(\"Total Messages Transferred: \" + numMsg);\n\t\t\t\t//link.close();\n\t\t\t\tif(reqRec.getConnection().equalsIgnoreCase(\"Keep-Alive\")==true && respondR.isResourceExisting(reqRec.getResource())==true)\n\t\t\t\t\tlink.setKeepAlive(true);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}while(true);\n\t\t\tSystem.out.print(\"Request Link Over as Connection: \" + reqRec.getConnection());\n\t\t} catch (IOException e) {\n\t\t\tif(link.isClosed())\n\t\t\t\tSystem.out.print(\"\\n\\nCritical(report it to developer):: link closed at exception\\n\\n\");\n\t\t\tSystem.out.println(\"Error in listening.\\n {Error may be here or with RespondR}\\nTraceString: \");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// STEP 5 : closing the connection\n\t\t\tSystem.out.println(\"\\nClosing Connection\\n\");\n\t\t\ttry {\t\t\t\t\n\t\t\t\tlink.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to disconnect.\\nTraceString: \");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}/*ends :: try...catch...finally*/\n\t\t\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse res)\n\t\t\tthrows ServletException, IOException {\n\t\tThread userSideCheck = new Thread(this);\n\t\t/*\n\t\t * starts thread that determines which users are no longer connected -\n\t\t * removes those users from the list\n\t\t */\n\t\tuserSideCheck.start();\n\t\tString user;\n\t\tString message;\n\t\tString[] receivers, users;\n\t\tint count = 0;\n\t\tStringBuffer out = new StringBuffer(\"\");\n\t\t// get current session\n\t\tHttpSession session = req.getSession(true);\n\n\t\tout\n\t\t\t\t.append(\"<HTML><HEAD><TITLE>Chat form</TITLE></HEAD><BODY BGCOLOR='#FFFFFF'>\");\n\t\t/*\n\t\t * if user session doesn't have a name, and one is provided from form,\n\t\t * well - use it!\n\t\t */\n\t\tif ((session.getValue(\"com.mrstover.name\") == null)\n\t\t\t\t&& ((user = req.getParameter(\"name\")) != null)) {\n\t\t\t// but only if no one else is using that name\n\t\t\tboolean allowed = false;\n\t\t\tint x = 0;\n\t\t\twhile (x < allowedUsers.length)\n\t\t\t\tif (user.equals(allowedUsers[x++]))\n\t\t\t\t\tallowed = true;\n\n\t\t\tif (!checkUserExist(user) && allowed)\n\t\t\t\tsession.putValue(\"com.mrstover.name\", user);\n\t\t\telse\n\t\t\t\tout\n\t\t\t\t\t\t.append(\"A user with that name already exists. Please choose another<P>\");\n\t\t}\n\n\t\t/*\n\t\t * If we know user's name, we have a message, and name is not blank,\n\t\t * then we graciously accept the message and add to our list\n\t\t */\n\t\tif ((session.getValue(\"com.mrstover.name\") != null)\n\t\t\t\t&& ((message = req.getParameter(\"message\")) != null)\n\t\t\t\t&& (!((user = (String) session.getValue(\"com.mrstover.name\"))\n\t\t\t\t\t\t.equals(\"\")))) {\n\t\t\t// adds the user's session to our list of sessions, if necessary\n\t\t\taddUser(user, session);\n\t\t\tif (!message.equals(\"\")) {\n\t\t\t\t// add message and the desired receivers to our list\n\t\t\t\tif ((receivers = req.getParameterValues(\"receivers\")) != null)\n\t\t\t\t\taddMessage(user, message, receivers);\n\t\t\t\telse\n\t\t\t\t\taddMessage(user, message);\n\t\t\t}\n\t\t\t// reprint the message form\n\t\t\tout.append(\"<FORM ACTION='\" + thisServlet + \"' METHOD='POST'>\");\n\t\t\tout.append(\"<CENTER><TABLE>\");\n\t\t\tout\n\t\t\t\t\t.append(\"<TR><TD>Message:<BR> <TEXTAREA NAME='message'\"\n\t\t\t\t\t\t\t+ \" COLS='50' ROWS='2' WRAP='VIRTUAL'></TEXTAREA></TD>\"\n\t\t\t\t\t\t\t+ \"<TD><B>Send to:</B><BR><SELECT NAME='receivers' MULTIPLE><OPTION VALUE='all'>all\");\n\t\t\tusers = getUsers();\n\t\t\t// select box with list of current chat users\n\t\t\twhile (count < users.length) {\n\t\t\t\tout\n\t\t\t\t\t\t.append(\"<OPTION VALUE=\" + users[count] + \">\"\n\t\t\t\t\t\t\t\t+ users[count]);\n\t\t\t\tcount++;\n\t\t\t}\n\n\t\t\tout.append(\"</SELECT></TR>\");\n\t\t\tout.append(\"</TABLE>\");\n\t\t\tout.append(\"<INPUT TYPE='SUBMIT' VALUE='SUBMIT'>\");\n\t\t\tout.append(\"</CENTER></FORM></BODY></HTML>\");\n\t\t}\n\t\t// else we need to know who you are first\n\t\telse {\n\t\t\tout.append(\"<FORM ACTION='\" + thisServlet + \"' METHOD='POST'>\");\n\t\t\tout.append(\"<CENTER><TABLE>\");\n\t\t\tout\n\t\t\t\t\t.append(\"<TR><TD>Please Tell me your name: <INPUT TYPE='TEXT' NAME='name' VALUE=''></TD></TR>\");\n\t\t\tout\n\t\t\t\t\t.append(\"<TR><TD>Message:<BR> <TEXTAREA NAME='message'\"\n\t\t\t\t\t\t\t+ \" COLS='50' ROWS='2' WRAP='VIRTUAL'></TEXTAREA></TD></TR>\");\n\t\t\tout.append(\"</TABLE>\");\n\t\t\tout.append(\"<INPUT TYPE='SUBMIT' VALUE='SUBMIT'>\");\n\t\t\tout.append(\"</CENTER></FORM></BODY></HTML>\");\n\t\t}\n\t\toutputToBrowser(res, out.toString());\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html; charset=UTF-8\");\r\n MensajeDAO m = new MensajeDAO();\r\n String name = request.getParameter(\"name\");\r\n String message = request.getParameter(\"message\");\r\n String message1 = request.getParameter(\"message\");\r\n DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\r\n \r\n Date date = new Date();\r\n int id_user;\r\n id_user = Integer.parseInt(name);\r\n Mensaje mensaje = new Mensaje(id_user, message, message1, dateFormat.format(date));\r\n System.out.print(\"emojiiiiiiiiiiiiiiiiiiiiiiii\"+mensaje.getEmi_mess());\r\n m.create(mensaje);\r\n \r\n DateFormat dateFormat2 = new SimpleDateFormat(\"HH:mm:ss\");\r\n\r\n mensaje.setTime_mess(dateFormat2.format(date));\r\n\r\n Pusher pusher = new Pusher(\"1188258\", \"814af04f4e0ebcbfa6e4\", \"859c005916df08aa32eb\");\r\n pusher.setCluster(\"us2\");\r\n pusher.setEncrypted(true);\r\n\r\n pusher.trigger(\"chat\", \"new-message\", mensaje.getJsonObject());\r\n\r\n }", "private void handleRequest(Request request) throws IOException{\n switch (request){\n case NEXTODD:\n case NEXTEVEN:\n new LocalThread(this, request, nextOddEven).start();\n break;\n case NEXTPRIME:\n case NEXTEVENFIB:\n case NEXTLARGERRAND:\n new NetworkThread(this, userID, serverIPAddress, request).start();\n break;\n default:\n break;\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"---here----\");\n \tresponse.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n try {\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Please wait while we analyze your request...</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<h2>Please wait... </h2>\");\n // out.println(\"<br><h3>Oops... it seems our registration service is currently being updated...<br>\"\n // + \"We're sorry for the inconvenience.... \"\n // + \"You can check back later and we'll have it all up and running again.... Thank You..!!!</h3>\");\n \n \n \n \n String Name= request.getParameter(\"name\");\n String Age = request.getParameter(\"Employeeid\");\n String Address = request.getParameter(\"Role\");\n String Phone = request.getParameter(\"phoneno\");\n String Email = request.getParameter(\"email\");\n String UserName = request.getParameter(\"username\");\n String Password = request.getParameter(\"password2\");\n \n \n \n //For debugging\n out.println(\"<h3>New User Registration Details</h3>\" \n + \"---<br>\");\n out.println(\"<br>Name\"+Name);\n out.println(\"<br>Age\"+Age);\n out.println(\"<br>Address \"+Address);\n out.println(\"<br>Phone\"+Phone);\n out.println(\"<br>Email\"+Email);\n out.println(\"<br>Username\"+UserName);\n out.println(\"<br>Password\"+Password);\n \n out.println(\"<br><br><a href='index.html'>Click here to login...</a></body>\");\n out.println(\"</html>\");\n } \n catch(Exception er)\n {\n out.println(\"System Internal Error\"\n + er.getMessage());\n }\n finally { \n out.close();\n }\n }", "private void listaUsuario(HttpServletRequest req, HttpServletResponse resp) {\n\t\t\r\n\t}", "protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.setCharacterEncoding(\"utf-8\");\n\t\tString method = req.getParameter(\"method\");\n//\t\tSystem.out.println(\"PPPPPPPPPPPPPPP\");\n\t\tif (\"Time_qunee\".equals(method)) {\n\t\t\ttry {\n\t\t\t\tTime_qunee(req, resp);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse if (\"Time_qunee_pre\".equals(method)) {\n\t\t\ttry {\n\t\t\t\tTime_qunee_pre(req, resp);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse if (\"Time_qunee_fold\".equals(method)) {\n\t\t\ttry {\n\t\t\t\tTime_qunee_fold(req, resp);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse if(\"Create_root_json\".equals(method)) {\n\t\t\tresp.setCharacterEncoding(\"utf-8\");\n\t\t\tresp.getWriter().write(DataServlet.createRootInfoJson());\n\t\t}\n\t\telse if(\"Create_montior_json\".equals(method)) {\n\t\t\tresp.setCharacterEncoding(\"utf-8\");\n\t\t\tresp.getWriter().write(DataServlet.createMontiorInfoJson());\n\t\t}\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n// /*// Check if user object is available in session.\n// if (Util.getCurrentUser(request) == null) {\n// request.setAttribute(\"msg\", \"Please Login\");\n// getServletContext().getRequestDispatcher(\"/error.jsp\").forward(request, response);\n// return;\n// // Check if has not value from query string.\n// } else */ if (!request.getParameterNames().hasMoreElements()) {\n// getServletContext().getRequestDispatcher(\"/addUser.jsp\").forward(request, response);\n// return;\n// }\n\n // Retrieve value from form in addUser.jsp.\n String email = request.getParameter(\"email\");\n String password = request.getParameter(\"password\");\n String confirmPassword = request.getParameter(\"confirmPassword\");\n String displayname = request.getParameter(\"displayname\");\n String type = request.getParameter(\"type\");\n // Set default value to 0 (fails)\n int msgType = 0;\n String msg = \"\";\n // Check if value complete.\n if (!Util.isFieldEmpty(email)\n && !Util.isFieldEmpty(password)\n && !Util.isFieldEmpty(confirmPassword)\n && !Util.isFieldEmpty(displayname)\n && !Util.isFieldEmpty(type)) {\n\n switch (User.isExists(email, displayname)) {\n case 0:\n if (password.equals(confirmPassword)) {\n // Add user to database.\n User.addUser(email, password, displayname, Integer.parseInt(type));\n msg = Util.ADD_USER_SUCCESS;\n msgType = 1;\n } else {\n msg = Util.PASSWORDS_NOT_MATCH;\n }\n break;\n case 1:\n msg = Util.EMAIL_EXIST;\n break;\n case 2:\n msg = Util.DISPLAYNAME_EXIST;\n break;\n case 3:\n msg = Util.EMAIL_DISPLAYNAME_EXIST;\n break;\n }\n request.setAttribute(\"msgType\", msgType);\n request.setAttribute(\"msg\", msg);\n getServletContext().getRequestDispatcher(\"/WEB-INF/jsp/addUser.jsp\").forward(request, response);\n // If some field is incomplete.\n } else if (!request.getParameterNames().hasMoreElements()) {\n getServletContext().getRequestDispatcher(\"/WEB-INF/jsp/addUser.jsp\").forward(request, response);\n } else {\n request.setAttribute(\"msg\", Util.INCOMPLETED_FIELD);\n getServletContext().getRequestDispatcher(\"/WEB-INF/jsp/addUser.jsp\").forward(request, response);\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException\r\n {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n PrintWriter out = response.getWriter();\r\n try\r\n {\r\n // A user is not needed for this query, so we don't check for him.\r\n // The response is the id of the latest reservation. If an error\r\n // occurs we send back 'error'.\r\n int mi = Delphi.Inst().getResMaxID();\r\n out.print(Integer.toString(mi));\r\n }\r\n catch (Exception ex) \r\n {\r\n AppLog.Instance().Error(\"ResGetMaxID \" + ex.getMessage());\r\n out.print(\"error\");\r\n }\r\n finally\r\n {\r\n out.close();\r\n }\r\n }", "private void makeReply(JSONObject request, DataOutputStream clientStream) throws ParseException, IOException {\n\t\tGossip_client_message.Op op = Gossip_parser.getClientOp(request);\n\t\tString sender = Gossip_parser.getClientName(request);\n\t\ttry {\n\t\t\t\tswitch(op) {\n\t\t\t\n\t\t\t\tcase REGISTER_OP: {\n\t\t\t\t\tString password = Gossip_parser.getPassword(request);\n\t\t\t\t\tString language = Gossip_parser.getLanguage(request);\n\t\t\t\t\tdata.addUser(sender, password, language);\n\t\t\t\t\t//recupero la lista delle chat\n\t\t\t\t\tArrayList<Gossip_chat> chatlist = data.getChats();\n\t\t\t\t\t//invio dati di registrazione\n\t\t\t\t\tsendReply(new Gossip_info_registration_message(chatlist, data.getUser(sender)), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\n\t\t\t\tcase LOGIN_OP: {\n\t\t\t\t\tString password = Gossip_parser.getPassword(request);\n\t\t\t\t\tif (data.getUser(sender).getPassword().equals(password)) {\n\t\t\t\t\t\t//imposto l'utente come online\n\t\t\t\t\t\tdata.setStatus(sender, true);\n\t\t\t\t\t\t//recupero la lista degli amici e quella delle chat\n\t\t\t\t\t\tArrayList<Gossip_user> friendlist = data.getFriends(sender);\n\t\t\t\t\t\tArrayList<Gossip_chat> chatlist = data.getChats();\n\t\t\t\t\t\t//invio dati di login\n\t\t\t\t\t\tsendReply(new Gossip_info_login_message(friendlist, chatlist, data.getUser(sender)), clientStream);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t//password errata\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.WRONGPASSWORD), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\t\n\t\t\t\tcase LOGOUT_OP: {\n\t\t\t\t\tdata.setStatus(sender, false);\n\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\t\n\t\t\t\tcase ACTION_OP:\n\t\t\t\t\tmakeAction(request, clientStream);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase LISTENING_OP:\n\t\t\t\t\tString password = Gossip_parser.getPassword(request);\n\t\t\t\t\t//memorizzo il socket solo se la password è esatta\n\t\t\t\t\tif (data.getUser(sender).getPassword().equals(password)) {\n\t\t\t\t\t\tdata.getUser(sender).setMessageSocket(clientSocket);\n\t\t\t\t\t\t//è un socket solo per le notifiche, faccio terminare il thread\n\t\t\t\t\t\tcloseThread = true;\n\t\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//termino comunque il thread\n\t\t\t\t\t\tcloseThread = true;\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.WRONGPASSWORD), clientStream);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase CHAT_OP:\n\t\t\t\t\t//operazione di interazione con chatroom\n\t\t\t\t\tmakeChatOp(request, clientStream);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.UNKNOWN_REQUEST), clientStream);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (NodeAlreadyException e) {\n\t\t\t//username già in uso\n\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.NICKALREADY), clientStream);\n\t\t} catch (NodeNotFoundException e) {\n\t\t\t//utente non registrato\n\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.NICKUNKNOWN), clientStream);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tUsers inputUser = mapper.readValue(request.getInputStream(), Users.class);\n\t\tString username = inputUser.getUName();\n\t\tString password = inputUser.getPassword();\n\t\t\n\t\t\n\t\tPrintWriter writer = response.getWriter(); //initialize printwriter\n\t\tHttpSession session=request.getSession(); //initialize session\n \n\t\tUsers userCode = service.logIn(username, password);\n\t\t\n\t\tif(userCode.getValue() ==-1)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==-2)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==3 ||userCode.getValue()==4 )\n\t\t{\n\t\t\t\n\t\t\tsession.setAttribute(\"uid\",userCode.getUserID());\n\t\t\tsession.setAttribute(\"name\",userCode.getFName());\n\t\t\tsession.setAttribute(\"roleid\",userCode.getURole().getRoleID());\n\t\t\t\n\t\t\t//resource = \"/ers/ERequest.view\";\n\t\t\t//request.getRequestDispatcher(resource).forward(request, response);\n\t\t\t//response.sendRedirect(resource);\n\t\t\t//writer.write(\"Welcome Employee\"); \n\t\t}\n\t\tresponse.setStatus(200);\n\t\tresponse.setContentType(\"application/text\");\n\t\twriter.write(userCode.getValue()+\"\");\n\t\t\t\t\n\t}", "private void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString ret = \"CallDone\";\n\t\t\tif(request.getParameter(\"cmd\").equals(\"newUser\")){\n\t\t\t\tfinal int UserID = Integer.parseInt(request.getParameter(\"UserId\"));\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"FirstTimeSecondStepStart\",UserID);\n\t\t\t\t\t\tUploadFiltersResultV2.filterExecute(UserID);\n\t\t\t\t\t\tuploadRecommendationInfo(\"FirstTimeSecondStepDone\",UserID);\t\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"maintainRecTable\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\t/*logs info uploading in the function*/\n\t\t\t\t\t\tRunRecMaintenance maintain = new RunRecMaintenance();\n\t\t\t\t\t\tmaintain.startAutomaticMaintain();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"maintainRecTableOnce\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"RecMaintainStart\",null);\n\t\t\t\t\t\tRecMaintenance maintain = new RecMaintenance();\n\t\t\t\t\t\tmaintain.maintainRecTable();\n\t\t\t\t\t\tuploadRecommendationInfo(\"RecMaintainDone\",null);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"maintainRecTableForOneUser\")){\n\t\t\t\tfinal int UserID = Integer.parseInt(request.getParameter(\"UserId\"));\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"RecMaintainStartForOne\",UserID);\n\t\t\t\t\t\tRecMaintenance maintain = new RecMaintenance();\n\t\t\t\t\t\tmaintain.maintainRecTableForOneUser(UserID);\n\t\t\t\t\t\tuploadRecommendationInfo(\"RecMaintainDoneForOne\",UserID);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"startGravity\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\t/*logs info uploading in the function*/\n\t\t\t\t\t\tCalculateGravity gravity = new CalculateGravity();\n\t\t\t\t\t\tgravity.startAutomaticGravity();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"refreshFirstStep\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"RefreshFirstStepStart\",null);\n\t\t\t\t\t\tCalculateFirstStepV2 firstStep = new CalculateFirstStepV2();\n\t\t\t\t\t\tfirstStep.startAutomaticFirstStepRefresh();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"refreshFirstStepOnce\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"RefreshFirstStepOnceStart\",null);\n\t\t\t\t\t\tCalculateFirstStepV2.refreshFirstStep();\n\t\t\t\t\t\tuploadRecommendationInfo(\"RefreshFirstStepOnceEnd\",null);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"runSecondStepForAll\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tHashMap<Integer, Long> UserAndFaceId = getAllUserId();\n\t\t\t\t\t\tfor(Entry<Integer, Long>entry: UserAndFaceId.entrySet()){\n\t\t\t\t\t\t\tInteger UserId = entry.getKey();\n\t\t\t\t\t\t\tUploadFiltersResultV2.filterExecute(UserId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\t\t\t\t\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"categorizeFacebookEvents\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\t\n\t\t\t\t\t\tuploadRecommendationInfo(\"automaticCategorizingStart\",null);\n\t\t\t\t\t\tRunFacebookEventCategorization categorization = new RunFacebookEventCategorization();\n\t\t\t\t\t\tcategorization.startAutomaticCategorization();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"categorizeFacebookEventsOnce\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"categorizingStart\",null);\n\t\t\t\t\t\tDiscriminatorCategorization categ = new DiscriminatorCategorization();\n\t\t\t\t\t\tcateg.categorizingV2();\n\t\t\t\t\t\tuploadRecommendationInfo(\"categorizingEnd\",null);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}else if(request.getParameter(\"cmd\").equals(\"debug\")){\n\t\t\t\tRunnable r = new Runnable(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tuploadRecommendationInfo(\"debugStart\",null);\n\t\t\t\t\t\t//Debug.undoFacebookDiscriminators();\n\t\t\t\t\t\tRecommenderDbService dbService = null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdbService = RecommenderDbServiceCreator.createCloud();\n\t\t\t\t\t\t\tdbService.debugFacebookEventsDELETE();\n\t\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}finally{\n\t\t\t\t\t\t\tif(dbService != null){\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tdbService.close();\n\t\t\t\t\t\t\t\t} catch (IOException | SQLException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tuploadRecommendationInfo(\"debugDone\",null);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread t = new Thread(r);\n\t\t\t\tt.start();\n\t\t\t}\n\t\t\tresponse.setContentType(\"text/html; charset=utf-8\");\n\t\t\tString responseStr = request.getParameter(\"callback\") + \"(\" + ret + \")\";//\"\"=ret\n\t\t\tresponse.getOutputStream().write(responseStr.getBytes(Charset.forName(\"UTF-8\")));\n\t}", "private static void sendRequestUserValidation(PrintWriter pw, String method, Boolean requestFileFlag, Boolean bodyFlag) {\n pw.print(method + \" /\");\n if (requestFileFlag) {\n pw.print(\"UserValidation/\");\n }\n pw.print(\" HTTP/1.1\\r\\n\");\n //request headers formation.\n pw.print(\"Host: localhost\\r\\n\\r\\n\");\n //request body formation.\n if (bodyFlag) {\n StringBuilder uvb = new StringBuilder();\n uvb.append(\"8\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"Julia\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"Samantha\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"Samantha_21\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"1Samantha\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"Samantha?10_2A\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"JuliaZ007\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"Julia@007\");\n uvb.append(System.getProperty(\"line.separator\"));\n uvb.append(\"_Julia007\");\n uvb.append(System.getProperty(\"line.separator\"));\n\n\n pw.print(uvb.toString());\n System.out.println(uvb.toString());\n }\n pw.flush();\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n HttpSession session = request.getSession();\n String cmd = request.getParameter(\"cmd\");\n if (cmd.equals(\"home\")) {\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);\n }\n else if (cmd.equals(\"testSearch\")) {\n request.setAttribute(\"allMembers\", memberMapper.getAllMembers());\n request.getRequestDispatcher(\"jsp/SearchResult.jsp\").forward(request, response);\n }\n else if (cmd.equals(\"logout\")) {\n session.setAttribute(\"user\", null);\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);\n }\n else if (cmd.equals(\"login\")) { \n try {\n if (storage.checkLogin(request.getParameter(\"username\"), Encryption.encryptThisString(request.getParameter(\"password\")))) {\n Member member = memberMapper.getMember(request.getParameter(\"username\"));\n session.setAttribute(\"user\", member);\n request.getRequestDispatcher(\"jsp/UserHome.jsp\").forward(request, response);\n }\n else {\n request.getRequestDispatcher(\"jsp/index.jsp\").forward(request, response);\n }\n } catch (NoSuchAlgorithmException ex) {\n request.getRequestDispatcher(\"jsp/index.jsp\").forward(request, response);\n }\n }\n else if(cmd.equals(\"updateMember\")) {\n String bio = request.getParameter(\"bio\");\n Member member = (Member)session.getAttribute(\"user\");\n member.setBio(bio);\n storage.updateMember(member);\n session.setAttribute(\"user\", member);\n request.getRequestDispatcher(\"jsp/UserHome.jsp\").forward(request, response);\n }\n else if (cmd.equals(\"userHome\")) {\n request.getRequestDispatcher(\"jsp/UserHome.jsp\").forward(request, response);\n }\n else if (cmd.equals(\"register\")) {\n request.getRequestDispatcher(\"jsp/RegisterMember.jsp\").forward(request, response);\n }\n else if (cmd.equals(\"createMember\")) {\n String fistName = request.getParameter(\"firstName\");\n String lastName = request.getParameter(\"lastName\");\n Gender gender = Gender.from(request.getParameter(\"gender\"));\n String username = request.getParameter(\"username\");\n String psw = request.getParameter(\"password\");\n LocalDate birthdate = LocalDate.parse(request.getParameter(\"birthdate\"));\n Member member = new Member(username, fistName, lastName, birthdate, gender);\n int id;\n try {\n id = storage.createMember(member,Encryption.encryptThisString(psw));\n if (id > 0) {\n member.setID(id);\n session.setAttribute(\"user\", member);\n request.getRequestDispatcher(\"jsp/UserHome.jsp\").forward(request, response);\n } else {\n request.getRequestDispatcher(\"jsp/RegisterMember.jsp\").forward(request, response);\n }\n } catch (NoSuchAlgorithmException ex) {\n request.getRequestDispatcher(\"jsp/RegisterMember.jsp\").forward(request, response);\n }\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n request.setCharacterEncoding(\"UTF-8\");\n response.setCharacterEncoding(\"UTF-8\");\n PrintWriter out = response.getWriter();\n\n JSONObject res_obj = new JSONObject();\n //获取前端参数\n String role_id = request.getParameter(\"role_id\");\n String pid = request.getParameter(\"pid\");\n try {\n //获取客户端真实ip地址\n String ip = Util.getClientIP(request);\n System.out.println(\"用户IP:\" + ip);\n\n UserDao userService = new UserDao();\n //根据ip查询可用的菜单\n JSONArray array = userService.queryMenuByRoleId(role_id);\n if (array != null && array.size() > 0) {\n //查询数据成功\n res_obj.put(\"code\", CONSTANTS.SUCCESS);\n res_obj.put(\"info\", CONSTANTS.INFO_QUERY_SUCCESS);\n res_obj.put(\"result\", array);\n } else {\n res_obj.put(\"code\", CONSTANTS.ERROR_QUERY_DATA);\n res_obj.put(\"info\", CONSTANTS.INFO_QUERY_FAIL);\n res_obj.put(\"result\", \"\");\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(\"数据异常,请联系管理员!\");\n //服务器发生异常情况\n res_obj.put(\"code\", CONSTANTS.ERROR_SERVER);\n res_obj.put(\"info\", CONSTANTS.INFO_SERVER_FAIL);\n res_obj.put(\"stacktrace\", e.getMessage());\n } finally {\n //将执行结果发送到前端\n System.out.println(res_obj.toString());\n out.write(res_obj.toString());\n //关闭输出流\n out.close();\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"application/json\");\n try (PrintWriter out = response.getWriter()) {\n JSONArray jArr = new JSONArray();\n ArrayList<Queue> queueList = QueueDAO.getQueue();\n for(Queue q : queueList){\n JSONObject queue = new JSONObject();\n queue.put(\"patientID\", q.getPatientID());\n queue.put(\"visitID\", q.getVisitID());\n queue.put(\"timestamp\", q.getTimestamp());\n queue.put(\"status\", q.getStatus());\n queue.put(\"name\", q.getName());\n jArr.add(queue);\n }\n out.println(jArr.toString());\n response.setStatus(HttpServletResponse.SC_OK);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"application/json;charset=utf-8\");\n try (PrintWriter out = response.getWriter()) {\n\n String file = request.getParameter(\"file\");\n String className = file.substring(0, file.indexOf(\".\"));\n\n try {\n \n JSONObject obj = new JSONObject();\n JSONArray errArray = new JSONArray();\n JSONArray outArray = new JSONArray();\n \n for(String aError : execErroutput(Config.DATA_PATH, Config.CMD_ENCODE, className)){\n errArray.put(aError);\n }\n for(String aOutput : execOutput(Config.DATA_PATH, Config.CMD_ENCODE, className)){\n outArray.put(aOutput);\n }\n \n obj.put(\"Error\", errArray);\n obj.put(\"Output\", outArray);\n \n out.println(obj.toString(4));\n \n } catch (Exception e) {\n System.err.println(e);\n }\n\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n try {\n \n String id = request.getParameter(\"id\");\n String name = request.getParameter(\"name\");\n String username = request.getParameter(\"username\");\n String mailbox = request.getParameter(\"mailbox\");\n String context = request.getParameter(\"context\");\n String type = request.getParameter(\"type\");\n String host = request.getParameter(\"host\");\n \n //VoipLigneDAO.insert(id, name, host, type, context,\"rfc2833\",\"en\", mailbox, host, username);\n \n out.println(\"enregistrement effectué!<br/>\");\n out.println(\"<a href=\\\"./userManagement.jsp\\\"></a>\");\n\n } finally { \n out.close();\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n String username = request.getParameter(\"username\");\n String password = request.getParameter(\"password\");\n EntityManager em = emf.createEntityManager();\n Query q = em.createNamedQuery(\"Users.findByUsername\");\n q.setParameter(\"username\", username);\n try {\n Users usr = (Users) q.getResultList().get(0);\n if (username.equals(usr.getUsername())) {\n if (password.equals(usr.getPassword())) {\n HttpSession ses = request.getSession();\n ses.setAttribute(\"user\", usr);\n response.sendRedirect(\"/Examfire/Home\");\n return;\n }\n }\n } catch (ArrayIndexOutOfBoundsException e) {\n request.setAttribute(\"message\", \"Your username or password Wrong!\");\n getServletContext().getRequestDispatcher(\"/WEB-INF/Login.jsp\").forward(request, response);\n }\n request.setAttribute(\"message\", \"Your username or password Wrong!\");\n getServletContext().getRequestDispatcher(\"/WEB-INF/Login.jsp\").forward(request, response);\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) {\r\n String strFollower = \"\";\r\n if(request.getParameter(\"follower\") != null){\r\n strFollower = request.getParameter(\"follower\");\r\n }\r\n //Start building the output\r\n String sOutput = \"\";\r\n Career diabloFollower = null;\r\n sOutput+= startHTML(\"Diablo Follower Overview\");\r\n sOutput+=inputHTML();\r\n \r\n if(strFollower.equals(\"enchantress\")||strFollower.equals(\"scoundrel\")||strFollower.equals(\"templar\")){\r\n Follower follower = this.makeServerAPIRequest(strFollower);\r\n sOutput+=follower.toHtmlString();\r\n }\r\n logger.log(Level.SEVERE, \"Made it to line 60\", new Exception());\r\n sOutput+=closeHTML();\r\n try{\r\n out.println(sOutput);\r\n } catch (Exception ex) {\r\n System.out.println(ex);\r\n out.println(ex);\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }\r\n \r\n\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws IOException, ServletException\n {\n String name = request.getParameter(\"txtName\");\n String lastName1 = request.getParameter(\"txtLastName1\");\n String lastName2 = request.getParameter(\"txtLastName2\");\n String userName = request.getParameter(\"hdUserName\");\n String role = request.getParameter(\"cmbRole\");\n boolean enabled = CommonFunctions.GetValue(request.getParameter(\"chkEnabled\"));\n UserBase user = new UserBase(-1, userName, name, lastName1, lastName2, role);\n\n HpcaServiceAgent agent = new HpcaServiceAgent();\n ServiceResult<Boolean> result = agent.UpdateUserPersonalInfo(user, enabled);\n\n if(result.getStatus() == ServiceResult.OperationResult.Succeeded)\n response.sendRedirect(RequestManager.AllUsersFullPage);\n else //An unexpected error occured\n RequestManager.SendUserCreationError(request, response);\n }", "@RequestMapping(value = \"\", method = RequestMethod.POST)\n\tpublic void recieve(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\trequest.setCharacterEncoding(\"UTF-8\");\n\t\tOutputStream out = response.getOutputStream();\n\t\t/**\n\t\t * 1. get the input message as a string\n\t\t */\n\t\tStringBuffer sb = new StringBuffer();\n\t\tInputStream is = request.getInputStream();\n\t\tInputStreamReader isr = new InputStreamReader(is, \"UTF-8\");\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\tString s = \"\";\n\t\twhile ((s = br.readLine()) != null) {\n\t\t\tsb.append(s);\n\t\t}\n\t\t/**\n\t\t * 2. parse the message from xml format to pojo\n\t\t */\n\t\tUserMessage message = UserMessageXMLParser.parse(sb.toString());\n\n\t\t/**\n\t\t * 3. store the input message into DB based on the input type\n\t\t */\n\t\tUserInputService.log(sb.toString());\n\n\t\t/**\n\t\t * 4. process the input message and return result to user\n\t\t */\n\t\tString user = message.getFromUserName();\n\n\t\tif (message != null && message.getMsgType().equals(\"text\")) {\n\t\t\tif (message.getContent().equals(\"bag\")) {\n\t\t\t\tNewsService.getNewsResultMessage(message, \"category\", message.getContent(), out);\n\n\t\t\t} else if (message.getContent().equals(\"lv\")) {\n\t\t\t\tNewsService.getNewsResultMessage(message, \"name\", message.getContent(), out);\n\t\t\t} else {\n\t\t\t\tmessage.display();\n\t\t\t\tString tulingresult = TulingGetResult.getResult(message.getContent());\n\t\t\t\tSystem.out.println(\"tuling result:\" + tulingresult);\n\t\t\t\tResultMessage rm = TextMessageService.process((UserTextMessage) message);\n\t\t\t\ttulingresult = TulingParser.getNormalText(tulingresult);\n\t\t\t\trm.setContent(tulingresult);\n\t\t\t\tOutPutXMLParser.parse(rm, out);\n\t\t\t}\n\n\t\t\tif (!message.getContent().equals(\"包\")) {\n\t\t\t\tmessage.display();\n\t\t\t\tString tulingresult = TulingGetResult.getResult(message.getContent());\n\t\t\t\tSystem.out.println(\"tuling result:\" + tulingresult);\n\t\t\t\tResultMessage rm = TextMessageService.process((UserTextMessage) message);\n\t\t\t\ttulingresult = TulingParser.getNormalText(tulingresult);\n\t\t\t\trm.setContent(tulingresult);\n\t\t\t\tOutPutXMLParser.parse(rm, out);\n\t\t\t} else {\n\t\t\t\tString a = \"<xml><ToUserName>\" + user + \"</ToUserName>\"\n\t\t\t\t\t\t+ \"<FromUserName>gh_156fb851cf61</FromUserName><CreateTime>1452265616</CreateTime>\"\n\t\t\t\t\t\t+ \"<MsgType>news</MsgType><ArticleCount>3</ArticleCount>\"\n\t\t\t\t\t\t+ \"<Articles><item><Title>lv</Title> <Description>pic-des-test</Description>\"\n\t\t\t\t\t\t+ \"<PicUrl>http://7xpxq6.com1.z0.glb.clouddn.com/lv.jpg</PicUrl>\"\n\t\t\t\t\t\t+ \"<Url>http://weidian.com/?userid=870151513</Url></item>\"\n\t\t\t\t\t\t+ \"<item><Title>Gucci</Title> <Description>pic-des-test</Description>\"\n\t\t\t\t\t\t+ \"<PicUrl>http://7xpxq6.com1.z0.glb.clouddn.com/gucci.jpg</PicUrl>\"\n\t\t\t\t\t\t+ \"<Url>http://weidian.com/?userid=870151513</Url></item>\"\n\t\t\t\t\t\t+ \"<item><Title>channel</Title> <Description>pic-des-test</Description>\"\n\t\t\t\t\t\t+ \"<PicUrl>http://7xpxq6.com1.z0.glb.clouddn.com/channel.jpeg</PicUrl>\"\n\t\t\t\t\t\t+ \"<Url>http://weidian.com/?userid=870151513</Url></item></Articles></xml> \";\n\t\t\t\tresponse.getWriter().write(a);\n\t\t\t}\n\t\t}\n\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n try {\n String userId=request.getParameter(\"userId\");\n String password=request.getParameter(\"password\");\n String type=\"user\";\n String auth=\"false\";\n ForRegistration fr=new ForRegistration();\n int status=fr.register(userId, password, type, auth);\n if(status>0)\n {\n request.setAttribute(\"message\",\"Registration Successful!\");\n RequestDispatcher rd=request.getRequestDispatcher(\"Registration.jsp\");\n rd.forward(request,response);\n }\n else\n {\n request.setAttribute(\"message\",\"Registration Failed! Please Try Again!\");\n RequestDispatcher rd=request.getRequestDispatcher(\"Registration.jsp\");\n rd.forward(request,response);\n }\n }\n catch(Exception e)\n {\n out.println(e);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n PrintWriter out = response.getWriter();\r\n try {\r\n JSONParser parser = new JSONParser();\r\n\r\n String username, password;\r\n boolean isexist = false;\r\n int i;\r\n\r\n try {\r\n username = request.getParameter(\"username\");\r\n password = request.getParameter(\"password\");\r\n\r\n Object obj = parser.parse(new FileReader(\"C:\\\\Users\\\\VigossZ\\\\Documents\\\\NetBeansProjects\\\\IS2560FinalProject\\\\web\\\\files\\\\api.json\"));\r\n\r\n JSONObject jsonObject = (JSONObject) obj;\r\n JSONArray userObjectarray = (JSONArray) jsonObject.get(\"userObject\");\r\n\r\n for (i = 0; i < userObjectarray.size(); i++) {\r\n JSONObject eachobj = (JSONObject) userObjectarray.get(i);\r\n String eachobjemail = eachobj.get(\"email\").toString();\r\n if (eachobjemail.equals(username)) {\r\n isexist = true;\r\n }\r\n }\r\n\r\n if (isexist)\r\n {\r\n response.sendRedirect(\"signup.html\");\r\n } else {\r\n JSONObject newuser = new JSONObject();\r\n newuser.put(\"id\", i);\r\n newuser.put(\"email\", username);\r\n JSONObject newtodolist = new JSONObject();\r\n newtodolist.put(\"content\", new JSONArray());\r\n newuser.put(\"todolist\", newtodolist);\r\n newuser.put(\"password\", password);\r\n JSONObject newnewsreader = new JSONObject();\r\n newnewsreader.put(\"bookmarks\", new JSONArray());\r\n newuser.put(\"newsreader\", newnewsreader);\r\n JSONObject newcontacts = new JSONObject();\r\n newcontacts.put(\"contact\", new JSONArray());\r\n newuser.put(\"contacts\", newcontacts);\r\n userObjectarray.add(newuser);\r\n\r\n FileWriter file = new FileWriter(\"C:\\\\Users\\\\VigossZ\\\\Documents\\\\NetBeansProjects\\\\IS2560FinalProject\\\\web\\\\files\\\\api.json\");\r\n file.write(jsonObject.toJSONString());\r\n file.flush();\r\n file.close();\r\n\r\n User user = new User();\r\n user.setUsername(username);\r\n user.setUserid(Integer.toString(i));\r\n request.getSession().setAttribute(\"user\", user);\r\n response.sendRedirect(\"home.jsp\");\r\n return;\r\n }\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n } finally {\r\n out.close();\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n HttpSession sess = request.getSession(true); // starts a new session\n String name = request.getParameter(\"user\");\n name = Jsoup.clean(name, Whitelist.simpleText());\n ArrayList<Board> boards = new ArrayList<Board>();\n sess.setAttribute(\"user\", name); // set some session attributes\n sess.setAttribute(\"boards\", boards);\n request.getRequestDispatcher(\"readFile\").forward(request, response);\n \n \n }", "protected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException\r\n\t{\r\n\t\t/**\r\n\t\t * Note: the \"resp\" is the only destination for an incoming requests\r\n\t\t */\r\n\t\tfinal long clientChannelID = Long.valueOf(req.getHeader(\"channelID\"));\r\n\t\t//final String clientID = req.getProtocol() + req.getRemoteAddr() + clientChannelID;\r\n\t\t\r\n\t\tSmartObjectInputStream input = new SmartObjectInputStream(req.getInputStream());\r\n\r\n\t\tLong xid = 0L;\r\n\t\tfinal WaitingCallback blocking = new WaitingCallback();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tchannelEndpoint.updateDeserializingThread(Thread.currentThread(),\r\n\t\t\t\t\ttrue);\r\n\t\t\tfinal CommMessage msg = CommMessage.parse(input);\r\n\t\t\txid = msg.getXID();\r\n\r\n\t\t\tsynchronized (callbacks)\r\n\t\t\t{\r\n\t\t\t\tcallbacks.put(xid + clientChannelID, blocking);\r\n\t\t\t}\r\n\t\t\tmsg.setXID(xid + clientChannelID); //update ID for preventing naming conflict\r\n\t\t\t\r\n\t\t\tchannelEndpoint.getChannelFacade().receivedMessage(this, msg);\r\n\t\t}\r\n\t\tcatch (final IOException ioe)\r\n\t\t{\r\n\t\t\tchannelEndpoint.getChannelFacade().receivedMessage(this, null);\r\n\t\t}\r\n\t\tcatch (final Throwable t)\r\n\t\t{\r\n\t\t\tt.printStackTrace();\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tchannelEndpoint.updateDeserializingThread(Thread.currentThread(),\r\n\t\t\t\t\tfalse);\r\n\t\t}\r\n\r\n\t\tCommMessage responseMsg = null;\r\n\r\n\t\t// wait for the reply\r\n\t\tsynchronized (blocking)\r\n\t\t{\r\n\t\t\tfinal long timeout = System.currentTimeMillis()\r\n\t\t\t\t\t+ CommConstants.TIMEOUT;\r\n\t\t\tresponseMsg = blocking.getResult();\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\twhile (responseMsg == null && System.currentTimeMillis() < timeout)\r\n\t\t\t\t{\r\n\t\t\t\t\tblocking.wait(CommConstants.TIMEOUT);\r\n\t\t\t\t\tresponseMsg = blocking.getResult();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (InterruptedException ie)\r\n\t\t\t{\r\n\t\t\t\tthrow new RemoteCommException(\r\n\t\t\t\t\t\t\"Interrupted while waiting for callback\", ie);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (responseMsg != null)\r\n\t\t{\r\n\t\t\tresponseMsg.setXID(responseMsg.getXID() - clientChannelID);//reset ID\r\n\t\t\tresp.setContentType(\"multipart/x-dpartner\");\r\n\t\t\tSmartObjectOutputStream output = new SmartObjectOutputStream(resp.getOutputStream());\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tchannelEndpoint.updateSerializing(Thread.currentThread(), true);\r\n\t\t\t\tresponseMsg.send(output);\r\n\t\t\t\tresp.flushBuffer();\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\tthrow e;\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tchannelEndpoint.updateSerializing(Thread.currentThread(), false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RemoteCommException(\r\n\t\t\t\t\t\"Method Invocation failed, timeout exceeded.\");\r\n\t\t}\r\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String name = request.getParameter(GenericConstants.COMPONENT_PNAME);\n \n RealTimeSUStateHelper suRTHelper = new RealTimeSUStateHelper(name);\n String responseData = suRTHelper.getServiceUnitsState();\n response.setStatus(HttpServletResponse.SC_OK);\n response.setHeader(RealTimeStatisticServlet.CONTENT_TYPE_HEADER, \n RealTimeStatisticServlet.CONTENT_TYPE_VALUE);\n response.setHeader(RealTimeStatisticServlet.CACHE_CONTROL_HEADER, \n RealTimeStatisticServlet.CACHE_CONTROL_VALUE);\n \n // Write out the message on the response stream\n OutputStream outputStream = response.getOutputStream();\n try {\n outputStream.write(responseData.getBytes());\n } catch (IOException e2) {\n }\n outputStream.flush();\n \n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) {\r\n /* TODO output your page here. You may use following sample code. */\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\");\r\n out.println(\"<title>Servlet CheckUser</title>\"); \r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n out.println(\"<h1>Servlet CheckUser at \" + request.getContextPath() + \"</h1>\");\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }\r\n }", "private void processRequestMessage(ServerSessionFactory factory, JsonObject requestJsonObject,\n final ResponseSender responseSender, String transportId) throws IOException {\n\n final Request<JsonElement> request = JsonUtils.fromJsonRequest(requestJsonObject,\n JsonElement.class);\n\n switch (request.getMethod()) {\n case METHOD_CONNECT:\n\n log.debug(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processReconnectMessage(factory, request, responseSender, transportId);\n break;\n case METHOD_PING:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processPingMessage(factory, request, responseSender, transportId);\n break;\n\n case METHOD_CLOSE:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processCloseMessage(factory, request, responseSender, transportId);\n\n break;\n default:\n\n final ServerSession session = getOrCreateSession(factory, transportId, request);\n\n log.debug(\"{} Req-> {} [jsonRpcSessionId={}, transportId={}]\", label, request,\n session.getSessionId(), transportId);\n\n // TODO, Take out this an put in Http specific handler. The main\n // reason is to wait for request before responding to the client.\n // And for no contaminate the ProtocolManager.\n if (request.getMethod().equals(Request.POLL_METHOD_NAME)) {\n\n Type collectionType = new TypeToken<List<Response<JsonElement>>>() {\n }.getType();\n\n List<Response<JsonElement>> responseList = JsonUtils.fromJson(request.getParams(),\n collectionType);\n\n for (Response<JsonElement> response : responseList) {\n session.handleResponse(response);\n }\n\n // Wait for some time if there is a request from server to\n // client\n\n // TODO Allow send empty responses. Now you have to send at\n // least an\n // empty string\n responseSender.sendResponse(new Response<Object>(request.getId(), Collections.emptyList()));\n\n } else {\n session.processRequest(new Runnable() {\n @Override\n public void run() {\n handlerManager.handleRequest(session, request, responseSender);\n }\n });\n }\n break;\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n HttpSession session = request.getSession(true);\n \n if(request.getParameter(\"Submit\") != null)\n {\n // Preleva i dati inviati e controlla se sono giusti\n String username = request.getParameter(\"nome\");\n String pwd = request.getParameter(\"pw\");\n \n //se è un cliente\n utenteCliente client = ClienteFactory.getInstance().getClient(username, pwd);\n \n if(client.getUsername().equals(username) && client.getPwd().equals(pwd))\n {\n session.setAttribute(\"loggedIn\", true);\n session.setAttribute(\"username\", client);\n session.setAttribute(\"id\", client.getId());\n session.setAttribute(\"logVenditore\", false);\n session.setAttribute(\"logCliente\", true);\n \n request.setAttribute(\"cliente\", client);\n request.getRequestDispatcher(\"cliente.jsp\").forward(request, response);\n \n \n }\n \n // se è un venditore\n utenteVenditore vend = VenditoreFactory.getInstance().getVenditore(username, pwd);\n if(vend.getUser().equals(username) && vend.getPwd().equals(pwd))\n {\n session.setAttribute(\"loggedIn\", true);\n session.setAttribute(\"username\", vend);\n session.setAttribute(\"idV\", vend.getId());\n session.setAttribute(\"logVenditore\", true);\n session.setAttribute(\"logCliente\", false);\n \n request.setAttribute(\"venditore\", vend);\n request.getRequestDispatcher(\"venditore.jsp\").forward(request, response);\n \n \n } \n \n //se non sono autenticato\n request.setAttribute(\"error\", true);\n \n }\n //Nel caso l’utente non sia autenticato, deve mostrare il form di login\n request.getRequestDispatcher(\"login.jsp\").forward(request, response);\n\n }", "private void getNodeInfo(HttpServletRequest request, HttpServletResponse response) throws NumberFormatException, ClassNotFoundException, QueryExecutionException, IOException {\n int nodeId = Integer.parseInt(request.getParameter(\"node\"));\n String nodeProp = request.getParameter(\"prop\");\n\n if (nodeProp == null) {\n response.getWriter().write(SimApi.getNodeInfo(nodeId));\n } else {\n response.getWriter().write(SimApi.getNodeInfo(nodeId, nodeProp));\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n String act,Username,goodid,sql=\"\";\n HttpSession session = request.getSession(true);\n if(session.getAttribute(\"islogin\")!=null&&session.getAttribute(\"islogin\").equals(\"true\")){\n Username = session.getAttribute(\"username\").toString();\n }else{\n request.getRequestDispatcher(\"error.jsp?error=没有登录!请登录后进行操作.\").forward(request, response);\n return;\n }\n act = request.getParameter(\"act\");\n MysqlController MC = new MysqlController();\n Cookie[] cookies = request.getCookies();\n switch(act){\n case \"add\":\n if(request.getParameter(\"goodid\")!=null){\n goodid = request.getParameter(\"goodid\");\n }else{\n request.getRequestDispatcher(\"error.jsp?error=非法操作!.\").forward(request, response);\n break;\n }\n break;\n case \"delete\":\n \n break;\n default:\n break;\n }\n if(MC.getCon()!=null){\n MC.Close();\n }\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n Usuario u = new Usuario();\r\n \r\n int error = 0;\r\n String email = request.getParameter(\"email\");\r\n String pass = request.getParameter(\"pass\");\r\n \r\n if (email != null && !email.isEmpty()) {\r\n u.setEmail(email);\r\n } else {\r\n u.setEmail(\"\");\r\n error = 1;\r\n }\r\n \r\n if (pass != null && !pass.isEmpty()) {\r\n u.setPass(pass);\r\n } else {\r\n u.setPass(\"\");\r\n error += 2;\r\n }\r\n \r\n if (error == 0) {\r\n u = usuarioFacade.findByEmail(email);\r\n if (u == null || !pass.equals(u.getPass())) {\r\n error = 4;\r\n }\r\n }\r\n \r\n String next;\r\n if (error == 0) {\r\n HttpSession session = request.getSession();\r\n session.setAttribute(\"usuarioId\", u.getId());\r\n next = \"/Principal\";\r\n } else {\r\n request.setAttribute(\"email\", email);\r\n request.setAttribute(\"pass\", pass);\r\n next = \"/login.jsp\";\r\n }\r\n request.setAttribute(\"error\", new Integer(error));\r\n \r\n RequestDispatcher rd = getServletContext().getRequestDispatcher(next);\r\n rd.forward(request, response);\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"application/json\");\n try (PrintWriter out = response.getWriter()) {\n Gson gson = new Gson();\n\n ProblemsManager problemsManager = ServletUtils.getProblemsManager(getServletContext());\n List<TimeTableProblem> problemList = problemsManager.getProblems();\n List<DTOShortProblem> shortProblemsList= new LinkedList<>();\n for(TimeTableProblem problem:problemList)\n {\n shortProblemsList.add(new DTOShortProblem(problem));\n }\n\n\n String json = gson.toJson(shortProblemsList);\n out.println(json);\n out.flush();\n }\n }", "public static String dispatch(HttpServletRequest request, HttpServletResponse response, Map<String, String> params) \n\t{\t\t\n\t\tString[] guts = request.getRequestURI().split(\"/\");\n\t\tswitch (guts[3]) {\n\t\t\tcase \"loginE.do\": // employee home\n\t\t\t\tboolean res = EmployeeDispatcher.signIn(params.get(\"username\"), params.get(\"password\"));\n\t\t\t\tif (res) return \"SUCCESS\";\n\t\t\t\telse return \"FAILED\";\n\t\t\t\t\n\t\t\tcase \"loginM.do\": // manager home\n\t\t\t\tres = ManagerDispatcher.signIn(params.get(\"username\"), params.get(\"password\"));\n\t\t\t\tif (res) return \"SUCCESS\";\n\t\t\t\telse return \"FAILED\";\n\t\t\t\t\n\t\t\tcase \"create.do\":// create employee\n\t\t\t\tres = ManagerDispatcher.createEmp(params);\n\t\t\t\tif (res) return \"SUCCESS\";\n\t\t\t\telse return \"FAILED\";\n\t\t\t\t\n\t\t\tcase \"pending.do\":// view reimbursement pending\n\t\t\t\tif (params.get(\"eid\") != null) //TODO revise\n\t\t\t\t{ return EmployeeDispatcher.viewEmployeePending(Integer.parseInt(params.get(\"eid\"))); }\n\t\t\t\telse { return ManagerDispatcher.getAllPending(); }\n\t\t\t\t\n\t\t\tcase \"resolved.do\":// view reimbursement resolved \n\t\t\t\tif (params.get(\"eid\") != null) //TODO revise\n\t\t\t\t{ return EmployeeDispatcher.viewEmployeeResolved(Integer.parseInt(params.get(\"eid\"))); }\n\t\t\t\telse { return ManagerDispatcher.getAllResolved(); }\n\t\t\t\t\n\t\t\tcase \"profiles.do\":// view employees\n\t\t\t\treturn ManagerDispatcher.getAllEmployees();\n\t\t\t\t\n\t\t\tcase \"logout.do\": // logout\n\t\t\t\treturn \"Successfully Logged out of ERS\";\n\t\t\t\t\n\t\t\tcase \"subReq.do\": //submit request\n\t\t\t\treturn EmployeeDispatcher.createReimbursementRequest(params);\n\t\t\t\t\n\t\t\tcase \"update.do\": //update employee\n\t\t\t\treturn CommonDispatcher.updateEmployeeInformation(params);\n\t\t\t\t\n\t\t\tcase \"viewE.do\": //view employee\n\t\t\t\treturn CommonDispatcher.viewEmployeeProfile(10000);//TODO remove value\n\t\t\t\t\n\t\t\tcase \"aprv.do\": //approve request\n\t\t\t\tparams.put(\"apr\", \"true\");\n\t\t\t\tManagerDispatcher.respond(params);\n\t\t\t\treturn \"Approve Completed\";\n\t\t\t\t\n\t\t\tcase \"deny.do\": //deny request\n\t\t\t\tparams.put(\"apr\", \"false\");\n\t\t\t\tManagerDispatcher.respond(params);\n\t\t\t\treturn \"Deny Completed\";\n\t\t}//end switch\n\t\treturn \"THIS IS A MESSAGE\";//TODO replace\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException \r\n {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) \r\n {\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\");\r\n out.println(\"<title>Servlet JoinGroupServlet</title>\"); \r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n out.println(\"<h1>Servlet JoinGroupServlet at \" + request.getContextPath() + \"</h1>\");\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }\r\n }", "public void processRequest(String request) {\r\n // Request for closing connection\r\n if (request.equals(\"CLOSE\")) {\r\n isOpen = false;\r\n\r\n // Request for getting all of the text on the Server's text areas\r\n } else if (request.equals(\"GET ALL TEXT\")) {\r\n String [] array = FileIOFunctions.getAllTexts();\r\n\r\n sendMessage(\"GET ALL TEXT\");\r\n sendMessage(array[0]);\r\n sendMessage(array[1]);\r\n } else {}\r\n }", "private void cadastrarUsuario(HttpServletRequest request, HttpServletResponse response) {\n\t\t\r\n\t}", "private void processRequest() throws Exception {\n\t\tString server_url = \"http://localhost:\" + socket.getPort() + \"/\";\n\t\tSystem.out.println(\"server \" + server_url);\n\t\tURL url = new URL(server_url);\n\t\tSystem.out.println(\"URL \" + url);\n\t\tInputStream in = socket.getInputStream();\n\t\tDataOutputStream op = new DataOutputStream(socket.getOutputStream());\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\t\tString requestLine = br.readLine();\n\t\tSystem.out.println();\n\t\t// information from the connection objects,\n\t\tSystem.out.println(\"------------------------------------------\");\n\t\tSystem.out.println(\"Information from the connection objects\");\n\t\tSystem.out.println(\"------------------------------------------\");\n\t\tSystem.out.println(\"RequestLine \" + requestLine);\n\t\tSystem.out.println(\"Connection received from \" + socket.getInetAddress().getHostName());\n\t\tSystem.out.println(\"Port : \" + socket.getPort());\n\t\tSystem.out.println(\"Protocol : \" + url.getProtocol());\n\t\tSystem.out.println(\"TCP No Delay : \" + socket.getTcpNoDelay());\n\t\tSystem.out.println(\"Timeout : \" + socket.getSoTimeout());\n\t\tSystem.out.println(\"------------------------------------------\");\n\t\tSystem.out.println();\n\t\tString headerLine = null;\n\t\twhile ((headerLine = br.readLine()).length() != 0) {\n\t\t\tSystem.out.println(headerLine);\n\t\t}\n // Creating the StringTokenizer and passing requestline in constructor .\n\t\t//tokens object split the requestline and create the token \n\t\tStringTokenizer tokens = new StringTokenizer(requestLine);\n\n\t\ttokens.nextToken(); // skip over the method, which should be “GET”\n\t\tString fileName = tokens.nextToken();\n\t\t// Prepend a “.” so that file request is within the current directory.\n\t\tfileName = \".\" + fileName;\n\t\tSystem.out.println(\"FileName GET\" + fileName);\n\t\t// Open the requested file.\n\t\tFileInputStream fis = null;\n\t\tboolean fileExists = true;\n\t\ttry {\n\t\t\tfis = new FileInputStream(fileName);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tfileExists = false;\n\t\t}\n\t\t// Construct the response message.\n\t\tString statusLine = null;\n\t\tString contentTypeLine = null;\n\t\tString entityBody = null;\n\t\t//Check file exist in directory or not\n\t\tif (fileExists) {\n\t\t\tstatusLine = \"200 OK \";\n\t\t\tcontentTypeLine = \"Content-Type:\" + contentType(fileName) + CRLF;\n\t\t} else {\n\t\t\tstatusLine = \"HTTP/1.1 404 Not Found:\";\n\t\t\tcontentTypeLine = \"Content-Type: text/html\" + CRLF;\n\t\t\tentityBody = \"<HTML>\" + \"<HEAD> <TITLE> Not Found</TITLE></HEAD>\" + \"<BODY> Not Found</BODY><HTML>\";\n\t\t}\n\t\t// Send the status line.\n\t\top.writeBytes(statusLine);\n\t\top.writeBytes(CRLF);\n\t\t// Send the content type line.\n\t\top.writeBytes(contentTypeLine);\n\n\t\t// Send a blank line to indicate the end of the header lines.\n\t\top.writeBytes(CRLF);\n\t\t// Send the entity body.\n\t\tif (fileExists) {\n\n\t\t\tsendBytes(fis, op);\n\n\t\t\tfis.close();\n\t\t} else {\n\t\t\top.writeBytes(entityBody);\n\t\t}\n//close the open objects\n\t\top.close();\n\t\tbr.close();\n\t\tsocket.close();\n\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException, ServletException {\n\t\tHttpSession serv = req.getSession();\n\t\tPrintWriter pout = resp.getWriter();\n\t\tJSONObject jsobj = new JSONObject();\n\n\t\tif (serv.getAttribute(\"loggedinUserId\") != null) {\n\t\t\ttry {\n\t\t\t\tjsobj.put(\"status\", true);\n\t\t\t} catch (JSONException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tpout.print(jsobj.toString());\n\t\t\treturn;\n\t\t}\n\n\t\tString name = req.getParameter(\"name\");\n\t\tString pwd = req.getParameter(\"pwd\");\n\n\t\tif (name != null) {\n\t\t\tDBUtil dbutil = new DBUtil();\n\t\t\tLong id = dbutil.validateUserLogin(name, PwdEncrypt.encrypt(pwd));\n\n\t\t\tif (id != null) {\n\t\t\t\tserv.setAttribute(\"loggedinUserName\", name);\n\t\t\t\tserv.setAttribute(\"loggedinUserId\", id);\n\t\t\t\tcom.oasishome.server.User user = dbutil.getUserById(id);\n\t\t\t\t// do the syncing here..\n\t\t\t\t// based on the Home - Hit Apis and get the devices update DB\n\t\t\t\t// accordingly ..\n\t\t\t\tString devicesList = SyncService.fetchDevicesApiHome(user\n\t\t\t\t\t\t.getMicAddress());\n\t\t\t\tif (devicesList != null) {\n\t\t\t\t\torg.json.JSONArray json;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tjson = new org.json.JSONArray(devicesList);\n\t\t\t\t\t\tSyncService.checkDevices(json, user.getMicAddress(),id);\n\t\t\t\t\t} catch (org.json.JSONException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tjsobj.put(\"status\", true);\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tjsobj.put(\"status\", false);\n\t\t\t\t\tjsobj.put(\"errorMessage\", \"username-password not valid :( \");\n\t\t\t\t} catch (JSONException 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}\n\t\t\tpout.print(jsobj.toString());\n\n\t\t}\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException\r\n {\r\n String message = request.getParameter(DATA_NAME);\r\n message = getPlainText(message);\r\n PrintWriter out = response.getWriter();\r\n out.print(prepareEnrcyptedJSONMessage(message)); \r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n Path contextPath = Paths.get(request.getServletContext().getRealPath(\"\"));\n String name = request.getServletPath().toString().substring(0, 13);\n File xmlFile = new File(contextPath.getParent().getParent().toString()+\"/database\"+name+\".xml\");\n PersonalInfoBuilder pib = new PersonalInfoBuilder();\n PersonalInfo person = pib.newPersonalInfo(xmlFile);\n PersonalInfo p = new PersonalInfo();\n \n p.setPasswordHash1(request.getParameter(\"password\"));\n if(p.getPasswordHash() != null && person.getPasswordHash().equals(p.getPasswordHash())){\n BufferedWriter br = new BufferedWriter(new FileWriter(\n new File(contextPath.getParent().getParent().toString(),\"correctPassword.txt\")));\n br.write(\"Profile can be edited by this user/program.\");\n br.close();\n response.sendRedirect(\"/CV-Generator\"+name+\".editing\");\n }else{\n response.sendRedirect(\"/CV-Generator\"+name+\".profile\");\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t\tresponse.setHeader(\"Pragma\", \"No-cache\");\r\n\t\tresponse.setHeader(\"Cache-control\", \"no-cache\");\r\n\t\tresponse.setDateHeader(\"Expires\", 0);\r\n\r\n\t\tString curRights=new String(request.getParameter(\"nodes\").getBytes(\"iso8859-1\"),\"gb2312\");\r\n\t\tString[] rights=null;//还原编号\r\n\t\tif(curRights.length()!=0)\r\n\t\t{\r\n\t\t\trights=curRights.split(\",\");\r\n\t\t}\r\n\t\t\r\n\t\tString lmBianHao=\"\";\r\n\t\t//先取出rights各个元素的右边的第一个字符(栏目名称+级别)\r\n\t\tif(rights!=null)\r\n\t\t\tfor(int i=0;i<rights.length;i++)\r\n\t\t\t{\r\n\t\t\t\tint lmLevel=Integer.parseInt(rights[i].substring(rights[i].length()-1));\r\n\t\t\t\tString lmName=rights[i].substring(0,rights[i].length()-1);\r\n\t\t\t\tif(i==0)\r\n\t\t\t\t\tlmBianHao=String.valueOf(lmService.getLmId(lmName, lmLevel, true));\r\n\t\t\t\telse\r\n\t\t\t\t\tlmBianHao=lmBianHao+\",\"+String.valueOf(lmService.getLmId(lmName, lmLevel, true));\r\n\t\t\t}\r\n\t\tcurRights=lmBianHao;\r\n\t\t//将其写入数据库\r\n\t\tPrintWriter out = response.getWriter();\r\n\t\tHttpSession session=request.getSession();\r\n\t\tint id=Integer.parseInt((String)session.getAttribute(\"rightUserId\"));\r\n\t\tString valu=\"\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tuserService.updatePermissionsById(id, curRights);\r\n\t\t\tvalu=\"success\";\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\tvalu=\"error\";\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tList<Admin> adminList=new ArrayList<Admin>();\r\n\t\tadminList=userService.selectAllUsers();\r\n\t\t//HttpSession session=request.getSession();\r\n\t\trequest.setAttribute(\"adminList\", adminList);\r\n\t\t//out.println(adminList);\r\n\t\trequest.getRequestDispatcher(\"/admin/admin_admin.jsp\").forward(request, response);\r\n\t\t\r\n\t\tout.print(valu);\r\n\t\tout.flush();\r\n\t\tout.close();\r\n\t\t//request.getRequestDispatcher(\"${pageContext.request.contextPath }/admin/admin_admin.jsp\").forward(request, response);\r\n\t}", "public void Parse() \n\tthrows BadRequestException, LengthRequestException {\n\n\t// Reading the first word of the request\n\tStringBuilder command = new StringBuilder();\n\tint c = 0;\n\ttry {\n\t while((c = userInput.read()) != -1) {\n\t\tif ((char)c == ' ')\n\t\t break;\n\t\tcommand.append((char)c);\n\t }\n\t} catch (IOException e) {\n\t System.err.println(\"[\"+new Date()+\"] ERROR : Error while reading the input stream of the client socket :\" + e.getMessage());\n\t}\t\n\n\t// Read the file key\n\tStringBuilder key = new StringBuilder();\n\ttry {\n\t while((c = userInput.read()) != -1) {\n\t\tif ((char)c == ' ')\n\t\t break;\n\t\tkey.append((char)c);\n\t }\n\t} catch (IOException e) {\n\t System.err.println(\"[\"+new Date()+\"] ERROR : Error while reading the input stream of the client socket :\" + e.getMessage());\n\t}\n\n\t// Bad key\n\tif(key.toString().length() != 32){\n\t throw new BadRequestException(\"Wrong key length\");\n\t}\n\tthis.key = key.toString();\n\n\t// Search the file in the files in shared\n\tIterator<CookieFile> it = files.iterator();\n\twhile (it.hasNext()) { \n\t CookieFile f = it.next();\n\n\t if (f.getKey().equals(this.key)) {\n\t\tf.toString();\n\t\tthis.file = f;\n\t\tbreak;\n\t }\n\t}\n\n\t// check the first \"[\"\n\ttry {\n\t c = userInput.read();\n\t if( (char)c != '[')\n\t\tthrow new BadRequestException(\"Parser unable to understand this request\");\n\t} catch (IOException e) {\n\t System.err.println(\"[\"+new Date()+\"] ERROR : Error while reading the input stream of the client socket :\" + e.getMessage());\n\t}\n\n\t// get the pieces\n\twhile(true) {\n\t int index;\n\t String data;\n\t try {\n\t\t// get the index\n\t\tStringBuilder sbIndex = new StringBuilder();\n\t\tint ck;\n\t\twhile((ck = userInput.read()) != -1) {\n\t\t if ((char)ck == ':')\n\t\t\tbreak;\n\t\t sbIndex.append((char)ck);\n\t\t}\n\t\tindex = Integer.parseInt(sbIndex.toString(), 10);\n\n\t\t// get the pieces\n\t\tif (index != file.getNbPieces()) {\n\t\t char dataBuffer[] = new char[2732/*pieceLength*/];\n\t\t userInput.read(dataBuffer, 0, 2732/*pieceLength*/);\n\n\t\t data = new String(dataBuffer);\n\t\t Piece p = new Piece(index, data);\n\t\t pieces.add(p);\n\t\t if ((ck = userInput.read()) != -1){\n\t\t\tif((char)ck == ']'){\n\t\t\t return;\n\t\t\t}\n\t\t\telse if ((char)ck != ' '){\n\t\t\t throw new BadRequestException(\"Parser unable to understand this request\");\n\t\t\t}\n\t\t }\n\t\t}\n\t\t// The last piece\n\t\telse { \n\n\t\t StringBuilder lastPiece = new StringBuilder();\n\t\t while((ck = userInput.read()) != -1) {\n\t\t\tif ((char)ck == ']')\n\t\t\t break;\n\t\t\tlastPiece.append((char)ck);\n\t\t }\n\n\t\t data = lastPiece.toString();\n\t\t Piece p = new Piece(index, data);\n\t\t pieces.add(p);\n\t\t return;\n\t\t}\n\t } catch (IOException e) {\n\t\tSystem.err.println(\"read:\"+ e.getMessage());\n\t }\n\t}\n }", "public void sendRequest(){\n fileServer.sendMessage(this.packet,new FileNode(ip,port));\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Servlet AUserServlet</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<h1>Servlet AUserServlet at \" + request.getContextPath() + \"</h1>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n\r\n String newsId = request.getParameter(\"newid\");\r\n String userId = request.getParameter(\"userid\");\r\n String content = request.getParameter(\"content\");\r\n\r\n boolean result = false;\r\n try {\r\n HttpSession session = request.getSession(false);\r\n TblUserInfo currentUser = (TblUserInfo) session.getAttribute(\"user\");\r\n if (currentUser == null) {\r\n response.sendError(403);\r\n return;\r\n }\r\n\r\n CommentService ser = new CommentService();\r\n if (XMLUltilities.isInteger(newsId) && XMLUltilities.isInteger(userId)) {\r\n result = ser.postComment(content, Integer.parseInt(userId), Integer.parseInt(newsId));\r\n }\r\n } catch (Exception e) {\r\n XMLUltilities.ExceptionLogging(e);\r\n }\r\n\r\n response.getWriter().write(\"{ \\\"success\\\" : \" + result + \" }\");\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n response.setContentType(\"text/html;charset=UTF-8\");\n\n SingletonFuncionLog singletonFuncionLog5 = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/SingletonFuncionLog\");\n this.estadisticas = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/Estadisticas\");\n \n estadisticas.nuevoAccesoCuestionarioCommand();\n\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"processRequest\");\n } catch (NamingException ex) {\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"NamingException ex\");\n\n Logger.getLogger(CuestionarioCommand.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "public void run() {\n try {\n \n // Input reader (from client)\n this.in = new BufferedReader(new InputStreamReader(this.socket.getInputStream()));\n \n // Output printer (to client)\n this.out = new PrintWriter(this.socket.getOutputStream(), true);\n \n /**\n * First, send a login request command REQUESTLOGIN\n * continuously to client until login data has been received.\n */\n while(true) {\n out.println(\"LOGINREQUEST\");\n this.request = in.readLine();\n \n // If no login data is received, keep reading inputs\n if (request == null) {\n return;\n }\n \n System.out.println(request);\n \n // Split incoming message\n this.args = this.request.split(\" \");\n \n // If client is attempting to register a new user REGISTER <username> <password>\n if(this.request.startsWith(\"REGISTER\")) {\n \n /**\n * Arguments\n * \n * args[0] = REGISTER\n * args[1] = username\n * args[2] = password\n */\n \n // Register username if not already taken.\n if(!userHandler.usernameTaken(args[1])) {\n userHandler.newUser(args[1], args[2]);\n out.println(\"REGISTERACCEPTED\");\n } else {\n out.println(\"ALREADYEXISTS\");\n }\n }\n \n // If client is attempting to log in with LOGIN <username> <password>\n if(this.request.startsWith(\"LOGIN\") && args.length == 3) {\n \n this.username = args[1].toLowerCase();\n this.password = args[2];\n \n // Attempt to authenticate user. Make sure the users list is used synchronously\n synchronized(users) {\n if(userHandler.authenticateUser(username, password)) {\n if(!users.contains(username)) {\n users.add(username);\n break;\n } else {\n out.println(\"ALREADYLOGGEDIN\");\n }\n } else {\n out.println(\"LOGINDENIED\");\n }\n }\n \n }\n }\n \n // Report back to client that login authentication succeeded.\n this.out.println(\"LOGINACCEPTED\");\n writers.add(out);\n \n /**\n * Handle incoming chat messages from client and\n * broadcast them to every connected client.\n */\n while(true) {\n this.request = in.readLine();\n \n // Skip if no request\n if(request == null) {\n continue;\n }\n \n // Split request into arguments\n this.args = request.split(\" \");\n \n // If this is a MESSAGE request from client, broadcast to everyone in chat\n if(this.request.startsWith(\"MESSAGE\") && this.args.length >= 2) {\n \n for(PrintWriter writer : writers) {\n writer.println(\"MESSAGE \" + this.username + \" \" + this.request.substring(\"MESSAGE \".length()));\n }\n \n // Write chat to file\n FileWriter fw = new FileWriter(\"chatlog.dat\", true);\n fw.write(this.username + \": \" + this.request.substring(\"MESSAGE \".length()) + \"\\n\");\n fw.close();\n }\n \n // Manual logout from client\n if(this.request.startsWith(\"LOGOUT\")) {\n \n // Remove username from users list\n if(this.username != null) {\n users.remove(this.username);\n }\n \n // Remove client from writers list\n if(this.out != null) {\n writers.remove(this.out);\n }\n \n // Close socket with client\n try {\n this.socket.close();\n } catch (IOException e) {\n System.out.println(\"Error closing socket for \" + username + \": \" + e);\n }\n }\n \n }\n \n } catch (IOException e) {\n System.out.println(e);\n } finally {\n \n /**\n * Cleanup when the client is disconnected.\n */\n \n // Remove username from users list\n if(username != null) {\n users.remove(this.username);\n }\n \n // Remove client from writers list\n if(out != null) {\n writers.remove(this.out);\n }\n \n // Close socket with client\n try {\n socket.close();\n } catch (IOException e) {\n System.out.println(\"Error closing socket for \" + username + \": \" + e);\n }\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"application/json;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n //defino una propiedad accion para que responda a una url determinada\n String accion = request.getServletPath().substring(request.getServletPath().lastIndexOf(\"/\")+1);\n //llamo al controlador\n AnimalController anic = new AnimalController();\n RespuestaServlet respuesta =new RespuestaServlet();\n switch (accion){\n case \"animal\":\n //armo lista\n List<AnimalVO> listadoAnimal = anic.consultar();\n //envio respuesta\n respuesta.setCodigo(1);\n respuesta.setMensage(\"Consulta Animal\");\n respuesta.setDatos(listadoAnimal);\n //armo un json para enviarlo a la vista\n Gson gsonConAnimal=new Gson();\n String jsonAnimal =gsonConAnimal.toJson(respuesta);\n out.println(jsonAnimal);\n\n \n break;\n case \"jaula\":\n break;\n case \"empelado\":\n break;\n case \"cliente\":\n break;\n case \"taquilla\":\n break;\n default:\n throw new AssertionError();\n }\n \n }catch(ZologicoException error){\n error.printStackTrace();\n RespuestaServlet respuesta =new RespuestaServlet();\n respuesta.setCodigo(500);\n respuesta.setMensage(\"error en actividad del servlet comuniquece con el administrador\");\n respuesta.setDatos(null);\n //armo un json para enviarlo a la vista\n Gson gson=new Gson();\n String json =gson.toJson(respuesta);\n PrintWriter out;\n out = response.getWriter();\n out.println(json);\n }\n }", "private void parse(final ServerRequest request,\n final ServerResponse response) {\n String clz = request.path().param(\"class\");\n\n try {\n clzParser.parse(rootDir,clz, javaDaoParserFactory.createDaoParser());\n JsonObject returnObject = Json.createObjectBuilder()\n .add(\"message\", clz)\n .build();\n response.send(returnObject);\n } catch (Exception e) {\n e.printStackTrace();\n JsonObject returnObject = Json.createObjectBuilder()\n .add(\"message\", e.getMessage())\n .build();\n response.send(returnObject);\n }\n\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\tHttpSession currentSession = request.getSession(false);\n\t\t\n\t\tif(currentSession == null) {\n\t\t\tSystem.out.println(\"No session... Redirecting.\");\n\t\t\tresponse.setStatus(300);\n\t\t\tresponse.setHeader(\"Location\", \"login.html\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint empId = (Integer)currentSession.getAttribute(\"employeeId\");\n\t\t\n\t\tPrintWriter pw = response.getWriter();\n\t\t\n\t\tEmployeeDAO dao = new EmployeeDAOImpl();\n\t\t\n\t\tList<List<Request>> requests = null;\n\t\t\n\t\ttry {\n\t\t\tEmployee emp = dao.getEmployee(empId);\n\t\t\tif(emp.getDepartment().equals(\"benco\")) {\n\t\t\t\trequests = GetRequests.getRequestsBenCo(empId);\n\t\t\t} else if(emp.getTitle().equalsIgnoreCase(\"department head\")) {\n\t\t\t\trequests = GetRequests.getRequestsDepartmentHead\n\t\t\t\t\t\t(empId, emp.getDepartmentId());\n\t\t\t} else {\n\t\t\t\trequests = GetRequests.getRequests(empId);\n\t\t\t}\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tpw.write(mapper.writeValueAsString(requests));\n\t}", "@POST\n @Path(\"/users/register\")\n public Response register(\n @Context HttpServletRequest request \n ,@Context HttpServletResponse response\n ,@Context ServletContext servletContext\n ,String raw\n ){\n try{\n log.debug(\"/register called\");\n// String raw=IOUtils.toString(request.getInputStream());\n mjson.Json x=mjson.Json.read(raw);\n \n Database2 db=Database2.get();\n for (mjson.Json user:x.asJsonList()){\n String username=user.at(\"username\").asString();\n \n if (db.getUsers().containsKey(username))\n db.getUsers().remove(username); // remove so we can overwrite the user details\n \n Map<String, String> userInfo=new HashMap<String, String>();\n for(Entry<String, Object> e:user.asMap().entrySet())\n userInfo.put(e.getKey(), (String)e.getValue());\n \n userInfo.put(\"level\", LevelsUtil.get().getBaseLevel().getRight());\n userInfo.put(\"levelChanged\", new SimpleDateFormat(\"yyyy-MM-dd\").format(new Date()));// nextLevel.getRight());\n \n db.getUsers().put(username, userInfo);\n log.debug(\"New User Registered (via API): \"+Json.newObjectMapper(true).writeValueAsString(userInfo));\n db.getScoreCards().put(username, new HashMap<String, Integer>());\n \n db.addEvent(\"New User Registered (via API)\", username, \"\");\n }\n \n db.save();\n return Response.status(200).entity(\"{\\\"status\\\":\\\"DONE\\\"}\").build();\n }catch(IOException e){\n e.printStackTrace();\n return Response.status(500).entity(\"{\\\"status\\\":\\\"ERROR\\\",\\\"message\\\":\\\"\"+e.getMessage()+\"\\\"}\").build(); \n }\n \n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n String query;\n ResultSet rs;\n \n Cookie loginCookie = null;\n Cookie[] cookies = request.getCookies();\n if (cookies != null) {\n for (Cookie cookie : cookies) {\n if (cookie.getName().equals(\"user\")) {\n loginCookie = cookie;\n break;\n }\n }\n }\n if (loginCookie != null) \n { \n try{\n query=\"select * from subscribers\";\n dbConnection db=new dbConnection();\n\n\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n rs=db.selectData(\"dream_event\",query);\n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\"); \n out.println(\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/stylesheet.css\\\">\");\n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<table class=\\\"table1\\\" border='1'><tr><th>Subscribers Mail ID</th></tr>\");\n while(rs.next())\n {\n out.println(\"<tr><td>\" + rs.getString(\"mail_id\") + \"</td></tr>\");\n }\n out.println(\"</table>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n }\n }catch(Exception e)\n {\n System.out.println(e.getMessage());\n }\n }\n else\n {\n try (PrintWriter out = response.getWriter()) {\n out.println(\"<h1 style=\\\"text-align:center;color:red;margin-top:200px\\\">Login to proceed!</h1>\");\n }\n }\n \n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) {\n\t\tAppDatabase db = (AppDatabase) getServletContext().getAttribute(\"db\");\n\t\t// Check to see if it's an authenticated request\n\t\tif (user == null) {\n\t\t\tSystem.out.println(\"Error getting user details. Unauthenticated request.\");\n\t\t\tresponse.setStatus(400);\n\t\t\treturn;\n\t\t}\n\t\t// The only variable we need is the target username/id\n\t\tString username = request.getParameter(\"username\");\n\t\t// Get the favorite spots, friends, and user info\n\t\tUser u = db.getUserByUsername(username);\n\t\tif (u == null) {\n\t\t\tresponse.setStatus(400);\n\t\t\tSystem.out.println(\"Error getting details for user: \" + username + \". User doesn't exist.\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Write the json to the response DataOutputStream\n\t\tString userJson = userToJson(u);\n\t\tString spotsJson = spotsToJson(db.getUserSpots(u.getId()));\n\t\tString friendsJson = friendsToJson(db.getUserFriends(u.getId()));\n\t\tSystem.out.println(\"User json: \" + userJson);\n\t\tSystem.out.println(\"Spots json: \" + spotsJson);\n\t\tSystem.out.println(\"Friends json: \" + friendsJson);\n\t\tString json = \"{\\\"user\\\":\" + userJson + \",\\\"spots\\\":\" + spotsJson + \",\\\"friends\\\":\" + friendsJson + \"}\";\n\t\tSystem.out.println(\"Final json: \" + json);\n\t\ttry {\n\t\t\tPrintWriter pw = response.getWriter();\n\t\t\tpw.write(json);\n\t\t\tpw.flush();\n\t\t\tpw.close();\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"Error writing user details response to client: \" + ioe.getMessage());\n\t\t}\n\t\t\n\t}", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, DAOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n String accion=request.getParameter(\"accion\");\r\n fabricate=new AutorPublicacionDAOFactory();\r\n daote=fabricate.metodoDAO();\r\n \r\n switch(accion)\r\n {\r\n case \"ObtenerTodosPorPublicacion\":ObtenerTodosPorPublicacion(request,response);\r\n break;\r\n case \"eliminarAutor\":eliminarAutor(request,response);\r\n break;\r\n case \"crearveryleer1\":crearveryleer1(request,response);\r\n break;\r\n case \"crearveryleer2\":crearveryleer2(request,response);\r\n break;\r\n case \"5\":\r\n break;\r\n case \"6\":\r\n break;\r\n case \"7\":\r\n break;\r\n case \"8\":\r\n break;\r\n }\r\n }", "private static void sendRequest(PrintWriter pw, String method, Boolean requestFileFlag, Boolean bodyFlag) {\n pw.print(method + \" /\");\n if (requestFileFlag) { //requestFileFlag is to specify concrete service in the server.\n //This is a wrong folder, so you should not find index.html.\n pw.print(\"xyz\");\n }\n pw.print(\" HTTP/1.1\\r\\n\");\n //request headers formation.\n pw.print(\"Host: localhost\\r\\n\\r\\n\");\n //request body formation.\n if (bodyFlag) { //bodyFlag is to specify whether to add a request body in the message.\n pw.print(\"username = Smith\\r\\n\");\n }\n pw.flush();\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n \r\n String usuario = request.getParameter(\"usuario\"); usuario = usuario == null?\"\":usuario;\r\n String password = request.getParameter(\"password\"); password = password == null?\"\":password;\r\n String mensaje = \"Hola Usuario...\";\r\n String id = \"\";\r\n \r\n usuarioDao dao = new usuarioDaoImpl();\r\n \r\n if (dao.validarDato(usuario, password)!=null) {\r\n HttpSession session = request.getSession();\r\n session.setAttribute(\"idUsuario\", dao.validarDato(usuario, password));\r\n \r\n id = dao.validarDato(usuario, password);\r\n \r\n request.setAttribute(\"user\", dao.mostrarUsuario(id));\r\n request.setAttribute(\"usuario\", usuario);//seteo de atributos desde un formulario.\r\n request.setAttribute(\"dato\", mensaje);//seteo de atributos de una variable cualquiera no recivida de un formulario.\r\n \r\n request.getRequestDispatcher(\"menu.jsp\").forward(request, response);\r\n \r\n } else {\r\n request.getRequestDispatcher(\"error.jsp\").forward(request, response);\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n Map<String, Object> toReturn = new HashMap<>();\n String type = request.getParameter(\"type\");\n\n HttpSession session = request.getSession();\n\n if (type != null) {\n if (type.equals(\"create\")) {\n //i changed this part, so you gotta change on the UI side,\n //double check the naming convention of the variables and change accordingly\n //we dont have that many columns in our database as compared to the original project\n //therefore must change some of it abit. \n //was thinking of adding in a firstname and last name in the user class to make it look like we got do more things though, that one can change after login is working\n String username = request.getParameter(\"username\");\n String password = request.getParameter(\"password\");\n String firstName = request.getParameter(\"firstName\");\n String lastName = request.getParameter(\"lastName\");\n String usertype = request.getParameter(\"usertype\");\n String pwHash = UserDAO.generateHash(password);\n String active = \"Active\";\n User current = (User) session.getAttribute(\"loginUser\");\n String manager = \"\";\n\n // Baically, if admin is creating, it will auto set the manager column in DB to Manager, if its manager creating, it will set manager\n // to Manager's first and last name\n if (current.checkAdmin().equals(\"Admin\")) {\n manager = \"Manager\";\n } else if (current.checkAdmin().equals(\"Manager\")) {\n manager = \"\" + current.getFirstName() + \" \" + current.getLastName().toUpperCase();\n }\n\n //System.out.println(\"crating user with \" + username);\n UserDAO u = new UserDAO();\n u.createUser(username, pwHash, firstName, lastName, usertype, manager, active);\n toReturn.put(\"success\", \"success\");\n write(response, toReturn);\n } else if (type.equals(\"login\")) {\n String username = request.getParameter(\"username\");\n String password = request.getParameter(\"password\");\n\n UserDAO uDAO = new UserDAO();\n Boolean login = uDAO.login(username, password);\n\n if (login) {\n User user = uDAO.retrieve(username);\n session.setAttribute(\"loginUser\", user);\n\n }\n\n toReturn.put(\"success\", login);\n write(response, toReturn);\n } else if (type.equals(\"retrieveUser\")) {\n // this part i dont really understand, i just edit to make it no error first, \n // its not gonna affect our logging in anyway\n try {\n /* TODO output your page here. You may use following sample code. */\n UserDAO userDAO = new UserDAO();\n String teamRetrieve;\n User current = (User) session.getAttribute(\"loginUser\");\n\n if (current.checkAdmin().equals(\"Admin\")) {\n teamRetrieve = \"Manager\";\n } else {\n teamRetrieve = \"\" + current.getFirstName() + \" \" + current.getLastName().toUpperCase();\n }\n\n String json = userDAO.retrieveUserInfo(teamRetrieve);\n \n\n response.getWriter().write(json);\n\n } finally {\n // out.close();\n }\n } else if (type.equals(\"deleteUser\")) {\n JSONObject transJsonObj = new JSONObject();\n try {\n transJsonObj = new JSONObject(request.getReader().readLine());\n\n } catch (IOException | JSONException e) {\n }\n try {\n String username = transJsonObj.getString(\"username\");\n\n UserDAO uDAO = new UserDAO();\n uDAO.deleteUser(username);\n\n response.getWriter().write(\"updated user\");\n } catch (JSONException ex) {\n //Logger.getLogger(admincontrol.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n //System.out.println(transJsonObj); \n } else if (type.equals(\"inactiveUser\")) {\n JSONObject transJsonObj = new JSONObject();\n try {\n transJsonObj = new JSONObject(request.getReader().readLine());\n\n } catch (IOException | JSONException e) {\n }\n try {\n String username = transJsonObj.getString(\"username\");\n\n UserDAO uDAO = new UserDAO();\n uDAO.userInactive(username);\n\n response.getWriter().write(\"updated user\");\n } catch (JSONException ex) {\n //Logger.getLogger(admincontrol.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n //System.out.println(transJsonObj); \n } else if (type.equals(\"updateUser\")) {\n try {\n //changed this part as well, same as above, chage the variable names accordingly and remove those thats not needed\n String username = request.getParameter(\"username\");\n String firstName = request.getParameter(\"firstName\");\n String lastName = request.getParameter(\"lastName\");\n String usertype = request.getParameter(\"usertype\");\n String manager = request.getParameter(\"manager\");\n\n if (usertype != null) {\n if (usertype.equals(\"Admin\")) {\n usertype = \"Admin\";\n }\n }\n String password = request.getParameter(\"password\");\n\n UserDAO uDAO = new UserDAO();\n if (password != null && !password.trim().equals(\"\")) {\n String pwHash = UserDAO.generateHash(password);\n uDAO.updateUserWithNewPw(username, firstName, lastName, usertype, pwHash);\n } else {\n uDAO.updateUser(username, firstName, lastName, usertype, manager);\n }\n response.getWriter().write(\"updated user\");\n toReturn.put(\"success\", \"success\");\n } catch (Exception e) {\n }\n } else if (type.equals(\"checkCurrentUserType\")) {\n try {\n User current = (User) session.getAttribute(\"loginUser\");\n String usertype = current.checkAdmin();\n toReturn.put(\"usertype\", usertype);\n } catch (Exception e) {\n }\n } else if (type.equals(\"makeNewMangerWithTeam\")) {\n\n UserDAO uDAO = new UserDAO();\n JSONObject transJsonObj = new JSONObject();\n try {\n transJsonObj = new JSONObject(request.getReader().readLine());\n\n } catch (IOException | JSONException e) {\n }\n try {\n\n User newManager = uDAO.retrieve(transJsonObj.getString(\"manager\"));\n String managerName = \"\" + newManager.getFirstName() + newManager.getLastName().toUpperCase();\n uDAO.makeManager(newManager.getUsername());\n\n String teamMembers = transJsonObj.getString(\"teamMembers\");\n\n ArrayList<String> members = new ArrayList<>();\n String temp = \"\";\n int start = 0;\n int end = teamMembers.indexOf(\" \");\n\n while (!teamMembers.isEmpty()) {\n members.add(teamMembers.substring(start, end));\n teamMembers = teamMembers.substring(end + 1);\n start = 0;\n end = teamMembers.indexOf(\" \");\n }\n \n for ( int i = 0; i < members.size(); i++ ) {\n uDAO.changeManager(members.get(i),managerName);\n }\n \n response.getWriter().write(\"Success, new team created with \" + managerName.toUpperCase() + \" as the manaager\");\n\n } catch (JSONException ex) {\n //Logger.getLogger(admincontrol.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n \r\n //comienza con la autentificacion que es acto 1\r\n if(\"1\".equals(request.getParameter(\"acto\"))){\r\n \r\n //verifica que no sean nullos o sin texto antes que nada los campos y en caso contrario mostrara un mensaje para que \r\n //el usuario ingrese su inicio de sesion\r\n \r\n if(!\"\".equals(request.getParameter(\"usuario\")) && request.getParameter(\"usuario\")!=null\r\n &&!\"\".equals(request.getParameter(\"clave\")) && request.getParameter(\"clave\")!=null){\r\n \r\n //se conecta a la bdd con la consulta correspondiente en la tabla usuariosla cual de todos los usuarios registrados los\r\n //reccore para ver si coinciden que el que se ha ingresado\r\n try{\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n Connection conn=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/requerimiento?zeroDateTimeBehavior=convertToNull\",\"root\",\"\");\r\n String query=\"select nick,contraseña from usuarios \";\r\n Statement st=conn.createStatement();\r\n ResultSet rs=st.executeQuery(query);\r\n while(rs.next()){\r\n \r\n //si el usuario ingresado coincide con los usuarios registrados accedera al menu principal\r\n if(request.getParameter(\"usuario\").equals(rs.getString(\"nick\"))\r\n &&request.getParameter(\"clave\").equals(rs.getString(\"contraseña\")) ){\r\n request.getRequestDispatcher(\"Menu_principal.jsp\").forward(request, response);\r\n }\r\n }{\r\n //en caso que no encuentre registros coincidentes mandara el siguiente mensaje \r\n request.setAttribute(\"vacio\",\"Su nombre de usuario y contraseña no coinciden con un usuario registrado\");\r\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);}\r\n \r\n //en caso que no este conectada la bdd mandara el siguiente mensaje y cargara la pagina otra vez \r\n //evitando que se caiga\r\n }catch(ClassNotFoundException | SQLException e){\r\n request.setAttribute(\"vacio\",\"No hay conexion\");\r\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);}\r\n }\r\n //manda el siguiente mensaje si no se ingresan datos en los campos y oprimen el submit\r\n else{\r\n request.setAttribute(\"vacio\",\"Ingrese su nombre de usuario y contraseña\");\r\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);\r\n }\r\n }\r\n \r\n //acto 2 ingresar requerimientos\r\n if(\"2\".equals(request.getParameter(\"acto\"))){ \r\n \r\n //se valida que los campos no tengan los valores por defecto de los option y el campo\r\n //descripcion verifica que no este vacio y sea menor a 300 caracteres\r\n if(!\"1\".equals(request.getParameter(\"gerencia\")) && \r\n !\"1\".equals(request.getParameter(\"departamentog\")) && \r\n !\"1\".equals(request.getParameter(\"departamentosm\")) &&\r\n !\"1\".equals(request.getParameter(\"encargados\")) &&\r\n !\"\".equals(request.getParameter(\"descripcion\")) &&\r\n 300>=request.getParameter(\"descripcion\").length() ){\r\n \r\n //conecta a la bdd cada valor a insertar sera los parametros pasados a travez de los option de cada campo mas el campo de texto\r\n //descripcion del requerimiento\r\n try{\r\n int update;\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n Connection conn=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/requerimiento?zeroDateTimeBehavior=convertToNull\",\"root\",\"\");\r\n String query=\"INSERT INTO requerimientos VALUES('\"+request.getParameter(\"gerencia\")+\"','\"+request.getParameter(\"departamentog\")+\"','\"+\r\n request.getParameter(\"departamentosm\")+\"','\"+request.getParameter(\"encargados\")+\"','\"+request.getParameter(\"descripcion\")+\"','Abierto',null)\";\r\n Statement st=conn.createStatement();\r\n update=st.executeUpdate(query);\r\n //confirma al usuario el registro del requerimiento\r\n if(update==1){\r\n request.setAttribute(\"vacio1\",\"El requerimiento se a registrado correctamente \");\r\n }\r\n request.getRequestDispatcher(\"Ingresar_requerimiento.jsp\").forward(request, response);\r\n }\r\n //en caso de falla mandara el siguiente mensaje\r\n catch(ClassNotFoundException | SQLException e){\r\n request.setAttribute(\"vacio1\",\"El requerimiento que ingreso ya se encuentra registrado o no hay conexion con la base de datos\");\r\n request.getRequestDispatcher(\"Ingresar_requerimiento.jsp\").forward(request, response);\r\n } \r\n //en caso que los campo no se ubieran ingresado valores o supere los 300 caracteres descripcion enviara el siguiente mensaje\r\n }else{\r\n request.setAttribute(\"vacio1\",\"Ingrese parametros validos, recuerde que la\"\r\n + \" descripcion del requerimiento solo puede contener maximo 300 caracateres \");\r\n request.getRequestDispatcher(\"Ingresar_requerimiento.jsp\").forward(request, response); \r\n }\r\n \r\n }\r\n \r\n \r\n \r\n \r\n //consulta los requerimietos acto 3\r\n if(\"3\".equals(request.getParameter(\"acto\"))){\r\n \r\n //se crea la consulta predeterminada\r\n String query1=\"select*from requerimientos \";\r\n String p1=\"\";\r\n String p2=\"\";\r\n String p3=\"\";\r\n \r\n //si se selecciona una opcion de gerencia agrega la condicion del where para que muestre segun ese gerente se agrega a p1 que se concatenara \r\n //con las demas variables\r\n if(!\"1\".equals(request.getParameter(\"gerencia\"))){\r\n p1=\"where gerencia='\"+request.getParameter(\"gerencia\")+\"' \";\r\n }\r\n \r\n //consulta si se ingreso un dato pregunta si se eligio un gerente estonces pasa a ser el else que pone el and en vez de where en caso que\r\n //se ubiera elegido un gerente y se concatenara con las demas\r\n if(!\"1\".equals(request.getParameter(\"departamentog\"))){\r\n \r\n if(\"\".equals(p1)){\r\n p2=\"where departamento='\"+request.getParameter(\"departamentog\")+\"' \";\r\n }else{\r\n p2=\"and departamento='\"+request.getParameter(\"departamentog\")+\"' \";\r\n }\r\n \r\n }\r\n //pregunta si selecciono un dato de los departamentos de mantencion si se selecciono una opcion si los campos anteriores no se seleccionaron\r\n // opciones se asigna la condicion where y si se seleccionaron opciones añade el and\r\n if(!\"1\".equals(request.getParameter(\"departamentosm\"))){\r\n \r\n if(\"\".equals(p1) || \"\".equals(p2)){\r\n p3=\"where departamentom='\"+request.getParameter(\"departamentosm\")+\"' \";\r\n }else{\r\n p3=\"and departamentom='\"+request.getParameter(\"departamentosm\")+\"' \";\r\n }\r\n \r\n }\r\n \r\n //se concatena tod para hacer la consulta completa segun las opciones que se eligieron \r\n String query2=query1+\"\"+p1+\"\"+p2+\"\"+p3;\r\n \r\n //se envia el string concatenado\r\n request.setAttribute(\"query1\",query2);\r\n \r\n request.getRequestDispatcher(\"Consultar_requerimientos.jsp\").forward(request, response); \r\n }\r\n \r\n \r\n \r\n \r\n //lo mismo que acto 3 consultar requerimiento este hace la consulta para buscar requerimietnos a cerrar\r\n // en cerrar requerimientos acto 4 \r\n if(\"4\".equals(request.getParameter(\"acto\"))){\r\n \r\n \r\n String query1=\"select*from requerimientos \";\r\n String p1=\"\";\r\n String p2=\"\";\r\n String p3=\"\";\r\n \r\n if(!\"1\".equals(request.getParameter(\"gerencia\"))){\r\n p1=\"where gerencia='\"+request.getParameter(\"gerencia\")+\"' \";\r\n }\r\n \r\n if(!\"1\".equals(request.getParameter(\"departamentog\"))){\r\n \r\n if(\"\".equals(p1)){\r\n p2=\"where departamento='\"+request.getParameter(\"departamentog\")+\"' \";\r\n }else{\r\n p2=\"and departamento='\"+request.getParameter(\"departamentog\")+\"' \";\r\n }\r\n \r\n }\r\n \r\n if(!\"1\".equals(request.getParameter(\"departamentosm\"))){\r\n \r\n if(\"\".equals(p1) && \"\".equals(p2)){\r\n p3=\"where departamentom='\"+request.getParameter(\"departamentosm\")+\"' \";\r\n }else{\r\n p3=\"and departamentom='\"+request.getParameter(\"departamentosm\")+\"' \";\r\n }\r\n \r\n }\r\n \r\n String query2=query1+\"\"+p1+\"\"+p2+\"\"+p3;\r\n \r\n request.setAttribute(\"query1\",query2);\r\n \r\n request.getRequestDispatcher(\"Cerrar_requerimientos.jsp\").forward(request, response); \r\n }\r\n \r\n \r\n \r\n \r\n //aqui este es el complemento de cerrar requerimiento acto 5 se envia el parametro del requerimiento a cerra\r\n //en la base de datos se les asigno un codigo unico autoincrementable que identifica los requerimientos\r\n //el cual aqui se utilizara para darle a ese requerimiento el estado de cerrado con el update\r\n if(\"5\".equals(request.getParameter(\"acto\"))){\r\n \r\n try{\r\n int update;\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n Connection conn=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/requerimiento?zeroDateTimeBehavior=convertToNull\",\"root\",\"\");\r\n String query=\"update requerimientos set estado='Cerrado' where codigo=\"+request.getParameter(\"codigo\")+\"\";\r\n Statement st=conn.createStatement();\r\n update=st.executeUpdate(query);\r\n \r\n //envia el siguiente mensaje si cambio el requerimiento correctamente\r\n if(update==1){\r\n request.setAttribute(\"vacio\",\"El requerimiento se cerro correctamente\");\r\n }\r\n request.getRequestDispatcher(\"Cerrar_requerimientos.jsp\").forward(request, response);\r\n }\r\n //en caso de error enviara el siguiente mensaje\r\n catch(ClassNotFoundException | SQLException e){\r\n request.setAttribute(\"vacio\",\"se a perdido la conexion\");\r\n request.getRequestDispatcher(\"Cerrar_requerimientos.jsp\").forward(request, response);\r\n }\r\n \r\n }\r\n }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "private void getNodeOperation(OperationResponse response, ObjectIdData requestData) {\n\t\t\n//\t\tString gehtNichtMeldung = \"{\\\"message\\\":\\\"MaPL currently is missing appropriate APIs to filter nodes intelligently.\\\"}\";\n//\t\tResponseUtil.addSuccess(response, requestData, String.valueOf(200), ResponseUtil.toPayload(gehtNichtMeldung));\n\t\t\n\t\t\n\t\trestWrapper = MapsHelpers.initRestWrapperAndLogin(getContext());\n\t\tint httpStatusCode = 200;\n\t\tLogger.severe(\"Object ID : \" + requestData.getObjectId());\n\t\tLogger.severe(\"Dynamic props : \" + requestData.getDynamicProperties().toString());\n\t\tLogger.severe(\"User def props: \" + requestData.getUserDefinedProperties().toString());\n\t\t\n\t\tif ( restWrapper != null ) {\n\t\t\tJSONArray allNodes = new JSONArray();\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tString additionalInfo = \"?withAdditionalInfo=true\";\n\t\t\t\t\n\t\t\t\tString treeId = requestData.getObjectId();\n\t\t\t\t\n\t\t\t\tLogger.severe(\"Find all nodes for tree ID \" + treeId );\n\t\t\t\t\n//\t\t\t\tResponseUtil.addSuccess(response, requestData, String.valueOf(httpStatusCode), ResponseUtil.toPayload(allNodes.toString(4)));\n//\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tString restPath = \"/node/root/\" + treeId + additionalInfo;\n\t\t\t\t\n\t\t\t\tObject result = restWrapper.httpGetRequest(restPath, new HashMap<String, String>());\n\t\t\t\t\n\t\t\t\tallNodes.put(result);\n\t\t\t\n\t\t\t\tgetChildren(allNodes, treeId, (JSONObject)result, 0);\n\t\t\t\tLogger.severe(\"Found nodes: \" + allNodes.length() );\n\t\t\t\t\n\t\t\t\thttpStatusCode = restWrapper.getHttpClient().getLastStatus();\n\t\t\t\t\n\t\t\t\tResponseUtil.addSuccess(response, requestData, String.valueOf(httpStatusCode), ResponseUtil.toPayload(allNodes.toString(4)));\n\t\t\t\t\n\t\t\t} catch (JSONException e) {\n\t\t\t\tLogger.log(Level.SEVERE, \"An error\", e);\n\t\t\t\tthrow new ConnectorException(e);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} else {\n\t\t\tresponse.addResult(requestData, OperationStatus.FAILURE, null, \"Authentication failed\", null);\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void processRequest(HttpRequest request, HttpResponse response) throws Exception {\n\t\tresponse.setHeaderField( \"Server-Name\", \"Las2peer 0.1\" );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\t\n\t\t\n\t\t\n\t\tif(authenticate(request,response))\n\t\t\tif(invoke(request,response));\n\t\t\t\t//logout(_currentUserId);\n\t \n\t\n\t\t//connector.logMessage(request.toString());\n\t\t\n\t\t\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tFileOutputStream fs = new FileOutputStream(new File(\"RegLog.txt\"));\n\t\tPrintStream p = new PrintStream(fs);\n\t\tresponse.setContentType(\"application/json\");\n\t\tresponse.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n\t\ttry{\n\t\t\tDBCall dbCall=new DBCall();\n\t\t\tFacCall facCall=new FacCall();\n\t\t\tString imageJson=request.getReader().readLine();\n\t\t\tJSONTokener jtk=new JSONTokener(imageJson);\n\t\t\tJSONObject clientJ=(JSONObject) jtk.nextValue();\n\t\t\tp.println(\"get request success\");\n\t\t\tJSONArray pic=(JSONArray) clientJ.get(\"pictures\");\n\t\t\tString facRes=facCall.register(imageJson);\n\t\t\tJSONObject facJson=new JSONObject(facRes);\n\t\t\tp.println(\"connect fac success \"+facJson);\n\t\t\tboolean facSuccess=facJson.getBoolean(\"success\");\n\t\t\tif(facSuccess==false)\n\t\t\t{\n\t\t\t\tresponse.setStatus(200);\n\t\t\t\tPrintWriter out = null;\n\t\t\t\ttry{\n\t\t\t\t\tout = response.getWriter();\n\t\t\t\t\tout.append(facRes); \n\t\t\t\t}catch (IOException e) { \n\t\t\t\t\te.printStackTrace(); \n\t\t\t\t}finally{ \n\t\t\t\t\tif (out != null) { \n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tout.close(); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tJSONArray facilitatorIds=facJson.getJSONArray(\"facilitatorIds\");\n\t\t\tString dbRes=dbCall.register(facilitatorIds,pic);\n\t\t\tJSONObject dbResJson=new JSONObject(dbRes);\n\t\t\tp.println(\"connect DB success \"+dbResJson);\n\t\t\tboolean dbSuccess=dbResJson.getBoolean(\"success\");\n\t\t\tif(dbSuccess==true)\n\t\t\t{\n\t\t\t\tresponse.setStatus(200);\n\t\t\t\tPrintWriter out = null;\n\t\t\t\ttry{\n\t\t\t\t\tout = response.getWriter();\n\t\t\t\t\tout.append(dbRes); \n\t\t\t\t}catch (IOException e) { \n\t\t\t\t\te.printStackTrace(); \n\t\t\t\t}finally{ \n\t\t\t\t\tif (out != null) { \n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tout.close(); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tJSONArray errorsJson=dbResJson.getJSONArray(\"errors\");\n\t\t\t\tJSONArray newrespJson=new JSONArray();\n\t\t\t\tint id=errorsJson.length();\n\t\t\t\tfor(int i=1;i<=id;i++)\n\t\t\t\t{\n\t\t\t\t\tJSONObject tmp=errorsJson.getJSONObject(i-1);\n\t\t\t\t\ttmp.put(\"pictureId\", i);\n\t\t\t\t\tnewrespJson.put(i-1,tmp);\n\t\t\t\t}\n\t\t\t\tJSONObject respJson=new JSONObject();\n\t\t\t\trespJson.put(\"success\", false);\n\t\t\t\trespJson.put(\"pictureErrors\", newrespJson.toString());\n\t\t\t\tresponse.setStatus(200);\n\t\t\t\tPrintWriter out = null;\n\t\t\t\ttry{\n\t\t\t\t\tout = response.getWriter();\n\t\t\t\t\tout.append(respJson.toString()); \n\t\t\t\t}catch (IOException e) { \n\t\t\t\t\te.printStackTrace(); \n\t\t\t\t}finally{ \n\t\t\t\t\tif (out != null) { \n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tout.close(); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}catch(JSONException e) {\n\t\t\tresponse.setStatus(500);//json¸ñʽÒì³£\n\t\t\tresponse.getWriter().write(\"json form error\");\n\t\t\tp.println(\"Json form Error\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally{p.close();}\n\t}", "public void handleClientRequest() {\n System.out.println(\"... new ConnectionHandler constructed ...\");\n try {\n while (true) {\n // Get input data from client over socket\n String line = br.readLine();\n String[] lineArray = line.split(\" \");\n String requestType = lineArray[0];\n String resourceName = lineArray[1];\n // Log this request\n log.append(\"\\nRequest at \").append(fldt).append(\":\\n\").append(line);\n log.newLine();\n File f = new File(path + resourceName);\n String contentLength = String.valueOf(f.length());\n\n // Interpret request and respond accordingly\n if (!f.isFile()) {\n byte[] response = getHeader(404, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n404 Not Found\");\n log.newLine();\n break;\n } else if (requestType.contains(\"GET\")) {\n byte[] header = getHeader(200, contentLength, resourceName);\n byte[] content = getContent(f);\n byte[] response = new byte[header.length + content.length];\n System.arraycopy(header, 0, response, 0, header.length);\n System.arraycopy(content, 0, response, header.length, content.length);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"HEAD\")) {\n byte[] response = getHeader(200, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"DELETE\")) {\n f.delete();\n break;\n } else {\n byte[] response = getHeader(501, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n501 Not Implemented\");\n log.newLine();\n break;\n }\n }\n cleanUp();\n } catch (IOException | IndexOutOfBoundsException e) {\n System.err.println(\"ConnectionHandler:handleClientRequest (error): \" + e.getMessage());\n cleanUp();\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n \r\n try (PrintWriter out = response.getWriter()) {\r\n modeloOfertas.actualizarEstados();\r\n if (request.getSession().getAttribute(\"correo\") == null || !request.getSession().getAttribute(\"estadoUsuario\").toString().equals(\"2\")) {\r\n response.sendRedirect(request.getContextPath() + \"/usuarios.do?operacion=login\");\r\n return;\r\n }\r\n String operacion = request.getParameter(\"operacion\");\r\n\r\n switch (operacion) {\r\n\r\n case \"home\":\r\n request.getRequestDispatcher(\"/Empresa/Home.jsp\").forward(request, response);\r\n break;\r\n case \"listarOferta\":\r\n listarOferta(request, response);\r\n break;\r\n case \"nuevaOferta\":\r\n nuevaOferta(request, response);\r\n break;\r\n case \"detalleOferta\":\r\n detalleOferta(request, response);\r\n break;\r\n case \"listarEmpleado\":\r\n listarEmpleado(request, response);\r\n break;\r\n case \"nuevoEmpleado\":\r\n request.getRequestDispatcher(\"/Empresa/NuevoEmpleado.jsp\").forward(request, response);\r\n break;\r\n case \"eliminarEmpleado\":\r\n eliminarEmpleado(request, response);\r\n break;\r\n case \"updateC\":\r\n request.getRequestDispatcher(\"/Empresa/cambiarContrasena.jsp\").forward(request, response);\r\n break;\r\n case \"cambiarC\":\r\n cambiarContrasena(request, response);\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(EmpresasController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n //文字コードをUTF-8に変更\n request.setCharacterEncoding(\"UTF-8\");\n \n //フォームから送られてきた入力情報をStringに格納\n String name = request.getParameter(\"name\");\n String password = request.getParameter(\"password\");\n \n //<未入力項目があった場合の処理>\n //未入力項目名が格納できる配列を作成\n //if(フォームに未入力があった場合)\n //配列にその項目名を追加\n //if(配列の要素数が0でない場合) ※フォームに未入力があった場合\n //未入力項目名の情報をリクエストパラメータに格納\n //フォームから送られてきた入力情報を配列を使用してセッションに格納\n //loginresultfalse.jspに遷移 \n ArrayList<String> nullLogin = new ArrayList<String>();\n if(name.equals(\"\")) { nullLogin.add(\"ユーザー名\"); }\n if(password.equals(\"\")){ nullLogin.add(\"パスワード\"); }\n if(nullLogin.size() != 0){\n request.setAttribute(\"nullLogin\", nullLogin);\n HashMap<String, String> loginNull = new HashMap<String, String>();\n loginNull.put(\"name\", name);\n loginNull.put(\"password\", password);\n HttpSession session = request.getSession();\n session.setAttribute(\"loginNull\", loginNull);\n request.getRequestDispatcher(\"/loginresultfalse.jsp\").forward(request, response);\n }else{\n \n //else(配列の要素が0である場合) ※フォームに未入力がない場合\n //<DB検索でデータが該当するかどうかの処理>\n //フォーム入力情報をUserDataに格納\n //DB検索を実行\n //結果をbooleanで受け取る\n //if(trueの場合)   ※データが該当した場合\n //ログインに成功情報をログイン状態を管理できるセッション(\"loginState\")に書き込み\n //各ページのログインボタンから遷移してきているのでページに関するセッション情報(\"pageCheck\")を取得\n //ページ遷移した後の「ようこそ○○さん」の表示のためにセッション(\"userSearch\")にUserData(loginState)の情報を格納\n //取得したページ情報をもとに直前まで閲覧していたページに遷移\n //else(falseの場合) ※データが該当しなかった場合\n //フォーム入力情報(\"loginNull\")を更新\n //リクエストパラメータにログイン失敗した旨を格納\n //loginresultfalse.jspに遷移\n try{\n UserData loginState = new UserData();\n loginState.setName(name);\n loginState.setPassword(password);\n \n boolean searchResult = UserDataDAO.getInstance().search(loginState);\n HttpSession session = request.getSession();\n \n if(searchResult){\n session.setAttribute(\"loginState\", \"connected\");\n String pageCheck = (String)session.getAttribute(\"pageCheck\");\n session.setAttribute(\"userSearch\", loginState);\n request.getRequestDispatcher(pageCheck).forward(request, response); \n }else{\n HashMap<String, String> loginNull = new HashMap<String, String>();\n loginNull.put(\"name\", name);\n loginNull.put(\"password\", password);\n session.setAttribute(\"loginNull\", loginNull);\n request.setAttribute(\"falseLogin\", \"該当するユーザー情報はありませんでした。\");\n request.getRequestDispatcher(\"/loginresultfalse.jsp\").forward(request, response); \n } \n }catch(Exception e){\n //何らかの理由で失敗したらエラーページにエラー文を渡して表示。想定は不正なアクセスとDBエラー\n request.setAttribute(\"error\", e.getMessage());\n request.getRequestDispatcher(\"/error.jsp\").forward(request, response);\n }\n }\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\ttry {\t\n\t\t\tint userId = (int) request.getAttribute(\"userid\");\n\t\t\tBufferedReader in = request.getReader();\n\t\t\tGson gson = new Gson();\n\t\t\tString bodyText = HelperClass.readBody(in);\n\t\t\tPurchaseTicketsUserModel body = gson.fromJson(bodyText, PurchaseTicketsUserModel.class);\n\t\t\tResultSet resultSet = DBManager.getInstance().selectTickets(body.getEventid(), userId);\n\t\t\tresponse.setStatus(setResponse(resultSet, body, userId));\n\t\t} catch (SQLException e) {\n\t\t\tlog.error(e);\n\t\t\tresponse.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}", "public void infoServiceRequest(String requestType, String param){\r\n \r\n InetAddress destAddr = null;\r\n String[] nodeInfo = null;\r\n String ip = this.getPeerIP().split(\":\")[0].substring(2);\r\n try {\r\n destAddr = InetAddress.getByName(ip);\r\n } catch (UnknownHostException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n int destPort = Integer.parseInt(managerInfoServicePort);\r\n \r\n DataOutputStream output;\r\n DataInputStream input;\r\n \r\n Socket sock = null;\r\n boolean connected = false;\r\n while (!connected) {\r\n try {\r\n sock = new Socket(destAddr, destPort);\r\n connected = true;\r\n } catch (IOException ex) {\r\n try {\r\n Thread.sleep(500);\r\n } catch (InterruptedException ex1) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex1), \"severe\");\r\n }\r\n }\r\n }\r\n try {\r\n output = new DataOutputStream(sock.getOutputStream());\r\n input = new DataInputStream(sock.getInputStream()); \r\n \r\n if(requestType.equals(\"UPDATE\")){\r\n output.writeUTF(requestType+\"-LOCAL\");\r\n output.flush();\r\n String infoServiceList = input.readUTF();\r\n infoSys.updateInfo(infoServiceList);\r\n }\r\n else if(requestType.equals(\"POISON\")){\r\n output.writeUTF(requestType+\"-LOCAL-\"+param);\r\n output.flush();\r\n infoSys.removeInfo(param);\r\n }\r\n else if(requestType.equals(\"ADD\")){\r\n output.writeUTF(requestType+\"-LOCAL-\"+param);\r\n output.flush();\r\n String infoServiceList = input.readUTF();\r\n //update local information service list\r\n infoSys.updateInfo(infoServiceList);\r\n }\r\n else if(requestType.equals(\"CPT-UPDATE\")){\r\n output.writeUTF(requestType);\r\n output.flush();\r\n String cptNode = input.readUTF();\r\n String[] cptNodes = cptNode.split(\", \");\r\n List singleCptList = new ArrayList<String>();\r\n for(int i = 0 ; i < cptNodes.length; ++i){\r\n singleCptList.add(cptNodes[i].substring(1,cptNodes[i].indexOf(\"]\")));\r\n }\r\n updateSubscriberList(\"CPT\",singleCptList); \r\n }\r\n else if(requestType.equals(\"CPT-DELETE\")){\r\n output.writeUTF(requestType+\"-\"+param);\r\n output.flush();\r\n subscriberList.get(\"CPT\").remove(param);\r\n }\r\n else if(requestType.equals(\"REQ-UPDATE\")){\r\n output.writeUTF(requestType);\r\n output.flush();\r\n String reqNode = input.readUTF();\r\n String[] reqNodes = reqNode.split(\", \");\r\n List reqList = new ArrayList<String>();\r\n for(int i = 0 ; i < reqNodes.length; ++i){\r\n reqList.add(reqNodes[i].substring(1,reqNodes[i].indexOf(\"]\")));\r\n }\r\n updateSubscriberList(\"REQ\",reqList); \r\n }\r\n else if(requestType.equals(\"REQ-DELETE\")){\r\n output.writeUTF(requestType+\"-\"+param);\r\n output.flush();\r\n subscriberList.get(\"REQ\").remove(param);\r\n }\r\n output.close();\r\n input.close();\r\n sock.close();\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String user = request.getParameter(\"user\");\n char[] pass = request.getParameter(\"pass\").toCharArray();\n char[] repeat = request.getParameter(\"repeat\").toCharArray();\n\n // do a basic minimum of input validation \n // should really also check if password contains what we want\n if (pass.length != repeat.length) {\n response.sendRedirect(\"nomatch.html\");\n return;\n }\n for (int i = 0; i < pass.length; i++) {\n if (pass[i] != repeat[i]) {\n response.sendRedirect(\"nomatch.html\");\n return;\n }\n }\n\n // create a password hash\n PasswordAuthentication pa = new PasswordAuthentication();\n String token = pa.hash(pass);\n\n // clear password and repeat char[]\n for (int i = 0; i < pass.length; i++) {\n pass[i] = 0;\n }\n for (int i = 0; i < repeat.length; i++) {\n repeat[i] = 0;\n }\n\n // connect to the database\n try (Connection con = DbConnection.get()) {\n\n // check if the username already exists\n if (userDao.existsUser(con, user)) {\n response.sendRedirect(\"userexists.html\");\n return;\n\n }\n if (!userDao.addUser(con, user, token)) {\n try (PrintWriter out = response.getWriter()) {\n out.write(\"SQL Insert Failed\");\n }\n return;\n }\n \n response.sendRedirect(\"registered.html\");\n\n\n } catch (SQLException ex) {\n Logger.getLogger(AddUser.class.getName()).log(Level.SEVERE, null, ex);\n try (PrintWriter out = response.getWriter()) {\n out.write(\"SQL Exception: \" + ex.getMessage());\n }\n }\n\n }", "@Override\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) {\n\n\t\tString message = request.getParameter(\"message\");\n\t\tString nickname = request.getParameter(\"nickname\");\n\t\t\n\t\tDao2 dao = new Dao2();\n\t\t\n\t\tUserDto dto = dao.usInfo(nickname);\n\t\t\n\t\tint userseq = dto.getUserseq();\n\t\tint myseq = Integer.parseInt(request.getParameter(\"myseq\"));\n\t\t\n\t\t//System.out.println(myseq);\n\t\tdao.SendMessage(myseq, userseq, message);\n\t\n\t\t\n\t}", "public synchronized void processReq() throws UnknownHostException, IOException, InterruptedException{\n\t\tsynchronized(quorum.locked){\n\n\t\t\tString words[] = msgFromClient.split(\" \");\n\t\t\tint reqNode = Integer.parseInt(words[1]);\n\t\t\tint reqPriority = Integer.parseInt(words[2]);\n\t\t\t\n\t\t\t//Ticking clock for reciept of request\n\t\t\ttry {\n\t\t\t\tclock.tick(0, reqPriority);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif(quorum.locked.get()){\n\t\t\t\tSystem.out.println(t.getName() + \"\\t ****** Quorum is LOCKED for \"+ quorum.getPermissionGivenTo() + \" ****** \");\n\t\t\t\t//**************** If locked, then add to the queue and send INQ or FAIL msgs ***********************\n\t\t\t\t\n\t\t\t\t//Putting in queue\n\t\t\t\tsynchronized(q){\n\t\t\t\t\tq.put(msgFromClient);\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\tSize of queue: \" + q.getQueue().size());\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\tCONTENTS OF THE QUEUE: \");\n\t\t\t\t\tq.printQueue();\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check whether to send INQ or FAIl\t\t\t\t\t\t\n\t\t\t\tint currNode = quorum.getPermissionGivenTo();\n\t\t\t\tint currPriority = quorum.getPermissionGivenToPriority();\n\t\t\t\t\n\t\t\t\t//If new request has higher priority, send INQ to the node with the token, JUST ONCE\n\t\t\t\tif(reqPriority < currPriority && quorum.isCanSendInq()){\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\t___New REQ has HIGHER priority___\");\n\t\t\t\t\tsendInq(myNodeId, currNode, quorum, clock);\n\t\t\t\t\t\n\t\t\t\t\t//Sent an INQ already to node whose is request is being processed. Can't send anymore INQ\n\t\t\t\t\tquorum.setCanSendInq(false);\n\t\t\t\t}\n\t\t\t\telse if(reqPriority == currPriority && reqNode < currNode && quorum.isCanSendInq()){\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\t_____ New REQ has SAME priority but LOWER NodeId___\");\n\t\t\t\t\tsendInq(myNodeId, currNode, quorum, clock);\n\t\t\t\t\t\n\t\t\t\t\t//Sent an INQ already to node whose is request is being processed. Can't send anymore INQ\n\t\t\t\t\tquorum.setCanSendInq(false);\n\t\t\t\t}\n\t\t\t\t//If new request has lower priority, send FAIL to requesting node, JUST ONCE\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\t___FAILED__\");\n\t\t\t\t\tsendFail(myNodeId, reqNode, quorum, clock);\n\t\t\t\t\t\n\t\t\t\t\t//If a fail has been sent to the node, further fails can't be sent\n\t\t\t\t\t//quorum.getSentFailTo().add(reqNode);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(t.getName() + \"\\t ****** Quorum is NOT LOCKED for \"+ quorum.getPermissionGivenTo() + \" ****** \");\n\t\t\t\t\n\t\t\t\t//Sending TOKEN to self\n\t\t\t\tif(reqNode == myNodeId){\n\t\t\t\t\tSystem.out.println(t.getName()+\"\\t********* Received TOKEN of OWN node *********\");\n\t\t\t\t\t\n\t\t\t\t\t//Remove the nodeId from the list of tokenPending\n\t\t\t\t\tquorum.removePermissionPending(reqNode);\n\t\t\t\t\t\n\t\t\t\t\t//Check if it can enter critical section\n\t\t\t\t\tif(quorum.canEnterCritSec())\n\t\t\t\t\t\tcritSecExec(myNodeId, quorum, file, clock);\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(t.getName() + \"\\tCAN'T ENTER CRITICAL SECTION YET. PERMISSIONS PENDING FROM: \");\n\t\t\t\t\t\tquorum.printPermissionsPendingList();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Setting details of request for which the TOKEN was sent\n\t\t\t\t\tquorum.setReqWithToken(msgFromClient);\n\t\t\t\t\tquorum.setPermissionGivenTo(reqNode);\n\t\t\t\t\tquorum.setPermissionGivenToPriority(reqPriority);\n\t\t\t\t\t\n\t\t\t\t\t//New TOKEN granted and so canSendInq and canSendFail booleans should be allowed\n\t\t\t\t\tquorum.setCanSendInq(true);\n\t\t\t\t\t//quorum.setCanSendFail(true);\n\t\t\t\t\t\n\t\t\t\t\t//Locking node for current request\n\t\t\t\t\tquorum.locked.compareAndSet(false, true);\n\n\t\t\t\t\t//continue;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Sending TOKEN to others\n\t\t\t\t\tString destIpAdd = file.getIpAddressList().get(reqNode);\n\t\t\t\t\tint destPort = file.getPortList().get(reqNode);\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\tDestIpAdd: \" + destIpAdd + \" DestPortNo: \" + destPort);\n\t\t\t\t\t\n\t\t\t\t\t//Setting client according to the quorum hashMap\n\t\t\t\t if(quorum.getQuorumSockets().containsKey(reqNode)){\n\t\t\t\t \tSystem.out.println(t.getName() + \"\\tGetting old socket\");\n\t\t\t\t\t\tclient = quorum.getQuorumSockets().get(reqNode);\n\t\t\t\t }\n\t\t\t\t\telse{\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tSystem.out.println(t.getName() + \"\\tCreating new socket\");\n\t\t\t\t\t\t\tclient = new Socket(destIpAdd, destPort);\n\t\t\t\t\t\t\tquorum.getQuorumSockets().put(reqNode, client);\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t\t //Ticking clock for SEND event\n\t\t\t\t /*try {\n\t\t\t\t\t\tclock.tick(0, 0);\n\t\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}*/\n\t\t\t\t \n\t\t\t\t\t//****************** If unlocked, check for no pending requests ***********************\n\n\t\t\t\t\toutToClient = new DataOutputStream(client.getOutputStream());\n\t\t\t\t\tString msgToSend = \"TOK \" + myNodeId + \" \" + clock.getClockVal();\n\t\t\t\t\t\n\t\t\t\t\tsynchronized(outToClient){\n\t\t\t\t\t\toutToClient.writeBytes(msgToSend+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(t.getName()+ \"\\t***************** PERMISSION GRANTED TOKEN TO: \" + reqNode + \" ******************\");\n\t\t\t\t\t\n\t\t\t\t\t//Setting details of request for which the TOKEN was sent\n\t\t\t\t\tquorum.setReqWithToken(msgFromClient);\n\t\t\t\t\tquorum.setPermissionGivenTo(reqNode);\n\t\t\t\t\tquorum.setPermissionGivenToPriority(reqPriority);\n\t\t\t\t\t\n\t\t\t\t\t//New TOKEN granted and so canSendInq and canSendFail booleans should be allowed\n\t\t\t\t\tquorum.setCanSendInq(true);\n\t\t\t\t\t\n\t\t\t\t\t//Locking node for current request\n\t\t\t\t\tquorum.locked.compareAndSet(false, true);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\ttry {\n\t\t\tprocessRequest(request, response);\n\t\t} catch (NamingException ex) {\n\t\t\tLogger.getLogger(u_SendMessage.class.getName()).log(Level.SEVERE, null, ex);\n\t\t} catch (SQLException ex) {\n\t\t\tLogger.getLogger(u_SendMessage.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n \n //----------------------------------------------------------------------------------------------------\n //CONTROL DE ACCESO\n //----------------------------------------------------------------------------------------------------\n String referer = request.getHeader(\"referer\");\n \n HttpSession session=request.getSession();\n String usuario = (String) session.getAttribute(NombreSesiones.USUARIO.getValor());\n Boolean esAdm = (Boolean) session.getAttribute(NombreSesiones.USUARIO_ADM.getValor());\n Boolean esAlu = (Boolean) session.getAttribute(NombreSesiones.USUARIO_ALU.getValor());\n Boolean esDoc = (Boolean) session.getAttribute(NombreSesiones.USUARIO_DOC.getValor());\n Retorno_MsgObj acceso = Seguridad.GetInstancia().ControlarAcceso(usuario, esAdm, esDoc, esAlu, utilidades.GetPaginaActual(referer));\n\n if (acceso.SurgioError() && !utilidades.GetPaginaActual(referer).isEmpty()) {\n mensaje = new Mensajes(\"Acceso no autorizado - \" + this.getServletName(), TipoMensaje.ERROR);\n System.err.println(\"Acceso no autorizado - \" + this.getServletName() + \" - Desde: \" + utilidades.GetPaginaActual(referer));\n out.println(utilidades.ObjetoToJson(mensaje));\n }\n else\n {\n String action = request.getParameter(\"pAction\");\n String retorno = \"\";\n\n if(usuario != null) perUsuario = (Persona) LoPersona.GetInstancia().obtenerByMdlUsr(usuario).getObjeto();\n\n\n switch(action)\n {\n\n case \"INSERT\":\n retorno = this.AgregarDatos(request);\n break;\n\n case \"UPDATE\":\n retorno = this.ActualizarDatos(request);\n break;\n\n case \"DELETE\":\n retorno = this.EliminarDatos(request);\n break;\n\n case \"OBTENER\":\n retorno = this.ObtenerDatos(request);\n break;\n\n }\n\n out.println(retorno);\n }\n }\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException\n\t{\n\n\t\trequest.setCharacterEncoding(\"utf-8\");\n\t\tresponse.setContentType(\"text/html;charset=utf-8\");\n\t\tPrintWriter out = response.getWriter();\n\t\t// 创建数据库连接\n\t\tJdbcUtils jdbcUtils = new JdbcUtils();\n\t\tjdbcUtils.getConnection();\n\t\t// FileUtil fileUtil = new FileUtil();\n\t\t// String str =\n\t\t// fileUtil.loadFile(\"E:/Code/JavaWeb/myEclipse/WebSocket_1/WebRoot/myfile/json.json\",\"utf-8\");\n\t\ttry {\n\t\t\tString sql2 = \"select * from EmptyUser\";\n\t\t\tString list = jdbcUtils.findModeResultToString(sql2,\n\t\t\t\t\tnull);\n\t\t\t\n\t\t\tlist = (\"[{\"+list+\"}]\").replace(\",}]\",\"}]\");\n\t\t\tSystem.out.println(list);\n//\t\t\tJsonUtils.parseUserFromJson(list);\n\t\t\tout.println(list);\n\t\t} catch (SQLException e) {\n\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tjdbcUtils.releaseConn();\n\t\t}\n\t\t\n\t\t\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try{\r\n HttpSession session = (HttpSession) request.getSession();\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n DtCliente usuario = (DtCliente) session.getAttribute(\"usuario_logueado\");\r\n String nombre = (String) request.getParameter(\"nombreLista\");\r\n // Llama a la instancia del sistema\r\n Interfaz sistema = Fabrica.getInstance().getInterfaz();\r\n // Crea los datos necesarios para realizar la llamada\r\n DtListaReproduccionPersonalizada LR = new DtListaReproduccionPersonalizada(nombre, new ArrayList(), usuario.getNick(), false, null);\r\n // Realiza la llamada a la funcion necesaria \r\n sistema.crearListaReproduccion(LR);\r\n // De ser correcto el caso se redirije a la pagina de caso correcto\r\n request.getRequestDispatcher(\"/WEB-INF/Paginas de verificacion/JSPcorrecto.jsp\").forward(request,response);\r\n } catch(Exception e){\r\n // Si en algun momento salta una exception se redirije a una pagina de error, \r\n // de ser asi se podra agregar mas catch con otros tipos de excepsiones ya que esta es muy general\r\n request.getRequestDispatcher(\"/WEB-INF/Paginas de verificacion/JSPerror.jsp\").forward(request,response);\r\n }\r\n }" ]
[ "0.6193863", "0.6036721", "0.60309947", "0.5989549", "0.59739906", "0.5968205", "0.59162736", "0.58716", "0.58591574", "0.58347917", "0.58145607", "0.5757616", "0.5751143", "0.5720772", "0.57164663", "0.5693545", "0.5674772", "0.5668415", "0.5658284", "0.5637865", "0.5633663", "0.563108", "0.56281066", "0.56279993", "0.561318", "0.5612465", "0.5574612", "0.5574601", "0.55735725", "0.5572552", "0.5572005", "0.55638844", "0.55588716", "0.5549817", "0.5548191", "0.5546338", "0.5538621", "0.5535718", "0.55254924", "0.55071604", "0.5496812", "0.54965615", "0.54965013", "0.54854566", "0.5481464", "0.5477296", "0.54724747", "0.5469796", "0.5468127", "0.5464468", "0.5459313", "0.54591906", "0.5447235", "0.5442373", "0.54363424", "0.54232484", "0.54179674", "0.54138273", "0.5408236", "0.54067", "0.5403195", "0.5394271", "0.53889334", "0.53887004", "0.5379737", "0.53743696", "0.5373922", "0.5372607", "0.53671145", "0.53561133", "0.5355137", "0.5353257", "0.5349018", "0.5336421", "0.53316396", "0.5330596", "0.5327769", "0.53265905", "0.53227216", "0.53202736", "0.531761", "0.53118414", "0.5309707", "0.53055614", "0.5297728", "0.5296891", "0.52968585", "0.5296549", "0.5295154", "0.5289164", "0.5286269", "0.527002", "0.52664894", "0.52638423", "0.5262579", "0.5260246", "0.5259083", "0.52588135", "0.5250542", "0.5249834" ]
0.63031495
0
This is the line written from gitbash and pushed to github//
@Parameters({ "browser" }) @BeforeSuite public void setUpInParent(@Optional(browser_name) String browser) { configFile = new ReadProperties(config_file_path); String chrome_path = configFile.getPropertyValue(browser_name); String url_location = configFile.getPropertyValue(browser_url); if (browser.equalsIgnoreCase(browser_name)) { System.setProperty(webdriver_chrome_driver, chrome_path); driver = new ChromeDriver(); driver.get(url_location); driver.manage().deleteAllCookies(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS); } wait=new WebDriverWait(driver, 5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void gitThis(){\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"nagarjuna is .................\");\r\n//second commit\r\nSystem.out.println(\"vinay is ..............................\");\r\n//third commit\r\nSystem.out.println(\"vinay is a ?\");\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hellow GitHub!!!\");\n\t\t// commit testing...\n\t\t// add: line 9 write...\n\t\tSystem.out.println(\"add code\");\n\t\t\n\t\tint a = 0;\n\t\tfor(int i=0; i<5; i++) {\n\t\t\ta++;\n\t\t}\n\t\tSystem.out.println(a);\n\t}", "private void checkout(){\n Scanner input = new Scanner(System.in);\n System.out.println(\"checkout commit : \");\n System.out.println(\"masukan nama commit : \"); // nama commit bukan kode hash\n String value = input.nextLine();\n \n // overwrite file commit ke file-untuk-git\n overWriteFile(\"file-untuk-git\", value + \".txt\", false);\n \n \n }", "public static void main(String[] args) {\nSystem.out.println(\"day one example how to use git\");\r\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"This is for git\");\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"this is git learing \");\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\" commit\");\n\t\tSystem.out.println(\"3rd commit\");\n\t\tSystem.out.println(\"final commit\");\n\t\tSystem.out.println(\"pull\");\n\t}", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(\"github\");\r\n\t\t\r\n\t\tSystem.out.println(\"changed it for job text\");\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"This is commited by GitData\");\n\n\t}", "public static void main(String[] args) {\n\n\t\tString mensajeGit = \"Hello Git and GitHub, a bug was fixed!!\";\n\t\t\n\t\t/* String mensajeGit = \"Hello Git!\";\n\t\t * String mensajeGit = \"Hello GitHub!\";\n\t\t * String mensajeGit = \"Hello Git and GitHub!\";\n\t\t * String mensajeGit = \"Hello Git a bug was fixed!!\";\n\t\t * String mensajeGit = \"Hello Git and GitHub, a bug was fixed!!\";\n\t\t*/\n\t\t\n\t\tSystem.out.println(\"<<< \" + mensajeGit + \" >>>\");\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"git hi\");\r\n\t\tSystem.out.println(\"git 연습1\");\r\n\t}", "private void commitInitialize(String message){\n Scanner input = new Scanner(System.in);\n if(initialize == null) {\n initialize = new GitHead();\n System.out.println(\"tolong bilang saya anda siapa ? \");\n System.out.println(\"tolong isi username dan email\");\n System.out.println(\"masukan username : \");\n String userName = input.nextLine();\n System.out.println(\"masukan email : \");\n String email = input.nextLine();\n initialize.setUserName(userName);\n initialize.setUserEmail(email);\n // pointer.setInitialize(pointer);\n initialize.setHead(initialize);\n initialize.message = message;\n last = initialize;\n }\n overWriteFile(message,\"file-untuk-git.txt\", true);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "protected void post_commit_hook() { }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Primer commit\");\r\n\t\tSystem.out.println(\"18/05/2020 - segundo commit\");\r\n\t\tSystem.out.println(\"Rosana - tercer commit\");\r\n\t\tSystem.out.println(\"prueba - sexto commit\");\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hola_Git\"\r\n\t\t\t\t+ \"Un placer\");\r\n\t\tSystem.out.println(\"change2\");\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tString string = \"Hello Git and GitHub, a bug was fixed!!\";\n\t\t\n\t\t System.out.println( \" \" + string + \" \");\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.print(\"This is added code\");\n\t\tSystem.out.print(\"This is added code from GitHub\");\n\n\t}", "public static String transformGFM(IStoredSettings settings, String input, String repositoryName) {\r\n\t\tString text = input;\r\n\r\n\t\t// strikethrough\r\n\t\ttext = text.replaceAll(\"~~(.*)~~\", \"<s>$1</s>\");\r\n\t\ttext = text.replaceAll(\"\\\\{(?:-){2}(.*)(?:-){2}}\", \"<s>$1</s>\");\r\n\r\n\t\t// underline\r\n\t\ttext = text.replaceAll(\"\\\\{(?:\\\\+){2}(.*)(?:\\\\+){2}}\", \"<u>$1</u>\");\r\n\r\n\t\t// strikethrough, replacement\r\n\t\ttext = text.replaceAll(\"\\\\{~~(.*)~>(.*)~~}\", \"<s>$1</s><u>$2</u>\");\r\n\r\n\t\t// highlight\r\n\t\ttext = text.replaceAll(\"\\\\{==(.*)==}\", \"<span class='highlight'>$1</span>\");\r\n\r\n\t\tString canonicalUrl = settings.getString(Keys.web.canonicalUrl, \"https://localhost:8443\");\r\n\r\n\t\t// emphasize and link mentions\r\n\t\tString mentionReplacement = String.format(\" **[@$1](%1s/user/$1)**\", canonicalUrl);\r\n\t\ttext = text.replaceAll(\"\\\\s@([A-Za-z0-9-_]+)\", mentionReplacement);\r\n\r\n\t\t// link ticket refs\n\t\tString ticketReplacement = MessageFormat.format(\"$1[#$2]({0}/tickets?r={1}&h=$2)$3\", canonicalUrl, repositoryName);\n\t\ttext = text.replaceAll(\"([\\\\s,]+)#(\\\\d+)([\\\\s,:\\\\.\\\\n])\", ticketReplacement);\n\n\t\t// link commit shas\r\n\t\tint shaLen = settings.getInteger(Keys.web.shortCommitIdLength, 6);\r\n\t\tString commitPattern = MessageFormat.format(\"\\\\s([A-Fa-f0-9]'{'{0}'}')([A-Fa-f0-9]'{'{1}'}')\", shaLen, 40 - shaLen);\r\n\t\tString commitReplacement = String.format(\" [`$1`](%1$s/commit?r=%2$s&h=$1$2)\", canonicalUrl, repositoryName);\r\n\t\ttext = text.replaceAll(commitPattern, commitReplacement);\r\n\r\n\t\tString html = transformMarkdown(text);\r\n\t\treturn html;\r\n\t}", "public void testGitHub() {\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"trying git\"); \r\n\t\tSystem.out.println(\"Getting there\");\r\n\t\t//Faisel\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello\");\n\t\t//ADDing comment 1 in testRebase branch\n\t\t//Adding commit2 in testRebase branch\n\t\t\n\t\t\n\t\t//Add commit 1.1 in master branch\n\n\t}", "public static void main(String[] args) {\n\t\t\tSystem.out.println(\"git_test!\");\n\t}", "public static void main(String[] args) {\n\n\t\tSystem.out.println(\"THis is my new claas in local repo\");\n\t\tSystem.out.println(\"Lets make some changes on local class and again we have to push that class in GIT\");\n\t}", "private void newline() {}", "public void push(TaskMonitor aTM) throws Exception\n{\n // Get repository and git\n Git git = getGit();\n \n // Get push\n PushCommand push = git.push();\n push.setProgressMonitor(getProgressMonitor(aTM));\n if(getCD()!=null) push.setCredentialsProvider(getCD());\n for(PushResult pr : push.call())\n System.out.println(\"Pushed: \" + pr);\n}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello Git\");\n\t\tSystem.out.println(\"添加更新1\");\n\t\tSystem.out.println(\"添加更新2\");\n\t\tSystem.out.println(\"添加更新3\");\n\t\tSystem.out.println(\"创建分支\");\n\t\tSystem.out.println(\"主干添加\");\n\t\tSystem.out.println(\"分支添加\");\n\t\tSystem.out.println(\"本地库更新\");\n\t\tSystem.out.println(\"在线添加\");\n\t}", "public void print(){\t\t\r\n\t\tSystem.out.println(\"===\\nCommit \" + id +\"\\n\"+ Time + \"\\n\" + message + \"\\n\");\r\n\t}", "public static void main(String[] args) {\n \n new Scanner (System.in); \n System.out.println(\"Estoy probando GIT y GIT HUB\");\n System.out.println(\"Ahora estoy probando a crear una segunda versión.\");\n System.out.println(\"Estoy probando GIT y GIT HUB\");\n \n }", "String getCommitMessageForLine(IPath filePath, int line);", "private void publishLine(String msg) {\r\n\t\ttaOutput.appendText(msg);\r\n\t\ttaOutput.appendText(\"\\n\");\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(\"Submitted Fourth project -branch 2 shelve\");\r\n\t}", "public void log() {\n String headID = head.getCommitID();\n while (headID != null) {\n File curr = new File(\".gitlet/commits/\" + headID);\n Comm currcomm = Utils.readObject(curr, Comm.class);\n System.out.println(\"===\");\n System.out.println(\"commit \" + currcomm.getCommitID());\n if (currcomm.getMergepointer() != null) {\n System.out.println(\"Merge: \"\n + currcomm.getParent().getCommitID()\n .substring(0, 7) + \" \"\n + currcomm.getMergepointer().getCommitID()\n .substring(0, 7));\n }\n System.out.println(\"Date: \" + currcomm.getDate());\n System.out.println(currcomm.getMessage());\n System.out.println();\n if (currcomm.getParent() == null) {\n break;\n } else {\n headID = currcomm.getParent().getCommitID();\n }\n }\n }", "public static void main(String[] args) {\n System.out.println(\"GitHub is for everyone!\");\n }", "public void addAllCommitPush(String message) throws IOException, GitAPIException {\n gitProjectUuidStore.pull().setTransportConfigCallback(transportConfigCallback).call();\n gitProjectZoneController.pull().setTransportConfigCallback(transportConfigCallback).call();\n //TODO: Add Missing Repos\n\n System.out.println(\"git add all files \");\n gitProjectUuidStore.add().addFilepattern(\".\").call();\n //Only commit and push in RELEASE MODE\n if(Play.current().isProd()) {\n CommitCommand commit = gitProjectUuidStore.commit();\n commit.setMessage(message).call();\n gitProjectUuidStore.push().setTransportConfigCallback(transportConfigCallback).call();\n }\n }", "private void addLine (String line) {\n writer.write (line);\n writer.newLine();\n // blockOut.append (line);\n // blockOut.append (GlobalConstants.LINE_FEED);\n }", "public static void main(String[] args) {\nint score = 91;\nString grade;\nif (score >90)\n{\n\tgrade = \"A\";\n}\n\n\n\nelse if (score>=80)\n{\n\tgrade = \"B\";\n}\n//THis is to test Git\n//THis is to test Git\n//THis is to test Git2\n//This is to test the brach made by gitdemo\n//Change from GitX\nelse \n{\n\tgrade = \"C\";\n}\nSystem.out.println(grade);\n}", "private String buildReflogMessage(String commitMessage, boolean amending) {\n \t\tString firstLine = commitMessage;\n \t\tint newlineIndex = commitMessage.indexOf(\"\\n\");\n \t\tif (newlineIndex > 0) {\n \t\t\tfirstLine = commitMessage.substring(0, newlineIndex);\n \t\t}\n \t\tString commitStr = amending ? \"\\tcommit (amend):\" : \"\\tcommit: \";\n \t\tString message = commitStr + firstLine;\n \t\treturn message;\n \t}", "GitCommit(RevCommit anRC) { _rev = anRC; }", "public int getLine()\n/* */ {\n/* 1312 */ return this.line;\n/* */ }", "public void add(int x, int y, String l)\n {\n if( r != null )\n {\n r.append(String.format(\"Commit @ [%d, %d, %s];\", x, y, l));\n r.flush();\n }\n }", "public static void main(String[] args) {\nSystem.out.println(\"hi\");\r\nSystem.out.println(\"neelu\");\r\nSystem.out.println(\"change qu kiya\");\r\nSystem.out.println(\"neeraj...\");\r\nSystem.out.println(\"push\");\r\nSystem.out.println(\"push again\");\r\nSystem.out.println(\"changes done again\");\r\n\t}", "private void updateChangeMessage(final CVSChangeLog change, final String line) {\n String message = change.getMsg();\n if (message.isEmpty()) {\n message += line;\n } else {\n message += LINE_SEPARATOR + line;\n }\n change.setMsg(message);\n }", "@EventHandler\n\tvoid signWriter(SignChangeEvent event) {\n\t\tString[] lines = event.getLines();\n\t\tif (ChatColor.stripColor(lines[0]).equalsIgnoreCase(\"[MarioKart]\")) {\n\t\t\tlines[0] = MarioKart.colors.getTitle() + \"[MarioKart]\";\n\t\t\tBoolean text = true;\n\t\t\tString cmd = ChatColor.stripColor(lines[1]);\n\t\t\tif (cmd.equalsIgnoreCase(\"list\")) {\n\t\t\t\tlines[1] = MarioKart.colors.getInfo() + \"List\";\n\t\t\t\tif (!(lines[2].length() < 1)) {\n\t\t\t\t\ttext = false;\n\t\t\t\t}\n\t\t\t\tlines[2] = MarioKart.colors.getSuccess()\n\t\t\t\t\t\t+ ChatColor.stripColor(lines[2]);\n\t\t\t} else if (cmd.equalsIgnoreCase(\"join\")) {\n\t\t\t\tlines[1] = MarioKart.colors.getInfo() + \"Join\";\n\t\t\t\tlines[2] = MarioKart.colors.getSuccess()\n\t\t\t\t\t\t+ ChatColor.stripColor(lines[2]);\n\t\t\t\tif (lines[2].equalsIgnoreCase(\"auto\")) {\n\t\t\t\t\tlines[2] = MarioKart.colors.getTp() + \"Auto\";\n\t\t\t\t}\n\t\t\t\tlines[3] = MarioKart.colors.getInfo() + lines[3];\n\t\t\t\ttext = false;\n\t\t\t} else if (cmd.equalsIgnoreCase(\"shop\")) {\n\t\t\t\tlines[1] = MarioKart.colors.getInfo() + \"Shop\";\n\n\t\t\t} else if (cmd.equalsIgnoreCase(\"leave\")\n\t\t\t\t\t|| cmd.equalsIgnoreCase(\"exit\")\n\t\t\t\t\t|| cmd.equalsIgnoreCase(\"quit\")) {\n\t\t\t\tchar[] raw = cmd.toCharArray();\n\t\t\t\tif (raw.length > 1) {\n\t\t\t\t\tString start = \"\" + raw[0];\n\t\t\t\t\tstart = start.toUpperCase();\n\t\t\t\t\tString body = \"\";\n\t\t\t\t\tfor (int i = 1; i < raw.length; i++) {\n\t\t\t\t\t\tbody = body + raw[i];\n\t\t\t\t\t}\n\t\t\t\t\tbody = body.toLowerCase();\n\t\t\t\t\tcmd = start + body;\n\t\t\t\t}\n\t\t\t\tlines[1] = MarioKart.colors.getInfo() + cmd;\n\t\t\t} else if (cmd.toLowerCase().contains(\"items\")) {\n\t\t\t\tlines[1] = \"items\";\n\t\t\t\t/*\n\t\t\t\tLocation above = event.getBlock().getLocation().add(0, 1.4, 0);\n\t\t\t\tEnderCrystal crystal = (EnderCrystal) above.getWorld()\n\t\t\t\t\t\t.spawnEntity(above, EntityType.ENDER_CRYSTAL);\n\t\t\t\tabove.getBlock().setType(Material.COAL_BLOCK);\n\t\t\t\tabove.getBlock().getRelative(BlockFace.WEST)\n\t\t\t\t\t\t.setType(Material.COAL_BLOCK);\n\t\t\t\tabove.getBlock().getRelative(BlockFace.NORTH)\n\t\t\t\t\t\t.setType(Material.COAL_BLOCK);\n\t\t\t\tabove.getBlock().getRelative(BlockFace.NORTH_WEST)\n\t\t\t\t\t\t.setType(Material.COAL_BLOCK);\n\t\t\t\tcrystal.setFireTicks(0);\n\t\t\t\tcrystal.setMetadata(\"race.pickup\", new StatValue(true, plugin));\n\t\t\t\t\n\t\t\t\t*/\n\t\t\t\ttext = false;\n\t\t\t\tevent.getPlayer().sendMessage(\"Creating item box...\");\n\t\t\t\tMarioKart.powerupManager.spawnItemPickupBox(event.getBlock().getLocation());\n\t\t\t} else if(cmd.equalsIgnoreCase(\"queues\")){ \n\t\t\t\tString track = ChatColor.stripColor(lines[2]);\n\t\t\t\tif(track.length() < 1){\n\t\t\t\t\treturn; //No track\n\t\t\t\t}\n\t\t\t\ttrack = plugin.signManager.getCorrectName(track);\n\t\t\t\tif(!plugin.trackManager.raceTrackExists(track)){\n\t\t\t\t\tevent.getPlayer().sendMessage(MarioKart.colors.getSuccess()+MarioKart.msgs.get(\"setup.fail.queueSign\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//Register sign\n\t\t\t\tplugin.signManager.addQueueSign(track, event.getBlock().getLocation());\n\t\t\t\t//Tell the player it was registered successfully\n\t\t\t\tevent.getPlayer().sendMessage(MarioKart.colors.getSuccess()+MarioKart.msgs.get(\"setup.create.queueSign\"));\n\t\t\t\tfinal String t = track;\n\t\t\t\tMarioKart.plugin.getServer().getScheduler().runTaskLater(plugin, new BukkitRunnable(){\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tplugin.signManager.updateSigns(t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}}, 2l);\n\t\t\t\t\n\t\t\t\ttext = false;\n\t\t\t} else {\n\t\t\t\ttext = false;\n\t\t\t}\n\t\t\tif (text) {\n\t\t\t\tlines[2] = ChatColor.ITALIC + \"Right click\";\n\t\t\t\tlines[3] = ChatColor.ITALIC + \"to use\";\n\t\t\t}\n\t\t}\n\t}", "public void stdOutputLine(String line) { \n debug(\"output:\"+line);\n if (line.equals(FINAL_SPLIT)) {\n if (addingDescription) {\n addingDescription = false;\n logInfo.setDescription(tempBuffer.toString());\n }\n if (addingLogMessage) {\n addingLogMessage = false;\n revision.setMessage(findUniqueString(tempBuffer.toString(), messageList));\n }\n if (revision != null) {\n logInfo.addRevision(revision);\n revision = null;\n }\n \n if (logInfo != null) { \n resultList.add(logInfo);\n // logInfo = null;\n tempBuffer = null;\n }\n return;\n }\n if (addingLogMessage) {\n // first check for the branches tag\n if (line.startsWith(BRANCHES)) {\n processBranches(line.substring(BRANCHES.length()));\n }\n else {\n processLogMessage(line);\n return;\n }\n }\n if (addingSymNames) { \n processSymbolicNames(line);\n }\n if (addingDescription) {\n processDescription(line);\n }\n // revision stuff first -> will be the most common to parse\n if (line.startsWith(REVISION)) {\n processRevisionStart(line);\n }\n if (line.startsWith(DATE)) {\n processRevisionDate(line);\n }\n\n if (line.startsWith(KEYWORD_SUBST)) {\n logInfo.setKeywordSubstitution(line.substring(KEYWORD_SUBST.length()).trim().intern());\n addingSymNames = false;\n return;\n }\n\n if (line.startsWith(DESCRIPTION)) {\n tempBuffer = new StringBuffer(line.substring(DESCRIPTION.length()));\n addingDescription = true;\n }\n\n if (line.indexOf(LOGGING_DIR) >= 0) {\n fileDirectory = line.substring(line.indexOf(LOGGING_DIR) + LOGGING_DIR.length()).trim();\n debug(\"fileDirectory: \"+fileDirectory);\n return;\n }\n if (line.startsWith(RCS_FILE)) {\n processRcsFile(line.substring(RCS_FILE.length()));\n return;\n }\n if (line.startsWith(WORK_FILE)) {\n processWorkingFile(line.substring(WORK_FILE.length()));\n return;\n }\n if (line.startsWith(REV_HEAD)) {\n logInfo.setHeadRevision(line.substring(REV_HEAD.length()).trim().intern());\n return;\n }\n if (line.startsWith(BRANCH)) {\n logInfo.setBranch(line.substring(BRANCH.length()).trim().intern());\n }\n if (line.startsWith(LOCKS)) {\n logInfo.setLocks(line.substring(LOCKS.length()).trim().intern());\n }\n if (line.startsWith(ACCESS_LIST)) {\n logInfo.setAccessList(line.substring(ACCESS_LIST.length()).trim().intern());\n }\n if (line.startsWith(SYM_NAME)) {\n addingSymNames = true;\n }\n if (line.startsWith(TOTAL_REV)) {\n int ind = line.indexOf(';');\n if (ind < 0) {\n // no selected revisions here..\n logInfo.setTotalRevisions(line.substring(TOTAL_REV.length()).trim().intern());\n logInfo.setSelectedRevisions(\"0\"); //NOI18N\n }\n else {\n String total = line.substring(0, ind);\n String select = line.substring(ind, line.length());\n logInfo.setTotalRevisions(total.substring(TOTAL_REV.length()).trim().intern());\n logInfo.setSelectedRevisions(select.substring(SEL_REV.length()).trim().intern());\n }\n }\n }", "public static void log() {\n String branch = commitPointers.readHeadCommit()[0];\n String currName = commitPointers.readHeadCommit()[1];\n File cFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n Commit curr = Utils.readObject(cFile, Commit.class);\n\n while (currName != null) {\n System.out.println(\"===\");\n System.out.println(\"commit \" + curr.commitID);\n if (curr.parentID.size() == 2) {\n System.out.println(\"Merge: \" + curr.parentID.get(0).substring(0, 7) + \" \" + curr.parentID.get(1).substring(0, 7));\n }\n System.out.println(\"Date: \" + curr.timeStamp.format(myFormatObj) + \" -0800\");\n System.out.println(curr.message);\n System.out.println();\n\n currName = curr.parentID.get(0);\n\n if (currName != null) {\n File newcFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n curr = Utils.readObject(newcFile, Commit.class);\n }\n }\n }", "private void displayLine()\n {\n System.out.println(\"#################################################\");\n }", "Git getGit();", "public static void main(String[] args) {\n\t\tSystem.out.println(\"20162891 ¹Ú¼º¹Î\");\r\n\t\tSystem.out.println(\"hotfix + \");\r\n\t}", "private HelloGitUtil(){\n\t}", "@FXML\n private void git(MouseEvent event) throws URISyntaxException, IOException {\n Desktop desktop = Desktop.getDesktop();\n desktop.browse(new URI(\"https://github.com/ashMohseni\"));\n }", "void commit() {\n }", "public void getBranchCommand() {\n\n }", "public static void main(String[] args) {\nSystem.out.println(\"this is one java program\");\r\n//this is the gerrit Example\r\n\t}", "public String Line() {\n return \"==================================================================================================================\";\n }", "public static void main(String[] args) {\n\t\tString name = \"bij\\\"a\\\"n\";\n\t\tSystem.out.println(\"repository test\");\n\t\tSystem.out.println(\"repository test 2 \");\n\t\tSystem.out.println(name);\n\t}", "private static String authorLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, NAME_STR, NAME);\n }", "public abstract void newLine();", "String branch();", "private void commit(){\n System.out.println(\"Masukan pesan commit : \");\n Scanner input = new Scanner(System.in);\n String message = input.nextLine();\n \n if(initialize == null){\n commitInitialize(message);\n } else {\n commitNext(message);\n }\n }", "public static void main(String[] args) {\n\n System.out.println(\"Many Munya Hello World 2020 \");\n\t System.out.println( \"Hi just added one branch called First\");\n }", "void push(RemoteConfig repository, String revspec) throws GitException, InterruptedException;", "@Override\r\n\tpublic void doThing() {\n\t\tSystem.out.print(\"ÎäÆ÷ÊDZ¦½£,\");\r\n\t}", "void putLine(String line);", "public void addCommitPush(String nameFileToAdd, String message) throws IOException, GitAPIException {\n gitProjectUuidStore.pull().setTransportConfigCallback(transportConfigCallback).call();\n gitProjectZoneController.pull().setTransportConfigCallback(transportConfigCallback).call();\n //TODO: Add Missing Repos\n\n System.out.println(\"git add file: \" + nameFileToAdd);\n gitProjectUuidStore.add().addFilepattern(nameFileToAdd).call();\n CommitCommand commit = gitProjectUuidStore.commit();\n commit.setMessage(message).call();\n gitProjectUuidStore.push().setTransportConfigCallback(transportConfigCallback).call();\n }", "public static void main(String[] args) {\n System.out.println(\"Testando o Git\");\r\n System.out.println(\"Tomara que tudo tenha saido corretamente!\");\r\n JOptionPane.showMessageDialog(null, \"Deu tudo certo\");\r\n }", "private static String lastModifiedLine(String lastModified)\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, \n MODIFIED_STR, lastModified);\n }", "private long commit(byte[] e) throws IOException, ClassNotFoundException, CheatAttemptException {\n\t\t\n\t\tCmtCommitValue val = committer.generateCommitValue(e);\n\t\tlong id = random.nextLong();\n\t\tcommitter.commit(val, id);\n\t\treturn id;\n\t\t\n\t}", "private static String getOutputMsg(String line){\n String[] arr = line.split(\" \");\n return arr[0] + \"|\" + arr[3].replace(\"[\",\"\");\n }", "private void addLine()\n\t{\n\t\tlines.add(printerFormatter.markEOL());\n\t}", "private String convertToStringLine(ProjectFilePart pfp) {\r\n return Base16.encode(pfp.getRelativeName().getBytes()) + \"~\" + Base16.encode(pfp.getHash().toByteArray()) + \"~\" + Base16.encode(pfp.getPadding()) + \"~\\n\";\r\n }", "@Test\n public void authorDateWithSubsecondsCorrectlyPopulated() throws Exception {\n fetch = primaryBranch;\n push = primaryBranch;\n\n Files.write(workdir.resolve(\"test.txt\"), \"some content\".getBytes(UTF_8));\n\n ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(\n Instant.ofEpochMilli(1496333940012L), ZoneId.of(\"-04:00\"));\n DummyRevision firstCommit = new DummyRevision(\"first_commit\")\n .withAuthor(new Author(\"Foo Bar\", \"[email protected]\"))\n .withTimestamp(zonedDateTime);\n process(firstCommitWriter(), firstCommit);\n\n String authorDate = git(\"log\", \"-1\", \"--pretty=%aI\");\n\n assertThat(authorDate).isEqualTo(\"2017-06-01T12:19:00-04:00\\n\");\n }", "protected static String br() {\n return \"\\r\\n\";\n }", "GitRemote(String aName) { _name = aName; }", "@Test\n\tpublic static void m() {\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Sample 3 added in eclipse\");\n\t\tSystem.out.println(\"to test upstream\");\n\t\tSystem.out.println(\"Sample 3 added in eclipse new line in system locally\");\n\t}", "String getCheckinComment();", "public void printModified() {\n System.out.println(\"\\n\"\n + \"=== Modifications Not Staged For Commit ===\");\n }", "public int postPullRequestComment(BuildInfo buildInfo, String message, String path, Integer lineNumber) throws IOException {\n StashComment comment = new StashComment();\n comment.setText(message);\n if (path != null) {\n StashAnchor anchor = new StashAnchor();\n String unixPath = path.replaceAll(\"\\\\\\\\\", \"/\");\n anchor.setPath(unixPath);\n anchor.setSourcePath(unixPath);\n if (lineNumber != null && lineNumber > 0) {\n anchor.setLine(lineNumber);\n anchor.setLineType(StashLineType.CONTEXT);\n }\n comment.setAnchor(anchor);\n }\n\n try {\n String url = stashUrl + \"/rest/api/1.0/projects/\" + buildInfo.getProjectKey() + \"/repos/\" + buildInfo.getRepositoryName() + \"/pull-requests/\" + buildInfo.getPullRequestId() + \"/comments\";\n ErrorReporter.get().printNotice(\"post \" + url);\n initObjectMapper();\n\n String requestBody = getObjectMapper().writeValueAsString(comment);\n ErrorReporter.get().printNotice(\"body: (application/json) \" + requestBody);\n\n HttpRequestWithBody request = Unirest.post(url)\n .header(\"content-type\", \"application/json\");\n if(credentials != null) {\n request.basicAuth(credentials.getUsername(), credentials.getPassword().getPlainText());\n }\n HttpResponse<JsonNode> response = request\n .body(comment)\n .asJson();\n\n if (response.getStatus() != 201) {\n throw new IOException(\"Wrong response status \" + response.getStatus() + \", expected 200\");\n }\n return response.getBody().getObject().getInt(\"id\");\n } catch (UnirestException e) {\n throw new IOException(e);\n }\n }", "@Override\n\tpublic void commit() {\n\n\t}", "public void print_line(String who, String line) {\n Log.i(\"IncomingSyncHandler\" + who, line);\n }", "public abstract void commitSprintBacklog();", "private Status processComment(final String line, final CVSChangeLogSet.File file, final CVSChangeLog change,\n final Status currentStatus, final Map<String, String> branches,\n final String previousLine, final List<CVSChangeLog> changes, final Map<String, CvsFile> files,\n final CvsRepositoryLocation location, final String prePreviousLine, final EnvVars envVars) {\n if (line != null && line.startsWith(FILE_DIVIDER)) {\n if (previousLine.equals(CHANGE_DIVIDER)) {\n updateChangeMessage(change, previousLine);\n }\n return currentStatus;\n } else if (previousLine != null && previousLine.startsWith(FILE_DIVIDER)) {\n if (line != null && line.isEmpty()) {\n //we could be on a line between files\n return currentStatus;\n } else {\n updateChangeMessage(change, previousLine);\n }\n } else if (prePreviousLine != null && prePreviousLine.startsWith(FILE_DIVIDER)) {\n // we've reached the end of the changes for the current file. Save the current change\n // and start processing the next file\n if ((previousLine == null || previousLine.isEmpty())\n && (line == null || line.startsWith(\"RCS file:\"))) {\n saveChange(file, change, branches, changes, files, location, envVars);\n return Status.FILE_NAME_PREVIOUS_LINE;\n } else {\n updateChangeMessage(change, prePreviousLine);\n updateChangeMessage(change, previousLine);\n return currentStatus;\n }\n } else if (previousLine != null && previousLine.startsWith(CHANGE_DIVIDER)) {\n if (line != null && line.startsWith(\"revision\")) {\n // the previous commit line has ended and we're now in a new commit.\n // Add the current change to our changeset and start processing the next commit\n parsePreviousChangeVersion(line, file, change, branches, changes, files, location, envVars);\n return Status.CHANGE_HEADER;\n } else {\n // see next else if line - we may have skipped a line that contains '-------'.\n // if we don't now have a 'revision' line then the line we skipped was actually\n // part of a comment so we need to include it in the current change\n updateChangeMessage(change, previousLine);\n updateChangeMessage(change, line);\n }\n } else if (line != null && line.startsWith(CHANGE_DIVIDER)) {\n // don't do anything yet, this could be either a part of the current comment\n // or a dividing line\n return currentStatus;\n } else {\n // nothing special on this line, add it to the current change comment\n updateChangeMessage(change, line);\n }\n return currentStatus;\n }", "@Override\n public void onMasterBranchVersionChange(String newVersion, String oldVersion, JGitFlowInfo flow) throws MavenJGitFlowExtensionException\n {\n try\n {\n Git git = flow.git();\n\n //get the README.md file\n File readmeFile = new File(flow.getProjectRoot(), README_MD);\n\n //do the replacement\n //NOTE: This is not performant or scalable. It's only here for example purposes.\n String readmeContent = Files.toString(readmeFile, Charsets.UTF_8);\n String newContent = readmeContent.replace(oldVersion, newVersion);\n\n Files.write(newContent, readmeFile, Charsets.UTF_8);\n\n //now commit the change\n JGitFlowCommitHelper.commitAllChanges(flow, \"updating version in README.md\");\n\n }\n catch (Exception e)\n {\n throw new MavenJGitFlowExtensionException(\"Error updating \" + README_MD + \" file!\", e);\n }\n }", "public void line(String line) {\n\t\t}", "private String nextLine(BufferedReader reader) throws IOException {\n String ln = reader.readLine();\n if (ln != null) {\n int ci = ln.indexOf('#');\n if (ci >= 0)\n ln = ln.substring(0, ci);\n ln = ln.trim();\n }\n return ln;\n }", "public void newLine()\n {\n rst += NEW_LINE;\n }", "@Override\n\t\t\tpublic void commandOutput(int id, String line) {\n\t\t\t\tRootTools.log(\"Command\", \"ID: \" + id + \", \" + line);\n\t\t\t\tMessage message = callback\n\t\t\t\t\t\t.obtainMessage(Constants.OUTPUT_UPDATED);\n\t\t\t\tmessage.obj = line;\n\t\t\t\tcallback.sendMessage(message);\n\n\t\t\t}", "String getCurrentLine();", "void commit(String workspace);", "public void commit(String message) throws IOException {\n\t\t// check whether stage folder is empty\n\t\tboolean check = commitChecker();\n\t\tif (check == false)\n\t\t\treturn;// check whether we can commit now\n\t\tVersion currentCommit = new Version(ID, message, myHead, true,\n\t\t\t\tcurrentBranch);// create a new Version instance\n\t\tFile current = new File(\".gitlet/\" + ID);\n\t\tcurrent.mkdir();// create a folder for this commit\n\t\tif (messageMap.keySet().contains(message)) {\n\t\t\tArrayList<Integer> lst = messageMap.get(message);\n\t\t\tlst.add(ID);\n\t\t} else {\n\t\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\t\tlst.add(ID);\n\t\t\tmessageMap.put(message, lst);// add to the message map\n\t\t}\n\t\tmyCommit.put(ID, currentCommit);// add to commit map\n\t\tfor (String s : stagedFiles) {// find the staged folder and files inside\n\t\t\tFile beCopy = new File(\".gitlet/\" + ID + \"/\" + filenameHelper(s));\n\t\t\tbeCopy.createNewFile();\n\t\t\tcopyFile(\".gitlet/stage/\" + filenameHelper(s),\n\t\t\t\t\tbeCopy.getCanonicalPath());\n\t\t\tcurrentCommit\n\t\t\t\t\t.myMapPut(s, \".gitlet/\" + ID + \"/\" + filenameHelper(s));\n\t\t\tFile fl = new File(\".gitlet/stage/\" + filenameHelper(s));\n\t\t\tfl.delete();// copy the staged file into the new commit folder and\n\t\t\t\t\t\t// delete the file in stage folder\n\t\t}\n\t\tfor (Map.Entry<String, String> f : tracked.entrySet()) {\n\t\t\tif (!stagedFiles.contains(f.getKey())) {\n\t\t\t\tcurrentCommit.myMapPut(f.getKey(), f.getValue());// copy tracked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// files\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// tracked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Hashmap\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// new\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Version\n\t\t\t}\n\t\t}\n\t\tstagedFiles = new ArrayList<String>();\n\t\tuntrackedFiles = new ArrayList<String>();\n\t\ttracked = currentCommit.file();// reset tracked files, untracked files\n\t\t\t\t\t\t\t\t\t\t// and staged files\n\t\tmyHead = currentCommit;\n\t\tmyBranch.put(currentBranch, currentCommit);\n\t\tID++;\n\t\tconflictState = false;// other settings\n\t\tSerialization();\n\t}", "R commit(C change);", "public Gitlet getMyGit(){\n\t\treturn myGit;\n\t}", "public String getJP_BranchName_Kana_Line();", "@Override\n\tpublic void commitInmate(InmateData inmate) {\n\t\t\n\t}", "public String invLine()\n {\n return \" > You are carrying a hot cup of COFFEE ~ Just the thing to wake you up!\";}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"hello facebook by dev1\");\n\t\tSystem.out.println(\"how are you by dev1\");\n\t\tSystem.out.println(\"hello dev2\");\n\t\tSystem.out.println(\"changes through eclips by dev3\");\n\t\t\n\t\tSystem.out.println(\"changes made by upi feature branch\");\n\t\t\n\t\tSystem.out.println(\"changes made by upi feature branch\");\n\n\t}", "public static void branch(String arg){\n commitPointers.branches = commitPointers.readBranches();\n if (commitPointers.branches.containsKey(arg)){\n exitWithError(\"A branch with that name already exists.\");\n }\n\n String headID = commitPointers.readHeadCommit()[1];\n commitPointers.branches.put(arg, headID);\n commitPointers.saveBranches();\n }", "public void sendln(String msg)\n\t{\n\t\tsendPlain(codeFilter(msg+\"\\n\\r\"));\n\t}", "public void postCommentInText(CapComments hp) {\n \t\t\t\tList<PictureStatus> pictures = (List<PictureStatus>) pictureRepo.findAll();\r\n \t\t\t\tcommentRepo.save(hp);\t\r\n \t\t\t}", "private void doCommit(final int y, final int x)\n \t\tthrows FileNotFoundException, GitAPIException\n \t{\n \t\t// update files\n \t\tupdateImageFile();\n \t\tupdateDataFile();\n \n \t\t// add files to changeset\n \t\tfinal AddCommand add = git.add();\n \t\tadd.addFilepattern(ASCII_IMAGE_FILE);\n \t\tadd.addFilepattern(CALENDAR_DATA_FILE);\n \t\tadd.call();\n \n \t\t// commit the changes\n \t\tfinal CommitCommand commit = git.commit();\n \t\tcommit.setAuthor(new PersonIdent(author, contrib[y][x].date));\n \t\tfinal String message = \"(\" + y + \", \" + x + \") -> \" +\n \t\t\tcontrib[y][x].current + COMMIT_NOTICE;\n \t\tcommit.setMessage(message);\n \t\tcommit.call();\n \t}" ]
[ "0.68387693", "0.62816554", "0.61003345", "0.6049608", "0.6033905", "0.5973052", "0.5934647", "0.59059966", "0.5858118", "0.5836003", "0.5800465", "0.5777817", "0.57571584", "0.56991446", "0.5659074", "0.5642632", "0.5612075", "0.55439115", "0.5536158", "0.54772323", "0.5451077", "0.54122525", "0.533949", "0.5333647", "0.5305812", "0.52994657", "0.52949846", "0.52933466", "0.52671295", "0.52325445", "0.5231197", "0.5203715", "0.52014315", "0.5150916", "0.5140439", "0.51258385", "0.51247525", "0.51204133", "0.5115524", "0.51141316", "0.5082631", "0.508062", "0.50515765", "0.5051475", "0.50305325", "0.50151724", "0.49969214", "0.4991514", "0.4990107", "0.49893108", "0.49821305", "0.49789265", "0.49753124", "0.49717325", "0.49165833", "0.49129266", "0.49071464", "0.48826864", "0.48693186", "0.48606914", "0.48562086", "0.48453283", "0.48334253", "0.48136678", "0.47923216", "0.47900924", "0.4788639", "0.47872123", "0.4786441", "0.4779392", "0.47721222", "0.47714922", "0.47695768", "0.47685364", "0.47588402", "0.47582063", "0.47579104", "0.47490332", "0.47459748", "0.47450194", "0.47270578", "0.47254246", "0.47240838", "0.4712763", "0.47118086", "0.4705157", "0.4703298", "0.46840358", "0.46779346", "0.46773723", "0.4674189", "0.4666488", "0.4664444", "0.4659913", "0.4658577", "0.46582863", "0.46547106", "0.46539393", "0.46515322", "0.4650263", "0.46448538" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); db = new Db(this); setContentView(R.layout.activity_test); //创建观察者 observer = new MyContentObserver(new Handler()); //Uri uri=Uri.parse("content://account/add/1); //Uri uri=Uri.parse("content://account/add/2); Uri uri=Uri.parse("content://account/add"); //Descendents 子孙 //notifyForDescendents 是否通知子路径 getContentResolver().registerContentObserver(uri, true, observer); }
{ "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 protected void onDestroy() { super.onDestroy(); getContentResolver().unregisterContentObserver(observer); }
{ "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
Constructor of the powerup.
public PowerUp(String imagePath){ super(imagePath); this.setPosition(); setAlive(false); point=new Point(rand.nextDouble()* Window.getWidth(),rand.nextDouble()* Window.getHeight()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ProductionPower(){\n this(0, new NumberOfResources(), new NumberOfResources(), 0, 0);\n }", "public BubblePowerUp() {\n super(-50, -50);\n \n }", "public ElectricShower() {\r\n\t\tthis(12, 0, 4);\r\n\t}", "private PowerSubsystem() {\n mPdp = new PowerDistributionPanel(0);\n addChild(\"PowerDistributionPanel\",mPdp);\n }", "public Microwave()\n {\n this.powerLevel = 1;\n this.timeToCook = 0;\n this.startTime = 0;\n }", "public PowerUp()\n {\n powerUp = new Rectangle();\n Random gen = new Random();\n int x = gen.nextInt(9);\n switch(x){\n case 0: type = \"Life\"; break;\n case 1: type = \"Laser\"; break;\n case 2: type = \"Gun\"; break;\n case 3: type = \"Long\"; break;\n case 4: type = \"Multi\"; break;\n case 5: type = \"Catch\"; break;\n case 6: type = \"Slow\"; break;\n case 7: type = \"Flip\"; break;\n case 8: type = \"Bomb\"; break;\n }\n text = new Rectangle();\n }", "public BareMetalMachinePowerOffParameters() {\n }", "public p7p2() {\n }", "public PowerMethodParameter() {\r\n\t\t\r\n\t\t//constructor fara parametru, utilizat in cazul in care utilizatorul nu introduce\r\n\t\t//fisierul sursa si nici fiesierul destinatie ca parametrii in linia de comanda\r\n\t\tSystem.out.println(\"****The constructor without parameters PowerMethodParameter has been called****\");\r\n\t\tSystem.out.println(\"You did not specify the input file and the output file\");\r\n\t\t\r\n\t}", "private PumpManager() { }", "public PowerUp(double x,double y,Color color)\n\t{\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.color = color;\n\t}", "public PowerLine(Manager manager, int number) {\n this.stability = 50;\n this.number = number;\n this.randomGenerator = new Random();\n this.manager = manager;\n this.reactorLine = new Oscillator(100, 100, 0.0);\n this.inputFluctuator = new Fluctuator(reactorLine, 5);\n this.inputAdjuster = new Oscillator(100, 100, Math.PI);\n this.outputData = FXCollections.observableArrayList();\n this.outputPower = new SimpleDoubleProperty(100);\n this.inputPower = 100.0;\n this.online = true;\n this.unstable = false;\n this.unstableTimeline = setupFluctuationTimeline(400);\n this.imbalance = 0;\n this.imbalanceTimeline = setupFluctuationTimeline(2000);\n this.severeImbalanceTimeline = setupFluctuationTimeline(1000);\n createOscilloscopeData();\n }", "public PowerUpASICCommand()\n\t{\n\t\tsuper();\n\t\tcommandString = new String(\"POWERUPASIC\");\n\t}", "public Puppy() {\n\t\t//TODO\n\t}", "public Pwm(int bus){\n instanceBus = bus;\n if(bus == unusedBus){\n \n }\n else{\n pwmInstance = new Jaguar(bus);\n Debug.output(\"Pwm constructor: created PWM on bus\", new Integer(bus), ConstantManager.deviceDebug);\n }\n }", "public PowerUp(float x, float y, float rotation, int type)\n {\n super(x, y, rotation);\n this.type = type;\n }", "public Item() {\n\t\tthis(rand.nextDouble() * GameManager.NATIVE_WIDTH, -30.0, PowerUp[new Random().nextInt(PowerUp.length)]);\n\t}", "public Punching() {\n initComponents();\n }", "public PAP()\n {\n _fWindowControl = 1;\n //lspd[0] = 240;\n _lspd[1] = 1;\n _ilvl = 9;\n }", "public Supervisor(double salario) {\r\n super(salario);\r\n }", "public ToZeroRampGenerator() { \r\n }", "public USBAmp() {\r\n super();\r\n }", "public ProductionPowerInput() {\n this.productionPowerInput = new HashMap<>();\n }", "public Slayer() \r\n {\r\n super(1, \"Slayer\");\r\n setSpecialPower(\"killDragon\");\r\n }", "public Powerup(String filename) {\n super(filename);\n getMyImageView().setFitWidth(20);\n getMyImageView().setFitHeight(20);\n this.setPowerType(filename);\n }", "public BrickControlPi() {\r\n\t}", "public PowerUp(Sprite sprite, int x, int y) {\n super(x, y);\n newSprite(sprite);\n setNewDimensions();\n name = sprite.name();\n }", "public OscillatorCalculator() {\n this(1);\n }", "public Wumpus()\r\n\t{\r\n\t\tsuper(true, true);\r\n\t\tthis.vivant = true;\r\n\t}", "protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }", "private Supervisor() {\r\n\t}", "public PnuematicSubsystem() {\n\n }", "public void initPC() {\r\n\t\tthis.memoryTaken = 0;\r\n\t\tthis.cpuTaken = 0;\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\r\n\t\tObject[] quirks = (Object[])args[1];\r\n\t\t\r\n\t\tthis.memory = (Integer)quirks[0];\r\n\t\tthis.cpu = (Integer)quirks[1];\r\n\t\tthis.pricePerMemoryUnit = (Double)quirks[2];\r\n\t\tthis.pricePerCpuUnit = (Double)quirks[3];\r\n\t\tthis.pricePerSecond = (Double)quirks[4];\r\n\t\tthis.discountPerWaitingSecond = (Double)quirks[5];\r\n\t\t\r\n\t\tSystem.out.println(this);\r\n\t}", "public ForkLift() {\n\n\t\t// _liftEncoder.setDistancePerPulse(distancePerPulse);\n\t}", "public SuperS()\r\n {\r\n setStep(0,0,0,0,0);\r\n }", "public ProductionPower(NumberOfResources outputRes, NumberOfResources inputRes){\n this(0, outputRes, inputRes, 0, 0);\n }", "public Machine() {\n\t\tsuper();\n\t}", "public Launcher() {\n //instantiate motors and djustment value using robot map constants\n m_masterMotor = new TalonSRX(RobotMap.MASTER_LAUNCHER_ID);\n m_closeSlaveMotor = new VictorSPX(RobotMap.CLOSE_LAUNCHER_SLAVE_ID);\n m_farSlaveMotor1 = new VictorSPX(RobotMap.FAR_LAUNCHER_SLAVE1_ID);\n m_farSlaveMotor2 = new VictorSPX(RobotMap.FAR_LAUNCHER_SLAVE2_ID);\n\n //Sets the far motors to be inverted so that they don't work against the close ones\n m_farSlaveMotor1.setInverted(RobotMap.LAUNCHER_FAR_SLAVE1_INVERTED);\n m_farSlaveMotor2.setInverted(RobotMap.LAUNCHER_FAR_SLAVE2_INVERTED);\n\n //Instantiates the encoder as the encoder plugged into the master\n m_encoder = new SensorCollection(m_masterMotor);\n\n //run the config methods to set up velocity control\n configVelocityControl();\n }", "private Instantiation(){}", "public HourlyWorker () {\r\n super ();\r\n hours = -1;\r\n hourlyRate = -1;\r\n salary = -1;\r\n }", "public WeiXinPayMonitor() {\r\n\t\tsuper();\r\n\t}", "public TestPawn(){\n }", "public DriverControl(){\n super(0);\n }", "private Pools() {\n super();\n }", "public Scania() {\n\n super(2, 600, Color.white, \"Scania\", 13000);\n truckBed = new Ramp();\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Prism(){//consturctor for Cube class with h initialzed to 10.0.\r\n super();//constructor of superclass called.\r\n h = 10.0;\r\n }", "public Excellon ()\n {}", "public PowerSource(String name) {\n super(name, null);\n Reporter.report(this, Reporter.Msg.CREATING);\n }", "public void setPowerup(Powerup p)\n\t{\n\t\titsPowerup = p;\n\t}", "private UI()\n {\n this(null, null);\n }", "public Arm() {\n initializeLogger();\n initializeCurrentLimiting();\n setBrakeMode();\n encoder.setDistancePerPulse(1.0/256.0);\n lastTimeStep = Timer.getFPGATimestamp();\n }", "public NoiseCalculator() {\n this(1.0);\n }", "public PotatoPower() {\r\n\t\t//pos5 = .975; //Low Bar and Boulder Pickup\r\n\t\t//pos9 = 1.484; //Low Goal Shoot\r\n\t\t//pos12 = 1.770; //High Goal Shoot\r\n\t\t//pos7 = 2.347; //Scale and Human Station\r\n\t\t//pos3 = 0; //Stop Motor\r\n\t\t//m5stopRange = 0.001; // range above and below set point to allow\r\n\t\t// for over or under when motor is moving faster\r\n\t\t\t// than we are reading the sting pot\r\n\t\tgoBall= false;\r\n\t\t//inAuto = false;\r\n\t}", "public AddonInstaller() {\n \n }", "private RunLengthEncoder() {\r\n }", "public Sandwich()\n\t{super();\n \n\t\t\n\t}", "public Simulator(){}", "public StopWatch() {\n }", "public VMProcess() \n\t{\n\t\tsuper();\n\t}", "public PowerContactSettings () {\n }", "public CreateKonceptWorker() {\n\t\tsuper();\n\t\tthis.koncept = new KoncepteParaula();\n\t}", "public ArcherTower() {\n\t\tsuper(defaultAttack, defaultRange, defaultAttackSpeed, name);\n\t}", "public SwerveDriveCalculator() {\n this(1.0, 1.0);\n }", "public Chick() {\n\t}", "public Vending_MachineTest()\n {\n // initialise instance variables\n \n \n }", "public PowerGenerator(double aFactor)\n {\n this.aFactor= aFactor;\n }", "public Sleep() {\n\n\t}", "public WaterEradicate() {\n }", "public ProducerPlan()\r\n\t{\r\n\t\tgetLogger().info(\"Created: \"+this);\r\n\t}", "public ProductionPower(int points, NumberOfResources outputRes, NumberOfResources inputRes){\n this(points, outputRes, inputRes, 0, 0);\n }", "public WaterMeter()\r\n\t{\r\n\t\tsuper(DeviceTypeEnum.WATER_METER);\r\n\t}", "public HotkeyData ()\n {\n this ( false, false, false, null );\n }", "public PencilPen() {\n this(10.0);\n }", "private void setupPowerSystem() {\n\t\tps = new PowerSystem(PowerSystemSolutionMethod.ANL_OPF);\r\n\t\t\r\n\t\t// Create nodes & register with power system\r\n\t\tNodeData nodeWindGenerator = new NodeData(1,1.0,0,false,true);\r\n\t\tps.addNode(nodeWindGenerator);\r\n\t\tNodeData nodeSubstation2 = new NodeData(2,1.0,0,false);\r\n\t\tps.addNode(nodeSubstation2);\r\n\t\tNodeData nodeCityResidential = new NodeData(3,1.0,0,false);\r\n\t\tps.addNode(nodeCityResidential);\r\n\t\tNodeData nodeCityIndustrial = new NodeData(4,1.0,0,false);\r\n\t\tps.addNode(nodeCityIndustrial);\r\n\t\tNodeData nodeCityCommercial = new NodeData(5,1.0,0,false);\r\n\t\tps.addNode(nodeCityCommercial);\r\n\t\tNodeData nodeCoalGenerator = new NodeData(7,1.0,0,false,true);\r\n\t\tps.addNode(nodeCoalGenerator);\r\n\t\tNodeData nodeSubstation3 = new NodeData(8,1.0,0,false);\r\n\t\tps.addNode(nodeSubstation3);\r\n\t\tNodeData nodeGasGenerator = new NodeData(11,1.0,0,false,true);\r\n\t\tps.addNode(nodeGasGenerator);\r\n\t\tNodeData nodeWindStorage = new NodeData(9,1.0,0,false);\r\n\t\tps.addNode(nodeWindStorage);\r\n\t\tNodeData nodeSubstation1 = new NodeData(0,1.0,0,false);\r\n\t\tps.addNode(nodeSubstation1);\r\n\t\t\r\n\t\t// Create lines & register with power system\r\n\t\tMWTimeSeries branchTimeSeries = null;\r\n\t\t\r\n\t\tBranchData branchWindGeneratorToLocalSubstation = new BranchData(nodeWindGenerator,nodeSubstation1,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchWindGeneratorToLocalSubstation,\"Wind Generator to Substation 1\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\r\n\t\tps.addBranch(branchWindGeneratorToLocalSubstation);\r\n\r\n\t\tBranchData branchWindStorageToLocalSubstation = new BranchData(nodeWindStorage,nodeSubstation1,0.01,0,1500.0,false);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchWindStorageToLocalSubstation,\"Storage to Substation 1\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\r\n\t\tps.addBranch(branchWindStorageToLocalSubstation);\r\n\t\t\r\n\t\tbranchWindLocalSubstationToCitySubstation = new BranchData(nodeSubstation1,nodeSubstation2,0.01,0,125.0,false);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchWindLocalSubstationToCitySubstation,\"Substation 1 to Substation 2\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\r\n\t\tps.addBranch(branchWindLocalSubstationToCitySubstation);\r\n\t\t\r\n\t\tBranchData branchWindToResidential = new BranchData(nodeSubstation2,nodeCityResidential,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchWindToResidential,\"Substation 2 to Residential\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\r\n\t\tps.addBranch(branchWindToResidential);\r\n\t\t\r\n\t\tBranchData branchWindToCommercial = new BranchData(nodeSubstation2,nodeCityCommercial,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchWindToCommercial,\"Substation 2 to Commercial\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\r\n\t\tps.addBranch(branchWindToCommercial);\r\n\r\n\t\tBranchData branchWindToIndustrial = new BranchData(nodeSubstation2,nodeCityIndustrial,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchWindToIndustrial,\"Substation 2 to Industrial\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\t\t\r\n\t\tps.addBranch(branchWindToIndustrial);\r\n\t\t\r\n\t\tBranchData branchCoalGeneratorToSubstation = new BranchData(nodeCoalGenerator,nodeSubstation3,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchCoalGeneratorToSubstation,\"Coal Generator to Substation 3\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\r\n\t\tps.addBranch(branchCoalGeneratorToSubstation);\r\n\t\t\r\n\t\t\r\n\t\tBranchData branchGasToSubstation = new BranchData(nodeGasGenerator,nodeSubstation3,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchGasToSubstation,\"Natural Gas Generator to Substation 3\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\t\t\r\n\t\tps.addBranch(branchGasToSubstation);\r\n\t\t\r\n\t\tBranchData branchCoalToResidential = new BranchData(nodeSubstation3,nodeCityResidential,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchCoalToResidential,\"Substation 3 to Residential\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\t\t\r\n\t\tps.addBranch(branchCoalToResidential);\r\n\t\t\r\n\t\tBranchData branchCoalToIndustrial = new BranchData(nodeSubstation3,nodeCityIndustrial,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchCoalToIndustrial,\"Substation 3 to Industrial\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\t\t\r\n\t\tps.addBranch(branchCoalToIndustrial);\r\n\t\t\r\n\t\tBranchData branchCoalToCommercial = new BranchData(nodeSubstation3,nodeCityCommercial,0.01,0,1500.0,true);\r\n\t\tbranchTimeSeries = new MWTimeSeries(simClock,branchCoalToCommercial,\"Substation 3 to Commercial\");\r\n\t\tbranchFlowInformation.add(branchTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(branchTimeSeries);\t\t\r\n\t\tps.addBranch(branchCoalToCommercial);\r\n\r\n\t\t\r\n\t\t// Create loads\r\n\t\tMWTimeSeries loadTimeSeries = null;\r\n\t\t\r\n\t\tloadResidential = new LoadData(nodeCityResidential,100.0,0,true);\r\n\t\tloadTimeSeries = new MWTimeSeries(simClock,loadResidential,\"Residential load\");\r\n\t\tcircuitpanel.getAnimatables().add(loadTimeSeries);\r\n\t\tloadInformation.add(loadTimeSeries);\r\n\t\tps.addLoad(loadResidential);\r\n\t\t\r\n\t\tloadCommercial = new LoadData(nodeCityCommercial,100.0,0,true);\r\n\t\tloadTimeSeries = new MWTimeSeries(simClock,loadCommercial,\"Commercial load\");\r\n\t\tcircuitpanel.getAnimatables().add(loadTimeSeries);\r\n\t\tloadInformation.add(loadTimeSeries);\r\n\t\tps.addLoad(loadCommercial);\r\n\t\t\r\n\t\tloadIndustrial = new LoadData(nodeCityIndustrial,100.0,0,true);\r\n\t\tloadTimeSeries = new MWTimeSeries(simClock,loadIndustrial,\"Industrial load\");\r\n\t\tcircuitpanel.getAnimatables().add(loadTimeSeries);\r\n\t\tloadInformation.add(loadTimeSeries);\r\n\t\tps.addLoad(loadIndustrial);\r\n\t\t\r\n\t\t// Create gens\r\n\t\tMWTimeSeries genTimeSeries = null;\r\n\t\t\r\n\t\tgensWithCostsAndEmissions = new ArrayList<CostAndEmissionsProvider>();\r\n\t\tGeneratorDataWithLinearCostAndEmissions genCoal = new GeneratorDataWithLinearCostAndEmissions(nodeCoalGenerator,600,0,2000,0,0,9999,true,2000,20.0,0,1.0,includeFixedCostsAndEmissions);\r\n\t\tgensWithCostsAndEmissions.add(genCoal);\r\n\t\tcostAndEmissionsTimeSeries.addCostAndEmissionsProvider(genCoal);\r\n\t\tgenTimeSeries = new MWTimeSeries(simClock,genCoal,\"Coal generation\");\r\n\t\tcircuitpanel.getAnimatables().add(genTimeSeries);\r\n\t\tgeneratorInformation.add(genTimeSeries);\r\n\t\tps.addGenerator(genCoal);\r\n\t\t\r\n\t\tGeneratorDataWithLinearCostAndEmissions genGas = new GeneratorDataWithLinearCostAndEmissions(nodeGasGenerator,200,0,2000,0,0,9999,true,700.0,70.0,0,0.5,includeFixedCostsAndEmissions);\r\n\t\tgensWithCostsAndEmissions.add(genGas);\r\n\t\tcostAndEmissionsTimeSeries.addCostAndEmissionsProvider(genGas);\r\n\t\tgenTimeSeries = new MWTimeSeries(simClock,genGas,\"Natural gas generation\");\r\n\t\tcircuitpanel.getAnimatables().add(genTimeSeries);\r\n\t\tgeneratorInformation.add(genTimeSeries);\r\n\t\tps.addGenerator(genGas);\r\n\t\t\r\n\t\tgenWind = new WindGeneratorDataWithLinearCostAndEmissions(nodeWindGenerator,initialWindGen,0,210,initialWindVariation,true,200.0,0,0,0,includeFixedCostsAndEmissions);\r\n\t\tgenWind.setAnimating(false);\r\n\t\tcostAndEmissionsTimeSeries.addCostAndEmissionsProvider(genWind);\r\n\t\tgenTimeSeries = new MWTimeSeries(simClock,genWind,\"Wind generation\");\r\n\t\twindGenTimeSeries = genTimeSeries;\r\n\t\tcircuitpanel.getAnimatables().add(genTimeSeries);\r\n\t\tgeneratorInformation.add(genTimeSeries);\r\n\t\tgensWithCostsAndEmissions.add(genWind);\r\n\t\tps.addGenerator(genWind);\r\n\t\t\r\n\t\tgenStorage = new StorageDevice(nodeWindStorage,0,0,0,0,0,0,true,genWind,branchWindLocalSubstationToCitySubstation,simClock,1000,100);\r\n\t\tgenTimeSeries = new MWTimeSeries(simClock,genStorage,\"Storage generation\");\r\n\t\tcostAndEmissionsTimeSeries.addCostAndEmissionsProvider(genStorage);\r\n\t\tcircuitpanel.getAnimatables().add(genTimeSeries);\r\n\t\tcircuitpanel.getAnimatables().add(genStorage);\r\n\t\tgeneratorInformation.add(genTimeSeries);\r\n\t\tgensWithCostsAndEmissions.add(genStorage);\r\n\t\tps.addGenerator(genStorage);\r\n\t\t\r\n\t\tps.solve();\r\n\t\t\r\n\t\tArrayList<LineAndDistanceInfoProvider> lines; \r\n\t\tFlowArrowsForBranchData fA;\r\n\t\tSimpleLineDisplay line;\r\n\t\t\r\n\t\tBranchColorProvider branchColorProvider = new BranchColorDynamic(Color.BLACK,0.85,Color.ORANGE,1.0,Color.RED);\r\n\t\tBranchThicknessProvider branchThicknessProvider = new BranchThicknessDynamic(1.0,0.85,2.0,1.0,3.0);\r\n\t\tFlowArrowColorProvider flowArrowColorProvider = new FlowArrowColorDynamic(new Color(0,255,0,255/2),0.85,new Color(255,128,64,255/2),1.0,new Color(255,0,0,255/2));\r\n\t\t\r\n\t\t\r\n\t\tdouble switchthickness = 5.0;\r\n\r\n\t\t// Line Coal Generator to Fossil Substation & flow label\r\n\t\tArrayList<Point2D.Double> pointsCoalGenToCoalSubstation = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(710 - 70,350),new Point2D.Double(710 - 70,212),1);\r\n\t\tpointsCoalGenToCoalSubstation.add(line.getFromPoint());\r\n\t\tpointsCoalGenToCoalSubstation.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsCoalGenToCoalSubstation.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsCoalGenToCoalSubstation.add(line.getToPoint());\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsCoalGenToCoalSubstation, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchCoalGeneratorToSubstation, branchColorProvider, circuitpanel, true,\r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchCoalGeneratorToSubstation,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\r\n\t\t//circuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(640,260),12,new Color(0f,0f,0f,1f),0,branchCoalGeneratorToSubstation));\r\n\t\t\r\n\t\t// Line Gas Generator to Fossil Substation & flow label\r\n\t\tArrayList<Point2D.Double> pointsGasGenToFossilSubstation = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(710 - 70,112.5),new Point2D.Double(765 - 70,160),1);\r\n\t\tpointsGasGenToFossilSubstation.add(line.getFromPoint());\r\n\t\tpointsGasGenToFossilSubstation.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsGasGenToFossilSubstation.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsGasGenToFossilSubstation.add(line.getToPoint());\r\n\t\tpointsGasGenToFossilSubstation.add(new Point2D.Double(710 - 70,212));\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsGasGenToFossilSubstation, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchGasToSubstation, branchColorProvider, circuitpanel, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchGasToSubstation,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\t//circuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(660,170),12,new Color(0f,0f,0f,1f),0,branchGasToSubstation));\r\n\t\t\r\n\t\t// Line Wind Generator to Wind Substation & flow label\r\n\t\tArrayList<Point2D.Double> pointsWindGenToWindSubstation = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(89,281),new Point2D.Double(89,150),1);\r\n\t\tpointsWindGenToWindSubstation.add(line.getFromPoint());\r\n\t\tpointsWindGenToWindSubstation.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsWindGenToWindSubstation.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsWindGenToWindSubstation.add(line.getToPoint());\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsWindGenToWindSubstation, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchWindGeneratorToLocalSubstation, branchColorProvider, circuitpanel, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchWindGeneratorToLocalSubstation,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(100,200),12,new Color(0f,0f,0f,1f),0,branchWindGeneratorToLocalSubstation));\t\t\r\n\t\t\r\n\t\t// Line storage to Wind Substation & flow label\r\n\t\tArrayList<Point2D.Double> pointsWindStorageToWindSubstation = new ArrayList<Point2D.Double>();\r\n\t\tpointsWindStorageToWindSubstation.add(new Point2D.Double(210,25));\r\n\t\tpointsWindStorageToWindSubstation.add(new Point2D.Double(85,25));\r\n\t\tpointsWindStorageToWindSubstation.add(new Point2D.Double(85,55));\r\n\t\tpointsWindStorageToWindSubstation.add(new Point2D.Double(85,95));\r\n\t\tpointsWindStorageToWindSubstation.add(new Point2D.Double(85,140));\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsWindStorageToWindSubstation, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 2, Math.PI/20, \r\n\t\t\t\tbranchWindStorageToLocalSubstation, branchColorProvider, circuitpanel, true,\r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchWindStorageToLocalSubstation,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(100,75),12,new Color(0f,0f,0f,1f),0,branchWindStorageToLocalSubstation));\t\t\r\n\t\t\r\n\t\t// Line substation 2 to Residential load\r\n\t\tArrayList<Point2D.Double> pointsWindStationToResidential = new ArrayList<Point2D.Double>();\r\n\t\tpointsWindStationToResidential.add(new Point2D.Double(351 - 70,212.5));\r\n\t\tpointsWindStationToResidential.add(new Point2D.Double(419 - 70,212.5));\r\n\t\tpointsWindStationToResidential.add(new Point2D.Double(457 - 70,212.5));\r\n\t\tpointsWindStationToResidential.add(new Point2D.Double(525 - 70,212.5));\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsWindStationToResidential, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchWindToResidential, branchColorProvider, circuitpanel, true, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchWindToResidential,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(413 - 70,180),12,new Color(0f,0f,0f,1f),0,branchWindToResidential));\t\t\r\n\t\t\r\n\t\t// Line substation 3 to Residential load\r\n\t\tArrayList<Point2D.Double> pointsFossilStationToResidential = new ArrayList<Point2D.Double>();\r\n\t\tpointsFossilStationToResidential.add(new Point2D.Double(710 - 70,212.5));\r\n\t\tpointsFossilStationToResidential.add(new Point2D.Double(631 - 70,212.5));\r\n\t\tpointsFossilStationToResidential.add(new Point2D.Double(592 - 70,212.5));\r\n\t\tpointsFossilStationToResidential.add(new Point2D.Double(525 - 70,212.5));\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsFossilStationToResidential, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchCoalToResidential, branchColorProvider, circuitpanel, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchCoalToResidential,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(585 - 70,180),12,new Color(0f,0f,0f,1f),0,branchCoalToResidential));\t\t\r\n\t\t\r\n\t\t// Line Substation 3 to Industrial load & flow label\r\n\t\tArrayList<Point2D.Double> pointsFossilSubstationToIndustrial = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(710 - 70,212.5),new Point2D.Double(525 - 70,365),1);\r\n\t\tpointsFossilSubstationToIndustrial.add(line.getFromPoint());\r\n\t\tpointsFossilSubstationToIndustrial.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsFossilSubstationToIndustrial.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsFossilSubstationToIndustrial.add(line.getToPoint());\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsFossilSubstationToIndustrial, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchCoalToIndustrial, branchColorProvider, circuitpanel, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchCoalToIndustrial,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(585 - 70,280),12,new Color(0f,0f,0f,1f),-Math.PI/5,branchCoalToIndustrial));\r\n\t\t\r\n\t\t// Line Substation 3 to Commercial load & flow label\r\n\t\tArrayList<Point2D.Double> pointsSub3ToCommercial = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(710 - 70,212.5),new Point2D.Double(525 - 70,55),1);\r\n\t\tpointsSub3ToCommercial.add(line.getFromPoint());\r\n\t\tpointsSub3ToCommercial.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsSub3ToCommercial.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsSub3ToCommercial.add(line.getToPoint());\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsSub3ToCommercial, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchCoalToCommercial, branchColorProvider, circuitpanel, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchCoalToCommercial,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(615 - 70,105),12,new Color(0f,0f,0f,1f),Math.PI/5,branchCoalToCommercial));\r\n\r\n\t\t\r\n\t\t// Line Substation 2 to Industrial load & flow label\r\n\t\tArrayList<Point2D.Double> pointsWindSubstationToIndustrial = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(351 - 70,212.5),new Point2D.Double(525 - 70,365),1);\r\n\t\tpointsWindSubstationToIndustrial.add(line.getFromPoint());\r\n\t\tpointsWindSubstationToIndustrial.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsWindSubstationToIndustrial.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsWindSubstationToIndustrial.add(line.getToPoint());\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsWindSubstationToIndustrial, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchWindToIndustrial, branchColorProvider, circuitpanel, \r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchWindToIndustrial,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(399 - 70,273),12,new Color(0f,0f,0f,1f),Math.PI/4,branchWindToIndustrial));\r\n\r\n\t\t// Line Substation 2 to Commercial load & flow label\r\n\t\tArrayList<Point2D.Double> pointsWindSubstationToCommercial = new ArrayList<Point2D.Double>();\r\n\t\tline = new SimpleLineDisplay(new Point2D.Double(351 - 70,212.5),new Point2D.Double(525 - 70,55),1);\r\n\t\tpointsWindSubstationToCommercial.add(line.getFromPoint());\r\n\t\tpointsWindSubstationToCommercial.add(DrawUtilities.getPointAtDistanceOnLine(line,line.getLength()/3));\r\n\t\tpointsWindSubstationToCommercial.add(DrawUtilities.getPointAtDistanceOnLine(line,2*line.getLength()/3));\r\n\t\tpointsWindSubstationToCommercial.add(line.getToPoint());\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsWindSubstationToCommercial, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 1, Math.PI/20, \r\n\t\t\t\tbranchWindToCommercial, branchColorProvider, circuitpanel, true,\r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchWindToCommercial,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(396 - 70,140),12,new Color(0f,0f,0f,1f),-Math.PI/4,branchWindToCommercial));\r\n\t\t\r\n\t\t// Line Substation 1 to Substation 2\r\n\t\tArrayList<Point2D.Double> pointsSub0ToSub1 = new ArrayList<Point2D.Double>();\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(85,140));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(175,140));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(175,156));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(175,196));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(175,212));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(190,212));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(230,212));\r\n\t\tpointsSub0ToSub1.add(new Point2D.Double(351 - 70,212));\r\n\t\tlines = DrawUtilities.addLineWithSwitchToAnimatedPanel(pointsSub0ToSub1, \r\n\t\t\t\t0, branchThicknessProvider, switchthickness, 2, Math.PI/20, \r\n\t\t\t\tbranchWindLocalSubstationToCitySubstation, branchColorProvider, circuitpanel, true,\r\n\t\t\t\toverloadMonitorParams);\r\n\t\tfA = new FlowArrowsForBranchData(branchWindLocalSubstationToCitySubstation,lines,0.05,20.0,10.0,flowArrowColorProvider);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(fA);\r\n\t\tcircuitpanel.getAnimatables().add(fA);\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new BranchMWFlowLabel(new Point2D.Double(195,141),12,new Color(0f,0f,0f,1f),0,branchWindLocalSubstationToCitySubstation));\r\n\t\t\r\n\t\t\r\n\t\t// Coal plant display\r\n\t\ttry {\r\n\t\t\tCoalPlantDisplay coaldisplay = new CoalPlantDisplay(new Point2D.Double(650 - 70,300),0,0.0,genCoal);\r\n\t\t\tcircuitpanel.getMiddleLayerRenderables().add(coaldisplay);\r\n\t\t\tcircuitpanel.addMouseListener(coaldisplay);\r\n\t\t\tCostAndEmissionsOverlay coaloverlay = new CostAndEmissionsOverlay(new Point2D.Double(700 - 70,450),genCoal);\r\n\t\t\tcostOverlays.add(coaloverlay);\r\n\t\t\tcircuitpanel.getTopLayerRenderables().add(coaloverlay);\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.out.println(ie);\r\n\t\t}\r\n\t\t\r\n\t\t// Gas plant display\r\n\t\ttry {\r\n\t\tGasPlantDisplay gasdisplay = new GasPlantDisplay(new Point2D.Double(650 - 70,40),0.0,genGas);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(gasdisplay);\r\n\t\tcircuitpanel.addMouseListener(gasdisplay);\r\n\t\tCostAndEmissionsOverlay gasoverlay = new CostAndEmissionsOverlay(new Point2D.Double(700 - 70,20),genGas);\r\n\t\tcostOverlays.add(gasoverlay);\r\n\t\tcircuitpanel.getTopLayerRenderables().add(gasoverlay);\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.out.println(ie);\r\n\t\t}\r\n\t\t\r\n\t\t// Wind plant display\r\n\t\ttry {\r\n\t\t\twinddisplay = new WindPlantDisplay(new Point2D.Double(50,240),0.0,genWind);\r\n\t\t\tcircuitpanel.getMiddleLayerRenderables().add(winddisplay);\r\n\t\t\tcircuitpanel.getAnimatables().add(winddisplay);\r\n\t\t\tcircuitpanel.addMouseListener(winddisplay);\r\n\t\t\tCostAndEmissionsOverlay windoverlay = new CostAndEmissionsOverlay(new Point2D.Double(100,450),genWind);\r\n\t\t\tcostOverlays.add(windoverlay);\r\n\t\t\tcircuitpanel.getTopLayerRenderables().add(windoverlay);\t\t\t\t\t\t\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.out.println(ie);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// Storage display\r\n//\t\ttry {\r\n\t\t\t//SubstationDisplay storagedisplay = new SubstationDisplay(new Point2D.Double(160,0),\"Storage\");\r\n\t\t\t//circuitpanel.getMiddleLayerRenderables().add(storagedisplay);\r\n\t\t\tStorageDisplay storagedisplay = new StorageDisplay(genStorage,StorageDisplay.Alignment.LEFT,StorageDisplay.Alignment.TOP,new Point2D.Double(170,0));\r\n\t\t\tcircuitpanel.getMiddleLayerRenderables().add(storagedisplay);\r\n//\t\t} catch (IOException ie) {\r\n//\t\t\tSystem.out.println(ie);\r\n//\t\t}\r\n\t\t\r\n\t\t// Commercial load\r\n\t\ttry {\r\n\t\t\tCityDisplay commercetonLoad = new CityDisplay(new Point2D.Double(475 - 70,25),CityDisplay.CityType.COMMERCIAL,\"Commercial\",loadCommercial,0);\r\n\t\t\tcircuitpanel.getBottomLayerRenderables().add(commercetonLoad);\r\n\t\t\tcircuitpanel.addMouseListener(commercetonLoad);\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.err.println(ie.toString());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Residential load\r\n\t\ttry {\r\n\t\t\tCityDisplay residentialLoad = new CityDisplay(new Point2D.Double(475 - 70,175),CityDisplay.CityType.RESIDENTIAL,\"Residential\",loadResidential,0);\r\n\t\t\tcircuitpanel.getBottomLayerRenderables().add(residentialLoad);\r\n\t\t\tcircuitpanel.addMouseListener(residentialLoad);\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.err.println(ie.toString());\r\n\t\t}\r\n\t\t\r\n\t\t// Industrial load\r\n\t\ttry {\r\n\t\t\tCityDisplay industrialLoad = new CityDisplay(new Point2D.Double(475 - 70,329),CityDisplay.CityType.INDUSTRIAL,\"Industrial\",loadIndustrial,0);\r\n\t\t\tcircuitpanel.getBottomLayerRenderables().add(industrialLoad);\r\n\t\t\tcircuitpanel.addMouseListener(industrialLoad);\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.err.println(ie.toString());\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\t// Substation 3\r\n\t\ttry {\r\n\t\t\tcircuitpanel.getMiddleLayerRenderables().add(new SubstationDisplay(new Point2D.Double(660 - 70,212 - 25.0),3));\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.out.println(ie);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// Substation 2\r\n\t\ttry {\r\n\t\t\tcircuitpanel.getMiddleLayerRenderables().add(new SubstationDisplay(new Point2D.Double(305 - 70,212 - 25.0),2));\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.out.println(ie);\r\n\t\t}\r\n\t\t\r\n\t\t// Substation 1\r\n\t\ttry {\r\n\t\t\tcircuitpanel.getMiddleLayerRenderables().add(new SubstationDisplay(new Point2D.Double(39,120.0),1));\r\n\t\t} catch (IOException ie) {\r\n\t\t\tSystem.out.println(ie);\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(new StoredEnergyLabel(new Point2D.Double(230,56),12,Color.BLACK,0,genStorage));\r\n\t\t\r\n\t\t/*\r\n\t\ttotalloadplot = new TotalLoadPlot(\r\n\t\t\t\tnew Point2D.Double(10,10),\r\n\t\t\t\t700,200,\r\n\t\t\t\tps,\r\n\t\t\t\tminutesPerAnimationStep,\r\n\t\t\t\t0,24,\r\n\t\t\t\t0,3000);\r\n\t\t*/\r\n\t\t/*\r\n\t\tMouseCoordinateLabel mclabel = new MouseCoordinateLabel(new Point2D.Double(0,20),12,Color.BLACK,0);\r\n\t\tcircuitpanel.getTopLayerRenderables().add(mclabel);\r\n\t\tcircuitpanel.addMouseMotionListener(mclabel);\r\n\t\tMouseCoordinateLabel mclabel = new MouseCoordinateLabel(new Point2D.Double(0,0),12,Color.BLACK,0);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(mclabel);\r\n\t\tcircuitpanel.addMouseMotionListener(mclabel);\r\n\t\t*/\r\n\t\t\r\n\t\tWindMaxDisplay windMaxLabel = new WindMaxDisplay(new Point2D.Double(144,384),12,Color.BLACK,0,genWind);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(windMaxLabel);\r\n\t\tWindCurtailedDisplay windCurtailedLabel = new WindCurtailedDisplay(new Point2D.Double(144,404),12,Color.BLACK,0,genWind);\r\n\t\tcircuitpanel.getMiddleLayerRenderables().add(windCurtailedLabel);\r\n\r\n\t\tcircuitpanel.getTopLayerRenderables().add(new BlackoutDisplay(ps));\t\t\r\n\t\t\r\n\t\tcircuitpanel.getAnimatables().add(ps);\r\n\t\t\r\n\t\tcircuitpanel.getTopLayerRenderables().add(\r\n\t\t\t\tnew SimClockDisplay(new Point2D.Double(350,5),12,Color.BLACK,0,simClock)); \r\n\t\t\r\n\t\t// Wind plant at node sixteen\r\n//\t\ttry {\r\n//\t\t\tWindPlantDisplay winddisplay = new WindPlantDisplay(new Point2D.Double(650,340),0.0,genWind);\r\n//\t\t\tcircuitpanel.getMiddleLayerRenderables().add(winddisplay);\r\n//\t\t\tcircuitpanel.getAnimatables().add(winddisplay);\r\n//\t\t\tcircuitpanel.addMouseListener(winddisplay);\r\n//\t\t\tCostAndEmissionsOverlay windoverlay = new CostAndEmissionsOverlay(new Point2D.Double(689,462),genWind);\r\n//\t\t\tcostOverlays.add(windoverlay);\r\n//\t\t\tcircuitpanel.getTopLayerRenderables().add(windoverlay);\t\t\t\t\t\t\r\n//\t\t} catch (IOException ie) {\r\n//\t\t\tSystem.out.println(ie);\r\n//\t\t}\r\n\t\t\r\n\t}", "public Resource() {\n\t\tsuper();\n\t\tfor (int i = 0; i < chopsticks.length; i++) {\n\t\t\tchopsticks[i] = 1;\n\t\t}\n\t}", "public QaStep() {\n\t}", "public Die() {\n this( 6 );\n }", "public ExamMB() {\n }", "public Pitonyak_09_02() {\r\n }", "public Knights()\r\n\t{\r\n\t\tsuper(Settings.COST_PRODUCTION_KNIGHT, Settings.TIME_COST_KNIGHT, \r\n\t\t\t\tSettings.SPEED_KNIGHT, Settings.DAMMAGES_KNIGHT, Settings.DAMMAGES_KNIGHT);\r\n\t}", "public QBP_Q21() {\n super();\n }", "public Pump(double price, int pumpNumber){\n\t\tpriceOfFuel = price;\n\t\tthis.pumpNumber = pumpNumber;\n\t\tunitSpaceAvailable = 3;\n\t\tqueue = new ArrayList<Driver>();\n\t}", "public SleepTest()\n {\n getLogger().debug(whoAmI() + \"\\tConstruct\");\n }", "public TesterPSO() {\n\t\tlogWriter = new Writer();\n\t\tMAX_RUN = 50;\n\t\truntimes = new long[MAX_RUN];\n\t}", "public WaterMeter(Radio radio)\r\n\t{\r\n\t\tsuper(radio, DeviceTypeEnum.WATER_METER);\r\n\t}", "public JumbleBoard()\n {\n }", "public Instance() {\n }", "public MaintenanceWindowsProperties() {\n }", "public ProgramWilmaa()\n\t{\n\t}", "public BankAcc(){\r\n //uses another constuctor\r\n this(593,2.5,\"Deg\",\"Deg\",\"Deg\");\r\n System.out.println(\"EMpty\");;\r\n }", "public MonHoc() {\n }", "public PassCost() {\r\n\r\n }", "public StartUp(){\r\n \r\n }", "public PencilTool() {\n super();\n myPencil = new Path2D.Double(); \n }", "public Genin(){\n this.ninja_name=null;\n this.power=null;\n this.strength=0;\n }", "public Genret() {\r\n }", "private DiscretePotentialOperations() {\r\n\t}", "public WorkerMonitor() {\n }", "public Constructor(){\n\t\t\n\t}" ]
[ "0.734181", "0.6736299", "0.6586026", "0.6578571", "0.6516289", "0.65150565", "0.64740133", "0.6440814", "0.6320475", "0.6271779", "0.6188817", "0.6176091", "0.613442", "0.613396", "0.6126092", "0.60928833", "0.60863465", "0.60789686", "0.6071844", "0.60709924", "0.6068635", "0.6062525", "0.6049259", "0.6037575", "0.5999518", "0.59990793", "0.59584326", "0.59435004", "0.5940907", "0.59211105", "0.5913461", "0.59114784", "0.59008425", "0.5886881", "0.5879225", "0.5874882", "0.58693904", "0.5866079", "0.58506477", "0.5846901", "0.5833364", "0.5812005", "0.5811638", "0.5809912", "0.579691", "0.5796843", "0.57870054", "0.57835853", "0.57792026", "0.57613385", "0.5758651", "0.57584137", "0.5755078", "0.57530886", "0.5752414", "0.5745209", "0.574148", "0.57391393", "0.5738061", "0.573745", "0.57349056", "0.5728524", "0.5726613", "0.57241505", "0.57197744", "0.5719059", "0.5718981", "0.5718637", "0.5713359", "0.57129765", "0.5710658", "0.5710277", "0.57102036", "0.5709743", "0.5707249", "0.5706022", "0.5705966", "0.57017905", "0.569743", "0.56911594", "0.56887513", "0.5688015", "0.5681181", "0.56780535", "0.56734365", "0.5673017", "0.5671736", "0.5664185", "0.5663233", "0.565839", "0.56530666", "0.5652278", "0.5647083", "0.5632694", "0.56322676", "0.56300426", "0.56200916", "0.5618322", "0.56175953", "0.5615696" ]
0.60318744
24
Intermediate operations are operations that produce a new stream, e.g. map, filter, distinct and sorted Good to note: Intermediate variables here only to clarify the process. Since streams can be consumed only once, these operations are often chained without intermediate variables.
@Test public void intermediateOperations() { Stream<Book> books = TestData.getBooks().stream(); // filter Stream<Book> booksWithMultipleAuthors = books.filter(book -> book.hasMultipleAuthors()); // map Stream<String> namesStream = booksWithMultipleAuthors.map(book -> book.getName()); Set<String> expected = Sets.newHashSet("Design Patterns: Elements of Reusable Object-Oriented Software", "Structure and Interpretation of Computer Programs"); assertEquals(expected, namesStream.collect(Collectors.toSet())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void intermediateAndTerminalOperations() throws Exception {\n System.out.println(\n MockData.getCars()\n // Here we go to \"abstraction\" of strams\n .stream()\n // This is an intermediate op because we stay in the abstraction\n .filter(car -> {\n System.out.println(\"filter car \" + car);\n return car.getPrice() < 10000;\n })\n // This is intermediate too, we still working with streams \"abstraction\"\n .map(car -> {\n System.out.println(\"mapping car \" + car);\n return car.getPrice();\n })\n // same as before, still intermediate, still in streams abstraction\n .map(price -> {\n System.out.println(\"mapping price \" + price);\n return price + (price * .14);\n })\n // ok, this is a terminal operation and give you back the \"concrete type\" result of the operations\n .collect(Collectors.toList())\n );\n\n // Q: If you comment this line, no result is printed, you got only stram reference, why?\n // A: STREAMS are LAZY initialized\n\n // Q: What's the order of execution in the above code?\n // A: See the console print to understand order of execution:\n // The mappings are executed as soon as the first car passes the filter\n // so to get some results, stream don't need to filter ALL the list before\n\n }", "@Test\n public void streamApiTest(){\n Collection<Integer> myCollection=initializeIntCollection(3,5);\n\n long sumOfOddValues3times=myCollection.stream().\n filter(o -> o % 2 ==1). // for all odd numbers\n mapToInt(o -> o*3). // multiply their value on 3\n sum(); // and return their sum (reduce operation)\n Assert.assertEquals((3+5+7)*3, sumOfOddValues3times);\n\n Optional<Integer> sumOfModulesOn3= myCollection.stream().\n filter( o -> o % 3 ==0).\n reduce((sum, o) -> sum = sum + o);\n Assert.assertEquals(new Integer(3+6), sumOfModulesOn3.get());\n\n\n\n Collection<Integer> evenCollection=new ArrayList<>();\n myCollection.\n stream().\n filter(o -> o % 2 == 0).\n forEach((i) -> evenCollection.add(i));\n }", "protected static void performReduceWithABinaryOperator() {\n Integer sum = Stream.of(1, 2, 3, 4, 5).reduce(0, Integer::sum);\n\n Integer minValue = Stream.of(5, 4, 9, 2, 1).reduce(Integer.MIN_VALUE, Integer::max);\n\n String concatenation = Stream.of(\"str \", \"= \", \"alt \", \"string\")\n // the first parameter becomes the target of the concat method and the second one is the argument to concat\n // the target, the parameter and the result are of the same type and this can be considered a binary\n // operator for the reduce method\n .reduce(\"\", String::concat);\n System.out.println(concatenation);\n }", "public void intermediateProcessing() {\n //empty\n }", "@Override\n public BinaryOperator<List<Integer>> combiner() {\n return (resultList1, resultList2) -> {\n Integer currentTotal1 = resultList1.get(0);\n Integer currentTotal2 = resultList2.get(0);\n currentTotal1 += currentTotal2;\n resultList1.set(0, currentTotal1);\n return resultList1;\n };\n }", "public static void main(String[] args){\n int result = Stream.of(1,2,3,4,5,6,7,8,9,10)\n .reduce(0,Integer::sum);//metodo referenciado\n// .reduce(0, (acumulador, elemento) -> acumulador+elemento);\n System.out.println(result);\n\n // Obtener lenguajes separados por pipeline entre ellos y sin espacios\n // opcion 1(mejor) con operador ternario\n String cadena = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador.equals(\"\")?lenguaje:acumulador + \"|\" + lenguaje);\n\n System.out.println(cadena);\n\n //Opcion 2 Con regex\n String cadenaRegex = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador + \"|\" + lenguaje)\n .replaceFirst(\"\\\\|\",\"\") // Quitamos la primera pipeline\n .replaceAll(\"\\\\s\",\"\"); // Quitamos todos los espacios\n\n System.out.println(cadenaRegex);\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tSystem.out.println(\"-------1. Stream filter() example---------\");\r\n\t\t//We can use filter() method to test stream elements for a condition and generate filtered list.\r\n\t\t\r\n\t\tList<Integer> myList = new ArrayList<>();\r\n\t\tfor(int i=0; i<100; i++) myList.add(i);\r\n\t\tStream<Integer> sequentialStream = myList.stream();\r\n\r\n\t\tStream<Integer> highNums = sequentialStream.filter(p -> p > 90); //filter numbers greater than 90\r\n\t\tSystem.out.print(\"High Nums greater than 90=\");\r\n\t\thighNums.forEach(p -> System.out.print(p+\" \"));\r\n\t\t//prints \"High Nums greater than 90=91 92 93 94 95 96 97 98 99 \"\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"-------2. Stream map() example---------\");\r\n\t\t//We can use map() to apply functions to an stream\r\n\t\tStream<String> names = Stream.of(\"aBc\", \"d\", \"ef\");\r\n\t\tSystem.out.println(names.map(s -> {\r\n\t\t\t\treturn s.toUpperCase();\r\n\t\t\t}).collect(Collectors.toList()));\r\n\t\t//prints [ABC, D, EF]\r\n\t\t\r\n\t\tSystem.out.println(\"-------3. Stream sorted() example---------\");\r\n\t\t//We can use sorted() to sort the stream elements by passing Comparator argument.\r\n\t\tStream<String> names2 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> reverseSorted = names2.sorted(Comparator.reverseOrder()).collect(Collectors.toList());\r\n\t\tSystem.out.println(reverseSorted); // [ef, d, aBc, 123456]\r\n\r\n\t\tStream<String> names3 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> naturalSorted = names3.sorted().collect(Collectors.toList());\r\n\t\tSystem.out.println(naturalSorted); //[123456, aBc, d, ef]\r\n\t\t\r\n\t\tSystem.out.println(\"-------4. Stream flatMap() example---------\");\r\n\t\t//We can use flatMap() to create a stream from the stream of list.\r\n\t\tStream<List<String>> namesOriginalList = Stream.of(\r\n\t\t\t\tArrays.asList(\"Pankaj\"), \r\n\t\t\t\tArrays.asList(\"David\", \"Lisa\"),\r\n\t\t\t\tArrays.asList(\"Amit\"));\r\n\t\t\t//flat the stream from List<String> to String stream\r\n\t\t\tStream<String> flatStream = namesOriginalList\r\n\t\t\t\t.flatMap(strList -> strList.stream());\r\n\r\n\t\t\tflatStream.forEach(System.out::println);\r\n\r\n\t}", "public static void calculateSumViaStreams(List<Integer> numbers){\n int sum = numbers.stream()\n .filter(x -> x % 2 == 0)\n .map(y -> y * y)\n .reduce(0, (x, y) -> x + y);\n\n System.out.println(sum);\n }", "static <T> Function<T, T> compose(Stream<Function<T, T>> functions) {\n return functions.reduce(identity(), Function::andThen);\n }", "public abstract Stream<E> streamBlockwise();", "@Override\n public BinaryOperator<TradeAccumulator> combiner() {\n return (accum1, accum2) -> {return accum1.addAll(accum2);};\n }", "@CompileStatic\npublic interface Stream<T> {\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n default <X> Stream<X> flatMap(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper) {\n\n return flatMap(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name name of the operation\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n <X> Stream<X> flatMap(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper);\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper the mapping closure\n * @return remapped stream\n */\n default <X> Stream<X> map(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper) {\n\n return map(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name stable name of the mapping operator\n * @param mapper the mapping closure\n * @return remapped stream\n */\n <X> Stream<X> map(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper);\n\n /**\n * Filter stream based on predicate\n *\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }\n\n /**\n * Filter stream based on predicate\n *\n * @param name name of the filter operator\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);\n\n /**\n * Assign event time to elements.\n *\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n default Stream<T> assignEventTime(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner) {\n\n return assignEventTime(null, assigner);\n }\n\n /**\n * Assign event time to elements.\n *\n * @param name name of the assign event time operator\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n Stream<T> assignEventTime(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner);\n\n /**\n * Add window to each element in the stream.\n *\n * @return stream of pairs with window\n */\n default Stream<Pair<Object, T>> withWindow() {\n return withWindow(null);\n }\n\n /**\n * Add window to each element in the stream.\n *\n * @param name stable name of the mapping operator\n * @return stream of pairs with window\n */\n Stream<Pair<Object, T>> withWindow(@Nullable String name);\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @return stream of pairs with timestamp\n */\n default Stream<Pair<T, Long>> withTimestamp() {\n return withTimestamp(null);\n }\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @param name stable name of mapping operator\n * @return stream of pairs with timestamp\n */\n Stream<Pair<T, Long>> withTimestamp(@Nullable String name);\n\n /** Print all elements to console. */\n void print();\n\n /**\n * Collect stream as list. Note that this will result on OOME if this is unbounded stream.\n *\n * @return the stream collected as list.\n */\n List<T> collect();\n\n /**\n * Test if this is bounded stream.\n *\n * @return {@code true} if this is bounded stream, {@code false} otherwise\n */\n boolean isBounded();\n\n /**\n * Process this stream as it was unbounded stream.\n *\n * <p>This is a no-op if {@link #isBounded} returns {@code false}, otherwise it turns the stream\n * into being processed as unbounded, although being bounded.\n *\n * <p>This is an optional operation and might be ignored if not supported by underlying\n * implementation.\n *\n * @return Stream viewed as unbounded stream, if supported\n */\n default Stream<T> asUnbounded() {\n return this;\n }\n\n /**\n * Convert elements to {@link StreamElement}s.\n *\n * @param <V> type of value\n * @param repoProvider provider of {@link Repository}\n * @param entity the entity of elements\n * @param keyExtractor extractor of keys\n * @param attributeExtractor extractor of attributes\n * @param valueExtractor extractor of values\n * @param timeExtractor extractor of time\n * @return stream with {@link StreamElement}s inside\n */\n <V> Stream<StreamElement> asStreamElements(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Persist this stream to replication.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param replicationName name of replication to persist stream to\n * @param target target of the replication\n */\n void persistIntoTargetReplica(\n RepositoryProvider repoProvider, String replicationName, String target);\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n */\n default void persistIntoTargetFamily(RepositoryProvider repoProvider, String targetFamilyname) {\n persistIntoTargetFamily(repoProvider, targetFamilyname, 10);\n }\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n * @param parallelism parallelism to use when target family is bulk attribute family\n */\n void persistIntoTargetFamily(\n RepositoryProvider repoProvider, String targetFamilyname, int parallelism);\n\n /**\n * Persist this stream as attribute of entity\n *\n * @param <V> type of value extracted\n * @param repoProvider provider of repository\n * @param entity the entity to store the stream to\n * @param keyExtractor extractor of key for elements\n * @param attributeExtractor extractor for attribute for elements\n * @param valueExtractor extractor of values for elements\n * @param timeExtractor extractor of event time\n */\n <V> void persist(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Directly write this stream to repository. Note that the stream has to contain {@link\n * StreamElement}s (e.g. created by {@link #asStreamElements}.\n *\n * @param repoProvider provider of repository\n */\n void write(RepositoryProvider repoProvider);\n\n /**\n * Create time windowed stream.\n *\n * @param millis duration of tumbling window\n * @return time windowed stream\n */\n WindowedStream<T> timeWindow(long millis);\n\n /**\n * Create sliding time windowed stream.\n *\n * @param millis duration of the window\n * @param slide duration of the slide\n * @return sliding time windowed stream\n */\n WindowedStream<T> timeSlidingWindow(long millis, long slide);\n\n /**\n * Create session windowed stream.\n *\n * @param <K> type of key\n * @param keyExtractor extractor of key\n * @param gapDuration duration of the gap between elements per key\n * @return session windowed stream\n */\n <K> WindowedStream<Pair<K, T>> sessionWindow(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n long gapDuration);\n\n /**\n * Create calendar-based windowed stream.\n *\n * @param window the resolution of the calendar window (\"days\", \"weeks\", \"months\", \"years\")\n * @param count number of days, weeks, months, years\n * @param timeZone time zone of the calculation\n * @return calendar windowed stream\n */\n WindowedStream<T> calendarWindow(String window, int count, TimeZone timeZone);\n\n /**\n * Group all elements into single window.\n *\n * @return globally windowed stream.\n */\n WindowedStream<T> windowAll();\n\n /**\n * Merge two streams together.\n *\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }\n\n /**\n * Merge two streams together.\n *\n * @param name name of the union operator\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(@Nullable String name, Stream<T> other) {\n return union(name, Arrays.asList(other));\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param streams other streams\n * @return merged stream\n */\n default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param name name of the union operator\n * @param streams other streams\n * @return merged stream\n */\n Stream<T> union(@Nullable String name, List<Stream<T>> streams);\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKeyUnsorted(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, true);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, false);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param sorted {@code true} if the input to the state update function should be time-sorted\n * @return the statefully reduced stream\n */\n <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate,\n boolean sorted);\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n default <K, V> Stream<Pair<K, V>> integratePerKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner) {\n\n return integratePerKey(null, keyExtractor, valueExtractor, initialValue, combiner);\n }\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param name optional name of the transform\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n <K, V> Stream<Pair<K, V>> integratePerKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner);\n\n /** Reshuffle the stream via random key. */\n default Stream<T> reshuffle() {\n return reshuffle(null);\n }\n\n /**\n * Reshuffle the stream via random key.\n *\n * @param name name of the transform\n */\n @SuppressWarnings(\"unchecked\")\n Stream<T> reshuffle(@Nullable String name);\n}", "public static void main(String[] args) {\n\t\n\t\tm(\"Iterate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.iterate(2, i -> 2 * i),\n\t\t\t\t() -> IntStream.iterate(10, i -> i - 1),\n\t\t\t\t() -> IntStream.iterate(10, i -> i),\n\t\t\t\t() -> IntStream.iterate(10, i -> 2),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity()),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity().andThen(IntUnaryOperator.identity())),\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> supplier.get().limit(10).forEach(System.out::println));\n\t\t});\n\t\t\n\t\t\n\t\t//Various IntStream generations. generate produces elements without input => it uses an IntSupplier.\n\t\t\n\t\tSystem.out.println(\"---------------------------------------------\");\n\t\t\n\t\tm(\"Generate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()).filter(n -> n >= 0),\n\t\t\t\t() -> IntStream.generate(() -> 10),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt() % 20).filter(n -> n >= 0)\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> {supplier.get().limit(10).forEach(System.out::println); System.out.println(\"--------------------------------\");});\n\t\t});\n\t\t\n\t\t\n\t\t//Iterate and generate for DoubleStream, LongStream and Stream<T>\n\t\t\n\t\t\n\t\tm(\"DoubleStream iterate and generate\", () -> {\t\t\n\t\t\tDoubleStream.iterate(1, d -> d + d / 2).limit(20).forEach(System.out::println); //Uses DoubleUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextDouble()).limit(5).forEach(System.out::println); //Uses DoubleSupplier\n\t\t});\n\t\t\n\t\tm(\"LongStream iterate and generate\", () -> {\t\t\n\t\t\tLongStream.iterate(2, n -> n * n).limit(4).forEach(System.out::println); //Uses LongUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextLong()).limit(5).forEach(System.out::println); //Uses LongSupplier\n\t\t});\n\t\t\n\t\tm(\"Stream iterate and generate\", () -> {\t\t\n\t\t\tStream.<List<Object>>iterate(new ArrayList<Object>(), l -> {l.add(1); return l;}).limit(4).forEach(System.out::println); //Uses UnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tStream.<List<Object>>generate(() -> new ArrayList<Object>()).limit(4).forEach(System.out::println); //Uses Supplier\n\t\t});\n\t\t\n\t\tm(\"noneMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 3;\n\t\t\tSystem.out.println(stream.noneMatch(predicate)); //Note: this is not infinite. None match will fail as soon as one element is found\n\t\t});\n\t\t\n\t\tm(\"allMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 0;\n\t\t\tPredicate<String> predicate2 = s -> s.length() > 3;\n\t\t\t//System.out.println(stream.allMatch(predicate)); //Note: This is infinite and will fail with OOM error\n\t\t\tSystem.out.println(stream.allMatch(predicate2)); //Note how this will return as the first element does not match so false can be returned\n\t\t});\n\t\t\n\t}", "private void collectorOperationInStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n Map<Integer, List<Person>> personsByAge = persons\n .stream()\n .collect(Collectors.groupingBy(p -> p.age));\n\n personsByAge.forEach((age, p) -> System.out.format(\"age %s: %s\\n\", age, p));\n\n Double averageAge = persons\n .stream()\n .collect(Collectors.averagingInt(p -> p.age));\n\n System.out.println(\"Average-Age: \" + averageAge);\n\n IntSummaryStatistics ageSummary = persons.stream()\n .collect(Collectors.summarizingInt(p -> p.age));\n\n System.out.println(\"Summarizing Age: \" + ageSummary);\n\n String phrase = persons\n .stream()\n .filter(p -> p.age >= 18)\n .map(p -> p.name)\n .collect(Collectors.joining(\" and \", \"In Germany \", \" are of legal age.\"));\n\n System.out.println(\"Collectors Joining: \" + phrase);\n\n Map<Integer, String> map = persons\n .stream()\n .collect(Collectors.toMap(\n p -> p.age,\n p -> p.name,\n (name1, name2) -> name1 + \";\" + name2));\n\n System.out.println(\"Collectors Mapping: \" + map);\n\n\n Collector<Person, StringJoiner, String> personNameCollector =\n Collector.of(\n () -> new StringJoiner(\" | \"), // supplier\n (j, p) -> j.add(p.name.toUpperCase()), // accumulator\n StringJoiner::merge, // combiner\n StringJoiner::toString); // finisher\n\n String names = persons\n .stream()\n .collect(personNameCollector);\n\n System.out.println(\"Collectors Collect: \" + names);\n\n\n List<Integer> IntegerRange = IntStream.range(51, 54).boxed().collect(Collectors.toList());\n List<Integer> IntegerRange1 = IntStream.range(51, 54).mapToObj(i-> i).collect(Collectors.toList());\n System.out.println(\"InStream to List : \"+IntegerRange);\n System.out.println(\"InStream to List : \"+IntegerRange1);\n }", "public static void main(String[] args) {\n int count = Stream.of(1, 2, 3).reduce(0, (lhs, rhs) -> lhs + rhs);\r\n System.out.println(\"Sum by reduce: \" + count);\r\n \r\n // 3-16a: feature preview\r\n count = Stream.of(1, 2, 3).reduce(0, Integer::sum);\r\n System.out.println(\"Ditto - Integer::sum: \" + count);\r\n \r\n // 3-16b: another feature preview - get rid of boxing/unboxing\r\n count = IntStream.of(1, 2, 3).sum();\r\n System.out.println(\"Ditto - IntStream.sum(): \" + count);\r\n \r\n // Example 3-18\r\n count = 0;\r\n for (int value : new int[]{1, 2, 3}) {\r\n count += value;\r\n }\r\n System.out.println(\"Ditto - classic: \" + count);\r\n \r\n }", "public static void reduceDemo() {\n Observable.range(1, 10).reduce(new Func2<Integer, Integer, Integer>() {\n @Override\n public Integer call(Integer integer, Integer integer2) {\n RxDemo.log(RxDemo.getMethodName() + \" \" + integer + \" \" + integer2);\n return integer + integer2;\n }\n }).subscribe(new RxCreateOperator.Sub());\n }", "public default StreamPlus<DATA> mergeWith(Stream<DATA> anotherStream) {\n val streamPlus = streamPlus();\n val iteratorA = streamPlus.iterator();\n val iteratorB = StreamPlus.from(anotherStream).iterator();\n val resultStream = StreamPlusHelper.doMerge(iteratorA, iteratorB);\n resultStream.onClose(() -> {\n funcUnit0(() -> streamPlus.close()).runCarelessly();\n funcUnit0(() -> anotherStream.close()).runCarelessly();\n });\n return resultStream;\n }", "ReduceType reduceInit();", "default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }", "public default <ANOTHER, TARGET> StreamPlus<TARGET> zipWith(Stream<ANOTHER> anotherStream, BiFunction<DATA, ANOTHER, TARGET> combinator) {\n return zipWith(anotherStream, RequireBoth, combinator);\n }", "public static void main(String[] args) {\n\t\tStream<Integer> numStream = numbers.stream();\n\t\t\n\t\t// numStream.forEach(System.out::println); // here stream is closed\n\t\t// numStream.forEach(System.out::println); // this line with throw java.lang.IllegalStateException: stream has already been operated upon or closed\n\t\t\n\t\t// Flux has the similary concepts cannot use the same flux steam multiple times.\n\t\t// Flux<Integer> fluxStream = Flux.fromStream(numStream);\n\t\t\n//\t\tfluxStream.subscribe(\n//\t\t\t\tLamdaUtil.onNext(),\n//\t\t\t\tLamdaUtil.onError(),\n//\t\t\t\tLamdaUtil.onComplete()\n//\t\t\t\t);\n\t\t\n//\t\tfluxStream.subscribe(\n//\t\t\t\tLamdaUtil.onNext(),\n//\t\t\t\tLamdaUtil.onError(),\n//\t\t\t\tLamdaUtil.onComplete()\n//\t\t\t\t);// this line with throw ERROR :stream has already been operated upon or closed\n\t\t\n\t\t// to reuse the same data several times we need to use supplier with every time new stream\n\t\t\n\t\tFlux<Integer> numSupplierStream = Flux.fromStream(() -> numbers.stream());\n\t\tnumSupplierStream.subscribe(\n\t\t\t\tLamdaUtil.onNext(),\n\t\t\t\tLamdaUtil.onError(),\n\t\t\t\tLamdaUtil.onComplete()\n\t\t\t\t);\n\t\tnumSupplierStream.subscribe(\n\t\t\t\tLamdaUtil.onNext(),\n\t\t\t\tLamdaUtil.onError(),\n\t\t\t\tLamdaUtil.onComplete()\n\t\t\t\t);\n\t\t\n\t}", "private Pair<JsonArray, JsonArray> performManyOpsAndReturnResultingErrorsAndResults(String accession,\n Iterable<Op> ops) {\n JsonArray opsWithErrors = new JsonArray();\n JsonArray opsWithResults = new JsonArray();\n boolean failed = false;\n boolean setFailed = false;\n JsonElement resultOfPreviousOperations = JsonNull.INSTANCE;\n JsonElement resultOfCurrentOperation;\n List<Op> opsThatProducedTheSameResult = new ArrayList<>();\n for (Op op: ops) {\n if (failed) {\n resultOfCurrentOperation = new JsonPrimitive(\"Not started\");\n } else {\n Pair<OpResult, ? extends JsonElement> r = performOneOp(accession, op);\n if (r.getLeft().equals(OpResult.FAILURE)) {\n setFailed = true;\n }\n resultOfCurrentOperation = r.getRight();\n }\n\n if (resultOfPreviousOperations.equals(resultOfCurrentOperation)) {\n opsThatProducedTheSameResult.add(op);\n } else {\n if (!resultOfPreviousOperations.equals(JsonNull.INSTANCE)) {\n (failed ? opsWithErrors : opsWithResults)\n .add(aggregatedResultsObject(opsThatProducedTheSameResult, resultOfPreviousOperations));\n }\n opsThatProducedTheSameResult = new ArrayList<>();\n opsThatProducedTheSameResult.add(op);\n resultOfPreviousOperations = resultOfCurrentOperation;\n }\n failed |= setFailed;\n }\n (failed ? opsWithErrors : opsWithResults)\n .add(aggregatedResultsObject(opsThatProducedTheSameResult, resultOfPreviousOperations));\n return Pair.of(opsWithErrors, opsWithResults);\n }", "public static void main(String[] args) {\n\t\tStream<Integer> intStream = Stream.of(1, 2, 3, 4);\n\t\t// intStream.forEach(System.out::println);\n\n\t\t/*\n\t\t * Approach 2 of declaring a stream objects with range of elements from 1-10\n\t\t * where last range element is not considered while printing or for any //\n\t\t * operation like sum, average, etc.\n\t\t * \n\t\t * We have IntStream, DoubleStream, etc to handle primitive values inside\n\t\t * streams...\n\t\t */\n\n\t\tIntStream.range(1, 10).forEach(e -> System.out.println(\"IntStream values from 1-10 range: \" + e)); // This will\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// print\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// numbers\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// from 1-9\n\n\t\t// Sometimes,we really want to create Streams dynamically instead of sequential\n\t\t// int values as above. We can use iterate method to to that.\n\t\tIntStream.iterate(1, e -> e * 2).limit(10).forEach(System.out::println);// Priting square numbers\n\n\t\tIntStream.iterate(2, e -> e + 2).limit(10).peek(System.out::println);// Printing even numbers\n\n\t\t/*\n\t\t * Convert these primitive streams to List For that we need to do a boxing\n\t\t * operation on top of stream\n\t\t */\n\n\t\tSystem.out.println(\"Converting IntStream to List...\");\n\t\tIntStream.range(1, 10).limit(5).boxed().collect(Collectors.toList()).forEach(System.out::println);\n\n\t\t/*\n\t\t * Lets explore some concepts on Strings...How stream works on strings and its\n\t\t * related operations\n\t\t */\n\n\t\t// Stream courseStream = Stream.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses2 = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\t// If we want to join these values\n\n\t\tSystem.out.println(courses.stream().collect(Collectors.joining()));\n\n\t\t/*\n\t\t * Lets say, if i want tp split each string in stream seprated by comma..\n\t\t */\n\t\tSystem.out.println(\"String opeartaion within Streams....\");\n\t\t// The below one prints all stream Objects that executed on top of split\n\t\t// function. So, we need to flatMap it to extract the actual result\n\t\tSystem.out.println(courses.stream().map(course -> course.toString().split(\",\")).collect(Collectors.toList()));\n\t\tSystem.out.println(\n\t\t\t\tcourses.stream().map(course -> course.split(\"\")).flatMap(Arrays::stream).collect(Collectors.toList()));\n\n\t\tSystem.out.println(\"Tuples strings : \"\n\t\t\t\t+ courses.stream().flatMap(course -> courses2.stream().map(course2 -> List.of(course, course2)))\n\t\t\t\t\t\t.collect(Collectors.toList()));\n\n\t\t/**\n\t\t * Higher Order Functions... Higher Order function is a function that returns a\n\t\t * function... In simpler terms, a method that returns a Predicate which\n\t\t * contains logic. So, here we are using method logic as a normal data and\n\t\t * returning it from an another method..\n\t\t */\n\n\t\tList<Courses> courseList = List.of(new Courses(1, \"Java\", 5000, 5), new Courses(2, \"AWS\", 4000, 4));\n\t\t// If we want to get courses whcih has number of students greater than 4000,\n\t\t// then we need to write a predicate for that first\n\t\tint numberOfStudentsThreshhold = 4000;\n\t\tPredicate<Courses> numberOfStudentsPredicate = numberOfStudentsPredecateMethod(numberOfStudentsThreshhold);\n\n\t\tSystem.out.println(\"Courses that has score>4000 : \"\n\t\t\t\t+ courseList.stream().filter(numberOfStudentsPredicate).collect(Collectors.toList()));\n\n\t}", "@Test\n\tpublic void testResourcesForChainedOperators() throws Exception {\n\t\tResourceSpec resource1 = new ResourceSpec(0.1, 100);\n\t\tResourceSpec resource2 = new ResourceSpec(0.2, 200);\n\t\tResourceSpec resource3 = new ResourceSpec(0.3, 300);\n\t\tResourceSpec resource4 = new ResourceSpec(0.4, 400);\n\t\tResourceSpec resource5 = new ResourceSpec(0.5, 500);\n\t\tResourceSpec resource6 = new ResourceSpec(0.6, 600);\n\t\tResourceSpec resource7 = new ResourceSpec(0.7, 700);\n\n\t\tMethod opMethod = Operator.class.getDeclaredMethod(\"setResources\", ResourceSpec.class);\n\t\topMethod.setAccessible(true);\n\n\t\tMethod sinkMethod = DataSink.class.getDeclaredMethod(\"setResources\", ResourceSpec.class);\n\t\tsinkMethod.setAccessible(true);\n\n\t\tMapFunction<Long, Long> mapFunction = new MapFunction<Long, Long>() {\n\t\t\t@Override\n\t\t\tpublic Long map(Long value) throws Exception {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\n\t\tFilterFunction<Long> filterFunction = new FilterFunction<Long>() {\n\t\t\t@Override\n\t\t\tpublic boolean filter(Long value) throws Exception {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\tExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n\t\tDataSet<Long> input = env.fromElements(1L, 2L, 3L);\n\t\topMethod.invoke(input, resource1);\n\n\t\tDataSet<Long> map1 = input.map(mapFunction);\n\t\topMethod.invoke(map1, resource2);\n\n\t\t// CHAIN(Source -> Map -> Filter)\n\t\tDataSet<Long> filter1 = map1.filter(filterFunction);\n\t\topMethod.invoke(filter1, resource3);\n\n\t\tIterativeDataSet<Long> startOfIteration = filter1.iterate(10);\n\t\topMethod.invoke(startOfIteration, resource4);\n\n\t\tDataSet<Long> map2 = startOfIteration.map(mapFunction);\n\t\topMethod.invoke(map2, resource5);\n\n\t\t// CHAIN(Map -> Filter)\n\t\tDataSet<Long> feedback = map2.filter(filterFunction);\n\t\topMethod.invoke(feedback, resource6);\n\n\t\tDataSink<Long> sink = startOfIteration.closeWith(feedback).output(new DiscardingOutputFormat<Long>());\n\t\tsinkMethod.invoke(sink, resource7);\n\n\t\tPlan plan = env.createProgramPlan();\n\t\tOptimizer pc = new Optimizer(new Configuration());\n\t\tOptimizedPlan op = pc.compile(plan);\n\n\t\tJobGraphGenerator jgg = new JobGraphGenerator();\n\t\tJobGraph jobGraph = jgg.compileJobGraph(op);\n\n\t\tJobVertex sourceMapFilterVertex = jobGraph.getVerticesSortedTopologicallyFromSources().get(0);\n\t\tJobVertex iterationHeadVertex = jobGraph.getVerticesSortedTopologicallyFromSources().get(1);\n\t\tJobVertex feedbackVertex = jobGraph.getVerticesSortedTopologicallyFromSources().get(2);\n\t\tJobVertex sinkVertex = jobGraph.getVerticesSortedTopologicallyFromSources().get(3);\n\t\tJobVertex iterationSyncVertex = jobGraph.getVerticesSortedTopologicallyFromSources().get(4);\n\n\t\tassertTrue(sourceMapFilterVertex.getMinResources().equals(resource1.merge(resource2).merge(resource3)));\n\t\tassertTrue(iterationHeadVertex.getPreferredResources().equals(resource4));\n\t\tassertTrue(feedbackVertex.getMinResources().equals(resource5.merge(resource6)));\n\t\tassertTrue(sinkVertex.getPreferredResources().equals(resource7));\n\t\tassertTrue(iterationSyncVertex.getMinResources().equals(resource4));\n\t}", "private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }", "@Test\n public void streamsExample() {\n List<Integer> list = asList(1, 2, 3, 4, 5);\n \n list.stream().forEach(out::println);\n \n out.println();\n \n list.stream().parallel().forEachOrdered(out::println);\n \n \n }", "private static void testStreamFormList() {\n\n Integer[] ids = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};\n\n/*\n Stream.of(ids)\n .map(StreamsOverviewMain::findById)\n .filter(Objects::nonNull)\n .collect(Collectors.toList())\n .forEach(System.out::println);\n*/\n/*\n Random r = new Random();\n Integer integer = Stream.of(ids)\n .filter(i -> i % 2 == 0)\n .filter(i -> i % 3 == 0)\n .filter(i -> i % 5 == 0)\n .findFirst()\n// .orElse(0);\n .orElseGet(()->r.nextInt());\n System.out.println(integer);\n*/\n Stream.of(ids)\n .filter(i -> i % 2 == 0)\n .filter(i -> i % 3 == 0)\n .skip(2)\n .limit(1)\n .forEach(System.out::println);\n\n/*\n Optional<Employee2> first = Stream.of(ids)\n .map(StreamsOverviewMain::findById)\n .filter(Objects::nonNull)\n .findFirst();\n System.out.println(first);\n*/\n/*\n OptionalDouble average = Stream.of(ids)\n .map(StreamsOverviewMain::findById)\n .filter(Objects::nonNull)\n .mapToInt(Employee2::getSalary)\n .average();\n System.out.println(average);\n*/\n\n List<List<Employee2>> departments = new ArrayList<>();\n departments.add(employeeList);\n departments.add(secondList);\n\n/*\n departments.stream().flatMap(l -> l.stream()\n .map(e -> e.getFirstName())).forEach(System.out::println);\n*/\n\n/*\n Stream.of(ids).map(e -> String.format(\"%,3d\", e)).forEach(System.out::print);\n System.out.println();\n Stream.of(ids)\n// .peek(e -> e = e * 2)\n .map(e -> String.format(\"%,3d\", e * 2))\n .forEach(System.out::print);\n System.out.println();\n*/\n/*\n Consumer<Integer> c = e -> e = e * 2;\n Stream.of(ids).forEach(c);\n System.out.println(c);\n*/\n }", "public static void main(String args[]) \n {\n Consumer<List<Integer> > modify = list -> \n { \n for (int i = 0; i < list.size(); i++) \n list.set(i, 5 * list.get(i));\n };\n \n Consumer<List<Integer> > square = list ->\n { \n for (int i = 0; i < list.size(); i++)\n \tlist\n .set(i,(int) Math.pow(list.get(i), 2));\n };\n \n // Consumer to display a list of integers \n Consumer<List<Integer> > \n dispList = list ->\n list.stream().\n forEach(a -> System.out.print(a + \" \"));\n \n List<Integer> list = new ArrayList<Integer>(); \n list.add(2); \n list.add(1); \n list.add(3); \n \n // using addThen() \n modify\n .andThen(square)\n .andThen(dispList)\n .accept(list);\n }", "@Test\n public void testChainingReactions() throws Exception {\n FunctionalReactives.from(1, 2, 3, 4, 5)\n .filter(new Predicate<Integer>() {\n @Override\n public boolean apply(Integer input) {\n return input % 2 == 1; //filter out even integers\n }\n })\n .map(new Function<Integer, Optional<String>>() {\n @Override\n public Optional<String> apply(Integer input) {\n return Optional.of(input.toString()); //convert integer to String\n }\n })\n .reduce(new FunctionAcc<String, String>() {\n @Override\n public Optional<String> apply(String acc, String next) {\n return Optional.of(acc + \",\" + next); //join integers on \",\"\n }\n })\n .forEach(println()) //print out reaction results each in one line\n .start(); //on start() it will iterate through the array to fire the reactives\n\n //Reaction walk through:\n // Original source: 1 -> 2 -> 3 -> 4 -> 5 -> |\n // Filter events: 1 ------> 3 ------> 5 -> |\n // Map to String: \"1\" ----> \"3\" ----> \"5\"-> |\n // Join on \",\" by reduce: -----> \"1,3\" --> \"1,3,5\" -> |\n // Print out on each: ----> \"1,3\\n\" -> \"1,3,5\\n\" -> |\n }", "public void testConsumer ()\n {\n\n List<String> list = new ArrayList<>();\n list.add(\"ccc\");\n list.add(\"bbb\");\n list.add(\"ddd\");\n list.add(\"DDDD\");\n list.add(\"ccc\");\n list.add(\"aaa\");\n list.add(\"eee\");\n\n// Collections.sort(list);\n// Collections.sort(list, (s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.sort((s, s2) -> s.compareTo(s2));\n// list.sort((s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.forEach(s -> System.out.println(s));\n// list.forEach(s -> System.out.println(s));\n\n\n// Predicate<String> predicate2 = s -> s.length()>3;\n// System.out.println(\"predicate2.test(\\\"DDDD\\\") = \" + predicate2.test(\"DDDD\"));\n\n// Stream<String> stringStream = list.stream();\n// stringStream.forEach(s -> System.out.println(s));\n// stringStream.forEach(s -> System.out.println(s));//会报错\n\n// list.stream().forEach(s -> System.out.println(s));\n// list.stream().forEach(s -> System.out.println(s));\n\n //并行流是无序的\n// list.parallelStream().forEach(s -> System.out.println(s));\n// list.parallelStream().forEach(s -> System.out.println(s));\n\n// list.stream().skip(3).forEach(s -> System.out.println(s));\n// list.stream().distinct().forEach(s -> System.out.println(s));\n// System.out.println(\"list.stream().count() = \" + list.stream().count());\n// list.stream().limit(2).forEach(s -> System.out.println(s));\n\n// list.stream().filter(s -> s.length()<4).forEach(s -> System.out.println(s));\n\n// BiFunction<Integer, String, Person> bf = Person::new;\n// BiFunction<Integer, String, Person> bf = (n, s) -> new Person(s);\n\n// Person aaa = bf.apply();\n\n// System.out.println(\"aaa = \" + bf.apply(0, \"aaa\"));\n \n }", "default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }", "@Test\n public void collectAndReduce() {\n List<Book> collectedWithReduce = TestData.getBooks().stream()\n .reduce(new ArrayList<Book>(),\n (list, book) -> {\n // Separate list created to avoid mutating elements in the list\n // -> works also with parallel streams\n ArrayList<Book> result = new ArrayList<Book>(list);\n result.add(book);\n return result;\n }, (list1, list2) -> {\n ArrayList<Book> result = new ArrayList<Book>(list1);\n result.addAll(list2);\n return result;\n });\n assertEquals(4, collectedWithReduce.size());\n\n // Collect to list \"manually\" with collect\n // R collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator,\n // BiConsumer<R, R> combiner)\n List<Book> books = TestData.getBooks().stream()\n .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n assertEquals(4, books.size());\n\n // And the typical way using utilities from java.util.stream.Collectors\n assertEquals(4,\n TestData.getBooks().stream().collect(Collectors.toList()).size());\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Create Stream of Object\\n\");\n\t\tStream<String> stream= Stream.of(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t stream.forEach(System.out::println);\n\t \n // Create Stream from Objects from Collection\n\t\tSystem.out.println(\" \\n\\nCreate Stream Object from collection\\n\");\n\t Collection<String> collection=Arrays.asList(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t Stream<String> stream2=collection.stream();\n\t stream2.forEach(System.out::println);\n\t \n\t //Create Stream Object from Collection\n\t System.out.println(\"\\n\\nCreate Stream Object from List\");\n\t List<String> list= Arrays.asList(\"Modou\",\"Fatou\",\"Saliou\",\"Samba\");\n\t Stream<String> stream3=list.stream();\n\t stream3.forEach(System.out::println);\n\t \n\t //Create Stream Object from Set\n\t System.out.println(\"\\n Create Stream from Set\");\n\t Set<String> set= new HashSet<>(list);\n\t Stream<String> stream4= set.stream();\n\t stream4.forEach(System.out::println);\n\t \n\t //Create Stream Object from Arrays\n\t System.out.println(\"\\nCreate Stream Object from Arrays\");\n\t ArrayList<String> array= new ArrayList<>(list);\n\t Stream<String> stream5= array.stream();\n\t stream5.forEach(System.out::println);\n\t \n\t //Create Stream from Array of String\n\t System.out.println(\"\\n Create Stream from Array of String\");\n\t String[] strArray= {\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\"};\n\t Stream<String> stream6=Arrays.stream(strArray);\n\t stream6.forEach(System.out::println);\n\t \n\t \n\t}", "public static void main(String[] args) {\n\n int X = 20;\n X +=10;\n System.out.println(X);\n X +=60;\n System.out.println(X);\n\n String schoolname = \"CyberTek\";\n schoolname += 12345;\n System.out.println(schoolname);\n\n char ch1 = 'a'; //result will not be numbers\n ch1 += 'b';\n System.out.println(ch1);\n\n\n int num = 'z';\n num +='x';\n System.out.println(num);\n\n System.out.println(\"=============================================\");\n////////////////////////////////////////////////////////////////////////////////\n //multi warm up for shorthand Operators\nint a = 2;\na *=3;\n System.out.println(a);\n\n int b = a *= 10;\n // b = a = a * 10 = 60\n System.out.println(a);\n System.out.println(b);\n\n\n int a1 = 100;\n int b1 = ( a1*= 2) + ++a1;\n // b1 = 200 + 201\n System.out.println(b1);\n\n\n int x1 = 10;\n int y1 = x1 += 10*2;\n System.out.println(y1);\n\n\n int q = 20;\n int p = q *= 20*3;\n System.out.println(p);\n System.out.println(\"==========================================================\");\n//////////////////////////////////////////////////////////////////////////////\n\n// warmup: subtraction - shorthand operators:\n\n int num1 = 300;\n num1 /=2;\n System.out.println(num1);\n\n int num2 = 400;\n num2 /= 20 +10;\n System.out.println(num2);\n ///////////////////////////////////////////////////////////////////////\n\n//remainder for shorthand operators\n\n int num3 = 300;\n num3 %= 10 + 20;\n System.out.println(num3);\n \n\n\n\n }", "@Test\r\n\tvoid mapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\tStream<Integer> streamInteger = transactionBeanStream.peek(System.out::println).map(TransactionBean::getId);\r\n\t\tList<Integer> afterStreamList = streamInteger.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong value\", 1, afterStreamList.get(0).intValue());\r\n\t\tassertSame(\"wrong value\", 2, afterStreamList.get(1).intValue());\r\n\t\tassertSame(\"wrong value\", 3, afterStreamList.get(2).intValue());\r\n\t}", "public default <ANOTHER> StreamPlus<Tuple2<DATA, ANOTHER>> zipWith(Stream<ANOTHER> anotherStream) {\n return zipWith(anotherStream, RequireBoth, Tuple2::of);\n }", "public void streamIterate(){\n Stream.iterate(new int[]{0, 1},t -> new int[]{t[1], t[0]+t[1]})\n .limit(20)\n .forEach(t -> System.out.println(\"(\" + t[0] + \",\" + t[1] +\")\"));\n /*\n In Java 9, the iterate method was enhanced with support for a predicate.\n For example, you can generate numbers starting at 0 but stop the iteration once the number is greater than 100:\n * */\n IntStream.iterate(0, n -> n < 100, n -> n + 4)\n .forEach(System.out::println);\n }", "private void usingPrimitiveStream() {\n IntStream.range(1, 4).forEach(System.out::println);\n DoubleStream.of(2.3, 4.3).forEach(System.out::println);\n LongStream.range(1, 4).forEach(System.out::println);\n }", "public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }", "public static <T> Stream<T> streamIterate(T seed, UnaryOperator<T> unaryOperator, int limit) {\n return Stream.iterate(seed, unaryOperator).limit(limit);\n }", "@Override // kotlinx.coroutines.flow.FlowCollector\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public java.lang.Object emit(java.lang.Object r9, kotlin.coroutines.Continuation r10) {\n /*\n r8 = this;\n boolean r0 = r10 instanceof kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1\n if (r0 == 0) goto L_0x0013\n r0 = r10\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r0 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r0\n int r1 = r0.label\n r2 = -2147483648(0xffffffff80000000, float:-0.0)\n r3 = r1 & r2\n if (r3 == 0) goto L_0x0013\n int r1 = r1 - r2\n r0.label = r1\n goto L_0x0018\n L_0x0013:\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r0 = new kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1\n r0.<init>(r10)\n L_0x0018:\n java.lang.Object r10 = r0.result\n java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r2 = r0.label\n r3 = 2\n r4 = 1\n if (r2 == 0) goto L_0x005e\n if (r2 == r4) goto L_0x0044\n if (r2 != r3) goto L_0x003c\n java.lang.Object r8 = r0.L$6\n kotlinx.coroutines.flow.FlowCollector r8 = (kotlinx.coroutines.flow.FlowCollector) r8\n java.lang.Object r8 = r0.L$4\n kotlin.coroutines.Continuation r8 = (kotlin.coroutines.Continuation) r8\n java.lang.Object r8 = r0.L$2\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r8 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r8\n java.lang.Object r8 = r0.L$0\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2 r8 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2) r8\n kotlin.ResultKt.throwOnFailure(r10)\n goto L_0x009b\n L_0x003c:\n java.lang.IllegalStateException r8 = new java.lang.IllegalStateException\n java.lang.String r9 = \"call to 'resume' before 'invoke' with coroutine\"\n r8.<init>(r9)\n throw r8\n L_0x0044:\n java.lang.Object r8 = r0.L$6\n kotlinx.coroutines.flow.FlowCollector r8 = (kotlinx.coroutines.flow.FlowCollector) r8\n java.lang.Object r9 = r0.L$5\n java.lang.Object r2 = r0.L$4\n kotlin.coroutines.Continuation r2 = (kotlin.coroutines.Continuation) r2\n java.lang.Object r4 = r0.L$3\n java.lang.Object r5 = r0.L$2\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r5 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r5\n java.lang.Object r6 = r0.L$1\n java.lang.Object r7 = r0.L$0\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2 r7 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2) r7\n kotlin.ResultKt.throwOnFailure(r10)\n goto L_0x0084\n L_0x005e:\n kotlin.ResultKt.throwOnFailure(r10)\n kotlinx.coroutines.flow.FlowCollector r10 = kotlinx.coroutines.flow.FlowCollector.this\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1 r2 = r2\n kotlin.jvm.functions.Function2 r2 = r2.$action$inlined\n r0.L$0 = r8\n r0.L$1 = r9\n r0.L$2 = r0\n r0.L$3 = r9\n r0.L$4 = r0\n r0.L$5 = r9\n r0.L$6 = r10\n r0.label = r4\n java.lang.Object r2 = r2.invoke(r9, r0)\n if (r2 != r1) goto L_0x007e\n return r1\n L_0x007e:\n r7 = r8\n r4 = r9\n r6 = r4\n r8 = r10\n r2 = r0\n r5 = r2\n L_0x0084:\n r0.L$0 = r7\n r0.L$1 = r6\n r0.L$2 = r5\n r0.L$3 = r4\n r0.L$4 = r2\n r0.L$5 = r9\n r0.L$6 = r8\n r0.label = r3\n java.lang.Object r10 = r8.emit(r9, r0)\n if (r10 != r1) goto L_0x009b\n return r1\n L_0x009b:\n return r10\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object\");\n }", "private static void functionStream() {\n\t\tStream.iterate(0, n -> n + 2).limit(10).forEach(System.out::println);\n\t\tStream.generate(Math::random).limit(4).forEach(System.out::println);\n\n\t}", "public void create() {\n // 1\n Stream.of(unitOfWorks);\n // 2\n Arrays.stream(unitOfWorks);\n // 3\n Stream.of(unitOfWorks[0], unitOfWorks[1], unitOfWorks[2]);\n //4\n Stream.Builder<UnitOfWork> unitOfWorkBuilder = Stream.builder();\n unitOfWorkBuilder.accept(unitOfWorks[0]);\n unitOfWorkBuilder.accept(unitOfWorks[1]);\n unitOfWorkBuilder.accept(unitOfWorks[2]);\n Stream<UnitOfWork> unitOfWorkStream = unitOfWorkBuilder.build();\n\n }", "public static void main(String[] args) {\n unaryAndBinaryOperator();\n }", "public default <ANOTHER, TARGET> StreamPlus<TARGET> zipWith(Stream<ANOTHER> anotherStream, ZipWithOption option, BiFunction<DATA, ANOTHER, TARGET> combinator) {\n val iteratorA = streamPlus().iterator();\n val iteratorB = IteratorPlus.from(anotherStream.iterator());\n return StreamPlusHelper.doZipWith(option, combinator, iteratorA, iteratorB);\n }", "public static void main(String []args) {\n\t\tList<String> numbers = Arrays.asList(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\",\"7\",\"8\",\"9\");\r\n\t\t//Generate numbers from 1 to 9\r\n\t\tSystem.out.println(IntStream.range(1,10).mapToObj(String::valueOf).collect(Collectors.toList()));\r\n//\t\tSystem.out.println(\"Original list \" + numbers);\r\n\t\t\r\n\t\tList<Integer> even = numbers.stream()\r\n\t\t\t\t//gets the integer value from the string\r\n//\t\t\t\t.map(s ->Integer.valueOf(s))\r\n\t\t\t\t.map(Integer::valueOf) // Another way to do the top line(line 18)\r\n\t\t\t\t//checking if it is even\r\n\t\t\t\t.filter(number -> number % 2 ==1)// Odd numbers\r\n//\t\t\t\t.filter(number -> number % 2 ==0)// Even numbers\r\n\t\t\t\t//Collects results in to list call even.\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\tSystem.out.println(even);\r\n\r\n\t\tList<String> strings = Arrays.asList(\"abc\", \"\", \"bc\", \"efg\", \"abcd\", \"\", \"jkl\", \"\", \"\");\r\n\t\tSystem.out.println(strings);\r\n\t\t\r\n\t\tList<String> filtered = strings.stream()\r\n\t\t\t\t// checking each item and we check it is empty\r\n\t\t\t\t.filter(s-> !s.isEmpty())\r\n//\t\t\t\t.filter(s-> s.isEmpty())\r\n\t\t\t\t// add the remaining element to the list\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\tSystem.out.println(filtered);\r\n\t\t\r\n\t\t// Known as a method reference \r\n//\t\tforEach(System.out::println)\r\n\t\t \r\n\t}", "public void callLazystream()\n {\n\n Stream<String> stream = list.stream().filter(element -> {\n wasCalled();\n System.out.println(\"counter in intermediate operations:\" + counter);\n return element.contains(\"2\");\n });\n\n System.out.println(\"counter in intermediate operations:\" + counter);\n }", "O transform(R result);", "private void mapToObjUsingStream() {\n IntStream.range(1, 4)\n .mapToObj(i -> \"a\" + i)\n .forEach(System.out::println);\n }", "private void exercise2() {\n List<String> list = asList(\n \"The\", \"Quick\", \"BROWN\", \"Fox\", \"Jumped\", \"Over\", \"The\", \"LAZY\", \"DOG\");\n\n final List<String> lowerOddLengthList = list.stream()\n .filter((string) -> string.length() % 2 != 0)\n .map(String::toLowerCase)\n .peek(System.out::println)\n .collect(toList());\n }", "public static void main(String[] args) {\n\n Function<Integer, String> parOuImpar = n -> n % 2 == 0 ? \"Par\" : \"Ímpar\";\n\n System.out.println(parOuImpar.apply(27));\n\n Function<String, String> oResutladoE = v -> \"O resultado é: \" + v;\n\n Function<String, String> empolgado = x -> x + \"!!\";\n\n Function<String, String> duvida = v -> v + \"??\";\n\n String resultadoFinal = parOuImpar\n .andThen(oResutladoE) //Função encadeada\n .andThen(empolgado) //Função encadeada\n .apply(27);\n System.out.println(resultadoFinal);\n\n String resutladoFinal2 = parOuImpar\n .andThen(duvida)\n .apply(33);\n System.out.println(resutladoFinal2);\n\n }", "public static void main(String[] args) {\n System.out.println(getInt());\n// Function<Integer, Integer> increment = num -> ++num;\n// System.out.println(increment.apply(2));\n// Function<Integer, Integer> incrementTwoTimes = increment.andThen(increment);\n// System.out.println(incrementTwoTimes.apply(2));\n//\n// BiFunction <Integer, Integer, Integer> biIncrement = (number1, number) -> number1 + number ;\n// System.out.println(biIncrement.apply(increment.apply(2), increment.apply(2)));\n }", "public static void findFirstMultipleOfSixViaStreams(List<Integer> numbers){\n\n int abc = 9;\n numbers.stream().filter(x -> {\n System.out.println(\"x = \" + x);\n return x % 6 == 0;\n }).map(x -> x + abc).findFirst();\n// Optional<Integer> firstSixMultiple = numbers.stream()\n// .filter(x -> {\n// System.out.println(\"x = \" + x);\n// return x % 6 == 0;\n// })\n// .findFirst();\n\n// int ans = firstSixMultiple.orElse(-1);\n\n// System.out.println(ans);\n }", "@Override\n public BinaryOperator<ObjectNode> combiner() {\n return (l, r) -> {\n Iterator<Map.Entry<String, JsonNode>> it = r.fields();\n while (it.hasNext()) {\n Map.Entry<String, JsonNode> entry = it.next();\n l.set(entry.getKey(), entry.getValue());\n }\n return l;\n };\n }", "public ChainOperator(){\n\n }", "public static void main(String[] args) {\n\t\tStream<Integer> stream = Stream.of(1, 2, 3, 4, 5, 6);\n\t\tstream.forEach(System.out::print);\n\t\t//:: is called method refrence \n\t\tStream<Integer> stream1 = Stream.of(new Integer[]{1,2,3,4});\n\t\tstream1.forEach(System.out::println);\n\t\t\n\t\tStream<String> names2 = Stream.of(\"D\", \"A\", \"Z\", \"R\");\n names2.sorted(Comparator.naturalOrder()).forEach(System.out::println);\n\t\t \n \n\t}", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "@Override\n public void chain(@Nonnull final IMapReduce source) {\n performSourceMapReduce(((SparkMapReduce) source).output);\n }", "public static void main(String[] args) {\n ArrayList<Double> myList = new ArrayList<>();\n\n myList.add(7.0);\n myList.add(18.0);\n myList.add(10.0);\n myList.add(24.0);\n myList.add(17.0);\n myList.add(5.0);\n\n double productOfSqrRoots = myList.parallelStream().reduce(\n 1.0,\n (a, b) -> a * Math.sqrt(b),\n (a, b) -> a * b\n );\n\n System.out.println(\"Product of square roots: \" + productOfSqrRoots);\n\n\n // This won't work. !! VERY HARD TO UNDERSTAND !!\n // In this version of reduce(), ACCUMULATOR and COMBINER function are one and the same.\n // This results in an error because when TWO PARTIAL RESULTS ARE COMBINED, THEIR SQUARE\n // ROOTS ARE MULTIPLIED TOGETHER RATHER THAN THE PARTIAL RESULTS, themselves.\n double productOfSqrRoots2 = myList.parallelStream().reduce(\n 1.0,\n (a, b) -> a * Math.sqrt(b)\n );\n\n System.out.println(productOfSqrRoots2);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static <CollectedFact> Stream<CollectedFact> addToStream(\n\t\t\tStream<CollectedFact> stream, Stream<CollectedFact> stream2) {\n\t\tList<CollectedFact> result = stream.collect(Collectors.toList()); // error\n\t\tresult.addAll(stream2.collect(Collectors.toList()));\n//\t\tresult.forEach(System.out::println);\n\t\t\n\t\t\n\t\t//code to save to an Output File\n\t\t List<String> strList = result.stream().distinct().map(Object::toString)\n\t\t\t\t.collect(Collectors.toList());\n\n\t\ttry {\n\t\t\tFiles.write(Paths.get(outputFileName),\n\t\t\t\t\t(Iterable<String>) strList.stream()::iterator);\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\treturn result.stream();\n\t}", "public static void compose() {\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n source.subscribe(new MyObserver<>());\n return source;\n });\n\n System.out.println(\"# 2\");\n\n Observable.fromIterable(Utils.getData())\n .compose((source) -> {\n Observable<String> observable = Observable.just(\"composed\");\n observable.subscribe(new MyObserver<>());\n return observable;\n });\n }", "public static void main(String[] args) {\n Consumer<Integer> consumer = x ->{\n System.out.println(\"Number is :\"+x);\n };\n consumer.accept(55);\n //Supplier\n Supplier<String> str = () -> \"Implementation of Supplier \";\n System.out.println(str.get());\n //Predicate\n int a=37;\n Predicate<Integer> isOddPredicate = x -> x%2 != 0;\n System.out.println(\"Is \"+a+\" Odd Number :\"+isOddPredicate.test(a));\n //Function\n int b=7;\n Function<Integer,Integer> squareFunction = x -> x*x;\n System.out.println(\"Square of \"+b+\" is \"+squareFunction.apply(b));\n\n //Example\n List<Integer> list = List.of(12,9,13,4,6,2,4);\n Consumer<Integer> con = System.out::println;\n System.out.println(\"Example(Square of odd no.) : \");\n list.stream()\n .filter(isOddPredicate)\n .map(squareFunction)\n .forEach(con);\n\n\n\n }", "Operations operations();", "public static void main(String[] args) {\n System.out.println(IntStream.rangeClosed(1, 70).filter(t->t%7==0).sum());\n\n\t\t\n\t\t//2.yol\n\t\tSystem.out.println(IntStream.iterate(7, t->t+7).limit(10).sum());\n\t\t\n\t}", "@Test\n public void intermediateOutputsAreInputForLocalActions_prefetchIntermediateOutputs()\n throws Exception {\n write(\n \"a/BUILD\",\n \"genrule(\",\n \" name = 'remote',\",\n \" srcs = [],\",\n \" outs = ['remote.txt'],\",\n \" cmd = 'echo -n remote > $@',\",\n \")\",\n \"\",\n \"genrule(\",\n \" name = 'local',\",\n \" srcs = [':remote'],\",\n \" outs = ['local.txt'],\",\n \" cmd = 'cat $(location :remote) > $@ && echo -n local >> $@',\",\n \" tags = ['no-remote'],\",\n \")\");\n\n buildTarget(\"//a:remote\");\n waitDownloads();\n assertOutputsDoNotExist(\"//a:remote\");\n buildTarget(\"//a:local\");\n waitDownloads();\n\n assertOnlyOutputContent(\"//a:remote\", \"remote.txt\", \"remote\");\n assertOnlyOutputContent(\"//a:local\", \"local.txt\", \"remotelocal\");\n }", "public void optional() {\n\n // .stream\n Stream<Optional<Employee>> emp = getEmployeeStream(\"Some employee ID\");\n Stream<Employee> empStream = emp.flatMap(Optional::stream);\n\n // .or\n Optional<Employee> or = getEmployee(\"123\").or(() -> Optional.of(new Employee(\"123\")));\n\n // .ifPresentOrElse\n or.ifPresentOrElse(employee -> {\n System.out.println(\"Present\");\n }, () -> {\n System.out.println(\"Else\");\n });\n\n }", "public static <T> List<T> reduceToSingleList3(Stream<List<T>> stream) {\n List<T> list = stream.reduce(new ArrayList<T>(), (list1, list2) -> {\n list1.addAll(list2);\n return list1;\n });\n return list;\n }", "public IntStream parallelStream() {\n\treturn StreamSupport.intStream(spliterator(), true);\n }", "public static void main(final String[] args)\n {\n final Supplier<ArrayList<String>> proveedor = ArrayList::new;\n\n // Aqui tenemos el acumulador, el que añadira cada elemento del stream al proveedor definido\n // arriba\n // BiConsumer<ArrayList<String>, String> acumulador = (list, str) -> list.add(str);\n final BiConsumer<ArrayList<String>, String> acumulador = ArrayList::add;\n\n // Aquí tenemos el combinador, ya que por ejemplo al usar parallelStream, cada hijo generara\n // su propio proveedor, y al final deberan combinarse\n final BiConsumer<ArrayList<String>, ArrayList<String>> combinador = ArrayList::addAll;\n\n final List<Empleado> empleados = Empleado.empleados();\n final List<String> listNom = empleados.stream()\n .map(Empleado::getNombre)\n .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n System.out.println(listNom);\n\n // Usando Collectors\n final List<String> listNom2 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toList());\n System.out.println(listNom2);\n\n final Set<String> listNom3 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toSet());\n System.out.println(listNom3);\n\n final Collection<String> listNom4 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toCollection(TreeSet::new));\n System.out.println(listNom4);\n\n // Ahora con mapas\n final Map<Long, String> map = empleados.stream()\n .collect(Collectors.toMap(Empleado::getId, Empleado::getNombre));\n System.out.println(map);\n\n final Map<Genero, String> map2 = empleados.stream()\n .collect(Collectors.toMap(Empleado::getGenero, Empleado::getNombre,\n (nom1,\n nom2) -> String.join(\", \", nom1, nom2)));\n System.out.println(map2);\n }", "static AggregateOperation compose(Iterable<AggregateOperation> operations) {\n // NOTE(user): It's possible to replace the following two sets with a single map.\n Set<SegmentId> segmentsToRemove = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToAdd = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToEndModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<SegmentId> segmentsToStartModifying = new TreeSet<SegmentId>(segmentComparator);\n Set<ParticipantId> participantsToRemove = new TreeSet<ParticipantId>(participantComparator);\n Set<ParticipantId> participantsToAdd = new TreeSet<ParticipantId>(participantComparator);\n Map<String, DocOpList> docOps = new TreeMap<String, DocOpList>();\n for (AggregateOperation operation : operations) {\n composeIds(operation.segmentsToRemove, segmentsToRemove, segmentsToAdd);\n composeIds(operation.segmentsToAdd, segmentsToAdd, segmentsToRemove);\n composeIds(operation.segmentsToEndModifying, segmentsToEndModifying, segmentsToStartModifying);\n composeIds(operation.segmentsToStartModifying, segmentsToStartModifying, segmentsToEndModifying);\n composeIds(operation.participantsToRemove, participantsToRemove, participantsToAdd);\n composeIds(operation.participantsToAdd, participantsToAdd, participantsToRemove);\n for (DocumentOperations documentOps : operation.docOps) {\n DocOpList docOpList = docOps.get(documentOps.id);\n if (docOpList != null) {\n docOps.put(documentOps.id, docOpList.concatenateWith(documentOps.operations));\n } else {\n docOps.put(documentOps.id, documentOps.operations);\n }\n }\n }\n return new AggregateOperation(\n new ArrayList<SegmentId>(segmentsToRemove),\n new ArrayList<SegmentId>(segmentsToAdd),\n new ArrayList<SegmentId>(segmentsToEndModifying),\n new ArrayList<SegmentId>(segmentsToStartModifying),\n new ArrayList<ParticipantId>(participantsToRemove),\n new ArrayList<ParticipantId>(participantsToAdd),\n mapToList(docOps));\n }", "@Test\n public void test3() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY 8 > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator filter = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe1 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator fe2 = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "static void andThenCon(List<Integer> lst) {\n Consumer<List<Integer> > modify = list -> {\n for (int i = 0; i < list.size(); i++)\n list.set(i, 2 * list.get(i));\n };\n \n // Consumer to display a list of integers\n Consumer<List<Integer> >\n dispList = list -> list.stream().forEach(a -> System.out.print(a + \" \"));\n \n // using addThen()\n modify.andThen(dispList).accept(lst);\n\t}", "public Object lambda23() {\n return this.staticLink.lambda7loupOr(lists.cdr.apply1(this.res));\n }", "public Operation zCombinedAnd(Operation op)\r\n {\r\n if (op.equals(this))\r\n {\r\n return this;\r\n }\r\n return null;\r\n }", "public static void main(String[] args) {\n\tDouble totalSalaryExpense = employeeList.stream().map(emp -> emp.getSalary()).reduce(0.00, (a, b) -> a + b);\n\tSystem.out.println(\"Total salary expense: \" + totalSalaryExpense);\n\n\t// Example 2: Using Stream.reduce() method for finding employee with\n\t// maximum salary\n\tOptional<Employee> maxSalaryEmp = employeeList.stream()\n\t\t.reduce((Employee a, Employee b) -> a.getSalary() < b.getSalary() ? b : a);\n\n\tif (maxSalaryEmp.isPresent()) {\n\t System.out.println(\"Employee with max salary: \" + maxSalaryEmp.get());\n\t}\n\n\t// Java 8 code showing Stream.map() method usage\n\tList<String> mappedList = employeeList.stream().map(emp -> emp.getName()).collect(Collectors.toList());\n\tSystem.out.println(\"\\nEmployee Names\");\n\tmappedList.forEach(System.out::println);\n\n\t// Definition & usage of flatMap() method\n\tList<String> nameCharList = employeeList.stream().map(emp -> emp.getName().split(\"\"))\n\t\t.flatMap(array -> Arrays.stream(array)).map(str -> str.toUpperCase()).filter(str -> !(str.equals(\" \")))\n\t\t.collect(Collectors.toList());\n\tnameCharList.forEach(str -> System.out.print(str));\n\n\tStream<String[]> splittedNames = employeeList.stream().map(emp -> emp.getName().split(\"\"));\n\t// splittedNames.forEach(System.out::println);\n\tStream<String> characterStream = splittedNames.flatMap(array -> Arrays.stream(array));\n\tSystem.out.println();\n\t// characterStream.forEach(System.out::print);\n\tStream<String> characterStreamWOSpace = characterStream.filter(str -> !str.equalsIgnoreCase(\" \"));\n\t// characterStreamWOSpace.forEach(System.out::print);\n\n\tList<String> listOfUpperChars = characterStreamWOSpace.map(str -> str.toUpperCase())\n\t\t.collect(Collectors.toList());\n\tlistOfUpperChars.forEach(System.out::print);\n\n }", "public LatentImage transform(UnaryOperator<Color> op) {\n\t\tpendingOperations.add((x, y, c) -> op.apply(c));\n\t\treturn this;\n\t}", "default Stream<Token<?>> stream() {\n return stream(true);\n }", "default <T> EagerFutureStream<T> switchToIO(EagerFutureStream<T> stream){\n\t\tEagerReact react = EagerReactors.ioReact;\n\t\treturn stream.withTaskExecutor(react.getExecutor()).withRetrier(react.getRetrier());\n\t}", "default Stream<E> parallelStream() {\n return StreamSupport.stream(spliterator(), true);\n }", "@Test\n public void terminalOperations() {\n // count\n assertEquals(4, TestData.getBooks().stream().count());\n // findFirst\n Optional<Book> gangOfFour = TestData.getBooks().stream()\n .filter(book -> book.name.equals(\"Design Patterns: Elements of Reusable Object-Oriented Software\"))\n .findFirst();\n assertTrue(gangOfFour.isPresent());\n assertEquals(4, gangOfFour.get().authors.size());\n }", "public default <ANOTHER> StreamPlus<Tuple2<DATA, ANOTHER>> zipWith(Stream<ANOTHER> anotherStream, ZipWithOption option) {\n return zipWith(anotherStream, option, Tuple2::of);\n }", "public static Expression reduce(Expression expression) { throw Extensions.todo(); }", "private void operator() {\n reduce();\n shift();\n getDispenser().advance();\n if(getDispenser().tokenIsNumber()) setState(State.NUMBER);\n else if (getDispenser().tokenIsLeftParen()) setState(State.LEFT_PAREN);\n else syntaxError(NUM);\n \n }", "default EagerFutureStream<U> control(Function<Supplier<U>, Supplier<U>> fn) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.control(fn);\n\t}", "public default StreamPlus<DATA> choose(Stream<DATA> anotherStream, ZipWithOption option, BiFunction<DATA, DATA, Boolean> selectThisNotAnother) {\n val iteratorA = this.streamPlus().iterator();\n val iteratorB = anotherStream.iterator();\n val iterator = new Iterator<DATA>() {\n \n private boolean hasNextA;\n \n private boolean hasNextB;\n \n public boolean hasNext() {\n hasNextA = iteratorA.hasNext();\n hasNextB = iteratorB.hasNext();\n return (option == ZipWithOption.RequireBoth) ? (hasNextA && hasNextB) : (hasNextA || hasNextB);\n }\n \n public DATA next() {\n val nextA = hasNextA ? iteratorA.next() : null;\n val nextB = hasNextB ? iteratorB.next() : null;\n if (hasNextA && hasNextB) {\n boolean selectA = selectThisNotAnother.apply(nextA, nextB);\n return selectA ? nextA : nextB;\n }\n if (hasNextA) {\n return nextA;\n }\n if (hasNextB) {\n return nextB;\n }\n throw new NoMoreResultException();\n }\n };\n val iterable = new Iterable<DATA>() {\n \n @Override\n public Iterator<DATA> iterator() {\n return iterator;\n }\n };\n return StreamPlus.from(StreamSupport.stream(iterable.spliterator(), false));\n }", "@Test\n public void terminalOperationsIndeed() {\n Stream<Book> bookStream = TestData.getBooks().stream();\n assertEquals(4, bookStream.count());\n\n try {\n bookStream.count();\n fail(\"No expection got?\");\n } catch(IllegalStateException e) {\n // We got exception as expected\n }\n }", "public default StreamPlus<DATA> prependWith(Stream<DATA> head) {\n return StreamPlus.concat(StreamPlus.from(head), streamPlus());\n }", "public static void main(String[] args) {\n\t\tConsumer<List<Integer>> modify = list -> {\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tlist.set(i, 2 * list.get(i));\n\t\t};\n\n\t\t// Consumer to display a list of integers\n\t\tConsumer<List<Integer>> dispList = list -> list.stream().forEach(a -> System.out.print(a + \" \"));\n\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(1);\n\t\tlist.add(3);\n\n\t\t// using addThen()\n\t\tmodify.andThen(dispList).accept(list);\n\n\t\t// demonstrate when NullPointerException is returned.\n\t\ttry {\n\t\t\t// using addThen()\n\t\t\tmodify.andThen(null).accept(list);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exception: \" + e);\n\t\t}\n\n\t\t// demonstrate how an Exception in the after function is returned and handled.\n\t\t// using addThen()\n\t\ttry {\n\t\t\tdispList.andThen(modify).accept(list);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exception: \" + e);\n\t\t}\n\t}", "static Integer foo(final List<Integer> list,\n final Integer initial,\n final Function2<Integer, Integer, Integer> operator) {\n Integer accumulator = initial;\n for (final Integer element : list) {\n accumulator = operator.apply(accumulator, element);\n }\n\n return accumulator;\n }", "Unary operator(Operator o);", "default <R> EagerFutureStream<Tuple2<U,R>> zipFutures(Stream<R> other) {\n\t\treturn (EagerFutureStream<Tuple2<U,R>>)FutureStream.super.zipFutures(other);\n\n\t}", "@Test\n public void test2() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY \" + SIZE.class.getName() +\"(TOTUPLE(*)) > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator filter = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe2 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "public void rc(){\n List<Integer> numbers = new ArrayList<>();\n var result = List.of(1,2,3,4,5,6,7,8,9,10);\n result\n .parallelStream()\n .forEach(number->addToList(numbers,number));\n print.accept(numbers);\n }", "@Test\r\n void multiLevelFilter() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY).filter(t -> \"r3\".equals(t.getValue()));\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong value\", \"r3\", afterStreamList.get(0).getValue());\r\n }", "private void streamsMinDemo() {\n IntStream.of(numbers).min().ifPresent(System.out::println);\n IntStream.of(numbers).max().ifPresent(System.out::println);\n IntStream.of(numbers).average().ifPresent(System.out::println);\n System.out.println(IntStream.of(numbers).count());\n System.out.println(IntStream.of(numbers).sum());\n }", "private Expr unary() {\n if(match(BANG, MINUS)) { // If this thing can be accurately considered a unary...\n Token operator = previous();\n Expr right = unary();\n return new Expr.Unary(operator, right);\n }\n\n return call(); // Otherwise, pass it up the chain of precedence\n }", "@Test\n void doubleEvenNumbers() {\n Flux<Integer> source = Flux.range(1, 10)\n .filter(n -> n % 2 == 0)\n .map(n -> n * 2);\n\n // FIXME: Verify Flux source using StepVerifier\n }", "public static void main(String[] args) {\n System.out.println(\"Chapter 3 - 3.3. Reduction Operations Using Reduce\");\n\n\n System.out.println();\n // *** Reduction Operations on IntStream ***\n reductionOperationsOnIntStream();\n\n System.out.println();\n // *** Summing Numbers Using reduce() ***\n summingNumbersUsingReduce();\n\n System.out.println();\n // *** Perform reduce with a BinaryOperator ***\n performReduceWithABinaryOperator();\n\n System.out.println();\n // *** Using a Collector ***\n usingACollector();\n\n System.out.println();\n // *** Accumulating Books into a Map ***\n new Recipe_3_3_Reduction_Operations_Using_Reduce().accumulatingBooksIntoAMap();\n }", "@Override\n\tpublic void VisitUnaryNode(UnaryOperatorNode Node) {\n\n\t}", "public IntStream stream() {\n\treturn StreamSupport.intStream(spliterator(), false);\n }" ]
[ "0.7203156", "0.5631429", "0.5508141", "0.5409803", "0.54034853", "0.5399074", "0.5377607", "0.53469956", "0.53450274", "0.52855086", "0.52488005", "0.5193727", "0.5184516", "0.5124545", "0.51031923", "0.5055176", "0.5049245", "0.50317246", "0.50255793", "0.50187534", "0.49915555", "0.49845886", "0.49805462", "0.49592844", "0.488983", "0.48868626", "0.48716858", "0.48706263", "0.48697826", "0.4839766", "0.48366737", "0.48257858", "0.48149756", "0.48138747", "0.48117018", "0.47804886", "0.47483546", "0.47241127", "0.47105676", "0.47032517", "0.46965382", "0.4685303", "0.4682968", "0.4676484", "0.46735013", "0.46664673", "0.4657987", "0.46521991", "0.46381634", "0.46362743", "0.4634402", "0.46288094", "0.46266448", "0.4607277", "0.4602423", "0.45986935", "0.4597529", "0.45916605", "0.45782933", "0.45754057", "0.45742115", "0.45715424", "0.45653844", "0.45621666", "0.45617622", "0.45474643", "0.4545804", "0.45314756", "0.4526313", "0.45246533", "0.4505088", "0.4493448", "0.44925597", "0.44917488", "0.44819015", "0.44815174", "0.44783476", "0.4475693", "0.44730714", "0.44578767", "0.44559216", "0.44482118", "0.44303492", "0.44284168", "0.44227678", "0.4422654", "0.44174123", "0.44132096", "0.43960077", "0.4395216", "0.43951708", "0.43946174", "0.43940118", "0.43921453", "0.43903393", "0.43847695", "0.4381615", "0.43772483", "0.43731487", "0.43725017" ]
0.6229671
1
Terminal operations are operations that consume the stream to produce a result or a sideeffect. Some examples: reduce, count, collect, foreach, findAny, findFirst Note that after a stream is consumed (by doing a terminal operation), it can't be used any more.
@Test public void terminalOperations() { // count assertEquals(4, TestData.getBooks().stream().count()); // findFirst Optional<Book> gangOfFour = TestData.getBooks().stream() .filter(book -> book.name.equals("Design Patterns: Elements of Reusable Object-Oriented Software")) .findFirst(); assertTrue(gangOfFour.isPresent()); assertEquals(4, gangOfFour.get().authors.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void intermediateAndTerminalOperations() throws Exception {\n System.out.println(\n MockData.getCars()\n // Here we go to \"abstraction\" of strams\n .stream()\n // This is an intermediate op because we stay in the abstraction\n .filter(car -> {\n System.out.println(\"filter car \" + car);\n return car.getPrice() < 10000;\n })\n // This is intermediate too, we still working with streams \"abstraction\"\n .map(car -> {\n System.out.println(\"mapping car \" + car);\n return car.getPrice();\n })\n // same as before, still intermediate, still in streams abstraction\n .map(price -> {\n System.out.println(\"mapping price \" + price);\n return price + (price * .14);\n })\n // ok, this is a terminal operation and give you back the \"concrete type\" result of the operations\n .collect(Collectors.toList())\n );\n\n // Q: If you comment this line, no result is printed, you got only stram reference, why?\n // A: STREAMS are LAZY initialized\n\n // Q: What's the order of execution in the above code?\n // A: See the console print to understand order of execution:\n // The mappings are executed as soon as the first car passes the filter\n // so to get some results, stream don't need to filter ALL the list before\n\n }", "public static void main(String[] args){\n int result = Stream.of(1,2,3,4,5,6,7,8,9,10)\n .reduce(0,Integer::sum);//metodo referenciado\n// .reduce(0, (acumulador, elemento) -> acumulador+elemento);\n System.out.println(result);\n\n // Obtener lenguajes separados por pipeline entre ellos y sin espacios\n // opcion 1(mejor) con operador ternario\n String cadena = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador.equals(\"\")?lenguaje:acumulador + \"|\" + lenguaje);\n\n System.out.println(cadena);\n\n //Opcion 2 Con regex\n String cadenaRegex = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador + \"|\" + lenguaje)\n .replaceFirst(\"\\\\|\",\"\") // Quitamos la primera pipeline\n .replaceAll(\"\\\\s\",\"\"); // Quitamos todos los espacios\n\n System.out.println(cadenaRegex);\n }", "@Test\n public void terminalOperationsIndeed() {\n Stream<Book> bookStream = TestData.getBooks().stream();\n assertEquals(4, bookStream.count());\n\n try {\n bookStream.count();\n fail(\"No expection got?\");\n } catch(IllegalStateException e) {\n // We got exception as expected\n }\n }", "public static void main(String[] args) {\n int count = Stream.of(1, 2, 3).reduce(0, (lhs, rhs) -> lhs + rhs);\r\n System.out.println(\"Sum by reduce: \" + count);\r\n \r\n // 3-16a: feature preview\r\n count = Stream.of(1, 2, 3).reduce(0, Integer::sum);\r\n System.out.println(\"Ditto - Integer::sum: \" + count);\r\n \r\n // 3-16b: another feature preview - get rid of boxing/unboxing\r\n count = IntStream.of(1, 2, 3).sum();\r\n System.out.println(\"Ditto - IntStream.sum(): \" + count);\r\n \r\n // Example 3-18\r\n count = 0;\r\n for (int value : new int[]{1, 2, 3}) {\r\n count += value;\r\n }\r\n System.out.println(\"Ditto - classic: \" + count);\r\n \r\n }", "@Test\n public void streamApiTest(){\n Collection<Integer> myCollection=initializeIntCollection(3,5);\n\n long sumOfOddValues3times=myCollection.stream().\n filter(o -> o % 2 ==1). // for all odd numbers\n mapToInt(o -> o*3). // multiply their value on 3\n sum(); // and return their sum (reduce operation)\n Assert.assertEquals((3+5+7)*3, sumOfOddValues3times);\n\n Optional<Integer> sumOfModulesOn3= myCollection.stream().\n filter( o -> o % 3 ==0).\n reduce((sum, o) -> sum = sum + o);\n Assert.assertEquals(new Integer(3+6), sumOfModulesOn3.get());\n\n\n\n Collection<Integer> evenCollection=new ArrayList<>();\n myCollection.\n stream().\n filter(o -> o % 2 == 0).\n forEach((i) -> evenCollection.add(i));\n }", "public static void reduceDemo() {\n Observable.range(1, 10).reduce(new Func2<Integer, Integer, Integer>() {\n @Override\n public Integer call(Integer integer, Integer integer2) {\n RxDemo.log(RxDemo.getMethodName() + \" \" + integer + \" \" + integer2);\n return integer + integer2;\n }\n }).subscribe(new RxCreateOperator.Sub());\n }", "public static void calculateSumViaStreams(List<Integer> numbers){\n int sum = numbers.stream()\n .filter(x -> x % 2 == 0)\n .map(y -> y * y)\n .reduce(0, (x, y) -> x + y);\n\n System.out.println(sum);\n }", "protected static void performReduceWithABinaryOperator() {\n Integer sum = Stream.of(1, 2, 3, 4, 5).reduce(0, Integer::sum);\n\n Integer minValue = Stream.of(5, 4, 9, 2, 1).reduce(Integer.MIN_VALUE, Integer::max);\n\n String concatenation = Stream.of(\"str \", \"= \", \"alt \", \"string\")\n // the first parameter becomes the target of the concat method and the second one is the argument to concat\n // the target, the parameter and the result are of the same type and this can be considered a binary\n // operator for the reduce method\n .reduce(\"\", String::concat);\n System.out.println(concatenation);\n }", "private void operator() {\n reduce();\n shift();\n getDispenser().advance();\n if(getDispenser().tokenIsNumber()) setState(State.NUMBER);\n else if (getDispenser().tokenIsLeftParen()) setState(State.LEFT_PAREN);\n else syntaxError(NUM);\n \n }", "public static void main(String[] args) {\n\t\tStream<Integer> intStream = Stream.of(1, 2, 3, 4);\n\t\t// intStream.forEach(System.out::println);\n\n\t\t/*\n\t\t * Approach 2 of declaring a stream objects with range of elements from 1-10\n\t\t * where last range element is not considered while printing or for any //\n\t\t * operation like sum, average, etc.\n\t\t * \n\t\t * We have IntStream, DoubleStream, etc to handle primitive values inside\n\t\t * streams...\n\t\t */\n\n\t\tIntStream.range(1, 10).forEach(e -> System.out.println(\"IntStream values from 1-10 range: \" + e)); // This will\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// print\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// numbers\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// from 1-9\n\n\t\t// Sometimes,we really want to create Streams dynamically instead of sequential\n\t\t// int values as above. We can use iterate method to to that.\n\t\tIntStream.iterate(1, e -> e * 2).limit(10).forEach(System.out::println);// Priting square numbers\n\n\t\tIntStream.iterate(2, e -> e + 2).limit(10).peek(System.out::println);// Printing even numbers\n\n\t\t/*\n\t\t * Convert these primitive streams to List For that we need to do a boxing\n\t\t * operation on top of stream\n\t\t */\n\n\t\tSystem.out.println(\"Converting IntStream to List...\");\n\t\tIntStream.range(1, 10).limit(5).boxed().collect(Collectors.toList()).forEach(System.out::println);\n\n\t\t/*\n\t\t * Lets explore some concepts on Strings...How stream works on strings and its\n\t\t * related operations\n\t\t */\n\n\t\t// Stream courseStream = Stream.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses2 = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\t// If we want to join these values\n\n\t\tSystem.out.println(courses.stream().collect(Collectors.joining()));\n\n\t\t/*\n\t\t * Lets say, if i want tp split each string in stream seprated by comma..\n\t\t */\n\t\tSystem.out.println(\"String opeartaion within Streams....\");\n\t\t// The below one prints all stream Objects that executed on top of split\n\t\t// function. So, we need to flatMap it to extract the actual result\n\t\tSystem.out.println(courses.stream().map(course -> course.toString().split(\",\")).collect(Collectors.toList()));\n\t\tSystem.out.println(\n\t\t\t\tcourses.stream().map(course -> course.split(\"\")).flatMap(Arrays::stream).collect(Collectors.toList()));\n\n\t\tSystem.out.println(\"Tuples strings : \"\n\t\t\t\t+ courses.stream().flatMap(course -> courses2.stream().map(course2 -> List.of(course, course2)))\n\t\t\t\t\t\t.collect(Collectors.toList()));\n\n\t\t/**\n\t\t * Higher Order Functions... Higher Order function is a function that returns a\n\t\t * function... In simpler terms, a method that returns a Predicate which\n\t\t * contains logic. So, here we are using method logic as a normal data and\n\t\t * returning it from an another method..\n\t\t */\n\n\t\tList<Courses> courseList = List.of(new Courses(1, \"Java\", 5000, 5), new Courses(2, \"AWS\", 4000, 4));\n\t\t// If we want to get courses whcih has number of students greater than 4000,\n\t\t// then we need to write a predicate for that first\n\t\tint numberOfStudentsThreshhold = 4000;\n\t\tPredicate<Courses> numberOfStudentsPredicate = numberOfStudentsPredecateMethod(numberOfStudentsThreshhold);\n\n\t\tSystem.out.println(\"Courses that has score>4000 : \"\n\t\t\t\t+ courseList.stream().filter(numberOfStudentsPredicate).collect(Collectors.toList()));\n\n\t}", "@Test\n public void streamsExample() {\n List<Integer> list = asList(1, 2, 3, 4, 5);\n \n list.stream().forEach(out::println);\n \n out.println();\n \n list.stream().parallel().forEachOrdered(out::println);\n \n \n }", "static <T> Function<T, T> compose(Stream<Function<T, T>> functions) {\n return functions.reduce(identity(), Function::andThen);\n }", "public static <T> Stream<T> streamIterate(T seed, UnaryOperator<T> unaryOperator, int limit) {\n return Stream.iterate(seed, unaryOperator).limit(limit);\n }", "private static void functionStream() {\n\t\tStream.iterate(0, n -> n + 2).limit(10).forEach(System.out::println);\n\t\tStream.generate(Math::random).limit(4).forEach(System.out::println);\n\n\t}", "public void streamIterate(){\n Stream.iterate(new int[]{0, 1},t -> new int[]{t[1], t[0]+t[1]})\n .limit(20)\n .forEach(t -> System.out.println(\"(\" + t[0] + \",\" + t[1] +\")\"));\n /*\n In Java 9, the iterate method was enhanced with support for a predicate.\n For example, you can generate numbers starting at 0 but stop the iteration once the number is greater than 100:\n * */\n IntStream.iterate(0, n -> n < 100, n -> n + 4)\n .forEach(System.out::println);\n }", "public final AstValidator.stream_cmd_return stream_cmd() throws RecognitionException {\n AstValidator.stream_cmd_return retval = new AstValidator.stream_cmd_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree STDIN64=null;\n CommonTree STDOUT66=null;\n CommonTree QUOTEDSTRING68=null;\n AstValidator.func_clause_return func_clause65 =null;\n\n AstValidator.func_clause_return func_clause67 =null;\n\n AstValidator.func_clause_return func_clause69 =null;\n\n\n CommonTree STDIN64_tree=null;\n CommonTree STDOUT66_tree=null;\n CommonTree QUOTEDSTRING68_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:216:12: ( ^( STDIN ( func_clause )? ) | ^( STDOUT ( func_clause )? ) | ^( QUOTEDSTRING ( func_clause )? ) )\n int alt15=3;\n switch ( input.LA(1) ) {\n case STDIN:\n {\n alt15=1;\n }\n break;\n case STDOUT:\n {\n alt15=2;\n }\n break;\n case QUOTEDSTRING:\n {\n alt15=3;\n }\n break;\n default:\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 15, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt15) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:216:14: ^( STDIN ( func_clause )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n STDIN64=(CommonTree)match(input,STDIN,FOLLOW_STDIN_in_stream_cmd800); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n STDIN64_tree = (CommonTree)adaptor.dupNode(STDIN64);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(STDIN64_tree, root_1);\n }\n\n\n if ( input.LA(1)==Token.DOWN ) {\n match(input, Token.DOWN, null); if (state.failed) return retval;\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:216:23: ( func_clause )?\n int alt12=2;\n int LA12_0 = input.LA(1);\n\n if ( (LA12_0==FUNC||LA12_0==FUNC_REF) ) {\n alt12=1;\n }\n switch (alt12) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:216:23: func_clause\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_func_clause_in_stream_cmd802);\n func_clause65=func_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, func_clause65.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n }\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 2 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:217:14: ^( STDOUT ( func_clause )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n STDOUT66=(CommonTree)match(input,STDOUT,FOLLOW_STDOUT_in_stream_cmd822); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n STDOUT66_tree = (CommonTree)adaptor.dupNode(STDOUT66);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(STDOUT66_tree, root_1);\n }\n\n\n if ( input.LA(1)==Token.DOWN ) {\n match(input, Token.DOWN, null); if (state.failed) return retval;\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:217:24: ( func_clause )?\n int alt13=2;\n int LA13_0 = input.LA(1);\n\n if ( (LA13_0==FUNC||LA13_0==FUNC_REF) ) {\n alt13=1;\n }\n switch (alt13) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:217:24: func_clause\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_func_clause_in_stream_cmd824);\n func_clause67=func_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, func_clause67.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n }\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 3 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:218:14: ^( QUOTEDSTRING ( func_clause )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n QUOTEDSTRING68=(CommonTree)match(input,QUOTEDSTRING,FOLLOW_QUOTEDSTRING_in_stream_cmd844); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n QUOTEDSTRING68_tree = (CommonTree)adaptor.dupNode(QUOTEDSTRING68);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(QUOTEDSTRING68_tree, root_1);\n }\n\n\n if ( input.LA(1)==Token.DOWN ) {\n match(input, Token.DOWN, null); if (state.failed) return retval;\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:218:30: ( func_clause )?\n int alt14=2;\n int LA14_0 = input.LA(1);\n\n if ( (LA14_0==FUNC||LA14_0==FUNC_REF) ) {\n alt14=1;\n }\n switch (alt14) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:218:30: func_clause\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_func_clause_in_stream_cmd846);\n func_clause69=func_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, func_clause69.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n }\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "private Pair<JsonArray, JsonArray> performManyOpsAndReturnResultingErrorsAndResults(String accession,\n Iterable<Op> ops) {\n JsonArray opsWithErrors = new JsonArray();\n JsonArray opsWithResults = new JsonArray();\n boolean failed = false;\n boolean setFailed = false;\n JsonElement resultOfPreviousOperations = JsonNull.INSTANCE;\n JsonElement resultOfCurrentOperation;\n List<Op> opsThatProducedTheSameResult = new ArrayList<>();\n for (Op op: ops) {\n if (failed) {\n resultOfCurrentOperation = new JsonPrimitive(\"Not started\");\n } else {\n Pair<OpResult, ? extends JsonElement> r = performOneOp(accession, op);\n if (r.getLeft().equals(OpResult.FAILURE)) {\n setFailed = true;\n }\n resultOfCurrentOperation = r.getRight();\n }\n\n if (resultOfPreviousOperations.equals(resultOfCurrentOperation)) {\n opsThatProducedTheSameResult.add(op);\n } else {\n if (!resultOfPreviousOperations.equals(JsonNull.INSTANCE)) {\n (failed ? opsWithErrors : opsWithResults)\n .add(aggregatedResultsObject(opsThatProducedTheSameResult, resultOfPreviousOperations));\n }\n opsThatProducedTheSameResult = new ArrayList<>();\n opsThatProducedTheSameResult.add(op);\n resultOfPreviousOperations = resultOfCurrentOperation;\n }\n failed |= setFailed;\n }\n (failed ? opsWithErrors : opsWithResults)\n .add(aggregatedResultsObject(opsThatProducedTheSameResult, resultOfPreviousOperations));\n return Pair.of(opsWithErrors, opsWithResults);\n }", "public static void main(String[] args) {\n ArrayList<Double> myList = new ArrayList<>();\n\n myList.add(7.0);\n myList.add(18.0);\n myList.add(10.0);\n myList.add(24.0);\n myList.add(17.0);\n myList.add(5.0);\n\n double productOfSqrRoots = myList.parallelStream().reduce(\n 1.0,\n (a, b) -> a * Math.sqrt(b),\n (a, b) -> a * b\n );\n\n System.out.println(\"Product of square roots: \" + productOfSqrRoots);\n\n\n // This won't work. !! VERY HARD TO UNDERSTAND !!\n // In this version of reduce(), ACCUMULATOR and COMBINER function are one and the same.\n // This results in an error because when TWO PARTIAL RESULTS ARE COMBINED, THEIR SQUARE\n // ROOTS ARE MULTIPLIED TOGETHER RATHER THAN THE PARTIAL RESULTS, themselves.\n double productOfSqrRoots2 = myList.parallelStream().reduce(\n 1.0,\n (a, b) -> a * Math.sqrt(b)\n );\n\n System.out.println(productOfSqrRoots2);\n }", "public static void main(String[] args) {\n\tDouble totalSalaryExpense = employeeList.stream().map(emp -> emp.getSalary()).reduce(0.00, (a, b) -> a + b);\n\tSystem.out.println(\"Total salary expense: \" + totalSalaryExpense);\n\n\t// Example 2: Using Stream.reduce() method for finding employee with\n\t// maximum salary\n\tOptional<Employee> maxSalaryEmp = employeeList.stream()\n\t\t.reduce((Employee a, Employee b) -> a.getSalary() < b.getSalary() ? b : a);\n\n\tif (maxSalaryEmp.isPresent()) {\n\t System.out.println(\"Employee with max salary: \" + maxSalaryEmp.get());\n\t}\n\n\t// Java 8 code showing Stream.map() method usage\n\tList<String> mappedList = employeeList.stream().map(emp -> emp.getName()).collect(Collectors.toList());\n\tSystem.out.println(\"\\nEmployee Names\");\n\tmappedList.forEach(System.out::println);\n\n\t// Definition & usage of flatMap() method\n\tList<String> nameCharList = employeeList.stream().map(emp -> emp.getName().split(\"\"))\n\t\t.flatMap(array -> Arrays.stream(array)).map(str -> str.toUpperCase()).filter(str -> !(str.equals(\" \")))\n\t\t.collect(Collectors.toList());\n\tnameCharList.forEach(str -> System.out.print(str));\n\n\tStream<String[]> splittedNames = employeeList.stream().map(emp -> emp.getName().split(\"\"));\n\t// splittedNames.forEach(System.out::println);\n\tStream<String> characterStream = splittedNames.flatMap(array -> Arrays.stream(array));\n\tSystem.out.println();\n\t// characterStream.forEach(System.out::print);\n\tStream<String> characterStreamWOSpace = characterStream.filter(str -> !str.equalsIgnoreCase(\" \"));\n\t// characterStreamWOSpace.forEach(System.out::print);\n\n\tList<String> listOfUpperChars = characterStreamWOSpace.map(str -> str.toUpperCase())\n\t\t.collect(Collectors.toList());\n\tlistOfUpperChars.forEach(System.out::print);\n\n }", "default Stream<Token<?>> stream() {\n return stream(true);\n }", "@CompileStatic\npublic interface Stream<T> {\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n default <X> Stream<X> flatMap(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper) {\n\n return flatMap(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name name of the operation\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n <X> Stream<X> flatMap(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper);\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper the mapping closure\n * @return remapped stream\n */\n default <X> Stream<X> map(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper) {\n\n return map(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name stable name of the mapping operator\n * @param mapper the mapping closure\n * @return remapped stream\n */\n <X> Stream<X> map(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper);\n\n /**\n * Filter stream based on predicate\n *\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }\n\n /**\n * Filter stream based on predicate\n *\n * @param name name of the filter operator\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);\n\n /**\n * Assign event time to elements.\n *\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n default Stream<T> assignEventTime(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner) {\n\n return assignEventTime(null, assigner);\n }\n\n /**\n * Assign event time to elements.\n *\n * @param name name of the assign event time operator\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n Stream<T> assignEventTime(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner);\n\n /**\n * Add window to each element in the stream.\n *\n * @return stream of pairs with window\n */\n default Stream<Pair<Object, T>> withWindow() {\n return withWindow(null);\n }\n\n /**\n * Add window to each element in the stream.\n *\n * @param name stable name of the mapping operator\n * @return stream of pairs with window\n */\n Stream<Pair<Object, T>> withWindow(@Nullable String name);\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @return stream of pairs with timestamp\n */\n default Stream<Pair<T, Long>> withTimestamp() {\n return withTimestamp(null);\n }\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @param name stable name of mapping operator\n * @return stream of pairs with timestamp\n */\n Stream<Pair<T, Long>> withTimestamp(@Nullable String name);\n\n /** Print all elements to console. */\n void print();\n\n /**\n * Collect stream as list. Note that this will result on OOME if this is unbounded stream.\n *\n * @return the stream collected as list.\n */\n List<T> collect();\n\n /**\n * Test if this is bounded stream.\n *\n * @return {@code true} if this is bounded stream, {@code false} otherwise\n */\n boolean isBounded();\n\n /**\n * Process this stream as it was unbounded stream.\n *\n * <p>This is a no-op if {@link #isBounded} returns {@code false}, otherwise it turns the stream\n * into being processed as unbounded, although being bounded.\n *\n * <p>This is an optional operation and might be ignored if not supported by underlying\n * implementation.\n *\n * @return Stream viewed as unbounded stream, if supported\n */\n default Stream<T> asUnbounded() {\n return this;\n }\n\n /**\n * Convert elements to {@link StreamElement}s.\n *\n * @param <V> type of value\n * @param repoProvider provider of {@link Repository}\n * @param entity the entity of elements\n * @param keyExtractor extractor of keys\n * @param attributeExtractor extractor of attributes\n * @param valueExtractor extractor of values\n * @param timeExtractor extractor of time\n * @return stream with {@link StreamElement}s inside\n */\n <V> Stream<StreamElement> asStreamElements(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Persist this stream to replication.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param replicationName name of replication to persist stream to\n * @param target target of the replication\n */\n void persistIntoTargetReplica(\n RepositoryProvider repoProvider, String replicationName, String target);\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n */\n default void persistIntoTargetFamily(RepositoryProvider repoProvider, String targetFamilyname) {\n persistIntoTargetFamily(repoProvider, targetFamilyname, 10);\n }\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n * @param parallelism parallelism to use when target family is bulk attribute family\n */\n void persistIntoTargetFamily(\n RepositoryProvider repoProvider, String targetFamilyname, int parallelism);\n\n /**\n * Persist this stream as attribute of entity\n *\n * @param <V> type of value extracted\n * @param repoProvider provider of repository\n * @param entity the entity to store the stream to\n * @param keyExtractor extractor of key for elements\n * @param attributeExtractor extractor for attribute for elements\n * @param valueExtractor extractor of values for elements\n * @param timeExtractor extractor of event time\n */\n <V> void persist(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Directly write this stream to repository. Note that the stream has to contain {@link\n * StreamElement}s (e.g. created by {@link #asStreamElements}.\n *\n * @param repoProvider provider of repository\n */\n void write(RepositoryProvider repoProvider);\n\n /**\n * Create time windowed stream.\n *\n * @param millis duration of tumbling window\n * @return time windowed stream\n */\n WindowedStream<T> timeWindow(long millis);\n\n /**\n * Create sliding time windowed stream.\n *\n * @param millis duration of the window\n * @param slide duration of the slide\n * @return sliding time windowed stream\n */\n WindowedStream<T> timeSlidingWindow(long millis, long slide);\n\n /**\n * Create session windowed stream.\n *\n * @param <K> type of key\n * @param keyExtractor extractor of key\n * @param gapDuration duration of the gap between elements per key\n * @return session windowed stream\n */\n <K> WindowedStream<Pair<K, T>> sessionWindow(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n long gapDuration);\n\n /**\n * Create calendar-based windowed stream.\n *\n * @param window the resolution of the calendar window (\"days\", \"weeks\", \"months\", \"years\")\n * @param count number of days, weeks, months, years\n * @param timeZone time zone of the calculation\n * @return calendar windowed stream\n */\n WindowedStream<T> calendarWindow(String window, int count, TimeZone timeZone);\n\n /**\n * Group all elements into single window.\n *\n * @return globally windowed stream.\n */\n WindowedStream<T> windowAll();\n\n /**\n * Merge two streams together.\n *\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }\n\n /**\n * Merge two streams together.\n *\n * @param name name of the union operator\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(@Nullable String name, Stream<T> other) {\n return union(name, Arrays.asList(other));\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param streams other streams\n * @return merged stream\n */\n default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param name name of the union operator\n * @param streams other streams\n * @return merged stream\n */\n Stream<T> union(@Nullable String name, List<Stream<T>> streams);\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKeyUnsorted(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, true);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, false);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param sorted {@code true} if the input to the state update function should be time-sorted\n * @return the statefully reduced stream\n */\n <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate,\n boolean sorted);\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n default <K, V> Stream<Pair<K, V>> integratePerKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner) {\n\n return integratePerKey(null, keyExtractor, valueExtractor, initialValue, combiner);\n }\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param name optional name of the transform\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n <K, V> Stream<Pair<K, V>> integratePerKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner);\n\n /** Reshuffle the stream via random key. */\n default Stream<T> reshuffle() {\n return reshuffle(null);\n }\n\n /**\n * Reshuffle the stream via random key.\n *\n * @param name name of the transform\n */\n @SuppressWarnings(\"unchecked\")\n Stream<T> reshuffle(@Nullable String name);\n}", "public abstract Stream<E> streamBlockwise();", "public static <T> List<T> reduceToSingleList2(Stream<List<T>> stream) {\n Optional<List<T>> optionalList = stream.reduce((list1, list2) -> {\n List<T> newList = new ArrayList<T>(list1);\n newList.addAll(list2);\n return newList;\n });\n return optionalList.orElse(Collections.emptyList());\n }", "public Position executeOperations(List<Operation> operations){\n\n return operations.stream()\n .reduce(startingPosition, Rover.operations.andThen(validate),\n (currentPosition, nextPosition) -> nextPosition);\n }", "@Test\n public void testChainingReactions() throws Exception {\n FunctionalReactives.from(1, 2, 3, 4, 5)\n .filter(new Predicate<Integer>() {\n @Override\n public boolean apply(Integer input) {\n return input % 2 == 1; //filter out even integers\n }\n })\n .map(new Function<Integer, Optional<String>>() {\n @Override\n public Optional<String> apply(Integer input) {\n return Optional.of(input.toString()); //convert integer to String\n }\n })\n .reduce(new FunctionAcc<String, String>() {\n @Override\n public Optional<String> apply(String acc, String next) {\n return Optional.of(acc + \",\" + next); //join integers on \",\"\n }\n })\n .forEach(println()) //print out reaction results each in one line\n .start(); //on start() it will iterate through the array to fire the reactives\n\n //Reaction walk through:\n // Original source: 1 -> 2 -> 3 -> 4 -> 5 -> |\n // Filter events: 1 ------> 3 ------> 5 -> |\n // Map to String: \"1\" ----> \"3\" ----> \"5\"-> |\n // Join on \",\" by reduce: -----> \"1,3\" --> \"1,3,5\" -> |\n // Print out on each: ----> \"1,3\\n\" -> \"1,3,5\\n\" -> |\n }", "public static void main(String[] args) {\n\t\tStream<Integer> numStream = numbers.stream();\n\t\t\n\t\t// numStream.forEach(System.out::println); // here stream is closed\n\t\t// numStream.forEach(System.out::println); // this line with throw java.lang.IllegalStateException: stream has already been operated upon or closed\n\t\t\n\t\t// Flux has the similary concepts cannot use the same flux steam multiple times.\n\t\t// Flux<Integer> fluxStream = Flux.fromStream(numStream);\n\t\t\n//\t\tfluxStream.subscribe(\n//\t\t\t\tLamdaUtil.onNext(),\n//\t\t\t\tLamdaUtil.onError(),\n//\t\t\t\tLamdaUtil.onComplete()\n//\t\t\t\t);\n\t\t\n//\t\tfluxStream.subscribe(\n//\t\t\t\tLamdaUtil.onNext(),\n//\t\t\t\tLamdaUtil.onError(),\n//\t\t\t\tLamdaUtil.onComplete()\n//\t\t\t\t);// this line with throw ERROR :stream has already been operated upon or closed\n\t\t\n\t\t// to reuse the same data several times we need to use supplier with every time new stream\n\t\t\n\t\tFlux<Integer> numSupplierStream = Flux.fromStream(() -> numbers.stream());\n\t\tnumSupplierStream.subscribe(\n\t\t\t\tLamdaUtil.onNext(),\n\t\t\t\tLamdaUtil.onError(),\n\t\t\t\tLamdaUtil.onComplete()\n\t\t\t\t);\n\t\tnumSupplierStream.subscribe(\n\t\t\t\tLamdaUtil.onNext(),\n\t\t\t\tLamdaUtil.onError(),\n\t\t\t\tLamdaUtil.onComplete()\n\t\t\t\t);\n\t\t\n\t}", "private void usingPrimitiveStream() {\n IntStream.range(1, 4).forEach(System.out::println);\n DoubleStream.of(2.3, 4.3).forEach(System.out::println);\n LongStream.range(1, 4).forEach(System.out::println);\n }", "public void operator() {\n while (keepOperational) {\n Scanner scanner = new Scanner(System.in);\n\n System.out.print(\"\\nInput:\\n\");\n String input = scanner.nextLine();\n\n /** delegate the input - all for enabling unit testing */\n operate(input);\n }\n }", "default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }", "@Test\n public void collectAndReduce() {\n List<Book> collectedWithReduce = TestData.getBooks().stream()\n .reduce(new ArrayList<Book>(),\n (list, book) -> {\n // Separate list created to avoid mutating elements in the list\n // -> works also with parallel streams\n ArrayList<Book> result = new ArrayList<Book>(list);\n result.add(book);\n return result;\n }, (list1, list2) -> {\n ArrayList<Book> result = new ArrayList<Book>(list1);\n result.addAll(list2);\n return result;\n });\n assertEquals(4, collectedWithReduce.size());\n\n // Collect to list \"manually\" with collect\n // R collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator,\n // BiConsumer<R, R> combiner)\n List<Book> books = TestData.getBooks().stream()\n .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n assertEquals(4, books.size());\n\n // And the typical way using utilities from java.util.stream.Collectors\n assertEquals(4,\n TestData.getBooks().stream().collect(Collectors.toList()).size());\n }", "default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }", "public static Expression reduce(Expression expression) { throw Extensions.todo(); }", "Expr term() throws IOException {\n\t\tExpr e = unary();\n\t\twhile (look.tag == '*' || look.tag == '/') {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new Arith(tok, e, unary());\n\t\t}\n\t\treturn e;\n\t}", "@Override\n public void reduce() {\n if(null != getState())\n switch(getState()) {\n case OPERATOR:\n if (getDispenser().tokenIsOperator() && numOpNumOnStack())\n priorityReduce();\n break;\n case RIGHT_PAREN:\n if (getDispenser().tokenIsRightParen()) {\n if (!getStack().contains('('))\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n while ((char)getStack().get(getStack().size() - 2) != '(')\n reduceNumOpNum();\n double aNum = (double)getStack().pop();\n getStack().pop();\n getStack().push(aNum);\n }\n break;\n case END:\n if (getDispenser().tokenIsEOF()) {\n if(getStack().contains('('))\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n while(numOpNumOnStack())\n reduceNumOpNum();\n if(getStack().size() != 1)\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n }\n break;\n }\n }", "public StreamTerm term() {\n return term;\n }", "public final EObject ruleStreamStatement() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_0=null;\n Token otherlv_1=null;\n Token otherlv_2=null;\n Token otherlv_3=null;\n Token otherlv_6=null;\n EObject lv_operator_4_0 = null;\n\n EObject lv_expression_5_0 = null;\n\n\n enterRule(); \n \n try {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:341:28: ( ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* otherlv_3= '=' ( ( (lv_operator_4_0= ruleReturnTypeOperator ) ) | ( (lv_expression_5_0= ruleExpression ) ) ) otherlv_6= ';' ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:342:1: ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* otherlv_3= '=' ( ( (lv_operator_4_0= ruleReturnTypeOperator ) ) | ( (lv_expression_5_0= ruleExpression ) ) ) otherlv_6= ';' )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:342:1: ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* otherlv_3= '=' ( ( (lv_operator_4_0= ruleReturnTypeOperator ) ) | ( (lv_expression_5_0= ruleExpression ) ) ) otherlv_6= ';' )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:342:2: ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* otherlv_3= '=' ( ( (lv_operator_4_0= ruleReturnTypeOperator ) ) | ( (lv_expression_5_0= ruleExpression ) ) ) otherlv_6= ';'\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:342:2: ( (otherlv_0= RULE_ID ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:343:1: (otherlv_0= RULE_ID )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:343:1: (otherlv_0= RULE_ID )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:344:3: otherlv_0= RULE_ID\n {\n\n \t\t\tif (current==null) {\n \t current = createModelElement(grammarAccess.getStreamStatementRule());\n \t }\n \n otherlv_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleStreamStatement785); \n\n \t\tnewLeafNode(otherlv_0, grammarAccess.getStreamStatementAccess().getReturnStreamStreamDefinitionCrossReference_0_0()); \n \t\n\n }\n\n\n }\n\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:355:2: (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )*\n loop4:\n do {\n int alt4=2;\n int LA4_0 = input.LA(1);\n\n if ( (LA4_0==16) ) {\n alt4=1;\n }\n\n\n switch (alt4) {\n \tcase 1 :\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:355:4: otherlv_1= ',' ( (otherlv_2= RULE_ID ) )\n \t {\n \t otherlv_1=(Token)match(input,16,FOLLOW_16_in_ruleStreamStatement798); \n\n \t \tnewLeafNode(otherlv_1, grammarAccess.getStreamStatementAccess().getCommaKeyword_1_0());\n \t \n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:359:1: ( (otherlv_2= RULE_ID ) )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:360:1: (otherlv_2= RULE_ID )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:360:1: (otherlv_2= RULE_ID )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:361:3: otherlv_2= RULE_ID\n \t {\n\n \t \t\t\tif (current==null) {\n \t \t current = createModelElement(grammarAccess.getStreamStatementRule());\n \t \t }\n \t \n \t otherlv_2=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleStreamStatement818); \n\n \t \t\tnewLeafNode(otherlv_2, grammarAccess.getStreamStatementAccess().getReturnStreamStreamDefinitionCrossReference_1_1_0()); \n \t \t\n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop4;\n }\n } while (true);\n\n otherlv_3=(Token)match(input,17,FOLLOW_17_in_ruleStreamStatement832); \n\n \tnewLeafNode(otherlv_3, grammarAccess.getStreamStatementAccess().getEqualsSignKeyword_2());\n \n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:376:1: ( ( (lv_operator_4_0= ruleReturnTypeOperator ) ) | ( (lv_expression_5_0= ruleExpression ) ) )\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0==20||(LA5_0>=25 && LA5_0<=32)||LA5_0==35||LA5_0==47||(LA5_0>=51 && LA5_0<=53)) ) {\n alt5=1;\n }\n else if ( (LA5_0==RULE_ID||LA5_0==RULE_NUMBER||LA5_0==21) ) {\n alt5=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 5, 0, input);\n\n throw nvae;\n }\n switch (alt5) {\n case 1 :\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:376:2: ( (lv_operator_4_0= ruleReturnTypeOperator ) )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:376:2: ( (lv_operator_4_0= ruleReturnTypeOperator ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:377:1: (lv_operator_4_0= ruleReturnTypeOperator )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:377:1: (lv_operator_4_0= ruleReturnTypeOperator )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:378:3: lv_operator_4_0= ruleReturnTypeOperator\n {\n \n \t newCompositeNode(grammarAccess.getStreamStatementAccess().getOperatorReturnTypeOperatorParserRuleCall_3_0_0()); \n \t \n pushFollow(FOLLOW_ruleReturnTypeOperator_in_ruleStreamStatement854);\n lv_operator_4_0=ruleReturnTypeOperator();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getStreamStatementRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"operator\",\n \t\tlv_operator_4_0, \n \t\t\"ReturnTypeOperator\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n\n }\n break;\n case 2 :\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:395:6: ( (lv_expression_5_0= ruleExpression ) )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:395:6: ( (lv_expression_5_0= ruleExpression ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:396:1: (lv_expression_5_0= ruleExpression )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:396:1: (lv_expression_5_0= ruleExpression )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:397:3: lv_expression_5_0= ruleExpression\n {\n \n \t newCompositeNode(grammarAccess.getStreamStatementAccess().getExpressionExpressionParserRuleCall_3_1_0()); \n \t \n pushFollow(FOLLOW_ruleExpression_in_ruleStreamStatement881);\n lv_expression_5_0=ruleExpression();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getStreamStatementRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"expression\",\n \t\tlv_expression_5_0, \n \t\t\"Expression\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n otherlv_6=(Token)match(input,18,FOLLOW_18_in_ruleStreamStatement894); \n\n \tnewLeafNode(otherlv_6, grammarAccess.getStreamStatementAccess().getSemicolonKeyword_4());\n \n\n }\n\n\n }\n\n leaveRule(); \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public <O extends FighterOperation> O apply(O operation);", "@Override\n public void visitTerminal(TerminalNode node) {\n\n }", "@Override\n public void visitTerminal(final TerminalNode node) {\n }", "public void testConsumer ()\n {\n\n List<String> list = new ArrayList<>();\n list.add(\"ccc\");\n list.add(\"bbb\");\n list.add(\"ddd\");\n list.add(\"DDDD\");\n list.add(\"ccc\");\n list.add(\"aaa\");\n list.add(\"eee\");\n\n// Collections.sort(list);\n// Collections.sort(list, (s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.sort((s, s2) -> s.compareTo(s2));\n// list.sort((s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.forEach(s -> System.out.println(s));\n// list.forEach(s -> System.out.println(s));\n\n\n// Predicate<String> predicate2 = s -> s.length()>3;\n// System.out.println(\"predicate2.test(\\\"DDDD\\\") = \" + predicate2.test(\"DDDD\"));\n\n// Stream<String> stringStream = list.stream();\n// stringStream.forEach(s -> System.out.println(s));\n// stringStream.forEach(s -> System.out.println(s));//会报错\n\n// list.stream().forEach(s -> System.out.println(s));\n// list.stream().forEach(s -> System.out.println(s));\n\n //并行流是无序的\n// list.parallelStream().forEach(s -> System.out.println(s));\n// list.parallelStream().forEach(s -> System.out.println(s));\n\n// list.stream().skip(3).forEach(s -> System.out.println(s));\n// list.stream().distinct().forEach(s -> System.out.println(s));\n// System.out.println(\"list.stream().count() = \" + list.stream().count());\n// list.stream().limit(2).forEach(s -> System.out.println(s));\n\n// list.stream().filter(s -> s.length()<4).forEach(s -> System.out.println(s));\n\n// BiFunction<Integer, String, Person> bf = Person::new;\n// BiFunction<Integer, String, Person> bf = (n, s) -> new Person(s);\n\n// Person aaa = bf.apply();\n\n// System.out.println(\"aaa = \" + bf.apply(0, \"aaa\"));\n \n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tSystem.out.println(\"-------1. Stream filter() example---------\");\r\n\t\t//We can use filter() method to test stream elements for a condition and generate filtered list.\r\n\t\t\r\n\t\tList<Integer> myList = new ArrayList<>();\r\n\t\tfor(int i=0; i<100; i++) myList.add(i);\r\n\t\tStream<Integer> sequentialStream = myList.stream();\r\n\r\n\t\tStream<Integer> highNums = sequentialStream.filter(p -> p > 90); //filter numbers greater than 90\r\n\t\tSystem.out.print(\"High Nums greater than 90=\");\r\n\t\thighNums.forEach(p -> System.out.print(p+\" \"));\r\n\t\t//prints \"High Nums greater than 90=91 92 93 94 95 96 97 98 99 \"\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"-------2. Stream map() example---------\");\r\n\t\t//We can use map() to apply functions to an stream\r\n\t\tStream<String> names = Stream.of(\"aBc\", \"d\", \"ef\");\r\n\t\tSystem.out.println(names.map(s -> {\r\n\t\t\t\treturn s.toUpperCase();\r\n\t\t\t}).collect(Collectors.toList()));\r\n\t\t//prints [ABC, D, EF]\r\n\t\t\r\n\t\tSystem.out.println(\"-------3. Stream sorted() example---------\");\r\n\t\t//We can use sorted() to sort the stream elements by passing Comparator argument.\r\n\t\tStream<String> names2 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> reverseSorted = names2.sorted(Comparator.reverseOrder()).collect(Collectors.toList());\r\n\t\tSystem.out.println(reverseSorted); // [ef, d, aBc, 123456]\r\n\r\n\t\tStream<String> names3 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> naturalSorted = names3.sorted().collect(Collectors.toList());\r\n\t\tSystem.out.println(naturalSorted); //[123456, aBc, d, ef]\r\n\t\t\r\n\t\tSystem.out.println(\"-------4. Stream flatMap() example---------\");\r\n\t\t//We can use flatMap() to create a stream from the stream of list.\r\n\t\tStream<List<String>> namesOriginalList = Stream.of(\r\n\t\t\t\tArrays.asList(\"Pankaj\"), \r\n\t\t\t\tArrays.asList(\"David\", \"Lisa\"),\r\n\t\t\t\tArrays.asList(\"Amit\"));\r\n\t\t\t//flat the stream from List<String> to String stream\r\n\t\t\tStream<String> flatStream = namesOriginalList\r\n\t\t\t\t.flatMap(strList -> strList.stream());\r\n\r\n\t\t\tflatStream.forEach(System.out::println);\r\n\r\n\t}", "Operations operations();", "static <T> Stream<T> stream(Optional<T> opt) {\n return opt.map(Stream::of).orElseGet(Stream::empty);\n }", "Unary operator(Operator o);", "public static void main(String[] args) {\r\n\t\tStream strings = Stream.of(\"A\", \"good\", \"day\", \"to\", \"write\", \"some\", \"Java\");\r\n//\t\tOptional<String> optionalS = (Optional<String>) strings.reduce(\"\", (x, y) -> x+\" \"+y).\r\n\r\n\t\tOptional<String> optional = strings.reduce((o, o2) -> o +\" \"+o2);\r\n\t\tif(optional.isPresent())\r\n\t\t\tSystem.out.println(optional.get());\r\n\r\n\t\t\r\n\t}", "Stream<Line> stream(Consumer<JSaParException> errorConsumer) throws IOException;", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Create Stream of Object\\n\");\n\t\tStream<String> stream= Stream.of(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t stream.forEach(System.out::println);\n\t \n // Create Stream from Objects from Collection\n\t\tSystem.out.println(\" \\n\\nCreate Stream Object from collection\\n\");\n\t Collection<String> collection=Arrays.asList(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t Stream<String> stream2=collection.stream();\n\t stream2.forEach(System.out::println);\n\t \n\t //Create Stream Object from Collection\n\t System.out.println(\"\\n\\nCreate Stream Object from List\");\n\t List<String> list= Arrays.asList(\"Modou\",\"Fatou\",\"Saliou\",\"Samba\");\n\t Stream<String> stream3=list.stream();\n\t stream3.forEach(System.out::println);\n\t \n\t //Create Stream Object from Set\n\t System.out.println(\"\\n Create Stream from Set\");\n\t Set<String> set= new HashSet<>(list);\n\t Stream<String> stream4= set.stream();\n\t stream4.forEach(System.out::println);\n\t \n\t //Create Stream Object from Arrays\n\t System.out.println(\"\\nCreate Stream Object from Arrays\");\n\t ArrayList<String> array= new ArrayList<>(list);\n\t Stream<String> stream5= array.stream();\n\t stream5.forEach(System.out::println);\n\t \n\t //Create Stream from Array of String\n\t System.out.println(\"\\n Create Stream from Array of String\");\n\t String[] strArray= {\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\"};\n\t Stream<String> stream6=Arrays.stream(strArray);\n\t stream6.forEach(System.out::println);\n\t \n\t \n\t}", "public static void main(String...args){\n\t\tIntStream.rangeClosed(2, 5).forEach(x -> System.out.println(x));\n\t\tSystem.out.println(IntStream.rangeClosed(2, 5).forEach(x -> System.out.println(x)));\n\t}", "public static void main(String[] args) {\n Consumer<Integer> consumer = x ->{\n System.out.println(\"Number is :\"+x);\n };\n consumer.accept(55);\n //Supplier\n Supplier<String> str = () -> \"Implementation of Supplier \";\n System.out.println(str.get());\n //Predicate\n int a=37;\n Predicate<Integer> isOddPredicate = x -> x%2 != 0;\n System.out.println(\"Is \"+a+\" Odd Number :\"+isOddPredicate.test(a));\n //Function\n int b=7;\n Function<Integer,Integer> squareFunction = x -> x*x;\n System.out.println(\"Square of \"+b+\" is \"+squareFunction.apply(b));\n\n //Example\n List<Integer> list = List.of(12,9,13,4,6,2,4);\n Consumer<Integer> con = System.out::println;\n System.out.println(\"Example(Square of odd no.) : \");\n list.stream()\n .filter(isOddPredicate)\n .map(squareFunction)\n .forEach(con);\n\n\n\n }", "@Test\n public void intermediateOperations() {\n Stream<Book> books = TestData.getBooks().stream();\n // filter\n Stream<Book> booksWithMultipleAuthors = books.filter(book -> book.hasMultipleAuthors());\n // map\n Stream<String> namesStream = booksWithMultipleAuthors.map(book -> book.getName());\n \n Set<String> expected = \n Sets.newHashSet(\"Design Patterns: Elements of Reusable Object-Oriented Software\",\n \"Structure and Interpretation of Computer Programs\");\n assertEquals(expected, namesStream.collect(Collectors.toSet()));\n }", "public void performLambdaOperations(){\n functionalInterfaceLambdaService.printFunctionalInterfaceWithAndWithoutLambda();\n runnableLambdaService.printRunnableInterfaceWithAndWithoutLambda();\n comparatorLambdaService.printComparatorInterfaceWithAndWithoutLambda();\n }", "@Override\n public BinaryOperator<List<Integer>> combiner() {\n return (resultList1, resultList2) -> {\n Integer currentTotal1 = resultList1.get(0);\n Integer currentTotal2 = resultList2.get(0);\n currentTotal1 += currentTotal2;\n resultList1.set(0, currentTotal1);\n return resultList1;\n };\n }", "public void printItemsUsingLambdaCollectorsJDK8(List<Item> items){\n\t\tIO.print(\"\\nPrint average of all items price using JDK8 stream, method reference, collector!\");\r\n\t\t// average requires total sum and no of items as well.\r\n\t\t// collect returns ONLY one value throughout the stream. So we need some kind of placer where we will keep storing sum, count during stream.\r\n\t\tAverager avg = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t// alternate of item -> item.getPrice()\r\n\t\t\t.collect(Averager::new, Averager::accept, Averager::mergeIntermediateAverage); \r\n\t\t\t//accept takes one double value from stream and call merge.. method, which combines previous averger`s sum, count.\r\n\t\t\t// All Averager`s methods have no return type except for average which is not used in stream processing.\r\n\t\tIO.print(\"Average of price: \" + String.format(\"%.4f\", avg.average()));\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of items price using JDK8 stream, collector, suming!\");\r\n\t\tdouble total = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.summingDouble(Item::getPrice)); // no need for map as well.\r\n\t\tIO.print(\"Total price: \" + String.format(\"%.4f\", total)); // same result\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector toList!\");\r\n\t\tList<Double> prices = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t// alternate of item -> item.getPrice()\r\n\t\t\t.collect(Collectors.toList()); \r\n\t\t\t// collects stream of elements i.e. price, and creates a List of price.\r\n\t\tIO.print(\"List of prices: \" + prices); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector toCollection!\");\r\n\t\tprices = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t.collect(Collectors.toCollection(ArrayList::new)); // same as toList: Here, we can get prices in any list form; TreeSet, HashSet, ArrayList.\r\n\t\tIO.print(\"List of prices: \" + prices);\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector joining!\");\r\n\t\tString priceString = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice)\r\n\t\t\t.map(Object::toString) //basically, double.toString() as upper map converts stream of Item into stream of Double\r\n\t\t\t.collect(Collectors.joining(\", \")); // same as toList.\r\n\t\tIO.print(\"List of prices: [\" + priceString + \"]\"); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, List<Item>> byType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType));\r\n\t\tIO.print(\"Items by Type: \" + byType ); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, Double> sumByType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType, Collectors.summingDouble(Item::getPrice)));\r\n\t\tIO.print(\"Total prices by Type: \" + sumByType); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, Optional<Item>> largetstByType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType, Collectors.maxBy(Comparator.comparing(Item::getPrice) )));\r\n\t\tIO.print(\"Total prices by Type: \" + largetstByType); \r\n\t}", "public void typeInference() {\n\t\tMathOperation addition = (a, b) -> a + b;\n\t\t// Data Type of a, b can be referred from MathOperation functional interface\n\t\tSystem.out.println(\"10 + 5 = \" + addition.operation(10, 5));\n\t}", "Stream<ActionDefinition> actions();", "public static void main(String args[]) \n {\n Consumer<List<Integer> > modify = list -> \n { \n for (int i = 0; i < list.size(); i++) \n list.set(i, 5 * list.get(i));\n };\n \n Consumer<List<Integer> > square = list ->\n { \n for (int i = 0; i < list.size(); i++)\n \tlist\n .set(i,(int) Math.pow(list.get(i), 2));\n };\n \n // Consumer to display a list of integers \n Consumer<List<Integer> > \n dispList = list ->\n list.stream().\n forEach(a -> System.out.print(a + \" \"));\n \n List<Integer> list = new ArrayList<Integer>(); \n list.add(2); \n list.add(1); \n list.add(3); \n \n // using addThen() \n modify\n .andThen(square)\n .andThen(dispList)\n .accept(list);\n }", "public static void main(String[] args) {\n System.out.println(\"Chapter 3 - 3.3. Reduction Operations Using Reduce\");\n\n\n System.out.println();\n // *** Reduction Operations on IntStream ***\n reductionOperationsOnIntStream();\n\n System.out.println();\n // *** Summing Numbers Using reduce() ***\n summingNumbersUsingReduce();\n\n System.out.println();\n // *** Perform reduce with a BinaryOperator ***\n performReduceWithABinaryOperator();\n\n System.out.println();\n // *** Using a Collector ***\n usingACollector();\n\n System.out.println();\n // *** Accumulating Books into a Map ***\n new Recipe_3_3_Reduction_Operations_Using_Reduce().accumulatingBooksIntoAMap();\n }", "public static void main(String[] args) {\n\t\n\t\tm(\"Iterate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.iterate(2, i -> 2 * i),\n\t\t\t\t() -> IntStream.iterate(10, i -> i - 1),\n\t\t\t\t() -> IntStream.iterate(10, i -> i),\n\t\t\t\t() -> IntStream.iterate(10, i -> 2),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity()),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity().andThen(IntUnaryOperator.identity())),\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> supplier.get().limit(10).forEach(System.out::println));\n\t\t});\n\t\t\n\t\t\n\t\t//Various IntStream generations. generate produces elements without input => it uses an IntSupplier.\n\t\t\n\t\tSystem.out.println(\"---------------------------------------------\");\n\t\t\n\t\tm(\"Generate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()).filter(n -> n >= 0),\n\t\t\t\t() -> IntStream.generate(() -> 10),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt() % 20).filter(n -> n >= 0)\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> {supplier.get().limit(10).forEach(System.out::println); System.out.println(\"--------------------------------\");});\n\t\t});\n\t\t\n\t\t\n\t\t//Iterate and generate for DoubleStream, LongStream and Stream<T>\n\t\t\n\t\t\n\t\tm(\"DoubleStream iterate and generate\", () -> {\t\t\n\t\t\tDoubleStream.iterate(1, d -> d + d / 2).limit(20).forEach(System.out::println); //Uses DoubleUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextDouble()).limit(5).forEach(System.out::println); //Uses DoubleSupplier\n\t\t});\n\t\t\n\t\tm(\"LongStream iterate and generate\", () -> {\t\t\n\t\t\tLongStream.iterate(2, n -> n * n).limit(4).forEach(System.out::println); //Uses LongUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextLong()).limit(5).forEach(System.out::println); //Uses LongSupplier\n\t\t});\n\t\t\n\t\tm(\"Stream iterate and generate\", () -> {\t\t\n\t\t\tStream.<List<Object>>iterate(new ArrayList<Object>(), l -> {l.add(1); return l;}).limit(4).forEach(System.out::println); //Uses UnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tStream.<List<Object>>generate(() -> new ArrayList<Object>()).limit(4).forEach(System.out::println); //Uses Supplier\n\t\t});\n\t\t\n\t\tm(\"noneMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 3;\n\t\t\tSystem.out.println(stream.noneMatch(predicate)); //Note: this is not infinite. None match will fail as soon as one element is found\n\t\t});\n\t\t\n\t\tm(\"allMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 0;\n\t\t\tPredicate<String> predicate2 = s -> s.length() > 3;\n\t\t\t//System.out.println(stream.allMatch(predicate)); //Note: This is infinite and will fail with OOM error\n\t\t\tSystem.out.println(stream.allMatch(predicate2)); //Note how this will return as the first element does not match so false can be returned\n\t\t});\n\t\t\n\t}", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "public static <T> List<T> reduceToSingleList3(Stream<List<T>> stream) {\n List<T> list = stream.reduce(new ArrayList<T>(), (list1, list2) -> {\n list1.addAll(list2);\n return list1;\n });\n return list;\n }", "@Test\r\n void limitMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().limit(2);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", 2, afterStreamList.size());\r\n }", "@Override\n\tpublic void VisitUnaryNode(UnaryOperatorNode Node) {\n\n\t}", "default <V> Parser<S,T,U> reduce(Parser<S,T,Function<U,U>> p) {\n return s-> {\n return reduce(s, parse(s), p);\n };\n }", "public void reduce( T mrt ) { }", "public void reduce( T mrt ) { }", "public static void main(String[] args) {\n\t\tStream<Integer> stream = Stream.of(1, 2, 3, 4, 5, 6);\n\t\tstream.forEach(System.out::print);\n\t\t//:: is called method refrence \n\t\tStream<Integer> stream1 = Stream.of(new Integer[]{1,2,3,4});\n\t\tstream1.forEach(System.out::println);\n\t\t\n\t\tStream<String> names2 = Stream.of(\"D\", \"A\", \"Z\", \"R\");\n names2.sorted(Comparator.naturalOrder()).forEach(System.out::println);\n\t\t \n \n\t}", "public static void main(String[] args) {\n Stream<String> streamOfArray = Stream.of(\"A\", \"B\", \"C\");\r\n streamOfArray.forEach(System.out::println);\r\n System.out.println(\"------\");\r\n \r\n // CREATING STREAM FROM EXISTING ARRAY :\r\n String[] arr = new String[] { \"A\", \"B\", \"C\" };\r\n Stream<String> streamOfArrayFull = Arrays.stream(arr);\r\n streamOfArrayFull.forEach(System.out::println);\r\n \r\n System.out.println(\"-----\");\r\n // CREATING STREAM FROM A PART OF AN ARRAY :\r\n Stream<String> streamOfArrayPart = Arrays.stream(arr, 1, 2);\r\n streamOfArrayPart.forEach(System.out::println);\r\n\t}", "@Test\r\n\tvoid mapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\tStream<Integer> streamInteger = transactionBeanStream.peek(System.out::println).map(TransactionBean::getId);\r\n\t\tList<Integer> afterStreamList = streamInteger.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong value\", 1, afterStreamList.get(0).intValue());\r\n\t\tassertSame(\"wrong value\", 2, afterStreamList.get(1).intValue());\r\n\t\tassertSame(\"wrong value\", 3, afterStreamList.get(2).intValue());\r\n\t}", "default Stream<T> fullStream() {\n return Stream.empty();\n }", "@Override\n protected void executeCommands(ITextTokenStream<BasicTextTokenType> stream) {\n TextToken<BasicTextTokenType> object = stream.getFirstObject();\n String token = object == null ? null : object.getStandardToken();\n if (token != null) {\n if (stream.getVerb() != null){\n switch (stream.getVerb().getType()) {\n case ATTACK:\n attackMob(token, object);\n break;\n case LOOK:\n lookAt(token, object);\n break;\n case MOVE:\n movePlayer(token, object);\n break;\n case GET:\n getItemFromRoom(token, object);\n break;\n case LOOT:\n lootAll(token, object);\n break;\n case DROP:\n dropItem(token, object);\n break;\n case EQUIP: // effect replaced with LOCK\n lock(token, object);\n //equipItem(token, object);\n break;\n case UNEQUIP: // effect replaced with UNLOCK\n unlock(token, object);\n //unequipItem(token, object);\n break;\n case INFO:\n info(token, object);\n break;\n case QUIT:\n quitGame();\n break;\n default:\n return;\n }\n }\n // For objects that can also be used to infer their verbs\n else {\n switch (object.getType()) {\n case DIRECTION:\n movePlayer(token, object);\n break;\n case INVENTORY:\n info(token, object);\n break;\n case HEALTH:\n info(token, object);\n break;\n default:\n return;\n }\n }\n\n } else {\n return;\n }\n\n }", "@Test\r\n void filterMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(1).getType());\r\n }", "@Test\n public void test1() {\n final Car car = Car.create(Car::new);\n final List<Car> cars = Collections.singletonList(car);\n final Car police = Car.create(Car::new);\n cars.forEach(police::follow);\n cars.forEach(c -> police.follow(c)); // 等价于写成lambda表达式的形式\n }", "public T caseTerminal(Terminal object) {\n\t\treturn null;\n\t}", "public LatentImage transform(UnaryOperator<Color> op) {\n\t\tpendingOperations.add((x, y, c) -> op.apply(c));\n\t\treturn this;\n\t}", "private NFA term() {\n NFA startFactor = new NFA();\n while (more() && peek() != ')' && peek() != '|') {\n NFA newFactor = factor();\n //If a term is just an empty sequence of factors\n if (startFactor.getStates().isEmpty()) {\n startFactor = newFactor;\n } else {//concatentae the term if there are multple factor\n startFactor = combine(startFactor, newFactor);\n }\n }\n return startFactor;\n }", "Astro term(Astro functor, AstroArg args);", "private Expr unary() {\n if(match(BANG, MINUS)) { // If this thing can be accurately considered a unary...\n Token operator = previous();\n Expr right = unary();\n return new Expr.Unary(operator, right);\n }\n\n return call(); // Otherwise, pass it up the chain of precedence\n }", "public static void main(String[] args) {\n List<Integer> lst = List.of(1, 2, 3, 4, 5);\n Stream<Integer> stream = lst.stream();\n\n Flux<Integer> integerFlux = Flux.fromStream(lst::stream);\n\n integerFlux.subscribe(\n ConsumerUtil.onNext(),\n ConsumerUtil.onError(),\n ConsumerUtil.onComplete()\n );\n\n integerFlux.subscribe(\n ConsumerUtil.onNext(),\n ConsumerUtil.onError(),\n ConsumerUtil.onComplete()\n );\n }", "public static void main(String []args) {\n\t\tList<String> numbers = Arrays.asList(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\",\"7\",\"8\",\"9\");\r\n\t\t//Generate numbers from 1 to 9\r\n\t\tSystem.out.println(IntStream.range(1,10).mapToObj(String::valueOf).collect(Collectors.toList()));\r\n//\t\tSystem.out.println(\"Original list \" + numbers);\r\n\t\t\r\n\t\tList<Integer> even = numbers.stream()\r\n\t\t\t\t//gets the integer value from the string\r\n//\t\t\t\t.map(s ->Integer.valueOf(s))\r\n\t\t\t\t.map(Integer::valueOf) // Another way to do the top line(line 18)\r\n\t\t\t\t//checking if it is even\r\n\t\t\t\t.filter(number -> number % 2 ==1)// Odd numbers\r\n//\t\t\t\t.filter(number -> number % 2 ==0)// Even numbers\r\n\t\t\t\t//Collects results in to list call even.\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\tSystem.out.println(even);\r\n\r\n\t\tList<String> strings = Arrays.asList(\"abc\", \"\", \"bc\", \"efg\", \"abcd\", \"\", \"jkl\", \"\", \"\");\r\n\t\tSystem.out.println(strings);\r\n\t\t\r\n\t\tList<String> filtered = strings.stream()\r\n\t\t\t\t// checking each item and we check it is empty\r\n\t\t\t\t.filter(s-> !s.isEmpty())\r\n//\t\t\t\t.filter(s-> s.isEmpty())\r\n\t\t\t\t// add the remaining element to the list\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\tSystem.out.println(filtered);\r\n\t\t\r\n\t\t// Known as a method reference \r\n//\t\tforEach(System.out::println)\r\n\t\t \r\n\t}", "protected void operation(String op) {\n \tint value;\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tint second = stack.pop();\n \t // handles when only one value in stack\n \t\tif (stack.empty()) {\n \t\t\tif (op.equals(\"+\")) {\n \t\t\t\tstack.push(second);\n \t\t\t}\n \t\t\telse if (op.equals(\"-\")) {\n \t\t\t\tcurrent = second *-1;\n \t\t\t\tstack.push(current);\n \t\t\t\tshow(stack.peek());\n \t\t\t\tcurrent = 0;\n \t\t\t}\n \t\t\telse if (op.equals(\"*\")) {\n \t\t\t\tstack.push(0);\n \t\t\t\tshow(stack.peek());\n \t\t\t}\n \t\t\telse {\n \t\t\t\tstack.push(0);\n \t\t\t\tshow(stack.peek());\n \t\t\t}\n \t\t}\n \t // handles the other cases\n \t\telse {\n \t\t\tif (op.equals(\"+\")) {\n \t\t\t\tvalue = second + stack.pop();\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse if (op.equals(\"-\")) {\n \t\t\t\tvalue = stack.pop() - second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse if (op.equals(\"*\")) {\n \t\t\t\tvalue = stack.pop() * second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tvalue = stack.pop() / second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t}\n \t}\n }", "@Override\n public BinaryOperator<TradeAccumulator> combiner() {\n return (accum1, accum2) -> {return accum1.addAll(accum2);};\n }", "public void rc(){\n List<Integer> numbers = new ArrayList<>();\n var result = List.of(1,2,3,4,5,6,7,8,9,10);\n result\n .parallelStream()\n .forEach(number->addToList(numbers,number));\n print.accept(numbers);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static <CollectedFact> Stream<CollectedFact> addToStream(\n\t\t\tStream<CollectedFact> stream, Stream<CollectedFact> stream2) {\n\t\tList<CollectedFact> result = stream.collect(Collectors.toList()); // error\n\t\tresult.addAll(stream2.collect(Collectors.toList()));\n//\t\tresult.forEach(System.out::println);\n\t\t\n\t\t\n\t\t//code to save to an Output File\n\t\t List<String> strList = result.stream().distinct().map(Object::toString)\n\t\t\t\t.collect(Collectors.toList());\n\n\t\ttry {\n\t\t\tFiles.write(Paths.get(outputFileName),\n\t\t\t\t\t(Iterable<String>) strList.stream()::iterator);\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\treturn result.stream();\n\t}", "public void optional() {\n\n // .stream\n Stream<Optional<Employee>> emp = getEmployeeStream(\"Some employee ID\");\n Stream<Employee> empStream = emp.flatMap(Optional::stream);\n\n // .or\n Optional<Employee> or = getEmployee(\"123\").or(() -> Optional.of(new Employee(\"123\")));\n\n // .ifPresentOrElse\n or.ifPresentOrElse(employee -> {\n System.out.println(\"Present\");\n }, () -> {\n System.out.println(\"Else\");\n });\n\n }", "public static void findFirstMultipleOfSixViaStreams(List<Integer> numbers){\n\n int abc = 9;\n numbers.stream().filter(x -> {\n System.out.println(\"x = \" + x);\n return x % 6 == 0;\n }).map(x -> x + abc).findFirst();\n// Optional<Integer> firstSixMultiple = numbers.stream()\n// .filter(x -> {\n// System.out.println(\"x = \" + x);\n// return x % 6 == 0;\n// })\n// .findFirst();\n\n// int ans = firstSixMultiple.orElse(-1);\n\n// System.out.println(ans);\n }", "public Action determineActionForTerminalOrEof(GrammarInfo grammarInfo, StateMachineBuildingCache cache, String terminalOrEof) {\n\n\t\t// determine which elements want to shift that terminal, and which want to reduce when seeing that terminal\n\t\tSet<StateElement> elementsThatWantToShift = new HashSet<>();\n\t\tSet<StateElement> elementsThatWantToReduce = new HashSet<>();\n\t\telementLoop:\n\t\tfor (StateElement element : elements) {\n\t\t\tStateElement.ActionType actionType = element.determineActionTypeForTerminal(terminalOrEof);\n\t\t\tswitch (actionType) {\n\n\t\t\t\tcase DROP_ELEMENT:\n\t\t\t\t\tcontinue elementLoop;\n\n\t\t\t\tcase SHIFT:\n\t\t\t\t\telementsThatWantToShift.add(element);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase REDUCE:\n\t\t\t\t\telementsThatWantToReduce.add(element);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new RuntimeException();\n\n\t\t\t}\n\t\t}\n\n\t\t// handle cases without reducible elements (shift or error)\n\t\tif (elementsThatWantToReduce.isEmpty()) {\n\t\t\tif (elementsThatWantToShift.isEmpty()) {\n\t\t\t\treturn getError();\n\t\t\t} else {\n\t\t\t\treturn getShift(grammarInfo, cache, elementsThatWantToShift);\n\t\t\t}\n\t\t}\n\n\t\t// handle cases without shifting elements (reduce single element; R/R conflict if multiple elements)\n\t\tif (elementsThatWantToShift.isEmpty()) {\n\t\t\tif (elementsThatWantToReduce.size() > 1) {\n\t\t\t\tthrow new StateMachineException.ReduceReduceConflict(this, terminalOrEof, ImmutableSet.copyOf(elementsThatWantToReduce));\n\t\t\t} else {\n\t\t\t\treturn getReduce(elementsThatWantToReduce.iterator().next());\n\t\t\t}\n\t\t}\n\n\t\t// Now we have at least one reducible element (but possibly more than one), and we could also shift. That means\n\t\t// we now have a shift-reduce conflict, and if there is more than one reducible element then we also have a\n\t\t// reduce-reduce conflict.\n\t\t//\n\t\t// S/R conflicts can be handled by precedence and resolve blocks, if present. R/R conflicts in general cannot\n\t\t// be solved by those since they lack the expressive power to make sufficiently clear which of the alternatives\n\t\t// should be reduced unter which circumstances.\n\t\t//\n\t\t// However, there is one special case of R/R conflict that can still be resolved IF there is also an S/R\n\t\t// conflict, as is the case here -- observe that R/R conflicts without a simultaneous S/R conflict would have\n\t\t// thrown an exception above already. If we have multiple reducible elements, and if conflict resolution\n\t\t// determines to allow other elements to shift the terminal for all of them, the conflict disappears and we can\n\t\t// shift. This logic can never result in reducing though.\n\t\t//\n\t\t// Note that the elementsThatWantToReduce are equivalent to the alternatives that want to reduce, since all\n\t\t// of them are \"at the end\" and have the terminalOrEof as their follow terminal, so they can only differ\n\t\t// in the alternative to reduce.\n\n\t\t// handle the case of a single reducible element (no R/R conflict), i.e. a possibly resolvable S/R conflict\n\t\tif (elementsThatWantToReduce.size() == 1) {\n\t\t\tStateElement elementThatWantsToReduce = elementsThatWantToReduce.iterator().next();\n\t\t\tConflictResolution resolution = resolveConflict(grammarInfo, elementThatWantsToReduce.getAlternative().getAttributes(), terminalOrEof);\n\t\t\tif (resolution == null) {\n\t\t\t\tthrow new StateMachineException.ShiftReduceConflict(this, terminalOrEof,\n\t\t\t\t\tImmutableSet.copyOf(elementsThatWantToShift), ImmutableSet.copyOf(elementsThatWantToReduce));\n\t\t\t}\n\t\t\tswitch (resolution) {\n\n\t\t\t\tcase SHIFT:\n\t\t\t\t\treturn getShift(grammarInfo, cache, elementsThatWantToShift);\n\n\t\t\t\tcase REDUCE:\n\t\t\t\t\treturn getReduce(elementThatWantsToReduce);\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new RuntimeException(\"unknown conflict resolution: \" + resolution);\n\n\t\t\t}\n\t\t}\n\n\t\t// Now we have multiple reducible elements (R/R conflict). Check which kinds of conflict resolution the elements allow.\n\t\tSet<StateElement> reducibleElementsWithShiftResolution = new HashSet<>();\n\t\tSet<StateElement> reducibleElementsWithReduceResolution = new HashSet<>();\n\t\tSet<StateElement> reducibleElementsWithoutResolution = new HashSet<>();\n\t\tfor (StateElement elementThatWantsToReduce : elementsThatWantToReduce) {\n\t\t\tConflictResolution resolution = resolveConflict(grammarInfo, elementThatWantsToReduce.getAlternative().getAttributes(), terminalOrEof);\n\t\t\tif (resolution == null) {\n\t\t\t\treducibleElementsWithoutResolution.add(elementThatWantsToReduce);\n\t\t\t} else if (resolution == ConflictResolution.SHIFT) {\n\t\t\t\treducibleElementsWithShiftResolution.add(elementThatWantsToReduce);\n\t\t\t} else if (resolution == ConflictResolution.REDUCE) {\n\t\t\t\treducibleElementsWithReduceResolution.add(elementThatWantsToReduce);\n\t\t\t}\n\t\t}\n\n\t\t// If all reducible elements agree to shift, then the R/R conflict disappears.\n\t\tif (reducibleElementsWithoutResolution.isEmpty() && reducibleElementsWithReduceResolution.isEmpty()) {\n\t\t\treturn getShift(grammarInfo, cache, elementsThatWantToShift);\n\t\t}\n\n\t\t// At this point we have an unresolvable R/R conflict. We now check for reducible elements that disagree in\n\t\t// their conflict resolution because then we want to show a more descriptive error message to the user.\n\t\tif (!reducibleElementsWithShiftResolution.isEmpty() && !reducibleElementsWithReduceResolution.isEmpty()) {\n\t\t\tthrow new StateMachineException.ConflictResolutionDisagreement(this, terminalOrEof,\n\t\t\t\tImmutableSet.copyOf(elementsThatWantToShift),\n\t\t\t\tImmutableSet.copyOf(reducibleElementsWithShiftResolution),\n\t\t\t\tImmutableSet.copyOf(reducibleElementsWithReduceResolution)\n\t\t\t);\n\t\t}\n\n\t\t// No conflict resolution disagreement, so we have a normal R/R conflict.\n\t\tthrow new StateMachineException.ReduceReduceConflict(this, terminalOrEof, ImmutableSet.copyOf(elementsThatWantToReduce));\n\n\t}", "public Object reduce( Set<Action> requiredActions, final ReduceFn fn,\n\t\t\tfinal Object initial ) throws AccessDeniedException,\n\t\t\tEmptyListException, ListIndexException, InvalidListException;", "public static void main(String[] args) {\n\t\tConsumer<List<Integer>> modify = list -> {\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tlist.set(i, 2 * list.get(i));\n\t\t};\n\n\t\t// Consumer to display a list of integers\n\t\tConsumer<List<Integer>> dispList = list -> list.stream().forEach(a -> System.out.print(a + \" \"));\n\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(1);\n\t\tlist.add(3);\n\n\t\t// using addThen()\n\t\tmodify.andThen(dispList).accept(list);\n\n\t\t// demonstrate when NullPointerException is returned.\n\t\ttry {\n\t\t\t// using addThen()\n\t\t\tmodify.andThen(null).accept(list);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exception: \" + e);\n\t\t}\n\n\t\t// demonstrate how an Exception in the after function is returned and handled.\n\t\t// using addThen()\n\t\ttry {\n\t\t\tdispList.andThen(modify).accept(list);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Exception: \" + e);\n\t\t}\n\t}", "protected String traverseStream(InputStream stream){\n\n\t\tScanner input = new Scanner(stream);\n\t\tString res = \"\";\n\n\t\twhile(input.hasNext()){\n\t\t\tres += input.next() + \" \";\n\t\t}\n\n\t\treturn res;\n\t}", "public static void main(String[] args) {\n IntStream.range(0, 10)\n .forEach(System.out::print);\n\n System.out.println();\n\n // print the range of elements but skip first 5\n IntStream.range(0, 10)\n .skip(5)\n .forEach(System.out::print);\n\n // Integer stream with sum\n System.out.println(\n IntStream\n .range(0, 10)\n .sum());\n\n }", "public static void main(String [] args) {\n\t\tFlux<Integer> reactiveStream = Flux.range(1, 5).log();\n\n\t\t//now we subscribe to the to this stream to consume the generated values \n\t\treactiveStream.subscribe();\n\n\t\t//using the take approach we can say to flux that just take a specific number of events in the stream.\n\t\t//the take method also cancel the stream after 3 events\n\t\treactiveStream = Flux.range(1, 5).log().take(3);\n\n\t\t//now we subscribe to the to this stream to consume the generated values \n\t\treactiveStream.subscribe();\n\t\t\n //with this approach the stream will complete this is because we observe the output of using take() instead of what was requested by this method.\n\t\treactiveStream = Flux.range(1, 5).take(3).log();\n\t\t\n\t\t//now we subscribe to the to this stream to consume the generated values \n\t\treactiveStream.subscribe();\n\n\t}", "public final AstValidator.stream_clause_return stream_clause() throws RecognitionException {\n AstValidator.stream_clause_return retval = new AstValidator.stream_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree STREAM393=null;\n CommonTree set395=null;\n AstValidator.rel_return rel394 =null;\n\n AstValidator.as_clause_return as_clause396 =null;\n\n\n CommonTree STREAM393_tree=null;\n CommonTree set395_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:618:15: ( ^( STREAM rel ( EXECCOMMAND | IDENTIFIER ) ( as_clause )? ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:618:17: ^( STREAM rel ( EXECCOMMAND | IDENTIFIER ) ( as_clause )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n STREAM393=(CommonTree)match(input,STREAM,FOLLOW_STREAM_in_stream_clause3269); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n STREAM393_tree = (CommonTree)adaptor.dupNode(STREAM393);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(STREAM393_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_rel_in_stream_clause3271);\n rel394=rel();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, rel394.getTree());\n\n\n _last = (CommonTree)input.LT(1);\n set395=(CommonTree)input.LT(1);\n\n if ( input.LA(1)==EXECCOMMAND||input.LA(1)==IDENTIFIER ) {\n input.consume();\n if ( state.backtracking==0 ) {\n set395_tree = (CommonTree)adaptor.dupNode(set395);\n\n\n adaptor.addChild(root_1, set395_tree);\n }\n\n state.errorRecovery=false;\n state.failed=false;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n MismatchedSetException mse = new MismatchedSetException(null,input);\n throw mse;\n }\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:618:60: ( as_clause )?\n int alt110=2;\n int LA110_0 = input.LA(1);\n\n if ( (LA110_0==AS) ) {\n alt110=1;\n }\n switch (alt110) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:618:60: as_clause\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_as_clause_in_stream_clause3283);\n as_clause396=as_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, as_clause396.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "private void rightParen() {\n reduce();\n getDispenser().advance();\n if (getDispenser().tokenIsEOF()) setState(State.END);\n else if (getDispenser().tokenIsOperator()) setState(State.OPERATOR);\n else if (getDispenser().tokenIsRightParen()) setState(State.RIGHT_PAREN);\n else if (getDispenser().tokenIsLeftParen()) syntaxError(OP);\n else syntaxError(OP_OR_END);\n \n }", "public static void main(String[] args) {\n System.out.println(IntStream.rangeClosed(1, 70).filter(t->t%7==0).sum());\n\n\t\t\n\t\t//2.yol\n\t\tSystem.out.println(IntStream.iterate(7, t->t+7).limit(10).sum());\n\t\t\n\t}", "private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }", "void expr() throws IOException {\n\t\tinput = input+(char)lookahead;\n\t\tterm();\n\t\trest();\n\t\tprintPostfix();\n\t}", "@Test\n public void testSummingUpTwoAsyncStreamsOfIntegers() throws Exception {\n FunctionalReactives<Integer> fr1 =\n FunctionalReactives.createAsync(\n aSubscribableWillAsyncFireIntegerOneToFive() //one async stream of Integers\n );\n FunctionalReactives<Integer> fr2 =\n fr1.fromAnother(\n aSubscribableWillAsyncFireIntegerOneToFive() //another async stream of Integers\n );\n\n FunctionalReactives<Void> fr =\n fr1.zipStrict(fr2, new Function2<Integer, Integer, Integer>() {\n @Override\n public Optional<Integer> apply(Integer input1, Integer input2) {\n return Optional.of(input1 + input2);\n }\n })\n .forEach(println()); //print out reaction results each in a line\n\n fr.start(); //will trigger Subscribable.doSubscribe()\n fr.shutdown(); //will trigger Subscribable.unsubscribe() which in above case will await for all the integers scheduled\n\n //Reaction walk through:\n // Source1: 1 -> 2 -> 3 -> 4 -> 5 -> |\n // Source2: 1 -> 2 -> 3 -> 4 -> 5 -> |\n // Print sum of two sources: 2 -> 4 -> 6 -> 8 -> 10 ->|\n\n }", "@Test\n public void testStreamingFunction() throws Exception {\n setFunctionLocation(\"encode-1.0.0-boot\");\n setFunctionBean(\"com.acme.Encode\");\n process = processBuilder.start();\n\n Function<Flux<Integer>, Flux<?>[]> fn = FunctionProxy.create(Function.class, connect(), Integer.class);\n\n Flux<?>[] result = fn.apply(Flux.just(1, 1, 1, 0, 0, 0, 0, 1, 1));\n\n assertThat(result.length, CoreMatchers.equalTo(1));\n StepVerifier.create((Flux<Integer>) result[0])\n .expectNext(3, 1)\n .expectNext(4, 0)\n .expectNext(2, 1)\n .verifyComplete();\n }", "public static void main(String[] args) {\n\t\tStream st = new Stream();\r\n\t\tSystem.out.println(\">>> Filtrar <<<\");\r\n\t\tst.filtrar();\r\n\t\tSystem.out.println(\">>> Transformar <<<\");\r\n\t\tst.transformar();\r\n\t\tSystem.out.println(\">>> Ordenar <<<\");\r\n\t\tst.ordenar();\r\n\t\tSystem.out.println(\">>> Limitar <<<\");\r\n\t\tst.limitar();\r\n\t\tSystem.out.println(\">>> Contar <<<\");\r\n\t\tst.contar();\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n Optional<Integer> integer = Optional.of(1111);\n integer.map(x -> \"\" + x)\n .filter(x -> x.length() == 3)\n .ifPresent(System.out::println);\n\n //map into another type of optional\n Optional\n .of(\"qwerty\")\n .map(String::length)\n .ifPresent(System.out::println);\n\n Optional<String> optional = Optional.of(\"qwerty\");\n\n //map vs flatmap\n //Chaining calls to flatMap() is useful when you want to transform one\n //Optional type to another.\n Optional<Optional<Integer>> integer1 = optional.map(OptionalChaining::calculator);\n Optional<Integer> integer2 = optional.map(OptionalChaining::calculatorInt);\n\n Optional<Integer> integer3 = optional.flatMap(OptionalChaining::calculator);\n }" ]
[ "0.6338699", "0.57074285", "0.5621041", "0.540977", "0.5166127", "0.5160726", "0.5142562", "0.51319087", "0.5007174", "0.5005964", "0.49120566", "0.48869622", "0.48645413", "0.48590916", "0.4821898", "0.4758245", "0.4755964", "0.47309443", "0.47177225", "0.46892264", "0.4687776", "0.46808526", "0.46689606", "0.46652272", "0.46516943", "0.46496552", "0.46467322", "0.46412808", "0.46408913", "0.4639357", "0.46365306", "0.46273935", "0.45917925", "0.45768115", "0.45635378", "0.4560144", "0.45372486", "0.4532757", "0.45288432", "0.44847453", "0.44746098", "0.44637147", "0.44414598", "0.44339865", "0.44310755", "0.44302574", "0.4424936", "0.4423089", "0.44209784", "0.44206625", "0.44126332", "0.43665797", "0.43596637", "0.43593666", "0.4354701", "0.4345887", "0.43302503", "0.43259922", "0.4303739", "0.42997864", "0.4298644", "0.4296373", "0.4282772", "0.42754477", "0.42754477", "0.42700374", "0.42689434", "0.426672", "0.42617685", "0.4259189", "0.42537194", "0.42498326", "0.4246869", "0.4227587", "0.42237347", "0.4219578", "0.42187065", "0.42142764", "0.4210378", "0.42095116", "0.42081463", "0.41998857", "0.41985044", "0.4194645", "0.41899753", "0.4186431", "0.4185775", "0.41741195", "0.41594997", "0.41570354", "0.4153823", "0.41375908", "0.413724", "0.41328335", "0.41259447", "0.412547", "0.41248456", "0.4109054", "0.41067305", "0.41062054" ]
0.5384859
4
After terminal operation, stream can't be used any more. Some notes on this at
@Test public void terminalOperationsIndeed() { Stream<Book> bookStream = TestData.getBooks().stream(); assertEquals(4, bookStream.count()); try { bookStream.count(); fail("No expection got?"); } catch(IllegalStateException e) { // We got exception as expected } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void resetIO()\r\n {\r\n // Clear out all the stream history stuff\r\n tcIn = null;\r\n tcOut = null;\r\n tcInBuf = null;\r\n\r\n // Make sure these are history-wrapped\r\n SystemIOUtilities.out().clearHistory();\r\n SystemIOUtilities.err().clearHistory();\r\n SystemIOUtilities.restoreSystemIn();\r\n }", "public void cancelStdInStream() {\n\t\tstdInLatch.countDown();\n\t\tif(pipeOut!=null) {\n\t\t\tlog.debug(\"Closing PipeOut\");\n\t\t\ttry { pipeOut.flush(); } catch (Exception e) {}\n\t\t\ttry { pipeOut.close(); } catch (Exception e) {}\n\t\t\tlog.debug(\"Closed PipeOut\");\n\t\t}\n\t\tpipeOut = null;\n\t\tif(pipeIn!=null) try { \n\t\t\tlog.debug(\"Closing PipeIn\");\n\t\t\tpipeIn.close(); \n\t\t\tlog.debug(\"Closed PipeIn\");\n\t\t} catch (Exception e) {}\n\t\tpipeIn = null;\t\t\n\t}", "@After\n\tpublic void restoreStreams() {\n\t\tSystem.setOut(originalOut);\n\t}", "@Override\n public boolean isTerminal() {\n return false;\n }", "@DISPID(1610940417) //= 0x60050001. The runtime will prefer the VTID if present\n @VTID(23)\n boolean atEndOfStream();", "public boolean endOfStream()\n {\n return false;\n }", "void suspendOutput();", "protected void finalizeSystemOut() {}", "protected void instrumentIO()\r\n {\r\n // Clear out all the stream history stuff\r\n tcIn = null;\r\n tcOut = null;\r\n tcInBuf = null;\r\n\r\n // Make sure these are history-wrapped\r\n SystemIOUtilities.out();\r\n SystemIOUtilities.err();\r\n\r\n // First, make sure the original System.in gets captured, so it\r\n // can be restored later\r\n SystemIOUtilities.replaceSystemInContents(null);\r\n\r\n // The previous line actually replaced System.in, but now we'll\r\n // \"replace the replacement\" with one that uses fail() if it\r\n // has no contents.\r\n System.setIn(new MutableStringBufferInputStream((String)null)\r\n {\r\n protected void handleMissingContents()\r\n {\r\n fail(\"Attempt to access System.in before its contents \"\r\n + \"have been set\");\r\n }\r\n });\r\n }", "private void enforceStreamSafety(){\n boolean gettingData = isGettingData(); //Check if we're getting data\n\n if(gettingData) {\n rtButton.setText(getResources().getString(R.string.start_dl_rt));\n sendLogApp(); //Need to send logapp to stop data transfer\n\n streaming_rt = !streaming_rt;\n flushStream(); //Get rid of any real time data still hanging around\n\n try {\n Thread.sleep(200);\n }\n catch(java.lang.InterruptedException e){\n System.out.println(\"Failed to sleep\");\n }\n }\n }", "@Test(timeout = 4000)\n public void test137() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null);\n PipedInputStream pipedInputStream0 = new PipedInputStream();\n javaCharStream0.ReInit((InputStream) pipedInputStream0, 122, 122);\n assertEquals((-1), javaCharStream0.bufpos);\n }", "private void closeOutputStream() {\n\t\tPrintStreamManagement.closeOutputStream();\n\t}", "@Override\n public final boolean isStreaming() {\n return false;\n }", "void cancelEof() {\n\t\tthis.eofSeen = false;\n\t}", "@Test\n\tdefault void testAlllowedWriting() {\n\t\tperformStreamTest(stream -> {\n\t\t\tErrorlessTest.run(() -> stream.writeByte((byte) 42, 6));\n\t\t});\n\t}", "public static\n void hookSystemOutputStreams() {\n out();\n err();\n }", "protected boolean isConsumingInput() {\r\n return true;\r\n }", "private void openOutputStream() {\n\t\tPrintStreamManagement.openOutputStream();\n\t}", "private void ensureOpen() throws IOException {\n if (out == null) {\n throw new IOException(\n/* #ifdef VERBOSE_EXCEPTIONS */\n/// skipped \"Stream closed\"\n/* #endif */\n );\n }\n }", "default void refreshStream() {}", "public boolean isNonTerminal(){\n return false;\n }", "public void processStreamInput() {\n }", "public abstract void disableStreamFlow();", "protected void closeNotSuccessful() {\n\t\tthis.writer.deblockQueue();\n\t}", "synchronized static void initStreams()\n {\n if ( !initialized )\n {\n out = ansiStream(true);\n err = ansiStream(false);\n initialized = true;\n }\n }", "@Test\n\tdefault void testAlllowedWritings() {\n\t\tperformStreamTest(stream -> {\n\t\t\tErrorlessTest.run(() -> stream.writeBytes(new byte[] { 42 }, 6));\n\t\t});\n\t}", "private void zzDoEOF() {\n if (!zzEOFDone) {\n zzEOFDone = true;\n\n }\n }", "@Override\r\n public void disableStreamFlow() {\r\n SwitchStates.setEmitOrgEND(false);\r\n }", "public void turnOnSystemOutput(){\n if(originalSystemOut == null){\n originalSystemOut = System.out;\n System.setOut(new PrintStream(generalStream));\n //will cause CSS hang up\n// System.setIn(console.getInputStream());\n }\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.backup(1);\n javaCharStream0.getLine();\n assertEquals(4094, javaCharStream0.bufpos);\n }", "@After\n public void returnOutStream() { //\n System.setOut(System.out);\n }", "@Override\n\tpublic boolean tryAgainOnEOF()\n\t{\n\t\treturn false;\n\t}", "private void zzDoEOF() {\n if (!zzEOFDone) {\n zzEOFDone = true;\n \n }\n }", "private void zzDoEOF() {\n if (!zzEOFDone) {\n zzEOFDone = true;\n \n }\n }", "private void zzDoEOF() {\n if (!zzEOFDone) {\n zzEOFDone = true;\n \n }\n }", "private void zzDoEOF() {\n if (!zzEOFDone) {\n zzEOFDone = true;\n \n }\n }", "private void zzDoEOF() {\n if (!zzEOFDone) {\n zzEOFDone = true;\n \n }\n }", "@Override\n public boolean isCommitted() {\n return false;\n }", "public void replayFinal() {\n for (InnerDisposable<T> rp : (InnerDisposable[]) this.observers.getAndSet(TERMINATED)) {\n this.buffer.replay(rp);\n }\n }", "public void ObserverIO() {\r\n\t\twhile(running && !gameover) {\r\n\t\t\tif (engine.begin) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tToClient.writeBoolean(running);\r\n\t\t\t\t\tToClient.writeBoolean(engine.gameOver);\r\n\t\t\t\t\t// Exit the loop if game over\r\n\t\t\t\t\tif(engine.gameOver)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tturnDelta = engine.getActiveTurn();\r\n\t\t\t\t\tToClient.writeBoolean(turnDelta != recordedTurn);\r\n\t\t\t\t\tif (turnDelta != recordedTurn) {\r\n\t\t\t\t\t\tToClient.writeUTF(engine.OutputData());\r\n\t\t\t\t\t\trecordedTurn = turnDelta;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tyield();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException 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\tSystem.out.println(\"Thread Connection lost\");\r\n\t\t\t\t\tinterrupt();\r\n\t\t\t\t} \r\n\t\t\t} else {\r\n\t\t\t\tyield();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(engine.gameOver) {\r\n\t\t\ttry {\r\n\t\t\t\tToClient.writeUTF(engine.getGameOverMessage(TYPE));\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void seekReset() {\n discardQueued(false);\n eofCond = false;\n stickyEofCond = false;\n blocked = false;\n sawCR = false;\n // FIXME: Change needed in Tcl\n //needNL = false;\n }", "@Override\n\tpublic void pipeOutput() {\n\n\t}", "public abstract InputStream stdout();", "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 }", "boolean terminateTailing();", "public abstract void enableStreamFlow();", "@Override\n public void flushBuffer() throws IOException {\n\n }", "@Before\n public void changeOutStream() {\n PrintStream printStream = new PrintStream(outContent);\n System.setOut(printStream);\n }", "public void endRead() throws ThingsException;", "public void run() {\n\t\tboolean completed = false;\n\t\t\n\t\ttry {\n\t\t\twhile (buffer.hasNext()) {\n\t\t\t\tsink.process(buffer.getNext());\n\t\t\t}\n\t\t\t\n\t\t\tsink.complete();\n\t\t\tcompleted = true;\n\t\t\t\n\t\t} finally {\n\t\t\tif (!completed) {\n\t\t\t\tbuffer.setOutputError();\n\t\t\t}\n\t\t\t\n\t\t\tsink.release();\n\t\t}\n\t}", "@Override\r\n public void disableStreamFlow() {\r\n SwitchStates.setEmitTrgEND(false);\r\n }", "public void flush() throws IOException {\n\t\tif ((buffer.length - cursor) > 50000) {\n\t\t\tSystem.out.println(\"WASTED: \" + (buffer.length - cursor));\n\t\t}\n\t}", "@After\n\tpublic void backOutput() {\n\t\tSystem.setOut(this.stdout);\n\t}", "public final void m63101a(Throwable th) {\n C0001a.c(th, \"Cannot observe nudge: stream is terminated\", new Object[0]);\n }", "public void run() {\n try {\n byte b[] = new byte[100];\n for (;;) {\n int n = in.read(b);\n String str;\n if (n < 0) {\n break;\n }\n str = new String(b, 0, n);\n buffer.append(str);\n System.out.print(str);\n }\n } catch (IOException ioe) { /* skip */ }\n }", "public final ByteBuffer finishStream() {\n return finishNative();\n }", "protected boolean continueOnWriteError() {\n/* 348 */ return true;\n/* */ }", "@Before\n\tpublic void setUpStreams() {\n\t\tSystem.setOut(new PrintStream(outContent));\n\t}", "@Override\r\n public void disableStreamFlow() {\r\n SwitchStates.setEmitOrgPRE(false);\r\n }", "@Override\n public void reset() {\n isDone = false;\n if (content.markSupported()) {\n try {\n content.reset();\n } catch (IOException ioe) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Unable to reset the input stream: {}\", ioe.getMessage());\n }\n }\n\n content.mark(0);\n }\n super.reset();\n }", "@Override\n public void flush() throws IOException {\n checkStreamState();\n flushIOBuffers();\n }", "protected abstract OutputStream getStream() throws IOException;", "void drain() {\n if (stdOutReader != null) {\n stdOutReader.drain();\n }\n if (stdErrReader != null) {\n stdErrReader.drain();\n }\n }", "@Override\r\n\tpublic void reading() {\n\t\tSystem.out.println(\"reading\");\r\n\t}", "protected void closeStream ()\n {\n stream.close ();\n }", "@Override\n protected void releaseBuffer() {\n }", "public OutputStream setStdInStream(int initialSize) throws IOException {\n\t\tif(stdInLatch.getCount()<1) {\n\t\t\treturn pipeOut;\n\t\t}\n\t\tpipeOut = new PipedOutputStream();\n\t\tpipeIn = new PipedInputStream(pipeOut, initialSize);\n\t\tstdInLatch.countDown();\n\t\tlog.debug(Banner.banner(\"Dropped Latch for STDIN Stream\"));\n\t\treturn pipeOut;\n\t}", "void redirectOutput() {\n Process process = _vm.process();\n _errThread = new StreamRedirectThread(\"error reader\", process.getErrorStream(), System.err);\n _outThread = new StreamRedirectThread(\"output reader\", process.getInputStream(), System.out);\n _errThread.start();\n _outThread.start();\n }", "@Override\n protected boolean continueOnWriteError() {\n return true;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "@Override\n protected boolean isFinished() {\n return false;\n }", "public void start() {\n PrintStream printStream = new PrintStream(output, true) {\n @Override\n public void close() {\n super.close();\n stop();\n }\n };\n //Redirect the System.Err and System.out to the new PrintStream that was created\n System.setErr(printStream);\n System.setOut(printStream);\n running = true;\n flushThread.start();\n }", "protected void releaseBuffer()\n {\n interlock.endReading();\n // System.out.println(\"endReading: 2\");\n }", "public PipedOutputStream() {\n }", "private void sout() {\n\t\t\n\t}", "void resetOutput(){\n\t\tSystem.setOut(oldOut);\n\t}", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }", "private void zzDoEOF() throws java.io.IOException {\n if (!zzEOFDone) {\n zzEOFDone = true;\n yyclose();\n }\n }" ]
[ "0.62651485", "0.6078019", "0.601068", "0.5950742", "0.5908836", "0.5825116", "0.57988894", "0.57957244", "0.57229996", "0.57104933", "0.57057786", "0.56775403", "0.56336975", "0.56286645", "0.56217927", "0.5619529", "0.56104225", "0.5610283", "0.558243", "0.55524635", "0.5541913", "0.5526547", "0.55173326", "0.55158085", "0.5513856", "0.5479086", "0.54626876", "0.54474247", "0.5447108", "0.54461676", "0.5444952", "0.5444842", "0.54353595", "0.54353595", "0.54353595", "0.54353595", "0.54353595", "0.54291964", "0.5422331", "0.54127985", "0.54061615", "0.54022163", "0.5386606", "0.5365149", "0.53602415", "0.5357239", "0.53450924", "0.5338903", "0.53357387", "0.5325705", "0.5310092", "0.53061193", "0.53025484", "0.5302153", "0.5298592", "0.5295798", "0.5295601", "0.5295024", "0.5294586", "0.52942836", "0.52882797", "0.52780104", "0.5273332", "0.52593833", "0.52542746", "0.5252284", "0.52522194", "0.52494246", "0.5247628", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52473086", "0.52398294", "0.5239203", "0.52363384", "0.52290434", "0.52222294", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277", "0.5220277" ]
0.5686825
11
Collecting stream elements to can be done manually with general reduce U reduce(U identity, BiFunction accumulator, BinaryOperator combiner);
@Test public void collectAndReduce() { List<Book> collectedWithReduce = TestData.getBooks().stream() .reduce(new ArrayList<Book>(), (list, book) -> { // Separate list created to avoid mutating elements in the list // -> works also with parallel streams ArrayList<Book> result = new ArrayList<Book>(list); result.add(book); return result; }, (list1, list2) -> { ArrayList<Book> result = new ArrayList<Book>(list1); result.addAll(list2); return result; }); assertEquals(4, collectedWithReduce.size()); // Collect to list "manually" with collect // R collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator, // BiConsumer<R, R> combiner) List<Book> books = TestData.getBooks().stream() .collect(ArrayList::new, ArrayList::add, ArrayList::addAll); assertEquals(4, books.size()); // And the typical way using utilities from java.util.stream.Collectors assertEquals(4, TestData.getBooks().stream().collect(Collectors.toList()).size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void streamApiTest(){\n Collection<Integer> myCollection=initializeIntCollection(3,5);\n\n long sumOfOddValues3times=myCollection.stream().\n filter(o -> o % 2 ==1). // for all odd numbers\n mapToInt(o -> o*3). // multiply their value on 3\n sum(); // and return their sum (reduce operation)\n Assert.assertEquals((3+5+7)*3, sumOfOddValues3times);\n\n Optional<Integer> sumOfModulesOn3= myCollection.stream().\n filter( o -> o % 3 ==0).\n reduce((sum, o) -> sum = sum + o);\n Assert.assertEquals(new Integer(3+6), sumOfModulesOn3.get());\n\n\n\n Collection<Integer> evenCollection=new ArrayList<>();\n myCollection.\n stream().\n filter(o -> o % 2 == 0).\n forEach((i) -> evenCollection.add(i));\n }", "public static void calculateSumViaStreams(List<Integer> numbers){\n int sum = numbers.stream()\n .filter(x -> x % 2 == 0)\n .map(y -> y * y)\n .reduce(0, (x, y) -> x + y);\n\n System.out.println(sum);\n }", "public static void main(String[] args) {\n int count = Stream.of(1, 2, 3).reduce(0, (lhs, rhs) -> lhs + rhs);\r\n System.out.println(\"Sum by reduce: \" + count);\r\n \r\n // 3-16a: feature preview\r\n count = Stream.of(1, 2, 3).reduce(0, Integer::sum);\r\n System.out.println(\"Ditto - Integer::sum: \" + count);\r\n \r\n // 3-16b: another feature preview - get rid of boxing/unboxing\r\n count = IntStream.of(1, 2, 3).sum();\r\n System.out.println(\"Ditto - IntStream.sum(): \" + count);\r\n \r\n // Example 3-18\r\n count = 0;\r\n for (int value : new int[]{1, 2, 3}) {\r\n count += value;\r\n }\r\n System.out.println(\"Ditto - classic: \" + count);\r\n \r\n }", "public interface Reducer<T, U> {\n U reduce(U collector, T item);\n}", "public abstract Stream<E> streamBlockwise();", "public static <T> List<T> reduceToSingleList3(Stream<List<T>> stream) {\n List<T> list = stream.reduce(new ArrayList<T>(), (list1, list2) -> {\n list1.addAll(list2);\n return list1;\n });\n return list;\n }", "@Test\n void testCollect() {\n List<Integer> numbers = Stream.of(1, 2, 3, 4)\n .collect(Collectors.toList());\n assertEquals(List.of(1, 2, 3, 4), numbers);\n\n // collect to a Set\n numbers = List.of(1, 1, 2, 2);\n Set<Integer> unique = numbers.stream()\n .collect(Collectors.toSet());\n assertEquals(Set.of(1, 2), unique);\n\n // collect to a different collection like a Queue\n Queue<Integer> queue = numbers.stream()\n .collect(Collectors.toCollection(LinkedList::new));\n assertEquals(Integer.valueOf(1), queue.poll());\n assertEquals(Integer.valueOf(1), queue.poll());\n assertEquals(Integer.valueOf(2), queue.poll());\n assertEquals(Integer.valueOf(2), queue.poll());\n\n // collect to one single String\n List<String> letters = List.of(\"S\", \"t\", \"r\", \"e\", \"a\", \"m\", \"s\");\n String word = letters.stream()\n .collect(Collectors.joining());\n assertEquals(\"Streams\", word);\n\n String another = letters.stream()\n .collect(Collectors.joining(\" \", \"*\", \"!\"));\n assertEquals(\"*S t r e a m s!\", another);\n }", "List<T> collect();", "T collect(V source);", "Double reduce(Double identity, Function accumulator);", "public static void main(String[] args){\n int result = Stream.of(1,2,3,4,5,6,7,8,9,10)\n .reduce(0,Integer::sum);//metodo referenciado\n// .reduce(0, (acumulador, elemento) -> acumulador+elemento);\n System.out.println(result);\n\n // Obtener lenguajes separados por pipeline entre ellos y sin espacios\n // opcion 1(mejor) con operador ternario\n String cadena = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador.equals(\"\")?lenguaje:acumulador + \"|\" + lenguaje);\n\n System.out.println(cadena);\n\n //Opcion 2 Con regex\n String cadenaRegex = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador + \"|\" + lenguaje)\n .replaceFirst(\"\\\\|\",\"\") // Quitamos la primera pipeline\n .replaceAll(\"\\\\s\",\"\"); // Quitamos todos los espacios\n\n System.out.println(cadenaRegex);\n }", "public static int sumUsingStreams(int []arr)\n{\n //Your code here\n //using stream.sum()\n return Arrays.stream( arr)\n .sum(); \n \n}", "public static <T> List<T> reduceToSingleList2(Stream<List<T>> stream) {\n Optional<List<T>> optionalList = stream.reduce((list1, list2) -> {\n List<T> newList = new ArrayList<T>(list1);\n newList.addAll(list2);\n return newList;\n });\n return optionalList.orElse(Collections.emptyList());\n }", "public static void main(String[] args) {\n ArrayList<Double> myList = new ArrayList<>();\n\n myList.add(7.0);\n myList.add(18.0);\n myList.add(10.0);\n myList.add(24.0);\n myList.add(17.0);\n myList.add(5.0);\n\n double productOfSqrRoots = myList.parallelStream().reduce(\n 1.0,\n (a, b) -> a * Math.sqrt(b),\n (a, b) -> a * b\n );\n\n System.out.println(\"Product of square roots: \" + productOfSqrRoots);\n\n\n // This won't work. !! VERY HARD TO UNDERSTAND !!\n // In this version of reduce(), ACCUMULATOR and COMBINER function are one and the same.\n // This results in an error because when TWO PARTIAL RESULTS ARE COMBINED, THEIR SQUARE\n // ROOTS ARE MULTIPLIED TOGETHER RATHER THAN THE PARTIAL RESULTS, themselves.\n double productOfSqrRoots2 = myList.parallelStream().reduce(\n 1.0,\n (a, b) -> a * Math.sqrt(b)\n );\n\n System.out.println(productOfSqrRoots2);\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "IStreamList<T> transform(IStreamList<T> dataset);", "public static <T> List<T> reduceToSingleList1(Stream<List<T>> stream) {\n List<T> list = stream.flatMap(x -> x.stream())\n .collect(Collectors.toList());\n //.collect(Collectors.toCollection(ArrayList<T>::new));\n return list;\n }", "public Stream<Integer> streamAllValuesOfby() {\n return rawStreamAllValuesOfby(emptyArray());\n }", "protected static void performReduceWithABinaryOperator() {\n Integer sum = Stream.of(1, 2, 3, 4, 5).reduce(0, Integer::sum);\n\n Integer minValue = Stream.of(5, 4, 9, 2, 1).reduce(Integer.MIN_VALUE, Integer::max);\n\n String concatenation = Stream.of(\"str \", \"= \", \"alt \", \"string\")\n // the first parameter becomes the target of the concat method and the second one is the argument to concat\n // the target, the parameter and the result are of the same type and this can be considered a binary\n // operator for the reduce method\n .reduce(\"\", String::concat);\n System.out.println(concatenation);\n }", "@Override\n public BinaryOperator<TradeAccumulator> combiner() {\n return (accum1, accum2) -> {return accum1.addAll(accum2);};\n }", "@Override\r\n public Double reduce(Double identity, Function accumulator) {\r\n return head.reduce(identity, accumulator);\r\n }", "public static void reduceDemo() {\n Observable.range(1, 10).reduce(new Func2<Integer, Integer, Integer>() {\n @Override\n public Integer call(Integer integer, Integer integer2) {\n RxDemo.log(RxDemo.getMethodName() + \" \" + integer + \" \" + integer2);\n return integer + integer2;\n }\n }).subscribe(new RxCreateOperator.Sub());\n }", "WindowedStream<T> windowAll();", "@Override\n\tpublic void run() {\n\t\tresult =\n\t\t\tStream.iterate(new int[]{0, 1}, s -> new int[]{s[1], s[0] + s[1]})\n\t\t\t\t.limit(limit)\n\t\t\t\t.map(n -> n[0])\n\t\t\t\t.collect(toList());\n\n\t}", "public interface Aggregate {\n public abstract Iterator iterator();\n}", "public interface Aggregate {\n public abstract Iterator iterator();\n}", "public static Expression reduce(Expression expression) { throw Extensions.todo(); }", "public interface Aggregate {\n public abstract Iterator iterator();\n}", "public interface Aggregate {\n\n public abstract Iterator iterator();\n}", "private void collectorOperationInStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n Map<Integer, List<Person>> personsByAge = persons\n .stream()\n .collect(Collectors.groupingBy(p -> p.age));\n\n personsByAge.forEach((age, p) -> System.out.format(\"age %s: %s\\n\", age, p));\n\n Double averageAge = persons\n .stream()\n .collect(Collectors.averagingInt(p -> p.age));\n\n System.out.println(\"Average-Age: \" + averageAge);\n\n IntSummaryStatistics ageSummary = persons.stream()\n .collect(Collectors.summarizingInt(p -> p.age));\n\n System.out.println(\"Summarizing Age: \" + ageSummary);\n\n String phrase = persons\n .stream()\n .filter(p -> p.age >= 18)\n .map(p -> p.name)\n .collect(Collectors.joining(\" and \", \"In Germany \", \" are of legal age.\"));\n\n System.out.println(\"Collectors Joining: \" + phrase);\n\n Map<Integer, String> map = persons\n .stream()\n .collect(Collectors.toMap(\n p -> p.age,\n p -> p.name,\n (name1, name2) -> name1 + \";\" + name2));\n\n System.out.println(\"Collectors Mapping: \" + map);\n\n\n Collector<Person, StringJoiner, String> personNameCollector =\n Collector.of(\n () -> new StringJoiner(\" | \"), // supplier\n (j, p) -> j.add(p.name.toUpperCase()), // accumulator\n StringJoiner::merge, // combiner\n StringJoiner::toString); // finisher\n\n String names = persons\n .stream()\n .collect(personNameCollector);\n\n System.out.println(\"Collectors Collect: \" + names);\n\n\n List<Integer> IntegerRange = IntStream.range(51, 54).boxed().collect(Collectors.toList());\n List<Integer> IntegerRange1 = IntStream.range(51, 54).mapToObj(i-> i).collect(Collectors.toList());\n System.out.println(\"InStream to List : \"+IntegerRange);\n System.out.println(\"InStream to List : \"+IntegerRange1);\n }", "public static <T> Stream<T> streamIterate(T seed, UnaryOperator<T> unaryOperator, int limit) {\n return Stream.iterate(seed, unaryOperator).limit(limit);\n }", "default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }", "@Test\r\n\tvoid mapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\tStream<Integer> streamInteger = transactionBeanStream.peek(System.out::println).map(TransactionBean::getId);\r\n\t\tList<Integer> afterStreamList = streamInteger.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong value\", 1, afterStreamList.get(0).intValue());\r\n\t\tassertSame(\"wrong value\", 2, afterStreamList.get(1).intValue());\r\n\t\tassertSame(\"wrong value\", 3, afterStreamList.get(2).intValue());\r\n\t}", "ReduceType reduceInit();", "public void reduce( T mrt ) { }", "public void reduce( T mrt ) { }", "@Override\n public BiConsumer<List<Integer>, Employee> accumulator() {\n return (resultList, employee) -> {\n if (resultList.isEmpty()) resultList.add(employee.getSalary());\n else {\n Integer currentTotal = resultList.get(0);\n currentTotal += employee.getSalary();\n resultList.set(0, currentTotal);\n }\n };\n }", "default <V> Parser<S, T, V> reduce(Supplier<V> start,BiFunction<V, U, V> f) {\n return s-> {\n return reduceBase(s, start.get(),f);\n };\n }", "@Override\n public void collect(T elem) {\n value = elem;\n }", "@Nonnull\r\n\tpublic static <T, U> CloseableIterable<U> collect(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func0<? extends U> initialCollector,\r\n\t\t\t@Nonnull final Func2<? super U, ? super T, ? extends U> merge,\r\n\t\t\t@Nonnull final Func1<? super U, ? extends U> newCollector\r\n\t\t\t) {\r\n\t\treturn new Collect<U, T>(source, initialCollector, merge, newCollector);\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tSystem.out.println(\"-------1. Stream filter() example---------\");\r\n\t\t//We can use filter() method to test stream elements for a condition and generate filtered list.\r\n\t\t\r\n\t\tList<Integer> myList = new ArrayList<>();\r\n\t\tfor(int i=0; i<100; i++) myList.add(i);\r\n\t\tStream<Integer> sequentialStream = myList.stream();\r\n\r\n\t\tStream<Integer> highNums = sequentialStream.filter(p -> p > 90); //filter numbers greater than 90\r\n\t\tSystem.out.print(\"High Nums greater than 90=\");\r\n\t\thighNums.forEach(p -> System.out.print(p+\" \"));\r\n\t\t//prints \"High Nums greater than 90=91 92 93 94 95 96 97 98 99 \"\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"-------2. Stream map() example---------\");\r\n\t\t//We can use map() to apply functions to an stream\r\n\t\tStream<String> names = Stream.of(\"aBc\", \"d\", \"ef\");\r\n\t\tSystem.out.println(names.map(s -> {\r\n\t\t\t\treturn s.toUpperCase();\r\n\t\t\t}).collect(Collectors.toList()));\r\n\t\t//prints [ABC, D, EF]\r\n\t\t\r\n\t\tSystem.out.println(\"-------3. Stream sorted() example---------\");\r\n\t\t//We can use sorted() to sort the stream elements by passing Comparator argument.\r\n\t\tStream<String> names2 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> reverseSorted = names2.sorted(Comparator.reverseOrder()).collect(Collectors.toList());\r\n\t\tSystem.out.println(reverseSorted); // [ef, d, aBc, 123456]\r\n\r\n\t\tStream<String> names3 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> naturalSorted = names3.sorted().collect(Collectors.toList());\r\n\t\tSystem.out.println(naturalSorted); //[123456, aBc, d, ef]\r\n\t\t\r\n\t\tSystem.out.println(\"-------4. Stream flatMap() example---------\");\r\n\t\t//We can use flatMap() to create a stream from the stream of list.\r\n\t\tStream<List<String>> namesOriginalList = Stream.of(\r\n\t\t\t\tArrays.asList(\"Pankaj\"), \r\n\t\t\t\tArrays.asList(\"David\", \"Lisa\"),\r\n\t\t\t\tArrays.asList(\"Amit\"));\r\n\t\t\t//flat the stream from List<String> to String stream\r\n\t\t\tStream<String> flatStream = namesOriginalList\r\n\t\t\t\t.flatMap(strList -> strList.stream());\r\n\r\n\t\t\tflatStream.forEach(System.out::println);\r\n\r\n\t}", "default <V> Parser<S,T,U> reduce(Parser<S,T,Function<U,U>> p) {\n return s-> {\n return reduce(s, parse(s), p);\n };\n }", "static <T> Function<T, T> compose(Stream<Function<T, T>> functions) {\n return functions.reduce(identity(), Function::andThen);\n }", "@CompileStatic\npublic interface Stream<T> {\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n default <X> Stream<X> flatMap(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper) {\n\n return flatMap(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name name of the operation\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n <X> Stream<X> flatMap(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper);\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper the mapping closure\n * @return remapped stream\n */\n default <X> Stream<X> map(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper) {\n\n return map(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name stable name of the mapping operator\n * @param mapper the mapping closure\n * @return remapped stream\n */\n <X> Stream<X> map(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper);\n\n /**\n * Filter stream based on predicate\n *\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }\n\n /**\n * Filter stream based on predicate\n *\n * @param name name of the filter operator\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);\n\n /**\n * Assign event time to elements.\n *\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n default Stream<T> assignEventTime(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner) {\n\n return assignEventTime(null, assigner);\n }\n\n /**\n * Assign event time to elements.\n *\n * @param name name of the assign event time operator\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n Stream<T> assignEventTime(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner);\n\n /**\n * Add window to each element in the stream.\n *\n * @return stream of pairs with window\n */\n default Stream<Pair<Object, T>> withWindow() {\n return withWindow(null);\n }\n\n /**\n * Add window to each element in the stream.\n *\n * @param name stable name of the mapping operator\n * @return stream of pairs with window\n */\n Stream<Pair<Object, T>> withWindow(@Nullable String name);\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @return stream of pairs with timestamp\n */\n default Stream<Pair<T, Long>> withTimestamp() {\n return withTimestamp(null);\n }\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @param name stable name of mapping operator\n * @return stream of pairs with timestamp\n */\n Stream<Pair<T, Long>> withTimestamp(@Nullable String name);\n\n /** Print all elements to console. */\n void print();\n\n /**\n * Collect stream as list. Note that this will result on OOME if this is unbounded stream.\n *\n * @return the stream collected as list.\n */\n List<T> collect();\n\n /**\n * Test if this is bounded stream.\n *\n * @return {@code true} if this is bounded stream, {@code false} otherwise\n */\n boolean isBounded();\n\n /**\n * Process this stream as it was unbounded stream.\n *\n * <p>This is a no-op if {@link #isBounded} returns {@code false}, otherwise it turns the stream\n * into being processed as unbounded, although being bounded.\n *\n * <p>This is an optional operation and might be ignored if not supported by underlying\n * implementation.\n *\n * @return Stream viewed as unbounded stream, if supported\n */\n default Stream<T> asUnbounded() {\n return this;\n }\n\n /**\n * Convert elements to {@link StreamElement}s.\n *\n * @param <V> type of value\n * @param repoProvider provider of {@link Repository}\n * @param entity the entity of elements\n * @param keyExtractor extractor of keys\n * @param attributeExtractor extractor of attributes\n * @param valueExtractor extractor of values\n * @param timeExtractor extractor of time\n * @return stream with {@link StreamElement}s inside\n */\n <V> Stream<StreamElement> asStreamElements(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Persist this stream to replication.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param replicationName name of replication to persist stream to\n * @param target target of the replication\n */\n void persistIntoTargetReplica(\n RepositoryProvider repoProvider, String replicationName, String target);\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n */\n default void persistIntoTargetFamily(RepositoryProvider repoProvider, String targetFamilyname) {\n persistIntoTargetFamily(repoProvider, targetFamilyname, 10);\n }\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n * @param parallelism parallelism to use when target family is bulk attribute family\n */\n void persistIntoTargetFamily(\n RepositoryProvider repoProvider, String targetFamilyname, int parallelism);\n\n /**\n * Persist this stream as attribute of entity\n *\n * @param <V> type of value extracted\n * @param repoProvider provider of repository\n * @param entity the entity to store the stream to\n * @param keyExtractor extractor of key for elements\n * @param attributeExtractor extractor for attribute for elements\n * @param valueExtractor extractor of values for elements\n * @param timeExtractor extractor of event time\n */\n <V> void persist(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Directly write this stream to repository. Note that the stream has to contain {@link\n * StreamElement}s (e.g. created by {@link #asStreamElements}.\n *\n * @param repoProvider provider of repository\n */\n void write(RepositoryProvider repoProvider);\n\n /**\n * Create time windowed stream.\n *\n * @param millis duration of tumbling window\n * @return time windowed stream\n */\n WindowedStream<T> timeWindow(long millis);\n\n /**\n * Create sliding time windowed stream.\n *\n * @param millis duration of the window\n * @param slide duration of the slide\n * @return sliding time windowed stream\n */\n WindowedStream<T> timeSlidingWindow(long millis, long slide);\n\n /**\n * Create session windowed stream.\n *\n * @param <K> type of key\n * @param keyExtractor extractor of key\n * @param gapDuration duration of the gap between elements per key\n * @return session windowed stream\n */\n <K> WindowedStream<Pair<K, T>> sessionWindow(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n long gapDuration);\n\n /**\n * Create calendar-based windowed stream.\n *\n * @param window the resolution of the calendar window (\"days\", \"weeks\", \"months\", \"years\")\n * @param count number of days, weeks, months, years\n * @param timeZone time zone of the calculation\n * @return calendar windowed stream\n */\n WindowedStream<T> calendarWindow(String window, int count, TimeZone timeZone);\n\n /**\n * Group all elements into single window.\n *\n * @return globally windowed stream.\n */\n WindowedStream<T> windowAll();\n\n /**\n * Merge two streams together.\n *\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }\n\n /**\n * Merge two streams together.\n *\n * @param name name of the union operator\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(@Nullable String name, Stream<T> other) {\n return union(name, Arrays.asList(other));\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param streams other streams\n * @return merged stream\n */\n default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param name name of the union operator\n * @param streams other streams\n * @return merged stream\n */\n Stream<T> union(@Nullable String name, List<Stream<T>> streams);\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKeyUnsorted(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, true);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, false);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param sorted {@code true} if the input to the state update function should be time-sorted\n * @return the statefully reduced stream\n */\n <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate,\n boolean sorted);\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n default <K, V> Stream<Pair<K, V>> integratePerKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner) {\n\n return integratePerKey(null, keyExtractor, valueExtractor, initialValue, combiner);\n }\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param name optional name of the transform\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n <K, V> Stream<Pair<K, V>> integratePerKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner);\n\n /** Reshuffle the stream via random key. */\n default Stream<T> reshuffle() {\n return reshuffle(null);\n }\n\n /**\n * Reshuffle the stream via random key.\n *\n * @param name name of the transform\n */\n @SuppressWarnings(\"unchecked\")\n Stream<T> reshuffle(@Nullable String name);\n}", "O transform(R result);", "void consume(List<E> elements) throws Exception;", "@Test\n public void intermediateAndTerminalOperations() throws Exception {\n System.out.println(\n MockData.getCars()\n // Here we go to \"abstraction\" of strams\n .stream()\n // This is an intermediate op because we stay in the abstraction\n .filter(car -> {\n System.out.println(\"filter car \" + car);\n return car.getPrice() < 10000;\n })\n // This is intermediate too, we still working with streams \"abstraction\"\n .map(car -> {\n System.out.println(\"mapping car \" + car);\n return car.getPrice();\n })\n // same as before, still intermediate, still in streams abstraction\n .map(price -> {\n System.out.println(\"mapping price \" + price);\n return price + (price * .14);\n })\n // ok, this is a terminal operation and give you back the \"concrete type\" result of the operations\n .collect(Collectors.toList())\n );\n\n // Q: If you comment this line, no result is printed, you got only stram reference, why?\n // A: STREAMS are LAZY initialized\n\n // Q: What's the order of execution in the above code?\n // A: See the console print to understand order of execution:\n // The mappings are executed as soon as the first car passes the filter\n // so to get some results, stream don't need to filter ALL the list before\n\n }", "public void AllReduce(double[] inData, double[] outData, MpiOp op) {\n\n double[] result = new double[inData.length];\n\n\n\n Reduce(inData, result, op, 0);\n\n //REDUCE_TAG--;\n\n Bcast(result, 0);\n\n System.arraycopy(result, 0, outData, 0, result.length);\n }", "private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }", "default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }", "@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)\n @SchedulerSupport(SchedulerKind.NONE)\n public final <R> Observable<R> reduceWith(Supplier<R> seedSupplier, BiFunction<R, ? super T, R> reducer) {\n return scanWith(seedSupplier, reducer).last();\n }", "public void AllReduce(float[] inData, float[] outData, MpiOp op) {\n\n float[] result = new float[inData.length];\n\n\n Reduce(inData, result, op, 0);\n\n //REDUCE_TAG--;\n\n Bcast(result, 0);\n\n System.arraycopy(result, 0, outData, 0, result.length);\n }", "Stream<T> union(@Nullable String name, List<Stream<T>> streams);", "public interface Reducer<KeyIn extends WritableComparable<KeyIn> , ValueIn extends WritableComparable<ValueIn> , KeyOut extends WritableComparable<KeyOut> , ValueOut extends WritableComparable<ValueOut>> {\n\t\n\tpublic void reduce(KeyIn keyIn , Iterator<ValueIn> values , ReduceOutputCollector<KeyOut, ValueOut> outputCollector );\n\t\n}", "public void printItemsUsingLambdaCollectorsJDK8(List<Item> items){\n\t\tIO.print(\"\\nPrint average of all items price using JDK8 stream, method reference, collector!\");\r\n\t\t// average requires total sum and no of items as well.\r\n\t\t// collect returns ONLY one value throughout the stream. So we need some kind of placer where we will keep storing sum, count during stream.\r\n\t\tAverager avg = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t// alternate of item -> item.getPrice()\r\n\t\t\t.collect(Averager::new, Averager::accept, Averager::mergeIntermediateAverage); \r\n\t\t\t//accept takes one double value from stream and call merge.. method, which combines previous averger`s sum, count.\r\n\t\t\t// All Averager`s methods have no return type except for average which is not used in stream processing.\r\n\t\tIO.print(\"Average of price: \" + String.format(\"%.4f\", avg.average()));\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of items price using JDK8 stream, collector, suming!\");\r\n\t\tdouble total = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.summingDouble(Item::getPrice)); // no need for map as well.\r\n\t\tIO.print(\"Total price: \" + String.format(\"%.4f\", total)); // same result\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector toList!\");\r\n\t\tList<Double> prices = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t// alternate of item -> item.getPrice()\r\n\t\t\t.collect(Collectors.toList()); \r\n\t\t\t// collects stream of elements i.e. price, and creates a List of price.\r\n\t\tIO.print(\"List of prices: \" + prices); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector toCollection!\");\r\n\t\tprices = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t.collect(Collectors.toCollection(ArrayList::new)); // same as toList: Here, we can get prices in any list form; TreeSet, HashSet, ArrayList.\r\n\t\tIO.print(\"List of prices: \" + prices);\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector joining!\");\r\n\t\tString priceString = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice)\r\n\t\t\t.map(Object::toString) //basically, double.toString() as upper map converts stream of Item into stream of Double\r\n\t\t\t.collect(Collectors.joining(\", \")); // same as toList.\r\n\t\tIO.print(\"List of prices: [\" + priceString + \"]\"); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, List<Item>> byType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType));\r\n\t\tIO.print(\"Items by Type: \" + byType ); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, Double> sumByType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType, Collectors.summingDouble(Item::getPrice)));\r\n\t\tIO.print(\"Total prices by Type: \" + sumByType); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, Optional<Item>> largetstByType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType, Collectors.maxBy(Comparator.comparing(Item::getPrice) )));\r\n\t\tIO.print(\"Total prices by Type: \" + largetstByType); \r\n\t}", "protected static void usingACollector() {\n String string = Stream.of(\"this\", \"is\", \"a\", \"list\")\n .collect(() -> new StringBuilder(), // result Supplier\n (sb, str) -> sb.append(str), // add a single value to the result\n (sb1, sb2) -> sb1.append(sb2)) // combine two results\n .toString();\n\n // Using method reference\n string = Stream.of(\"this\", \"is\", \"a\", \"list\")\n .collect(StringBuilder::new, // result Supplier\n StringBuilder::append, // add a single value to the result\n StringBuilder::append) // combine two results\n .toString();\n\n // Using joining method\n string = Stream.of(\"this\", \"is\", \"a\", \"list\").collect(Collectors.joining());\n }", "public void reduce(String key, Iterator<Integer> values,\n OutputCollector<String, List<Integer>> output) {\n }", "public static void main(String[] args) {\n\tDouble totalSalaryExpense = employeeList.stream().map(emp -> emp.getSalary()).reduce(0.00, (a, b) -> a + b);\n\tSystem.out.println(\"Total salary expense: \" + totalSalaryExpense);\n\n\t// Example 2: Using Stream.reduce() method for finding employee with\n\t// maximum salary\n\tOptional<Employee> maxSalaryEmp = employeeList.stream()\n\t\t.reduce((Employee a, Employee b) -> a.getSalary() < b.getSalary() ? b : a);\n\n\tif (maxSalaryEmp.isPresent()) {\n\t System.out.println(\"Employee with max salary: \" + maxSalaryEmp.get());\n\t}\n\n\t// Java 8 code showing Stream.map() method usage\n\tList<String> mappedList = employeeList.stream().map(emp -> emp.getName()).collect(Collectors.toList());\n\tSystem.out.println(\"\\nEmployee Names\");\n\tmappedList.forEach(System.out::println);\n\n\t// Definition & usage of flatMap() method\n\tList<String> nameCharList = employeeList.stream().map(emp -> emp.getName().split(\"\"))\n\t\t.flatMap(array -> Arrays.stream(array)).map(str -> str.toUpperCase()).filter(str -> !(str.equals(\" \")))\n\t\t.collect(Collectors.toList());\n\tnameCharList.forEach(str -> System.out.print(str));\n\n\tStream<String[]> splittedNames = employeeList.stream().map(emp -> emp.getName().split(\"\"));\n\t// splittedNames.forEach(System.out::println);\n\tStream<String> characterStream = splittedNames.flatMap(array -> Arrays.stream(array));\n\tSystem.out.println();\n\t// characterStream.forEach(System.out::print);\n\tStream<String> characterStreamWOSpace = characterStream.filter(str -> !str.equalsIgnoreCase(\" \"));\n\t// characterStreamWOSpace.forEach(System.out::print);\n\n\tList<String> listOfUpperChars = characterStreamWOSpace.map(str -> str.toUpperCase())\n\t\t.collect(Collectors.toList());\n\tlistOfUpperChars.forEach(System.out::print);\n\n }", "public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }", "@Override\n public BinaryOperator<List<Integer>> combiner() {\n return (resultList1, resultList2) -> {\n Integer currentTotal1 = resultList1.get(0);\n Integer currentTotal2 = resultList2.get(0);\n currentTotal1 += currentTotal2;\n resultList1.set(0, currentTotal1);\n return resultList1;\n };\n }", "default Stream<E> parallelStream() {\n return StreamSupport.stream(spliterator(), true);\n }", "public void AllReduce(long[] inData, long[] outData, MpiOp op) {\n\n long[] result = new long[inData.length];\n\n\n\n Reduce(inData, result, op, 0);\n\n //REDUCE_TAG--;\n\n Bcast(result, 0);\n\n System.arraycopy(result, 0, outData, 0, result.length);\n }", "@Nonnull\r\n\tpublic static <T, U> Observable<U> scan(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal U seed,\r\n\t\t\t@Nonnull final Func2<? super U, ? super T, ? extends U> accumulator) {\r\n\t\treturn new Aggregate.ScanSeeded<U, T>(source, seed, accumulator);\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"Chapter 3 - 3.3. Reduction Operations Using Reduce\");\n\n\n System.out.println();\n // *** Reduction Operations on IntStream ***\n reductionOperationsOnIntStream();\n\n System.out.println();\n // *** Summing Numbers Using reduce() ***\n summingNumbersUsingReduce();\n\n System.out.println();\n // *** Perform reduce with a BinaryOperator ***\n performReduceWithABinaryOperator();\n\n System.out.println();\n // *** Using a Collector ***\n usingACollector();\n\n System.out.println();\n // *** Accumulating Books into a Map ***\n new Recipe_3_3_Reduction_Operations_Using_Reduce().accumulatingBooksIntoAMap();\n }", "public static void main(String[] args) {\n\t\tStream<Integer> intStream = Stream.of(1, 2, 3, 4);\n\t\t// intStream.forEach(System.out::println);\n\n\t\t/*\n\t\t * Approach 2 of declaring a stream objects with range of elements from 1-10\n\t\t * where last range element is not considered while printing or for any //\n\t\t * operation like sum, average, etc.\n\t\t * \n\t\t * We have IntStream, DoubleStream, etc to handle primitive values inside\n\t\t * streams...\n\t\t */\n\n\t\tIntStream.range(1, 10).forEach(e -> System.out.println(\"IntStream values from 1-10 range: \" + e)); // This will\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// print\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// numbers\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// from 1-9\n\n\t\t// Sometimes,we really want to create Streams dynamically instead of sequential\n\t\t// int values as above. We can use iterate method to to that.\n\t\tIntStream.iterate(1, e -> e * 2).limit(10).forEach(System.out::println);// Priting square numbers\n\n\t\tIntStream.iterate(2, e -> e + 2).limit(10).peek(System.out::println);// Printing even numbers\n\n\t\t/*\n\t\t * Convert these primitive streams to List For that we need to do a boxing\n\t\t * operation on top of stream\n\t\t */\n\n\t\tSystem.out.println(\"Converting IntStream to List...\");\n\t\tIntStream.range(1, 10).limit(5).boxed().collect(Collectors.toList()).forEach(System.out::println);\n\n\t\t/*\n\t\t * Lets explore some concepts on Strings...How stream works on strings and its\n\t\t * related operations\n\t\t */\n\n\t\t// Stream courseStream = Stream.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses2 = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\t// If we want to join these values\n\n\t\tSystem.out.println(courses.stream().collect(Collectors.joining()));\n\n\t\t/*\n\t\t * Lets say, if i want tp split each string in stream seprated by comma..\n\t\t */\n\t\tSystem.out.println(\"String opeartaion within Streams....\");\n\t\t// The below one prints all stream Objects that executed on top of split\n\t\t// function. So, we need to flatMap it to extract the actual result\n\t\tSystem.out.println(courses.stream().map(course -> course.toString().split(\",\")).collect(Collectors.toList()));\n\t\tSystem.out.println(\n\t\t\t\tcourses.stream().map(course -> course.split(\"\")).flatMap(Arrays::stream).collect(Collectors.toList()));\n\n\t\tSystem.out.println(\"Tuples strings : \"\n\t\t\t\t+ courses.stream().flatMap(course -> courses2.stream().map(course2 -> List.of(course, course2)))\n\t\t\t\t\t\t.collect(Collectors.toList()));\n\n\t\t/**\n\t\t * Higher Order Functions... Higher Order function is a function that returns a\n\t\t * function... In simpler terms, a method that returns a Predicate which\n\t\t * contains logic. So, here we are using method logic as a normal data and\n\t\t * returning it from an another method..\n\t\t */\n\n\t\tList<Courses> courseList = List.of(new Courses(1, \"Java\", 5000, 5), new Courses(2, \"AWS\", 4000, 4));\n\t\t// If we want to get courses whcih has number of students greater than 4000,\n\t\t// then we need to write a predicate for that first\n\t\tint numberOfStudentsThreshhold = 4000;\n\t\tPredicate<Courses> numberOfStudentsPredicate = numberOfStudentsPredecateMethod(numberOfStudentsThreshhold);\n\n\t\tSystem.out.println(\"Courses that has score>4000 : \"\n\t\t\t\t+ courseList.stream().filter(numberOfStudentsPredicate).collect(Collectors.toList()));\n\n\t}", "@Nonnull\r\n\tpublic static <T, U> Observable<U> aggregate(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal U seed,\r\n\t\t\t@Nonnull final Func2<? super U, ? super T, ? extends U> accumulator) {\r\n\t\treturn new Aggregate.Seeded<U, T>(source, seed, accumulator);\r\n\t}", "public void AllReduce(int[] inData, int[] outData, MpiOp op) {\n\n int[] result = new int[inData.length];\n\n\n Reduce(inData, result, op, 0);\n\n //REDUCE_TAG--;\n\n Bcast(result, 0);\n\n System.arraycopy(result, 0, outData, 0, result.length);\n }", "public void testConsumer ()\n {\n\n List<String> list = new ArrayList<>();\n list.add(\"ccc\");\n list.add(\"bbb\");\n list.add(\"ddd\");\n list.add(\"DDDD\");\n list.add(\"ccc\");\n list.add(\"aaa\");\n list.add(\"eee\");\n\n// Collections.sort(list);\n// Collections.sort(list, (s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.sort((s, s2) -> s.compareTo(s2));\n// list.sort((s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.forEach(s -> System.out.println(s));\n// list.forEach(s -> System.out.println(s));\n\n\n// Predicate<String> predicate2 = s -> s.length()>3;\n// System.out.println(\"predicate2.test(\\\"DDDD\\\") = \" + predicate2.test(\"DDDD\"));\n\n// Stream<String> stringStream = list.stream();\n// stringStream.forEach(s -> System.out.println(s));\n// stringStream.forEach(s -> System.out.println(s));//会报错\n\n// list.stream().forEach(s -> System.out.println(s));\n// list.stream().forEach(s -> System.out.println(s));\n\n //并行流是无序的\n// list.parallelStream().forEach(s -> System.out.println(s));\n// list.parallelStream().forEach(s -> System.out.println(s));\n\n// list.stream().skip(3).forEach(s -> System.out.println(s));\n// list.stream().distinct().forEach(s -> System.out.println(s));\n// System.out.println(\"list.stream().count() = \" + list.stream().count());\n// list.stream().limit(2).forEach(s -> System.out.println(s));\n\n// list.stream().filter(s -> s.length()<4).forEach(s -> System.out.println(s));\n\n// BiFunction<Integer, String, Person> bf = Person::new;\n// BiFunction<Integer, String, Person> bf = (n, s) -> new Person(s);\n\n// Person aaa = bf.apply();\n\n// System.out.println(\"aaa = \" + bf.apply(0, \"aaa\"));\n \n }", "@Test\n public void streamsExample() {\n List<Integer> list = asList(1, 2, 3, 4, 5);\n \n list.stream().forEach(out::println);\n \n out.println();\n \n list.stream().parallel().forEachOrdered(out::println);\n \n \n }", "@Override\n public BiConsumer<ObjectNode, Map.Entry<String, JsonNode>> accumulator() {\n return (acc, entry) -> acc.set(entry.getKey(), entry.getValue());\n }", "public static void main(final String[] args)\n {\n final Supplier<ArrayList<String>> proveedor = ArrayList::new;\n\n // Aqui tenemos el acumulador, el que añadira cada elemento del stream al proveedor definido\n // arriba\n // BiConsumer<ArrayList<String>, String> acumulador = (list, str) -> list.add(str);\n final BiConsumer<ArrayList<String>, String> acumulador = ArrayList::add;\n\n // Aquí tenemos el combinador, ya que por ejemplo al usar parallelStream, cada hijo generara\n // su propio proveedor, y al final deberan combinarse\n final BiConsumer<ArrayList<String>, ArrayList<String>> combinador = ArrayList::addAll;\n\n final List<Empleado> empleados = Empleado.empleados();\n final List<String> listNom = empleados.stream()\n .map(Empleado::getNombre)\n .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n System.out.println(listNom);\n\n // Usando Collectors\n final List<String> listNom2 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toList());\n System.out.println(listNom2);\n\n final Set<String> listNom3 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toSet());\n System.out.println(listNom3);\n\n final Collection<String> listNom4 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toCollection(TreeSet::new));\n System.out.println(listNom4);\n\n // Ahora con mapas\n final Map<Long, String> map = empleados.stream()\n .collect(Collectors.toMap(Empleado::getId, Empleado::getNombre));\n System.out.println(map);\n\n final Map<Genero, String> map2 = empleados.stream()\n .collect(Collectors.toMap(Empleado::getGenero, Empleado::getNombre,\n (nom1,\n nom2) -> String.join(\", \", nom1, nom2)));\n System.out.println(map2);\n }", "private static <T, R> R getOf(final Collection<T> collection, Function<T, R> func, BinaryOperator<R> mapper, Function<R, R> sumator) {\n R r = null;\n for (T t: collection) {\n r = mapper.apply(r, func.apply(t));\n }\n return sumator.apply(r);\n }", "default EagerFutureStream<U> doOnEach(final Function<U, U> fn) {\n\t\treturn (EagerFutureStream) FutureStream.super.doOnEach(fn);\n\t}", "public void reduce(K key, Iterator<V> values, OutputCollector<K, V> output, Reporter reporter) throws IOException {\n\t\twhile (values.hasNext()) {\n\t\t\toutput.collect(key, values.next());\n\t\t}\n\t}", "private static int addListOfNumbers(List<Integer> numbers) {\n\t\t/*\n\t\t * Approach 1: Use reduce method and make a call to sum method explicitly\n\t\t */\n\t\t// return numbers.stream().reduce(0, StreamReduce::sum);\n\n\t\t/*\n\t\t * Approach 2 : Replace explicit call with Lambda expression\n\t\t */\n\t\t// return numbers.stream().reduce(0, (x,y)->x+y);\n\n\t\t/*\n\t\t * Approach 3: Replace Lambda expression with Integer sum methods\n\t\t *\n\t\t */\n\n\t\treturn numbers.stream().reduce(0, Integer::sum);\n\t}", "default Stream<Sketch> components() {\n return StreamExt.iterate(1, size(), 1).mapToObj(this::component).map(Optional::get);\n }", "KStream<K, V> toStream();", "@SuppressWarnings(\"unchecked\")\n\tpublic static <CollectedFact> Stream<CollectedFact> addToStream(\n\t\t\tStream<CollectedFact> stream, Stream<CollectedFact> stream2) {\n\t\tList<CollectedFact> result = stream.collect(Collectors.toList()); // error\n\t\tresult.addAll(stream2.collect(Collectors.toList()));\n//\t\tresult.forEach(System.out::println);\n\t\t\n\t\t\n\t\t//code to save to an Output File\n\t\t List<String> strList = result.stream().distinct().map(Object::toString)\n\t\t\t\t.collect(Collectors.toList());\n\n\t\ttry {\n\t\t\tFiles.write(Paths.get(outputFileName),\n\t\t\t\t\t(Iterable<String>) strList.stream()::iterator);\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\treturn result.stream();\n\t}", "@Nonnull\r\n\tpublic static <T, U> CloseableIterable<U> collect(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func0<? extends U> newCollector,\r\n\t\t\t@Nonnull final Func2<? super U, ? super T, ? extends U> merge\r\n\t\t\t) {\r\n\t\treturn collect(source, newCollector, merge, Functions.asFunc1(newCollector));\r\n\t}", "@Test\n public void intermediateOperations() {\n Stream<Book> books = TestData.getBooks().stream();\n // filter\n Stream<Book> booksWithMultipleAuthors = books.filter(book -> book.hasMultipleAuthors());\n // map\n Stream<String> namesStream = booksWithMultipleAuthors.map(book -> book.getName());\n \n Set<String> expected = \n Sets.newHashSet(\"Design Patterns: Elements of Reusable Object-Oriented Software\",\n \"Structure and Interpretation of Computer Programs\");\n assertEquals(expected, namesStream.collect(Collectors.toSet()));\n }", "protected abstract boolean reduce();", "@Nonnull\r\n\tpublic static <T> Observable<T> aggregate(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func2<? super T, ? super T, ? extends T> accumulator) {\r\n\t\treturn new Aggregate.Simple<T>(source, accumulator);\r\n\t}", "public static void main(String[] args) {\n\t\n\t\tm(\"Iterate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.iterate(2, i -> 2 * i),\n\t\t\t\t() -> IntStream.iterate(10, i -> i - 1),\n\t\t\t\t() -> IntStream.iterate(10, i -> i),\n\t\t\t\t() -> IntStream.iterate(10, i -> 2),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity()),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity().andThen(IntUnaryOperator.identity())),\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> supplier.get().limit(10).forEach(System.out::println));\n\t\t});\n\t\t\n\t\t\n\t\t//Various IntStream generations. generate produces elements without input => it uses an IntSupplier.\n\t\t\n\t\tSystem.out.println(\"---------------------------------------------\");\n\t\t\n\t\tm(\"Generate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()).filter(n -> n >= 0),\n\t\t\t\t() -> IntStream.generate(() -> 10),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt() % 20).filter(n -> n >= 0)\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> {supplier.get().limit(10).forEach(System.out::println); System.out.println(\"--------------------------------\");});\n\t\t});\n\t\t\n\t\t\n\t\t//Iterate and generate for DoubleStream, LongStream and Stream<T>\n\t\t\n\t\t\n\t\tm(\"DoubleStream iterate and generate\", () -> {\t\t\n\t\t\tDoubleStream.iterate(1, d -> d + d / 2).limit(20).forEach(System.out::println); //Uses DoubleUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextDouble()).limit(5).forEach(System.out::println); //Uses DoubleSupplier\n\t\t});\n\t\t\n\t\tm(\"LongStream iterate and generate\", () -> {\t\t\n\t\t\tLongStream.iterate(2, n -> n * n).limit(4).forEach(System.out::println); //Uses LongUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextLong()).limit(5).forEach(System.out::println); //Uses LongSupplier\n\t\t});\n\t\t\n\t\tm(\"Stream iterate and generate\", () -> {\t\t\n\t\t\tStream.<List<Object>>iterate(new ArrayList<Object>(), l -> {l.add(1); return l;}).limit(4).forEach(System.out::println); //Uses UnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tStream.<List<Object>>generate(() -> new ArrayList<Object>()).limit(4).forEach(System.out::println); //Uses Supplier\n\t\t});\n\t\t\n\t\tm(\"noneMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 3;\n\t\t\tSystem.out.println(stream.noneMatch(predicate)); //Note: this is not infinite. None match will fail as soon as one element is found\n\t\t});\n\t\t\n\t\tm(\"allMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 0;\n\t\t\tPredicate<String> predicate2 = s -> s.length() > 3;\n\t\t\t//System.out.println(stream.allMatch(predicate)); //Note: This is infinite and will fail with OOM error\n\t\t\tSystem.out.println(stream.allMatch(predicate2)); //Note how this will return as the first element does not match so false can be returned\n\t\t});\n\t\t\n\t}", "public void reduce(LongWritable key, Iterator<Text> values,\n\t\t\t\tOutputCollector<LongWritable, Text> output, Reporter reporter)\n\t\t\t\tthrows IOException {\n\t\t\toutput.collect(key, values.next());\n\t\t\t// process value\n\t\t}", "@Override\n\tpublic void extractAggFn(List<Expr> collector) {\n\n\t}", "default Stream<E> stream() {\n return StreamSupport.stream(this.spliterator(), false);\n }", "public interface ReduceFunction {\n String reduce(String hash);\n}", "<R> MultiSet<R> map(Function<X, R> f);", "public void rc(){\n List<Integer> numbers = new ArrayList<>();\n var result = List.of(1,2,3,4,5,6,7,8,9,10);\n result\n .parallelStream()\n .forEach(number->addToList(numbers,number));\n print.accept(numbers);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Create Stream of Object\\n\");\n\t\tStream<String> stream= Stream.of(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t stream.forEach(System.out::println);\n\t \n // Create Stream from Objects from Collection\n\t\tSystem.out.println(\" \\n\\nCreate Stream Object from collection\\n\");\n\t Collection<String> collection=Arrays.asList(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t Stream<String> stream2=collection.stream();\n\t stream2.forEach(System.out::println);\n\t \n\t //Create Stream Object from Collection\n\t System.out.println(\"\\n\\nCreate Stream Object from List\");\n\t List<String> list= Arrays.asList(\"Modou\",\"Fatou\",\"Saliou\",\"Samba\");\n\t Stream<String> stream3=list.stream();\n\t stream3.forEach(System.out::println);\n\t \n\t //Create Stream Object from Set\n\t System.out.println(\"\\n Create Stream from Set\");\n\t Set<String> set= new HashSet<>(list);\n\t Stream<String> stream4= set.stream();\n\t stream4.forEach(System.out::println);\n\t \n\t //Create Stream Object from Arrays\n\t System.out.println(\"\\nCreate Stream Object from Arrays\");\n\t ArrayList<String> array= new ArrayList<>(list);\n\t Stream<String> stream5= array.stream();\n\t stream5.forEach(System.out::println);\n\t \n\t //Create Stream from Array of String\n\t System.out.println(\"\\n Create Stream from Array of String\");\n\t String[] strArray= {\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\"};\n\t Stream<String> stream6=Arrays.stream(strArray);\n\t stream6.forEach(System.out::println);\n\t \n\t \n\t}", "private void collectUsingStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n List<Person> filtered = persons\n .stream()\n .filter(p -> p.name.startsWith(\"H\"))\n .collect(Collectors.toList());\n\n System.out.println(\"collectUsingStream Filtered: \" + filtered);\n }", "public void reduce(Text word, Iterable<Text> value,\n Context context) throws IOException, InterruptedException\n {String sum=\"\";\n for (Text count : value) {\n if(sum.equals(\"\")){\n sum=count.toString();\n }\n else\n sum =sum+\",\"+ count.toString();\n }//System.out.println(sum);\n context.write(word, new Text(sum));\n }", "public interface Aggregate<T> {\n \n void add(T t);\n\n void remove(T t);\n \n Iterator<T> createIterator();\n\n int length();\n\n T get(int index);\n}", "public IntStream parallelStream() {\n\treturn StreamSupport.intStream(spliterator(), true);\n }", "public static void findFirstMultipleOfSixViaStreams(List<Integer> numbers){\n\n int abc = 9;\n numbers.stream().filter(x -> {\n System.out.println(\"x = \" + x);\n return x % 6 == 0;\n }).map(x -> x + abc).findFirst();\n// Optional<Integer> firstSixMultiple = numbers.stream()\n// .filter(x -> {\n// System.out.println(\"x = \" + x);\n// return x % 6 == 0;\n// })\n// .findFirst();\n\n// int ans = firstSixMultiple.orElse(-1);\n\n// System.out.println(ans);\n }", "@Override\n public Integer reduce(Integer value, Integer sum) {\n return value + sum;\n }", "@Nonnull\r\n\tpublic static <T> Observable<T> scan(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func2<? super T, ? super T, ? extends T> accumulator) {\r\n\t\treturn new Aggregate.Scan<T>(source, accumulator);\r\n\t}", "public static void main(String[] args){\n List<String> list = Arrays.asList(\"a\",\"2\",\"3\",\"4\",\"5\");\n //List l1 = Lists.newArrayList();\n //list.stream().map(a->\"map\"+a).forEach(System.out::println);\n Stream lines = list.stream();\n lines.flatMap(line->Arrays.stream(line.toString().split(\"\"))).distinct().count();\n\n\n }", "public void collect(K key, V value) {\n\n }", "public abstract T accumulate(T left, T right);" ]
[ "0.5897748", "0.58082116", "0.5806185", "0.57786554", "0.5752171", "0.56174064", "0.55730516", "0.557184", "0.55597985", "0.5549976", "0.5368975", "0.5347033", "0.531308", "0.5307659", "0.53040135", "0.5280046", "0.5258525", "0.5206923", "0.5203229", "0.51738024", "0.5168428", "0.5123353", "0.51217645", "0.5104682", "0.5089765", "0.5089765", "0.5077512", "0.50698984", "0.5061521", "0.503554", "0.5034692", "0.502228", "0.5013449", "0.5010876", "0.4988142", "0.4988142", "0.4985896", "0.4970888", "0.49547106", "0.49379036", "0.49215838", "0.49207658", "0.49166927", "0.4893451", "0.48854312", "0.48831478", "0.4881486", "0.48794723", "0.487703", "0.487196", "0.4870712", "0.4855126", "0.48546204", "0.48504806", "0.48298326", "0.48274258", "0.4823703", "0.48150736", "0.48109317", "0.48004258", "0.47958705", "0.47628847", "0.47496846", "0.4743251", "0.47280812", "0.4726582", "0.47159117", "0.47054625", "0.46875092", "0.46834883", "0.4676075", "0.4671126", "0.4668282", "0.4650499", "0.46475112", "0.46457782", "0.4640571", "0.46086562", "0.45961836", "0.45930243", "0.45676816", "0.45579305", "0.45493048", "0.45326385", "0.45232308", "0.4511756", "0.45113498", "0.45041683", "0.44982654", "0.4496874", "0.4485297", "0.44747412", "0.44729838", "0.4468193", "0.4467113", "0.4455747", "0.44522834", "0.44512525", "0.44444034", "0.44376525" ]
0.6641815
0
Finds MenuPermissionEntity by UserGroupEntity.
List<MenuPermissionEntity> findByUserGroup(UserGroupEntity userGroup);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<MenuPermissionEntity> deleteByUserGroup(UserGroupEntity userGroup);", "UserGroup findById(String groupId);", "UserGroup selectByPrimaryKey(Long id_user_group);", "GroupUser getGroupUserById(String id);", "public Collection<PrivilegeEntity> getGroupPrivileges(GroupEntity groupEntity) {\n if (groupEntity == null) {\n return Collections.emptyList();\n }\n\n // get all of the privileges for the group\n List<PrincipalEntity> principalEntities = new LinkedList<>();\n\n principalEntities.add(groupEntity.getPrincipal());\n\n List<PrivilegeEntity> explicitPrivilegeEntities = privilegeDAO.findAllByPrincipal(principalEntities);\n List<PrivilegeEntity> implicitPrivilegeEntities = getImplicitPrivileges(explicitPrivilegeEntities);\n List<PrivilegeEntity> privilegeEntities;\n\n if (implicitPrivilegeEntities.isEmpty()) {\n privilegeEntities = explicitPrivilegeEntities;\n } else {\n privilegeEntities = new LinkedList<>();\n privilegeEntities.addAll(explicitPrivilegeEntities);\n privilegeEntities.addAll(implicitPrivilegeEntities);\n }\n\n return privilegeEntities;\n }", "UserGroup findByName(String companyId, String name);", "GroupRoleUserRel selectByPrimaryKey(String id);", "GroupRightDAO selectByPrimaryKey(Long groupRightId);", "public interface PermissionDao extends EasyJpaRepository<Permission,String> {\n\n @Query(\"select distinct p from Permission p \" +\n \"where p.code in (select p.code from Permission p left join p.users u1 where u1 = ?1 ) or \" +\n \"p.code in (select p.code from Permission p inner join p.groups g left join g.users u2 where u2 = ?1 and g.status.abandon = false ) \")\n List<Permission> findAllPermissionForUser(User user);\n\n @Query(\"select distinct p from Permission p right join p.groups g where g in ?1 \")\n List<Permission> findAllPermissionForGroups(Collection<Group> groups);\n\n Permission findByCode(String code);\n\n @Query(\"select distinct p from Permission p \" +\n \"where \"\n +\"p.code in (select p.code from Permission p left join p.users u1 where u1 = ?1 and p = ?2 ) or \" +\n \"p.code in (select p.code from Permission p inner join p.groups g left join g.users u2 where u2 = ?1 and g.status.abandon = false and p = ?2) \")\n Permission checkUserHasPermission(User user,Permission permission);\n\n @Query(\"select distinct p from Permission p \" +\n \"where \"\n +\"p.code in (select p.code from Permission p left join p.users u1 where u1 = ?1 and p in ?2 ) or \" +\n \"p.code in (select p.code from Permission p inner join p.groups g left join g.users u2 where u2 = ?1 and g.status.abandon = false and p in ?2) \")\n List<Permission> checkUserHasPermissions(User user,Collection<Permission> permissions);\n\n @Query(\"select p from Permission p where p not in ?1\")\n List<Permission> findPermissionNotIn(Collection<Permission> permissions);\n}", "@ViewPermission\n\t@RequestMapping(method = RequestMethod.GET, value = FIND_PRODUCT_GROUP_BY_ID)\n\tpublic CustomerProductGroup findProductGroupById(@PathVariable Long productGroupId, HttpServletRequest request){\n\t\tlogger.info(String.format(PRODUCT_GRP_BY_ID_LOG_MESSAGE, this.userInfo.getUserId(), request.getRemoteAddr(), productGroupId ));\n\t\treturn this.productGroupService.findProductGroupById(productGroupId);\n\t}", "Permission selectByPrimaryKey(String id);", "public interface FindUserGroupUserByUserIdService extends EntityService<UserGroupUser> {\n public UserGroupUser find(long userId);\n}", "Permission selectByPrimaryKey(Integer id);", "@Transactional(readOnly = true)\n public Group findByUserAndName(Long userId, String groupName) {\n Query query = entityManager.createQuery(\"SELECT g FROM Group g, IN (g.user) u \"\n + \"WHERE u.id = :userId AND g.name = :groupName\");\n query.setParameter(\"userId\", userId);\n query.setParameter(\"groupName\", groupName);\n return (Group) query.getSingleResult();\n }", "@RequestMapping(value = \"/getPermissionForUserMenu\", method = RequestMethod.GET)\n\tpublic ResponseEntity<?> getPermissionForUserMenu() throws JsonParseException, JsonMappingException, IOException {\n\t\tMap<String, Object> result = permissionAuthorize.getPermissionForUserMenu(SecurityUtil.getIdUser());\n\t\t// return.\n\t\treturn new ResponseEntity<Map<String, Object>>(result, HttpStatus.OK);\n\t}", "public List<UserParam> findListForManagement(UserEntity userEntity);", "EpermissionDO selectByPrimaryKey(Long id);", "public boolean isUserInGroup(long idUser, long idGroup);", "UmsMenu selectByPrimaryKey(String menuId);", "public java.util.List<Todo> filterFindByGroupId(long groupId);", "public java.util.List<DataEntry> filterFindByGroupId(long groupId);", "UserGroup findByNameIgnoreCase(String companyId, String name);", "PensionRoleMenu selectByPrimaryKey(Long id);", "List<User> findUsers(User.UserGroup group, Long id, String fname, String lname, String email) throws Exception;", "public List<Usergroup> getUsersInGroup(Long groupKey) throws DAOException;", "List<UserGroup> findAllGroups(String companyId);", "List<TUserPermission> selectByExample(TUserPermissionExample example);", "public boolean isUserInGroup(UserEntity userEntity, GroupEntity groupEntity) {\n for (MemberEntity memberEntity : userEntity.getMemberEntities()) {\n if (memberEntity.getGroup().equals(groupEntity)) {\n return true;\n }\n }\n return false;\n }", "List<UserEntityPermissionsState> getEntityPermissions(Set<Long> usersPrincipalIds, List<Long> entityIds);", "MessageGroup selectByPrimaryKey(Long id_message_group);", "List<RolePermission> findByRoleId(Long roleId);", "public java.util.List<Todo> findByUserIdGroupId(long userId, long groupId);", "@Query(\"SELECT userEntity FROM RoleEntity roleEntity JOIN roleEntity.user userEntity WHERE roleEntity.roleValue=:roleValue\")\r\n List<UserEntity> findAllByRole(@Param(\"roleValue\") RoleEntity.Role roleValue);", "List<UserPermissionDTO> findAll();", "@Override\n\tpublic List<Function> findMenu() {\n\t\tUser user = BosContext.getLoginUser();\n\t\tif(user.getUsername().equals(\"admin\")){\n\t\t\treturn functionDao.findAllMenu();\n\t\t}else{\n\t\t\treturn functionDao.findMenuByUserId(user.getId());\n\t\t}\n\t\t\n\t}", "public java.util.List<Todo> findByGroupId(long groupId);", "public Group getGroupFullWithDomain(Long groupKey) throws DAOException;", "@Test\n\tvoid findAllForMyGroup() {\n\t\tinitSpringSecurityContext(\"mmartin\");\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, \"dig as\", null, newUriInfoAsc(\"id\"));\n\n\t\t// 4 users from delegate and 1 from my company\n\t\tAssertions.assertEquals(5, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(5, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(5, tableItem.getData().size());\n\n\t\t// Check the users (from delegate)\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertFalse(tableItem.getData().get(0).isCanWrite());\n\t\tAssertions.assertTrue(tableItem.getData().get(0).isCanWriteGroups());\n\t}", "public Permission getPermission(String objectId, User user, Boolean pending) throws UserManagementException;", "public java.util.List<Todo> filterFindByUserIdGroupId(\n\t\tlong userId, long groupId);", "@ViewPermission\n\t@RequestMapping(method = RequestMethod.GET, value = FIND_ALL_PRODUCT_GROUP_ID)\n\tpublic List<Long> findProductGroupIds(@RequestParam(value = \"productGroupId\",required = false) Long productGroupId,\n\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"productGroupName\",required = false) String productGroupName,\n\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"productGroupType\",required = false) String productGroupType,\n\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"customerHierarchyId\",required = false) Long customerHierarchyId,\n\t\t\t\t\t\t\t\t\t\t HttpServletRequest request){\n\t\tlogger.info(String.format(PRODUCT_GRP_IDS_LOG_MESSAGE, this.userInfo.getUserId(), request.getRemoteAddr(),\n\t\t\t\tproductGroupId, productGroupName, productGroupType, customerHierarchyId));\n\t\treturn this.productGroupService.findProductGroupIds(productGroupId, productGroupName, productGroupType, customerHierarchyId);\n\t}", "@Repository\npublic interface PermissionDao {\n Set<Permission> findPermissionsByRoleId(Integer roleId);\n}", "Optional<UserPermissionDTO> findOne(Long id);", "UsrMmenus selectByPrimaryKey(String menuid);", "public interface PermissionService {\n List<User> findRoleUsers(String roleId);\n\n void roleAssignUsers(String roleId, String assignUsers, String removeUsers);\n\n void roleAssignMenu(String roleId, String menuIds);\n\n List<Menu> findRoleMenus(String roleId);\n}", "public String findPrivileges() {\r\n\r\n String thePrivilegeType = this.getParam(\"privilegeType\");\r\n if (thePrivilegeType == null) {\r\n this.privilegeTypeEnum = ScopeEnum.IMMEDIATE;\r\n } else {\r\n this.privilegeTypeEnum = ScopeEnum.valueOf(PrivilegesRadioEnum.fromLabel(thePrivilegeType).name());\r\n }\r\n\r\n this.clearContext();\r\n\r\n // The list of groups.\r\n List < Privilege > privileges = null;\r\n\r\n List < Subject > subjects = null;\r\n\r\n ParameterGroup parameterGroup = null;\r\n Iterator < Parameter > itParam = null;\r\n Parameter parameter = null;\r\n\r\n if (this.getGroupController().getGroup() != null && !this.getGroupController().getIsCreation()) {\r\n\r\n // Dynamic parameters\r\n List < String > attributes = new ArrayList < String >();\r\n IParameterService parameterService = this.getGroupController().getParameterService();\r\n\r\n parameterGroup = parameterService\r\n .findParametersByGroup(\"org.esco.grouperui.group.privileges.attribut\");\r\n\r\n // We retrieve the parameters from the database.\r\n itParam = parameterGroup.getParameters().iterator();\r\n while (itParam.hasNext()) {\r\n parameter = itParam.next();\r\n attributes.add(parameter.getKey());\r\n }\r\n\r\n // Dynamic source\r\n Map < String, SourceTypeEnum > sources = new HashMap < String, SourceTypeEnum >();\r\n parameterGroup = parameterService.findParametersByGroup(\"org.esco.grouperui.group.privileges.map\");\r\n\r\n itParam = parameterGroup.getParameters().iterator();\r\n while (itParam.hasNext()) {\r\n parameter = itParam.next();\r\n sources.put(parameter.getValue(), SourceTypeEnum.valueOf(parameter.getKey().toUpperCase()));\r\n }\r\n\r\n // The stem name from which we want to retrieve the privileges.\r\n String groupName = this.getGroupController().getGroup().getName();\r\n\r\n // The person from which we want to open the grouper session.\r\n Person userConnected = null;\r\n try {\r\n userConnected = PersonController.getConnectedPerson();\r\n } catch (ESCOSubjectNotFoundException e1) {\r\n GroupModificationsPrivilegesController.LOGGER.error(e1, \"Subject not found\");\r\n } catch (ESCOSubjectNotUniqueException e1) {\r\n GroupModificationsPrivilegesController.LOGGER.error(e1, \"Subject not unique\");\r\n }\r\n\r\n // The Membership Type selected via the Radio Button.\r\n PrivilegesRadioEnum radioType = PrivilegesRadioEnum.fromLabel(thePrivilegeType.toUpperCase());\r\n if (radioType == null) {\r\n radioType = PrivilegesRadioEnum.IMMEDIATE;\r\n }\r\n\r\n // The list of Subject corresponding to the find parameters.\r\n privileges = this.getGroupController().getGrouperService().findGroupPrivileges(userConnected,\r\n attributes, sources, groupName, ScopeEnum.valueOf(radioType.name()));\r\n\r\n GroupPrivileges groupPrivileges = new GroupPrivileges(privileges);\r\n subjects = groupPrivileges.getSubjects();\r\n\r\n Iterator < Subject > itSubject = subjects.iterator();\r\n while (itSubject.hasNext()) {\r\n this.data.add(itSubject.next());\r\n }\r\n }\r\n this.addedItems();\r\n\r\n // Create and return the XML status.\r\n XmlProducer producer = new XmlProducer();\r\n producer.setTarget(new Status(this.isRowToReturn()));\r\n producer.setTypesOfTarget(Status.class);\r\n\r\n return this.xmlProducerWrapper.wrap(producer);\r\n }", "@Override\n\tpublic List<LinkGroup> findByMenu(long linkgroupId) {\n\t\treturn findByMenu(linkgroupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,\n\t\t\tnull);\n\t}", "@Override\n\tpublic List<Permission> fetchMenuPermissionByOrganisation(\n\t\t\tOrganisation organisation, String val) {\n\t\treturn this.permissionDao.fetchMenuPermissionByOrganisation(organisation, val);\n\t}", "public void joinGroup(Group group) {\n try {\n conn = dao.getConnection();\n ps = conn.prepareStatement(\"SELECT * FROM USERS_GROUPS WHERE USER_ID=? AND GROUP_ID=?\");\n ps.setString(1, Session.getInstance(\"\").getUserName());\n ps.setString(2, group.toString());\n ResultSet rs = ps.executeQuery();\n if (rs.next()) return;\n\n ps = conn.prepareStatement(\"INSERT INTO USERS_GROUPS(USER_ID, GROUP_ID) VALUES(?, ?)\");\n ps.setString(1, Session.getInstance(\"\").getUserName());\n ps.setString(2, group.toString());\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "List<UserGroupImp> fetchUserGroupByName (String userGroupName);", "public static PermissionEntity getEntity(MemoryState memoryState, String name0, UUID uuid, boolean group) {\n String lname = checkNameUuid(name0, uuid, group).toLowerCase();\n PermissionEntity entity;\n if (group)\n entity = memoryState.getGroups().get(lname);\n else\n entity = memoryState.getPlayers().get(lname);\n if (entity == null) {\n entity = new PermissionEntity();\n entity.setName(lname);\n entity.setGroup(group);\n entity.setDisplayName(name0);\n if (group)\n memoryState.getGroups().put(lname, entity);\n else\n memoryState.getPlayers().put(lname, entity);\n }\n return entity;\n }", "GroupUser getGroupUserByUsername(String username);", "List<GroupRoleUserRel> selectByExample(GroupRoleUserRelExample example);", "PolicyGroup selectByPrimaryKey(Long id);", "public IPermissionOwner getPermissionOwner(long id);", "int deleteByPrimaryKey(Long id_user_group);", "public List<Permission> getPermissions(T object, User user);", "@ViewPermission\n\t@RequestMapping(method = RequestMethod.GET, value = PRODUCT_SEARCH_URL)\n\tpublic PageableResult<CustomerProductGroup> findProductGroup(@RequestParam(value = \"page\") int page,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"pageSize\") int pageSize,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"productGroupId\", required = false) Long productGroupId,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"productGroupName\", required = false) String productGroupName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"productGroupType\", required = false) String productGroupType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"customerHierarchyId\", required = false) Long customerHierarchyId,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"firstSearch\", required = false) boolean firstSearch,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t HttpServletRequest request) {\n\n\t\tlogger.info(String.format(ProductGroupSearchController.SEARCH_LOG_MESSAGE, this.userInfo.getUserId(), request.getRemoteAddr(),\n\t\t\t\tproductGroupId, productGroupName, productGroupType, customerHierarchyId));\n\t\treturn this.productGroupService.findProductGroup(page, pageSize, productGroupId,\n\t\t\t\tproductGroupName, productGroupType,customerHierarchyId, firstSearch);\n\t}", "private Group getGroup(String groupId, User user, DAO dao) {\n Group group;\n if (!groupId.isEmpty()) {\n group = (Group) dao.get(\n Group.class,\n groupId);\n } else {\n group = user.getFriendsGroup(new Query());\n }\n return group;\n }", "@Override\n\tpublic List<Permission> fetchByOrganisation(Organisation organisation) {\n\t\treturn this.permissionDao.fetchByOrganisation(userIdentity.getOrganisation());\n\t}", "List<EpermissionDO> selectByExample(EpermissionDOExample example);", "public List<SecGroupright> getAllGroupRights();", "public UserPermission selectByPrimaryKey(String id) {\n\t\tUserPermission key = new UserPermission();\n\t\tkey.setId(id);\n\t\tUserPermission record = (UserPermission) getSqlMapClientTemplate()\n\t\t\t\t.queryForObject(\"userpermission.selectByPrimaryKey\", key);\n\t\treturn record;\n\t}", "public interface PermissionRepository extends BaseRepository<Permission> {\n\n Permission findByPermissionName(String permissionName);\n\n Permission findById(String id);\n\n Integer deleteById(String id);\n\n List<Permission> findByMenuId(String menuId);\n\n @Query(value = \"SELECT 1 FROM Permission t WHERE t.permissionName = :permissionName AND t.menuId <> :menuId AND t.id <> :id\")\n String findRepeatPermission(@Param(\"permissionName\") String permissionName,@Param(\"menuId\") String menuId, @Param(\"id\") String id);\n}", "@Override\n\tpublic ShiroRolesPermissionsPoEntity selectById(Integer pk) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Permission queryById(Integer id) {\n\t\treturn permissionDao.queryById(id);\r\n\t}", "public Group getGroupFull(Long groupKey) throws DAOException;", "SeGroup selectByPrimaryKey(SeGroupKey key);", "public List<User> getStudents(Group currentGroup);", "public Group getGroup(Long id);", "@Override\r\n\tpublic List<TPermission> queryByUid(int id) {\n\t\treturn dao.queryByUid(id);\r\n\t}", "@GET\n\t@PermitAll\n\t@Path(\"/{groupId}/user/{permission}/{skipBlocks}/{blockSize}\")\n\t@Produces(\"application/json\")\n\t@ApiDoc(\"\")\n\tpublic List<Membership> getGroupUserMemberships(@PathParam(\"groupId\") final String groupId,\n\t\t\t@PathParam(\"permission\") final String permissions ,\n\t\t\t@PathParam(\"skipBlocks\") int skipBlocks,\n\t\t\t@PathParam(\"blockSize\") int blockSize) throws NdexException {\n\n\t\tlogger.info(userNameForLog() + \"[start: Getting \"+ permissions + \" users in group \" + groupId + \"]\");\n\t\t\n\t\tPermissions permission = Permissions.valueOf(permissions.toUpperCase());\n\t\t\n\t\ttry (GroupDocDAO dao = getGroupDocDAO()){\n\t\t\tList<Membership> l = dao.getGroupUserMemberships(UUID.fromString(groupId), permission, skipBlocks, blockSize);\n\t\t\tlogger.info(userNameForLog() + \"[end: Getting \"+ permissions + \" users in group \" + groupId + \"]\");\n\t\t\treturn l;\n\t\t} \n\t}", "@Override\n public boolean inGroup(String worldName, String playerName, String groupName) {\n try {\n PermissionUser[] userList = PermissionsEx.getPermissionManager().getGroup(groupName).getUsers();\n for (PermissionUser user : userList) {\n if (user.getName() == playerName)\n return true;\n else\n return false;\n }\n } catch (Exception e) {\n return false;\n }\n return false;\n }", "List<UserGroup> selectByExample(UserGroupExample example);", "public interface MenuRepository extends CrudRepository<Menu, Long> {\n Iterable<Menu> findByMenuLevel(Integer menuLevel);\n}", "List<UserContentAccess> findContentAccess();", "Collection <Permission> findByRole(Integer accountId,Integer role);", "public Privilege findByName(UserPrivilegeType name);", "public interface PermissionRepository extends CrudRepository<PermissionEntity, Long> {\n\n public PermissionEntity findById(Long id);\n\n public PermissionEntity findByValueIgnoreCase(String permission);\n}", "@Test\n\tpublic void testFindBy() throws PaaSApplicationException {\n\t\tList<String> members = getMembers();\n\n\t\tGroup expected = new Group();\n\t\texpected.setGid(1);\n\t\texpected.setName(\"tstdaemon\");\n\t\texpected.setMembers(members);\n\n\t\tGroup actual = repo.findBy(1);\n\t\tAssertions.assertEquals(expected, actual, \"Find group by Id\");\n\t}", "@Override\n\tpublic LinkGroup fetchByPrimaryKey(long linkgroupId) {\n\t\treturn fetchByPrimaryKey((Serializable)linkgroupId);\n\t}", "@Override\n public Map<String, Object> queryTaskGroupById(User loginUser, Integer id) {\n Map<String, Object> result = new HashMap<>();\n if (isNotAdmin(loginUser, result)) {\n return result;\n }\n TaskGroup taskGroup = taskGroupMapper.selectById(id);\n result.put(Constants.DATA_LIST, taskGroup);\n putMsg(result, Status.SUCCESS);\n return result;\n }", "SysRoleUser selectByPrimaryKey(Long id);", "private List<Group> getGroupsWithUser(String userId, Assignment asn, Site site)\n\t{\n\t\tboolean isAdmin = securityService.isSuperUser();\n\t\treturn asn.getGroups().stream().map(gref -> site.getGroup(gref)).filter(Objects::nonNull)\n\t\t\t\t.filter(g -> g.getMember(userId) != null || isAdmin) // allow admin to submit on behalf of groups\n\t\t\t\t.collect(Collectors.toList());\n\t}", "@Test\n\tpublic void testFindAny() throws PaaSApplicationException {\n\t\tGroup group = new Group();\n\n\t\tList<String> members = getMembers();\n\n\t\tgroup.setGid(1);\n\t\tgroup.setMembers(members);\n\n\t\tList<Group> list = repo.findAny(group);\n\t\tAssertions.assertEquals(1, list.size(), \"Find a single user by given username and home directory\");\n\t\tAssertions.assertEquals(\"tstdaemon\", list.get(0).getName(), \"Find user 'tstnews'\");\n\t\tAssertions.assertEquals(members, list.get(0).getMembers(), \"User 'news' home directory\");\n\t}", "@Override\r\n\tpublic List<Tree> queryListMenu(String uiId) {\n\t\treturn permissionDao.queryListMenu(uiId);\r\n\t}", "PermissionService getPermissionService();", "@SuppressWarnings(\"unchecked\")\n\tpublic List<UserPermission> selectByExample(UserPermissionExample example) {\n\t\tList<UserPermission> list = getSqlMapClientTemplate().queryForList(\n\t\t\t\t\"userpermission.selectByExample\", example);\n\t\treturn list;\n\t}", "public void setGroup(entity.Group value);", "public java.util.List<Todo> filterFindByUserIdGroupId(\n\t\tlong userId, long groupId, int start, int end);", "public java.util.List<DataEntry> findByGroupId(long groupId);", "@SuppressWarnings(\"unused\")\n\tprivate static void viewUserGroupMembersAndAdmins(\n\t\t\tSecurityService service, String securityDomainId, String groupId) {\n\t\tSystem.out.println(\"Inside viewUserGroupMembersAndAdmins>>>>\");\n\t\tGroupResponse grpResp = service.retrieveUserGroupByGroupId(securityDomainId, groupId);\n\t\tSystem.out.println(\"Group Response>>>>\" + grpResp);\n\t\tUserGroupProfile ugp = grpResp.getUserGroupProfile();\n\t\tSystem.out.println(\"User Group Profile>>>>\" + ugp);\n\t\tActorListResponse alResp = service.retrieveMemberListByUserGroupId(securityDomainId, groupId);\n\t\tSystem.out.println(\"alResp>>>> \" + alResp);\n\t\tActorProfileListResponse ap = service.retrieveActorProfileByUserIdList(securityDomainId, new ArrayList<Actor>(alResp.getSuccessfulActorSet())); \n\t\tSystem.out.println(\"List of Actor Profiles>>>>>\" + ap);\n\t\t//serviceImpl.retrieveActorProfileByUserIdList(securityDomainId, alResp.getActorList());\n\t\t\n\t}", "MenuInfo selectByPrimaryKey(Integer menuid);", "@SuppressWarnings(\"unchecked\")\r\n\tprivate Set<String> getIdSet(UserId userId, GroupId groupId,\r\n\t\t\tCollectionOptions options, SecurityToken token)\r\n\t\t\tthrows JSONException {\r\n\r\n\t\tString user = userId.getUserId(token);\r\n\r\n\t\tif (groupId == null) {\r\n\t\t\treturn ImmutableSortedSet.of(user);\r\n\t\t}\r\n\r\n\t\tSet<String> idSet = new HashSet<String>();\r\n\t\t\r\n\t\tSession hs = HibernateUtil.getSessionFactory().getCurrentSession();\r\n\t\tTransaction tran = null;\r\n\r\n\t\tswitch (groupId.getType()) {\r\n\t\tcase all:\r\n\t\t\t// idSet.add(user);\r\n\t\t\tList<String> allUserIds = null;\r\n\t\t\ttry {\r\n\t\t\t\t// List<String> allUserIds = sqlMap.queryForList(\r\n\t\t\t\t// \"getAllUserIds\" );\r\n\t\t\t\ttran = hs.beginTransaction();\r\n\r\n\t\t\t\t// Criteria crit = hs.createCriteria(User.class);\r\n\t\t\t\tQuery q = hs.createQuery(\"select id from User\");\r\n\t\t\t\tallUserIds = (List<String>) q.list();\r\n\r\n\t\t\t\ttran.commit();\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tif (tran != null)\r\n\t\t\t\t\ttran.rollback();\r\n\t\t\t\tHibernateUtil.getSessionFactory().getCurrentSession()\r\n\t\t\t\t\t\t.getTransaction().rollback();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\tfor (String id : allUserIds) {\r\n\t\t\t\tidSet.add(id);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase groupId:\r\n\t\t\t\r\n\t\tcase friends:\r\n\t\t\ttry {\r\n\t\t\t\t/**\r\n\t\t\t\t * <p>\r\n\t\t\t\t * This filter can be any field of the object being filtered or\r\n\t\t\t\t * the special js filters, hasApp or topFriends. Other special\r\n\t\t\t\t * Filters defined in the OpenSocial v.9 specification are\r\n\t\t\t\t * </p>\r\n\t\t\t\t * <dl>\r\n\t\t\t\t * <dt>all</dt>\r\n\t\t\t\t * <dd>Retrieves all friends</dd>\r\n\t\t\t\t * <dt>hasApp</dt>\r\n\t\t\t\t * <dd>Retrieves all friends with any data for this application.\r\n\t\t\t\t * </dd>\r\n\t\t\t\t * <dt>'topFriends</dt>\r\n\t\t\t\t * <dd>Retrieves only the user's top friends.</dd>\r\n\t\t\t\t * <dt>isFriendsWith</dt>\r\n\t\t\t\t * <dd>Only \"hasApp filter\" is implemented here</dd>\r\n\t\t\t\t * </dl>\r\n\t\t\t\t */\r\n\r\n\t\t\t\ttran = hs.beginTransaction();\r\n\t\t\t\t\r\n\t\t\t\t//List<String> friendsIds = sqlMap.queryForList(\"getFriendsIds\",user);\r\n\r\n\t\t\t\tList<String> friendsIds = new ArrayList<String>();\r\n\t\t\t\t\r\n\t\t\t\tUser userObject = (User)hs.get(User.class, user);\r\n\t\t\t\t\r\n\t\t\t\tSet<User> friends = userObject.getFriendsByMe();\r\n\t\t\t\tSet<User> friendsByOthers = userObject.getFriendsByOther();\r\n\t\t\t\t\r\n\t\t\t\tfriends.addAll(friendsByOthers);\r\n\t\t\t\t\r\n\t\t\t\tif (options.getFilter() != null\r\n\t\t\t\t\t\t&& options.getFilter().equals(\"hasApp\")) {\r\n\r\n\t\t\t\t\tSet<User> tempFriends = new HashSet<User>();\r\n\t\t\t\t\ttempFriends.addAll(friends);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (User friend : tempFriends) {\r\n\t\t\t\t\t\tif (!friend.getPerson().getHasapp())\r\n\t\t\t\t\t\t\tfriends.remove(friend);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(User friend: friends) {\r\n\t\t\t\t\tfriendsIds.add(friend.getId());\r\n\t\t\t\t}\r\n\t\t\t\tidSet.addAll(friendsIds);\r\n\r\n\r\n\t\t\t\ttran.commit();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tif (tran != null)\r\n\t\t\t\t\ttran.rollback();\r\n\t\t\t\t\r\n\t\t\t\tHibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\tbreak;\r\n\t\tcase self:\r\n\t\t\tidSet.add(user);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn idSet;\r\n\t}", "public List<Menu> findMenus(User user) {\n\n List<Resource> resources = findAll(new Sort(Sort.Direction.DESC,\"parentId\",\"weight\"));\n Set<String> userPermissions = userAuthService.findStringPermissions(user);\n Iterator<Resource> iter = resources.iterator();\n while (iter.hasNext()) {\n if (!hasPermission(iter.next(), userPermissions)) {\n iter.remove();\n }\n }\n return convertToMenus(resources);\n }", "public interface MenuGroupRepository extends JpaRepository<MenuGroup,String>\n , QuerydslPredicateExecutor<MenuGroup> {\n}", "@Override\n\tpublic List<UserRole> buscarUserRoleSemPermissoes() {\n\t\t// TODO Auto-generated method stub\n\t\tQuery query = getCurrentSession().createQuery(\"select ur from UserRole ur where ur.permissions\");\n\t\treturn query.list();\n\t}", "Group getGroupById(String id);", "Collection getForeignKeysInGroup(Object groupID) throws Exception;", "void onCreateContextMenuForGroup(ContextMenu menu, Activity activity) {\n }" ]
[ "0.68260324", "0.6186708", "0.6171006", "0.5621693", "0.5544397", "0.5498723", "0.543434", "0.5408689", "0.535112", "0.5344652", "0.5331008", "0.53174835", "0.5283171", "0.52599853", "0.5255668", "0.52503955", "0.5245351", "0.52340275", "0.5215943", "0.51831174", "0.5155267", "0.5108129", "0.5089158", "0.5067967", "0.5063898", "0.5063668", "0.5059193", "0.5055873", "0.5043547", "0.5017114", "0.49667865", "0.4955639", "0.49405974", "0.49364355", "0.49273777", "0.49229503", "0.4916675", "0.49149072", "0.48853266", "0.48760495", "0.48665854", "0.48654976", "0.4861372", "0.48560822", "0.4836478", "0.48204076", "0.47945398", "0.47790396", "0.4761723", "0.4761144", "0.475191", "0.47477996", "0.47432807", "0.473266", "0.47181115", "0.47168326", "0.47028843", "0.47024447", "0.47012037", "0.46978587", "0.46791", "0.4677045", "0.46762544", "0.4674273", "0.4673753", "0.46721524", "0.46712953", "0.46639946", "0.46633047", "0.46618578", "0.4659505", "0.4658095", "0.46526504", "0.4648081", "0.46335673", "0.46333724", "0.46327266", "0.46159878", "0.46117", "0.4600564", "0.45992044", "0.4597677", "0.45888382", "0.4582569", "0.45803922", "0.45760572", "0.4555576", "0.45341364", "0.45331377", "0.453065", "0.45290837", "0.45236418", "0.45217222", "0.45199612", "0.45148084", "0.45125785", "0.45064098", "0.450372", "0.45035768", "0.45004672" ]
0.85094607
0
Deletes MenuPermissionsEntity by UserGroupEntity.
List<MenuPermissionEntity> deleteByUserGroup(UserGroupEntity userGroup);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int deleteByPrimaryKey(Long id_user_group);", "public void deleteMenu() {\n deleteMenuGroupError = true;\n String input = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"menu_id\");\n menu_id = Integer.parseInt(input);\n setMenu_id(menu_id);\n if (menu.deleteMenu()) {\n createMenuError = false;\n updateMenuError = false;\n deleteMenuError = true;\n } else {\n deleteMenuError = false;\n }\n }", "List<MenuPermissionEntity> findByUserGroup(UserGroupEntity userGroup);", "public boolean delete(String username, int menuId);", "Integer deleteByRoleAndPermission(@Param(\"roleId\") Integer roleId,\n @Param(\"permissionId\") Integer permissionId);", "@Override\n\tpublic void deleteGroupUser(Integer groupId, String vcEmployeeIds) {\n\t\tString hql = \"delete from HhGroupUser h where h.vcEmployeeId in (\" + vcEmployeeIds + \") and h.groupId = \" + groupId;\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\n\t\tquery.executeUpdate();\n\t}", "public boolean delete(int menuId);", "@Override\n\tpublic void removeByMenu(long linkgroupId) {\n\t\tfor (LinkGroup linkGroup : findByMenu(linkgroupId, QueryUtil.ALL_POS,\n\t\t\t\tQueryUtil.ALL_POS, null)) {\n\t\t\tremove(linkGroup);\n\t\t}\n\t}", "public void deleteGroup(Group group);", "public int deleteAllPermissions() throws DAOException;", "int deleteByPrimaryKey(Long groupRightId);", "int deleteByPrimaryKey(Long permsId);", "int deleteByPrimaryKey(Long id_message_group);", "@Override\n\tpublic void deleteAllGroupUsersRole(Integer id) {\n\t\tString hql = \"delete from HhGroupUserRole h where h.groupId = \" + id;\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\n\t\tquery.executeUpdate();\n\t}", "@Override\n\tpublic void deleteAllGroupUser(Integer id) {\n\t\tString hql = \"delete from HhGroupUser h where h.groupId = \" + id;\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\n\t\tquery.executeUpdate();\n\t}", "public void deleteGroup(GroupUser group) {\n try{\n PreparedStatement s = sql.prepareStatement(\"DELETE FROM Groups WHERE groupName=? AND id=?;\");\n s.setString(1, group.getId());\n s.setInt(2, group.getIdNum());\n s.execute();\n\n s.close();\n } catch (SQLException e) {\n sqlException(e);\n }\n }", "public void removeByGroupId(long groupId);", "public void removeByGroupId(long groupId);", "public int deleteByPrimaryKey(Integer rolemenuId) throws SQLException {\r\n SysRoleMenu key = new SysRoleMenu();\r\n key.setRolemenuId(rolemenuId);\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByPrimaryKey\", key);\r\n return rows;\r\n }", "public void removeByUserIdGroupId(long userId, long groupId);", "public void delete(SecRole entity);", "@Override\n\tpublic void deleteUserGroup(Integer id) {\n\t\tString hql = \"update HhGroup h set h.isDel = 1 where h.id = \" + id;\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\n\t\tquery.executeUpdate();\n\t}", "int deleteByPrimaryKey(String menuId);", "public void delete() throws PortalException, SystemException, IOException {\n for (ModelInputGroupDisplayItem gchild:getChildGroups()) {\n gchild.setParent(null);\n }\n for (ModelInputDisplayItem item:getDisplayItems()) {\n ((ModelInputIndividualDisplayItem)item).setGroupId(null);\n }\n populateChildren();\n ModelInputGroupLocalServiceUtil.deleteModelInputGroup(group.getModelInputGroupPK());\n }", "int deleteByExample(GroupRoleUserRelExample example);", "public int deleteByExample(UserPermissionExample example) {\n\t\tint rows = getSqlMapClientTemplate().delete(\n\t\t\t\t\"userpermission.deleteByExample\", example);\n\t\treturn rows;\n\t}", "@Override\n\tpublic Integer deletePersByMenuId(Integer menuId) {\n\t\treturn this.menuDao.deletePersByMenuId(menuId);\n\t}", "@Override\n\tpublic void delete(User entity) {\n\t\t\n\t}", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "public static void deleteAuthGroupUser( AuthorizationGroup authGroupList, UsersVO userVo ) {\n\n List<BusinessRelationObjectVO> relList = authGroupList.getRelationship( ApplicationSchemaConstants.RELCLASS_HASAUTHORIZATIONGROUP );\n\n for (BusinessRelationObjectVO vo: relList) {\n if (userVo.getObid().equals(vo.getToObid())) {\n BusinessRelationObject rel = (BusinessRelationObject)DomUtil.toDom(vo.getObid());\n rel.deleteObject();\n }\n }\n UserManagementUtil.removeUserForGroup(authGroupList.getVo().getNames(), userVo.getNames());\n }", "@POST\n @Path(\"DeletePermission/{roleId : [1-9][0-9]*}/{permission}\")\n public boolean deletePermissionByInstance(@PathParam(value = \"roleId\") Long roleId, @PathParam(value = \"permission\") String permission) {\n\n String splitedPermission[] = permission.split(\":\");\n\n checkGmOrGPermission(splitedPermission[2], \"GameModel:Edit:\", \"Game:Edit:\");\n\n return this.userFacade.deleteRolePermission(roleId, permission);\n }", "private void deleteTodoMenu(User u) {\n\t\t\n\t}", "public boolean removePermission(Permission permission);", "@Override\n public void deleteMenu(MenuDto menuDto)\n {\n Menu menu = new Menu();\n BeanUtils.copyProperties(menuDto, menu);\n menu.setStat(DataStatus.DISABLED);\n menuDao.updateMenu(menu);\n }", "public void removePermission(T object, Permission permission, User user);", "@Override\n\tpublic void onBeforeDelete(BeforeDeleteEvent<Group> event) {\n\t\tSystem.out.println(\"On Before Delete\");\n\t\tString id = (String) event.getDBObject().get(\"id\");\n\t\tGroup g = groupRepository.findOne(id);\n\t\troleMappingRepository.delete(roleMappingRepository.findByKeyAndType(g.getId(),g.type()));\n\t\tuserGroupRepository.delete(userGroupRepository.findByGroup(g));\n\t}", "int deleteByExample(EpermissionDOExample example);", "public int deleteByPrimaryKey(String id) {\n\t\tUserPermission key = new UserPermission();\n\t\tkey.setId(id);\n\t\tint rows = getSqlMapClientTemplate().delete(\n\t\t\t\t\"userpermission.deleteByPrimaryKey\", key);\n\t\treturn rows;\n\t}", "@Override\n\tpublic Integer deleteMenuPerByMenuIds(List<Integer> delMenuIds) {\n\t\treturn this.menuDao.deleteMenuPerByMenuIds(delMenuIds);\n\t}", "@Test\n public void testAuthorizedRemoveGroup() throws IOException {\n testUserId2 = createTestUser();\n grantUserManagementRights(testUserId2);\n\n String groupId = createTestGroup();\n\n Credentials creds = new UsernamePasswordCredentials(testUserId2, \"testPwd\");\n\n String getUrl = String.format(\"%s/system/userManager/group/%s.json\", baseServerUri, groupId);\n assertAuthenticatedHttpStatus(creds, getUrl, HttpServletResponse.SC_OK, null); //make sure the profile request returns some data\n\n String postUrl = String.format(\"%s/system/userManager/group/%s.delete.html\", baseServerUri, groupId);\n List<NameValuePair> postParams = new ArrayList<>();\n assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);\n\n assertAuthenticatedHttpStatus(creds, getUrl, HttpServletResponse.SC_NOT_FOUND, null); //make sure the profile request returns some data\n }", "@Override\r\n\tpublic void deletePsermission(Permission permission) {\n\t\tpermissionDao.deletePsermission(permission);\r\n\t}", "public synchronized void revokeAdminPrivilege(UserEntity userEntity) {\n for (PrivilegeEntity privilege : userEntity.getPrincipal().getPrivileges()) {\n if (privilege.getPermission().getPermissionName().equals(PermissionEntity.AMBARI_ADMINISTRATOR_PERMISSION_NAME)) {\n userEntity.getPrincipal().getPrivileges().remove(privilege);\n principalDAO.merge(userEntity.getPrincipal()); //explicit merge for Derby support\n userDAO.merge(userEntity);\n privilegeDAO.remove(privilege);\n break;\n }\n }\n }", "Result deleteGroup(String group);", "public boolean deletePeopleInGroup(int groupId) throws SQLException {\r\n\t\treturn db.delete(DATABASE_TABLE, KEY_GROUP_ID + \"=\" + groupId, null) > 0;\r\n\t}", "int deleteByPrimaryKey(SeGroupKey key);", "public void removeByGroupId(long groupId)\n throws com.liferay.portal.kernel.exception.SystemException;", "public void removeGroup(int groupId);", "int deleteByPrimaryKey(Integer menuid);", "private boolean isAllowToDelete(String userId, String siteId, SignupMeeting meeting) {\n\t\tif (sakaiFacade.isUserAdmin(userId))\n\t\t\treturn true;\n\n\t\tSignupSite site = currentSite(meeting, siteId);\n\t\tif (site != null) {\n\t\t\tif (site.isSiteScope()) {// GroupList is null or empty case\n\t\t\t\tif (sakaiFacade.isAllowedSite(userId, SakaiFacade.SIGNUP_DELETE_SITE, site.getSiteId()))\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/* It's groups scope */\n\t\t\tif (sakaiFacade.isAllowedSite(userId, SakaiFacade.SIGNUP_DELETE_GROUP_ALL, site.getSiteId())\n\t\t\t\t\t|| sakaiFacade.isAllowedSite(userId, SakaiFacade.SIGNUP_DELETE_SITE, site.getSiteId()))\n\t\t\t\treturn true;\n\n\t\t\t/*\n\t\t\t * organizer has to have permission to delete every group in the\n\t\t\t * list,otherwise can't delete\n\t\t\t */\n\t\t\tboolean allowedTodelete = true;\n\t\t\tList<SignupGroup> signupGroups = site.getSignupGroups();\n\t\t\tfor (SignupGroup group : signupGroups) {\n\t\t\t\tif (!(sakaiFacade.isAllowedGroup(userId, SakaiFacade.SIGNUP_DELETE_GROUP, site.getSiteId(), group.getGroupId()) \n\t\t\t\t\t\t|| sakaiFacade.isAllowedGroup(userId, SakaiFacade.SIGNUP_DELETE_GROUP_ALL, siteId, group.getGroupId()))) {\n\t\t\t\tallowedTodelete = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn allowedTodelete;\n\n\t\t}\n\t\treturn false;\n\n\t}", "int deleteByExample(TUserPermissionExample example);", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "private void deleteGroupImage(Group group) {\n trDeleteGroupImage.setUser(user);\n trDeleteGroupImage.setGroup(group);\n try {\n trDeleteGroupImage.execute();\n } catch (NotGroupOwnerException | GroupNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void deleteSiteMenu(SiteMenuVO siteMenuVO) throws Exception {\n\t\tsqlSession.delete(\"com.example.mapper.SiteMapper.deleteSiteMenu\", siteMenuVO);\n\t}", "@Override\r\n\tpublic int delPermission(int id) {\n\t\treturn 0;\r\n\t}", "int deleteByPrimaryKey(String menuid);", "@Override\n\tpublic void delete(List<User> entity) {\n\t\t\n\t}", "@Override\n\tpublic void delete(UserModel um) throws Exception {\n\t\tsf.getCurrentSession().delete(um);\n\t}", "public void deleteGroup(AdminBean adminBean, int index,\r\n\t\t\tUserAccountDTO currentUser) {\r\n\t\t\r\n\t\tUserGroupDTO dto = new UserGroupDTO();\r\n\t\ttry{\r\n\t\t\tadminBean.getGroupAssignmentList().get(index);\r\n\t\t\tdto.setGroup_Code(((UserGroupDTO)adminBean.getGroupAssignmentList().get(index)).getGroup_Code());\r\n\t\t\tdto.setAgency_Code(currentUser.getAgencyCode());\r\n\t\t\tdto.setBureau_Code(currentUser.getBureauCode());\r\n\t\t\tadminDAO.deleteGroup(dto);\r\n\t\t\tadminBean.setReturnMessage(\"Admin Group deleted successfully\");\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\tadminBean.setReturnMessage(\"Failed to delete admin group\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic void deleteGroupList(Long id) {\n\t\ttry {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"******************** je suis dans DeleteGroup from group's list **********************************************\");\n\n\t\t\tsession = HibernateUtil.getSessionFactory().openSession();\n\t\t\ttx = session.beginTransaction();\n\t\t\tContactGroup g = (ContactGroup) session.get(ContactGroup.class, id);\n\t\t\tsession.delete(g);\n\t\t\ttx.commit();\n\t\t\tsession.close();\n\n\t\t} catch (HibernateException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void delete(SmsAgendaGrupoPk pk) throws SmsAgendaGrupoDaoException;", "@ServiceMethod(returns = ReturnType.SINGLE)\n public void deleteGroup(String groupId) {\n this.serviceClient.deleteGroup(groupId);\n }", "@Override\n\tpublic synchronized void removeGroup(Group group) throws DataBackendException, UnknownEntityException\n {\n try\n {\n ((TorqueAbstractSecurityEntity)group).delete();\n }\n catch (TorqueException e)\n {\n throw new DataBackendException(\"Removing Group '\" + group.getName() + \"' failed\", e);\n }\n }", "public void deleteGroup( GroupId groupId ) {\n String path = template.urlFor( UrlTemplate.GROUPS_ID_PATH ).replace( \"{groupId}\", groupId.getId() ).build();\n try {\n client.delete( path );\n } catch ( RequestException e ) {\n throw new EslServerException( \"Failed to delete Group.\", e );\n } catch ( Exception e ) {\n throw new EslException( \"Failed to delete Group.\", e );\n }\n }", "public void removeBycompanyIdAndGroupId(long companyId, long groupId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "void deleteTrackerUsersInGroups(final Integer id);", "@Override\r\n\tpublic int deleteRolePermission(int id) {\n\t\treturn rolePermissionMapper.deleteByPrimaryKey(id);\r\n\t}", "@POST\n @Path(\"DeleteAllRolePermissions/{roleId : [1-9][0-9]*}/{gameModelId}\")\n public boolean deleteAllRolePermissions(@PathParam(\"roleId\") Long roleId,\n @PathParam(\"gameModelId\") String id) {\n\n checkGmOrGPermission(id, \"GameModel:Edit:\", \"Game:Edit:\");\n\n return this.userFacade.deleteRolePermissionsByIdAndInstance(roleId, id);\n }", "@Override\n\tpublic void delete(User entity) {\n\t\tuserlist.remove(String.valueOf(entity.getDni()));\n\t}", "@Override\n\tpublic void deleteAllUserRole(Integer id) {\n\t\tString hql = \"delete from HhUsersrole h where h.vcEmployeeId in (select u.vcEmployeeId from HhGroupUser u where u.groupId = \" + id + \") and h.roleId in \"+\n\t\t\t\t \t \"(select g.roleId from HhGroupUserRole g where g.groupId = \" + id + \" ) \";\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\n\t\tquery.executeUpdate();\n\t}", "@DefaultMessage(\"This action will remove all the permissions for this user and make it inactive. The user itself will not be removed.\")\n @Key(\"systemUser.deleteUserMessage\")\n String systemUser_deleteUserMessage();", "@Override\r\n\tpublic int deleteRoleandPermission(int roleid, int permissionid) {\n\t\treturn adminRoleandpermissionDao.deleteByPrimaryKey(roleid, permissionid);\r\n\t}", "DeleteParameterGroupResult deleteParameterGroup(DeleteParameterGroupRequest deleteParameterGroupRequest);", "public void delete(CrGrupoFormularioPk pk) throws CrGrupoFormularioDaoException;", "@Override\n\tpublic void delete(ERS_USERS entity) {\n\t\t\n\t}", "public void delete() {\n\t\tif(verificaPermissao() ) {\n\t\t\tentidades = EntidadesDAO.find(idEntidades);\n\t\t\tEntidadesDAO.delete(entidades);\n\t\t\tentidades.setAtiva(false);\n\t\t}\t\n\t}", "public boolean deleteGroups(List<Integer> groupIds) {\n\t\tif (currentUser.getContacts().stream().filter(c -> c instanceof Grupo && groupIds.contains(c.getId()))\n\t\t\t\t.allMatch(c -> ((Grupo) c).getAdmin() == currentUser.getId())) {\n\t\t\tfor (int groupId : groupIds) {\n\t\t\t\tOptional<Contacto> g = currentUser.getContacts().stream()\n\t\t\t\t\t\t.filter(c -> ((c.getId() == groupId) && c instanceof Grupo)).findFirst();\n\t\t\t\tGrupo group = (Grupo) g.get();\n\t\t\t\tcurrentUser.removeContact(group);\n\t\t\t\tuserCatalog.modifyUser(currentUser);\n\t\t\t\t// Deletes the group in all the contacts\n\t\t\t\tgroup.getComponents().stream().forEach(c -> {\n\t\t\t\t\tUsuario user = userCatalog.getUser(c.getUserId());\n\t\t\t\t\tuser.removeContact(group);\n\t\t\t\t\tuserCatalog.modifyUser(user);\n\t\t\t\t});\n\t\t\t\tmessageDAO.deleteMessageList(group.getMsgId());\n\t\t\t\tcontactDAO.deleteContact(group);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic void deleteUserRole(Integer id, String vcEmployeeIds) {\n\t\tString hql = \"delete from HhUsersrole h where h.vcEmployeeId in (\" + vcEmployeeIds + \") and h.roleId in \"+\n\t\t\t\t\t \"(select g.roleId from HhGroupUserRole g where g.groupId = \" + id + \" ) \";\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\n\t\tquery.executeUpdate();\n\t}", "@Override\n\tpublic void deleteRolemenuByRoleId(Integer roleid) {\n\t\tjdbcTemplate.update(\"delete from menurole where roleid=?\",roleid);\n\t}", "public int deleteAdministratorAccessGroup(Integer administratorAccessGroupId, Integer noOfChanges,\n\t\t\tInteger auditorId) {\n\t\tStringBuffer sql = new StringBuffer(deleteAdministratorAccessGroupSQL.toString());\n\t\t// Replace the parameters with supplied values.\n\t\tUtilities.replace(sql, auditorId);\n\t\tUtilities.replaceAndQuote(sql, new Timestamp(new java.util.Date()\n\t\t\t\t.getTime()).toString());\n\t\tUtilities.replace(sql, administratorAccessGroupId);\n\t\tUtilities.replace(sql, noOfChanges);\n\t\treturn UpdateHandler.getInstance().update(getJdbcTemplate(),\n\t\t\t\tsql.toString());\n\t}", "@Path (\"deleteGroupId\")\n @GET\n @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })\n @RedbackAuthorization (noPermission = true)\n ActionStatus deleteGroupId( @QueryParam (\"groupId\") String groupId, @QueryParam (\"repositoryId\") String repositoryId )\n throws ArchivaRestServiceException;", "int deleteByExample(PensionRoleMenuExample example);", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.miDelete:\n deleteGroup();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "public void removeByc_g(long groupId, long companyId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Test\n public void deleteAppPermissionTest() throws ApiException {\n String appId = null;\n String username = null;\n Boolean naked = null;\n // api.deleteAppPermission(appId, username, naked);\n\n // TODO: test validations\n }", "@Override\n\tpublic Integer deleteMenuByIds(List<Integer> delMenuIds) {\n\t\treturn this.menuDao.deleteMenuByIds(delMenuIds);\n\t}", "public void deleteGroup(String groupId) {\n deleteGroup(getGroup(groupId));\n }", "@Delete\n void delete(UsersEntity usersEntity);", "@Override\r\n\tpublic void deleteMenmberMode(MenmberMode menmberMode) {\n\t\tgetHibernateTemplate().delete(menmberMode);\r\n\t}", "public void removeByUserGroup(long groupId) throws SystemException {\n\t\tfor (VCal vCal : findByUserGroup(groupId)) {\n\t\t\tremove(vCal);\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n @Override\n public DeleteGroupResponse execute(final Long inRequest)\n {\n DomainGroup group = groupMapper.execute(new FindByIdRequest(\"DomainGroup\", inRequest));\n Long groupId = group.getId();\n Organization parentOrg = group.getParentOrganization();\n Long parentOrgId = group.getParentOrgId();\n\n // get set of parentOrgs\n Set<Long> parentOrgIds = new HashSet<Long>(parentOrgIdMapper.execute(parentOrgId));\n parentOrgIds.add(parentOrgId);\n\n // get set of compositeStreams ids that include this group.\n @SuppressWarnings(\"unused\")\n List<Long> containingCompositeStreamIds = getEntityManager().createQuery(\n \"SELECT sv.id FROM StreamView sv, StreamScope ss WHERE ss.id = :ssId AND \"\n + \" sv MEMBER OF ss.containingCompositeStreams\").setParameter(\"ssId\",\n group.getStreamScope().getId()).getResultList();\n\n // get everyone composite stream id and add to list of containingCompositeStreamIds.\n Long everyoneCompositeStreamId = (Long) getEntityManager().createQuery(\n \"SELECT id from StreamView where type = :type\").setParameter(\"type\", StreamView.Type.EVERYONE)\n .getSingleResult();\n containingCompositeStreamIds.add(everyoneCompositeStreamId);\n\n DeleteGroupResponse response = new DeleteGroupResponse(groupId, group.getShortName(), new Long(group\n .getEntityStreamView().getId()), new Long(group.getStreamScope().getId()), parentOrgIds,\n containingCompositeStreamIds);\n\n // delete the group hibernate should take care of following since we are deleting via entity manager.\n // Hibernate: delete from Group_Capability where domainGroupId=?\n // Hibernate: delete from Group_Task where groupId=?\n // Hibernate: delete from Group_Coordinators where DomainGroup_id=?\n // Hibernate: delete from StreamView_StreamScope where StreamView_id=?\n // Hibernate: delete from GroupFollower where followingId=? (this should be gone already).\n // Hibernate: delete from DomainGroup where id=? and version=?\n // Hibernate: delete from StreamView where id=? and version=?\n getEntityManager().remove(group);\n\n OrganizationHierarchyTraverser orgTraverser = orgTraverserBuilder.getOrganizationHierarchyTraverser();\n orgTraverser.traverseHierarchy(parentOrg);\n organizationMapper.updateOrganizationStatistics(orgTraverser);\n\n return response;\n\n }", "public Boolean deleteGroupProduct(GroupProduct sm){\n\t\tTblGroupProduct tblsm = new TblGroupProduct();\n\t\tSession session = HibernateUtils.getSessionFactory().openSession();\n\t\tTransaction tx = null;\n\t\ttry{\n\t\t\ttblsm.convertToTable(sm);\n\t\t\ttx = session.beginTransaction();\n\t\t\tsession.delete(tblsm);\n\t\t\ttx.commit();\n\t\t}catch(HibernateException e){\n\t\t\tSystem.err.println(\"ERROR IN LIST!!!!!!\");\n\t\t\tif (tx!= null) tx.rollback();\n\t\t\te.printStackTrace();\n\t\t\tsession.close();\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "@Delete({\n \"delete from A_USER_ROLE\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);", "ReturnCode deleteMenus(MmtConfig cfg);", "@Test (description = \"Delete a contact group by click Delete on Context Menu and verify toast message\",\n\t\t\tgroups = { \"functional\" })\n\n\tpublic void DeleteContactGroup_02() throws HarnessException {\n\t\tContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());\n\n\t\t// Refresh\n\t\tapp.zPageContacts.zToolbarPressButton(Button.B_REFRESH);\n\n\t\t// Delete contact group by click Delete on Context menu\n\t\tapp.zPageContacts.zListItem(Action.A_RIGHTCLICK, Button.B_DELETE, group.getName());\n\n\t\t// Verifying the toaster message\n\t\tToaster toast = app.zPageMain.zGetToaster();\n\t\tString toastMessage = toast.zGetToastMessage();\n\t\tZAssert.assertStringContains(toastMessage, \"1 contact group moved to Trash\", \"Verify toast message: Contact group Moved to Trash\");\n\t}", "public void deleteAllUsersFromGroup(String groupName) {\n try {\n conn = dao.getConnection();\n ps = conn.prepareStatement(\"DELETE FROM USERS_GROUPS WHERE GROUP_ID=?\");\n ps.setString(1, groupName);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException | SQLException e) {\n e.printStackTrace();\n }\n }", "void deleteByResourceGroup(String resourceGroupName, String dataControllerName);", "int deleteByPrimaryKey(Integer roleId);", "int deleteByPrimaryKey(Integer roleId);", "public int deleteByExample(SysRoleMenuExample example) throws SQLException {\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByExample\", example);\r\n return rows;\r\n }", "@POST\n @Path(\"DeleteAllRolePermissions/{roleName}/{gameModelId}\")\n public boolean deleteAllRolePermissions(@PathParam(\"roleName\") String roleName,\n @PathParam(\"gameModelId\") String id) {\n try {\n return this.deleteAllRolePermissions(roleFacade.findByName(roleName).getId(), id);\n } catch (WegasNoResultException ex) {\n throw WegasErrorMessage.error(\"Role \\\"\" + roleName + \"\\\" does not exists\");\n }\n }" ]
[ "0.64649487", "0.63679594", "0.6282049", "0.6162721", "0.6078608", "0.60394925", "0.5969641", "0.5961427", "0.5926724", "0.58423936", "0.5763792", "0.57360566", "0.57335216", "0.56969684", "0.5686472", "0.5672965", "0.56447846", "0.56447846", "0.559696", "0.5573369", "0.5566259", "0.5549137", "0.5527632", "0.55133706", "0.54945004", "0.54741687", "0.5463594", "0.5439615", "0.5400115", "0.53957194", "0.5394545", "0.53902215", "0.5379931", "0.5352659", "0.5351632", "0.53492826", "0.534247", "0.5342093", "0.5331922", "0.531661", "0.53102374", "0.5308968", "0.53040254", "0.5301308", "0.5286238", "0.5285498", "0.52729106", "0.5270596", "0.5264034", "0.52619284", "0.52441084", "0.5235124", "0.5218414", "0.52133924", "0.5196291", "0.51941395", "0.5191922", "0.51901686", "0.51896834", "0.5188838", "0.51868737", "0.518157", "0.51772606", "0.5171613", "0.517051", "0.51682186", "0.51677376", "0.51672226", "0.5163415", "0.51631683", "0.514209", "0.51284015", "0.5127838", "0.51254916", "0.5105513", "0.5095794", "0.50854135", "0.50709426", "0.506987", "0.5066049", "0.5055515", "0.50524694", "0.50524074", "0.5037203", "0.5020569", "0.50174934", "0.5015001", "0.50087804", "0.49979755", "0.49967122", "0.4989679", "0.49851823", "0.4979503", "0.49750692", "0.49747455", "0.49671802", "0.49667823", "0.49667823", "0.49556264", "0.49548548" ]
0.8563621
0
Constructs an object of class EnableOrcNature.
public EnableOrcNature() { /* Nothing to do */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Orc() {\n\t\tsuper(\"Orc\" , 4);\n\t\t\n\t}", "Oracion createOracion();", "public XpeDccNewContractSetupROVORowImpl() {\n }", "public abstract Anuncio creaAnuncioTematico();", "public OrGate() {\n\t\tsuper(2, 1);\n\t}", "public TutorIndustrial() {}", "public com.vodafone.global.er.decoupling.binding.request.InactivateTariffAuthorisationType createInactivateTariffAuthorisationType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.InactivateTariffAuthorisationTypeImpl();\n }", "ORGateway createORGateway();", "public XpeDccWfActionROVORowImpl() {\n }", "public Generateur() {\n }", "public abstract Anuncio creaAnuncioGeneral();", "@Override\n\tpublic AbstractOriental createOrientale() {\n\t\treturn new OrientalSN();\n\t}", "public ExpertiseEntity() {\n }", "public Produit() {\n\t\tsuper();\n\t}", "public Requisition() {\n\n }", "protected Approche() {\n }", "@java.lang.Override\n public boolean hasOrc() {\n return schemaCase_ == 5;\n }", "@Override\n\tprotected Entity createNewEntity(final Object baseObject) {\n\t\tProductAssociation productAssociation = getBean(ContextIdNames.PRODUCT_ASSOCIATION);\n\t\tproductAssociation.setGuid(new RandomGuidImpl().toString());\n\t\tproductAssociation.setCatalog(this.getImportJob().getCatalog());\n\t\treturn productAssociation;\n\t}", "public FastProvisioningEditionCapability() {\n }", "public OriDestEOImpl() {\n }", "public Odontologo() {\n }", "@java.lang.Override\n public boolean hasOrc() {\n return schemaCase_ == 5;\n }", "public MnjMfgFabinsProdLEOImpl() {\n }", "public abstract Anuncio creaAnuncioIndividualizado();", "public DetArqueoRunt () {\r\n\r\n }", "private NaturePackage() {}", "@Override\n public Productor getProductor() {\n return new ProductorImp1();\n }", "public Produit() {\n }", "public com.vodafone.global.er.decoupling.binding.request.PurchaseTariffAuthorisationType createPurchaseTariffAuthorisationType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.PurchaseTariffAuthorisationTypeImpl();\n }", "public Orbiter() {\n }", "public OVChipkaart() {\n\n }", "public Produto() {}", "protected Asignatura()\r\n\t{}", "public Implementor(){}", "public Ov_Chipkaart() {\n\t\t\n\t}", "public AETinteractions() {\r\n\t}", "public Aso() {\n\t\tName = \"Aso\";\n\t\ttartossag = 3;\n\t}", "public MARealEstateBuildingVORowImpl() {\n }", "public EsoFactoryImpl()\r\n {\r\n super();\r\n }", "ObjectRealization createObjectRealization();", "public EnsembleLettre() {\n\t\t\n\t}", "OperacionColeccion createOperacionColeccion();", "public AirAndPollen() {\n\n\t}", "public Clade() {}", "AgentPolicy build();", "public AntrianPasien() {\r\n\r\n }", "public CreateIndividualPreAction() {\n }", "public Caso_de_uso () {\n }", "protected Product() {\n\t\t\n\t}", "public PurchaseExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public InternetProductOption() {\n\t}", "public ObjectFactory() {\n\t}", "public CustomerPolicyProperties() {\n }", "public AgenteEstAleatorio() {\r\n }", "public contrustor(){\r\n\t}", "public Producto() {\r\n }", "public ObjectFactory() {\r\n\t}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public Education() {}", "ORDecomposition createORDecomposition();", "public Corso() {\n\n }", "public CuerpoCeleste() {\n\t\t// Start of user code constructor for CuerpoCeleste)\n\t\tsuper();\n\t\t// End of user code\n\t}", "public Cgg_jur_anticipo(){}", "public static IOR makeIOR(ORB paramORB) {\n/* 91 */ return (IOR)new IORImpl(paramORB);\n/* */ }", "Obligacion createObligacion();", "public Arquero(){\n this.vida = 75;\n this.danioAUnidad = 15;\n this.danioAEdificio = 10;\n this.rangoAtaque = 3;\n this.estadoAccion = new EstadoDisponible();\n }", "public Cargo(){\n super(\"Cargo\");\n intake = new WPI_TalonSRX(RobotMap.cargoIntake);\n shoot = new WPI_TalonSRX(RobotMap.cargoShoot);\n }", "public RedoCommand() {\n }", "public Estudiante() {\r\n\t\tsuper();\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "private IOferta buildOfertaEjemplo4() {\n\t\tPredicate<Compra> condicion = Predicates.alwaysTrue();\n\t\tFunction<Compra, Float> descuento = new DescuentoLlevaXPagaY(\"11-111-1111\", 3, 2);\n\t\treturn new OfertaDinero(\"Lleva 3 paga 2 en Coca-Cola\", condicion,\n\t\t\t\tdescuento);\n\t}", "public WaterEradicate() {\n }", "@Generated\n public Anotacion() {\n }", "public GetProductoSrv() {\n\t\tsuper();\n\t\tinitializer();\n\t}", "public Achterbahn() {\n }", "private IOferta buildOfertaEjemplo6() {\n\t\tPredicate<Compra> condicion = new PredicadoCupon(\"11111\");\n\n\t\tFunction<Compra, Float> descuento = Functions.compose(\n\t\t\t\tnew DescuentoFijo<>(10.0f),\n\t\t\t\tnew ExtraerTotalBruto());\n\n\t\treturn new OfertaDinero(\"$10 cupon\", condicion, descuento);\n\t}", "public DDetRetContrArtEscenicsAttTO() { }", "protected Product()\n\t{\n\t}", "public ControllerProtagonista() {\n\t}", "public Operation(){\n\t}", "public EspressoDrink(){\t\n\t}", "public AvaliacaoRisco() {\n }", "public InvoiceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "private DittaAutonoleggio(){\n \n }", "public CUClienteComplementoOV()\t{\n\n\t\t}", "public InstanciaProductoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "private ProfitPerTariffType ()\n {\n super();\n }", "public SystematicAcension_by_LiftingTechnology() {\n\n\t}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.64391947", "0.6085126", "0.5511212", "0.53932065", "0.53892946", "0.53672814", "0.5273764", "0.5253605", "0.5194801", "0.5181712", "0.5181076", "0.50568205", "0.505335", "0.50481164", "0.50294423", "0.5020734", "0.5017471", "0.5010259", "0.5008083", "0.5007941", "0.50053847", "0.50052017", "0.5001133", "0.49984133", "0.49869165", "0.49843386", "0.49784315", "0.49577788", "0.49561813", "0.4949641", "0.49438837", "0.4933139", "0.49239632", "0.49163875", "0.49065688", "0.49029672", "0.48898286", "0.48886096", "0.48819622", "0.48772743", "0.48737487", "0.48694447", "0.48646328", "0.48463196", "0.48363835", "0.4834876", "0.48337436", "0.48207277", "0.481523", "0.4809385", "0.48069888", "0.4801865", "0.47896466", "0.47879893", "0.4785709", "0.4781997", "0.47696847", "0.47695768", "0.47695768", "0.47695768", "0.4767787", "0.4766039", "0.47623172", "0.47592387", "0.4751989", "0.47491756", "0.4735911", "0.4734858", "0.4734148", "0.4733223", "0.47324356", "0.47195104", "0.47178447", "0.47163185", "0.47156322", "0.47131404", "0.47126514", "0.47069487", "0.4698301", "0.4696628", "0.46957958", "0.4693982", "0.46931368", "0.46919465", "0.46886972", "0.46878386", "0.46867418", "0.46864232", "0.468184", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824", "0.46762824" ]
0.8090398
0
/ Nothing to do
@Override public void dispose() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private stendhal() {\n\t}", "public void mo38117a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "protected void mo6255a() {\n }", "private static void cajas() {\n\t\t\n\t}", "private void m50366E() {\n }", "public void mo4359a() {\n }", "public void baocun() {\n\t\t\n\t}", "public void method_4270() {}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "private void kk12() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo12628c() {\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo6081a() {\n }", "@Override\n protected void prot() {\n }", "public final void mo91715d() {\n }", "void berechneFlaeche() {\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public void mo12930a() {\n }", "@Override\n\tpublic void processing() {\n\n\t}", "public void mo21877s() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "public void m23075a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "private final void i() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void just() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void mo115190b() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo21785J() {\n }", "public void mo21794S() {\n }", "public void mo21779D() {\n }", "public void mo21791P() {\n }", "public void mo21793R() {\n }", "public abstract void mo70713b();", "public void mo9848a() {\n }", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private Rekenhulp()\n\t{\n\t}", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "public void mo21878t() {\n }", "public void mo21825b() {\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void reset() {\n\t\t\t\t\r\n\t\t\t}", "public void mo21795T() {\n }", "public void Tyre() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}" ]
[ "0.65895355", "0.6489548", "0.64344335", "0.64179164", "0.6362693", "0.63369465", "0.628753", "0.6257722", "0.62229055", "0.62229055", "0.62133396", "0.6181253", "0.6178429", "0.6171697", "0.6160862", "0.6153748", "0.613395", "0.6132096", "0.61125517", "0.6109009", "0.6109009", "0.6082508", "0.6068519", "0.606461", "0.6060046", "0.60437983", "0.6029201", "0.60273075", "0.60143745", "0.60099995", "0.6004516", "0.5965015", "0.5964335", "0.5937096", "0.5933836", "0.593083", "0.5918702", "0.5918144", "0.5915042", "0.5915042", "0.5915042", "0.5915042", "0.5915042", "0.5915042", "0.5915042", "0.5909291", "0.5895109", "0.5892806", "0.5889468", "0.588695", "0.5880677", "0.5849586", "0.58280534", "0.58147675", "0.58123326", "0.5812317", "0.581202", "0.5808875", "0.57974803", "0.57872677", "0.5783918", "0.57814336", "0.57814336", "0.57772344", "0.57738036", "0.57703686", "0.5766732", "0.5764971", "0.57615644", "0.5760758", "0.57607406", "0.5750065", "0.57490486", "0.5747953", "0.5746788", "0.57459855", "0.5740746", "0.5736878", "0.573513", "0.5731542", "0.5714711", "0.5710047", "0.5710047", "0.5710047", "0.5710047", "0.56976324", "0.56967056", "0.569657", "0.56948996", "0.569172", "0.56915087", "0.56911945", "0.56911445", "0.5690425", "0.56893134", "0.5682191", "0.56797063", "0.56778395", "0.56738466", "0.5667962", "0.5667962" ]
0.0
-1
/ Nothing to do
@Override public void init(final IWorkbenchWindow window) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private stendhal() {\n\t}", "public void mo38117a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "protected void mo6255a() {\n }", "private static void cajas() {\n\t\t\n\t}", "private void m50366E() {\n }", "public void mo4359a() {\n }", "public void baocun() {\n\t\t\n\t}", "public void method_4270() {}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "private void kk12() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo12628c() {\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo6081a() {\n }", "@Override\n protected void prot() {\n }", "public final void mo91715d() {\n }", "void berechneFlaeche() {\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void processing() {\n\n\t}", "public void mo12930a() {\n }", "public void mo21877s() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "public void m23075a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "private final void i() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void just() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "public void mo115190b() {\n }", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo21785J() {\n }", "public void mo21794S() {\n }", "public void mo21779D() {\n }", "public void mo21791P() {\n }", "public void mo21793R() {\n }", "public abstract void mo70713b();", "public void mo9848a() {\n }", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private Rekenhulp()\n\t{\n\t}", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "public void mo21878t() {\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void mo21825b() {\n }", "@Override\r\n\t\t\tpublic void reset() {\n\t\t\t\t\r\n\t\t\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo21795T() {\n }", "public void Tyre() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}" ]
[ "0.6590924", "0.64903784", "0.6434677", "0.6417911", "0.6363197", "0.63366836", "0.628781", "0.62571955", "0.62234044", "0.62234044", "0.6213766", "0.6181998", "0.61782545", "0.61718345", "0.6160147", "0.6154202", "0.6134151", "0.6132306", "0.61133564", "0.61095804", "0.61095804", "0.60822", "0.6068581", "0.6063462", "0.6059809", "0.6044079", "0.6029666", "0.6027087", "0.60136086", "0.6009939", "0.6004536", "0.59644896", "0.5964277", "0.59380424", "0.5933472", "0.5930633", "0.5919487", "0.59177476", "0.5915717", "0.5915717", "0.5915717", "0.5915717", "0.5915717", "0.5915717", "0.5915717", "0.5909296", "0.5895355", "0.5893893", "0.58900046", "0.5887254", "0.5880991", "0.58495915", "0.5827492", "0.5814991", "0.5812503", "0.581234", "0.5811181", "0.5808968", "0.5799103", "0.57876205", "0.57838976", "0.5781363", "0.5781363", "0.57780564", "0.57733834", "0.5771962", "0.57670355", "0.57642794", "0.57613826", "0.57611704", "0.57602", "0.5749973", "0.5749845", "0.5747733", "0.5746388", "0.5745747", "0.5739999", "0.5736219", "0.5734408", "0.57311517", "0.5715221", "0.57114106", "0.57114106", "0.57114106", "0.57114106", "0.56990683", "0.5696876", "0.5696731", "0.56959534", "0.5691307", "0.5691254", "0.56911933", "0.5690892", "0.5690365", "0.5690311", "0.5681361", "0.56794477", "0.56768733", "0.5674611", "0.5667631", "0.5667631" ]
0.0
-1
Log.d("TAG1", "onPageScrolled() called with: position = [" + position + "], positionOffset = [" + positionOffset + "], positionOffsetPixels = [" + positionOffsetPixels + "]");
@Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n Log.d(TAG, \"onPageScrolled: position=\"+position+\",positionOffset=\"+positionOffset+\",positionOffsetPixels=\"+positionOffsetPixels);\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n System.out.println(\"onPageScrolled is called\");\n\n\n }", "@Override\r\n\tpublic void onPageScrolled(int position, float positionOffset,\r\n\t\t\tint positionOffsetPixels) {\n\r\n\t}", "@Override\r\n\t\t\tpublic void onPageScrolled(int position, float positionOffset,\r\n\t\t\t\t\tint positionOffsetPixels) {\n\r\n\t\t\t}", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int position,\n float positionOffset, int positionOffsetPixels) {\n }", "@Override\r\n\t\tpublic void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\t\t}", "@Override\r\n\t\tpublic void onPageScrolled(int position, float positionOffset,\r\n\t\t\t\tint positionOffsetPixels) {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t}", "@Override\n\t\t\tpublic void onPageScrolled(int position, float positionOffset,\n\t\t\t\t\tint positionOffsetPixels) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onPageScrolled(int position,\n\t\t\t\t\t\t\tfloat positionOffset, int positionOffsetPixels) {\n\n\t\t\t\t\t}", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n // Code goes here\n }", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n // Code goes here\n }", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n // Code goes here\n }", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\n\t}", "@Override\r\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n\t}", "@Override\r\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t}", "@Override\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t}", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }", "@Override\r\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n\t\t\t}", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\tLog.i(\"\", \"Enter hereeeeeeeeeeeeeeeeeeeee(onPageScrolled!!!\");\n\t\t\t}", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n \n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n \n }", "@Override\n\t\t\tpublic void onPageScrolled(int position, float positionOffset,\n\t\t\t\t\tint positionOffsetPixels)\n\t\t\t{\n\n\t\t\t}", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t}", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }", "@Override\r\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n }", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\n\t\t}", "public void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }", "@Override\r\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2)\r\n\t\t{\n\t\t\t\r\n\t\t}", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t}", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t}", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t}", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t}", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t}", "@Override\n\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2)\n\t\t{\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t\t}", "public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t\t}", "public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n\t\t}", "@Override\r\n public void onPageScrolled(int row, int column, float rowOffset,\r\n float columnOffset, int rowOffsetPixels,\r\n int columnOffsetPixels) {\n mPageIndicator.onPageScrolled(row, column, rowOffset,\r\n columnOffset, rowOffsetPixels, columnOffsetPixels);\r\n }", "@Override\r\n\tpublic void onPageScrollStateChanged(int position) {\n\t\tLog.e(TAG, \"onPageScrollStateChanged=\" + position);\r\n\t}", "@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n if (mOnPageChangeListener != null) {\n mOnPageChangeListener.onPageScrolled(FakePositionHelper.getFakeFromReal(InfiniteViewPager.this, position), positionOffset, positionOffsetPixels);\n }\n }", "@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\tcurrentPosition2 = arg0;\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tpublic void onPageScrolled(int position, float arg1, int arg2) {\n\r\n\t\tif (position == mFragments.size()) {\r\n\r\n\t\t}\r\n\t\t// Toast.makeText(getApplicationContext(),\r\n\t\t// \"End of Categories\"+position, Toast.LENGTH_SHORT).show();\r\n\t}", "@Override\n public void onPageScrollStateChanged(int state) {\n Log.d(TAG, \"onPageScrollStateChanged: \"+state);\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\r\n public void onPageScrollStateChanged(int arg0) {\n\r\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }", "@Override\n public void onPageScrollStateChanged(int state)\n {\n\n }", "@Override\n public void onPageScrollStateChanged(int arg0) {\n }" ]
[ "0.8918307", "0.85791904", "0.85403544", "0.84533006", "0.8436696", "0.8399442", "0.8399442", "0.83948517", "0.8369267", "0.83467406", "0.8336965", "0.83356017", "0.8324185", "0.83166265", "0.83166265", "0.83166265", "0.8302138", "0.8302138", "0.8302138", "0.8302138", "0.8302138", "0.8302138", "0.8302138", "0.83007205", "0.83007205", "0.8282393", "0.8282393", "0.8282393", "0.8280732", "0.8280732", "0.8280732", "0.8280732", "0.8280732", "0.8272465", "0.8271325", "0.8265318", "0.8265318", "0.82625395", "0.82579", "0.82579", "0.8236392", "0.82326216", "0.82326216", "0.82326216", "0.82326216", "0.82326216", "0.82326216", "0.82326216", "0.82326216", "0.82326216", "0.820651", "0.8194814", "0.81785935", "0.81760776", "0.81685877", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.8167893", "0.81512135", "0.8150804", "0.81369394", "0.8118537", "0.8115789", "0.8115789", "0.8115789", "0.8115789", "0.8115789", "0.809658", "0.80816203", "0.80816203", "0.80816203", "0.80816203", "0.7842193", "0.77627724", "0.7652113", "0.7631886", "0.7613324", "0.76037776", "0.75510776", "0.7450409", "0.74417925", "0.72590554", "0.7246851", "0.7246851", "0.7246851", "0.7246851", "0.7246851", "0.7246851", "0.7246851", "0.7246851", "0.7246851", "0.7242505", "0.72364026" ]
0.8238574
40
Processes requests for both HTTP GET and POST methods.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); Calculadora calculadora = new Calculadora(); String secue = request.getParameter("secuencia30"); String secuene = request.getParameter("7secuenega"); String press = request.getParameter("10prestecla"); String nombre = request.getParameter("nombre"); int numpares = Integer.parseInt(request.getParameter("1par")); int produnum1 = Integer.parseInt(request.getParameter("2product1")); int produnum2 = Integer.parseInt(request.getParameter("2product2")); int may3_1 = Integer.parseInt(request.getParameter("3may1")); int may3_2 = Integer.parseInt(request.getParameter("3may2")); int may4_1 = Integer.parseInt(request.getParameter("4may1")); int may4_2 = Integer.parseInt(request.getParameter("4may2")); int may4_3 = Integer.parseInt(request.getParameter("4may3")); int tablamult = Integer.parseInt(request.getParameter("5tablamult")); int prosum8_1 = Integer.parseInt(request.getParameter("8prosum1")); int prosum8_2 = Integer.parseInt(request.getParameter("8prosum1")); int div9_1 = Integer.parseInt(request.getParameter("9div1")); int div9_2 = Integer.parseInt(request.getParameter("9div2")); String[] secuencia = secue.split(" "); String[] secuencianega = secuene.split(" "); String[] press_10_dat = press.split(" "); try (PrintWriter out = response.getWriter()) { out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<link href='https://fonts.googleapis.com/css?family=Nunito' rel='stylesheet'>"); out.println("<link rel='stylesheet' href='estilos.css' />"); out.println("<title>Resultados</title>"); out.println("</head>"); out.println("<body>"); out.println("<div id='formulario'>"); out.println("<div id='titulo'>Bienvenido " + nombre + "</div>"); out.println("<form name='form'>"); out.println("<h2>1. Numero par o impar</h2>"); out.println(calculadora.pares(numpares)); out.println("<h2>2. Producto dos numeros</h2>"); out.println(calculadora.produs(produnum1, produnum2)); out.println("<h2>3. Numero mayor(Dos Numeros)</h2>"); out.println(calculadora.nummay(may3_1, may3_2)); out.println("<h2>4. Numero mayor(Tres Numeros)</h2>"); out.println(calculadora.nummay3(may4_1, may4_2, may4_3)); out.println("<h2>5. Tabla Multiplicar</h2>"); out.println(calculadora.tablamult(tablamult)); out.println("<h2>6. Secuencia 30 Numeros - Suma y Producto</h2>"); out.println(calculadora.produsum(secuencia)); out.println("<h2>7. Sumar hasta negativo encontrado</h2>"); out.println(calculadora.septima_opcion_negativo(secuencianega)); out.println("<h2>8. Producto mediante sumas</h2>"); out.println(calculadora.prosum(prosum8_1, prosum8_2)); out.println("<h2>9. Division Mediante Restas</h2>"); out.println(calculadora.divirest(div9_1, div9_2)); out.println("<h2>10. Producto hasta presionar tecla</h2>"); out.println(calculadora.decima_opcion_producto(press_10_dat)); out.println("</form>"); out.println("<div id='creditos'></div>"); out.println("</div>"); out.println("</body>"); out.println("</html>"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }" ]
[ "0.7003337", "0.66585124", "0.66023004", "0.65085584", "0.6446528", "0.6441425", "0.64401287", "0.64316165", "0.64271754", "0.64235586", "0.64235586", "0.6418961", "0.6418961", "0.6418961", "0.6417602", "0.64138156", "0.64138156", "0.6399609", "0.63932025", "0.63932025", "0.63919455", "0.6391227", "0.6391227", "0.63895965", "0.63895965", "0.63895965", "0.63895965", "0.63882446", "0.63882446", "0.63798195", "0.637763", "0.6377603", "0.63762355", "0.63754046", "0.6370034", "0.63621527", "0.63621527", "0.6360786", "0.6354855", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545", "0.63542545" ]
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.7328923", "0.71375936", "0.7116379", "0.7105418", "0.7100661", "0.7022967", "0.7016274", "0.69642067", "0.6889007", "0.6783552", "0.67732364", "0.6746842", "0.66676646", "0.6558366", "0.6557279", "0.6525134", "0.6524604", "0.6524604", "0.6524604", "0.6522886", "0.65200865", "0.6515483", "0.65122306", "0.6512207", "0.6491502", "0.6481304", "0.6477025", "0.64721435", "0.647172", "0.64694464", "0.6456923", "0.6451681", "0.6451681", "0.6451681", "0.64493614", "0.64493614", "0.64377946", "0.64370346", "0.6433898", "0.64243734", "0.64221543", "0.6420086", "0.6420086", "0.6420086", "0.6407118", "0.64038825", "0.64038825", "0.6396014", "0.6396012", "0.63545245", "0.63332963", "0.6323947", "0.62961334", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.6288465", "0.62795925", "0.6271685", "0.6271685", "0.6270769", "0.62610644", "0.6254298", "0.625112", "0.62265104", "0.6213978", "0.6213913", "0.62123287", "0.62083256", "0.6201531", "0.6177241", "0.6177241", "0.6177241", "0.6177241", "0.6177241", "0.6177241", "0.6177241", "0.6164035", "0.6159936", "0.61476284", "0.61463875", "0.61463875", "0.614518", "0.61415166", "0.6137055", "0.6131772", "0.6130102", "0.61240584", "0.611795", "0.6117597", "0.61067724", "0.60994065", "0.60982865", "0.6097271" ]
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }", "@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }" ]
[ "0.8763002", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.8731796", "0.86987144", "0.86987144", "0.86987144", "0.86987144", "0.86987144", "0.86987144", "0.85310906", "0.85310906", "0.8527943", "0.8527943", "0.8527943", "0.85270804", "0.85270804", "0.85270804", "0.85270804", "0.85270804", "0.85270804", "0.8516814", "0.8512057", "0.8510937", "0.8510138", "0.849624", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333", "0.8492333" ]
0.0
-1
/SharedPreferences SPreferences = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences.Editor editorPreferences = SPreferences.edit();
public void btnNextClicked(){ fname = etFName.getText().toString(); lname = etLName.getText().toString(); country = spcountry.getSelectedItem().toString(); description = etDescription.getText().toString(); phone = etPhone.getText().toString(); controller.setData(fname,lname,country,description,phone); controller.putStringData(this); /*editorPreferences.putString("First Name: ",user.getFirstName()); editorPreferences.putString("Last Name: ",user.getLastName()); editorPreferences.putString("Country : ",user.getCountry()); editorPreferences.putString("Description : ",user.getDescription()); editorPreferences.putString("Phone Number : ",user.getPhone()); editorPreferences.apply();*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void makePref(){\n //Creates a shared pref called MyPref and 0-> MODE_PRIVATE\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //so the pref can be edit\n edit = sharedPref.edit();\n}", "SharedPreferences mo117960a();", "public SharedPreferences getPrefs() { return this.prefs; }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.pref);\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n //onSharedPreferenceChanged(sharedPreferences, getString(R.string.language_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.difficulty_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.word_category_key));\n }", "private static SharedPreferences getSharedPreference(Context context){\n return PreferenceManager.getDefaultSharedPreferences(context);\n }", "private void readSharedPreferences() {\n SharedPreferences sharedPref = getActivity().getSharedPreferences(SETTINGS_FILE_KEY, MODE_PRIVATE);\n currentDeviceAddress = sharedPref.getString(SETTINGS_CURRENT_DEVICE_ADDRESS, \"\");\n currentDeviceName = sharedPref.getString(SETTINGS_CURRENT_DEVICE_NAME, \"\");\n currentFilenamePrefix = sharedPref.getString(SETTINGS_CURRENT_FILENAME_PREFIX, \"\");\n currentSubjectName = sharedPref.getString(SETTINGS_SUBJECT_NAME, \"\");\n currentShoes = sharedPref.getString(SETTINGS_SHOES, \"\");\n currentTerrain = sharedPref.getString(SETTINGS_TERRAIN, \"\");\n }", "private SharedPreferences getSharedPrefs() {\n return Freelancer.getContext().getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "private void savePrefsData() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\"myPrefs\", MODE_PRIVATE);\n SharedPreferences.Editor editor = pref.edit();\n editor.putBoolean(\"isIntroOpnend\", true);\n editor.commit();\n }", "@SuppressLint(\"CommitPrefEdits\")\n public HaloPreferencesStorageEditor(SharedPreferences preferences) {\n mPreferencesEditor = preferences.edit();\n }", "@SuppressLint(\"CommitPrefEdits\")\n @Override\n public void onLoadFinished(Loader<SharedPreferences> loader,\n SharedPreferences prefs) {\n }", "private void savePreferences() {\n SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(\" \", \"\");\n\n SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0);\n SharedPreferences.Editor editer = sharedPref.edit();\n editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr);\n editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr);\n editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr);\n editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr);\n\n // The commit runs faster.\n editer.apply();\n\n // Run this every time we're building a query.\n SharedPrefStatic.buildUriQuery();\n SharedPrefStatic.mEditIntentSaved = true;\n }", "private static SharedPreferences getSharedPreferences(Context context) {\n return PreferenceManager.getDefaultSharedPreferences(context);\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n String aaString = sharedPreferences.getString(getString(R.string.pref_antalAktier_key), getString(R.string.pref_antalAktier_default));\n// float aaFloat = Float.parseFloat(aaString);\n editTextAntalAktier.setText(aaString);\n\n String kk = sharedPreferences.getString(getString(R.string.pref_koebskurs_key), getString(R.string.pref_koebskurs__default));\n editTextKoebskurs.setText(kk);\n\n String k = sharedPreferences.getString(getString(R.string.pref_kurtage_key), getString(R.string.pref_kurtage_default));\n editTextKurtage.setText(k);\n\n// float minSize = Float.parseFloat(sharedPreferences.getString(getString(R.string.pref_size_key),\n// getString(R.string.pref_size_default)));\n// mVisualizerView.setMinSizeScale(minSize);\n\n // Register the listener\n sharedPreferences.registerOnSharedPreferenceChangeListener(this);\n }", "private void getPreferences() {\n Constants constants = new Constants();\n android.content.SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n\n serverUrl = sharedPreferences.getString(\"LedgerLinkBaseUrl\", constants.DEFAULTURL);\n IsEditing = SharedPrefs.readSharedPreferences(getActivity(), \"IsEditing\", \"0\");\n tTrainerId = SharedPrefs.readSharedPreferences(getActivity(), \"ttrainerId\", \"-1\");\n vslaId = SharedPrefs.readSharedPreferences(getActivity(), \"vslaId\", \"-1\");\n\n vslaName = DataHolder.getInstance().getVslaName();\n representativeName = DataHolder.getInstance().getGroupRepresentativeName();\n representativePost = DataHolder.getInstance().getGroupRepresentativePost();\n repPhoneNumber = DataHolder.getInstance().getGroupRepresentativePhoneNumber();\n grpBankAccount = DataHolder.getInstance().getGroupBankAccount();\n physAddress = DataHolder.getInstance().getPhysicalAddress();\n regionName = DataHolder.getInstance().getRegionName();\n grpPhoneNumber = DataHolder.getInstance().getGroupPhoneNumber();\n grpBankAccount = DataHolder.getInstance().getGroupBankAccount();\n locCoordinates = DataHolder.getInstance().getLocationCoordinates();\n grpSupportType = DataHolder.getInstance().getSupportTrainingType();\n numberOfCycles = DataHolder.getInstance().getNumberOfCycles();\n }", "private static SharedPreferences.Editor getEditor(Context context) {\n SharedPreferences preferences = getSharedPreferences(context);\n return preferences.edit();\n }", "public void savePreferences(SharedPreferences preferences){\r\n\t\tSharedPreferences.Editor editor = preferences.edit();\r\n editor.putBoolean(\"initialSetupped\", initialSetuped);\r\n editor.putString(\"username\", userName);\r\n editor.putString(\"useremail\", userEmail);\r\n editor.putString(\"recipientemail\", recipientEmail);\r\n editor.putBoolean(\"option\", option.isPound());\r\n\r\n // Commit the edits!\r\n editor.commit();\r\n\t}", "private SharedPreferences GetPreferences( Context context )\n\t{\n\t\treturn context.getSharedPreferences( CACHE_NAME, Context.MODE_PRIVATE );\n\t}", "private static SharedPreferences getSharedPreferences() {\n Context ctx = AppUtils.getAppContext();\n return ctx.getSharedPreferences(\"pref_user_session_data\", Context.MODE_PRIVATE);\n }", "@Api(1.0)\n @NonNull\n private SharedPreferences getSharedPreferences() {\n return mContext.getSharedPreferences(mPreferencesId, Context.MODE_PRIVATE);\n }", "private void loadPreferences() {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n boolean lm = sp.getBoolean(getString(R.string.live_match), true);\n boolean ls = sp.getBoolean(getString(R.string.live_score), true);\n\n if(lm) live_match.setChecked(true);\n else live_match.setChecked(false);\n\n if(ls) live_score.setChecked(true);\n else live_score.setChecked(false);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t\tthis.prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t/*\n\t\t * Each app has its own shared preferences available to all components\n\t\t * of the app and this loads the default preferences that are saved on\n\t\t * the phone\n\t\t */\n\t\tthis.prefs.registerOnSharedPreferenceChangeListener(this);\n\t\t/*\n\t\t * Each user can change preferences. So this listener is a mechanism to\n\t\t * notify this activity that the old values are stale\n\t\t */\n\t}", "private static SharedPreferences getSharedPreferences(Context context) {\n return context.getSharedPreferences(SMILE_PREFERENCES, Context.MODE_PRIVATE);\n }", "@Override\r\n public void onCreate(Bundle savedInstanceState) { \t\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.settings); \r\n String oldtitle = (String) getTitle();\r\n setTitle(oldtitle + \" > Settings\");\r\n \r\n //Load the settings\r\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\r\n String liveid = settings.getString(\"liveusername\", \"\");\r\n String password = settings.getString(\"livepassword\", \"\");\r\n String saved_livedownloaddp = settings.getString(\"livedownloaddp\", \"\");\r\n String saved_liveignorestockdp = settings.getString(\"liveignorestockdp\", \"\");\r\n\r\n \teLiveID = ((TextView)findViewById(R.id.editLiveID));\r\n \teLiveID.setText(liveid); \t\r\n \tePassword = ((TextView)findViewById(R.id.editPassword));\r\n \tePassword.setText(password); \r\n \t\r\n \tliveremember = ((CheckBox)findViewById(R.id.checkRememberlive));\r\n \th_livedownloaddp = ((CheckBox)findViewById(R.id.checkDownloadDP));\r\n \th_liveignorestockdp = ((CheckBox)findViewById(R.id.checkIgnoreStockDP));\r\n \t\r\n \tif(liveid.length() > 0 || password.length() > 0)\r\n \t\tliveremember.setChecked(true);\r\n \t\r\n \tif(saved_livedownloaddp.equals(\"true\")) {\r\n \t\th_livedownloaddp.setChecked(true);\r\n \t}\r\n\r\n \tif(saved_liveignorestockdp.equals(\"true\")) {\r\n \t\th_liveignorestockdp.setChecked(true);\r\n \t}\r\n \t\r\n \tButton btnSave = (Button)findViewById(R.id.btnSave);\r\n btnSave.setOnClickListener(btnSaveOnClick);\r\n \r\n Button btnCancel = (Button)findViewById(R.id.btnDiscard);\r\n btnCancel.setOnClickListener(btnCancelOnClick);\r\n }", "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "public void saveData(){\n SharedPreferences sharedPreferences = getSharedPreferences(\"SHARED_PREFS\",MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"email_pref\",email.getText().toString());\n editor.putString(\"password_pref\",uPassword.getText().toString());\n editor.apply();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.preferences);\n\n SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext());\n\n //String ip = SP.getString(\"ip\", \"NULL\");\n // Config.ip = SP.getString(\"ip\", \"NULL\");\n // Log.e(\"IP\",Config.ip );\n String language = SP.getString(\"language\",\"NULL\");\n // Toast.makeText(getApplicationContext(),Config.ip,Toast.LENGTH_SHORT).show();\n //Toast.makeText(getApplicationContext(),language,Toast.LENGTH_SHORT).show();\n }", "private void savePreferences(){\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putInt(\"p1Count\", pOneCounter);\n editor.putInt(\"p2Count\", pTwoCounter);\n editor.putInt(\"pAICount\", pAICounter);\n editor.putInt(\"tieCount\", tieCounter);\n\n editor.commit();\n }", "@Override\n public void onPause() {\n \t\t//Save settings Enabled, Alarm Hour, Alarm Minute\n SharedPreferences settings = getSharedPreferences(MainActivity.PREFS_NAME, 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putBoolean(MainActivity.ALARM_ENABLED, AlarmEnabled);\n editor.putInt(MainActivity.SNOOZE_MINUTE, SnoozeMin);\n \n //Commit the edits\n editor.commit();\n \n super.onPause();\n }", "private void setPreferences(Preferences preferences) {\n this.preferences = preferences;\n }", "public void shared() {\n\n String Email = editTextEmail.getText().toString();\n String Password = editTextPassword.getText().toString();\n String username = userstring;\n\n SharedPreferences sharedlog = getSharedPreferences(\"usernamelast\" , MODE_PRIVATE);\n SharedPreferences.Editor editorlogin = sharedlog.edit();\n editorlogin.putString(\"usernamelast\", username);\n editorlogin.apply();\n\n SharedPreferences sharedPref = getSharedPreferences(\"email\", MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"email\", Email);\n editor.apply();\n //Los estados los podemos setear en la siguiente actividad\n SharedPreferences sharedPref2 = getSharedPreferences(\"password\", MODE_PRIVATE);\n SharedPreferences.Editor editor2 = sharedPref2.edit();\n editor2.putString(\"password\", Password);\n editor2.apply();\n\n\n }", "public static SharedPreferences.Editor getSharedPrefsEditor() {\n return PreferencesUtils.getSharedPrefs().edit();\n }", "public void writeEncounterNumPreferences(long encounterNum){\n mSharedPreference = mContext.getSharedPreferences(mContext.getString(\n R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=mSharedPreference.edit();\n editor.putLong(mContext.getString(R.string.encounter),encounterNum);\n editor.commit();\n}", "private void savePreferences() {\n SharedPreferences sp = getSharedPreferences(MY_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n\n editor.putInt(\"entreeIndex\", spEntree.getSelectedItemPosition());\n editor.putInt(\"drinkIndex\", spDrink.getSelectedItemPosition());\n editor.putInt(\"dessertIndex\", spDessert.getSelectedItemPosition());\n\n editor.apply();\n }", "private void LoadSavedPreferences() {\n\t\tString value;\n\t\tSharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\t// tab 3 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tempSzad\", \"22\");\n\t\tettempSzad_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPmaxdop\", \"70\");\n\t\tettempPmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempZmaxdop\", \"22\");\n\t\tettempZmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPumpaON\", \"50\");\n\t\tettempPumpaON_.setText(value);\n\n\t\t// tab 1 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tv1\", \"20.20\");\n\t\ttvS1.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv2\", \"44.22\");\n\t\ttvS2.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv3\", \"19.22\");\n\t\ttvS3.setText(value);\n\t}", "public void savingPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n\n //tao doi tuong editer\n SharedPreferences.Editor editor = sharedPreferences.edit();\n String user = txtUserName.getText().toString();\n String pass = txtPassWord.getText().toString();\n\n boolean bchk = chkSave.isChecked();\n\n\n if(!bchk)\n {\n //xoa du lieu luu truoc do\n editor.clear();\n }\n else\n {\n editor.putString(\"user\",user);\n editor.putString(\"pass\",pass);\n editor.putBoolean(\"checked\",bchk);\n }\n\n editor.commit();\n\n\n }", "static synchronized SharedPreferences m45630a(Context context) {\n synchronized (C7529d.class) {\n if (Build.VERSION.SDK_INT >= 11) {\n f31839a = context.getSharedPreferences(\".tpush_mta\", 4);\n } else {\n f31839a = context.getSharedPreferences(\".tpush_mta\", 0);\n }\n if (f31839a == null) {\n f31839a = PreferenceManager.getDefaultSharedPreferences(context);\n }\n return f31839a;\n }\n }", "private void resetSharedPreferences(){\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(getString(R.string.pref_genre_key), getString(R.string.pref_genre_any_value));\n editor.putString(getString(R.string.pref_earliest_year_key), getString(R.string.pref_earliest_year_default));\n editor.putString(getString(R.string.pref_latest_year_key), getString(R.string.pref_latest_year_default));\n // Commit the edits\n editor.apply();\n }", "private SharedPreferences m4028a() {\n SharedPreferences sharedPreferences;\n synchronized (Preferences.class) {\n if (this.f5334b == null) {\n this.f5334b = this.f5333a.getSharedPreferences(\"androidx.work.util.preferences\", 0);\n }\n sharedPreferences = this.f5334b;\n }\n return sharedPreferences;\n }", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "public void restoringPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n //lay gia tri checkbook, k co mac dinh la false\n boolean bchk = sharedPreferences.getBoolean(\"checked\",false);\n if(bchk)\n {\n //lay user, pass, neu k co mac dinh gia tri la rong\n String user = sharedPreferences.getString(\"user\",\"\");\n String pass = sharedPreferences.getString(\"pass\",\"\");\n txtUserName.setText(\"user\");\n txtPassWord.setText(\"pass\");\n }\n\n chkSave.setChecked(bchk);\n }", "private void restorePreferences(){\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n\n pOneCounter = prefs.getInt(\"p1Count\",0);\n pTwoCounter = prefs.getInt(\"p2Count\",0);\n pAICounter = prefs.getInt(\"pAICount\",0);\n tieCounter = prefs.getInt(\"tieCount\",0);\n\n }", "public void savingVariablesWebConfig(){\n SharedPreferences prefs = getSharedPreferences(Constants.PREFERENCES_NAME, Context.MODE_PRIVATE);\n //Save data of user in preferences\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_ACCEPTED, \"3\");\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_VISIBLE, \"10\");\n editor.putString(Constants.PREF_VALUE_MAX_TIME_ORDERS, \"15\");\n editor.commit();\n }", "public SharedPreferences prefs() {\n\n SharedPreferences prefs = context.getSharedPreferences(APP_IDS_PREFS_NAME, Context.MODE_PRIVATE); // Private because it can still be accessed from other apps with the same User ID\n return prefs;\n }", "@Override\n\tprotected void onPause() {\n\t\tSharedPreferences.Editor editor = myprefs.edit();\n\t\teditor.putString(\"userN\", userName);\n\t\teditor.putString(\"name\",person_name);\n\t\teditor.commit();\n\t\tsuper.onPause();\n\t}", "private static SharedPreferences getSharedPrefs(final Context context) {\n final String prefsName = context.getString(R.string.sharedprefs_name);\n return context.getSharedPreferences(prefsName, Context.MODE_PRIVATE);\n }", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "private void getPrefs() {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(getBaseContext());\n \n int size = prefs.getInt(\"textsizePref\", 20);\n int color = Integer.valueOf(prefs.getString(\"textcolorPref\", \"7f070006\"),16);\n int bakcolor = Integer.valueOf(prefs.getString(\"backgroundcolorPref\", \"1\"));\n int font = Integer.valueOf(prefs.getString(\"fontPref\", \"1\"));\n mQuoteTxt.setTextColor(getResources().getColor(color));\n \n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n Editor editor = sp.edit();\n switch (bakcolor) {\n case 1: \t\n \tmScrollview.setBackgroundColor(getResources().getColor(R.color.white));\n \tif (color == 1) {\n \t\tmQuoteTxt.setTextColor(getResources().getColor(R.color.black));\n \t\teditor.putString(\"textcolorPref\", \"2\");\n \t} \t\t\n \tmHeader.setTextColor(getResources().getColor(R.color.black));\n \tbreak;\n case 2:\n \tmScrollview.setBackgroundColor(getResources().getColor(R.color.black));\n \tif (color == 2) {\n \t\tmQuoteTxt.setTextColor(getResources().getColor(R.color.white));\n \t\teditor.putString(\"textcolorPref\", \"1\");\n \t} \t\t\n \tmHeader.setTextColor(getResources().getColor(R.color.white));\n break;\n } \n editor.commit();\n switch (font) {\n case 1:\n \tmQuoteTxt.setTypeface(Typeface.DEFAULT);\n \tbreak;\n case 2:\n \tmQuoteTxt.setTypeface(Typeface.SANS_SERIF);\n \tbreak;\n case 3:\n \tmQuoteTxt.setTypeface(Typeface.SERIF);\n \tbreak;\n case 4:\n \tmQuoteTxt.setTypeface(Typeface.MONOSPACE);\n \tbreak;\n }\n mQuoteTxt.setTextSize((float) size);\n \n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tmWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);\n\t\tsp = getSharedPreferences(Constants.PREFERENCES_NAME,\n\t\t\t\tContext.MODE_PRIVATE);\n\t}", "public void saveDataToSharedPreference(View view) {\n email = emailEditText.getText().toString();\n name = nameEditText.getText().toString();\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n editor.putString(\"name\",name);\n editor.putString(\"email\",email);\n editor.apply();\n\n Toast.makeText(context, \"Data saved successfully into SharedPreferences!\", Toast.LENGTH_SHORT).show();\n clearText();\n }", "public static void initPrefs(){\n prefs = context.getSharedPreferences(PREFS_FILE, 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.remove(Constants.IS_FIRST_RUN);\n editor.putBoolean(Constants.ACTIVITY_SENSE_SETTING,false);\n editor.commit();\n }", "private SharedPreferencesManager(){}", "public void saveSettings(View v) {\n SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); // get shared preferences\n SharedPreferences.Editor editor = sharedPref.edit();\n int seconds_rec = Integer.parseInt(time_recording.getText().toString());\n int notif_occ = Integer.parseInt(time_occurance.getText().toString());\n\n editor.putInt(getString(R.string.time_recording_seconds), seconds_rec); // save values to a sp\n editor.putInt(getString(R.string.time_notification_minutes), notif_occ);\n editor.commit(); // commit the differences\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "private void loadSettings(){\n SharedPreferences sharedPreferences = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);\n notificationSwtich = sharedPreferences.getBoolean(SWITCH, false);\n reminderOnOff.setChecked(notificationSwtich);\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n //set the driver name and track variables using methods below, which are also called from onSharedPreferencesChanged\n setDriver(sharedPreferences);\n setTrack(sharedPreferences);\n }", "private final synchronized void writePreferencesImpl() {\n if ( LOGD ) { Log.d( TAG, \"writePreferencesImpl \" + mPrefFile + \" \" + mPrefKey ); }\n\n mForcePreferenceWrite = false;\n\n SharedPreferences pref =\n Utilities.getContext().getSharedPreferences( mPrefFile, Context.MODE_PRIVATE );\n SharedPreferences.Editor edit = pref.edit();\n edit.putString( mPrefKey, getSerializedString() );\n Utilities.commitNoCrash(edit);\n }", "private void initSharedPreference(){\n mSharedPreferences = Configuration.getContext().getSharedPreferences(\"SessionManager\", Context.MODE_PRIVATE) ;\n }", "private void setPreferences(String sw, boolean checked) {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(sw,checked);\n editor.apply();\n\n }", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.framework_setting);\n SharedPreferences sharedPreferences = this.getPreferenceManager().getSharedPreferences();\n String preference_smartbar_default_type = getResources().getString(R.string.preference_smartbar_default_type);\n final ListPreference listPreference = (ListPreference) findPreference(preference_smartbar_default_type);\n //修改Smartbar类型\n String smart_type = sharedPreferences.getString(preference_smartbar_default_type, null);\n int index = listPreference.findIndexOfValue(String.valueOf(smart_type));\n if (index != -1) {\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n }\n if (listPreference != null) {\n listPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object newValue) {\n int index = listPreference.findIndexOfValue(newValue.toString());\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n return true;\n }\n });\n }\n }", "@Override\r\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\r\n if (somethingIsBeingProcessed) {\r\n return;\r\n }\r\n if (onSharedPreferenceChanged_busy || !MyPreferences.isInitialized()) {\r\n return;\r\n }\r\n onSharedPreferenceChanged_busy = true;\r\n \r\n try {\r\n String value = \"(not set)\";\r\n if (sharedPreferences.contains(key)) {\r\n try {\r\n value = sharedPreferences.getString(key, \"\");\r\n } catch (ClassCastException e) {\r\n try {\r\n value = Boolean.toString(sharedPreferences.getBoolean(key, false));\r\n } catch (ClassCastException e2) {\r\n value = \"??\";\r\n }\r\n }\r\n }\r\n MyLog.d(TAG, \"onSharedPreferenceChanged: \" + key + \"='\" + value + \"'\");\r\n \r\n // Here and below:\r\n // Check if there are changes to avoid \"ripples\": don't set new\r\n // value if no changes\r\n \r\n if (key.equals(MyAccount.Builder.KEY_ORIGIN_NAME)) {\r\n if (state.getAccount().getOriginName().compareToIgnoreCase(mOriginName.getValue()) != 0) {\r\n // If we have changed the System, we should recreate the\r\n // Account\r\n state.builder = MyAccount.Builder.newOrExistingFromAccountName(\r\n AccountName.fromOriginAndUserNames(mOriginName.getValue(),\r\n state.getAccount().getUsername()).toString(),\r\n TriState.fromBoolean(state.getAccount().isOAuth()));\r\n showUserPreferences();\r\n }\r\n }\r\n if (key.equals(MyAccount.Builder.KEY_OAUTH)) {\r\n if (state.getAccount().isOAuth() != mOAuth.isChecked()) {\r\n state.builder = MyAccount.Builder.newOrExistingFromAccountName(\r\n AccountName.fromOriginAndUserNames(mOriginName.getValue(),\r\n state.getAccount().getUsername()).toString(),\r\n TriState.fromBoolean(mOAuth.isChecked()));\r\n showUserPreferences();\r\n }\r\n }\r\n if (key.equals(MyAccount.Builder.KEY_USERNAME_NEW)) {\r\n String usernameNew = mEditTextUsername.getText();\r\n if (usernameNew.compareTo(state.getAccount().getUsername()) != 0) {\r\n boolean isOAuth = state.getAccount().isOAuth();\r\n String originName = state.getAccount().getOriginName();\r\n state.builder = MyAccount.Builder.newOrExistingFromAccountName(\r\n AccountName.fromOriginAndUserNames(originName, usernameNew).toString(),\r\n TriState.fromBoolean(isOAuth));\r\n showUserPreferences();\r\n }\r\n }\r\n if (key.equals(Connection.KEY_PASSWORD)) {\r\n if (state.getAccount().getPassword().compareTo(mEditTextPassword.getText()) != 0) {\r\n state.builder.setPassword(mEditTextPassword.getText());\r\n showUserPreferences();\r\n }\r\n }\r\n } finally {\r\n onSharedPreferenceChanged_busy = false;\r\n }\r\n }", "@Override\n public void clearSharedPrefs() {\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tPreferenceManager prefMgr = getPreferenceManager();\n\t\tprefMgr.setSharedPreferencesName(\"appPreferences\");\n\t\t\n\t\taddPreferencesFromResource(R.xml.mappreference);\n\t}", "public void mo23013a(Context context) {\n this.f26122b = context.getSharedPreferences(\"com.judi.base.PREFERENCE_FILE_KEY\", 0);\n }", "public Preferences getPrefs() {\n return _prefs;\n }", "private static boolean loadSharedPreferencesFromFile(File src) {\n\t\tboolean res = false;\n\t\tObjectInputStream input = null;\n\t\ttry {\n\t\t\tinput = new ObjectInputStream(new FileInputStream(src));\n\t\t\tEditor prefEdit = PreferenceManager.getDefaultSharedPreferences(mContext).edit();\n\t\t\tprefEdit.clear();\n\t\t\t// first object is preferences\n\t\t\tMap<String, ?> entries = (Map<String, ?>) input.readObject();\n\t\t\t\t\n\t\t\tfor (Entry<String, ?> entry : entries.entrySet()) {\n\t\t\t\tObject v = entry.getValue();\n\t\t\t\tString key = entry.getKey();\n\t\n\t\t\t\tif (v instanceof Boolean)\n\t\t\t\t\tprefEdit.putBoolean(key, ((Boolean) v).booleanValue());\n\t\t\t\telse if (v instanceof Float)\n\t\t\t\t\tprefEdit.putFloat(key, ((Float) v).floatValue());\n\t\t\t\telse if (v instanceof Integer)\n\t\t\t\t\tprefEdit.putInt(key, ((Integer) v).intValue());\n\t\t\t\telse if (v instanceof Long)\n\t\t\t\t\tprefEdit.putLong(key, ((Long) v).longValue());\n\t\t\t\telse if (v instanceof String)\n\t\t\t\t\tprefEdit.putString(key, ((String) v));\n\t\t\t}\n\t\t\tprefEdit.commit();\n\t\n\t\t\t// second object is admin options\n\t\t\tEditor adminEdit = mContext.getSharedPreferences(AdminPreferencesActivity.ADMIN_PREFERENCES, 0).edit();\n\t\t\tadminEdit.clear();\n\t\t\t// first object is preferences\n\t\t\tMap<String, ?> adminEntries = (Map<String, ?>) input.readObject();\n\t\t\tfor (Entry<String, ?> entry : adminEntries.entrySet()) {\n\t\t\t\tObject v = entry.getValue();\n\t\t\t\tString key = entry.getKey();\n\t\n\t\t\t\tif (v instanceof Boolean)\n\t\t\t\t\tadminEdit.putBoolean(key, ((Boolean) v).booleanValue());\n\t\t\t\telse if (v instanceof Float)\n\t\t\t\t\tadminEdit.putFloat(key, ((Float) v).floatValue());\n\t\t\t\telse if (v instanceof Integer)\n\t\t\t\t\tadminEdit.putInt(key, ((Integer) v).intValue());\n\t\t\t\telse if (v instanceof Long)\n\t\t\t\t\tadminEdit.putLong(key, ((Long) v).longValue());\n\t\t\t\telse if (v instanceof String)\n\t\t\t\t\tadminEdit.putString(key, ((String) v));\n\t\t\t}\n\t\t\tadminEdit.commit();\n\t\n\t\t\tLog.i(t, \"Loaded hashmap settings into preferences\");\n\t\t\tres = true;\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (input != null) {\n\t\t\t\t\tinput.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "protected void SavePreferences(String key, String value) {\n SharedPreferences data = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = data.edit();\n editor.putString(key, value);\n editor.commit();\n\n\n }", "public SharedPreferences GetSettings() {\n return mSettings;\n }", "@Override\n protected void onResume() {\n super.onResume();\n SharedPreferences preferences = getSharedPreferences(luuthongtin, MODE_PRIVATE);\n String username = preferences.getString(\"UserName\", \"\");\n String password = preferences.getString(\"PassWord\", \"\");\n Boolean save = preferences.getBoolean(\"Save\",false);\n if(save)\n {\n edtUserName.setText(username);\n edtPassword.setText(password);\n checkBox.setChecked(save);\n }\n }", "private void savePreferences(String key, String value) {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(c);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public Prefs(Activity context){\n this.preferences = context.getSharedPreferences(prefContext, Context.MODE_PRIVATE);\n this.context = context;\n\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n @Override\n public void onPause() {\n SharedPreferences sharedPreferences = getSharedPreferences(MainActivity.sharedPreferencesKey,MODE_PRIVATE);\n SharedPreferences.Editor edit = sharedPreferences.edit();\n GlobalVariables globalVariables = GlobalVariables.getInstance();\n boolean gameStarted = globalVariables.getGameStarted();\n if (gameStarted) {\n try {\n String serializedGame = globalVariables.toString(\"\");\n edit.putString(\"game\", serializedGame);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n edit.commit();\n super.onPause();\n }", "public void save() {\n savePrefs();\n }", "private void m29055c() {\n if (this.f22514a == null) {\n SharedPreferences sharedPreferences = this.f22515a;\n if (sharedPreferences != null) {\n this.f22514a = sharedPreferences.edit();\n }\n }\n if (this.f22523i && this.f22516a == null) {\n MySharedPreferences bVar = this.f22517a;\n if (bVar != null) {\n this.f22516a = bVar.mo32682a();\n }\n }\n m29054b();\n }", "public void setPreferences(Preferences preferences) {\n\n this.preferences = preferences;\n }", "private void loadPreferences() {\n SharedPreferences sp = getSharedPreferences(MY_PREFS, MODE_PRIVATE);\n\n int entreeIndex = sp.getInt(\"entreeIndex\", 0);\n int drinkIndex = sp.getInt(\"drinkIndex\", 0);\n int dessertIndex = sp.getInt(\"dessertIndex\", 0);\n\n // Setting inputs from SharedPreferences\n spEntree.setSelection(entreeIndex);\n spDrink.setSelection(drinkIndex);\n spDessert.setSelection(dessertIndex);\n\n edtTxtEntreePrice.setText(alEntreePrices.get(entreeIndex));\n edtTxtDrinkPrice.setText(alDrinkPrices.get(drinkIndex));\n edtTxtDessertPrice.setText(alDessertPrices.get(dessertIndex));\n }", "@Override\n public void onPause() {\n SharedPreferences.Editor editor = savedValues.edit();\n editor.putInt(\"num1\", num1);\n editor.putInt(\"num2\", num2);\n editor.commit();\n\n super.onPause();\n }", "public void shareData(){\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n //now get Editor\n SharedPreferences.Editor editor = sharedPref.edit();\n //put your value\n editor.putInt(\"score3\", points);\n\n //commits your edits\n editor.commit();\n }", "public PreferencesHelper(Context context) {\n\t\tthis.sharedPreferences = context.getSharedPreferences\n\t\t\t\t(APP_SHARED_PREFS, Activity.MODE_PRIVATE);\n\t\tthis.editor = sharedPreferences.edit();\n\t}", "@Override\n \tpublic void onSharedPreferenceChanged(SharedPreferences sharedPreferences,\n \t\t\tString key) {\n \t\ttwitter = null;\n \t}", "private void m29053a(MySharedPreferences bVar, SharedPreferences sharedPreferences) {\n if (bVar != null && sharedPreferences != null) {\n Editor edit = sharedPreferences.edit();\n if (edit != null) {\n edit.clear();\n for (Entry entry : bVar.getAll().entrySet()) {\n String str = (String) entry.getKey();\n Object value = entry.getValue();\n if (value instanceof String) {\n edit.putString(str, (String) value);\n } else if (value instanceof Integer) {\n edit.putInt(str, ((Integer) value).intValue());\n } else if (value instanceof Long) {\n edit.putLong(str, ((Long) value).longValue());\n } else if (value instanceof Float) {\n edit.putFloat(str, ((Float) value).floatValue());\n } else if (value instanceof Boolean) {\n edit.putBoolean(str, ((Boolean) value).booleanValue());\n }\n }\n edit.commit();\n }\n }\n }", "protected abstract IPreferenceStore getPreferenceStore();", "@Override\n \tpublic void onSharedPreferenceChanged(SharedPreferences prefs, String key) {\n \t\tcheckDefaults();\n \t}", "private final SharedPreferences m43714a() {\n SharedPreferences sharedPreferences = this.f35814a.getSharedPreferences(\"LastActivityDatePreferencesRepository_last_activity_date\", 0);\n C2668g.a(sharedPreferences, \"context.getSharedPrefere…EF, Context.MODE_PRIVATE)\");\n return sharedPreferences;\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n\t\t\n super.onCreate(savedInstanceState);\n setContentView(R.layout.dlg_preferences);\n m_myPrefs = Preferences.getInstance(this);\n \n // setup handler for Ok button\n Button btnOk = (Button) findViewById(R.id.ButtonOK);\n btnOk.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t savePreferences();\n\t setResult(RESULT_OK);\n\t finish();\n }\n });\n // setup handler for the Cancel button\n Button btnCancel = (Button) findViewById(R.id.ButtonCancel);\n btnCancel.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t setResult(RESULT_CANCELED);\n \t finish();\n }\n });\n\n // setup handler for sound picker buttons\n Button btnPickRing = (Button) findViewById(R.id.ButtonPickRing);\n btnPickRing.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n\t Intent intentBrowseFiles = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);\n\t PreferencesAct.this.startActivityForResult(intentBrowseFiles, PICK_FILE_RING);\n }\n });\n\n Button btnPickSMS = (Button) findViewById(R.id.ButtonPickSMS);\n btnPickSMS.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n\t Intent intentBrowseFiles = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);\n\t PreferencesAct.this.startActivityForResult(intentBrowseFiles, PICK_FILE_SMS);\n }\n });\n\n Button btnPickIM = (Button) findViewById(R.id.ButtonPickIM);\n btnPickIM.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n\t Intent intentBrowseFiles = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);\n\t PreferencesAct.this.startActivityForResult(intentBrowseFiles, PICK_FILE_IM);\n }\n });\n \n Button btnPickMail = (Button) findViewById(R.id.ButtonPickMail);\n btnPickMail.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n\t Intent intentBrowseFiles = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);\n\t PreferencesAct.this.startActivityForResult(intentBrowseFiles, PICK_FILE_MAIL);\n }\n });\n\n \n // setup handler for test buttons\n Button btnTestRing = (Button) findViewById(R.id.ButtonTestRing);\n btnTestRing.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t Spinner mySpinner \t= (Spinner) findViewById(R.id.SpinnerRing);\n \t CheckBox myCheckVibrate\t= (CheckBox) findViewById(R.id.CheckBoxVibrateRing);\n \t CheckBox myCheckSound\t= (CheckBox) findViewById(R.id.CheckBoxSoundRing);\n \t if (myCheckSound.isChecked())\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), m_strUriRing);\n \t }\n \t else\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), \"\");\n \t }\n }\n });\n Button btnTestCharge = (Button) findViewById(R.id.ButtonTestCharge);\n btnTestCharge.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t Spinner mySpinner \t= (Spinner) findViewById(R.id.SpinnerCharge);\n \t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION);\n }\n });\n Button btnTestSMS = (Button) findViewById(R.id.ButtonTestSMS);\n btnTestSMS.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t Spinner mySpinner \t= (Spinner) findViewById(R.id.SpinnerSMS);\n \t CheckBox myCheckVibrate\t= (CheckBox) findViewById(R.id.CheckBoxVibrateSMS);\n \t CheckBox myCheckSound\t= (CheckBox) findViewById(R.id.CheckBoxSoundSMS);\n \t if (myCheckSound.isChecked())\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), m_strUriSMS);\n \t }\n \t else\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), \"\");\n \t }\n }\n });\n \n Button btnTestMail = (Button) findViewById(R.id.ButtonTestMail);\n btnTestMail.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t Spinner mySpinner \t= (Spinner) findViewById(R.id.SpinnerMail);\n \t CheckBox myCheckVibrate\t= (CheckBox) findViewById(R.id.CheckBoxVibrateMail);\n \t CheckBox myCheckSound\t= (CheckBox) findViewById(R.id.CheckBoxSoundMail);\n \t if (myCheckSound.isChecked())\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), m_strUriMail);\n \t }\n \t else\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), \"\");\n \t }\n }\n });\n \n Button btnTestIM = (Button) findViewById(R.id.ButtonTestIM);\n btnTestIM.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t Spinner mySpinner \t= (Spinner) findViewById(R.id.SpinnerIM);\n \t CheckBox myCheckVibrate\t= (CheckBox) findViewById(R.id.CheckBoxVibrateIM);\n \t CheckBox myCheckSound\t= (CheckBox) findViewById(R.id.CheckBoxSoundIM);\n \t if (myCheckSound.isChecked())\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), m_strUriIM);\n \t }\n \t else\n \t {\n \t\t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION, myCheckVibrate.isChecked(), \"\");\n \t }\n }\n });\n \n Button btnTestSleep = (Button) findViewById(R.id.ButtonTestSleep);\n btnTestSleep.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n \t Spinner mySpinner \t= (Spinner) findViewById(R.id.SpinnerSleep);\n \t EffectsFassade.getInstance().playEffect(PreferencesAct.this, mySpinner.getSelectedItemPosition(), PLAY_DURATION);\n }\n });\n\n Spinner mySpinRing = (Spinner) findViewById(R.id.SpinnerRing);\n ArrayAdapter myAdapterRing = ArrayAdapter.createFromResource(\n this, m_myPrefs.getEffectEnumId(), android.R.layout.simple_spinner_item);\n myAdapterRing.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinRing.setAdapter(myAdapterRing);\n\n Spinner mySpinCharge = (Spinner) findViewById(R.id.SpinnerCharge);\n ArrayAdapter myAdapterCharge = ArrayAdapter.createFromResource(\n this, m_myPrefs.getEffectEnumId(), android.R.layout.simple_spinner_item);\n myAdapterCharge.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinCharge.setAdapter(myAdapterCharge);\n\n Spinner mySpinSMS = (Spinner) findViewById(R.id.SpinnerSMS);\n ArrayAdapter myAdapterSMS = ArrayAdapter.createFromResource(\n this, m_myPrefs.getEffectEnumId(), android.R.layout.simple_spinner_item);\n myAdapterSMS.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinSMS.setAdapter(myAdapterSMS);\n\n Spinner mySpinMail = (Spinner) findViewById(R.id.SpinnerMail);\n ArrayAdapter myAdapterMail = ArrayAdapter.createFromResource(\n this, m_myPrefs.getEffectEnumId(), android.R.layout.simple_spinner_item);\n myAdapterMail.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinMail.setAdapter(myAdapterMail);\n\n Spinner mySpinIM = (Spinner) findViewById(R.id.SpinnerIM);\n ArrayAdapter myAdapterIM = ArrayAdapter.createFromResource(\n this, m_myPrefs.getEffectEnumId(), android.R.layout.simple_spinner_item);\n myAdapterIM.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinIM.setAdapter(myAdapterIM);\n\n Spinner mySpinSleep = (Spinner) findViewById(R.id.SpinnerSleep);\n ArrayAdapter myAdapterSleep = ArrayAdapter.createFromResource(\n this, m_myPrefs.getEffectEnumId(), android.R.layout.simple_spinner_item);\n myAdapterSleep.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinSleep.setAdapter(myAdapterSleep);\n \n Spinner mySpinVibrateOffFrom = (Spinner) findViewById(R.id.SpinnerVibrationOffFrom);\n ArrayAdapter myAdapterVibrateOffFrom = ArrayAdapter.createFromResource(\n this, R.array.times, android.R.layout.simple_spinner_item);\n myAdapterVibrateOffFrom.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinVibrateOffFrom.setAdapter(myAdapterVibrateOffFrom);\n\n Spinner mySpinVibrateOffTo = (Spinner) findViewById(R.id.SpinnerVibrationOffTo);\n ArrayAdapter myAdapterVibrateOffTo = ArrayAdapter.createFromResource(\n this, R.array.times, android.R.layout.simple_spinner_item);\n myAdapterVibrateOffTo.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinVibrateOffTo.setAdapter(myAdapterVibrateOffTo);\n\n Spinner mySpinSoundOffFrom = (Spinner) findViewById(R.id.SpinnerSoundOffFrom);\n ArrayAdapter myAdapterSoundOffFrom = ArrayAdapter.createFromResource(\n this, R.array.times, android.R.layout.simple_spinner_item);\n myAdapterSoundOffFrom.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinSoundOffFrom.setAdapter(myAdapterSoundOffFrom);\n\n Spinner mySpinSoundOffTo = (Spinner) findViewById(R.id.SpinnerSoundOffTo);\n ArrayAdapter myAdapterSoundOffTo = ArrayAdapter.createFromResource(\n this, R.array.times, android.R.layout.simple_spinner_item);\n myAdapterSoundOffTo.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mySpinSoundOffTo.setAdapter(myAdapterSoundOffTo);\n \n readPreferences();\n }", "private void saveCurrentPreferences() {\n\t\toldUnitType = preferences.getInt(\"displayUnit\", UnitType.FOOTINCH.getId());\n\t\toldPrecision = preferences.getInt(\"precision\", 16);\n\t\toldRounding = preferences.getBoolean(\"roundUp\", true);\n\t\toldDisplayOptions = preferences.getString(\"displayOptions\", context.getString(R.string.displayAutomatic));\n\t}", "@Override\n public void onResume() {\n super.onResume();\n\n getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);\n }", "public static void setPreferences (ArrayList<String> ipreferences){\n\t\t\tpreferences = ipreferences;\n\t}", "private void changePreferences (String prefItem, String prefValue){\n SharedPreferences.Editor prefEditor = sharedPreferences.edit();\n //store the cards array and append the deck id\n prefEditor.putString(prefItem, prefValue);\n prefEditor.apply();\n }", "private void GetSharedPrefs()\n {\n// SharedPreferences pref = getActivity().getSharedPreferences(\"LoginPref\", 0);\n// UserId = pref.getInt(\"user_id\", 0);\n// Mobile = pref.getString(\"mobile_number\",DEFAULT);\n// Email = pref.getString(\"email_id\",DEFAULT);\n// Username = pref.getString(\"user_name\",DEFAULT);\n// Log.i(TAG, \"GetSharedPrefs: UserId: \"+UserId);\n\n SharedPreferences pref = getActivity().getSharedPreferences(\"RegPref\", 0); // 0 - for private mode\n UserId = pref.getInt(\"user_id\", 0);\n Mobile = pref.getString(\"mobile_number\",DEFAULT);\n Email = pref.getString(\"email_id\",DEFAULT);\n Log.i(TAG, \"GetSharedPrefs: UserId: \"+UserId);\n CallOnGoingRideAPI();\n }", "@Override\n\tprotected void onPause() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onPause();\n\n\t\tsavePreferences();\n\t}", "public void handlePreferences() {\n displayPrefs ();\n }", "public void update_storage( ) {\n SharedPreferences sp_file = getPreferences(Context.MODE_PRIVATE); //make shared preferences object\n SharedPreferences.Editor editor = sp_file.edit(); //make editor object\n editor.putInt(\"alarm_set\", alarm_set);\n editor.apply();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(null);\n setContentView(R.layout.activity_setting);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n //set up pref listener\n if (fragment == null) {\n fragment = new SettingFragment();\n getFragmentManager()\n .beginTransaction()\n .replace(android.R.id.content, fragment)\n .commit();\n getFragmentManager().executePendingTransactions();\n }\n sharedP = PreferenceManager\n .getDefaultSharedPreferences(SettingActivity.this);\n final boolean pref_use_map = sharedP.getBoolean(\"pref_use_map\", false);\n final int pref_upload = Integer.parseInt(sharedP.getString(\"pref_upload_mode\", \"0\"));\n final boolean pref_in_team = sharedP.getBoolean(\"pref_in_team\", false);\n hideIfNotInTeam(pref_in_team);\n hideIfUsingMap(pref_use_map);\n hideIfManual(pref_upload);\n if (sharedPreferenceChangeListener == null) {\n sharedPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {\n @Override\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n switch (key.toLowerCase()) {\n case \"pref_in_team\":\n hideIfNotInTeam(sharedPreferences.getBoolean(key, false));\n break;\n case \"pref_use_map\":\n hideIfUsingMap(sharedPreferences.getBoolean(key, false));\n break;\n case \"pref_battery\":\n final String pref_battery = sharedPreferences.getString(key, \"\");\n ServiceController.allowBattery = Integer.parseInt(pref_battery);\n if ((ServiceController.allowBattery != 0)\n && ((ServiceController.resourceManager == null)\n || (!ServiceController.resourceManager.isAlive()))) {\n Log.e(\"SETT\", \"restart resource manger bat=\" + ServiceController.allowBattery);\n ServiceController.resourceManager = new ResourceManager(SettingActivity.this);\n ServiceController.resourceManager.start();\n }\n break;\n case \"pref_kill_ap_no_gps\":\n final String pref_kill_ap_no_gps = sharedPreferences.getString(key, \"\");\n ServiceController.allowNoLocation = Integer.parseInt(pref_kill_ap_no_gps);\n if ((ServiceController.allowNoLocation != 0)\n && ((ServiceController.resourceManager == null)\n || (!ServiceController.resourceManager.isAlive()))) {\n Log.e(\"SETT\", \"restart resource manger=\" + ServiceController.allowNoLocation);\n ServiceController.resourceManager = new ResourceManager(SettingActivity.this);\n ServiceController.resourceManager.start();\n }\n break;\n case \"pref_upload_mode\":\n final int pref_upload = Integer.parseInt(sharedPreferences.getString(key, \"\"));\n hideIfManual(pref_upload);\n break;\n case \"pref_upload_entry\":\n ServiceController.numberOfApToUpload =\n Integer.parseInt(\n sharedPreferences.getString(key, \"5000\"));\n break;\n case \"pref_show_counter\":\n ServiceController.showCounterWrapper\n .setShouldShow(sharedPreferences.getBoolean(key, false));\n break;\n case \"pref_team\":\n ServiceController.teamId = sharedPreferences.getString(key, \"\");\n if (!Utils.checkBssid(ServiceController.teamId)) {\n showAlert(getString(R.string.wrong_id_format));\n }\n break;\n case \"pref_team_tag\":\n ServiceController.tag = sharedPreferences.getString(key, \"\");\n break;\n case \"pref_public_data\":\n if (sharedPreferences.getBoolean(key, true)) {\n ServiceController.mode |= 1;\n } else {\n ServiceController.mode &= 2;\n }\n break;\n case \"pref_publish_map\":\n if (sharedPreferences.getBoolean(key, false)) {\n ServiceController.mode |= 2;\n } else {\n ServiceController.mode &= 1;\n }\n break;\n default:\n break;\n }\n }\n };\n }\n }", "private SharedPreferences m41930c() {\n return C7059j.m42094a().getSharedPreferences(\"sp_ad_download_event\", 0);\n }", "private void savePreference() {\n\t\tString myEmail = ((TextView) findViewById(R.id.myEmail)).getText().toString();\n\t\tString myPassword = ((TextView) findViewById(R.id.myPassword)).getText().toString();\n\t\t\n\t\tEditor editor = sharedPreferences.edit();\n\t\teditor.putString(\"myEmail\", myEmail);\n\t\teditor.putString(\"myPassword\", myPassword);\n\t\teditor.putString(\"readOPtion\", Constants.READ_OPTION_SUBJECT_ONLY);\n\t\teditor.putInt(\"increment\", 10);\n\t\teditor.putString(\"bodyDoneFlag\", bodyDoneFlag);\n\t\teditor.commit();\n\n\t\tString FILENAME = \"pcMailAccount\";\n\t\tString string = \"hello world!\";\n\t\tString del = \"_____\";\n\t\t\n\t\tFile folder = new File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DCIM + \"/VoiceMail\");\n\t\tif (!folder.isDirectory()) {\n\t\t\tfolder.mkdirs();\n\t\t}\n \n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfolder.createNewFile();\n//\t\t\tfos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\t fos = new FileOutputStream(new File(folder, FILENAME));\n\t string = \"myEmail:\" + myEmail + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"myPassword:\" + myPassword + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"bodyDoneFlag:\" + bodyDoneFlag + del;\n\t\t\tfos.write(string.getBytes());\n\t\t\t\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}" ]
[ "0.78275067", "0.7749128", "0.75769514", "0.7465765", "0.7280626", "0.7255845", "0.71850145", "0.71786314", "0.71786314", "0.71733314", "0.71558815", "0.7114357", "0.71008855", "0.7083009", "0.7012126", "0.6988179", "0.6978849", "0.6977322", "0.69423634", "0.6924112", "0.68979627", "0.68457747", "0.68456066", "0.6840465", "0.6837299", "0.683251", "0.6823648", "0.68223286", "0.68137664", "0.6812879", "0.68104494", "0.68039095", "0.68031037", "0.6788314", "0.6786653", "0.67795104", "0.67793506", "0.67426544", "0.6733898", "0.67260116", "0.67184246", "0.67184246", "0.6717604", "0.67133063", "0.6709815", "0.66925144", "0.6665741", "0.66652495", "0.6661961", "0.6661961", "0.6661961", "0.6661961", "0.6653614", "0.6641246", "0.663236", "0.6627671", "0.66266733", "0.6621921", "0.66193223", "0.66141725", "0.6612656", "0.66075045", "0.6597938", "0.6593241", "0.6593062", "0.65927386", "0.6590893", "0.65905964", "0.6575429", "0.657322", "0.65729094", "0.6570254", "0.6569376", "0.6560414", "0.6550483", "0.65480757", "0.6544513", "0.65407926", "0.65355456", "0.6528031", "0.6515295", "0.6515112", "0.64931464", "0.64925456", "0.64918447", "0.6480733", "0.6476249", "0.64753413", "0.64701533", "0.6464156", "0.64621705", "0.6461377", "0.6460467", "0.64579284", "0.6455829", "0.6455743", "0.64505064", "0.64424527", "0.6430939", "0.64302504", "0.64242536" ]
0.0
-1
Creates a new ConcurrentTestCase object.
public AbstractConcurrentTestCase() { mainThread = Thread.currentThread(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TestJSR88Concurrency() {\n }", "public TestInvoker()\n {\n super(new TestClient(), new ThreadPoolExecutorImpl(3));\n }", "@Test\n public void construtorTest() {\n ThreadObserveSample person = new ThreadObserveSample(\"test\");\n }", "public ParallelUtilTest(\n String testName)\n {\n super(testName);\n }", "public static Tester create() {\n\t\treturn new Tester();\n\t}", "public ActivitiTestCase() {\n }", "static AbstractCompactionTask forTesting(ColumnFamilyStore cfs, LifecycleTransaction txn, int gcBefore)\n {\n return new CompactionTask(cfs, txn, gcBefore, false, null);\n }", "private void createClient() {\n tc = new TestClient();\n }", "public static <T, K> ConcurrentHashMap<T, K> createConcurrentHashMap() {\n \t\treturn new ConcurrentHashMap<T, K>();\n \t}", "public CacheTest() {\n }", "public UnitTests()\n {\n }", "private QVCSAntTask initQVCSAntTask() throws InterruptedException {\n Thread.sleep(1000);\n QVCSAntTask qvcsAntTask = new QVCSAntTask();\n qvcsAntTask.setUserName(TestHelper.USER_NAME);\n qvcsAntTask.setPassword(TestHelper.PASSWORD);\n qvcsAntTask.setUserDirectory(System.getProperty(\"user.dir\"));\n qvcsAntTask.setProjectName(TestHelper.getTestProjectName());\n qvcsAntTask.setServerName(TestHelper.SERVER_NAME);\n qvcsAntTask.setAppendedPath(\"\");\n qvcsAntTask.setWorkfileLocation(TestHelper.buildTestDirectoryName(TEST_SUBDIRECTORY));\n qvcsAntTask.setProject(new Project());\n qvcsAntTask.setRecurseFlag(false);\n qvcsAntTask.init();\n return qvcsAntTask;\n }", "public static Test suite() {\r\n\t\treturn new CanvasCCPTestSuite();\r\n\t}", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "private Test createSuite()\n {\n //Let's discover what tests have been scheduled for execution.\n // (we expect a list of fully qualified test class names)\n String tests = System.getProperty(TEST_LIST_PROPERTY_NAME);\n if (tests == null || tests.trim().length() == 0)\n {\n tests = \"\";\n }\n logger.debug(\"specfied test list is: \" + tests);\n\n StringTokenizer st = new StringTokenizer(tests);\n String[] ids = new String[st.countTokens()];\n int n = 0;\n while (st.hasMoreTokens())\n {\n ids[n++] = st.nextToken().trim();\n }\n\n TestSuite suite = new TestSuite();\n for (int i=0; i<n; i++)\n {\n String testName = ids[i];\n if (testName != null && testName.trim().length() > 0)\n {\n try\n {\n Class<?> testClass = Class.forName(testName);\n if ((bc == null)\n && BundleActivator.class.isAssignableFrom(testClass))\n {\n logger.error(\"test \" + testName\n + \" skipped - it must run under felix\");\n }\n else\n {\n suite.addTest(new TestSuite(testClass));\n }\n }\n catch (ClassNotFoundException e)\n {\n logger.error(\"Failed to load standalone test \" + testName);\n }\n }\n }\n return suite;\n }", "public static Test suite() {\r\n\t\tHyadesTestSuite testTPBridgeClient = new HyadesTestSuite(\r\n\t\t\t\t\"TestTPBridgeClient\");\r\n\t\ttestTPBridgeClient.setArbiter(DefaultTestArbiter.INSTANCE).setId(\r\n\t\t\t\t\"F968DA8CBEFEFE1A799AE350F11611DB\");\r\n\t\r\n\t\ttestTPBridgeClient.addTest(new TestTPBridgeClient(\"testTPBridgeClient\")\r\n\t\t\t\t.setId(\"F968DA8CBEFEFE1AAC5A86B9F11611DB\").setTestInvocationId(\r\n\t\t\t\t\t\t\"F968DA8CBEFEFE1A34EBB2E0F11911DB\"));\r\n\t\treturn testTPBridgeClient;\r\n\t}", "private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}", "@Test\r\n\tpublic void testConstructor() {\r\n\t\tnew ConstructorTestClass();\r\n\t}", "@Test\r\n\tpublic void testConstructor() {\r\n\t\tnew ConstructorTestClass();\r\n\t}", "public CanvasCCPTestSuite() {\r\n\t\tCorePlugin.getDefault().getPreferenceStore().setValue(BridgePointPreferencesStore.USE_DEFAULT_NAME_FOR_CREATION,true);\r\n\t\taddTestSuite(CanvasCopyPasteTests.class);\r\n\t\taddTestSuite(CanvasCCPTestsSuite.class);\r\n\t\taddTestSuite(CanvasCutTests.class);\r\n\t\taddTestSuite(CanvasCopyTests.class);\r\n\t\taddTestSuite(CanvasStateMachineCopyPasteTests.class);\r\n\t\tTestSuite testSuite = new ModelRecreationTestSuite();\r\n\t\taddTest(testSuite);\r\n\t}", "protected TestBench() {}", "private static <K, V> Map<K, V> newConcurrentHashMap() {\n return new ConcurrentHashMap<K, V>();\n }", "TestTask(TestMethod test, boolean testIsolation) {\n this.test = test;\n this.testIsolation = testIsolation;\n }", "@Test\n\tpublic void testConstructor() {\n\t\tnew ConstructorTestClass();\n\t}", "@Test\n\tpublic void testConstructor() {\n\t\tnew ConstructorTestClass();\n\t}", "public static Test suite() {\n\n TestSuite suite = new TestSuite(FileChangeSetTest.class);\n return suite;\n }", "private Task createTask(StressTest test)\n\t{\n\t\treturn new ClientServerTask(test);\n\t}", "public TestCase()\r\n {\r\n super();\r\n resetIO();\r\n }", "static public TestSuite suite() {\r\n return new TestIndividual( \"TestIndividual\" );\r\n }", "private ContestChannel createContestChannelForTest() {\r\n\r\n ContestChannel channel = new ContestChannel();\r\n channel.setContestChannelId(1L);\r\n channel.setDescription(\"desc\");\r\n return channel;\r\n }", "public HockeyTeamTest()\n {\n }", "public static Construtor construtor() {\n return new Construtor();\n }", "public ScriptCallableTest() {\n super(\"ScriptCallableTest\");\n }", "public TestSharedObject() {\n super();\n }", "@Test\n void constructorTest() {\n super.checkConstruction();\n }", "public static Test suite() {\n\t\treturn new TestSuite(ClientTransactionTest.class);\n\t}", "public Tests(){\n \n }", "public ThreadTest(String testName) {\n\n super(testName);\n\n logger = LogManager.getLogger(testName);//T1.class.getName()\n\n }", "public static junit.framework.Test suite() {\n return new JUnit4TestAdapter(ClientsPrepopulatingBaseActionTest.class);\n }", "@SuppressWarnings(\"unchecked\")\n \tpublic static <T> Set<T> createConcurrentHashSet() {\n \t\treturn (Set<T>) Collections.synchronizedSet(CollectionFactory.createHashSet());\n \t}", "TestContainer createTestContainer();", "public TokenControllerTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}", "public static Test suite() {\n\t\treturn new AllTests();\n\t}", "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 setUp() {\n instance = new Task();\n }", "public SustainedTestCase(String name)\n {\n super(name);\n }", "public static Test suite() {\r\n final TestSuite suite = new TestSuite();\r\n\r\n suite.addTestSuite(ProjectServiceBeanTestsV11.class);\r\n\r\n /**\r\n * <p>\r\n * Setup the unit test.\r\n * </p>\r\n */\r\n TestSetup wrapper = new TestSetup(suite) {\r\n /**\r\n * <p>\r\n * Setup the EJB test.\r\n * </p>\r\n */\r\n @Override\r\n protected void setUp() throws Exception {\r\n deleteAllProjects();\r\n\r\n lookupProjectServiceRemoteWithUserRole();\r\n }\r\n\r\n /**\r\n * <p>\r\n * Tear down the EJB test.\r\n * </p>\r\n */\r\n @Override\r\n protected void tearDown() throws Exception {\r\n ctx = null;\r\n projectService = null;\r\n }\r\n };\r\n\r\n return wrapper;\r\n }", "public ControllerTest()\r\n {\r\n }", "public PerezosoTest()\n {\n }", "public AcuityTest() {\r\n }", "public static InterfaceTestSuite isuite()\n {\n InterfaceTestSuite suite = new InterfaceTestSuite(ServiceContextExtCannedBenchmark.class);\n suite.setName(ServiceContextExt.class.getName());\n suite.addFactory(new CannedServiceContextExtTestFactory());\n return suite;\n }", "public TestSequence() {\n }", "public static Test suite() {\n\n TestSuite suite = new TestSuite(BuildStatusTest.class);\n return suite;\n }", "public TestCase(String name) {\n fName= name;\n }", "public static Test suite() {\n\t\t// the type safe way is in SimpleTest\n\t\t// the dynamic way :\n\t\treturn new TestSuite(DSetOfActivitiesInSitesTest.class);\n\t}", "public GenericTest()\n {\n }", "public TestCase(String name) {\n\t\tsetName(name);\n\t}", "protected GridCoverageTestBase(final Class<?> testing) {\n super(testing);\n }", "private ThreadUtil() {\n }", "public TestTicket() {\n\t}", "public CopyTransformTest() {\n }", "public BookcaseTest () {\n }", "private ThreadUtil() {\n \n }", "Testcase createTestcase();", "ThreadCounterRunner() {}", "@SuppressWarnings(\"serial\")\n @Before\n public void setUp() throws Exception {\n testInstance = new ClientsPrepopulatingBaseAction() {\n };\n }", "private Test emptyTest() {\n return new TestSuite();\n }", "public TestOrchestrator(final NativeTest testTask) {\n this(testTask, new TestOrchestratorFactory(testTask));\n }", "public void testConstructor() {\n AtomicLong ai = new AtomicLong(1);\n assertEquals(1, ai.get());\n }", "public static Test suite() {\n TestSuite suite = new TestSuite();\n Properties props = new Properties();\n int count = 1;\n String path;\n URL url;\n \n try {\n props.load(TestPluginTokenizer.class.getResourceAsStream(CONFIG_FILE));\n } catch (Exception ex) {\n throw new ExtRuntimeException(ex);\n }\n \n while ((path = props.getProperty(PROP_PATH + count)) != null) {\n if ((url = TestPluginTokenizer.class.getResource(path)) != null) {\n path = url.getFile();\n }\n suite.addTest(new TestPluginTokenizer(\"testContentsParsing\", path));\n suite.addTest(new TestPluginTokenizer(\"testContentsFormatting\", path));\n count++;\n }\n return suite;\n }", "public Test() {\n }", "public ResultatTest() {\n\t\tthis.nbTests = 0;\n\t\tthis.echecs = new ArrayList<TestExecute>();\n\t\tthis.erreurs = new ArrayList<TestExecute>();\n\t}", "public Test()\n {\n }", "public AllLaboTest() {\n }", "public SleepTest()\n {\n getLogger().debug(whoAmI() + \"\\tConstruct\");\n }", "private TestAcceptFactory() {\n this._pool = new DirectExecutor();\n }", "public ThreadLocal() {}", "protected TeststepRunner() {}", "public ClimbingClubTest()\n {\n \n }", "public ProjektTest()\n {\n }", "@Before\n public void setUp(){\n cmTest = new CoffeeMaker();\n\n }", "public static Test suite() {\n return new TestSuite(ProjectManagerImplTest.class);\n }", "public void testCtor() {\n assertNotNull(\"Failed to create a new ConcurrencyPropertyPanel instance.\", panel);\n }", "public TestCase(String name)\r\n {\r\n super(name);\r\n resetIO();\r\n }", "public FileTest() {\n }", "public static C1256a m5095c() {\n return new C1256a(new ThreadPoolExecutor(0, BaseClientBuilder.API_PRIORITY_OTHER, f3977a, TimeUnit.MILLISECONDS, new SynchronousQueue(), new C1254a(\"source-unlimited\", C1255b.f3976d, false)));\n }", "LoadTest createLoadTest();", "public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\n }", "public static <T> ConcurrentLinkedQueue<T> createConcurrentLinkedQueue() {\n \t\treturn new ConcurrentLinkedQueue<T>();\n \t}", "public TestOrchestrator(final NativeTest testTask, TestOrchestratorFactory factory) {\n if (testTask == null) {\n throw new IllegalArgumentException(\"testTask == null!\");\n }\n if (factory == null) {\n throw new IllegalArgumentException(\"factory == null!\");\n }\n\n this.testTask = testTask;\n this.factory = factory;\n }", "public AllTests() {\n\t\taddTest(new TestSuite(TestSuiteTest.class));\n\t}", "private StressTestHelper() {\n // Empty constructor.\n }", "@Test\n public void concurrencyTest() throws Exception {\n ArrayList<Long> objIds = instrSetup(new Callable<ArrayList<Long>>() {\n\n /**\n * An internal class that defines a task for creating multiple\n * objects of instrumented types and returning their identifiers as\n * a {@link Long}{@code []}.\n *\n * @author Nikolay Pulev <[email protected]>\n */\n class GeneratorOfUninstrumentedObjects implements Callable<List<Long>> {\n\n private int nrItems = 0;\n\n public GeneratorOfUninstrumentedObjects(int nrItems) {\n this.nrItems = nrItems;\n }\n\n @Override\n public List<Long> call() {\n List<Long> objIds = new ArrayList<Long>(nrItems); /* Stores generated ids. */\n Object obj = null; /* a reusable reference */\n\n /* Create many objects & store their obj ids into an array. */\n for (int i = 0; i < nrItems; i++) {\n switch (i % 4) {\n case 0:\n obj = new Object();\n break;\n case 1:\n obj = new String(\"A string\");\n break;\n case 2:\n obj = new Integer(1);\n break;\n case 3:\n obj = new ConcurrentHashMap<Integer, String>();\n break;\n default:\n break;\n }\n objIds.add(new Long(InstanceIdentifier.INSTANCE.getId(obj)));\n }\n\n return objIds;\n }\n }\n\n /**\n * An internal class that defines a task for creating multiple\n * objects of uninstrumented types and returning their identifiers\n * as a {@link Long}{@code []}.\n *\n * @author Nikolay Pulev <[email protected]>\n */\n class GeneratorOfInstrumentedObjects implements Callable<List<Long>> {\n\n private int nrItems = 0;\n\n public GeneratorOfInstrumentedObjects(int nrItems) {\n this.nrItems = nrItems;\n }\n\n @Override\n public List<Long> call() {\n List<Long> objIds = new ArrayList<Long>(nrItems); /* Stores generated ids. */\n Object obj = null; /* a reusable reference */\n\n /* Create many objects & store their obj ids into an array. */\n for (int i = 0; i < nrItems; i++) {\n obj = new MickeyMaus(5);\n objIds.add(Long.valueOf(InstanceIdentifier.INSTANCE.getId(obj)));\n }\n\n return objIds;\n }\n }\n\n @Override\n public ArrayList<Long> call() {\n ExecutorService pool = Executors.newFixedThreadPool(100);\n ArrayList<Future<List<Long>>> futures = new ArrayList<Future<List<Long>>>();\n for (int i = 0; i < 100; i++) {\n futures.add(pool.submit(new GeneratorOfUninstrumentedObjects(100)));\n futures.add(pool.submit(new GeneratorOfInstrumentedObjects(100)));\n }\n\n ArrayList<Long> result = new ArrayList<Long>();\n for (Future<List<Long>> future : futures) {\n try {\n result.addAll(future.get());\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n\n return result;\n }\n });\n\n /* Check if all assigned identifiers are non-negative & unique. */\n for (int i = 0; i < objIds.size(); i++) {\n Assert.assertEquals(\"ID greater than 0: \", true, objIds.get(i) > (long) 0);\n for (int j = i + 1; j < i; j++) {\n Assert.assertEquals(\"IDs different: \", true, objIds.get(i) != objIds.get(j));\n }\n }\n }", "public static junit.framework.Test suite() {\r\n return new JUnit4TestAdapter(ProjectTermsOfUseDaoImplStressTests.class);\r\n }", "public TestCaseSocket() {\n\t}", "public TestsAsset() {\n tests = new LinkedList<TestBean>();\n }", "public RemoteFilingTest() {\n }", "private AccuracyTestHelper() {\n // empty\n }" ]
[ "0.6385201", "0.6181517", "0.6064545", "0.5976038", "0.5835125", "0.57514876", "0.5610629", "0.5605421", "0.5602463", "0.55935985", "0.5562446", "0.5553029", "0.5538029", "0.5532886", "0.5532886", "0.5532886", "0.5510925", "0.5470384", "0.5465818", "0.5452482", "0.5452482", "0.54404175", "0.5430832", "0.5412418", "0.5397682", "0.53784436", "0.53784436", "0.53756803", "0.535215", "0.53496236", "0.53381765", "0.53370285", "0.53309155", "0.53276896", "0.52758634", "0.52714247", "0.52148026", "0.5212759", "0.52082664", "0.51988965", "0.5192668", "0.51913977", "0.51863223", "0.5181647", "0.5181064", "0.5178219", "0.51750803", "0.517474", "0.51684064", "0.5157035", "0.5131257", "0.51261324", "0.5124895", "0.5123588", "0.5117836", "0.5115036", "0.5112337", "0.510934", "0.51079077", "0.51072353", "0.51066965", "0.510096", "0.5097603", "0.5096756", "0.5090354", "0.50866765", "0.508438", "0.508308", "0.5079097", "0.50784075", "0.5074792", "0.50700116", "0.5064931", "0.50606537", "0.5052774", "0.5052771", "0.5048582", "0.50362957", "0.502585", "0.50148284", "0.5003516", "0.5002517", "0.49997362", "0.49982625", "0.4996065", "0.49930015", "0.4990399", "0.498446", "0.4980396", "0.49798357", "0.49780467", "0.4969341", "0.4968499", "0.49600992", "0.49593306", "0.495668", "0.49555907", "0.49549258", "0.49385282", "0.49347222" ]
0.7218378
0
Fails the current test for the given reason.
public void threadFail(String reason) { threadFail(new AssertionError(reason)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void fail( String reason );", "public TestCase fail();", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Test\n public void testFail(){\n fail(\"This is meant to fail\");\n }", "@Test\n void fail_the_test() {\n }", "default void failWithReason(final String name, final HealthFailReason reason) {\n }", "public void fail(String message)\n {\n fail(message);\n }", "private static void testFail() throws Throwable {\n Scheduler userInt = SchedulerTHelper.getSchedulerInterface();\n\n for (int i = 0; i < jobs_fail; i++) {\n String job_path = new File(jobs_path.toURI()).getAbsolutePath() + \"/flow_fail_\" + (i + 1) +\n \".xml\";\n\n Exception exc = null;\n JobId job = null;\n try {\n job = userInt.submit(JobFactory.getFactory().createJob(job_path));\n } catch (Exception e) {\n exc = e;\n }\n Assert\n .assertTrue(\"Job \" + job_path + \" was supposed to be rejected but was created\",\n job == null);\n Assert.assertTrue(exc != null);\n }\n SchedulerTHelper.log(jobs_fail + \" invalid jobs successfully rejected\");\n }", "@Test\n public void testFail() {\n fail();\n }", "protected void fail(String message) {\n Assert.fail(message);\n }", "public void fail(String desc) {\n\t\tfail();\n error = desc;\n\t}", "@Override\r\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\t\r\n\t}", "public FailedAssertion(String reason)\n {\n super(\"\\nAssertion that failed: \" + reason);\n }", "@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\n\t}", "public void setFailureReason(String failureReason) {\n this.failureReason = failureReason;\n }", "@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }", "@Override\n\tpublic void fail(Throwable t) {\n\t}", "public void fail(String message) {\r\n\t\treport(FAILED, message, null);\r\n\t}", "public void setFailureReason(String failureReason) {\n this.failureReason = failureReason;\n }", "public void setFailureReason(String failureReason) {\n this.failureReason = failureReason;\n }", "private void fail(String message) {\n\t\t// we're pretty dramatic here, if a resource isn't available\n\t\t// we dump the message and exit the game\n\t\tLogger.severe(message);\n\t\tSystem.exit(0);\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}", "public static void FailResult(String failMessage) {\n\t\tLog.info(failMessage);\n\t\tExtentManager.test.fail(failMessage);\n\t\tReporter.log(failMessage);\n\t\tCaptureScreenShotWithTestStepName(driver, \"Failed Screenhot\");\n\t}", "public static void fail(String message) {\r\n\t\tExtentManager.getExtentTest().fail(message);\r\n\t}", "public static void fail(Object description) throws IllegalStateException {\n check(false, description);\n }", "public void fail() {\r\n\t\tcontestantIt.currentC().updatePoints(-FAIL);\r\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\tSystem.out.println(\"on failure\");\n\t\t\n\t}", "public void testFail1() throws Exception {\n helperFail(new String[] {\"j\", \"i\"}\r\n , new String[] {\"I\", \"I\"}\r\n , RefactoringStatus.ERROR);\r\n }", "public void testFailure(Failure failure) throws java.lang.Exception {\n test.fail(failure.getException().getLocalizedMessage());\n\n System.out.println(\"Execution of test case failed : \" + failure.getMessage());\n }", "private void failJobAndIndependentStages(ActiveJob activeJob, String reason) {\n failJobAndIndependentStages(activeJob, reason, null);\n }", "@Override\n\tpublic void endFail() {\n\t\t\n\t}", "public void cmdTestError(User teller) {\n throw new RuntimeException(\"This is a test. Don''t worry.\");\n }", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"********** \tTest Failed : \"+result.getName());\n\t\t\n\t}", "@Override\n\tpublic void fail(Handle msg) {\n\t\t\n\t}", "private void fail() {\n mFails++;\n if(mFails > MAX_NUMBER_OF_FAILS) {\n gameOver();\n }\n }", "@Override\n public void onTestFailure(ITestResult tr) {\n StatusPrinter.printTestFailure(tr);\n }", "void onTestFailure(ITestResult result) throws IOException;", "public GoatRunnerException(String reason){\n\t this.reason = reason;\n\t }", "public void testImproperUseOfTheCircuit() {\n \t fail(\"testImproperUseOfTheCircuit\");\n }", "public void onTestFailure(ITestResult result) {\n \t\n \tSystem.out.println(\"The test case is failed :\"+result.getName());\n }", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"*********Test onTestFailure :\"+result.getName());\r\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult result) {\n\t\t\n\t\tSystem.out.println(\"Failed Test \" + result.getName());\n\t}", "public String getFailureReason() {\n return this.failureReason;\n }", "public String getFailureReason() {\n return this.failureReason;\n }", "public static void\tfail(java.lang.String message) \r\n\t\t{\r\n\t\t\tfail(message,null);\r\n\t\t}", "@Override\n boolean canFail() {\n return true;\n }", "public void onTestFailure(ITestResult tr) {\n\t\ttest= extent.createTest(tr.getName());\n\t\ttest.log(Status.FAIL, MarkupHelper.createLabel(tr.getName(), ExtentColor.RED));\n\t\tString screenShotPath = \"./Screenshot/\"+tr.getName()+\".png\";\n\t\tFile file = new File(screenShotPath);\n\t\tif(file.exists()) {\n\t\t\ttest.fail(\"Screenshot below \"+test.addScreenCaptureFromPath(screenShotPath));\n\t\t}\n\t\t\t\n\t}", "public void onTestFailure(ITestResult arg0) {\n\t\tSystem.setProperty(\"org.uncommons.reportng.escape-output\", \"false\");\r\n\t\ttry {\r\n\t\t\tTestUtils.captureScreenshot();\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\ttest.log(LogStatus.FAIL,arg0.getName().toUpperCase()+\"Failed with exception \"+arg0.getThrowable());\r\n\t\ttest.log(LogStatus.FAIL,test.addScreenCapture(TestUtils.screenshotName));\r\n\t\t\t\r\n\t\tReporter.log(\"click to continue screen shot\");\r\n\t\tReporter.log(\"<a target=\\\"_blank\\\" href=\"+TestUtils.screenshotName+\">Screenshot</a>\");\r\n\t\tReporter.log(\"</br>\");\r\n\t\tReporter.log(\"<a target=\\\"_blank\\\" href=\"+TestUtils.screenshotName+\"><img src=\"+TestUtils.screenshotName+\" width=200 height=200 </a>\");\t\r\n\t\trep.endTest(test);\r\n\t\trep.flush();\r\n\r\n\t}", "@Test\n void testFailure_illegalStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=clientRenewProhibited\"));\n }", "@Override\n public void fail(String status, String msg, Object object) {\n\n }", "public static void\tassertFail(java.lang.String message) \r\n\t\t{\r\n\t\t\tassertFail(message,null);\r\n\t\t}", "@Override\r\n\t\t\t\t\tpublic void failed(String message) {\n\r\n\t\t\t\t\t}", "public void onTestFailure(ITestResult result) {\r\n\t\ttry {\r\n\t\t\t//used to write result details in html\r\n\t\t\tgenerateTestExecution(result);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.getMessage();\r\n\t\t}\r\n\t\t\r\n\t}", "public final void checkExpFails(\n String sql,\n String expected)\n {\n tester.assertExceptionIsThrown(\n TesterImpl.buildQuery(sql),\n expected);\n }", "@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\t\n\t\t\t}", "public static void fail(String stepName, String description) \n\t{\n\t\ttry{\n\t\t\t\tString strImagePath=\"./ScreenShot/\"+getScreenshot();\n\t\t\t\tString strMarkup=getMarkup(strImagePath);\n\t\t\t\ttest.log(LogStatus.FAIL, stepName, description +\"\\n\" + strMarkup);\t\t\t\t\t\t\n\t\t\t\tReporter.blnStatus=false;\n\t\t\t\tblnReportTempStatus=false;\n\t\t}catch(Exception e){fnPrintException(e);}\t\n\t}", "@When(\"^I execute my test case$\")\n public void iExecuteMyTestCase() throws Throwable {\n throw new PendingException();\n }", "public void fail(boolean hcf);", "@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\n\t\t\t}", "@Test\t\t\n\tpublic void TestToFail()\t\t\t\t\n\t{\t\t\n\t System.out.println(\"This method to test fail\");\t\t\t\t\t\n\t // Assert.assertTrue(false);\t\t\t\n\t}", "@Override\n public void testTaskManagerFailure(\n TestEnvironment testEnv,\n ExternalContext<RowData> externalContext,\n ClusterControllable controller)\n throws Exception {\n }", "String failureReason();", "@Test(timeout = 500)\n\tpublic void testGetModuloOne() {\n\t\tAssert.fail();\n\t}", "@Override\r\n\tpublic void onTestFailure(ITestResult iTestResult) {\r\n\t\tString text3 = iTestResult.getTestContext().getName() + \"->\"\r\n\t\t\t\t+ iTestResult.getName() + \"--\" + \" failed\";\r\n\t\tSystem.out.println(iTestResult.getTestContext().getName() + \"->\"\r\n\t\t\t\t+ iTestResult.getName() + \"--\" + \" failed\");\r\n\t\ttestFailed++;\r\n\t\tpassStatusMap.put(Thread.currentThread().getId(), false);\r\n\t\tappendHtlmFileTestName(iTestResult.getName(), \"failed\");\r\n\t\t// appendHtlmFileTestResult(\"failed\");\r\n\t}", "public void failure(Object content){\n\n\t\tif (isParticipant() && (getState() == RequestProtocolState.SENDING_RESULT)) {\n\t\t\tsendMessage(content, Performative.FAILURE, getInitiator());\n\t\t\tsetFinalStep();\n\t\t}\n\t\telse if( isInitiator() ){\n\t\t\taddError(Locale.getString(\"FipaRequestProtocol.12\")); //$NON-NLS-1$\n\t\t}\n\t\telse{\n\t\t\taddError(Locale.getString(\"FipaRequestProtocol.13\")); //$NON-NLS-1$\n\t\t}\n\t}", "@Test(expected = SQLException.class)\n public void testGetDeckException() {\n System.out.println(\"TestgetDeckException\");\n int deckID = 6000;\n Deck result = cardDeckController.getDeck(deckID);\n fail(\"The Deckid was \" + deckID + \"No such information in database, test failed\");\n }", "@Test\n void testFailure_unrecognizedStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=foo\"));\n }", "public void testSoThatTestsDoNotFail() {\n\n }", "@Test\n public void statusReasonTest() {\n // TODO: test statusReason\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void onFail(String msg) {\n\t\t\t\t\t\t\t}", "@Test\n public void testValidationFailed() {\n fail();\n }", "@Then ( \"the Prescription was not added\" )\r\n public void failure () {\r\n // assertTrue( driver.getPageSource().contains( \"Error occurred creating\r\n // prescription\" ) );\r\n }", "public void failed(String msg) {\n failureMsg = msg;\n }", "void illegalCommand(final String reason);", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(result.getName()+\"**********Test Fail.............This is result.getName\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic String getFailDescription() {\n\t\treturn null;\r\n\t}", "@Test\n @ConditionalIgnoreRule.ConditionalIgnore(condition = RunningOnGithubAction.class)\n public void testFailure() throws Exception {\n ExecutorService executorService = Executors.newFixedThreadPool(1);\n try {\n Future<?> future =\n executorService.submit(\n () -> {\n try {\n submitQuery(false, 0);\n } catch (SQLException e) {\n throw new RuntimeSQLException(\"SQLException\", e);\n } catch (InterruptedException e) {\n throw new IllegalStateException(\"task interrupted\", e);\n }\n });\n executorService.shutdown();\n future.get();\n fail(\"should fail and raise an exception\");\n } catch (ExecutionException ex) {\n Throwable rootCause = ex.getCause();\n assertThat(\"Runtime Exception\", rootCause, instanceOf(RuntimeSQLException.class));\n\n rootCause = rootCause.getCause();\n\n assertThat(\"Root cause class\", rootCause, instanceOf(SnowflakeSQLException.class));\n assertThat(\"Error code\", ((SnowflakeSQLException) rootCause).getErrorCode(), equalTo(390114));\n }\n }", "@Override\npublic void onTestFailure(ITestResult result) {\n\t\n}", "public void fail(String message, BufferedImage image) {\r\n\t\treport(FAILED, message, image);\r\n\t}", "public void onTestFailure(ITestResult result) {\n\t \n\t if(result.getStatus()==ITestResult.FAILURE) {\n\t \t\n\t \ttest.log(Status.FAIL,\n\t\t\t\t\t\tMarkupHelper.createLabel(result.getName() + \" - Test Case Failed\", ExtentColor.RED));\n\t \ttest.log(Status.FAIL, MarkupHelper.createLabel(result.getThrowable()+\"The Test Case Fail\", ExtentColor.RED));\n\t \t String imgPath= screenShot.takeScreenShotOfFailTC(BaseClass.getDriver(), result.getMethod().getMethodName());\n\t \ttry {\n\t\t\t\t\ttest.fail(\"ScreenShot is Attached\",MediaEntityBuilder.createScreenCaptureFromPath(imgPath).build());\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\n\t \t\n\t }\n\t }", "@Override\r\n\tpublic void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"onTestFailed -> Test Name: \"+result.getName());\r\n\t}", "public static void\tfail(java.lang.String message, java.lang.Throwable e) \r\n\t\t{\r\n\t\t\tmessage = message + captureScreenshotIfEnabled();\r\n\t\t\ttry {\r\n\t\t\t\tLog.error(e.getMessage() ,e);\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (Exception e2) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t}\r\n\t\t\tLog.error(\"FAIL: \" + message);\r\n\t\t\tif(message.contains(\"<td\"))\r\n\t\t\t{\r\n\t\t\t\tmessage = message.split(\"<td\")[0];\r\n\t\t\t}\r\n\t\t\torg.junit.Assert.fail(message);\r\n\t\t}", "public static void\tassertFail(java.lang.String message, java.lang.Throwable e) \r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\tfail(message,e);\r\n\t\t\t}\r\n\t\t\tcatch(AssertionError ae)\t{\t}\r\n\t\t}", "@Test\n public void accuseFailTest() throws Exception {\n assertTrue(\"failure - accused status was not set to true\", target.isAccused());\n\n }", "@Override\r\n\t\t\t\t\t\tpublic void onFailed(String failReason) {\n\t\t\t\t\t\t\tTypeSDKLogger.e(\"return Error\");\r\n\t\t\t\t\t\t\tTypeSDKLogger.e(\"failReason:\" + failReason);\r\n\t\t\t\t\t\t\tpayResult.SetData(AttName.PAY_RESULT, \"0\");\r\n\t\t\t\t\t\t\tpayResult.SetData(AttName.PAY_RESULT_REASON, \"PAY_FAIL\");\r\n\t\t\t\t\t\t\tnotify.Pay(payResult.DataToString());\r\n\t\t\t\t\t\t}", "@Override\n public void onAnalysisFailed(IntegrationAnalyzer.FailReason failReason) {\n String message = failReason.getMessage();\n Log.d(TAG, \"Fail Reason message is\" + message);\n //..\n\n }", "@Override\n public void failed(String s, Throwable cause)\n {\n }", "@Override\n public void failed(String s, Throwable cause)\n {\n }", "public static void failUnexpectedToReachThis()\r\n\t{\r\n\t\tfail( \"Unexpected to hit this line, as the previous statement should thrown an exception\" ); \r\n\t}", "public void testFailure(final Failure failure) {\n\n AgentClient reportingClient = AgentClient.getInstance();\n\n if (reportingClient == null) {\n LOG.error(\"No reporting client available, please make sure you have a TestProject driver initialized\");\n return;\n }\n\n // Report the error.\n // Proceed only if error is instance of assertion error.\n if (!(failure.getException() instanceof AssertionError)) {\n return;\n }\n\n // Get the assertion error message.\n String resultDescription = failure.getException().getMessage();\n // Proceed only if message is not empty.\n if (resultDescription.isEmpty()) {\n return;\n }\n\n // Skip reporting when disabled, just log it.\n if (reportingClient.getReportsDisabled()) {\n LOG.trace(\"Step [{}] - [{}]\", resultDescription, false);\n return;\n }\n\n // Finally, submit the report\n StepReport report = new StepReport(resultDescription, null, false, null);\n if (!reportingClient.reportStep(report)) {\n LOG.error(\"Failed reporting exception: [{}]\", report);\n }\n\n }", "@Test\n @MediumTest\n @DisabledTest(message = \"crbug.com/1182234\")\n @Feature({\"Payments\"})\n public void testRetryWithCustomError() throws TimeoutException {\n mPaymentRequestTestRule.triggerUIAndWait(\"buy\", mPaymentRequestTestRule.getReadyForInput());\n mPaymentRequestTestRule.clickAndWait(\n R.id.button_primary, mPaymentRequestTestRule.getReadyForUnmaskInput());\n mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait(\n R.id.card_unmask_input, \"123\", mPaymentRequestTestRule.getReadyToUnmask());\n mPaymentRequestTestRule.clickCardUnmaskButtonAndWait(\n ModalDialogProperties.ButtonType.POSITIVE,\n mPaymentRequestTestRule.getPaymentResponseReady());\n\n mPaymentRequestTestRule.retryPaymentRequest(\"{\"\n + \" error: 'ERROR'\"\n + \"}\",\n mPaymentRequestTestRule.getReadyToPay());\n\n Assert.assertEquals(\"ERROR\", mPaymentRequestTestRule.getRetryErrorMessage());\n }", "static public void fail(String message) {\n if (sThrowsOnFailure) {\n throw new AssertionError(message);\n } else {\n StackTraceElement[] traces = Thread.currentThread().getStackTrace();\n Log.println(Log.ASSERT, LOG_TAG, message);\n printStackTrace(traces);\n }\n }", "static void fail(String message) {\n Log.error(message);\n System.exit(1);\n }", "@Then ( \"^The labor and delivery report is not updated successfully$\" )\n public void unsuccessfulEdit () {\n // confirm that the error message is displayed\n waitForAngular();\n try {\n final String temp = driver.findElement( By.name( \"errorMsg\" ) ).getText();\n if ( temp.equals( \"\" ) ) {\n fail();\n }\n }\n catch ( final Exception e ) {\n }\n }", "public void fail(Exception e, String msg) {\r\n System.err.println(msg + \": \" + e);\r\n System.exit(1);\r\n }", "@Override\r\n\tpublic void onFail() {\n\t\tif(bSendStatus)\r\n\t\t\tnativeadstatus(E_ONFAIL);\r\n\t}", "public static void throwIt (short reason){\n systemInstance.setReason(reason);\n throw systemInstance;\n }", "private void assertFail(int value) {\n try {\n converter.convertRomanNumber(value);\n fail();\n } catch (Exception e) {\n }\n }", "@Test\n public void executeWithFailure() {\n new SimpleCommandFailure(\"badRequest\", HystrixRuntimeException.FailureType.COMMAND_EXCEPTION).execute();\n }" ]
[ "0.825232", "0.70271915", "0.6945516", "0.68899786", "0.6755509", "0.66816956", "0.6678286", "0.667625", "0.66581994", "0.6650765", "0.662782", "0.65919054", "0.6579502", "0.65346503", "0.6530183", "0.6467911", "0.64566296", "0.64523", "0.64165694", "0.64165694", "0.6364113", "0.6363897", "0.6363897", "0.6350576", "0.633419", "0.6322155", "0.63123274", "0.6308505", "0.62791646", "0.6266323", "0.6256868", "0.6249028", "0.62378997", "0.62295055", "0.62250125", "0.620192", "0.620149", "0.6199069", "0.6194246", "0.6193964", "0.6185954", "0.61624134", "0.6148908", "0.6090234", "0.6090234", "0.6089122", "0.6062467", "0.6035317", "0.6013606", "0.6003701", "0.5994526", "0.5989907", "0.5988571", "0.5981827", "0.5973351", "0.59695596", "0.5963987", "0.5951852", "0.5947441", "0.5926676", "0.5926637", "0.59157777", "0.590176", "0.5896652", "0.58899665", "0.58738977", "0.58737016", "0.58671486", "0.5859649", "0.58573943", "0.5847508", "0.58418405", "0.5838546", "0.5837264", "0.581405", "0.580515", "0.58005387", "0.58000594", "0.5797787", "0.5790018", "0.5787143", "0.5774459", "0.5756753", "0.5754994", "0.5753331", "0.5749759", "0.5725226", "0.57174015", "0.57174015", "0.5707866", "0.5689738", "0.5671139", "0.5662686", "0.5661931", "0.56581646", "0.5657618", "0.5657026", "0.5652132", "0.5651791", "0.5650037" ]
0.71527576
1
Fails the current test with the given Throwable.
public void threadFail(Throwable e) { failure = e; resume(mainThread); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void testFail() throws Throwable {\n Scheduler userInt = SchedulerTHelper.getSchedulerInterface();\n\n for (int i = 0; i < jobs_fail; i++) {\n String job_path = new File(jobs_path.toURI()).getAbsolutePath() + \"/flow_fail_\" + (i + 1) +\n \".xml\";\n\n Exception exc = null;\n JobId job = null;\n try {\n job = userInt.submit(JobFactory.getFactory().createJob(job_path));\n } catch (Exception e) {\n exc = e;\n }\n Assert\n .assertTrue(\"Job \" + job_path + \" was supposed to be rejected but was created\",\n job == null);\n Assert.assertTrue(exc != null);\n }\n SchedulerTHelper.log(jobs_fail + \" invalid jobs successfully rejected\");\n }", "@Override\n\tpublic void fail(Throwable t) {\n\t}", "protected void runTest() throws Throwable {\n\t\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t\t}", "@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}", "public void testFailure(Failure failure) throws java.lang.Exception {\n test.fail(failure.getException().getLocalizedMessage());\n\n System.out.println(\"Execution of test case failed : \" + failure.getMessage());\n }", "public void onTestFailure(ITestResult tr) {\n\t\ttest= extent.createTest(tr.getName());\n\t\ttest.log(Status.FAIL, MarkupHelper.createLabel(tr.getName(), ExtentColor.RED));\n\t\tString screenShotPath = \"./Screenshot/\"+tr.getName()+\".png\";\n\t\tFile file = new File(screenShotPath);\n\t\tif(file.exists()) {\n\t\t\ttest.fail(\"Screenshot below \"+test.addScreenCaptureFromPath(screenShotPath));\n\t\t}\n\t\t\t\n\t}", "public TestCase fail();", "@Override\r\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\t\r\n\t}", "@Test\n public void testFail(){\n fail(\"This is meant to fail\");\n }", "private void failWithException(final CronetException exception) {\n postTaskToExecutor(new Runnable() {\n @Override\n public void run() {\n failWithExceptionOnExecutor(exception);\n }\n });\n }", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\n\t}", "public void fail( String reason );", "@Override\n public void onTestFailure(ITestResult tr) {\n StatusPrinter.printTestFailure(tr);\n }", "@Test\n void fail_the_test() {\n }", "public ExecutionResult failed(Throwable throwable) {\n var duration = Duration.between(start(), Instant.now());\n return new ExecutionResult(1, duration, out.toString(), err.toString(), throwable);\n }", "public void threadFail(String reason) {\n threadFail(new AssertionError(reason));\n }", "boolean processFailure(Throwable t);", "void setFailed(Throwable lastFailure);", "void onTestFailure(ITestResult result) throws IOException;", "void failed (Exception e);", "public static void\tfail(java.lang.String message, java.lang.Throwable e) \r\n\t\t{\r\n\t\t\tmessage = message + captureScreenshotIfEnabled();\r\n\t\t\ttry {\r\n\t\t\t\tLog.error(e.getMessage() ,e);\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (Exception e2) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t}\r\n\t\t\tLog.error(\"FAIL: \" + message);\r\n\t\t\tif(message.contains(\"<td\"))\r\n\t\t\t{\r\n\t\t\t\tmessage = message.split(\"<td\")[0];\r\n\t\t\t}\r\n\t\t\torg.junit.Assert.fail(message);\r\n\t\t}", "public void testFailure(final Failure failure) {\n\n AgentClient reportingClient = AgentClient.getInstance();\n\n if (reportingClient == null) {\n LOG.error(\"No reporting client available, please make sure you have a TestProject driver initialized\");\n return;\n }\n\n // Report the error.\n // Proceed only if error is instance of assertion error.\n if (!(failure.getException() instanceof AssertionError)) {\n return;\n }\n\n // Get the assertion error message.\n String resultDescription = failure.getException().getMessage();\n // Proceed only if message is not empty.\n if (resultDescription.isEmpty()) {\n return;\n }\n\n // Skip reporting when disabled, just log it.\n if (reportingClient.getReportsDisabled()) {\n LOG.trace(\"Step [{}] - [{}]\", resultDescription, false);\n return;\n }\n\n // Finally, submit the report\n StepReport report = new StepReport(resultDescription, null, false, null);\n if (!reportingClient.reportStep(report)) {\n LOG.error(\"Failed reporting exception: [{}]\", report);\n }\n\n }", "@Test\n public void testFail() {\n fail();\n }", "@Test\n @ConditionalIgnoreRule.ConditionalIgnore(condition = RunningOnGithubAction.class)\n public void testFailure() throws Exception {\n ExecutorService executorService = Executors.newFixedThreadPool(1);\n try {\n Future<?> future =\n executorService.submit(\n () -> {\n try {\n submitQuery(false, 0);\n } catch (SQLException e) {\n throw new RuntimeSQLException(\"SQLException\", e);\n } catch (InterruptedException e) {\n throw new IllegalStateException(\"task interrupted\", e);\n }\n });\n executorService.shutdown();\n future.get();\n fail(\"should fail and raise an exception\");\n } catch (ExecutionException ex) {\n Throwable rootCause = ex.getCause();\n assertThat(\"Runtime Exception\", rootCause, instanceOf(RuntimeSQLException.class));\n\n rootCause = rootCause.getCause();\n\n assertThat(\"Root cause class\", rootCause, instanceOf(SnowflakeSQLException.class));\n assertThat(\"Error code\", ((SnowflakeSQLException) rootCause).getErrorCode(), equalTo(390114));\n }\n }", "@Test\n public void testSuiteLoadError() throws Exception {\n final FuzzJobRunner fuzzJobRunner = createFuzzJobRunnerWithMockServices();\n setupMocks();\n\n when(suiteInstance.getState()).thenReturn(RunState.ERROR);\n when(suiteInstance.getError()).thenReturn(\"Suite error XXX\");\n\n AbortException exception = Assert.assertThrows(\n AbortException.class,\n () -> fuzzJobRunner.run(\n jenkinsRun,\n workspace,\n launcher,\n logger,\n testplan,\n \"\",\n instanceConfiguration,\n saveResultPackage\n )\n );\n assertThat(exception.getMessage(), is(\"Couldn't load suite, error: Suite error XXX\"));\n }", "@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\tSystem.out.println(\"on failure\");\n\t\t\n\t}", "public final void fail(Throwable t) {\n Exceptions.throwIfFatal(t);\n this.s.dispose();\n onError(t);\n }", "@Override\n public void testTaskManagerFailure(\n TestEnvironment testEnv,\n ExternalContext<RowData> externalContext,\n ClusterControllable controller)\n throws Exception {\n }", "public void downloadFailed(Throwable t);", "@When(\"^I execute my test case$\")\n public void iExecuteMyTestCase() throws Throwable {\n throw new PendingException();\n }", "@Test\n\tpublic void test04() throws Throwable {\n\t}", "public void cmdTestError(User teller) {\n throw new RuntimeException(\"This is a test. Don''t worry.\");\n }", "public static void\tassertFail(java.lang.String message, java.lang.Throwable e) \r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\tfail(message,e);\r\n\t\t\t}\r\n\t\t\tcatch(AssertionError ae)\t{\t}\r\n\t\t}", "public void error(Throwable e);", "public void onTestFailure(ITestResult arg0) {\n\t\tSystem.setProperty(\"org.uncommons.reportng.escape-output\", \"false\");\r\n\t\ttry {\r\n\t\t\tTestUtils.captureScreenshot();\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\ttest.log(LogStatus.FAIL,arg0.getName().toUpperCase()+\"Failed with exception \"+arg0.getThrowable());\r\n\t\ttest.log(LogStatus.FAIL,test.addScreenCapture(TestUtils.screenshotName));\r\n\t\t\t\r\n\t\tReporter.log(\"click to continue screen shot\");\r\n\t\tReporter.log(\"<a target=\\\"_blank\\\" href=\"+TestUtils.screenshotName+\">Screenshot</a>\");\r\n\t\tReporter.log(\"</br>\");\r\n\t\tReporter.log(\"<a target=\\\"_blank\\\" href=\"+TestUtils.screenshotName+\"><img src=\"+TestUtils.screenshotName+\" width=200 height=200 </a>\");\t\r\n\t\trep.endTest(test);\r\n\t\trep.flush();\r\n\r\n\t}", "private void failWithExceptionOnExecutor(CronetException e) {\n mException = e;\n // Do not call into mCallback if request is complete.\n synchronized (mNativeStreamLock) {\n if (isDoneLocked()) {\n return;\n }\n mReadState = mWriteState = State.ERROR;\n destroyNativeStreamLocked(false);\n }\n try {\n mCallback.onFailed(this, mResponseInfo, e);\n } catch (Exception failException) {\n Log.e(CronetUrlRequestContext.LOG_TAG, \"Exception notifying of failed request\",\n failException);\n }\n mInflightDoneCallbackCount.decrement();\n }", "void doCatch(Throwable t) throws Throwable;", "public void testMain() throws Throwable {\n\r\n\t}", "public void onFailure(Exception t);", "@Override\n\tpublic void runTest() throws Throwable {}", "@Override\r\n\tpublic void onTestFailure(ITestResult iTestResult) {\r\n\t\tString text3 = iTestResult.getTestContext().getName() + \"->\"\r\n\t\t\t\t+ iTestResult.getName() + \"--\" + \" failed\";\r\n\t\tSystem.out.println(iTestResult.getTestContext().getName() + \"->\"\r\n\t\t\t\t+ iTestResult.getName() + \"--\" + \" failed\");\r\n\t\ttestFailed++;\r\n\t\tpassStatusMap.put(Thread.currentThread().getId(), false);\r\n\t\tappendHtlmFileTestName(iTestResult.getName(), \"failed\");\r\n\t\t// appendHtlmFileTestResult(\"failed\");\r\n\t}", "@Test\n void errorHandlingRegressionTests() {\n assertThrows(ParsingFailureException.class, () -> runAndThrow(\"parsing\"));\n\n assertThrows(PreparedStatementFailureException.class, () -> runAndThrow(\"prepared_4040\"));\n assertThrows(PreparedStatementFailureException.class, () -> runAndThrow(\"prepared_4050\"));\n assertThrows(PreparedStatementFailureException.class, () -> runAndThrow(\"prepared_4060\"));\n assertThrows(PreparedStatementFailureException.class, () -> runAndThrow(\"prepared_4070\"));\n assertThrows(PreparedStatementFailureException.class, () -> runAndThrow(\"prepared_4080\"));\n assertThrows(PreparedStatementFailureException.class, () -> runAndThrow(\"prepared_4090\"));\n\n assertThrows(IndexExistsException.class, () -> runAndThrow(\"index_exists_4300\"));\n assertThrows(IndexExistsException.class, () -> runAndThrow(\"index_exists_5000\"));\n\n assertThrows(PlanningFailureException.class, () -> runAndThrow(\"planning_4000\"));\n assertThrows(PlanningFailureException.class, () -> runAndThrow(\"planning_4321\"));\n\n assertThrows(IndexNotFoundException.class, () -> runAndThrow(\"index_not_found_12004\"));\n assertThrows(IndexNotFoundException.class, () -> runAndThrow(\"index_not_found_12016\"));\n assertThrows(IndexNotFoundException.class, () -> runAndThrow(\"index_not_found_5000\"));\n\n assertThrows(QuotaLimitedException.class, () -> runAndThrow(\"quota_limited\"));\n\n assertThrows(InternalServerFailureException.class, () -> runAndThrow(\"internal_5000\"));\n\n assertThrows(CasMismatchException.class, () -> runAndThrow(\"cas_mismatch\"));\n assertThrows(CasMismatchException.class, () -> runAndThrow(\"cas_mismatch_reason\"));\n\n assertThrows(DmlFailureException.class, () -> runAndThrow(\"dml_failure\"));\n\n assertThrows(AuthenticationFailureException.class, () -> runAndThrow(\"auth_13014\"));\n assertThrows(AuthenticationFailureException.class, () -> runAndThrow(\"auth_10000\"));\n\n assertThrows(IndexFailureException.class, () -> runAndThrow(\"index_12000\"));\n assertThrows(IndexFailureException.class, () -> runAndThrow(\"index_14000\"));\n\n assertThrows(FeatureNotAvailableException.class, () -> runAndThrow(\"query_context\"));\n assertThrows(FeatureNotAvailableException.class, () -> runAndThrow(\"preserve_expiry\"));\n\n assertThrows(UnambiguousTimeoutException.class, () -> runAndThrow(\"streaming\"));\n\n assertThrows(RateLimitedException.class, () -> runAndThrow(\"rate_limited_1191\"));\n assertThrows(RateLimitedException.class, () -> runAndThrow(\"rate_limited_1192\"));\n assertThrows(RateLimitedException.class, () -> runAndThrow(\"rate_limited_1193\"));\n assertThrows(RateLimitedException.class, () -> runAndThrow(\"rate_limited_1194\"));\n\n assertThrows(CouchbaseException.class, () -> runAndThrow(\"empty_list\"));\n assertThrows(CouchbaseException.class, () -> runAndThrow(\"unknown\"));\n\n assertThrows(DocumentNotFoundException.class, () -> runAndThrow(\"kv_notfound\"));\n assertThrows(DocumentExistsException.class, () -> runAndThrow(\"kv_exists\"));\n }", "Throwable cause();", "private void handleException(Throwable throwable,\n ITestNGMethod testMethod,\n ITestResult testResult,\n int failureCount) {\n testResult.setThrowable(throwable);\n int successPercentage= testMethod.getSuccessPercentage();\n int invocationCount= testMethod.getInvocationCount();\n float numberOfTestsThatCanFail= ((100 - successPercentage) * invocationCount) / 100;\n\n if(failureCount < numberOfTestsThatCanFail) {\n testResult.setStatus(ITestResult.SUCCESS_PERCENTAGE_FAILURE);\n }\n else {\n testResult.setStatus(ITestResult.FAILURE);\n }\n\n }", "void markFailed(Execution execution, Throwable cause);", "public void testThrowableThrowable() {\n Throwable th1 = new Throwable(\"aaa\");\n Throwable th = new Throwable(th1);\n assertEquals(\"incorrect message\", \n \"java.lang.Throwable: aaa\", th.getMessage());\n assertSame(\"incorrect cause\", th1, th.getCause());\n assertTrue(\"empty stack trace\", th.getStackTrace().length > 0);\n }", "public static void failUnexpectedToReachThis()\r\n\t{\r\n\t\tfail( \"Unexpected to hit this line, as the previous statement should thrown an exception\" ); \r\n\t}", "private void rethrowIfFailed()\r\n/* 198: */ {\r\n/* 199:232 */ Throwable cause = cause();\r\n/* 200:233 */ if (cause == null) {\r\n/* 201:234 */ return;\r\n/* 202: */ }\r\n/* 203:237 */ PlatformDependent.throwException(cause);\r\n/* 204: */ }", "protected void failed(Throwable e, Description description, String status) {\n TestBench.out().println();\n // Instance of is the best way I know to retrieve this data.\n if (e instanceof MultipleFailureException) {\n /*\n * MultipleFailureExceptions hold multiple exceptions in one exception.\n * In order to properly display these stack traces we have to cast the\n * throwable and work with the list of thrown exceptions stored within\n * it.\n */\n int i = 1; // Running exception count\n int failureCount = ((MultipleFailureException) e).getFailures().size();\n for (Throwable singleThrown : ((MultipleFailureException) e).getFailures()) {\n getClassLogger().logp(\n Level.SEVERE,\n description.getClassName(),\n description.getMethodName(),\n (i++) + \"/\" + failureCount + \" \" + description.getDisplayName() + \" failed \"\n + singleThrown.getMessage() + \"\\n\" + status, singleThrown);\n }\n\n } else {\n getClassLogger().logp(Level.SEVERE, description.getClassName(),\n description.getMethodName(),\n description.getDisplayName() + \" failed \" + e.getMessage() + \"\\n\" + status, e);\n }\n super.failed(e, description);\n }", "public void onFailure(Throwable arg0) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public boolean tryFailure(Throwable cause)\r\n/* 341: */ {\r\n/* 342:424 */ if (setFailure0(cause))\r\n/* 343: */ {\r\n/* 344:425 */ notifyListeners();\r\n/* 345:426 */ return true;\r\n/* 346: */ }\r\n/* 347:428 */ return false;\r\n/* 348: */ }", "public void onFailure(Throwable caught) {\n\r\n\t\t\t}", "public abstract void onFailure(FailureCode code, Throwable ex);", "private void failBuild(final Exception e, final BuildListener listener) throws IOException {\n System.out.print(e.getStackTrace());\n if (this.getShouldNotFailBuild()) {\n listener.error(\"Remote build failed for the following reason, but the build will continue:\");\n listener.error(e.getMessage());\n } else {\n listener.error(\"Remote build failed for the following reason:\");\n throw new AbortException(e.getMessage());\n }\n }", "void visitFailure(Throwable failure);", "void onFailure(Throwable error);", "public void onFailure(Throwable caught) {\n\t\t\t\t\t}", "public void onFailure(Throwable caught) {\n\t\t\t}", "@Test(description=\"Testing Report if Exception is Occurred (Throwing Exception Intentionally)\")\n\tpublic void test() {\n\t\tReporter.log(\"Running test Method from TC010 class\", true);\n\t\tthrow new IllegalStateException();\n\t}", "public void onFailure(Throwable caught) {\n if (attempt > 20) {\n fail();\n }\n \n int token = getToken();\n log(\"onFailure: attempt = \" + attempt + \", token = \" + token\n + \", caught = \" + caught);\n new Timer() {\n @Override\n public void run() {\n runAsync1(attempt + 1);\n }\n }.schedule(100);\n }", "public void onFailure(Throwable caught) {\n\t\t\t\t\n\t\t\t}", "default void orElseThrow(Throwable t) throws Throwable {\n if (isFailure()) throw t;\n }", "@Override\n\tpublic void onTestFailure(ITestResult result) {\n\t\t\n\t\tSystem.out.println(\"Failed Test \" + result.getName());\n\t}", "public static void funcReportTestCaseFailed(String tc_name, Throwable t, boolean flag) {\n\n\t\tErrorUtil.addVerificationFailure(t);\n\t\tTestUtil.addInfo(\"<br><p style='color:red'>\" + tc_name + \" has been failed due to error(s)</p>\");\n\t\tString s1 = TestUtil.processInfo();\n\t\tTestUtil.reportStatus(s1, \"Fail\", flag);\n\t\torg.testng.Assert.fail(tc_name + \" has been failed due to error(s)\" + t);\n\t}", "@Override\n public void failed(String s, Throwable cause)\n {\n }", "@Override\n public void failed(String s, Throwable cause)\n {\n }", "protected void fail(String message) {\n Assert.fail(message);\n }", "public void onTestFailure(ITestResult result) {\r\n\t\ttry {\r\n\t\t\t//used to write result details in html\r\n\t\t\tgenerateTestExecution(result);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.getMessage();\r\n\t\t}\r\n\t\t\r\n\t}", "public void taskSetFailed(TaskSet taskSet, String reason, Throwable exception) {\n eventProcessLoop.post(new TaskSetFailed(taskSet, reason, exception));\n }", "public void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t Throwable throwable, String action);", "public void onTestFailure(ITestResult result) {\n\t \n\t if(result.getStatus()==ITestResult.FAILURE) {\n\t \t\n\t \ttest.log(Status.FAIL,\n\t\t\t\t\t\tMarkupHelper.createLabel(result.getName() + \" - Test Case Failed\", ExtentColor.RED));\n\t \ttest.log(Status.FAIL, MarkupHelper.createLabel(result.getThrowable()+\"The Test Case Fail\", ExtentColor.RED));\n\t \t String imgPath= screenShot.takeScreenShotOfFailTC(BaseClass.getDriver(), result.getMethod().getMethodName());\n\t \ttry {\n\t\t\t\t\ttest.fail(\"ScreenShot is Attached\",MediaEntityBuilder.createScreenCaptureFromPath(imgPath).build());\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\n\t \t\n\t }\n\t }", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"********** \tTest Failed : \"+result.getName());\n\t\t\n\t}", "public void onTestFailure(ITestResult result) {\n \t\n \tSystem.out.println(\"The test case is failed :\"+result.getName());\n }", "@Override\npublic void onTestFailure(ITestResult result) {\n\t\n}", "@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tfail(\"Request failure: \" + caught.getMessage());\n\t\t\t}", "@Test\n public void testSuiteLoadFatalError() throws Exception {\n final FuzzJobRunner fuzzJobRunner = createFuzzJobRunnerWithMockServices();\n setupMocks();\n\n when(suiteInstance.getState()).thenReturn(RunState.FATAL);\n when(suiteInstance.getError()).thenReturn(\"Suite error XXX\");\n\n AbortException exception = Assert.assertThrows(\n AbortException.class,\n () -> fuzzJobRunner.run(\n jenkinsRun,\n workspace,\n launcher,\n logger,\n testplan,\n \"\",\n instanceConfiguration,\n saveResultPackage\n )\n );\n assertThat(exception.getMessage(), is(\"Couldn't load suite, error: Suite error XXX\"));\n }", "@CustomExceptionTest(ArithmeticException.class)\n public static void test5() {\n }", "@Override\n\tpublic void endFail() {\n\t\t\n\t}", "void sendFailureMessage(int statusCode, Header[] headers, byte[] responseBody, Throwable error);", "void exceptionCaught(Throwable cause) throws Exception;", "void exceptionCaught(Throwable cause) throws Exception;", "public void onTryFails(int currentRetryCount, Exception e) {}", "void markFailed(Throwable t) {\n\t}", "public static void FailResult(String failMessage) {\n\t\tLog.info(failMessage);\n\t\tExtentManager.test.fail(failMessage);\n\t\tReporter.log(failMessage);\n\t\tCaptureScreenShotWithTestStepName(driver, \"Failed Screenhot\");\n\t}", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"*********Test onTestFailure :\"+result.getName());\r\n\t}", "public void fail(Exception e, String msg) {\r\n System.err.println(msg + \": \" + e);\r\n System.exit(1);\r\n }", "protected void reportException(Throwable t) {\n }", "void Crash(T ex) throws T;", "public void fail(String message) {\r\n\t\treport(FAILED, message, null);\r\n\t}", "@Override\n\tpublic void onTestFailedWithTimeout(ITestResult result) {\n\t}", "@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void onTestFailedWithTimeout(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedWithTimeout(ITestResult result) {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Fail\");\n\t\t\t\t\t}", "@Test(expectedExceptions = IOException.class, invocationCount = 3)\n public void testCase1() throws IOException {\n System.out.println(\"run testcase1\");\n throw new IOException(\"in test case 1\");\n }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n try { \n DBUtil.runScript(\"\", \"\", (Connection) null, false, (ErrorHandler) null);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(FileNotFoundException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }", "private void uponMsgFail(ProtoMessage msg, Host host, short destProto,\n Throwable throwable, int channelId) {\n logger.error(\"Message {} to {} failed, reason: {}\", msg, host, throwable);\n }", "private void uponMsgFail(ProtoMessage msg, Host host, short destProto,\n Throwable throwable, int channelId) {\n logger.error(\"Message {} to {} failed, reason: {}\", msg, host, throwable);\n }" ]
[ "0.6747252", "0.6711574", "0.6655407", "0.6640734", "0.6640734", "0.644172", "0.63977563", "0.6391107", "0.634957", "0.6344359", "0.63346", "0.63188064", "0.6315384", "0.6275779", "0.6275472", "0.6264246", "0.6240773", "0.62364423", "0.6225857", "0.6198021", "0.61807233", "0.61799085", "0.61559707", "0.61331034", "0.6132844", "0.61097974", "0.6098386", "0.6086447", "0.608336", "0.6055251", "0.6046575", "0.5994194", "0.597837", "0.5975174", "0.5966415", "0.5936149", "0.5934327", "0.59307003", "0.59304017", "0.59239537", "0.58940303", "0.58886", "0.5881999", "0.5879411", "0.58746403", "0.5867014", "0.5849558", "0.58232254", "0.5815958", "0.58049446", "0.5796575", "0.5788443", "0.57797533", "0.57673895", "0.5759676", "0.57486045", "0.5748104", "0.57310283", "0.57310265", "0.5711771", "0.56992894", "0.56960946", "0.5676813", "0.567102", "0.567004", "0.5658015", "0.56525576", "0.56525576", "0.5650232", "0.56339973", "0.5622199", "0.56213456", "0.56195647", "0.5614797", "0.5612108", "0.56068975", "0.5606186", "0.560157", "0.55938804", "0.55819", "0.5572571", "0.55713373", "0.55713373", "0.5560869", "0.55608207", "0.5544776", "0.55364764", "0.5533795", "0.55316377", "0.55178374", "0.55092925", "0.54994637", "0.5495339", "0.5493837", "0.5493837", "0.54876965", "0.5486636", "0.54815125", "0.5478626", "0.5478626" ]
0.6593434
5
Resumes the main test thread.
protected void resume() { resume(mainThread); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resume() throws ADBServerNeedRestartException {\n mStatus = STATUS.RESUMED;\n mTestThread = new TestSessionThread(this);\n if (!isADBServerRestartedMode()) {\n CUIOutputStream.println(\"resume test plan \" + getSessionLog().getTestPlanName()\n + \" (session id = \" + mId + \")\");\n }\n startImpl();\n }", "public void resume(){\r\n\r\n isRunning = true;\r\n ourThread = new Thread(this);\r\n ourThread.start();\r\n }", "public void threadResume()\n {\n synchronized(pauseLock)\n {\n try\n {\n paused = false;\n pauseLock.notifyAll(); //notifying the thread to resume its execution \n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n }\n \n }", "public void resume() {}", "public void resume() {\n running = true;\n gameThread = new Thread(this);\n gameThread.start();\n }", "void resume();", "void resume();", "void resume();", "public void resume();", "public void resume() {\n }", "public void resume()\n {\n // Starting the thread\n gameThread = new Thread(this);\n playing = true;\n gameThread.start();\n }", "@Override\n\t@Ignore\n\t@Test\n\tpublic void testLaunchThenResume() throws Throwable {\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tLog.d(\"RituNavi\", \"MainTestActivity onResume\");\n\t}", "public void onResume() {\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }", "public void runResumeWorkflow() {\n\t\tassert (status == WorkflowStatus.READY\n\t\t\t\t|| status == WorkflowStatus.FINISHED || status == WorkflowStatus.ERROR);\n\n\t\tsetStatus(WorkflowStatus.INITIALIZING);\n\t}", "public void resume() {\n m_suspended = false;\n }", "public void resume() {\n this.suspended = false;\n }", "void startPauseResume() throws RemoteException;", "@Override\r\n\tpublic void resume() {\n\t\tthis.suspended = false;\r\n\t}", "@Override\r\n public void resume() {\n }", "@Override\r\n public void resume() {\n }", "@Override\r\n public void resume() {\n }", "public void resume() {\n\t\t// TODO Auto-generated method stub\n\t}", "@Override\n public void resume() { }", "@Override\n public void resume() {\n }", "@Override\n public void resume() {\n }", "@Override\n public void resume() {\n }", "@Override\n public void resume() {\n // Not used\n }", "@FXML\n void resumeThread(ActionEvent event) {\n resumeBtn.setVisible(false);\n tc.setRunning(true);\n tc.k.resume();\n\n }", "static final void resumeNested(Thread thread)\n {\n VMThread vt = thread.vmThread;\n if (vt != null)\n synchronized (vt)\n {\n if (--vt.suspendCount == 0)\n vt.resume();\n }\n }", "public synchronized void resume() {\r\n\r\n\t\tpaused = false;\r\n\t\tnotifyAll();\r\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\n\tpublic void resume() {\n\t\t\n\t}", "@Override\r\n public void resume() {\r\n\r\n }", "@Override\n public void resume() {\n }", "@Override\r\n\tpublic void resume() {\n\t}", "@Override\n\tpublic void resume() {\n\t}", "@Override\n\tpublic void resume() {\n\t}", "@Override\n\tpublic void resume() {\n\t}", "@Override\n\tpublic void resume() {\n\t}", "@Override\n\tpublic void resume() {\n\t}", "public void resume() {\n playing = true;\n gameThread = new Thread(this);\n gameThread.start();\n }", "public void resume() {\n playing = true;\n gameThread = new Thread(this);\n gameThread.start();\n }", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resume() {\n\t\t\r\n\t}", "@Override\n public void resume() {\n \n }", "@Override\n public void resume() {\n\n }", "@Override\n public void resume() {\n\n }", "@Override\n public void resume() {\n\n }", "public void resume ()\n\t{\n\t\trunning = true;\n\n\t\tif (loopThread == null)\n\t\t{\n\t\t\tloopThread = new Thread(this);\n\t\t\tloopThread.start();\n\t\t}\n\n\t\tif (!loopThread.isAlive())\n\t\t{\n\t\t\tloopThread = new Thread(this);\n\t\t\tloopThread.start();\n\t\t}\n\n\t\tif (mp != null) mp.start();\n\t}", "public void resume()\r\n {\r\n\t timer.start();\r\n }", "public abstract void resume();", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}", "@Override\n\tpublic void resume() {\n\n\t}" ]
[ "0.7344973", "0.7339511", "0.6923242", "0.6922145", "0.6916395", "0.6859968", "0.6859968", "0.6859968", "0.6832148", "0.6792804", "0.67817175", "0.67746675", "0.6764574", "0.67585903", "0.6756307", "0.67543983", "0.66795963", "0.6674413", "0.66420424", "0.6615113", "0.6615113", "0.6615113", "0.66100186", "0.65738875", "0.6568527", "0.6568527", "0.6568527", "0.65677565", "0.656466", "0.656345", "0.6558276", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.65521127", "0.6540709", "0.6538882", "0.653848", "0.6521613", "0.6521613", "0.6521613", "0.6521613", "0.6521613", "0.6506519", "0.65028495", "0.649002", "0.649002", "0.649002", "0.649002", "0.649002", "0.649002", "0.649002", "0.649002", "0.649002", "0.649002", "0.6485778", "0.648299", "0.648299", "0.648299", "0.64754647", "0.644248", "0.64389324", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356", "0.6438356" ]
0.8259078
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); inicioSesion = new javax.swing.JButton(); salir = new javax.swing.JButton(); usuario = new javax.swing.JTextField(); password = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); info = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Inicio Sesion"); inicioSesion.setText("Inicio Sesion"); inicioSesion.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { inicioSesionActionPerformed(evt); } }); salir.setText("Salir"); salir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { salirActionPerformed(evt); } }); usuario.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { usuarioActionPerformed(evt); } }); password.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { passwordActionPerformed(evt); } }); jLabel1.setText("Usuario"); jLabel2.setText("Password"); info.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(33, 33, 33) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(info, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(inicioSesion, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE) .addComponent(salir, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(usuario) .addComponent(password, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)))) .addGap(33, 33, 33)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(39, 39, 39) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(usuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(47, 47, 47) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE) .addComponent(info, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(inicioSesion, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(salir, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(44, 44, 44)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public FrmMenu() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public JFFornecedores() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }", "public frmAddIncidencias() {\n initComponents();\n }" ]
[ "0.73192346", "0.7290526", "0.7290526", "0.7290526", "0.7285891", "0.72480357", "0.7213616", "0.7207808", "0.71955067", "0.71891475", "0.71844363", "0.7159038", "0.71474695", "0.7092269", "0.7079923", "0.70560205", "0.69864315", "0.697697", "0.69552195", "0.6953691", "0.69458604", "0.6942849", "0.6935743", "0.6930747", "0.69286084", "0.6924837", "0.69246644", "0.6911876", "0.69103247", "0.68922365", "0.6891582", "0.68904996", "0.68901706", "0.6888661", "0.68829393", "0.6881672", "0.6880505", "0.68782157", "0.6875765", "0.6874406", "0.68711114", "0.6859388", "0.6856025", "0.68551815", "0.6855079", "0.6855076", "0.68530315", "0.68524104", "0.68524104", "0.6843717", "0.68364704", "0.6836458", "0.6828335", "0.68279964", "0.6826276", "0.68240345", "0.6823631", "0.68171996", "0.6816324", "0.68097955", "0.68088883", "0.68078303", "0.6807776", "0.680721", "0.680251", "0.6795605", "0.6794452", "0.67921954", "0.67907083", "0.678904", "0.6787817", "0.6787755", "0.67814714", "0.67663145", "0.6765024", "0.67649895", "0.6756559", "0.6754775", "0.6751848", "0.67506975", "0.67435455", "0.6738591", "0.6737042", "0.6735227", "0.6732907", "0.6726301", "0.6726003", "0.67197675", "0.67156976", "0.6714806", "0.6713657", "0.6708582", "0.67078584", "0.6705488", "0.6700733", "0.6699659", "0.6698679", "0.66974026", "0.6693979", "0.66902804", "0.6690275" ]
0.0
-1
Merge the DataSourced. The data sources to be used are determined by the seed type TEMPLATE: aggregates a list of data source DATASOURCE: only takes a single data source
private static DataSources toDataSources(OutputGenerator outputGenerator, List<DataSource> sharedDataSources) { final List<DataSource> dataSources = outputGenerator.getDataSources(); final SeedType seedType = outputGenerator.getSeedType(); if (seedType == SeedType.TEMPLATE) { return new DataSources(ListUtils.concatenate(dataSources, sharedDataSources)); } else if (seedType == SeedType.DATASOURCE) { // Since every data source shall generate an output there can be only 1 datasource supplied. Validate.isTrue(dataSources.size() == 1, "One data source expected for generation driven by data sources"); return new DataSources(dataSources); } else { throw new IllegalArgumentException("Don't know how to handle the seed type: " + seedType); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n protected DataSource selectAnyDataSource() {\n if (dataSourcesMtApp.isEmpty()) {\r\n List<MasterTenant> masterTenants = masterTenantRepo.findAll();\r\n LOG.info(\">>>> selectAnyDataSource() -- Total tenants:\" + masterTenants.size());\r\n for (MasterTenant masterTenant : masterTenants) {\r\n dataSourcesMtApp.put(masterTenant.getTenantId(),\r\n DataSourceUtil.createAndConfigureDataSource(masterTenant));\r\n }\r\n }\r\n return this.dataSourcesMtApp.values().iterator().next();\r\n }", "void example4() {\n\t\t\n\t\tIndexedDataSource<UnsignedInt1Member> list1 = \n\t\t\t\tnom.bdezonia.zorbage.storage.Storage.allocate(G.UINT1.construct(), 100);\n\t\t\n\t\tIndexedDataSource<UnsignedInt1Member> list2 = \n\t\t\t\tnom.bdezonia.zorbage.storage.Storage.allocate(G.UINT1.construct(), 1000);\n\t\t\n\t\tIndexedDataSource<UnsignedInt1Member> joinedList =\n\t\t\t\tnew ConcatenatedDataSource<>(list1, list2);\n\t\t\n\t\tFill.compute(G.UINT1, G.UINT1.random(), joinedList);\n\t}", "Map<String,DataSource> load(Set<String> existsDataSourceNames) throws Exception;", "@Override\r\n protected boolean isUseDataSource() {\r\n return true;\r\n }", "@Override\n\tpublic DataSource createDataSource(Plugins plugin, DataSourceConfig dataSourceConfig) {\n \tDruidPlugin druidPlugin = new DruidPlugin(dataSourceConfig.getUrl(),\n \t\t\tdataSourceConfig.getUser(),dataSourceConfig.getPassword(), dataSourceConfig.getDriverClassName());\n \t// 1.统计信息插件\n \tStatFilter statFilter = new StatFilter();\n \tstatFilter.setMergeSql(dataSourceConfig.isDruidMergeSql());\n \tstatFilter.setLogSlowSql(dataSourceConfig.isDruidLogSlowSql());\n \t// 慢查询目前设置为1s,随着优化一步步进行慢慢更改\n \tstatFilter.setSlowSqlMillis(dataSourceConfig.getDruidSlowSqlMillis());\n \tdruidPlugin.addFilter(statFilter);\n \tString dbtype = dataSourceConfig.getType();\n \tif(!\"sqlite\".equals(dbtype)) {\n \t\tWallFilter wall = new WallFilter();\n \t\tProp prop = PropKit.use(\"druid_wall.properties\");\n \t\tif(prop!=null) {\n \t\t\twall.configFromProperties(prop.getProperties());\n \t\t}\n \t\twall.setDbType(dbtype);\n \t\tdruidPlugin.addFilter(wall);\n \t}\n\t\t\n\t\tdruidPlugin.setInitialSize(dataSourceConfig.getInitialSize());\n\t\tdruidPlugin.setMinIdle(dataSourceConfig.getMinIdle());\n\t\tdruidPlugin.setMaxActive(dataSourceConfig.getMaxActive());\n\t\tdruidPlugin.setMaxWait(dataSourceConfig.getMaxWait());\n\t\tif(plugin!=null) {\n\t\t\tplugin.add(druidPlugin);\n\t\t}\n\t\tdruidPlugin.start();\n\t\treturn druidPlugin.getDataSource();\n\t}", "private DataSource.Factory buildDataSourceFactory() {\n return ((DemoApplication) getApplication()).buildDataSourceFactory();\n }", "@Override\n\tprotected void initDataSource() {\n\t}", "@Bean(name = \"dataSource\")\n\tpublic DataSource dataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript(\"db/create-db.sql\").addScript(\"db/insert-data.sql\").build();\n\t\treturn db;\n\t}", "static DataSource[] _getDataSources () throws Exception {\n SearchOptions opts = new SearchOptions (null, 1, 0, 1000); \n TextIndexer.SearchResult results = _textIndexer.search(opts, null);\n Set<String> labels = new TreeSet<String>();\n for (TextIndexer.Facet f : results.getFacets()) {\n if (f.getName().equals(SOURCE)) {\n for (TextIndexer.FV fv : f.getValues())\n labels.add(fv.getLabel());\n }\n }\n\n Class[] entities = new Class[]{\n Disease.class, Target.class, Ligand.class\n };\n\n List<DataSource> sources = new ArrayList<DataSource>();\n for (String la : labels ) {\n DataSource ds = new DataSource (la);\n for (Class cls : entities) {\n opts = new SearchOptions (cls, 1, 0, 100);\n results = _textIndexer.search(opts, null);\n for (TextIndexer.Facet f : results.getFacets()) {\n if (f.getName().equals(SOURCE)) {\n for (TextIndexer.FV fv : f.getValues())\n if (la.equals(fv.getLabel())) {\n if (cls == Target.class)\n ds.targets = fv.getCount();\n else if (cls == Disease.class)\n ds.diseases = fv.getCount();\n else\n ds.ligands = fv.getCount();\n }\n }\n }\n }\n Logger.debug(\"DataSource: \"+la);\n Logger.debug(\" + targets: \"+ds.targets);\n Logger.debug(\" + ligands: \"+ds.ligands);\n Logger.debug(\" + diseases: \"+ds.diseases);\n \n sources.add(ds);\n }\n\n return sources.toArray(new DataSource[0]);\n }", "@Test\n public void testJavaScriptGenerationDataSources() throws Exception {\n setSystemAdministratorContext();\n\n // final Template template = createSaveTemplate(\n // \"/org/openbravo/service/datasource/templates/datasource\", new ArrayList<Template>());\n\n int i = 0;\n for (DataSource dataSource : OBDal.getInstance().createQuery(DataSource.class, \"\").list()) {\n final DataSourceService dataSourceService = dataSourceServiceProvider\n .getDataSource(dataSource.getId());\n final DataSourceComponent component = (DataSourceComponent) dataSourceComponentProvider\n .getComponent(dataSourceService.getName(), new HashMap<String, Object>());\n component.setDataSourceService(dataSourceService);\n i++;\n if ((i % 2) == 0) {\n final Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"_onlyGenerateCreateStatement\", \"true\");\n component.setParameters(params);\n }\n final Map<String, Object> data = new HashMap<String, Object>();\n data.put(\"data\", component);\n final String result = templateProcessor.process(dataSourceService.getTemplate(), data);\n System.err.println(result);\n log.debug(result);\n }\n // prevent actual save of the template\n OBDal.getInstance().rollbackAndClose();\n }", "@Override\n public Set<Datasource> getDatasources() throws ConfigurationException {\n Context context = getContext();\n Set<Datasource> result = new HashSet<>();\n int length = context.getResource().length;\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n // Tomcat 5.5.x or Tomcat 6.0.x\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n String username = context.getResourceUsername(i);\n String url = context.getResourceUrl(i);\n String password = context.getResourcePassword(i);\n String driverClassName = context.getResourceDriverClassName(i);\n if (name != null && username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n if (tomeeVersion != null) {\n TomeeResources actualResources = getResources(false);\n if (actualResources != null) {\n result.addAll(getTomeeDatasources(actualResources));\n }\n }\n } else {\n // Tomcat 5.0.x\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n // find the resource params for the selected resource\n for (int j = 0; j < resourceParams.length; j++) {\n if (name.equals(resourceParams[j].getName())) {\n Parameter[] params = resourceParams[j].getParameter();\n HashMap paramNameValueMap = new HashMap(params.length);\n for (Parameter parameter : params) {\n paramNameValueMap.put(parameter.getName(), parameter.getValue());\n }\n String username = (String) paramNameValueMap.get(\"username\"); // NOI18N\n String url = (String) paramNameValueMap.get(\"url\"); // NOI18N\n String password = (String) paramNameValueMap.get(\"password\"); // NOI18N\n String driverClassName = (String) paramNameValueMap.get(\"driverClassName\"); // NOI18N\n if (username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n }\n }\n }\n return result;\n }", "public void setDataSources(ArrayList dataSources) {\n this.dataSources = dataSources;\n }", "@Override\n\tpublic DataSource getDataSource() {\t\t\n\t\treturn dataSource;\n\t}", "@Override\n public Optional<List<Object[]>> getPopulateTempTableContent() {\n List<Object[]> batchArgs = new ArrayList<>();\n\n for (DataSet dataSet : objects) {\n CategoryCombo categoryCombo = dataSet.getCategoryCombo();\n\n for (OrganisationUnit orgUnit : dataSet.getSources()) {\n if (!categoryCombo.isDefault()) {\n if (orgUnit.hasCategoryOptions()) {\n Set<CategoryOption> orgUnitOptions = orgUnit.getCategoryOptions();\n\n for (CategoryOptionCombo optionCombo : categoryCombo.getOptionCombos()) {\n Set<CategoryOption> optionComboOptions = optionCombo.getCategoryOptions();\n\n if (orgUnitOptions.containsAll(optionComboOptions)) {\n Date startDate =\n DateUtils.min(\n optionComboOptions.stream()\n .map(co -> co.getStartDate())\n .collect(Collectors.toSet()));\n Date endDate =\n DateUtils.max(\n optionComboOptions.stream()\n .map(co -> co.getAdjustedEndDate(dataSet))\n .collect(Collectors.toSet()));\n\n List<Object> values =\n Lists.newArrayList(\n dataSet.getId(), orgUnit.getId(), optionCombo.getId(), startDate, endDate);\n\n batchArgs.add(values.toArray());\n }\n }\n }\n } else {\n List<Object> values =\n Lists.newArrayList(\n dataSet.getId(), orgUnit.getId(), defaultOptionCombo.getId(), null, null);\n\n batchArgs.add(values.toArray());\n }\n }\n }\n\n return Optional.of(batchArgs);\n }", "public void addDataSources(Collection<DataSource> sources) {\n if (containsDataSource(sources)) { // there are duplicates so trim the collection\n removeIdenticalDataSources(sources);\n }\n datasources.addAll(sources);\n }", "public void addPreferredDataSources(Collection<DataSource> sources) {\n if (containsDataSource(sources)) { // there are duplicates so trim the collection\n removeIdenticalDataSources(sources);\n } \n datasources.addAll(0,sources);\n }", "@Override\n public String getDataSource()\n {\n return dataSource;\n }", "@Autowired\n public void setDataSources(\n @Qualifier(\"dataSourceWarehousePoland\") DataSource dataSourceWarehousePoland,\n @Qualifier(\"dataSourceWarehouseFinland\") DataSource dataSourceWarehouseFinland,\n @Qualifier(\"dataSourceFinance\") DataSource dataSourceFinance) {\n this.jdbcWarehousePoland = new JdbcTemplate(dataSourceWarehousePoland);\n this.jdbcWarehouseFinland = new JdbcTemplate(dataSourceWarehouseFinland);\n this.jdbcFinance = new JdbcTemplate(dataSourceFinance);\n }", "@Override\n public Datasource createDatasource(final String name, final String url, \n final String username, final String password, final String driverClassName) \n throws ConfigurationException, DatasourceAlreadyExistsException {\n List<Datasource> conflictingDS = new ArrayList<>();\n for (Datasource datasource : getDatasources()) {\n if (name.equals(datasource.getJndiName())) {\n conflictingDS.add(datasource);\n }\n }\n if (conflictingDS.size() > 0) {\n throw new DatasourceAlreadyExistsException(conflictingDS);\n }\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n if (tomeeVersion != null) {\n // we need to store it to resources.xml\n TomeeResources resources = getResources(true);\n assert resources != null;\n modifyResources( (TomeeResources tomee) -> {\n Properties props = new Properties();\n props.put(\"userName\", username); // NOI18N\n props.put(\"password\", password); // NOI18N\n props.put(\"jdbcUrl\", url); // NOI18N\n props.put(\"jdbcDriver\", driverClassName); // NOI18N\n StringWriter sw = new StringWriter();\n try {\n props.store(sw, null);\n } catch (IOException ex) {\n // should not really happen\n LOGGER.log(Level.WARNING, null, ex);\n }\n int idx = tomee.addTomeeResource(sw.toString());\n tomee.setTomeeResourceId(idx, name);\n tomee.setTomeeResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n });\n } else {\n // Tomcat 5.5.x or Tomcat 6.0.x\n modifyContext((Context context) -> {\n int idx = context.addResource(true);\n context.setResourceName(idx, name);\n context.setResourceAuth(idx, \"Container\"); // NOI18N\n context.setResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n context.setResourceDriverClassName(idx, driverClassName);\n context.setResourceUrl(idx, url);\n context.setResourceUsername(idx, username);\n context.setResourcePassword(idx, password);\n context.setResourceMaxActive(idx, \"20\"); // NOI18N\n context.setResourceMaxIdle(idx, \"10\"); // NOI18N\n context.setResourceMaxWait(idx, \"-1\"); // NOI18N\n });\n }\n } else {\n // Tomcat 5.0.x\n modifyContext((Context context) -> {\n int idx = context.addResource(true);\n context.setResourceName(idx, name);\n context.setResourceAuth(idx, \"Container\"); // NOI18N\n context.setResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n // check whether resource params not already defined\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < resourceParams.length; i++) {\n if (name.equals(resourceParams[i].getName())) {\n // if this happens in means that for this ResourceParams\n // element was no repspective Resource element - remove it\n context.removeResourceParams(resourceParams[i]);\n }\n }\n ResourceParams newResourceParams = createResourceParams(\n name,\n new Parameter[] {\n createParameter(\"factory\", \"org.apache.commons.dbcp.BasicDataSourceFactory\"), // NOI18N\n createParameter(\"driverClassName\", driverClassName), // NOI18N\n createParameter(\"url\", url), // NOI18N\n createParameter(\"username\", username), // NOI18N\n createParameter(\"password\", password), // NOI18N\n createParameter(\"maxActive\", \"20\"), // NOI18N\n createParameter(\"maxIdle\", \"10\"), // NOI18N\n createParameter(\"maxWait\", \"-1\") // NOI18N\n }\n );\n context.addResourceParams(newResourceParams);\n });\n }\n return new TomcatDatasource(username, url, password, name, driverClassName);\n }", "@Override\n\tpublic void setDataSource(DataSource dataSource) {\n\t}", "@Override\r\n\tpublic void addRuleInstances(Digester digester) {\n\t\t digester.addRule(prefix+\"/data-source\",new ObjectCreateRule(\"com.cup.sample.digester.bean.DataSource\", \"className\"));\r\n\t\t digester.addSetProperties(prefix+\"/data-source\");\r\n\t\t\r\n\t}", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "public IterableDataSource(final DataSourceImpl anotherDataSource) {\n super(anotherDataSource);\n }", "public void addPreferredDataSource(DataSource source) { \n if (!containsDataSource(source)) datasources.add(0,source);\n }", "public void makeDataSourceCloneable(){\n\t\tsetMainDataSource(Manager.createCloneableDataSource(getMainDataSource()));\n\t\t/*\n\t\tif(processor==null || processor.getDataOutput()==null){\n\t\t\tsetMainDataSource(Manager.createCloneableDataSource(getMainDataSource()));\n\t\t}else{\n\t\t\tsetMainDataSource(Manager.createCloneableDataSource(processor.getDataOutput()));\n\t\t}\n\t\t*/\n\t}", "private void merge(DefaultSingleGraphDataUnit source) throws LpException {\n try {\n execute((connection) -> {\n final Update update = connection.prepareUpdate(\n QueryLanguage.SPARQL, QUERY_COPY);\n final SimpleDataset dataset = new SimpleDataset();\n dataset.addDefaultGraph(source.getReadGraph());\n dataset.setDefaultInsertGraph(graph);\n update.setDataset(dataset);\n update.execute();\n });\n } catch (LpException ex) {\n throw new LpException(\"Can't merge with: {}\",\n source.getIri(), ex);\n }\n }", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "protected MapDataSet mergeDataSets(List<MapDataSet> dataSets, MergingDataSetDefinition dataSetDefinition, EvaluationContext context) {\n \t\tMapDataSet ret = new MapDataSet(dataSetDefinition, context);\n \n \t\tList<DataSetColumn> columns = new ArrayList<DataSetColumn>();\n \n \t\t// Gather all columns from all contained data sets\n \t\tfor (DataSet dataSet : dataSets) {\n \t\t\tfor (DataSetColumn column : dataSet.getMetaData().getColumns()) {\n \t\t\t\tcolumns.add(column);\n \t\t\t}\n \t\t}\n \n \t\t// Sort the columns according to the merge order\n \t\tif (MergingDataSetDefinition.MergeOrder.NAME.equals(dataSetDefinition.getMergeOrder())) {\n \t\t\tCollections.sort(columns, new Comparator<DataSetColumn>() {\n \t\t\t\t@Override\n \t\t\t\tpublic int compare(DataSetColumn column1, DataSetColumn column2) {\n \t\t\t\t\treturn OpenmrsUtil.compareWithNullAsGreatest(column1.getName(), column2.getName());\n \t\t\t\t}\n \t\t\t});\n \t\t}\n \t\telse if (MergingDataSetDefinition.MergeOrder.LABEL.equals(dataSetDefinition.getMergeOrder())) {\n \t\t\tCollections.sort(columns, new Comparator<DataSetColumn>() {\n \t\t\t\t@Override\n \t\t\t\tpublic int compare(DataSetColumn column1, DataSetColumn column2) {\n \t\t\t\t\treturn OpenmrsUtil.compareWithNullAsGreatest(column1.getLabel(), column2.getLabel());\n \t\t\t\t}\n \t\t\t});\n \t\t}\n \n \t\tret.getMetaData().setColumns(columns);\n \n \t\t// Gather column data values from all contained data sets\n \t\tfor (MapDataSet dataSet : dataSets) {\n \t\t\tfor (DataSetColumn column : dataSet.getMetaData().getColumns()) {\n \t\t\t\tret.addData(column, getDataSetData(dataSet, column));\n \t\t\t}\n \t\t}\n \n \t\treturn ret;\n \t}", "DataSource clone();", "EDataSourceType getDataSource();", "public DataSource createImpl()\n {\n if (_impl == null)\n {\n // create a param defining the datasource\n \n \tJdbcDataSourceParam dsParam = new JdbcDataSourceParam(getName(),\n getJdbcDriver(), getJdbcUrl() , //getJdbcCatalog(),\n getJdbcUser(), getJdbcPassword());//+ \":\" + getJdbcCatalog()\n\n // get/create the datasource\n _impl = DataManager.getDataSource(dsParam);\n\n // get the entities, create and add them\n Vector v = getEntities();\n for (int i = 0; i < v.size(); i++)\n {\n EntityDobj ed = (EntityDobj) v.get(i);\n _impl.addEntity(ed.createImpl());\n }\n\n // get the joins, create and add them\n v = getJoins();\n for (int i = 0; i < v.size(); i++)\n {\n JoinDobj jd = (JoinDobj) v.get(i);\n _impl.addJoin(jd.createImpl());\n }\n }\n\n return _impl;\n }", "String getDataSource();", "@Override\r\n\tpublic void merge(List<EObject> sources, List<EObject> targets) {\n\t\tcontext = targets.get(0).eResource().getResourceSet();\r\n\r\n\t\tsuper.merge(sources, targets);\r\n\t}", "public void addDataSource(DataSource source) {\n if (!containsDataSource(source)) datasources.add(source);\n }", "@SneakyThrows\n protected void addSourceResource() {\n if (databaseType instanceof MySQLDatabaseType) {\n try (Connection connection = DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl(\"\"), \"root\", \"root\")) {\n connection.createStatement().execute(\"USE sharding_db\");\n addSourceResource0(connection);\n }\n } else {\n Properties queryProps = ScalingCaseHelper.getPostgreSQLQueryProperties();\n try (Connection connection = DriverManager.getConnection(JDBC_URL_APPENDER.appendQueryProperties(getComposedContainer().getProxyJdbcUrl(\"sharding_db\"), queryProps), \"root\", \"root\")) {\n addSourceResource0(connection);\n }\n }\n List<Map<String, Object>> resources = queryForListWithLog(\"SHOW DATABASE RESOURCES FROM sharding_db\");\n assertThat(resources.size(), is(2));\n }", "@Bean\n\tpublic DataSourceDao dataSourceDao() {\n\t\tDataSourceDao metadata = new DataSourceDao();\n\t\tmetadata.put(\"rslite\", dsRSLite());\n\t\tmetadata.put(\"rastreosat\", dsRS());\n\t\tmetadata.put(\"entel\", dsEntel());\n\t\tmetadata.put(\"mongo\", dsMongo());\n\t\treturn metadata;\n\t}", "static public DataSource getDataSource(Context appContext) {\n // As per\n // http://goo.gl/clVKsG\n // we can rely on the application context never changing, so appContext is only\n // used once (during initialization).\n if (ds == null) {\n //ds = new InMemoryDataSource();\n //ds = new GeneratedDataSource();\n ds = new CacheDataSource(appContext, 20000);\n }\n \n return ds;\n }", "DataSources retrieveDataSources() throws RepoxException;", "public TemporaryDataSource(DataSource dataSource){\n\t\tthis.ds = dataSource;\n\t}", "public static void createEntitySources() {\n UUID makeBreakfastId = UUID.fromString(\"fab3906e-b50a-11eb-b13c-0242ac110002\"); //saved.getId()\n ITodo makeBreakfast = SelectTemplate.selectOne(ITodo.class, new Object[]{makeBreakfastId}, new HashMap<>());\n System.out.println(\"selected -> \" + makeBreakfast.getId());\n\n UUID makePancakeId = UUID.fromString(\"fab6a862-b50a-11eb-b13c-0242ac110002\");\n ITodo makePancake = SelectTemplate.selectOne(ITodo.class, new Object[]{makePancakeId}, new HashMap<>());\n System.out.println(\"selected -> \" + makePancake.getId());\n\n //modify found task\n makeBreakfast.setNextTask(makePancake);\n\n //updated modified task\n UpdateTemplate.updateOne(makeBreakfast);\n ITodo updatedTask = SelectTemplate.selectOne(ITodo.class, new Object[]{makeBreakfast.getId()}, new HashMap<>());\n System.out.println(\"updated -> \" + updatedTask.getId());\n }", "String afficherDataSource();", "@Bean(name = \"datasource1\")\n\t@ConfigurationProperties(prefix = \"database1.datasource\")\n\t@Primary\n\tpublic DataSource dataSource1() {\n\t\treturn DataSourceBuilder.create().build();\n\t}", "@Nonnull\r\n List<DataSource> getDataSources();", "@Bean\r\n public DataSource dataSource() {\r\n String message = messageSource.getMessage(\"begin\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\r\n dataSource.setDriverClassName(propDatabaseDriver);\r\n dataSource.setUrl(propDatabaseUrl);\r\n dataSource.setUsername(propDatabaseUserName);\r\n dataSource.setPassword(propDatabasePassword);\r\n\r\n message = messageSource.getMessage(\"end\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n return dataSource;\r\n }", "public void createDataSourceReturnsCorrectDefinition() {\n SoftDeleteColumnDeletionDetectionPolicy deletionDetectionPolicy =\n new SoftDeleteColumnDeletionDetectionPolicy()\n .setSoftDeleteColumnName(\"isDeleted\")\n .setSoftDeleteMarkerValue(\"1\");\n\n HighWaterMarkChangeDetectionPolicy changeDetectionPolicy =\n new HighWaterMarkChangeDetectionPolicy(\"fakecolumn\");\n\n // AzureSql\n createAndValidateDataSource(createTestSqlDataSourceObject(null, null));\n createAndValidateDataSource(createTestSqlDataSourceObject(deletionDetectionPolicy, null));\n createAndValidateDataSource(createTestSqlDataSourceObject(null, new SqlIntegratedChangeTrackingPolicy()));\n createAndValidateDataSource(createTestSqlDataSourceObject(deletionDetectionPolicy,\n changeDetectionPolicy));\n\n // Cosmos\n createAndValidateDataSource(createTestCosmosDataSource(null, false));\n createAndValidateDataSource(createTestCosmosDataSource(null, true));\n createAndValidateDataSource(createTestCosmosDataSource(deletionDetectionPolicy, false));\n createAndValidateDataSource(createTestCosmosDataSource(deletionDetectionPolicy, false));\n\n // Azure Blob Storage\n createAndValidateDataSource(createTestBlobDataSource(null));\n createAndValidateDataSource(createTestBlobDataSource(deletionDetectionPolicy));\n\n // Azure Table Storage\n createAndValidateDataSource(createTestTableStorageDataSource());\n createAndValidateDataSource(createTestBlobDataSource(deletionDetectionPolicy));\n }", "public void createDataSourceReturnsCorrectDefinition() {\n SoftDeleteColumnDeletionDetectionPolicy deletionDetectionPolicy =\n new SoftDeleteColumnDeletionDetectionPolicy()\n .setSoftDeleteColumnName(\"isDeleted\")\n .setSoftDeleteMarkerValue(\"1\");\n\n HighWaterMarkChangeDetectionPolicy changeDetectionPolicy =\n new HighWaterMarkChangeDetectionPolicy(\"fakecolumn\");\n\n // AzureSql\n createAndValidateDataSource(createTestSqlDataSourceObject(null, null));\n createAndValidateDataSource(createTestSqlDataSourceObject(deletionDetectionPolicy, null));\n createAndValidateDataSource(createTestSqlDataSourceObject(null, new SqlIntegratedChangeTrackingPolicy()));\n createAndValidateDataSource(createTestSqlDataSourceObject(deletionDetectionPolicy,\n changeDetectionPolicy));\n\n // Cosmos\n createAndValidateDataSource(createTestCosmosDataSource(null, false));\n createAndValidateDataSource(createTestCosmosDataSource(null, true));\n createAndValidateDataSource(createTestCosmosDataSource(deletionDetectionPolicy, false));\n createAndValidateDataSource(createTestCosmosDataSource(deletionDetectionPolicy, false));\n\n // Azure Blob Storage\n createAndValidateDataSource(createTestBlobDataSource(null));\n createAndValidateDataSource(createTestBlobDataSource(deletionDetectionPolicy));\n\n // Azure Table Storage\n createAndValidateDataSource(createTestTableStorageDataSource());\n createAndValidateDataSource(createTestBlobDataSource(deletionDetectionPolicy));\n }", "public static void main(String[] args) throws ParseException, SQLException {\n // TODO code application logic here\n// DataSource ds=DataSource.getInstance();\n// DataSource ds1=DataSource.getInstance();\n// DataSource ds2=DataSource.getInstance();\n// System.out.println(ds);\n// System.out.println(ds1);\n// System.out.println(ds2);\n\nUser u=new User(\"kalboussi\",\"hazem2\",\"hazem123\",\"admin\",\"[email protected]\",25142394);\nUser u2=new User(\"hamoudi\",\"bilel\",\"bilel123\",\"agent financier\",\"[email protected]\",20250341);\n\nUserService ps=new UserService();\n//ps.insert(u);\n//ps.Insertps(u2);\n//ps.delete(u);\n//ps.update(u);\nps.search(8).forEach(System.out::println);\nSystem.out.println(ps.displayAll2());\nSimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\nDate date = simpleDateFormat.parse(\"25/12/2010\");\n//System.out.println(date);\nDate date1 = simpleDateFormat.parse(\"25/12/2019\");\n\nStaff s=new Staff(\"sami\",\"mhamdi\",1250.f,\"ouvrier\",\"25dzd6522\",200.f,date);\nStaff s1=new Staff(\"salah\",\"aloui\",1200.f,\"ouvrier\",\"25dzdfd6522\",100.f,date1);\n\nStaffService ss=new StaffService();\n//ss.insert(s1);\n//ss.delete();\nSystem.out.println(ss.search());\nSystem.out.println(ss.displayAll2());\nSystem.out.println(ss.moyenne());\n \n }", "public void replaceAllDataSources(Collection<DataSource> newsources) {\n datasources.clear();\n datasources.addAll(newsources);\n }", "@Bean\n\tpublic DataSource getDataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL)\n\t\t\t\t.addScript(\"crate-db.sql\")\n\t\t\t\t.addScript(\"insert-db.sql\")\n\t\t\t\t.build();\n\t\treturn db;\n\t}", "public void addDataSource(DataSource dataSource) throws Exception {\n\t\tdataSourceMapper.addDataSource(dataSource);\n\t}", "public static JRDataSource getDataSource() {\n\t\treturn new CustomDataSource(1000);\n\t}", "@Bean\n public DataSource dataSource() {\n EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n EmbeddedDatabase db = builder\n .setType(EmbeddedDatabaseType.HSQL) //.H2 or .DERBY\n .addScript(\"db/sql/create-db.sql\")\n .addScript(\"db/sql/insert-data.sql\")\n .build();\n return db;\n }", "@Override\r\n public DataSource selectDataSource(String tenantIdentifier) {\n\r\n tenantIdentifier = initializeTenantIfLost(tenantIdentifier);\r\n\r\n if (!this.dataSourcesMtApp.containsKey(tenantIdentifier)) {\r\n List<MasterTenant> masterTenants = masterTenantRepo.findAll();\r\n LOG.info(\r\n \">>>> selectDataSource() -- tenant:\" + tenantIdentifier + \" Total tenants:\" + masterTenants.size());\r\n for (MasterTenant masterTenant : masterTenants) {\r\n dataSourcesMtApp.put(masterTenant.getTenantId(),\r\n DataSourceUtil.createAndConfigureDataSource(masterTenant));\r\n }\r\n }\r\n return this.dataSourcesMtApp.get(tenantIdentifier);\r\n }", "static public void setDataSource(DataSource source) {\n ds = source;\n }", "public void setDataSource(DataSource dataSource) {\n this.dataSource = dataSource;\n }", "public void setDataSource(DataSource dataSource) {\n this.dataSource = dataSource;\n }", "public void setDataSource(DataSource dataSource) {\n this.dataSource = dataSource;\n }", "private void buildSourceTable()\n {\n // validate\n Util.argCheckNull(_dt);\n\n // get entities\n try\n {\n DataSourceDobj ds = _dt.getSourceDataSource();\n Util.argCheckNull(ds);\n Vector entities = ds.getEntities();\n\n // iterate entities\n EntityDobj ent;\n for(int i = 0; entities != null && i < entities.size(); i++)\n {\n // get the entity\n ent = (EntityDobj)entities.elementAt(i);\n\n // add to source table if not in target table\n if(ent != null)\n {\n // search target list\n boolean inTarget = false;\n TransferEntity te;\n for(int j = 0; !inTarget && j < _lstTarget.getDefaultModel().getSize(); j++)\n {\n te = (TransferEntity)_lstTarget.getDefaultModel().getElementAt(j);\n if(te != null && te.getSourceEntityName().equalsIgnoreCase(ent.getName()))\n inTarget = true;\n }\n\n // if !inTarget add to source\n if(!inTarget)\n _lstSource.addItem(ent);\n }\n }\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"TransferEntitiesPanel.buildSourceTable: \" + e.toString());\n }\n }", "public void setDatasource(DataSource source) {\n datasource = source;\n }", "public String getDataSource() {\n return dataSource;\n }", "@Override\n public void setDataSource(@Qualifier(\"dataSource\") DataSource dataSource) {\n super.setDataSource(dataSource);\n }", "@Bean\r\n\tpublic DataSource getDataSource() {\r\n\t\tfinal HikariDataSource dataSource = new HikariDataSource();\r\n\t\t/*\r\n\t\t * The Following is the Oracle Database Configuration With Hikari Datasource\r\n\t\t */\r\n\t\tdataSource.setMaximumPoolSize(maxPoolSize);\r\n\t\tdataSource.setMinimumIdle(minIdleTime);\r\n\t\tdataSource.setDriverClassName(driver);\r\n\t\tdataSource.setJdbcUrl(url);\r\n\t\tdataSource.addDataSourceProperty(\"user\", userName);\r\n\t\tdataSource.addDataSourceProperty(\"password\", password);\r\n\t\tdataSource.addDataSourceProperty(\"cachePrepStmts\", cachePrepareStmt);\r\n\t\tdataSource.addDataSourceProperty(\"prepStmtCacheSize\", prepareStmtCacheSize);\r\n\t\tdataSource.addDataSourceProperty(\"prepStmtCacheSqlLimit\", prepareStmtCacheSqlLimit);\r\n\t\tdataSource.addDataSourceProperty(\"useServerPrepStmts\", useServerPrepareStmt);\r\n\t\treturn dataSource;\r\n\t}", "public synchronized ContentValues prepareDataSource(DataSource dataSource) {\n byte[] dataSourceArray = toBytes(dataSource);\n long curTime = DateTime.getDateTime();\n ContentValues cValues = new ContentValues();\n\n if (dataSource.getId() != null)\n cValues.put(C_DATASOURCE_ID, dataSource.getId());\n if (dataSource.getType() != null)\n cValues.put(C_DATASOURCE_TYPE, dataSource.getType());\n if (dataSource.getPlatform() != null && dataSource.getPlatform().getId() != null)\n cValues.put(C_PLATFORM_ID, dataSource.getPlatform().getId());\n if (dataSource.getPlatform() != null && dataSource.getPlatform().getType() != null)\n cValues.put(C_PLATFROM_TYPE, dataSource.getPlatform().getType());\n if (dataSource.getPlatformApp() != null && dataSource.getPlatformApp().getId() != null)\n cValues.put(C_PLATFORMAPP_ID, dataSource.getPlatformApp().getId());\n if (dataSource.getPlatformApp() != null && dataSource.getPlatformApp().getType() != null)\n cValues.put(C_PLATFROMAPP_TYPE, dataSource.getPlatformApp().getType());\n if (dataSource.getApplication() != null && dataSource.getApplication().getId() != null)\n cValues.put(C_APPLICATION_ID, dataSource.getApplication().getId());\n if (dataSource.getApplication() != null && dataSource.getApplication().getType() != null)\n cValues.put(C_APPLICATION_TYPE, dataSource.getApplication().getType());\n cValues.put(C_CREATEDATETIME, curTime);\n cValues.put(C_DATASOURCE, dataSourceArray);\n return cValues;\n }", "public DataSourceDetail(DataSourceDetail source) {\n if (source.Id != null) {\n this.Id = new String(source.Id);\n }\n if (source.Title != null) {\n this.Title = new String(source.Title);\n }\n if (source.Name != null) {\n this.Name = new String(source.Name);\n }\n if (source.Type != null) {\n this.Type = new String(source.Type);\n }\n if (source.Description != null) {\n this.Description = new String(source.Description);\n }\n if (source.Schema != null) {\n this.Schema = new String(source.Schema);\n }\n if (source.CmsProject != null) {\n this.CmsProject = new String(source.CmsProject);\n }\n if (source.PkgId != null) {\n this.PkgId = new String(source.PkgId);\n }\n if (source.SchemaVersion != null) {\n this.SchemaVersion = new String(source.SchemaVersion);\n }\n if (source.CreatorId != null) {\n this.CreatorId = new String(source.CreatorId);\n }\n if (source.CreatedAt != null) {\n this.CreatedAt = new String(source.CreatedAt);\n }\n if (source.UpdatedAt != null) {\n this.UpdatedAt = new String(source.UpdatedAt);\n }\n if (source.EnvId != null) {\n this.EnvId = new String(source.EnvId);\n }\n if (source.DataSourceVersion != null) {\n this.DataSourceVersion = new String(source.DataSourceVersion);\n }\n if (source.AppUsageList != null) {\n this.AppUsageList = new DataSourceLinkApp[source.AppUsageList.length];\n for (int i = 0; i < source.AppUsageList.length; i++) {\n this.AppUsageList[i] = new DataSourceLinkApp(source.AppUsageList[i]);\n }\n }\n if (source.PublishedAt != null) {\n this.PublishedAt = new String(source.PublishedAt);\n }\n if (source.ChildDataSourceIds != null) {\n this.ChildDataSourceIds = new String[source.ChildDataSourceIds.length];\n for (int i = 0; i < source.ChildDataSourceIds.length; i++) {\n this.ChildDataSourceIds[i] = new String(source.ChildDataSourceIds[i]);\n }\n }\n if (source.Fun != null) {\n this.Fun = new String(source.Fun);\n }\n if (source.ScfStatus != null) {\n this.ScfStatus = new Long(source.ScfStatus);\n }\n if (source.Methods != null) {\n this.Methods = new String(source.Methods);\n }\n if (source.ChildDataSourceNames != null) {\n this.ChildDataSourceNames = new String[source.ChildDataSourceNames.length];\n for (int i = 0; i < source.ChildDataSourceNames.length; i++) {\n this.ChildDataSourceNames[i] = new String(source.ChildDataSourceNames[i]);\n }\n }\n if (source.IsNewDataSource != null) {\n this.IsNewDataSource = new Long(source.IsNewDataSource);\n }\n if (source.ViewId != null) {\n this.ViewId = new String(source.ViewId);\n }\n if (source.Configuration != null) {\n this.Configuration = new String(source.Configuration);\n }\n if (source.TemplateCode != null) {\n this.TemplateCode = new String(source.TemplateCode);\n }\n if (source.Source != null) {\n this.Source = new Long(source.Source);\n }\n if (source.PublishVersion != null) {\n this.PublishVersion = new String(source.PublishVersion);\n }\n if (source.PublishViewId != null) {\n this.PublishViewId = new String(source.PublishViewId);\n }\n if (source.SubType != null) {\n this.SubType = new String(source.SubType);\n }\n if (source.AuthStatus != null) {\n this.AuthStatus = new Long(source.AuthStatus);\n }\n if (source.AuthInfo != null) {\n this.AuthInfo = new TicketAuthInfo(source.AuthInfo);\n }\n }", "public ArrayList getDataSources() {\n return dataSources;\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.404 -0500\", hash_original_method = \"CD5C82C799E78C74801FDB521CEE7324\", hash_generated_method = \"CD5C82C799E78C74801FDB521CEE7324\")\n \nContext ()\n {\n copyTables();\n }", "@Profile(\"production\")\r\n @Bean(name=\"DataSourceBean\") \r\n public DataSource getDataSource(){\r\n final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();\r\n dsLookup.setResourceRef(true);\r\n DataSource dataSource = dsLookup.getDataSource(\"jdbc/eshop_db\"); \t \r\n return dataSource;\r\n }", "Source updateDatasourceOAI(Source ds) throws RepoxException;", "Source createDatasourceOAI(Source ds, Provider prov) throws RepoxException;", "public void setDataSourceTypes (List<DataSourceType> dataSourceTypes) {\n this.dataSourceTypes = dataSourceTypes;\n }", "public String getDataSource() {\n return dataSource;\n }", "public void setDataSource(DataSource dataSource) {\n\t\tthis.dataSource = dataSource; // Sets the current object this of the class's attribute dataSource eqal to the object of datasource\n\t\tthis.jdbcTemplateObject = new JdbcTemplate(dataSource); // Instantiation of the JDBCTemplateObject class which takes in the object of datasource to set up data synchronization\n\t\t\n\t}", "private void mergeProductData(List<ProductView> productViews,\n Map<String, List<ProductDataView>> productDataViews) {\n LOG.debug(\"Enter.\");\n\n productViews.stream().forEach(\n product -> product.setDataDefinitions(productDataViews.get(product.getId())));\n\n LOG.debug(\"Exit.\");\n }", "public interface DataSource {\r\n\t\r\n\tstatic final String FILE_PATH = \"plugins/DataManager/\";\r\n\t\r\n\tpublic void setup();\r\n\t\r\n\tpublic void close();\r\n\r\n\tpublic boolean set(String pluginKey, String dataKey, String data) ;\r\n\t\r\n\tpublic boolean set(String pluginKey, String dataKey, int data);\r\n\t\r\n\tpublic boolean set(String pluginKey, String dataKey, long data);\r\n\t\r\n\tpublic boolean set(String pluginKey, String dataKey, float data);\r\n\t\r\n\tpublic boolean set(String pluginKey, String dataKey, double data);\r\n\t\r\n\tpublic boolean set(String pluginKey, String dataKey, boolean data);\r\n\r\n\tpublic boolean set(String pluginKey, String dataKey, List<String> data);\r\n\t\r\n\tpublic Optional<String> getString(String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Integer> getInt(String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Long> getLong(String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Float> getFloat(String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Double> getDouble(String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Boolean> getBoolean(String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<List<String>> getList(String pluginKey, String dataKey);\r\n\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, String data) ;\r\n\t\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, int data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, long data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, float data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, double data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, boolean data);\r\n\r\n\tpublic boolean set(UUID uuid, String pluginKey, String dataKey, List<String> data);\r\n\t\r\n\tpublic Optional<String> getString(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Integer> getInt(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Long> getLong(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Float> getFloat(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Double> getDouble(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Boolean> getBoolean(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<List<String>> getList(UUID uuid, String pluginKey, String dataKey);\r\n\t\r\n\tpublic boolean addGroup(String group, String pluginKey);\r\n\t\r\n\tpublic boolean deleteGroup(String group, String pluginKey);\r\n\t\r\n\tpublic boolean isGroup(String group, String pluginKey);\r\n\t\r\n\tpublic boolean addMember(UUID uuid, String group, String pluginKey);\r\n\t\r\n\tpublic boolean removeMember(UUID uuid, String group, String pluginKey);\r\n\t\r\n\tpublic boolean isMember(UUID uuid, String group, String pluginKey);\r\n\t\r\n\tpublic Optional<List<UUID>> getMemberIDs(String group, String pluginKey);\r\n\t\r\n\tpublic List<String> getGroups(String pluginKey);\r\n\t\r\n\tpublic List<String> getGroups(UUID uuid, String pluginKey);\r\n\t\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, String data);\r\n\t\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, int data);\r\n\t\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, long data);\r\n\t\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, float data);\r\n\t\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, double data);\r\n\t\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, boolean data);\r\n\r\n\tpublic boolean set(String group, String pluginKey, String dataKey, List<String> data);\r\n\t\r\n\tpublic Optional<String> getString(String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Integer> getInt(String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Long> getLong(String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Float> getFloat(String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Double> getDouble(String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Boolean> getBoolean(String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<List<String>> getList(String group, String pluginKey, String dataKey);\r\n\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, String data) ;\r\n\t\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, int data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, long data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, float data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, double data);\r\n\t\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, boolean data);\r\n\r\n\tpublic boolean set(UUID uuid, String group, String pluginKey, String dataKey, List<String> data);\r\n\t\r\n\tpublic Optional<String> getString(UUID uuid, String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Integer> getInt(UUID uuid, String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Long> getLong(UUID uuid, String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Float> getFloat(UUID uuid, String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Double> getDouble(UUID uuid, String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<Boolean> getBoolean(UUID uuid, String group, String pluginKey, String dataKey);\r\n\t\r\n\tpublic Optional<List<String>> getList(UUID uuid, String group, String pluginKey, String dataKey);\r\n\r\n}", "protected DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "public DataSource getDataSource() {\n return dataSource;\n }", "public static Map<Integer, DataSource> getAvailableDataSources() {\n\t\tLoadRessources lr;\n\t\ttry {\n\t\t\tlr = new LoadRessources();\n\t\t} catch (JDOMException e1) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"The configuration file dataSource.xml is corrupted. Please check that this file is a valid XML file!\");\n\t\t\treturn null;\n\t\t} catch (IOException e1) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"Unable to open the configuration file dataSources.xml\");\n\t\t\treturn null;\n\t\t}\n\t\tMap<Integer, DataSource> dataSources = lr.extractData();\n\t\treturn dataSources;\n\t}", "@Bean(destroyMethod = \"close\")\n\tpublic DataSource dataSource() {\n\t\tHikariConfig config = Utils.getDbConfig(dataSourceClassName, url, port, \"postgres\", user, password);\n\n try {\n\t\t\tlogger.info(\"Configuring datasource {} {} {}\", dataSourceClassName, url, user);\n config.setMinimumIdle(0);\n\t\t\tHikariDataSource ds = new HikariDataSource(config);\n\t\t\ttry {\n\t\t\t\tString dbExist = \"SELECT datname FROM pg_catalog.pg_database WHERE lower(datname) = lower('\"+databaseName+\"')\";\n\t\t\t\tPreparedStatement statementdbExist = ds.getConnection().prepareStatement(dbExist);\n\t\t\t\tif(statementdbExist.executeQuery().next()) {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tds.close();\n\t\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\t} else {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tString sql = \"CREATE DATABASE \" + databaseName;\n\t\t\t\t\tPreparedStatement statement = ds.getConnection().prepareStatement(sql);\n\t\t\t\t\tstatement.executeUpdate();\n\t\t\t\t\tstatement.close();\n\t\t\t\t\tds.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.error(\"ERROR Configuring datasource SqlException {} {} {}\", e);\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t} catch (Exception ee) {\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\tlogger.debug(\"ERROR Configuring datasource catch \", ee);\n\t\t\t}\n\t\t\tHikariConfig config2 = Utils.getDbConfig(dataSourceClassName, url, port, databaseName, user, password);\n\t\t\treturn new HikariDataSource(config2);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR in database configuration \", e);\n\t\t} finally {\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "public void setDataSource(BasicDataSource dataSource) {\n this.dataSource = dataSource;\n }", "public DataSource getDataSource() {\n return _dataSource;\n }", "@Autowired(required = false)\n\tpublic void setDataSource(DataSource dataSource) {\n\t\tsimpleJdbcTemplate = new JdbcTemplate(dataSource);\n\t\tsimpleJdbcInsert = new SimpleJdbcInsert(dataSource);\n\t\tnamedParameterJdbcOperations = new NamedParameterJdbcTemplate(dataSource);\n\t\tthis.dialect = getDialect(dataSource);\n\t}", "@BeforeClass\n\tpublic static void setupDataSource() {\n\t\tdataSource = new SingleConnectionDataSource();\n\t\tdataSource.setUrl(\"jdbc:postgresql://localhost:5432/campground\");\n\t\tdataSource.setUsername(\"postgres\");\n\t\tdataSource.setPassword(\"postgres1\");\n\t\t/* The following line disables autocommit for connections\n\t\t * returned by this DataSource. This allows us to rollback\n\t\t * any changes after each test */\n\t\tdataSource.setAutoCommit(false);\n\n\t}", "@Override\n public boolean addDataSourceInfo(DataSource ds) {\n return false;\n }", "@Override\n public DynamicTableSource createDynamicTableSource(Context context) {\n FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context);\n\n final ReadableConfig config = helper.getOptions();\n\n // validate all options\n helper.validate();\n\n // get jdbc options\n JdbcOptions jdbcOptions = getJdbcOptions(config);\n\n // get resovled table schema\n ResolvedSchema resolvedSchema = context.getCatalogTable().getResolvedSchema();\n\n // create the table source\n return new ClickHouseDynamicTableSource(jdbcOptions, resolvedSchema);\n\n }", "public synchronized String getDataSource(){\n\t\treturn dataSource;\n\t}", "private void CreateDataIngestors() throws isisicatclient.IcatException_Exception {\n Grouping dataIngestors = new Grouping();\r\n dataIngestors.name = \"DataIngestors\";\r\n dataIngestors.id = port.create(sessionId, dataIngestors);\r\n dataIngestors = (Grouping) port.search(sessionId, \"Grouping[name='DataIngestors']\").get(0);\r\n\r\n List<String> ingestorTables = port.getEntityNames();\r\n\r\n ingestorTables.remove(\"Facility\");\r\n\r\n List<EntityBaseBean> ingestorRules = new ArrayList<>();\r\n for (String table : ingestorTables) {\r\n Rule rule = new Rule();\r\n rule.grouping = dataIngestors;\r\n rule.crudFlags = \"CRUD\"; //no delete permission for ingestors\r\n rule.what = table;\r\n ingestorRules.add(rule);\r\n }\r\n port.createMany(sessionId, ingestorRules);\r\n }", "private void refreshData() {\n try {\n setDataSource(statement.executeQuery(\"select * from \" + sourceTableName));\n } catch (SQLException e) {\n System.err.println(\"Can't execute statement\");\n e.printStackTrace();\n }\n }", "public void replaceDataSource(DataSource newsource) {\n removeDataSourcesWithSameOrigin(newsource);\n datasources.add(newsource);\n }", "@Bean(name = \"datasource2\")\n\t@ConfigurationProperties(prefix = \"database2.datasource\")\n\tpublic DataSource dataSource2() {\n\t\treturn DataSourceBuilder.create().build();\n\t}", "public void setDataSource( DataSource dataSource) {\n\t\tthis.dataSource = dataSource;\n\t}", "@Autowired\n public void setDataSource(DataSource dataSource) {\n this.jdbcTemplate = new JdbcTemplate(dataSource);\n this.namedJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);\n }", "public void replaceDataSource(DataSource oldsource, DataSource newsource) {\n int i=datasources.indexOf(oldsource);\n if (i>=0) datasources.set(i, newsource);\n else datasources.add(newsource);\n }", "@Override\n\t@Transactional(propagation = Propagation.REQUIRED)\n\tpublic void compareDataSource(QualityQuery data) throws Exception {\n\t\tList<DataSourceResult> resultList = metaDataFetchService.listFromColumnResult(data);\n\t\tmetaDataModifyService.mergeDqDataSourceResult(data.getBatchId(), resultList);\n\t}" ]
[ "0.58101064", "0.5785022", "0.5744678", "0.5661742", "0.56614614", "0.56587523", "0.56584424", "0.55882335", "0.5571446", "0.55638653", "0.55340856", "0.55158615", "0.5495477", "0.5466982", "0.5463926", "0.54208905", "0.54085755", "0.53982025", "0.53949624", "0.5388653", "0.53851765", "0.53791803", "0.53791803", "0.53791803", "0.53616464", "0.5333833", "0.5320878", "0.5318204", "0.5310494", "0.5310494", "0.5310494", "0.5310494", "0.5310494", "0.5310494", "0.5300839", "0.5279773", "0.52722055", "0.5268443", "0.5246116", "0.52287316", "0.52262414", "0.52165693", "0.5201867", "0.51964986", "0.5189588", "0.5181423", "0.51792026", "0.51673645", "0.5157838", "0.5146441", "0.5142378", "0.51362944", "0.51362944", "0.5133811", "0.5133345", "0.51297426", "0.5116899", "0.5109103", "0.5099948", "0.5095668", "0.50910157", "0.5087694", "0.5087694", "0.5087694", "0.50853413", "0.50586545", "0.50430775", "0.50306696", "0.50303906", "0.50216174", "0.50194234", "0.5015447", "0.5013335", "0.5013004", "0.5010113", "0.50088394", "0.5006032", "0.500059", "0.49994984", "0.49984857", "0.49937433", "0.49914464", "0.49880123", "0.49834135", "0.49667633", "0.4960879", "0.49524975", "0.49455124", "0.49388665", "0.49322608", "0.49232742", "0.4922327", "0.49214348", "0.49207363", "0.49143693", "0.49093056", "0.49080124", "0.49055153", "0.49053255", "0.48977283" ]
0.6712438
0
Loading FreeMarker templates from absolute paths is not encouraged due to security concern (see which are mostly irrelevant when running on the command line. So we resolve the absolute file instead of relying on existing template loaders.
private static Template template(Configuration configuration, TemplateSource templateSource) { switch (templateSource.getOrigin()) { case TEMPLATE_LOADER: return fromTemplatePath(configuration, templateSource); case TEMPLATE_CODE: return fromTemplateCode(configuration, templateSource); default: throw new IllegalArgumentException("Don't know how to create a template: " + templateSource.getOrigin()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object findTemplateSource(String name)\r\n/* 33: */ throws IOException\r\n/* 34: */ {\r\n/* 35:67 */ if (this.logger.isDebugEnabled()) {\r\n/* 36:68 */ this.logger.debug(\"Looking for FreeMarker template with name [\" + name + \"]\");\r\n/* 37: */ }\r\n/* 38:70 */ Resource resource = this.resourceLoader.getResource(this.templateLoaderPath + name);\r\n/* 39:71 */ return resource.exists() ? resource : null;\r\n/* 40: */ }", "private String loadTemplate(String fileName)\n throws IOException, URISyntaxException\n {\n File file = new File(resolveResourcePath(this.TEMPLATE_PATH + fileName));\n BufferedReader reader = new BufferedReader(new FileReader(file));\n \n StringBuilder builder = new StringBuilder();\n String str = reader.readLine();\n while (str != null)\n {\n builder.append(str);\n str = reader.readLine();\n }\n return builder.toString();\n }", "private String loadTemplate(String templatePath) throws EmailException {\n try {\n ClassLoader classLoader = getClass().getClassLoader();\n File file = new File(classLoader.getResource(templatePath).getFile());\n return new String(Files.readAllBytes(file.toPath()));\n } catch (IOException e) {\n throw new EmailException(\"Error on loading email template\", e);\n } catch (NullPointerException e) {\n throw new EmailException(\"Error on resolving template path\", e);\n }\n }", "public String resolvePath();", "private static FreeMarkerEngine createEngine() {\n Configuration config = new Configuration();\n File templates = new File(\"src/main/resources/spark/template/freemarker\");\n try {\n config.setDirectoryForTemplateLoading(templates);\n } catch (IOException ioe) {\n System.out.printf(\"ERROR: Unable use %s for template loading.%n\", templates);\n System.exit(1);\n }\n return new FreeMarkerEngine(config);\n }", "private Templates load(URL fileSource) throws Exception {\n return m_factory.newTemplates(new StreamSource(fileSource.openStream()));\n }", "ResourceLocation resolve(String path);", "protected final TemplateLoader getTemplateLoader(Configuration config, String themeDir) {\n \n ServletContext context = getServletContext();\n String themeTemplateDir = context.getRealPath(themeDir) + \"/templates\";\n String vitroTemplateDir = context.getRealPath(\"/templates/freemarker\");\n\n try {\n FileTemplateLoader themeFtl = new FileTemplateLoader(new File(themeTemplateDir));\n FileTemplateLoader vitroFtl = new FileTemplateLoader(new File(vitroTemplateDir));\n ClassTemplateLoader ctl = new ClassTemplateLoader(getClass(), \"\");\n TemplateLoader[] loaders = new TemplateLoader[] { themeFtl, vitroFtl, ctl };\n MultiTemplateLoader mtl = new MultiTemplateLoader(loaders);\n return mtl;\n } catch (IOException e) {\n log.error(\"Error loading templates\");\n return null;\n }\n \n }", "private static String p_readFromResource(String path) {\n StringBuffer content = new StringBuffer();\n\n InputStream istream = NamedTemplate.class.getResourceAsStream(path);\n\n if (istream != null) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(istream));\n\n try {\n String line = reader.readLine();\n while (line != null) {\n content.append(line).append(\"\\n\");\n\n line = reader.readLine();\n }\n } catch (IOException e) {\n logger.error(\"NamedTemplate: unable to read template from \" + path, e);\n }\n } else {\n return null;\n }\n\n return content.toString();\n }", "protected abstract String getTemplateFilename();", "public File getTemplateFile();", "protected void initVelocityResourceLoader(VelocityEngine velocityEngine,\n\t\t\tString resourceLoaderPath) throws IOException {\n\t\tStringBuilder resolvedPath = new StringBuilder();\n\t\tString[] paths = StringUtils.commaDelimitedListToStringArray(resourceLoaderPath);\n\t\tResourceLoader resourceLoader = (ResourceLoader) this.config.getConfig(FinderConfig.SPRING_RESOURCE_LOADER);\n\t\tfor (int i = 0; i < paths.length; i++) {\n\t\t\tString path = paths[i];\n\t\t\t// .append(LostVelocityLayoutView.DEFAULT_LAYOUT_DO_NOT_USE).append(\",\")\n\n\t\t\tResource resource = resourceLoader.getResource(path);\n\n\t\t\tFile file = resource.getFile(); // will fail if not resolvable\n\t\t\t\t\t\t\t\t\t\t\t// in the file system\n\t\t\tif (file.getAbsolutePath().indexOf(\"layout\") > 0) {\n\t\t\t\tFile defaultLayout = new File(file.getAbsolutePath() + File.separator\n\t\t\t\t\t\t+ LostVelocityLayoutView.DEFAULT_LAYOUT);\n\t\t\t\tif (defaultLayout.exists()) {\n\t\t\t\t\tdefaultLayout.delete();\n\t\t\t\t}\n\t\t\t\tdefaultLayout.createNewFile();\n\n\t\t\t\tOutputStream os = new FileOutputStream(defaultLayout);\n\t\t\t\tInputStream is = resourceLoader.getResource(\n\t\t\t\t\t\t\"classpath:velocity/\" + LostVelocityLayoutView.DEFAULT_LAYOUT).getURL()\n\t\t\t\t\t\t\t\t\t\t\t\t.openStream();\n\t\t\t\tFileUtil.copy(is, os);\n\n\t\t\t\tFile doNotUseLayout = new File(file.getAbsolutePath() + File.separator\n\t\t\t\t\t\t+ LostVelocityLayoutView.DEFAULT_LAYOUT_DO_NOT_USE);\n\t\t\t\tif (doNotUseLayout.exists()) {\n\t\t\t\t\tdoNotUseLayout.delete();\n\t\t\t\t}\n\t\t\t\tdoNotUseLayout.createNewFile();\n\t\t\t\tFileUtil.copy(\n\t\t\t\t\t\tresourceLoader.getResource(\n\t\t\t\t\t\t\t\t\"classpath:velocity/\"\n\t\t\t\t\t\t\t\t\t\t+ LostVelocityLayoutView.DEFAULT_LAYOUT_DO_NOT_USE)\n\t\t\t\t\t\t\t\t\t\t.getURL().openStream(),\n\t\t\t\t\t\tnew FileOutputStream(doNotUseLayout));\n\t\t\t}\n\n\t\t\tlog.debug(\"Resource loader path [{}] resolved to file [{}]\", path,\n\t\t\t\t\tfile.getAbsolutePath());\n\n\t\t\tresolvedPath.append(file.getAbsolutePath());\n\t\t\tif (i < paths.length - 1) {\n\t\t\t\tresolvedPath.append(',');\n\t\t\t}\n\t\t}\n\t\tvelocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER, \"file\");\n\t\tvelocityEngine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_CACHE, \"true\");\n\t\tvelocityEngine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH,\n\t\t\t\tresolvedPath.toString());\n\t\tinitSpringResourceLoader(velocityEngine, resourceLoaderPath, resourceLoader);\n\t}", "@Bean\n @Description(\"Thymeleaf template resolver serving HTML 5\")\n public ClassLoaderTemplateResolver templateResolver() {\n\n var templateResolver = new ClassLoaderTemplateResolver();\n templateResolver.setPrefix(\"/templates/\");\n templateResolver.setSuffix(\".html\");\n templateResolver.setTemplateMode(\"HTML5\");\n templateResolver.setCharacterEncoding(\"UTF-8\");\n return templateResolver;\n }", "@Override\n public InputStream getInputStream(String templateName) throws IOException {\n if (templateName.contains(\"..\")) {\n throw new RuntimeException(\"templateName must not contain '..' characters\");\n }\n String templateFile = WELL_KNOWN_CONTAINER + \"/\" + templateName.replaceAll(\"^/+\", \"\"); // remove heading separator\n log.trace(\"locating template file: \" + templateFile + \"; requested template name: \" + templateName);\n try {\n Resource res = StaticResourceServlet.StaticResourceProvider.getInstance().getResource(getServletContext(), templateFile);\n if (res.notFound()) {\n throw new IOException(\"Template file not found: \" + templateName);\n }\n return new ByteArrayInputStream(res.getData());\n } catch (Exception e) {\n throw new IOException(\"Failed open template: \" + templateName, e);\n }\n }", "@Override\n public void setTplPath(String arg0) {\n\n }", "public static final Transformer loadXsl(final String absoluteFilePath) {\r\n if ((absoluteFilePath == null) || (absoluteFilePath.length() == 0)) {\r\n logB.error(\"XmlFactory.loadXsl : unable to load template : empty file name !\");\r\n\r\n return null;\r\n }\r\n\r\n Transformer tf = null;\r\n Templates tmp = cacheXSL.get(absoluteFilePath);\r\n\r\n if (tmp == null) {\r\n final File file = new File(absoluteFilePath);\r\n\r\n if (!file.exists()) {\r\n logB.error(\"XmlFactory.loadXsl : unable to load xslt : no file found for : \" + absoluteFilePath);\r\n\r\n return null;\r\n }\r\n\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadXsl : file : \" + file);\r\n }\r\n\r\n try {\r\n tmp = newTemplate(new StreamSource(file));\r\n cacheXSL.put(absoluteFilePath, tmp);\r\n\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadXsl : template : \" + Integer.toHexString(tmp.hashCode()));\r\n }\r\n } catch (final Exception e) {\r\n logB.error(\"XmlFactory.loadXsl : unable to create template for XSL : \" + file, e);\r\n }\r\n }\r\n\r\n if (tmp != null) {\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadXsl : template in cache : \" + Integer.toHexString(tmp.hashCode()));\r\n }\r\n\r\n tf = newTransformer(tmp);\r\n }\r\n\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadXsl : xslt : \" + tf);\r\n }\r\n\r\n return tf;\r\n }", "@Override\n public ITemplate lookup(final String templateName, final Folder folder) {\n ITemplate template = templateManager.lookup(templateName, folder);\n if( template != null ) {\n LogUtils.trace(log, \"lookup: found template from wrapped template manager\");\n return template;\n }\n \n // Not directly on this web, so try to get from underlay, if the web is a host (web's dont support underlays)\n if (folder instanceof Host) {\n try {\n Host theHost = (Host) folder;\n ITemplate r = UnderlayUtils.walkUnderlays(theHost, underlayLocator, new UnderlayUtils.UnderlayVisitor<ITemplate>() {\n\n @Override\n public ITemplate visitUnderlay(Host underLayFolder) throws NotAuthorizedException, BadRequestException {\n ITemplate t = templateManager.lookup(templateName, underLayFolder);\n if( t != null ) {\n LogUtils.trace(log, \"lookup: found template from underlay\", underLayFolder.getName(), \"web\", folder.getWeb());\n //return new WrappedTemplate(t, folder.getWeb());\n return t;\n } else {\n LogUtils.trace(log, \"lookup: did not find template from underlay\", underLayFolder.getName());\n return null;\n } \n }\n }); \n return r;\n } catch (NotAuthorizedException | BadRequestException ex) {\n throw new RuntimeException(ex);\n }\n } else {\n LogUtils.trace(log, \"lookup: no template in wrapped, and target is not a host\", folder.getName());\n return null; // maybe should go to the web's host?\n }\n }", "private void loadAdditionalTemplateBundles(List<TemplateBundle> templates) {\n\t\t\n\t\tString paths = JaspersoftStudioPlugin.getInstance().getPreferenceStore()\n\t\t\t\t.getString(TemplateLocationsPreferencePage.TPP_TEMPLATES_LOCATIONS_LIST);\n\t\tStringTokenizer st = new StringTokenizer(paths, File.pathSeparator + \"\\n\\r\");\n\t\tArrayList<String> pathsList = new ArrayList<String>();\n\t\twhile (st.hasMoreTokens()) {\n\t\t\tpathsList.add(st.nextToken());\n\t\t}\n\t\t\n\t\tfor (String dir : pathsList) {\n\t\t\tFile[] files = new File(dir).listFiles(new FileFilter() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean accept(File f) {\n\t\t\t\t\treturn f.getName().endsWith(\".jrxml\"); //$NON-NLS-1$\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (files != null) {\n\t\t\t\tfor (File f : files) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tTemplateBundle bundle = new TableTemplateBunlde(f.toURI().toURL(), true, JasperReportsConfiguration.getDefaultInstance());\n\t\t\t\t\t\tif (bundle != null && tableTemplateKey.equals(bundle.getProperty(BuiltInCategories.ENGINE_KEY))) {\n\t\t\t\t\t\t\ttemplates.add(bundle);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\t// Log error but continue...\n\t\t\t\t\t\tJaspersoftStudioPlugin.getInstance().getLog().log(\n\t\t\t\t\t\t\t\tnew Status(IStatus.ERROR,JaspersoftStudioPlugin.PLUGIN_ID,\n\t\t\t\t\t\t\t\t\t\tMessageFormat.format(Messages.DefaultTemplateProvider_TemplateLoadingErr,new Object[]{f.getAbsolutePath()}), ex));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Bean\n public SpringResourceTemplateResolver templateResolver() {\n SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();\n templateResolver.setApplicationContext(applicationContext);\n templateResolver.setPrefix(\"/WEB-INF/views/\");\n templateResolver.setSuffix(\".html\");\n return templateResolver;\n }", "public static final Document loadTemplate(final String absoluteFilePath) {\r\n if ((absoluteFilePath == null) || (absoluteFilePath.length() == 0)) {\r\n logB.error(\"XmlFactory.loadTemplate : unable to load template : empty file name !\");\r\n\r\n return null;\r\n }\r\n\r\n Document doc = cacheDOM.get(absoluteFilePath);\r\n\r\n if (doc == null) {\r\n final File file = new File(absoluteFilePath);\r\n\r\n if (!file.exists()) {\r\n logB.error(\"XmlFactory.loadTemplate : unable to load template : no file found for : \" + absoluteFilePath);\r\n\r\n return null;\r\n }\r\n\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadTemplate : file : \" + file);\r\n }\r\n\r\n doc = parse(file);\r\n\r\n if (doc != null) {\r\n cacheDOM.put(absoluteFilePath, doc);\r\n\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\r\n \"XmlFactory.loadTemplate : template : \" + Integer.toHexString(doc.hashCode()) + \" : \\n\" + asString(doc));\r\n }\r\n }\r\n }\r\n\r\n if (doc != null) {\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadTemplate : template in use : \" + Integer.toHexString(doc.hashCode()));\r\n }\r\n\r\n doc = (Document) doc.cloneNode(true);\r\n }\r\n\r\n if (logB.isDebugEnabled()) {\r\n logB.debug(\"XmlFactory.loadTemplate : xml document :\\n\" + asString(doc));\r\n }\r\n\r\n return doc;\r\n }", "public void loadTemplate() throws Exception {\n\t\tScanner fs = new Scanner(this.getClass().getClassLoader().getResourceAsStream(template));\n\t\t\n\t\tStringBuffer sql = new StringBuffer();\n\t\ttry {\n\t\t\twhile(fs.hasNextLine()) {\n\t\t\t\tsql.append(fs.nextLine() + \"\\n\");\n\t\t\t}\n\t\t}finally {\n\t\t\tfs.close();\n\t\t}\n\t\tsqlText = sql.toString();\n\t}", "@Bean\n\tpublic SpringResourceTemplateResolver templateResolver() {\n\n\t\tSystem.out.println(\"execution is reaching templateResolver()\");\n\t\tSpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();\n\t\tresolver.setApplicationContext(applicationContext);\n\t\tresolver.setPrefix(\"/WEB-INF/views/templetes/\");\n\t\tresolver.setSuffix(\".html\");\n\t\tresolver.setTemplateMode(TemplateMode.HTML);\n\t\tresolver.setCacheable(false);\n\t\treturn resolver;\n\t}", "@Override\n protected InputStream getTemplateSource(String templateSourceName) \n \tthrows IOException {\n \t\n \tString path = mTemplates.get(templateSourceName);\n \treturn mServletContext.getResourceAsStream(path);\n }", "public SpringTemplateLoader(ResourceLoader resourceLoader, String templateLoaderPath)\r\n/* 20: */ {\r\n/* 21:55 */ this.resourceLoader = resourceLoader;\r\n/* 22:56 */ if (!templateLoaderPath.endsWith(\"/\")) {\r\n/* 23:57 */ templateLoaderPath = templateLoaderPath + \"/\";\r\n/* 24: */ }\r\n/* 25:59 */ this.templateLoaderPath = templateLoaderPath;\r\n/* 26:60 */ if (this.logger.isInfoEnabled()) {\r\n/* 27:61 */ this.logger.info(\"SpringTemplateLoader for FreeMarker: using resource loader [\" + this.resourceLoader + \r\n/* 28:62 */ \"] and template loader path [\" + this.templateLoaderPath + \"]\");\r\n/* 29: */ }\r\n/* 30: */ }", "@Override\n final public Object load(String name,\n CacheElement ce)\n throws ResourceException\n {\n Template t = null;\n URL tUrl;\n Object ret = null;\n\n tUrl = findTemplate(name);\n try {\n String protocol = tUrl.getProtocol();\n // Treat files as a special case\n if (protocol.equals(\"file\")) {\n File f = new File(tUrl.getFile());\n long lastMod = f.lastModified();\n\n t = new FileTemplate(_broker, f);\n t.parse();\n ret = t;\n if (_cacheSupportsReload) {\n CacheReloadContext reloadContext = new TemplateProvider.FTReloadContext(f, lastMod);\n ce.setReloadContext(reloadDelay.decorate(\"file\", reloadContext));\n }\n } else {\n long lastMod = UrlProvider.getUrlLastModified(tUrl);\n String encoding = tUrl.openConnection().getContentEncoding();\n // encoding may be null. Will be handled by StreamTemplate\n t = new StreamTemplate(_broker, UrlProvider.getUrlInputStream(tUrl), encoding);\n t.setName(name);\n t.parse();\n ret = t;\n if (_cacheSupportsReload) {\n CacheReloadContext reloadContext = new UrlReloadContext(tUrl, lastMod);\n ce.setReloadContext(reloadDelay.decorate(tUrl.getProtocol(), reloadContext));\n }\n }\n } catch (NullPointerException npe) {\n _log.warn(\"BrokerTemplateProvider: Template not found: \" + name);\n } catch (ParseException e) {\n _log.warn(\"BrokerTemplateProvider: Error occured while parsing \" + name, e);\n throw new InvalidResourceException(\"Error parsing template \" + name, e);\n } catch (IOException e) {\n _log.warn(\"BrokerTemplateProvider: IOException while parsing \" + name, e);\n throw new InvalidResourceException(\"Error parsing template \" + name, e);\n } catch (Exception e) {\n _log.warn(\"BrokerTemplateProvider: Error occured while fetching \" + name, e);\n throw new ResourceException(\"Error parsing template \" + name, e);\n }\n if (ret == null)\n throw new NotFoundException(this + \" could not locate \" + name);\n\n return ret;\n }", "private JSONObject loadTemplate(Path extensionResourcePath) throws ExtensionManagementException {\n\n Path templatePath = extensionResourcePath.resolve(TEMPLATE_FILE_NAME);\n if (Files.exists(templatePath) && Files.isRegularFile(templatePath)) {\n return readJSONFile(templatePath);\n }\n return null;\n }", "public CompiledST lookupTemplate(String name) {\n\t\tif (name.charAt(0) != '/')\n\t\t\tname = \"/\" + name;\n\t\tif (verbose)\n\t\t\tSystem.out.println(getName() + \".lookupTemplate(\" + name + \")\");\n\t\tCompiledST code = rawGetTemplate(name);\n\t\tif (code == NOT_FOUND_ST) {\n\t\t\tif (verbose)\n\t\t\t\tSystem.out.println(name + \" previously seen as not found\");\n\t\t\treturn null;\n\t\t}\n\t\t// try to load from disk and look up again\n\t\tif (code == null)\n\t\t\tcode = load(name);\n\t\tif (code == null)\n\t\t\tcode = lookupImportedTemplate(name);\n\t\tif (code == null) {\n\t\t\tif (verbose)\n\t\t\t\tSystem.out.println(name + \" recorded not found\");\n\t\t\ttemplates.put(name, NOT_FOUND_ST);\n\t\t}\n\t\tif (verbose)\n\t\t\tif (code != null)\n\t\t\t\tSystem.out.println(getName() + \".lookupTemplate(\" + name + \") found\");\n\t\treturn code;\n\t}", "public void loadTemplates()\n {\n for (PageTemplate template : templates.values())\n {\n template.load(pageDirectory);\n }\n }", "@Override\n public URL getTemplateLocation() {\n try {\n String[] candidates = getDirectoryCandidates();\n for (int i = 0; i < candidates.length; i++) {\n if (Activator.getDefault().getBundle().getEntry(candidates[i]) != null) {\n URL candidate = new URL(getInstallURL(), candidates[i]);\n return candidate;\n }\n }\n } catch (MalformedURLException e) { // do nothing\n }\n return null;\n }", "public interface TemplateResolver \n{\n\n\t@Nonnull String resolve(@Nonnull String template, @Nullable Object model);\n}", "private static File resolveMetaFile(String path) {\n return new File(StringUtils.substringBefore(path, DEF_LOC_ARTIFACT) + DEF_REL_META + File.separator + \"project.tms.json\");\n }", "public void init() \n { Prepare the FreeMarker configuration;\n // - Load templates from the WEB-INF/templates directory of the Web app.\n //\n cfg = new Configuration();\n cfg.setServletContextForTemplateLoading(\n getServletContext(), \n \"WEB-INF/templates\"\n );\n }", "@Override\n public String doMapping(String template)\n {\n log.debug(\"doMapping({})\", template);\n // Copy our elements into an array\n List<String> components\n = new ArrayList<>(Arrays.asList(StringUtils.split(\n template,\n String.valueOf(TemplateService.TEMPLATE_PARTS_SEPARATOR))));\n int componentSize = components.size() - 1 ;\n\n // This method never gets an empty string passed.\n // So this is never < 0\n String templateName = components.get(componentSize);\n components.remove(componentSize--);\n\n log.debug(\"templateName is {}\", templateName);\n\n // Last element decides, which template Service to use...\n TemplateService templateService = (TemplateService)TurbineServices.getInstance().getService(TemplateService.SERVICE_NAME);\n TemplateEngineService tes = templateService.getTemplateEngineService(templateName);\n\n if (tes == null)\n {\n return null;\n }\n\n String defaultName = \"Default.vm\";\n\n // This is an optimization. If the name we're looking for is\n // already the default name for the template, don't do a \"first run\"\n // which looks for an exact match.\n boolean firstRun = !templateName.equals(defaultName);\n\n for(;;)\n {\n String templatePackage = StringUtils.join(components.iterator(), String.valueOf(separator));\n\n log.debug(\"templatePackage is now: {}\", templatePackage);\n\n StringBuilder testName = new StringBuilder();\n\n if (!components.isEmpty())\n {\n testName.append(templatePackage);\n testName.append(separator);\n }\n\n testName.append((firstRun)\n ? templateName\n : defaultName);\n\n // But the Templating service must look for the name with prefix\n StringBuilder templatePath = new StringBuilder();\n if (StringUtils.isNotEmpty(prefix))\n {\n templatePath.append(prefix);\n templatePath.append(separator);\n }\n templatePath.append(testName);\n\n log.debug(\"Looking for {}\", templatePath);\n\n if (tes.templateExists(templatePath.toString()))\n {\n log.debug(\"Found it, returning {}\", testName);\n return testName.toString();\n }\n\n if (firstRun)\n {\n firstRun = false;\n }\n else\n {\n // We run this loop only two times. The\n // first time with the 'real' name and the\n // second time with \"Default\". The second time\n // we will end up here and break the for(;;) loop.\n break;\n }\n }\n\n log.debug(\"Returning default\");\n return getDefaultName(template);\n }", "public String getTemplateSrc(String templateName) throws IOException {\n String outSource = \"\";\n \n try {\n BufferedReader in = new BufferedReader(new FileReader(templateName)); \n String inline;\n \n while ((inline = in.readLine()) != null) {\n outSource += inline + NEWL_;\n }\n in.close();\n } catch (FileNotFoundException e) {\n throw new IOException(\"template error:\" + e.getMessage() + \" not found.\");\n } catch (IOException e) {\n throw new IOException(\"read template error:\" + e.getMessage());\n }\n \n return outSource;\n }", "private InputSource filesystemLookup(ResourceLocation matchingEntry) {\n\n String uri = matchingEntry.getLocation();\n // the following line seems to be necessary on Windows under JDK 1.2\n uri = uri.replace(File.separatorChar, '/');\n URL baseURL;\n\n //\n // The ResourceLocation may specify a relative path for its\n // location attribute. This is resolved using the appropriate\n // base.\n //\n if (matchingEntry.getBase() != null) {\n baseURL = matchingEntry.getBase();\n } else {\n try {\n baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());\n } catch (MalformedURLException ex) {\n throw new BuildException(\"Project basedir cannot be converted to a URL\");\n }\n }\n\n URL url = null;\n try {\n url = new URL(baseURL, uri);\n } catch (MalformedURLException ex) {\n // this processing is useful under Windows when the location of the DTD\n // has been given as an absolute path\n // see Bugzilla Report 23913\n File testFile = new File(uri);\n if (testFile.exists() && testFile.canRead()) {\n log(\"uri : '\"\n + uri + \"' matches a readable file\", Project.MSG_DEBUG);\n try {\n url = FILE_UTILS.getFileURL(testFile);\n } catch (MalformedURLException ex1) {\n throw new BuildException(\n \"could not find an URL for :\" + testFile.getAbsolutePath());\n }\n } else {\n log(\"uri : '\"\n + uri + \"' does not match a readable file\", Project.MSG_DEBUG);\n\n }\n }\n\n InputSource source = null;\n if (url != null && \"file\".equals(url.getProtocol())) {\n String fileName = FILE_UTILS.fromURI(url.toString());\n if (fileName != null) {\n log(\"fileName \" + fileName, Project.MSG_DEBUG);\n File resFile = new File(fileName);\n if (resFile.exists() && resFile.canRead()) {\n try {\n source = new InputSource(Files.newInputStream(resFile.toPath()));\n String sysid = JAXPUtils.getSystemId(resFile);\n source.setSystemId(sysid);\n log(\"catalog entry matched a readable file: '\"\n + sysid + \"'\", Project.MSG_DEBUG);\n } catch (IOException ex) {\n // ignore\n }\n }\n }\n }\n return source;\n }", "public abstract String getImportFromFileTemplate( );", "private String getTemplate(String templateFile) throws IOException{\r\n \t\tStringBuffer templateBuffer = new StringBuffer();\r\n \t\tFileReader in;\r\n \t\tint c;\r\n \t\tin = new FileReader(new File(templateFolder,templateFile));\r\n \r\n \t\twhile ((c = in.read()) != -1){\r\n \t\t\ttemplateBuffer.append((char) c);\r\n \t\t}\r\n \r\n \t\tString templateString = templateBuffer.toString();\r\n \t\tif (templateString.indexOf(\"startCell\") == (-1)){\r\n \t\t\treturn templateString;\r\n \t\t}else{\r\n \t\t\ttemplateString = templateString.substring(templateString.indexOf(\"startCell\") + 12, templateString.indexOf(\"<!--endCell\"));\r\n \t\t\treturn templateString;\r\n \t\t}\r\n \t}", "private static File generateTemplateFile(String templateFilename) {\n\t\treturn new File(templateFilename);\n\t}", "@Test public void testFullyQualifiedTemplateRef2() throws Exception {\n String dir = getRandomDir();\n writeFile(dir, \"a.st\", \"a(x) ::= << </group/b()> >>\\n\");\n String groupFile =\n \"b() ::= \\\"bar\\\"\\n\"+\n \"c() ::= \\\"</a()>\\\"\\n\";\n writeFile(dir, \"group.stg\", groupFile);\n STGroup group = new STGroupDir(dir);\n ST st1 = group.getInstanceOf(\"/a\");\n ST st2 = group.getInstanceOf(\"/group/c\"); // invokes /a\n String expected = \" bar bar \";\n String result = st1.render()+st2.render();\n assertEquals(expected, result);\n }", "private String createTemplateServerRequest(String servletPath,String templateName) {\n String pathInfo = servletPath.substring(servletPath.indexOf(\"/\",TEMPLATE_LOAD_PROTOCOL.length()));\n if (templateName != null) { \n pathInfo = pathInfo + templateName;\n }\n return pathInfo;\n }", "@Before\n public void setup() throws IOException {\n TemplateLoader normalLoader = freemarkerConfig.getConfiguration().getTemplateLoader();\n freemarkerConfig.getConfiguration().setTemplateLoader(new MultiTemplateLoader(new TemplateLoader[] {\n new FileTemplateLoader(new File(\"CommonWeb/web/WEB-INF/freemarker\")),\n normalLoader\n }));\n\n // Setup Spring test in standalone mode\n this.mockMvc = MockMvcBuilders\n .webAppContextSetup(webApplicationContext)\n .build();\n }", "private InputStream getTemplateSource(String templateSourceName) \n throws IOException {\n TemplateSourceInfo tsInfo = (TemplateSourceInfo)mTemplateMap\n .get(templateSourceName);\n\n HttpClient client = getTemplateServerClient(tsInfo.server);\n HttpClient.Response response = client\n .setURI(createTemplateServerRequest(tsInfo.server,tsInfo.name + \".tea\"))\n .setPersistent(true).getResponse(); \n InputStream in = response.getInputStream();\n return in;\n }", "private Map retrieveTemplateMap() {\n Map templateMap = new TreeMap();\n for (int j=0;j<mRemoteSourceDirs.length;j++) {\n String remoteSource = mRemoteSourceDirs[j];\n if (!remoteSource.endsWith(\"/\")) {\n remoteSource = remoteSource + \"/\";\n }\n \n try {\n HttpClient tsClient = getTemplateServerClient(remoteSource);\n\n HttpClient.Response response = tsClient.setURI(createTemplateServerRequest(remoteSource,null))\n .setPersistent(true).getResponse(); \n\n if (response != null && response.getStatusCode() == 200) {\n\n Reader rin = new InputStreamReader\n (new BufferedInputStream(response.getInputStream()));\n \n StreamTokenizer st = new StreamTokenizer(rin);\n st.resetSyntax();\n st.wordChars('!','{');\n st.wordChars('}','}');\n st.whitespaceChars(0,' ');\n st.parseNumbers();\n st.quoteChar('|');\n st.eolIsSignificant(true);\n String templateName = null; \n int tokenID = 0;\n // ditching the headers by looking for \"\\r\\n\\r\\n\"\n /* \n * no longer needed now that HttpClient is being used but leave\n * in for the moment.\n *\n * while (!((tokenID = st.nextToken()) == StreamTokenizer.TT_EOL \n * && st.nextToken() == StreamTokenizer.TT_EOL) \n * && tokenID != StreamTokenizer.TT_EOF) {\n * }\n */\n while ((tokenID = st.nextToken()) != StreamTokenizer.TT_EOF) {\n if (tokenID == '|' || tokenID == StreamTokenizer.TT_WORD) {\n \n templateName = st.sval;\n }\n else if (tokenID == StreamTokenizer.TT_NUMBER \n && templateName != null) {\n templateName = templateName.substring(1);\n //System.out.println(templateName);\n templateMap.put(templateName.replace('/','.'),\n new TemplateSourceInfo(\n templateName,\n remoteSource,\n (long)st.nval));\n templateName = null;\n }\n }\n }\n }\n catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }\n //System.out.println(\"retrieving templateMap\");\n return templateMap;\n }", "public String getTemplatePath() {\n this.defaultPath = defaultPath.endsWith(File.separator) ? defaultPath : defaultPath + File.separator;\n\n if (Paths.get(defaultPath).toFile().mkdirs()) {\n //Throw exception, couldn't create directories\n }\n\n return defaultPath + (defaultName != null ? defaultName + \".\" + extensionPattern : \"\");\n }", "@Override\n public Integer call() {\n if (properties != null && !properties.isEmpty()) {\n System.getProperties().putAll(properties);\n }\n\n final List<File> templateDirectories = getTemplateDirectories(baseDir);\n\n final Settings settings = Settings.builder()\n .setArgs(args)\n .setTemplateDirectories(templateDirectories)\n .setTemplateName(template)\n .setSourceEncoding(sourceEncoding)\n .setOutputEncoding(outputEncoding)\n .setOutputFile(outputFile)\n .setInclude(include)\n .setLocale(locale)\n .isReadFromStdin(readFromStdin)\n .isEnvironmentExposed(isEnvironmentExposed)\n .setSources(sources != null ? sources : new ArrayList<>())\n .setProperties(properties != null ? properties : new HashMap<>())\n .setWriter(writer(outputFile, outputEncoding))\n .build();\n\n try {\n return new FreeMarkerTask(settings).call();\n } finally {\n if (settings.hasOutputFile()) {\n close(settings.getWriter());\n }\n }\n }", "final public String getTemplateSource()\n {\n return ComponentUtils.resolveString(getProperty(TEMPLATE_SOURCE_KEY));\n }", "public Function2<Object, TemplateOptions, String> template(String templateString);", "private String replaceJavaTemplatePlaceholders(\n final String runnerTemplatePath,\n final String featureFileName,\n final String fileString\n ) {\n String javaFileName = Paths.get(runnerTemplatePath).getFileName().toString();\n String javaFileNameWithoutExtension = javaFileName.substring(0, javaFileName.lastIndexOf('.'));\n String replacedFileString = fileString.replace(javaFileNameWithoutExtension, featureFileName);\n replacedFileString = replacedFileString.replaceAll(\"package .*;\", \"\");\n return replacedFileString;\n }", "public static void processTemplate(String relativePath,\r\n Map<String, ?> data, Writer writer) throws IOException {\r\n\r\n try {\r\n Template template = AppServlet.configuration\r\n .getTemplate(relativePath);\r\n template.process(data, writer);\r\n writer.flush();\r\n } catch (TemplateException e) {\r\n System.err.println(\"The template\" + relativePath\r\n + \"could not be processed properly.\");\r\n e.printStackTrace();\r\n }\r\n }", "protected String getFileTemplate(String sTemplate, String sPath)\n {\n String sFileName = sTemplate;\n\n if (sFileName.length() == 0)\n {\n log(\"Report writer:No output file specified. Report terminated\");\n return null;\n }\n\n try\n {\n sFileName = new File(sPath).getCanonicalPath() + File.separatorChar + sFileName;\n }\n catch (IOException e)\n {\n // leave the problem for caller\n sFileName = sPath + sFileName;\n }\n\n return sFileName;\n }", "protected TemplateResolver getTemplateResolver() {\n return templateResolver;\n }", "@Override\n public InputStream findResource(String filename)\n {\n InputStream resource = null;\n try\n {\n Path scriptRootPath = Files.createDirectories(getScriptRootPath(side));\n Path scriptPath = scriptRootPath.resolve(filename).toAbsolutePath();\n resource = Files.newInputStream(scriptPath, StandardOpenOption.READ);\n } catch (IOException e)\n {\n resource = super.findResource(filename);\n }\n return resource;\n }", "public void init(){\n\t\tcfg = new Configuration();\r\n\t\tcfg.setServletContextForTemplateLoading(getServletContext(), \"WEB-INF/templates\");\r\n }", "public String outputTemplateBase() throws IOException {\n\t\tVelocityEngine ve = new VelocityEngine();\n\t\tve.setProperty(RuntimeConstants.RESOURCE_LOADER, \"classpath\");\n\t\tve.setProperty(\"classpath.resource.loader.class\",\n\t\t\t\tClasspathResourceLoader.class.getName());\n\n\t\tve.init();\n\t\t/* next, get the Template */\n\t\tTemplate t = ve.getTemplate(\"de/velocityTest/helloworld.vm\");\n\t\t/* create a context and add data */\n\t\tVelocityContext context = new VelocityContext();\n\t\tcontext.put(\"name\", \"World\");\n\t\t/* now render the template into a StringWriter */\n\t\tFile file = new File(\"./test.txt\");\n\t\tFileWriter out = new FileWriter(file);\n\t\tBufferedWriter w = new BufferedWriter(out);\n\t\tStringWriter writer = new StringWriter();\n\t\tt.merge(context, w);\n\t\tw.flush();\n\t\t/* show the World */\n\t\treturn w.toString();\n\t}", "public interface TemplateEngineService {\n\n /**\n * Get the EngineFactory for the template engine name given.\n * \n * @param name\n * of the TemplateEngine to be retrieved.\n * @return TemplateEngine for the given engine name or null for an unknown\n * engine name.\n */\n public TemplateEngine getEngine( String name );\n\n /**\n * Gets the collection with all available template engines.\n * \n * @return A collection of available template engines. If there are no\n * template engines availabel the collection will be empty.\n */\n public Collection<TemplateEngine> getEngines();\n\n /**\n * Convenience method that immediately creates a Template based on the actual\n * template file/reader. To accomplish this the TemplateEngine is determined\n * by the contents of the template file/reader. That particular template\n * engine is used to create the Template.\n * \n * TODO: describe shebang\n * \n * @param reader\n * The reader to be used for the Template\n * @return A valid Template object for the given reader.\n * @throws IOException\n * when using the reader fails\n * @throws TemplateCompilationException\n * when compiling the template fails.\n * @throws MissingShebangException\n * when the template lacks a shebang.\n * @throws UnknownEngineException\n * when the shebang refers to an engine that is not known to the\n * engine factory.\n */\n public Template getTemplate( Reader reader ) throws IOException, TemplateCompilationException,\n MissingShebangException, UnknownEngineException;\n\n}", "public static void main(String[] args) {\n\t\tPath path = Paths.get(\"F:\\\\AccentureMayBatch\\\\JSTLProject\");\r\n\r\n\t\r\n\r\n\t\tSystem.out.format(\"toString: %s%n\", path.toString());\r\n\t\tSystem.out.format(\"getFileName: %s%n\", path.getFileName());\r\n\t\tSystem.out.format(\"getName(0): %s%n\", path.getName(0));\r\n\t\tSystem.out.format(\"getNameCount: %d%n\", path.getNameCount());\r\n\t\tSystem.out.format(\"subpath(0,2): %s%n\", path.subpath(0,2));\r\n\t\tSystem.out.format(\"getParent: %s%n\", path.getParent());\r\n\t\tSystem.out.format(\"getRoot: %s%n\", path.getRoot());\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFiles.list(new File(\".\").toPath())\r\n\t\t\t .forEach(System.out::println);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tFiles.walk(new File(\".\").toPath())\r\n\t\t .filter(p -> !p.getFileName()\r\n\t\t .toString().startsWith(\".\"))\r\n\t\t .forEach(System.out::println);\r\n\t\t\t\r\n\t\t\tFiles.lines(new File(\"./src/com/polaris/utility/PathDemo.java\").toPath())\r\n\t\t .map(s -> s.trim())\r\n\t\t .filter(s -> !s.isEmpty())\r\n\t\t .forEach(System.out::println);\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//finding path and sub path into string\r\n\t\t Path start = Paths.get(\".\");\r\n\t\t int maxDepth = 5;\r\n\t\t try (Stream<Path> stream = Files.find(start, maxDepth, (path2, attr) -> String.valueOf(path2).endsWith(\".java\"))) \r\n\t\t {\r\n\t\t String joined = stream\r\n\t\t .sorted()\r\n\t\t .map(String::valueOf)\r\n\t\t .collect(Collectors.joining(\"; \"));\r\n\t\t System.out.println(\"Found: \" + joined);\r\n\t\t } catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t \r\n\t\t\r\n\t\tPath source = Paths.get(\"./src/com/polaris/utility/PathDemo.java\");\r\n\t\tPath target = Paths.get(\"F:/yatrabakup\");\r\n\t\t\r\n/*\r\n\t\ttry {\r\n\t\t // Files.copy(source, target);\r\n\t\t} catch(FileAlreadyExistsException fae) {\r\n\t\t fae.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t // something else went wrong\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t\t*/\r\n\t\ttry (BufferedReader reader = Files.newBufferedReader(Paths.get(\"f:\\\\yatrabakup\\\\EmployeeData.csv\"))) {\r\n\t\t reader.lines().map(String::toLowerCase).forEach(System.out::println);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static FXMLLoader getFXMLLoader(String template) {\n return new FXMLLoader(getResource(\"javafx/\" + template + \".fxml\"));\n }", "@Test\r\n\tpublic void checkGetTemplates() throws MalformedURLException, IOException {\r\n\r\n\t\tITemplate temp = general.getTemplate(\"specific\");\r\n\t\tassertEquals(\"generalTemplate\", temp.toString());\r\n\r\n\t\tString secondTemp = AbstractDresdenOclTest\r\n\t\t\t\t.getFile(\"/resources/templates/testSpecific.stg\",\r\n\t\t\t\t\t\tTemplateTestPlugin.ID).getAbsolutePath();\r\n\t\tITemplateGroup testSuper1 = null;\r\n\t\ttry {\r\n\t\t\ttestSuper1 = TemplatePlugin.getTemplateGroupRegistry()\r\n\t\t\t\t\t.addDefaultTemplateGroup(\"TestSuper1\", general);\r\n\t\t\ttestSuper1.addFile(secondTemp);\r\n\t\t} catch (TemplateException e) {\r\n\t\t\tfail(\"Can't set TemplateGroup testSuper1\");\r\n\t\t}\r\n\r\n\t\ttemp = testSuper1.getTemplate(\"specific\");\r\n\t\tassertEquals(\"specificTemplate\", temp.toString());\r\n\r\n\t\ttemp = general.getTemplate(\"specific2\");\r\n\t\tassertNull(temp);\r\n\r\n\t\tITemplateGroup testSuper2 = null;\r\n\t\ttry {\r\n\t\t\ttestSuper2 = TemplatePlugin.getTemplateGroupRegistry()\r\n\t\t\t\t\t.addDefaultTemplateGroup(\"TestSuper2\", testSuper1);\r\n\t\t\ttestSuper2.addFile(AbstractDresdenOclTest\r\n\t\t\t\t\t.getFile(\"/resources/templates/testGeneral.stg\",\r\n\t\t\t\t\t\t\tTemplateTestPlugin.ID).getAbsolutePath());\r\n\t\t} catch (TemplateException e) {\r\n\t\t\tfail(\"Can't set TemplateGroup testSuper2\");\r\n\t\t}\r\n\r\n\t\ttemp = testSuper2.getTemplate(\"specific2\");\r\n\t\tassertNotNull(temp);\r\n\t\tassertEquals(\"specificTemplate\", temp.toString());\r\n\r\n\t}", "String getAbsolutePathWithinSlingHome(String relativePath);", "String renderTemplate(String filename, Map<String, Object> context) {\n if (sEngine == null) {\n // PebbleEngine caches compiled templates by filename, so as long as we keep using the\n // same engine instance, it's okay to call getTemplate(filename) on each render.\n sEngine = new PebbleEngine();\n sEngine.addExtension(new PebbleExtension());\n }\n try {\n StringWriter writer = new StringWriter();\n sEngine.getTemplate(filename).evaluate(writer, context);\n return writer.toString();\n } catch (Exception e) {\n StringWriter writer = new StringWriter();\n e.printStackTrace(new PrintWriter(writer));\n return \"<div style=\\\"font-size: 150%\\\">\" + writer.toString().replace(\"&\", \"&amp;\").replace(\"<\", \"&lt;\").replace(\"\\n\", \"<br>\");\n }\n }", "public Reader getReader(Object templateSource, String encoding)\r\n/* 43: */ throws IOException\r\n/* 44: */ {\r\n/* 45:75 */ Resource resource = (Resource)templateSource;\r\n/* 46: */ try\r\n/* 47: */ {\r\n/* 48:77 */ return new InputStreamReader(resource.getInputStream(), encoding);\r\n/* 49: */ }\r\n/* 50: */ catch (IOException ex)\r\n/* 51: */ {\r\n/* 52:80 */ if (this.logger.isDebugEnabled()) {\r\n/* 53:81 */ this.logger.debug(\"Could not find FreeMarker template: \" + resource);\r\n/* 54: */ }\r\n/* 55:83 */ throw ex;\r\n/* 56: */ }\r\n/* 57: */ }", "protected static Templates getTemplates(URL style) throws TransformerException {\r\n Templates templates = s_cachedTemplates.get(style);\r\n Long lastModifiedDate = s_lastModifiedDates.get(style);\r\n long lastModified = 0;\r\n\r\n if (\"file\".equals(style.getProtocol())) {\r\n lastModified = new File(style.getFile()).lastModified();\r\n }\r\n\r\n if (templates == null || lastModifiedDate.longValue() != lastModified) {\r\n TransformerFactory factory = TransformerFactory.newInstance();\r\n\r\n try {\r\n factory.setURIResolver(new XslURIResolver());\r\n templates = factory.newTemplates(new StreamSource(style.openStream(), style.toString()));\r\n\r\n s_cachedTemplates.put(style, templates);\r\n s_lastModifiedDates.put(style, new Long(lastModified));\r\n } catch (IOException e) {\r\n throw new TransformerException(\"Fail to open XSL template: \" + style, e);\r\n }\r\n }\r\n\r\n return templates;\r\n }", "private PSTemplate importTemplate(String siteId, FileItem item)\n\t throws PSExtractHTMLException\n\t {\n\n\t PSTemplate convertedTemplate = new PSTemplate();\n\t \n\t try(InputStream fileInput = item.getInputStream())\n\t {\n\n\t \t //Build a string with the InputStream\n\t \t BufferedReader br = new BufferedReader(new InputStreamReader(item.getInputStream()));\n\t \t StringBuilder sb = new StringBuilder();\n\t \t String line = null;\n\t \t while ((line = br.readLine()) != null) {\n\t \t sb.append(line).append(\"\\n\");\n\t \t }\n\t \t br.close();\n\t \t \n\t \t String validStringXml = sb.toString();\n\t \t validStringXml = validStringXml.trim().replaceFirst(\"^([\\\\W]+)<\",\"<\");\n\t \t convertedTemplate = PSSerializerUtils.unmarshal(validStringXml, PSTemplate.class);\n\n\t \t //Import the template\n\t return templateService.importTemplate(convertedTemplate,siteId);\n\n\t } catch (PSDataServiceException | IPSPathService.PSPathNotFoundServiceException | IOException e) {\n\t\t\tthrow new PSExtractHTMLException(e);\n\t\t }\n\t }", "TemplatesPackage getTemplatesPackage();", "String localizedTemplateString(String templateName);", "@Test(dataProvider = \"getTemplatePathDP\")\n public void getTemplatePath(String converterName, String expectedTemplate) throws Exception {\n String expectedTemplatePath = tmp_output_builder_test.toString() + File.separator + expectedTemplate;\n Path expectedFile = Paths.get(expectedTemplatePath);\n Files.createDirectory(expectedFile.getParent());\n Files.createFile(expectedFile);\n\n doReturn(tmp_output_builder_test.toString()).when(sakuliProperties).getForwarderTemplateFolder();\n doReturn(converterName).when(testling).getConverterName();\n assertEquals(testling.getTemplatePath().toString(), expectedTemplatePath);\n }", "@Override\n public String resolve(String path)\n {\n\n // strip classname\n path = path.substring(path.lastIndexOf(\"/\") + 1);\n\n return path;\n }", "protected File getFile(HttpServletRequest request) {\n String path = request.getPathInfo();\n\n // we want to extract everything after /spa/spaResources/ from the path info. This should cater for sub-directories\n String extractedFile = path.substring(path.indexOf('/', BASE_URL.length() - 1) + 1);\n File folder = SpaModuleUtils.getSpaStaticFilesDir();\n\n //Resolve default index.html\n if (extractedFile.endsWith(\"index.htm\") || !extractedFile.contains(\".\")) {\n extractedFile = \"index.html\";\n }\n\n File file = folder.toPath().resolve(extractedFile).toFile();\n if (!file.exists()) {\n log.warn(\"File with path '{}' doesn't exist\", file.toString());\n return null;\n }\n return file;\n }", "public static String readEmbeddedTextFile(String filepath) {\n\t\tBundle bundle = null;\n\t\tsynchronized (Activator.class) {\n\t\t\tif (m_plugin != null) {\n\t\t\t\tbundle = m_plugin.getBundle();\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t// attempt to get a file to one of the template.\n\t\ttry {\n\t\t\tURL url = bundle.getEntry(\"/\" + filepath);\n\t\t\tif (url != null) {\n\t\t\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\t\t\tnew InputStreamReader(url.openStream()));\n\n\t\t\t\tString line;\n\t\t\t\tStringBuilder total = new StringBuilder(reader.readLine());\n\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\ttotal.append('\\n');\n\t\t\t\t\ttotal.append(line);\n\t\t\t\t}\n\n\t\t\t\treturn total.toString();\n\t\t\t}\n\t\t} catch (MalformedURLException e) {\n\t\t\t// we'll just return null.\n\t\t} catch (IOException e) {\n\t\t\t// we'll just return null.\n\t\t}\n\n\t\treturn null;\n\t}", "public static TemplateElement buildTemplate(String labelURI, String file, Locale locale) {\r\n // Search the extension\r\n int lastDotIndex = file.lastIndexOf(\".\");\r\n if (lastDotIndex < 0) {\r\n XMLTemplateBuilder.logger.info(\"Dot not found in the name of the file.\");\r\n lastDotIndex = file.length();\r\n }\r\n XMLTemplateBuilder.logger.debug(\"Loading template for the locale : {}\", locale.toString());\r\n\r\n String sLocaleSuffix = \"_\" + locale.getLanguage() + \"_\" + locale.getCountry();\r\n String variant = locale.getVariant();\r\n if ((variant != null) && !variant.equals(\"\")) {\r\n sLocaleSuffix = sLocaleSuffix + \"_ \" + variant;\r\n }\r\n // File name:\r\n String sFileName = file.substring(0, lastDotIndex);\r\n String extension = file.substring(lastDotIndex, file.length());\r\n String sCompleteName = sFileName + sLocaleSuffix + extension;\r\n XMLTemplateBuilder constructor = new XMLTemplateBuilder();\r\n constructor.setLabelFile(labelURI);\r\n URL url = constructor.getClass().getClassLoader().getResource(sCompleteName);\r\n if (url == null) {\r\n XMLTemplateBuilder.logger.warn(\"Not found : {}\", sCompleteName);\r\n // Try without the locale\r\n url = constructor.getClass().getClassLoader().getResource(file);\r\n if (url == null) {\r\n XMLTemplateBuilder.logger.warn(\"Neither found : {}\", file);\r\n } else {\r\n return constructor.buildTemplate(url.toString());\r\n }\r\n } else {\r\n return constructor.buildTemplate(url.toString());\r\n }\r\n return null;\r\n }", "public static String readHTML(String path){\r\n String htmlStr = \"\";\r\n String root = \"\";\r\n try { \r\n root = System.getProperty(\"user.dir\") + \"\\\\src\\\\\";\r\n htmlStr = FileUtils.readFileToString(new File(root+path), \"UTF-8\");\r\n System.out.println(EchoServer_HTTP.getDate() + \" - File '\" + root+path + \"' was requested from the server.\");\r\n } catch(IOException e){ \r\n System.out.println(EchoServer_HTTP.getDate() + \" - ERROR: File '\" + root+path + \"' not found.\");\r\n }\r\n return htmlStr;\r\n }", "public static String getAbsoluteResourcePath(String resourcePathInPlugin) {\r\n String pluginPath = RichFacesTemplatesActivator.getPluginResourcePath();\r\n IPath pluginFile = new Path(pluginPath);\r\n File file = pluginFile.append(resourcePathInPlugin).toFile();\r\n if (file.exists()) {\r\n return file.getAbsolutePath();\r\n } else {\r\n throw new IllegalArgumentException(\"Can't get path for \" //$NON-NLS-1$\r\n + resourcePathInPlugin);\r\n }\r\n }", "@Override\n \tprotected File deriveLocalFileCodeBase(Class<?> baseClass)\n \t{\n \t\t// setup codeBase\n \t\tif (baseClass == null)\n \t\t\tbaseClass = this.getClass();\n \n \t\tPackage basePackage = baseClass.getPackage();\n \t\tString packageName = basePackage.getName();\n \t\tString packageNameAsPath = packageName.replace('.', Files.sep);\n \n \t\tString pathName = System.getProperty(\"user.dir\") + Files.sep;\n \t\tFile path = new File(pathName);\n \t\tString pathString = path.getAbsolutePath();\n \n \t\t// println(\"looking for \" + packageNameAsPath +\" in \" + pathString);\n \n \t\tint packageIndex = pathString.lastIndexOf(packageNameAsPath);\n \t\tif (packageIndex != -1)\n \t\t{\n \t\t\tpathString = pathString.substring(0, packageIndex);\n \t\t\tpath = new File(pathString + Files.sep);\n \t\t}\n \n \t\tcodeBase = new ParsedURL(path);\n \t\tprintln(\"codeBase=\" + codeBase);\n \t\treturn path;\n \t}", "private String getLocatorYamlFilePath(HashMap confMap) {\n return confMap.get(\"LocatorFile\").toString();\n }", "String resolve(String placeholder, AddressTemplate template);", "public static void extractTemplates(Path extractTo, boolean forceOverride) throws DirectoryNotEmptyException {\n\n Objects.requireNonNull(extractTo, \"Target path cannot be null\");\n if (!Files.isDirectory(extractTo)) {\n try {\n Files.createDirectories(extractTo);\n } catch (IOException e) {\n throw new CobiGenRuntimeException(\"Unable to create directory \" + extractTo);\n }\n }\n\n // find templates will also download jars if needed as a side effect and will return teh path to the\n // files.\n URI findTemplatesLocation = ConfigurationFinder.findTemplatesLocation();\n if (Files.isDirectory(Paths.get(findTemplatesLocation))) {\n LOG.info(\"Templates already found at {}. You can edit them in place to adapt your generation results.\",\n extractTo);\n return;\n }\n\n try {\n if (!isEmpty(extractTo) && !forceOverride) {\n throw new DirectoryNotEmptyException(extractTo.toString());\n }\n\n LOG.info(\n \"CobiGen is attempting to download the latest CobiGen_Templates.jar and will extract it to cobigen home directory {}. please wait...\",\n ConfigurationConstants.DEFAULT_HOME);\n File templatesDirectory = extractTo.toFile();\n processJar(templatesDirectory.toPath());\n LOG.info(\"Successfully downloaded and extracted templates to @ {}\",\n templatesDirectory.toPath().resolve(ConfigurationConstants.COBIGEN_TEMPLATES));\n } catch (DirectoryNotEmptyException e) {\n throw e;\n } catch (IOException e) {\n throw new CobiGenRuntimeException(\"Not able to extract templates to \" + extractTo, e);\n }\n }", "@Override\n public GEMFile getFileByAbsolutePath(String absolutePath) {\n return (GEMFile) gemFileDb.get(absolutePath);\n }", "File getLoadLocation();", "private Map<String, File> generatePegasusDataTemplates(String pegasusFilename,\n String resolverPath, List<String> resolverDirectories, String rootPath) throws IOException\n {\n String tempDirectoryPath = _tempDir.getAbsolutePath();\n File pegasusFile = new File(PEGASUS_DIR + FS + pegasusFilename);\n ArrayList<String> args = new ArrayList<>();\n args.add(\"-d\");\n args.add(tempDirectoryPath);\n if (resolverPath != null)\n {\n args.add(\"-p\");\n args.add(resolverPath);\n }\n if (rootPath != null)\n {\n args.add(\"-t\");\n args.add(rootPath);\n }\n if (resolverDirectories != null)\n {\n args.add(\"-r\");\n args.add(String.join(\",\", resolverDirectories));\n }\n args.add(pegasusFile.getAbsolutePath());\n\n DataTemplateGeneratorCmdLineApp.main(args.toArray(new String[0]));\n\n File[] generatedFiles = _tempDir.listFiles((File dir, String name) -> name.endsWith(\".java\"));\n Assert.assertNotNull(generatedFiles, \"Found no generated Java files.\");\n return Arrays.stream(generatedFiles)\n .collect(Collectors.toMap(\n file -> file.getName().replace(\".java\", \"\"),\n Function.identity()));\n }", "public Pattern getCompiledPath();", "public TemplateAvailabilityProvider getProvider(String view, ApplicationContext applicationContext)\n/* */ {\n/* 118 */ Assert.notNull(applicationContext, \"ApplicationContext must not be null\");\n/* 119 */ return getProvider(view, applicationContext.getEnvironment(), applicationContext\n/* 120 */ .getClassLoader(), applicationContext);\n/* */ }", "public static List<String> getTemplates() {\n\t\tFile templatesDir = new File(PathUtils.getExtensionsTemplatePath());\n\t\tList<String> templates = Arrays.stream(templatesDir.listFiles(File::isDirectory)).map(File::getName)\n\t\t\t\t.collect(Collectors.toList());\n\t\tIProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();\n\t\tList<String> customTemplates = Arrays.stream(projects).filter(ExtensionUtils::isTemplate)\n\t\t\t\t.map(IProject::getName).collect(Collectors.toList());\n\t\ttemplates.addAll(customTemplates);\n\t\treturn templates;\n\t}", "protected String getStaticFilesLocation(PortletRequest request) {\n // TODO allow overriding on portlet level?\n String staticFileLocation = getPortalProperty(\n Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH,\n request.getPortalContext());\n if (staticFileLocation != null) {\n // remove trailing slash if any\n while (staticFileLocation.endsWith(\".\")) {\n staticFileLocation = staticFileLocation.substring(0,\n staticFileLocation.length() - 1);\n }\n return staticFileLocation;\n } else {\n // default for Liferay\n return \"/html\";\n }\n }", "public VirtualFile resolve(String relative)\n\t{\n\t\treturn null;\n\t}", "String getTemplate();", "@Override\n public Source resolve(String href, String base) throws TransformerException\n {\n\tif (!href.isEmpty() && URI.create(href).isAbsolute())\n\t{\n\t if (log.isDebugEnabled()) log.debug(\"Resolving URI: {} against base URI: {}\", href, base);\n\t URI uri = URI.create(base).resolve(href);\n return resolve(uri);\n\t}\n\telse\n\t{\n\t if (log.isDebugEnabled()) log.debug(\"Stylesheet self-referencing its doc - let the processor handle resolving\");\n\t return null;\n\t}\n }", "public String getSharedLoader(IPath baseDir);", "public Template getTemplate( Reader reader ) throws IOException, TemplateCompilationException,\n MissingShebangException, UnknownEngineException;", "private static void handleVmFile(Properties vm_app_vars, VelocityEngine ve,\r\n\t\t\tStringResourceRepository repo, Map<String, String> resolveAll,\r\n\t\t\tEntry<String, String> entry) {\n\t\tString vm_with_parse = StringUtils.replace(entry.getValue(),\r\n\t\t\t\t\"#include(\", \"#parse(\");\r\n\t\tString vmAbsPath = entry.getKey();\r\n\t\trepo.putStringResource(vmAbsPath, vm_with_parse);\r\n\r\n\t\tString value = entry.getValue();\r\n\t\t// Get Json , default case\r\n\t\tString jsonKey = vmAbsPath.replace(\".vm\", \".json\");\r\n\t\tString jsonString = resolveAll.get(jsonKey);\r\n\t\tif (jsonString == null) {\r\n\t\t\tSystem.out.println(\"NO default JSON found:\" + jsonKey);\r\n\t\t}\r\n\t\tif (!vmAbsPath.startsWith(\"templates/\")) {\r\n\r\n\t\t\t/**\r\n\t\t\t * apps Orginal VM \\\\apps Expand VM\r\n\t\t\t */\r\n\t\t\tString vmResult = generateText(vm_app_vars, ve, vmAbsPath,\r\n\t\t\t\t\tjsonString);\r\n\t\t\tputProcessedVmToVmRepro(repo, vmAbsPath, vmResult);\r\n\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"UNKNOW VM CASE default JSON:\" + jsonKey);\r\n\t\t\trepo.putStringResource(\"/\" + vmAbsPath,\r\n\t\t\t\t\t\"## VM+PLAIN \\n\" + entry.getValue());\r\n\t\t}\r\n\t}", "public static String render(Request request, Map<String, Object> model, String templatePath) {\n //model.put(\"currentUser\", getSessionCurrentUser(request));\n //model.put(\"WebPath\", Path.Web.class); // Access application URLs from templates\n return strictVelocityEngine().render(new ModelAndView(model, templatePath));\n }", "public File fileRelativeToSource(File f) {\n if (f.isAbsolute()) {\n return f;\n } else {\n return new File(_basedir, f.getPath());\n }\n }", "@Test\n public void testCanGrabMarkdownFromFileSystem() throws Exception {\n String id = this.getClass().getClassLoader().getResource(\"carTaxService\").getFile();\n when(cache.get(id)).thenReturn(null);\n when(FSRepositoryInformationExtractor.get(any(RepositoryUri.class))).thenReturn(StandardTestObjects.getStandardService());\n String html = underTest.generateContent(id);\n assertThat(html).isNotNull();\n assertThat(html).isNotEmpty();\n }", "public interface FileConfig {\n /**\n * get the mustache file path.\n * @return file path\n */\n String getPath();\n}", "public String resolvePath(String path, boolean tryCurrentPath) {\n String realPath = \"\";\n if (tryCurrentPath) {\n realPath = tryExtensionsPath(path);\n // Can't find the file in the active directory.\n if (realPath.isEmpty()) {\n // try to open the file in the same directory as the current file.\n int lastForwardSlash = currentFile().lastIndexOf('/');\n int lastBackwardSlash = currentFile().lastIndexOf('\\\\');\n int lastSlash = Math.max(lastForwardSlash, lastBackwardSlash);\n if (lastSlash != -1) {\n realPath = currentFile().substring(0, lastSlash+1) + path;\n realPath = tryExtensionsPath(realPath);\n }\n }\n }\n \n // Try all search paths\n for (String searchPath: searchPaths) {\n if (!realPath.isEmpty())\n break;\n \n realPath = searchPath + path;\n realPath = tryExtensionsPath(realPath);\n }\n \n return realPath;\n }", "public static void init(){\n velocityEngine = new VelocityEngine();\n Properties velocityProperties = new Properties();\n velocityProperties.put(\"resource.loader\", \"class\");\n velocityProperties.put(\"class.resource.loader.class\",\n \"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader\");\n velocityProperties.put(\"class.resource.loader\", \"/WEB-INF/classes/\");\n velocityEngine.init(velocityProperties);\n }", "public String processTemplate(String name, String templateString, Object context)\r\n\t{\r\n\t\treturn freeMarkerEngine.processTemplate(name, templateString, context);\r\n\t}", "@Override\n protected AbstractUrlBasedView buildView(String viewName) throws Exception {\n try (InputStream stream = getServletContext().getResourceAsStream(getPrefix() + \"/custom/jsp/\" + viewName + getSuffix())) {\n return super.buildView(\"/\" + (stream == null ? \"common\" : \"custom\") + \"/jsp/\" + viewName);\n }\n }", "@Override\n\tpublic List<TemplateBundle> getTemplateBundles() {\n\t\tList<TemplateBundle> templates = new ArrayList<TemplateBundle>();\t\n\t\tif (cache == null){\n\t\t\tcache = new ArrayList<TemplateBundle>();\n\t\t\tEnumeration<?> en = JaspersoftStudioPlugin.getInstance().getBundle().findEntries(\"templates/table\", \"*.jrxml\", false); //Doesn't search in the subdirectories\n\t\t\twhile (en.hasMoreElements()) {\n\t\t\t\tURL templateURL = (URL) en.nextElement();\n\t\t\t\ttry {\n\t\t\t\t\tTemplateBundle bundle = new TableTemplateBunlde(templateURL, JasperReportsConfiguration.getDefaultInstance());\n\t\t\t\t\tif (bundle != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcache.add(bundle);\n\t\t\t\t\t}\t\n\t\t\t\t} catch (Exception ex) \t{\n\t\t\t\t\t// Log error but continue...\n\t\t\t\t\tJaspersoftStudioPlugin.getInstance().getLog().log(\n\t\t\t\t\t\t\tnew Status(IStatus.ERROR,JaspersoftStudioPlugin.PLUGIN_ID,\n\t\t\t\t\t\t\t\t\tMessageFormat.format(Messages.DefaultTemplateProvider_TemplateLoadingErr,new Object[]{templateURL}), ex));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttemplates.addAll(cache);\n\t\tloadAdditionalTemplateBundles(templates);\n\t\treturn templates;\n\t}", "String getRealPath(String path);", "protected abstract ITemplateResource computeTemplateResource(final IEngineConfiguration configuration, final String ownerTemplate, final String template, final Map<String, Object> templateResolutionAttributes);" ]
[ "0.6303969", "0.5841641", "0.5755838", "0.563791", "0.55930483", "0.55862606", "0.5525432", "0.54200697", "0.5365469", "0.532679", "0.5288741", "0.52468055", "0.5151562", "0.5151202", "0.5100635", "0.5088104", "0.508321", "0.5079861", "0.50794053", "0.5063702", "0.50356555", "0.50329345", "0.50239253", "0.5014179", "0.50048554", "0.49979597", "0.4996402", "0.49748582", "0.49711734", "0.4955989", "0.49488026", "0.49304122", "0.49142736", "0.49124", "0.49083886", "0.4878644", "0.48302823", "0.4829562", "0.4804963", "0.48022896", "0.47953844", "0.47839668", "0.47800937", "0.47754428", "0.47723752", "0.475544", "0.47365463", "0.46388295", "0.46358326", "0.46303886", "0.45931023", "0.458449", "0.4573421", "0.4565096", "0.45610493", "0.4551432", "0.45425114", "0.45276618", "0.45216602", "0.4505024", "0.44659913", "0.44272673", "0.44269013", "0.44236302", "0.441358", "0.44118226", "0.44070002", "0.44053686", "0.44042495", "0.43775722", "0.43611467", "0.43481475", "0.4345903", "0.4344514", "0.4330625", "0.4320125", "0.43192655", "0.43179032", "0.43153006", "0.43152553", "0.43112195", "0.43097097", "0.4302797", "0.43016148", "0.42968214", "0.4294998", "0.42867744", "0.428657", "0.42865437", "0.42736512", "0.42624122", "0.42594558", "0.42591617", "0.42564523", "0.4254498", "0.4241562", "0.42314434", "0.42265093", "0.4213952", "0.42110896" ]
0.46256968
50
Methods used to draw the fluids, credits to TinkerMod Renders the given texture tiled into a GUI
private void renderTiledTextureAtlas(int x, int y, int width, int height, float depth, TextureAtlasSprite sprite, boolean upsideDown) { Tessellator tessellator = Tessellator.getInstance(); BufferBuilder worldrenderer = tessellator.getBuffer(); worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); this.mc.renderEngine.bindTexture(this.fluidStack.getFluid().getFlowing()); this.putTiledTextureQuads(worldrenderer, x, y, width, height, depth, sprite, upsideDown); tessellator.draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void renderTex() {\n final float\n w = xdim(),\n h = ydim(),\n x = xpos(),\n y = ypos() ;\n GL11.glBegin(GL11.GL_QUADS) ;\n GL11.glTexCoord2f(0, 0) ;\n GL11.glVertex2f(x, y + (h / 2)) ;\n GL11.glTexCoord2f(0, 1) ;\n GL11.glVertex2f(x + (w / 2), y + h) ;\n GL11.glTexCoord2f(1, 1) ;\n GL11.glVertex2f(x + w, y + (h / 2)) ;\n GL11.glTexCoord2f(1, 0) ;\n GL11.glVertex2f(x + (w / 2), y) ;\n GL11.glEnd() ;\n }", "public void draw(GL2 gl, GLUT glut, Texture[] textures) {\n\t\t\r\n\t\tfor(int i = -10; i < 10; i++) {\r\n\t\t\tgl.glEnable(GL2.GL_TEXTURE_2D);\r\n\t\t\tgl.glBegin(GL2.GL_QUADS);\r\n\t\t\tgl.glColor3d(1, 1, 1);\r\n\t\t\t\r\n\t\t\ttextures[0].bind(gl);\r\n\t\t\ttextures[0].setTexParameterf(gl, GL2.GL_TEXTURE_WRAP_S, GL2.GL_REPEAT);\r\n\t\t\ttextures[0].setTexParameterf(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);\r\n\t\t\ttextures[0].setTexParameterf(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);\r\n\t\t\ttextures[0].setTexParameterf(gl, GL2.GL_TEXTURE_WRAP_T, GL2.GL_REPEAT);\r\n\t\t\t\r\n\t\t\tfor(int j = -10; j < 10; j++) {\r\n\t\t\t\tgl.glTexCoord2d(0, 0);\r\n\t\t\t\tgl.glVertex3d(i, y, j);\r\n\t\t\t\tgl.glTexCoord2d(1, 0);\r\n\t\t\t\tgl.glVertex3d(i + 1, y, j);\r\n\t\t\t\tgl.glTexCoord2d(1, 1);\r\n\t\t\t\tgl.glVertex3d(i + 1, y, j + 1);\r\n\t\t\t\tgl.glTexCoord2d(0, 1);\r\n\t\t\t\tgl.glVertex3d(i, y, j + 1);\r\n\t\t\t}\r\n\t\t\tgl.glEnd();\r\n\t\t}\r\n\t\t\r\n\t\tgl.glDisable(GL2.GL_TEXTURE_2D);\r\n\t}", "public void draw() {\r\n\r\n//\t\tif (textures.length > 1) {\r\n//\t\t\tfor (int i = 1; i < textures.length; i++) {\r\n\t\tif (textures.length > 1) {\r\n\t\t\tDrawQuadWithTexture(textures[0], x, y, width, height);\r\n\t\t\tDrawQuadWithRotatedTexture(textures[1], x, y, width, height, angle);\r\n\t\t} else {\r\n\t\t\tDrawQuadWithRotatedTexture(textures[0], x, y, width, height, angle);\r\n\t\t}\r\n\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\t\r\n\t}", "public void display(GLAutoDrawable drawable) {\t\n\t\n\tSystem.out.println(times++);\n\n\t\n\tfbo.attach(gl);\n\t\n\t\tclear(gl);\n\t\t\n\t\tgl.glColor4f(1.f, 1.f, 1.f, 1f);\n\t\tgl.glBegin(GL2.GL_QUADS);\n\t\t{\n\t\t gl.glVertex3f(0.0f, 0.0f, 1.0f);\n\t\t gl.glVertex3f(0.0f, 1.0f, 1.0f);\n\t\t gl.glVertex3f(1.0f, 1.0f, 1.0f);\n\t\t gl.glVertex3f(1.0f, 0.0f, 1.0f);\n\t\t}\n\t\tgl.glEnd();\n\t\t\n\t\tgl.glColor4f(1.f, 0.f, 0.f, 1f);\n\t\tgl.glBegin(GL2.GL_TRIANGLES);\n\t\t{\n\t\t gl.glVertex3f(0.0f, 0.0f, 1.0f);\n\t\t gl.glVertex3f(0.0f, 1.0f, 1.0f);\n\t\t gl.glVertex3f(1.0f, 1.0f, 1.0f);\n\t\t}\n\t\tgl.glEnd();\n\tfbo.detach(gl);\n\n \n\tclear(gl);\n\n \n gl.glColor4f(1.f, 1.f, 1.f, 1f);\n fbo.bind(gl);\n\t gl.glBegin(GL2.GL_QUADS);\n\t {\n\t gl.glTexCoord2f(0.0f, 0.0f);\n\t \tgl.glVertex3f(0.0f, 1.0f, 1.0f);\n\t gl.glTexCoord2f(1.0f, 0.0f);\n\t \tgl.glVertex3f(1.0f, 1.0f, 1.0f);\n\t gl.glTexCoord2f(1.0f, 1.0f);\n\t \tgl.glVertex3f(1.0f, 0.0f, 1.0f);\n\t gl.glTexCoord2f(0.0f, 1.0f);\n\t \tgl.glVertex3f(0.0f, 0.0f, 1.0f);\n\t }\n gl.glEnd();\n fbo.unbind(gl);\n}", "public void draw() {\n\t\t\tfloat[] vertices = new float[mVertices.size()];\n\t\t\tfor (int i = 0; i < vertices.length; i++)\n\t\t\t\tvertices[i] = mVertices.get(i);\n\t\t\t\n\t\t\tfloat[] textureCoords = null;\n\t\t\tif (mTextureID != 0) {\n\t\t\t\ttextureCoords = new float[mTextureCoords.size()];\n\t\t\t\tfor (int i = 0; i < textureCoords.length; i++)\n\t\t\t\t\ttextureCoords[i] = mTextureCoords.get(i);\n\t\t\t}\n\t\t\t\n\t\t\tshort[] indices = new short[mIndices.size()];\n\t\t\tfor (int i = 0; i < indices.length; i++)\n\t\t\t\tindices[i] = mIndices.get(i);\n\t\t\t\n\t\t\t// Get OpenGL\n\t\t\tGL10 gl = GameGraphics2D.this.mGL;\n\t\t\t\n\t\t\t// Set render state\n\t\t\tgl.glDisable(GL10.GL_LIGHTING);\n\t\t\tgl.glEnable(GL10.GL_DEPTH_TEST);\n\t\t\tgl.glEnable(GL10.GL_BLEND);\n\n\t\t\tif (mBlendingMode == BLENDING_MODE.ALPHA)\n\t\t\t\tgl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);\n\t\t\telse if (mBlendingMode == BLENDING_MODE.ADDITIVE)\n\t\t\t\tgl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);\n\t\t\t\n\t\t\tif (mTextureID != 0)\n\t\t\t\tgl.glEnable(GL10.GL_TEXTURE_2D);\n\t\t\telse\n\t\t\t\tgl.glDisable(GL10.GL_TEXTURE_2D);\n\t\t\t\n\t\t\t// Draw the batch of textured triangles\n\t\t\tgl.glColor4f(Color.red(mColour) / 255.0f,\n\t\t\t\t\t\t Color.green(mColour) / 255.0f,\n\t\t\t\t\t\t Color.blue(mColour) / 255.0f,\n\t\t\t\t\t\t Color.alpha(mColour) / 255.0f);\n\t\t\t\n\t\t\tif (mTextureID != 0) {\n\t\t\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureID);\n\t\t\t\tgl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, GameGraphics.getFloatBuffer(textureCoords));\n\t\t\t}\n\t\t\t\n\t\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, GameGraphics.getFloatBuffer(vertices));\n\t\t\tgl.glDrawElements(GL10.GL_TRIANGLES, indices.length,\n\t\t\t\t\tGL10.GL_UNSIGNED_SHORT, GameGraphics.getShortBuffer(indices));\n\t\t}", "public void doRender(ModEntityTNTPrimed par1TNTPrimed, double x, double y, double z, float par5, float par6)\n {\n GL11.glPushMatrix();\n GL11.glTranslatef((float)x, (float)y, (float)z);\n float f2;\n\n if ((float)par1TNTPrimed.getFuse() - par6 + 1.0F < 10.0F)\n {\n f2 = 1.0F - ((float)par1TNTPrimed.getFuse() - par6 + 1.0F) / 10.0F;\n\n if (f2 < 0.0F)\n {\n f2 = 0.0F;\n }\n\n if (f2 > 1.0F)\n {\n f2 = 1.0F;\n }\n\n f2 *= f2;\n f2 *= f2;\n float f3 = 1.0F + f2 * 0.3F;\n GL11.glScalef(f3, f3, f3);\n }\n\n f2 = (1.0F - ((float)par1TNTPrimed.getFuse() - par6 + 1.0F) / 100.0F) * 0.8F;\n this.bindEntityTexture(par1TNTPrimed);\n this.blockRenderer.renderBlockAsItem(ModBlocks.modTNT[(par1TNTPrimed.getFuse() / 20) + 1], 0, par1TNTPrimed.getBrightness(par6));\n\n// if (par1TNTPrimed.getFuse() / 5 % 2 == 0)\n// {\n// GL11.glDisable(GL11.GL_TEXTURE_2D);\n// GL11.glDisable(GL11.GL_LIGHTING);\n// GL11.glEnable(GL11.GL_BLEND);\n// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);\n// GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);\n// this.blockRenderer.renderBlockAsItem(ModBlocks.modTNT[(par1TNTPrimed.getFuse() / 20) + 1], 0, 1.0F);\n// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n// GL11.glDisable(GL11.GL_BLEND);\n// GL11.glEnable(GL11.GL_LIGHTING);\n// GL11.glEnable(GL11.GL_TEXTURE_2D);\n// }\n\n GL11.glPopMatrix();\n }", "public static void load(){\n for(TextureHandler t : textures){\n if(t.texture!=null)t.texture.dispose();\n }\n textures.clear();\n \n //if the textures are corrupt or just arent there then the error TextureHandler will\n //be a placeholder which is generated programatically so it is always there\n int size = 64;\n Pixmap pixmap = new Pixmap(size,size, Format.RGBA8888 );\n pixmap.setColor(1f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,size/2);\n pixmap.setColor(0f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,(size/2)-2);\n pixmap.setColor(1f,0f,0f,1f);\n int offset = size/6;\n int length = (size+size)/3;\n pixmap.drawLine(offset,offset,offset+length,offset+length);\n pixmap.drawLine(offset+length,offset,offset,offset+length);\n error = new Texture(pixmap);\n pixmap.dispose();\n //things that get rendered the most get put at the top so theyre the first in the list\n textures.add(new TextureHandler(\"Block\" ,\"Block.png\",true));\n textures.add(new TextureHandler(\"Block1\",\"Block1.png\",true));\n textures.add(new TextureHandler(\"Block2\",\"Block2.png\",true));\n textures.add(new TextureHandler(\"Block3\",\"Block3.png\",true));\n textures.add(new TextureHandler(\"Block4\",\"Block4.png\",true));\n textures.add(new TextureHandler(\"GameBackground\",\"GameBackground.png\",true));\n \n textures.add(new TextureHandler(\"Hints\",\"Hints.png\",false));\n textures.add(new TextureHandler(\"Left\" ,\"ButtonLeft.png\",true));\n textures.add(new TextureHandler(\"Right\" ,\"ButtonRight.png\",true));\n textures.add(new TextureHandler(\"Rotate\",\"ButtonRotate.png\",true));\n textures.add(new TextureHandler(\"Pause\" ,\"ButtonPause.png\",true));\n textures.add(new TextureHandler(\"Label\" ,\"TextBox.png\",true));\n \n textures.add(new TextureHandler(\"Locked\",\"levels/Locked.png\",false));\n textures.add(new TextureHandler(\"Timer\",\"levels/Clock.png\",false));\n \n textures.add(new TextureHandler(\"PauseSelected\",\"SelectedPause.png\",true));\n textures.add(new TextureHandler(\"LeftSelected\",\"SelectedLeft.png\",true));\n textures.add(new TextureHandler(\"RightSelected\",\"SelectedRight.png\",true));\n textures.add(new TextureHandler(\"RotateSelected\",\"SelectedRotate.png\",true));\n \n textures.add(new TextureHandler(\"Background\",\"Background.png\",false));\n textures.add(new TextureHandler(\"Title\",\"MainMenuTitle.png\",false));\n\n }", "public static boolean render(int coordX, int coordY, int coordZ, int texture, Texture[] textureMap) {\r\n GL11.glTranslatef(coordX, coordY, coordZ); // Absolute position in game\r\n// GL11.glRotatef(xrot, 1.0f, 0.0f, 0.0f); // Rotate On The X Axis\r\n// GL11.glRotatef(yrot, 0.0f, 1.0f, 0.0f); // Rotate On The Y Axis\r\n// GL11.glRotatef(zrot, 0.0f, 0.0f, 1.0f); // Rotate On The Z Axis\r\n GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureMap[texture].getTextureID()); // Select Our Texture\r\n GL11.glBegin(GL11.GL_QUADS);\r\n // Front Face\r\n GL11.glTexCoord2f(0.0f, 0.0f);\r\n GL11.glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 0.0f);\r\n GL11.glVertex3f(1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 1.0f);\r\n GL11.glVertex3f(1.0f, 1.0f, 1.0f); // Top Right Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 1.0f);\r\n GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Texture and Quad\r\n // Back Face\r\n GL11.glTexCoord2f(1.0f, 0.0f);\r\n GL11.glVertex3f(-1.0f, -1.0f, -1.0f); // Bottom Right Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 1.0f);\r\n GL11.glVertex3f(-1.0f, 1.0f, -1.0f); // Top Right Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 1.0f);\r\n GL11.glVertex3f(1.0f, 1.0f, -1.0f); // Top Left Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 0.0f);\r\n GL11.glVertex3f(1.0f, -1.0f, -1.0f); // Bottom Left Of The Texture and Quad\r\n // Top Face\r\n GL11.glTexCoord2f(0.0f, 1.0f);\r\n GL11.glVertex3f(-1.0f, 1.0f, -1.0f); // Top Left Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 0.0f);\r\n GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 0.0f);\r\n GL11.glVertex3f(1.0f, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 1.0f);\r\n GL11.glVertex3f(1.0f, 1.0f, -1.0f); // Top Right Of The Texture and Quad\r\n // Bottom Face\r\n GL11.glTexCoord2f(1.0f, 1.0f);\r\n GL11.glVertex3f(-1.0f, -1.0f, -1.0f); // Top Right Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 1.0f);\r\n GL11.glVertex3f(1.0f, -1.0f, -1.0f); // Top Left Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 0.0f);\r\n GL11.glVertex3f(1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 0.0f);\r\n GL11.glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad\r\n // Right face\r\n GL11.glTexCoord2f(1.0f, 0.0f);\r\n GL11.glVertex3f(1.0f, -1.0f, -1.0f); // Bottom Right Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 1.0f);\r\n GL11.glVertex3f(1.0f, 1.0f, -1.0f); // Top Right Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 1.0f);\r\n GL11.glVertex3f(1.0f, 1.0f, 1.0f); // Top Left Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 0.0f);\r\n GL11.glVertex3f(1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad\r\n // Left Face\r\n GL11.glTexCoord2f(0.0f, 0.0f);\r\n GL11.glVertex3f(-1.0f, -1.0f, -1.0f); // Bottom Left Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 0.0f);\r\n GL11.glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad\r\n GL11.glTexCoord2f(1.0f, 1.0f);\r\n GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Top Right Of The Texture and Quad\r\n GL11.glTexCoord2f(0.0f, 1.0f);\r\n GL11.glVertex3f(-1.0f, 1.0f, -1.0f); // Top Left Of The Texture and Quad\r\n GL11.glEnd();\r\n\r\n// xrot += 0.3f; // X Axis Rotation\r\n// yrot += 0.2f; // Y Axis Rotation\r\n// zrot += 0.4f; // Z Axis Rotation\r\n\r\n return true;\r\n }", "@SideOnly(Side.CLIENT)\n public static void drawTexture_Items(int x, int y, IIcon icon, int width, int height, float zLevel)\n {\n for(int i = 0; i < width; i += 16)\n for(int j = 0; j < height; j += 16)\n drawScaledTexturedRect_Items(x + i, y + j, icon, Math.min(width - i, 16), Math.min(height - j, 16),zLevel);\n \n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n }", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "public void renderFlanges(int cons, int tex)\r\n/* 108: */ {\r\n/* 109:106 */ this.context.setTex(tex);\r\n/* 110:108 */ if ((cons & 0x1) > 0)\r\n/* 111: */ {\r\n/* 112:109 */ this.context.setTexFlags(0);\r\n/* 113:110 */ this.context.renderBox(63, 0.25D, 0.0D, 0.25D, 0.75D, 0.125D, 0.75D);\r\n/* 114: */ }\r\n/* 115:112 */ if ((cons & 0x2) > 0)\r\n/* 116: */ {\r\n/* 117:113 */ this.context.setTexFlags(112320);\r\n/* 118:114 */ this.context.renderBox(63, 0.25D, 0.875D, 0.25D, 0.75D, 1.0D, 0.75D);\r\n/* 119: */ }\r\n/* 120:116 */ if ((cons & 0x4) > 0)\r\n/* 121: */ {\r\n/* 122:117 */ this.context.setTexFlags(217134);\r\n/* 123:118 */ this.context.renderBox(63, 0.25D, 0.25D, 0.0D, 0.75D, 0.75D, 0.125D);\r\n/* 124: */ }\r\n/* 125:120 */ if ((cons & 0x8) > 0)\r\n/* 126: */ {\r\n/* 127:121 */ this.context.setTexFlags(188469);\r\n/* 128:122 */ this.context.renderBox(63, 0.25D, 0.25D, 0.875D, 0.75D, 0.75D, 1.0D);\r\n/* 129: */ }\r\n/* 130:124 */ if ((cons & 0x10) > 0)\r\n/* 131: */ {\r\n/* 132:125 */ this.context.setTexFlags(2944);\r\n/* 133:126 */ this.context.renderBox(63, 0.0D, 0.25D, 0.25D, 0.125D, 0.75D, 0.75D);\r\n/* 134: */ }\r\n/* 135:128 */ if ((cons & 0x20) > 0)\r\n/* 136: */ {\r\n/* 137:129 */ this.context.setTexFlags(3419);\r\n/* 138:130 */ this.context.renderBox(63, 0.875D, 0.25D, 0.25D, 1.0D, 0.75D, 0.75D);\r\n/* 139: */ }\r\n/* 140: */ }", "private void drawSprite(int x, int y, int u, int v)\n {\n GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);\n this.mc.getTextureManager().bindTexture(STAT_ICONS);\n float f = 0.0078125F;\n float f1 = 0.0078125F;\n int i = 18;\n int j = 18;\n Tessellator tessellator = Tessellator.getInstance();\n BufferBuilder bufferbuilder = tessellator.getBuffer();\n bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);\n bufferbuilder.pos((double)(x + 0), (double)(y + 18), (double)this.zLevel).tex((double)((float)(u + 0) * 0.0078125F), (double)((float)(v + 18) * 0.0078125F)).endVertex();\n bufferbuilder.pos((double)(x + 18), (double)(y + 18), (double)this.zLevel).tex((double)((float)(u + 18) * 0.0078125F), (double)((float)(v + 18) * 0.0078125F)).endVertex();\n bufferbuilder.pos((double)(x + 18), (double)(y + 0), (double)this.zLevel).tex((double)((float)(u + 18) * 0.0078125F), (double)((float)(v + 0) * 0.0078125F)).endVertex();\n bufferbuilder.pos((double)(x + 0), (double)(y + 0), (double)this.zLevel).tex((double)((float)(u + 0) * 0.0078125F), (double)((float)(v + 0) * 0.0078125F)).endVertex();\n tessellator.draw();\n }", "void texImage2D(int target, int level, int resourceId, int border);", "@SideOnly(Side.CLIENT)\n public static void drawTexture(int x, int y, IIcon icon, int width, int height, float zLevel)\n {\n for(int i = 0; i < width; i += 16)\n for(int j = 0; j < height; j += 16)\n drawScaledTexturedRect(x + i, y + j, icon, Math.min(width - i, 16), Math.min(height - j, 16),zLevel);\n \n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n }", "private void renderGuiExtraLive (SpriteBatch batch)\n\t{\n\t\t//float x = cameraGUI.viewportWidth - 50 -\n\t\t//\t\tConstants.LIVES_START * 50;\n\t\t//float y = -15;\n\t\t//for (int i = 0; i < Constants.LIVES_START; i++)\n\t\t//{\n\t\t//\tif (worldController.lives <= i)\n\t\t//\t\tbatch.setColor(0.5f, 0.5f, 0.5f, 0.5f);\n\t\t//\tbatch.draw(Assets.instance.bird.character, \n\t\t//\t\t\tx + i * 50, y, 50, 50, 120, 100, 0.35f, -0.35f, 0);\n\t\t//\tbatch.setColor(1, 1, 1, 1);\n\t\t//}\n\t\t\n\t\tfloat x = cameraGUI.viewportWidth - 50 -\n\t\t\t\t1 * 50;\n\t\tfloat y = -15;\n\t\tfor (int i = 0; i < 1; i++)//Constants.LIVES_START; i++)\n\t\t{\n\t\t\tif (worldController.lives <= i)\n\t\t\t\tbatch.setColor(0.5f, 0.5f, 0.5f, 0.5f);\n\t\t\tbatch.draw(Assets.instance.bird.character, \n\t\t\t\t\tx + i * 50, y, 50, 50, 120, 100, 0.35f, -0.35f, 0);\n\t\t\tbatch.setColor(1, 1, 1, 1);\n\t\t}\n\t\tif (worldController.lives>= 0 &&worldController.livesVisual>worldController.lives) \n\t\t{ \n\t\t\t\n\t\t\tint i = worldController.lives;\n\t\t float alphaColor = Math.max(0, worldController.livesVisual- worldController.lives - 0.5f);\n\t\t float alphaScale = 0.35f * (2 + worldController.lives - worldController.livesVisual) * 2;\n\t\t float alphaRotate = -45 * alphaColor;\n\t\t batch.setColor(1.0f, 0.7f, 0.7f, alphaColor);\n\t\t batch.draw(Assets.instance.bird.character, x + i * 50, y, 50, 50, 120, 100, alphaScale, -alphaScale,alphaRotate);\n\t\t batch.setColor(1, 1, 1, 1);\n\t\t }\n\t}", "public void draw()\n\t{\n\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, texture_id);\n\t\tdrawMesh(gl);\n\t}", "public void draw(int texture){\n\t\tGLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);\n\t\tGLES20.glUseProgram(program);\n\t\tGLES20.glDisable(GLES20.GL_BLEND);\n\n\t\tint positionHandle = GLES20.glGetAttribLocation(program, \"aPosition\");\n\t\tint textureHandle = GLES20.glGetUniformLocation(program, \"uTexture\");\n\t\tint texturePositionHandle = GLES20.glGetAttribLocation(program, \"aTexPosition\");\n\n\t\tGLES20.glVertexAttribPointer(texturePositionHandle, 2, GLES20.GL_FLOAT, false, 0, textureBuffer);\n\t\tGLES20.glEnableVertexAttribArray(texturePositionHandle);\n\n\t\tGLES20.glActiveTexture(GLES20.GL_TEXTURE0);\n\t\tGLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture);\n\t\tGLES20.glUniform1i(textureHandle, 0);\n\n\t\tGLES20.glVertexAttribPointer(positionHandle, 2, GLES20.GL_FLOAT, false, 0, verticesBuffer);\n\t\tGLES20.glEnableVertexAttribArray(positionHandle);\n\n\t\tGLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);\n\t\tGLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);\n\t}", "private void drawsegment_gouraud_texture24(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) {\n //Accurate texture mode added - comments stripped from dupe code, see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode){\n if(precomputeAccurateTexturing()){ //see if the precomputation goes well, if so finish the setup\n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n accurateMode = false; //if the matrix inversion screwed up, revert to normal rendering (something is degenerate)\n }\n }\n \n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode&&goingIn){\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU; iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else{\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n for ( ; xstart < xend; xstart++ ) {\n if(accurateMode){\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else{\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n \n try {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n m_zbuffer[xstart] = iz;\n \n int red;\n int grn;\n int blu;\n \n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = (iu & 0xFFFF) >> 9;\n int ivi = (iv & 0xFFFF) >> 9;\n \n // get texture pixels\n int pix0 = m_texture[ofs];\n int pix1 = m_texture[ofs + 1];\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int pix2 = m_texture[ofs];\n int pix3 = m_texture[ofs + 1];\n \n // red\n int red0 = (pix0 & 0xFF0000);\n int red2 = (pix2 & 0xFF0000);\n int up = red0 + ((((pix1 & 0xFF0000) - red0) * iui) >> 7);\n int dn = red2 + ((((pix3 & 0xFF0000) - red2) * iui) >> 7);\n red = up + (((dn-up) * ivi) >> 7);\n \n // grn\n red0 = (pix0 & 0xFF00);\n red2 = (pix2 & 0xFF00);\n up = red0 + ((((pix1 & 0xFF00) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF00) - red2) * iui) >> 7);\n grn = up + (((dn-up) * ivi) >> 7);\n \n // blu\n red0 = (pix0 & 0xFF);\n red2 = (pix2 & 0xFF);\n up = red0 + ((((pix1 & 0xFF) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF) - red2) * iui) >> 7);\n blu = up + (((dn-up) * ivi) >> 7);\n } else {\n // get texture pixel color\n blu = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)];\n red = (blu & 0xFF0000);\n grn = (blu & 0xFF00);\n blu = blu & 0xFF;\n }\n \n //\n int r = (ir >> 16);\n int g = (ig >> 16);\n // oops, namespace collision with accurate \n // texture vector b...sorry [ewjordan]\n int bb2 = (ib >> 16); \n \n m_pixels[xstart] = 0xFF000000 | \n ((((red * r) & 0xFF000000) | ((grn * g) & 0xFF0000) | (blu * bb2)) >> 8);\n // m_stencil[xstart] = p;\n }\n } catch (Exception e) { }\n \n //\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n iz+=izadd;\n }\n ypixel++;//accurate mode\n \n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n uleft+=uleftadd;\n vleft+=vleftadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n zleft+=zleftadd;\n }\n }", "@Override\n protected void drawGuiContainerBackgroundLayer(float var1, int var2,int var3) \n\t{\n\t GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n\t this.mc.renderEngine.bindTexture(resource);\n\t int var5 = (this.width - this.xSize) / 2;\n\t int var6 = (this.height - this.ySize) / 2;\n\t this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);\n\t int b = tile.tableBurnTime; // 取得Tile内的燃料燃烧时间\n\t float maxBurnTime = tile.maxBurnTime*1.0F;// 取得最大燃料燃烧时间,用float,不用的话得不出百分比\n\t if (b > 0 && maxBurnTime > 0) // 确定描绘的时机\n\t {\n\t // 描绘火焰图像\n\t this.drawTexturedModalRect(this.guiLeft + 81, this.guiTop + 37 + (int)(14 - 14 * ((float)b / maxBurnTime)),\n\t \t\t 176, (int)(14 - 14 * ((float)b / maxBurnTime)), 14, (int)(14 * ((float)b / maxBurnTime)));\n\t }\n\t \n\t int out = tile.outputTime; // 取得Tile内的燃料燃烧时间\n\t float maxOutputTime = 100F;// 取得最大燃料燃烧时间,用float,不用的话得不出百分比\n\t if (b > 0 && maxBurnTime > 0) // 确定描绘的时机\n\t {\n\t // 描绘火焰图像\n\t this.drawTexturedModalRect(this.guiLeft + 76, this.guiTop + 20,\n\t \t\t 176, 14, (int)(24*((float)out/maxOutputTime)), 16);\n\t }\n }", "private void graphicsLoader() {\n\t\tff2Logo = new Texture(Gdx.files.internal(uiName + \"/ff2logo.png\"));\n\t\tff2LogoHit = new Texture(Gdx.files.internal(uiName + \"/ff2logohit.png\"));\n\t\tplayerword = new Texture(Gdx.files.internal(uiName + \"/playerword.png\"));\n\t\tplayerwordHit = new Texture(Gdx.files.internal(uiName + \"/playerwordhit.png\"));\n\t\tturretword = new Texture(Gdx.files.internal(uiName + \"/turretword.png\"));\n\t\tturretwordHit = new Texture(Gdx.files.internal(uiName + \"/turretwordhit.png\"));\n\t\tfenceword = new Texture(Gdx.files.internal(uiName + \"/fenceword.png\"));\n\t\tfencewordHit = new Texture(Gdx.files.internal(uiName + \"/fencewordhit.png\"));\n\t\tbarrierword = new Texture(Gdx.files.internal(uiName + \"/barrierword.png\"));\n\t\tbarrierwordHit = new Texture(Gdx.files.internal(uiName + \"/barrierwordhit.png\"));\n\t\tgatewayword = new Texture(Gdx.files.internal(uiName + \"/gatewayword.png\"));\n\t\tgatewaywordHit = new Texture(Gdx.files.internal(uiName + \"/gatewaywordhit.png\"));\n\t\tpowerupword = new Texture(Gdx.files.internal(uiName + \"/powerupword.png\"));\n\t\tpowerupwordHit = new Texture(Gdx.files.internal(uiName + \"/powerupwordhit.png\"));\n\t\tswitchword = new Texture(Gdx.files.internal(uiName + \"/switchword.png\"));\n\t\tswitchwordHit = new Texture(Gdx.files.internal(uiName + \"/switchwordhit.png\"));\n\t\tenemyfighterword = new Texture(Gdx.files.internal(uiName + \"/enemyfighterword.png\"));\n\t\tenemyfighterwordHit = new Texture(Gdx.files.internal(uiName + \"/enemyfighterwordhit.png\"));\n\t\tmineword = new Texture(Gdx.files.internal(uiName + \"/mineword.png\"));\n\t\tminewordHit = new Texture(Gdx.files.internal(uiName + \"/minewordhit.png\"));\n\t\tpushblockword = new Texture(Gdx.files.internal(uiName + \"/pushblockword.png\"));\n\t\tpushblockwordHit = new Texture(Gdx.files.internal(uiName + \"/pushblockwordhit.png\"));\n\t\tbombupword = new Texture(Gdx.files.internal(uiName + \"/bombupword.png\"));\n\t\tbombupwordHit = new Texture(Gdx.files.internal(uiName + \"/bombupwordhit.png\"));\n\t\t\n\t\t// ui\n\t\tsoundonbutton = new Texture(Gdx.files.internal(uiName + \"/soundon.png\"));\n\t\tsoundoffbutton = new Texture(Gdx.files.internal(uiName + \"/soundoff.png\"));\n\t\tcreatebutton = new Texture(Gdx.files.internal(uiName + \"/createbutton.png\"));\n\t\tnocreatebutton = new Texture(Gdx.files.internal(uiName + \"/nocreatebutton.png\"));\n\t\tloaderTexture = new Texture(Gdx.files.internal(uiName + \"/ff2loader.png\"));\n\t\tgameOverTexture = new Texture(Gdx.files.internal(uiName + \"/gameover.png\"));\n\t\tnextFieldTexture = new Texture(Gdx.files.internal(uiName + \"/nextfield.png\"));\n\t\t\n\t\tmenubutton = new Texture(Gdx.files.internal(uiName + \"/menubutton.png\"));\n\t\tnomenubutton = new Texture(Gdx.files.internal(uiName + \"/nomenubutton.png\"));\n\t\tdiffEasyButton = new Texture(Gdx.files.internal(uiName + \"/diffeasybutton.png\"));\n\t\tdiffNormButton = new Texture(Gdx.files.internal(uiName + \"/diffnormbutton.png\"));\n\t\tdiffHardButton = new Texture(Gdx.files.internal(uiName + \"/diffhardbutton.png\"));\n\t\tosdButton = new Texture(Gdx.files.internal(uiName + \"/osdbutton.png\"));\n\t\t\n\t\texoFFfont = new BitmapFont(Gdx.files.internal(uiName + \"/font/exo-ff.fnt\"), true);\n\t\t\n\t\t// creator\n\t\texitbutton = new Texture(Gdx.files.internal(creatorName + \"/exitbutton.png\"));\n\t\tfilebutton = new Texture(Gdx.files.internal(creatorName + \"/filebutton.png\"));\n\t\ttoolsbutton = new Texture(Gdx.files.internal(creatorName + \"/toolsbutton.png\"));\n\t\tnextbutton = new Texture(Gdx.files.internal(creatorName + \"/nextbutton.png\"));\n\t\tprevbutton = new Texture(Gdx.files.internal(creatorName + \"/prevbutton.png\"));\n\t\tdeletebutton = new Texture(Gdx.files.internal(creatorName + \"/deletebutton.png\"));\n\t\tyesbutton = new Texture(Gdx.files.internal(creatorName + \"/yesbutton.png\"));\n\t\tnobutton = new Texture(Gdx.files.internal(creatorName + \"/nobutton.png\"));\n\t\tbuildbutton = new Texture(Gdx.files.internal(creatorName + \"/buildbutton.png\"));\n\t\tprocbutton = new Texture(Gdx.files.internal(creatorName + \"/procbutton.png\"));\n\t\trandbutton = new Texture(Gdx.files.internal(creatorName + \"/randbutton.png\"));\n\t\tgroupsbutton = new Texture(Gdx.files.internal(creatorName + \"/groupsbutton.png\"));\n\t\tarenabutton = new Texture(Gdx.files.internal(creatorName + \"/arenabutton.png\"));\n\t\tfileExitButton = new Texture(Gdx.files.internal(creatorName + \"/fileexitbutton.png\"));\n\t\tfileLoadButton = new Texture(Gdx.files.internal(creatorName + \"/loadbutton.png\"));\n\t\tfileSaveButton = new Texture(Gdx.files.internal(creatorName + \"/savebutton.png\"));\n\t\tfilePlayButton = new Texture(Gdx.files.internal(creatorName + \"/playbutton.png\"));\n\t\tfileNoPlayButton = new Texture(Gdx.files.internal(creatorName + \"/noplaybutton.png\"));\n\t\tfileSendButton = new Texture(Gdx.files.internal(creatorName + \"/sendbutton.png\"));\n\t\ttoasterBack = new Texture(Gdx.files.internal(creatorName + \"/toasterback.png\"));\n\t\twindowBack = new Texture(Gdx.files.internal(creatorName + \"/windowback.png\"));\n\t\temptyCellTexture = new Texture(Gdx.files.internal(creatorName + \"/emptycell.png\"));\n\t\tcreateSplashTexture = new Texture(Gdx.files.internal(creatorName + \"/createsplash.png\"));\n\t\t\n\t\tplayerDef = new Texture(Gdx.files.internal(creatorName + \"/player_def.png\"));\n\t\tgatewayDef = new Texture(Gdx.files.internal(creatorName + \"/gateway_def.png\"));\n\t\tpowerupDef = new Texture(Gdx.files.internal(creatorName + \"/powerup_def.png\"));\n\t\tbombupDef = new Texture(Gdx.files.internal(creatorName + \"/bombup_def.png\"));\n\t\tswitchDef = new Texture(Gdx.files.internal(creatorName + \"/switch_def.png\"));\n\t\tscaffoldDef = new Texture(Gdx.files.internal(creatorName + \"/scaffold_def.png\"));\n\t\tbarrierDef = new Texture(Gdx.files.internal(creatorName + \"/barrier_def.png\"));\n\t\tfenceDef = new Texture(Gdx.files.internal(creatorName + \"/fence_def.png\"));\n\t\tturretDef = new Texture(Gdx.files.internal(creatorName + \"/turret_def.png\"));\n\t\tenemyDef = new Texture(Gdx.files.internal(creatorName + \"/enemy_def.png\"));\n\t\tmineDef = new Texture(Gdx.files.internal(creatorName + \"/mine_def.png\"));\n\t\tpushblockDef = new Texture(Gdx.files.internal(creatorName + \"/pushblock_def.png\"));\n\t\thangerDef = new Texture(Gdx.files.internal(creatorName + \"/hanger_def.png\"));\n\t\t\n\t\tdeleteDef = new Texture(Gdx.files.internal(creatorName + \"/delete_def.png\"));\n\t\tdeleteSel = new Texture(Gdx.files.internal(creatorName + \"/delete_sel.png\"));\n\t\tlockUnlock = new Texture(Gdx.files.internal(creatorName + \"/lock_unlock.png\"));\n\t\tlockLock = new Texture(Gdx.files.internal(creatorName + \"/lock_lock.png\"));\n\t\ttoolSelect = new Texture(Gdx.files.internal(creatorName + \"/toolselect.png\"));\n\t\t\n\t\t// game stuff\n\t\tplayerShipTexture = new Texture(Gdx.files.internal(gameName + \"/player2ship.png\"));\n\t\tplayerShipPowerupTexture = new Texture(Gdx.files.internal(gameName + \"/player2shippowerup.png\"));\n\t\tplayerShipBombupTexture = new Texture(Gdx.files.internal(gameName + \"/player2shipbombup.png\"));\n\t\tenemyShipTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2ship.png\"));\n\t\tenemyShipPowerupTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shippowerup.png\"));\n\t\tenemyShipBombupTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shipbombup.png\"));\n\t\tenemyShipOrderedTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shipordered.png\"));\n\t\tplayerBulletTexture = new Texture(Gdx.files.internal(gameName + \"/playerlaser.png\"));\n\t\tplayerCableTexture = new Texture(Gdx.files.internal(gameName + \"/playercable.png\"));\n\t\tenemyBulletTexture = new Texture(Gdx.files.internal(gameName + \"/enemylaser.png\"));\n\t\tenemyCableTexture = new Texture(Gdx.files.internal(gameName + \"/enemycable.png\"));\n\t\tbombCableTexture = new Texture(Gdx.files.internal(gameName + \"/bombcable.png\"));\n\t\tturretTexture = new Texture(Gdx.files.internal(gameName + \"/turret.png\"));\n\t\tturrethitTexture = new Texture(Gdx.files.internal(gameName + \"/turrethit.png\"));\t\n\t\tfenceTexture = new Texture(Gdx.files.internal(gameName + \"/fence.png\"));\n\t\tfencehitTexture = new Texture(Gdx.files.internal(gameName + \"/fencehit.png\"));\n\t\tbarrierTexture = new Texture(Gdx.files.internal(gameName + \"/barrier.png\"));\n\t\tbarrierhitTexture = new Texture(Gdx.files.internal(gameName + \"/barrierhit.png\"));\n\t\tgatewayonTexture = new Texture(Gdx.files.internal(gameName + \"/gatewayon.png\"));\n\t\tgatewayoffTexture = new Texture(Gdx.files.internal(gameName + \"/gatewayoff.png\"));\n\t\tpowerupTexture = new Texture(Gdx.files.internal(gameName + \"/powerup.png\"));\n\t\tbombupTexture = new Texture(Gdx.files.internal(gameName + \"/bombup.png\"));\n\t\tbombupCharge = new Texture(Gdx.files.internal(gameName + \"/bombupcharge.png\"));\n\t\texplosion = new Texture(Gdx.files.internal(gameName + \"/explosion.png\"));\n\t\tdeath = new Texture(Gdx.files.internal(gameName + \"/death.png\"));\n\t\tpowerupCharge = new Texture(Gdx.files.internal(gameName + \"/powerupcharge.png\"));\n\t\tswitchonTexture = new Texture(Gdx.files.internal(gameName + \"/switchon.png\"));\n\t\tswitchoffTexture = new Texture(Gdx.files.internal(gameName + \"/switchoff.png\"));\n\t\tscaffoldTexture = new Texture(Gdx.files.internal(gameName + \"/scaffold.png\"));\n\t\tmineTexture = new Texture(Gdx.files.internal(gameName + \"/mine.png\"));\n\t\tminehitTexture = new Texture(Gdx.files.internal(gameName + \"/minehit.png\"));\n\t\tmineDebrisTexture = new Texture(Gdx.files.internal(gameName + \"/minedebris.png\"));\n\t\tpushblockTexture = new Texture(Gdx.files.internal(gameName + \"/pushblock.png\"));\n\t\thangerTexture = new Texture(Gdx.files.internal(gameName + \"/hanger.png\"));\n\t\thangerhitTexture = new Texture(Gdx.files.internal(gameName + \"/hangerhit.png\"));\n\t\t// have a catch here for the loaded=true?\n\t\tloaded = true;\n\t}", "public void drawScreen(int mouseX, int mouseY, float partialTicks)\r\n\t{\r\n\r\n\t\tGL11.glDisable(GL11.GL_ALPHA_TEST);\r\n\t\tGL11.glEnable(GL11.GL_ALPHA_TEST);\r\n\t\tTessellator tessellator = Tessellator.getInstance();\r\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\r\n\t\tMinecraft.getMinecraft().getTextureManager().bindTexture(getRandomTexture());\r\n\r\n\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tbufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);\r\n\t\tbufferbuilder.pos(0.0D, (double)this.height, 0.0D).tex(0, (double) (1F + (float)mouseX)).endVertex();\r\n\t\tbufferbuilder.pos((double)this.width, (double)this.height, 0.0D).tex((double)1F, (double)(1F + (float)mouseX)).endVertex();\r\n\t\tbufferbuilder.pos((double)this.width, 0.0D, 0.0D).tex((double)1F , (double)mouseX).endVertex();\r\n\t\tbufferbuilder.pos(0, 0, 0).tex(0, mouseX).endVertex();\r\n\t\ttessellator.draw();\r\n\r\n\t\t//title textures + splash\r\n\t\tthis.mc.getTextureManager().bindTexture(MINECRAFT_TITLE_TEXTURES);\r\n\t\tGlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tint j = this.width / 2 - 137;\r\n\t\tif ((double)this.minceraftRoll < 1.0E-4D)\r\n\t\t{\r\n\t\t\tthis.drawTexturedModalRect(j + 0, 30, 0, 0, 99, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 99, 30, 129, 0, 27, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 99 + 26, 30, 126, 0, 3, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 99 + 26 + 3, 30, 99, 0, 26, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 155, 30, 0, 45, 155, 44);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.drawTexturedModalRect(j + 0, 30, 0, 0, 155, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 155, 30, 0, 45, 155, 44);\r\n\t\t}\r\n\t\tthis.mc.getTextureManager().bindTexture(field_194400_H);\r\n\t\tdrawModalRectWithCustomSizedTexture(j + 88, 67, 0.0F, 0.0F, 98, 14, 128.0F, 16.0F);\r\n\t\tGlStateManager.pushMatrix();\r\n\t\tGlStateManager.translate((float)(this.width / 2 + 90), 70.0F, 0.0F);\r\n\t\tGlStateManager.rotate(-20.0F, 0.0F, 0.0F, 1.0F);\r\n\t\tfloat f = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * ((float)Math.PI * 2F)) * 0.1F);\r\n\t\tf = f * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashText) + 32);\r\n\t\tGlStateManager.scale(f, f, f);\r\n\t\tthis.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, -256);\r\n\t\tGlStateManager.popMatrix();\r\n\t\t//End\r\n\r\n\t\tString s = \"Minecraft 1.12.2\";\r\n\r\n\t\tif (this.mc.isDemo())\r\n\t\t{\r\n\t\t\ts = s + \" Demo\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ts = s + (\"release\".equalsIgnoreCase(this.mc.getVersionType()) ? \"\" : \"/\" + this.mc.getVersionType());\r\n\t\t}\r\n\t\tthis.drawString(this.fontRenderer, \"Frame: \"+RandomTexture, this.width - this.fontRenderer.getStringWidth(\"Frame: \"+RandomTexture) - 2, this.height - 30, 16777215);\r\n\t\tthis.drawString(this.fontRenderer, \"Modified by Will0376\", this.width - this.fontRenderer.getStringWidth(\"Modified by Will0376\") - 2, this.height - 20, 16777215);\r\n\r\n\t\tList<String> brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true));\r\n\t\tList<String> brdlist = new ArrayList<>();\r\n\t\tfor(int i = 0;i < brandings.size();i++){\r\n\t\t\tif(brandings.get(i).contains(\"MCP\")){\r\n\t\t\t}\r\n\t\t\telse if(brandings.get(i).contains(\"Forge\")){\r\n\t\t\t\tbrdlist.add(\"Forge:\"+(brandings.get(i).split(\"Forge\")[1]));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tbrdlist.add(brandings.get(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int brdline = 0; brdline < brdlist.size(); brdline++)\r\n\t\t{\r\n\t\t\tString brd = brdlist.get(brdline);\r\n\t\t\tif (!Strings.isNullOrEmpty(brd))\r\n\t\t\t{\r\n\t\t\t\tthis.drawString(this.fontRenderer, brd, 2, this.height - ( 10 + brdline * (this.fontRenderer.FONT_HEIGHT + 1)), 16777215);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.drawString(this.fontRenderer, \"Copyright Mojang AB. Do not distribute!\", this.widthCopyrightRest, this.height - 10, -1);\r\n\r\n\r\n\t\tsuper.drawScreen(mouseX, mouseY, partialTicks);\r\n\t}", "@Override\n\tpublic void setTexture(int texID) {\n\n\t}", "private void drawsegment_gouraud_texture32\n (\n float leftadd,\n float rghtadd,\n int ytop,\n int ybottom\n ) {\n \n //Accurate texture mode added - comments stripped from dupe code, see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode){\n if(precomputeAccurateTexturing()){ //see if the precomputation goes well, if so finish the setup\n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n accurateMode = false; //if the matrix inversion screwed up, revert to normal rendering (something is degenerate)\n }\n }\n \n ytop*=SCREEN_WIDTH;\n ybottom*=SCREEN_WIDTH;\n //int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode&&goingIn){\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU; iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else{\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n \n for ( ; xstart < xend; xstart++ ) {\n if(accurateMode){\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else{\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n \n try {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n //m_zbuffer[xstart] = iz;\n \n int red;\n int grn;\n int blu;\n int al;\n \n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = (iu & 0xFFFF) >> 9;\n int ivi = (iv & 0xFFFF) >> 9;\n \n // get texture pixels\n int pix0 = m_texture[ofs];\n int pix1 = m_texture[ofs + 1];\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int pix2 = m_texture[ofs];\n int pix3 = m_texture[ofs + 1];\n \n // red\n int red0 = (pix0 & 0xFF0000);\n int red2 = (pix2 & 0xFF0000);\n int up = red0 + ((((pix1 & 0xFF0000) - red0) * iui) >> 7);\n int dn = red2 + ((((pix3 & 0xFF0000) - red2) * iui) >> 7);\n red = (up + (((dn-up) * ivi) >> 7)) >> 16;\n \n // grn\n red0 = (pix0 & 0xFF00);\n red2 = (pix2 & 0xFF00);\n up = red0 + ((((pix1 & 0xFF00) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF00) - red2) * iui) >> 7);\n grn = (up + (((dn-up) * ivi) >> 7)) >> 8;\n \n // blu\n red0 = (pix0 & 0xFF);\n red2 = (pix2 & 0xFF);\n up = red0 + ((((pix1 & 0xFF) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF) - red2) * iui) >> 7);\n blu = up + (((dn-up) * ivi) >> 7);\n \n // alpha\n pix0>>>=24;\n pix2>>>=24;\n up = pix0 + ((((pix1 >>> 24) - pix0) * iui) >> 7);\n dn = pix2 + ((((pix3 >>> 24) - pix2) * iui) >> 7);\n al = up + (((dn-up) * ivi) >> 7);\n } else {\n // get texture pixel color\n blu = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)];\n al = (blu >>> 24);\n red = (blu & 0xFF0000) >> 16;\n grn = (blu & 0xFF00) >> 8;\n blu = blu & 0xFF;\n }\n \n // multiply with gouraud color\n red = (red * ir) >>> 8; // 0x00FF????\n grn = (grn * ig) >>> 16; // 0x0000FF??\n blu = (blu * ib) >>> 24; // 0x000000FF\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n \n //\n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al) >> 8)) & 0xFF0000) |\n ((bg + (((grn - bg) * al) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al) >> 8)) & 0xFF);\n }\n } catch (Exception e) { }\n \n //\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n iz+=izadd;\n }\n ypixel++;//accurate mode\n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n uleft+=uleftadd;\n vleft+=vleftadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n zleft+=zleftadd;\n }\n }", "private void DrawPlait(GL gl, float x, float y, float xP, float yP,\n\t\t\tdouble costheta, double sintheta, TextureCoords tc) {\n\n\t\tgl.glPushMatrix();\n\t\tgl.glMatrixMode(gl.GL_MODELVIEW);\n\t\t//gl.glScalef(0.5f, 0.5f, 1f);\n\t\tgl.glTranslatef(x, y, 0.0f);\n\n\t\tgl.glEnable(gl.GL_TEXTURE_2D);\n\t\tgl.glAlphaFunc(gl.GL_GREATER, 0.3f);\n\t\tgl.glEnable(gl.GL_ALPHA_TEST);\n\t\tgl.glEnable(gl.GL_MODULATE);\n\t\tgl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA);\n\t\tgl.glTexEnvf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);\n\t\tgl.glDepthMask(false);\n\n\t\tm_txt.enable();\n\t\tm_txt.bind();\n\t\tgl.glBegin(gl.GL_QUADS);\n\t\tgl.glColor3f(m_r, m_g, m_b);\n\t\tgl.glRotatef((float) 180, 1.0f, 0.0f, 0.0f);\n\n\t\tgl.glTexCoord2d(tc.left(), tc.top());\n\t\tgl.glVertex2f((float) (costheta * (-xP) - sintheta * (yP)),\n\t\t\t\t(float) (sintheta * (-xP) + costheta * (yP)));\n\t\tgl.glTexCoord2d(tc.right(), tc.top());\n\t\tgl.glVertex2f((float) (costheta * (xP) - sintheta * (yP)),\n\t\t\t\t(float) (sintheta * (xP) + costheta * (yP)));\n\t\tgl.glTexCoord2d(tc.right(), tc.bottom());\n\t\tgl.glVertex2f((float) (costheta * (xP) - sintheta * (-yP)),\n\t\t\t\t(float) (sintheta * (xP) + costheta * (-yP)));\n\t\tgl.glTexCoord2d(tc.left(), tc.bottom());\n\t\tgl.glVertex2f((float) (costheta * (-xP) - sintheta * (-yP)),\n\t\t\t\t(float) (sintheta * (-xP) + costheta * (-yP)));\n\t\tgl.glEnd();\n\n\t\tm_txt.disable();\n\t\tgl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);\n\t\tgl.glDisable(GL.GL_ALPHA);\n\t\tgl.glDisable(gl.GL_BLEND);\n\t\tgl.glDisable(gl.GL_TEXTURE_2D);\n\t\tgl.glDisable(gl.GL_DEPTH_TEST);\n\t\tgl.glDepthMask(true);\n\n\t\tgl.glPopMatrix();\n\t}", "@Override\n\tpublic void render() {\n\t\tupdate();\n\n\t\tGdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); // clear the screen\n\t\tbatch.begin();\n\n\t\tTextureRegion tmpRegion = null;\n\t\t\n\t\t// Draw the terrain!\n\t\tfor (int x = 0; x < 30; ++x) {\n\t\t\tfor (int y = 0; y < 20; ++y) {\n\t\t\t\ttmpRegion = new TextureRegion( tileset32Texture, (tiles[x][y] - 4) * 32, 0, 32, 32);\n\t\t\t\t//pause_button_region = new TextureRegion( spriteSheet, tiles[x][y] - 4, 0, 32, 32);\n\t\t\t\t// switch to 32x32 sprite\n\t\t\t\t//batch.draw(spriteSheet, x * 16, y * 16, tiles[x][y] * 16, 0, 16, 16);\n\t\t\t\tbatch.draw(tmpRegion, x * SQUARE_WIDTH, y * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH);\n\n\t\t\t\t// Temporary, copy pasta\n\t\t\t\t/*\n\t\t\t\t * switch( movementDirs[x][y] ) { case 'N': batch.draw(\n\t\t\t\t * spriteSheet, x*16, y*16, 11*16, 0, 16, 16 ); break; case 'E':\n\t\t\t\t * batch.draw( spriteSheet, x*16, y*16, 12*16, 0, 16, 16 );\n\t\t\t\t * break; case 'W': batch.draw( spriteSheet, x*16, y*16, 13*16,\n\t\t\t\t * 0, 16, 16 ); break; case 'S': batch.draw( spriteSheet, x*16,\n\t\t\t\t * y*16, 14*16, 0, 16, 16 ); break; }\n\t\t\t\t */\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// Draw the towers\n\t\tfor( int i = 0; i < towers.size(); ++i )\n\t\t{\n\t\t\tbatch.draw(towers.get(i).m_type.getTextureRegion(), towers.get(i).m_x * SQUARE_WIDTH, (towers.get(i).m_y) * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH);\n\t\t\t//drawSprite(towers.get( i ).getIconNum(), towers.get(i).m_x, towers.get(i).m_y);\n\t\t\tif (towers.get(i).selected) {\n\t\t\t\t//batch.draw(spriteSheet, towers.get(i).m_x * SQUARE_WIDTH, towers.get(i).m_y * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, towers.get(i).m_type.getSpriteLocX(), towers.get(i).m_type.getSpriteLocY(), 16, 16, false, true);\n\t\t\t\t//drawSprite(towers.get( i ).getIconNum(), towers.get(i).m_x, towers.get(i).m_y);\n\t\t\t\tbatch.draw(selectionImg, towers.get(i).m_x * SQUARE_WIDTH, towers.get(i).m_y * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 0, 0, 32, 32, false, true);\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\t// Draw the creeps!\n\t\tfor( int i = 0; i < creeps.size(); ++i)\n\t\t{\n\n\t\t\tif( creeps.get(i).active ) {\n\t\t\t\tTextureRegion toUse = null;\n\t\t\t\t//TextureRegion toUse = new TextureRegion(corporateCreepTexture);\n\t\t\t\tif (creeps.get(i).m_type == CreepType.GLOBAL_CORP) {\n\t\t\t\t\ttoUse = new TextureRegion(corporateCreepTexture);\n\t\t\t\t} else if (creeps.get(i).m_type == CreepType.SEARCHER) {\n\t\t\t\t\ttoUse = new TextureRegion(defconZeplinTexture);\n\t\t\t\t} else if (creeps.get(i).m_type == CreepType.GOVERNMENT) {\n\t\t\t\t\ttoUse = new TextureRegion(govHeliTexture);\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: Change this to difference art.\n\t\t\t\t\ttoUse = new TextureRegion(corporateCreepTexture);\n\t\t\t\t}\n\t\t\t\tbatch.draw(toUse, creeps.get(i).x * SQUARE_WIDTH + creeps.get(i).xOffset, creeps.get(i).y * SQUARE_WIDTH + creeps.get(i).yOffset, SQUARE_WIDTH, SQUARE_WIDTH);\n\t\t\t\t//batch.draw(toUse, creeps.get(i).x * SQUARE_WIDTH + creeps.get(i).xOffset, creeps.get(i).y * SQUARE_WIDTH + creeps.get(i).yOffset, SQUARE_WIDTH, SQUARE_WIDTH, 0, 32, 32, 32, false, false);\n\t\t\t}\n\t\t}\n\n\t\t// Draw the projectiles!\n\t\tfor( int i = 0; i < maxProjectiles; ++i )\n\t\t{\n\t\t\tif( projectiles[i].active )\n\t\t\t{\n//\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 0, 16*3, 16, 16, false, false);\n\t\t\t\tif (projectiles[i].towertype == \"judge\"){\n\t\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 0, 16*3, 16, 16, false, false);\n\t\t\t\t} else if (projectiles[i].towertype == \"teacher\"){\n\t\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 16, 16*3, 16, 16, false, false);\n\t\t\t\t} else if (projectiles[i].towertype == \"lawyer\"){\n\t\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 32, 16*3, 16, 16, false, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw the UI!\n\n\t\t// Background\n\n\t\tbatch.draw(blackBox, 0, 0, uiPanelWidth , screenHeight);\n\n\t\t// Draw the menu bar\n\t\tbatch.draw(menuTexture,-4,-190);\n\t\t//batch.draw(menu_region, 0, -100);\n\t\t\n\t\t// Draw the free towers.\n\t\t\n\t\tfor (int i = 1; i <= 3; i++) \n\t\t{\n\t\t\tif (free_towers.get(i-1) != null) \n\t\t\t{\n\t\t\t\t//tower_region.setRegion( free_towers.get(i-1).getSpriteLocX(), free_towers.get(i-1).getSpriteLocY(), 16, 16 );\n\t\t\t\tbatch.draw(free_towers.get(i-1).getTextureRegion(), 29, (screenHeight - 60 * i) + 5, SQUARE_WIDTH, SQUARE_WIDTH);\n\t\t\t\t//batch.draw(tower_region, 33, screenHeight - 57 * i, 16, 16);\n\t\t\t\t\n\t\t\t\tString towerPrice = \"$\" + free_towers.get(i-1).getPrice();\n\t\t\t\tTextBounds priceBounds = mFont.getBounds(towerPrice);\n\t\t\t\tColor oldColor = mFont.getColor();\n\t\t\t\tmFont.setColor(Color.GREEN);\n\t\t\t\tmFont.drawWrapped(batch, towerPrice, 10, 33 + screenHeight - 58*i + priceBounds.height, priceBounds.width);\n\t\t\t\tmFont.setColor(oldColor);\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t// Keep the GC in its cage as long as possible. \n\t\tif( oldMoney != money || oldLife != life )\n\t\t{\n\t\t\tuiString = \"+: \" + life + '\\n' + \"$: \" + money;\n\t\t\tuiBounds = mFont.getMultiLineBounds(uiString);\n\t\t}\n\t\toldMoney = money;\n\t\toldLife = life;\n\t\t\t\t\n\t\t// Draw droid pause button if on an android device.\n\t\tif (runningDrd) {\n\t\t\t\n\t\t\tpause_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(pause_button_region, DRD_PAUSE_RECT.x, DRD_PAUSE_RECT.y, DRD_PAUSE_RECT.width, DRD_PAUSE_RECT.height);\n\t\t\t\n\t\t\tString pause_button_string = \"Pause\";\n\t\t\tTextBounds pauseButtonBounds = mFont.getBounds(pause_button_string);\n\t\t\tmFont.drawWrapped(batch, pause_button_string,\n\t\t\t\t\t\t\t(32 - (pauseButtonBounds.width / 2)),\n\t\t\t\t\t\t\tDRD_PAUSE_RECT.y + pauseButtonBounds.height + 4, pauseButtonBounds.width);\n\t\t}\n\t\t\n\t\t// Draw the restart button if paused or game over.\n\t\tif (life <= 0 || isPaused) {\n\t\t\t\n\t\t\trestart_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(restart_button_region, RESTART_RECT.x, RESTART_RECT.y, RESTART_RECT.width, RESTART_RECT.height);\n\t\t\t\n\t\t\tString restart_button_string = \"Restart\";\n\t\t\tTextBounds restartButtonBounds = mFont.getBounds(restart_button_string);\n\t\t\tmFont.drawWrapped(batch, restart_button_string,\n\t\t\t\t\t\t\t(32 - (restartButtonBounds.width / 2)),\n\t\t\t\t\t\t\tRESTART_RECT.y + restartButtonBounds.height + 4, restartButtonBounds.width);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// Draw the start button if we are in build mode.\n\t\tif (buildMode) {\n\t\t\t\n\t\t\tstart_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(start_button_region, START_RECT.x, START_RECT.y, START_RECT.width, START_RECT.height);\n\t\t\t\n\t\t\tString start_button_string = \"Start\";\n\t\t\tTextBounds startButtonBounds = mFont.getBounds(start_button_string);\n\t\t\tmFont.drawWrapped(batch, start_button_string,\n\t\t\t\t\t\t\t(32 - (startButtonBounds.width / 2)),\n\t\t\t\t\t\t\tSTART_RECT.y + startButtonBounds.height + 4, startButtonBounds.width);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// Draw the sell button if we are not paused or in build mode and a tower is selected.\n\t\tif (!isPaused && !buildMode && selected != null) {\n\t\t\t\n\t\t\tsell_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(sell_button_region, SELL_RECT.x, SELL_RECT.y, SELL_RECT.width, SELL_RECT.height);\n\t\t\t\n\t\t\tString sell_button_string = \"Sell\";\n\t\t\tTextBounds sellButtonBounds = mFont.getBounds(sell_button_string);\n\t\t\tmFont.drawWrapped(batch, sell_button_string,\n\t\t\t\t\t\t\t(32 - (sellButtonBounds.width / 2)),\n\t\t\t\t\t\t\tSTART_RECT.y + sellButtonBounds.height + 4, sellButtonBounds.width);\n\t\t}\n\t\t\n\t\t// Text\n\t\tString uiString = \"+ \" + life + '\\n' + \"$ \" + money;\n\t\tTextBounds uiBounds = mFont.getMultiLineBounds(uiString);\n\t\tColor oldColor = mFont.getColor();\n\t\tmFont.setColor(Color.RED);\n\t\tmFont.drawWrapped(batch, uiString, 3, uiBounds.height + 3, uiBounds.width);\n\t\tmFont.setColor(oldColor);\n\n\t\t// DEBUG TEXT\n\t\t//mFont.drawWrapped(batch, debugtext, 60, uiBounds.height + 3, 1000);\t\t\n\n\t\t// Draw the cursorTexture\n\t\tif (cursorState != null && cursorTexture != null) {\n\t\t\tbatch.draw(cursorTexture, cursorLocX - 8, screenHeight - cursorLocY - 8);\n\t\t}\n\t\t\n\t\t// Render Paused String if needed in bottom right corner.\n\t\tString center_string = null;\n\t\tif (isPaused) {\n\t\t\tcenter_string = \"PAUSED\";\n\t\t} else if (life <= 0) {\n\t\t\tcenter_string = \"GAME OVER\";\n\t\t}\n\t\t\n\t\tif (center_string != null) {\n\t\t\tTextBounds pausedBounds = mFont.getMultiLineBounds(center_string);\n\t\t\tColor oldColor2 = mFont.getColor();\n\t\t\tmFont.setColor(Color.RED);\n\t\t\tmFont.drawWrapped(batch, center_string,\n\t\t\t\t\t(screenWidth / 2) - (pausedBounds.width / 2),\n\t\t\t\t\t(screenHeight / 2) - (pausedBounds.height / 2), pausedBounds.width );\n\t\t\tmFont.setColor(oldColor2);\n\t\t}\n\t\t\n\t\tbatch.end();\n\t}", "private void drawsegment_gouraud_texture8(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) {\n //Accurate texture mode added - comments stripped from dupe code, see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode){\n if(precomputeAccurateTexturing()){ //see if the precomputation goes well, if so finish the setup\n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n accurateMode = false; //if the matrix inversion screwed up, revert to normal rendering (something is degenerate)\n }\n }\n \n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode&&goingIn){\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU; iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else{\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n \n for ( ; xstart < xend; xstart++ ) {\n if(accurateMode){\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else{\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n \n try\n {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n //m_zbuffer[xstart] = iz;\n \n int al0;\n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = iu & 0xFFFF;\n al0 = m_texture[ofs] & 0xFF;\n int al1 = m_texture[ofs + 1] & 0xFF;\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int al2 = m_texture[ofs] & 0xFF;\n int al3 = m_texture[ofs + 1] & 0xFF;\n al0 = al0 + (((al1-al0) * iui) >> 16);\n al2 = al2 + (((al3-al2) * iui) >> 16);\n al0 = al0 + (((al2-al0) * (iv & 0xFFFF)) >> 16);\n } else {\n al0 = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)] & 0xFF;\n }\n \n // get RGB colors\n int red = ir & 0xFF0000;\n int grn = (ig >> 8) & 0xFF00;\n int blu = (ib >> 16);\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n m_pixels[xstart] = 0xFF000000 |\n ((br + (((red - br) * al0) >> 8)) & 0xFF0000) |\n ((bg + (((grn - bg) * al0) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al0) >> 8)) & 0xFF);\n \n // write stencil\n // m_stencil[xstart] = p;\n }\n }\n catch (Exception e) {\n \n }\n \n //\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n iz+=izadd;\n }\n ypixel++;//accurate mode\n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n \n uleft+=uleftadd;\n vleft+=vleftadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n zleft+=zleftadd;\n }\n }", "public void RenderMiningCharge( FCEntityMiningCharge miningCharge, double d, double d1, double d2, \r\n float f, float f1 )\r\n {\r\n \tint iFacing = miningCharge.m_iFacing;\r\n \t\r\n GL11.glPushMatrix();\r\n GL11.glTranslatef((float)d, (float)d1, (float)d2);\r\n \r\n if(((float)miningCharge.m_iFuse - f1) + 1.0F < 10F)\r\n {\r\n float fScaleFactor = 1.0F - (((float)miningCharge.m_iFuse - f1) + 1.0F) / 10F;\r\n \r\n if(fScaleFactor < 0.0F)\r\n {\r\n fScaleFactor = 0.0F;\r\n }\r\n if(fScaleFactor > 1.0F)\r\n {\r\n fScaleFactor = 1.0F;\r\n }\r\n \r\n fScaleFactor *= fScaleFactor;\r\n fScaleFactor *= fScaleFactor;\r\n \r\n float fScale = 1.0F + fScaleFactor * 0.3F;\r\n \r\n GL11.glScalef( fScale, fScale, fScale );\r\n }\r\n \r\n float f3 = (1.0F - (((float)miningCharge.m_iFuse - f1) + 1.0F) / 100F) * 0.8F;\r\n \r\n this.loadTexture(\"/terrain.png\");\r\n \r\n RenderMiningChargeBlock( iFacing, miningCharge.getBrightness(f1));\r\n \r\n if((miningCharge.m_iFuse / 5) % 2 == 0)\r\n {\r\n GL11.glDisable(3553 /*GL_TEXTURE_2D*/);\r\n GL11.glDisable(2896 /*GL_LIGHTING*/);\r\n GL11.glEnable(3042 /*GL_BLEND*/);\r\n GL11.glBlendFunc(770, 772);\r\n GL11.glColor4f(1.0F, 1.0F, 1.0F, f3);\r\n RenderMiningChargeBlock( iFacing, 1.0F);\r\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n GL11.glDisable(3042 /*GL_BLEND*/);\r\n GL11.glEnable(2896 /*GL_LIGHTING*/);\r\n GL11.glEnable(3553 /*GL_TEXTURE_2D*/);\r\n }\r\n \r\n GL11.glPopMatrix();\r\n }", "public void render () \n\t{ \n\t\trenderWorld(batch);\n\t\trenderGui(batch);\n\t}", "public void usa(){\n stroke(1);\n //back guns\n fill(0);\n rect(73,192,4,15);\n rect(224,192,4,15);\n rect(71,207,8,15);\n rect(222,207,8,15);\n rect(66,207,3,15);\n rect(232,207,3,17);\n rect(122,109,4,15);\n rect(175,110,4,15);\n rect(121,120,6,15);\n rect(174,120,6,15);\n rect(116,124,3,15);\n rect(182,124,3,15);\n\n //wings\n fill(1,0,74);//dark blue\n beginShape();\n vertex(14,286);\n vertex(61,236);\n vertex(88,308);\n vertex(51,334);\n vertex(14,313);\n endShape(CLOSE);\n beginShape();\n vertex(286,287);\n vertex(286,312);\n vertex(247,335);\n vertex(212,309);\n vertex(238,238);\n endShape(CLOSE);\n\n fill(200);//white\n beginShape();\n vertex(38,307);\n vertex(74,307);\n vertex(80,314);\n vertex(81,337);\n vertex(68,345);\n vertex(38,327);\n endShape(CLOSE);\n beginShape();\n vertex(219,316);\n vertex(226,308);\n vertex(262,308);\n vertex(262,326);\n vertex(231,345);\n vertex(219,336);\n endShape(CLOSE);\n\n fill(192,0,11);//red\n beginShape();\n vertex(96,191);\n vertex(61,230);\n vertex(60,269);\n vertex(96,312);\n vertex(101,300);\n vertex(100,247);\n vertex(112,232);\n vertex(132,232);\n vertex(131,186);\n endShape(CLOSE);\n beginShape();\n vertex(204,191);\n vertex(240,230);\n vertex(240,270);\n vertex(205,312);\n vertex(200,302);\n vertex(200,248);\n vertex(193,238);\n vertex(185,231);\n vertex(170,230);\n vertex(170,186);\n endShape(CLOSE);\n\n //white\n fill(200);\n beginShape();\n vertex(70,217);\n vertex(74,220);\n vertex(81,210);\n vertex(85,213);\n vertex(75,227);\n vertex(72,229);\n vertex(71,231);\n vertex(73,233);\n vertex(73,268);\n vertex(71,272);\n vertex(76,277);\n vertex(82,274);\n vertex(89,283);\n vertex(90,297);\n vertex(66,272);\n vertex(65,235);\n vertex(68,229);\n vertex(62,228);\n endShape(CLOSE);\n beginShape();\n vertex(228,217);\n vertex(225,218);\n vertex(218,211);\n vertex(215,213);\n vertex(223,227);\n vertex(226,226);\n vertex(230,230);\n vertex(227,233);\n vertex(228,270);\n vertex(229,272);\n vertex(223,276);\n vertex(218,276);\n vertex(210,283);\n vertex(211,296);\n vertex(235,273);\n vertex(234,233);\n vertex(232,228);\n vertex(237,227);\n endShape(CLOSE);\n\n //guns\n //white\n fill(200);\n beginShape();\n vertex(121,301);\n vertex(98,313);\n vertex(102,336);\n vertex(119,342);\n vertex(139,336);\n vertex(141,313);\n endShape(CLOSE);//l\n beginShape();\n vertex(159,312);\n vertex(162,336);\n vertex(180,342);\n vertex(200,336);\n vertex(202,313);\n vertex(180,302);\n endShape(CLOSE);\n\n //black\n fill(0);\n rect(105,315,30,30);\n rect(166,315,30,30);\n quad(105,344,109,355,131,355,135,344);\n quad(166,344,170,355,192,355,196,344);\n //green\n fill(0,0,67);\n rect(103,253,33,62);//l\n rect(164,252,33,62);//r\n //white\n fill(200);\n bezier(103,252,107,230,132,230,136,252);//l\n bezier(164,252,169,230,192,230,197,252);//r\n rect(103,280,33,25);//l\n rect(164,280,33,25);//r\n rect(104,319,33,26,3);//l\n rect(165,319,33,26,3);//r\n rect(115,310,7,28,8);//l\n rect(178,310,7,28,8);//r\n //green\n fill(0,0,67);\n rect(105,284,10,15);\n rect(124,284,10,15);\n rect(167,285,10,15);\n rect(185,284,10,15);\n\n //body-wings\n //green\n fill(0,0,67);//blue\n bezier(107,154,101,162,98,169,98,187);\n bezier(191,153,199,164,202,172,203,187);\n quad(107,154,98,186,98,223,107,224);\n quad(191,153,203,186,202,223,192,223);\n fill(192,0,11);//red\n quad(134,112,108,147,107,239,132,230);\n quad(165,112,192,147,193,239,168,230);\n //black\n fill(0);\n quad(130,122,130,142,111,164,111,147);\n quad(169,122,188,147,188,165,169,144);\n //white\n fill(200);\n beginShape();\n vertex(131,154);\n vertex(129,202);\n vertex(118,202);\n vertex(112,181);\n vertex(110,179);\n vertex(110,171);\n endShape(CLOSE);\n beginShape();\n vertex(170,154);\n vertex(190,172);\n vertex(190,182);\n vertex(188,181);\n vertex(182,201);\n vertex(172,201);\n endShape(CLOSE);\n\n //green\n fill(192,0,11);\n quad(134,193,166,193,154,342,146,342);\n fill(192,0,11);\n quad(142,180,159,180,152,352,148,352);\n //white\n fill(200);\n ellipse(150,374,6,50);\n\n //head\n fill(1,1,75);\n ellipse(149.5f,72,33,25);\n ellipse(149.5f,94,30,170);\n fill(0);\n ellipse(149.5f,94,20,160);\n fill(154,155,84);\n ellipse(149.5f,94,17,77);\n strokeWeight(2);\n line(143,74,158,74);\n line(142,104,158,104);\n strokeWeight(1);\n fill(200);\n bezier(143,15,147,2,153,2,155.5f,15);\n }", "private void render()\n {\n //Applicazione di un buffer \"davanti\" alla tela grafica. Prima di disegnare \n //sulla tela grafica il programma disegnerà i nostri oggetti grafici sul buffer \n //che, in seguito, andrà a disegnare i nostri oggetti grafici sulla tela\n bufferStrategico = display.getTelaGrafica().getBufferStrategy();\n \n //Se il buffer è vuoto (== null) vengono creati 3 buffer \"strategici\"\n if(bufferStrategico == null)\n {\n display.getTelaGrafica().createBufferStrategy(3);\n return;\n }\n \n //Viene definito l'oggetto \"disegnatore\" di tipo Graphic che disegnerà i\n //nostri oggetti grafici sui nostri buffer. Può disegnare qualsiasi forma\n //geometrica\n disegnatore = bufferStrategico.getDrawGraphics();\n \n //La riga seguente pulisce lo schermo\n disegnatore.clearRect(0, 0, larghezza, altezza);\n \n //Comando per cambiare colore dell'oggetto \"disegnatore\". Qualsiasi cosa\n //disengata dal disegnatore dopo questo comando avrà questo colore.\n \n /*disegnatore.setColor(Color.orange);*/\n \n //Viene disegnato un rettangolo ripieno. Le prime due cifre indicano la posizione \n //da cui il nostro disegnatore dovrà iniziare a disegnare il rettangolo\n //mentre le altre due cifre indicano le dimensioni del rettangolo\n \n /*disegnatore.fillRect(10, 50, 50, 70);*/\n \n //Viene disegnato un rettangolo vuoto. I parametri hanno gli stessi valori\n //del comando \"fillRect()\"\n \n /*disegnatore.setColor(Color.blue);\n disegnatore.drawRect(0,0,10,10);*/\n \n //I comandi seguenti disegnano un cerchio seguendo la stessa logica dei\n //rettangoli, di colore verde\n \n /*disegnatore.setColor(Color.green);\n disegnatore.fillOval(50, 10, 50, 50);*/\n \n /*Utilizziamo il disegnatore per caricare un'immagine. Il primo parametro\n del comando è l'immagine stessa, il secondo e il terzo parametro sono \n le coordinate dell'immagine (x,y) mentre l'ultimo parametro è l'osservatore\n dell'immagine (utilizzo ignoto, verrà impostato a \"null\" in quanto non\n viene usato)*/\n //disegnatore.drawImage(testImmagine,10,10,null);\n \n /*Comando che disegna uno dei nostri sprite attraverso la classe \"FoglioSprite\".*/\n //disegnatore.drawImage(foglio.taglio(32, 0, 32, 32), 10, 10,null);\n \n /*Viene disegnato un albero dalla classe \"Risorse\" attraverso il disegnatore.*/\n //disegnatore.drawImage(Risorse.omino, x, y,null);\n \n /*Se lo stato di gioco esiste eseguiamo la sua renderizzazione.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().renderizzazione(disegnatore);\n }\n \n //Viene mostrato il rettangolo\n bufferStrategico.show();\n disegnatore.dispose();\n }", "public void render(float f) {\n update();\n\n long currentTime = System.currentTimeMillis();\n //Divide by a thousand to convert from milliseconds to seconds\n elapsedTime = (currentTime - lastTime) % 1000.0f;\n lastTime = currentTime;\n\n batch.begin();\n bg1.draw(batch, 1);\n bg2.draw(batch, 1);\n playerSprite.draw(batch);\n\n //Draws bullets if bullet array is holding bullet objects\n if (bullets.size() > 0) {\n for (Bullet bullet : bullets) {\n bullet.getSprite().draw(batch);\n }\n }\n\n //Draws worms if worm array is holding worm objects\n if (worms.size() > 0) {\n for (Worm worm : worms) {\n worm.getSprite().draw(batch);\n }\n }\n\n //Draws trojans if trojan array is holding trojan objects\n if (trojans.size() > 0) {\n if (bigTrojan == null) {\n for (Trojan trojan : trojans) {\n trojan.getSprite().draw(batch);\n }\n } else if (bigTrojan != null) {\n bigTrojan.getSprite().draw(batch);\n }\n }\n //Draws memLeaks if memLeak array is holding memLeak objects\n if (memLeaks.size() > 0) {\n for (MemoryLeak memLeak : memLeaks) {\n memLeak.getSprite().draw(batch);\n }\n }\n\n if (elissaArray.size() > 0) {\n for (Elissa elissa : elissaArray) {\n elissa.getSprite().draw(batch);\n }\n }\n\n //Draws ElissaFiles if elissaFiles array is holding files objects\n if (elissaFiles.size() > 0) {\n for (ElissaFiles file : elissaFiles) {\n file.getSprite().draw(batch);\n }\n }\n\n //Draws files if files array is holding files objects\n if (files.size() > 0) {\n for (Files file : files) {\n file.getSprite().draw(batch);\n }\n }\n\n //particle system\n particles.render(batch);\n\n switch (gameState) {\n case PLAYING:\n //Score\n scoreTxt = \"Score: \" + String.format(Locale.US, \"%06d\", score);\n uiFont.draw(batch, scoreTxt, 0, HEIGHT - (scoreLayout.height));\n //Health\n healthTxt = \"Health: \" + player.getHp();\n uiFont.draw(batch, healthTxt, WIDTH / 2, HEIGHT - (healthLayout.height));\n //MOVEMENT\n isTouched = Gdx.input.isTouched();\n //Gdx.app.log(\"Playing: \", \"Is touched: \" + isTouched);\n playerMovement();\n pauseButton.draw(batch, 1);\n stage.draw();\n break;\n case PAUSED:\n //Fill in pause code\n if (settingsOn == false) {\n pauseScreenRender();\n } else if (settingsOn == true) {\n settingsScreenRender();\n }\n break;\n case GAMEOVER:\n countdown = ((System.currentTimeMillis() - startTime) / 1000);\n Gdx.app.log(\"Seconds Elapsed: \", \"\" + ((System.currentTimeMillis() - startTime) / 1000));\n overlay.draw(batch, 0.5f);\n font.draw(batch, txt, WIDTH / 2 - layout.width / 2, HEIGHT / 2 + layout.height / 2);\n if (countdown == 5) {\n gameState = GameState.PLAYING;\n Lvl1.musicBackground.dispose();\n game.setScreen(AntiVirus.levelSelectScreen);\n }\n break;\n case COMPLETE:\n completeScreenRender();\n break;\n }\n batch.end();\n }", "public void drawStaticHud(GL2 gl) {\n this.gl = gl;\n\n if (! player.isAlive())\n return;\n\n update();\n\n start2D();\n //drawEnergy(gl);\n\n // Set the crosshair color to green\n gl.glColor4f(0.0f, 1.0f, 0.0f, 0.0f);\n\n if(crosshair != null) {\n crosshair.bind(gl);\n }\n gl.glBegin(GL2.GL_QUADS);\n int s = HEIGHT / 2; // Cross hair 10% screen height\n\n draw(-s / 2, -s / 2, s, s);\n gl.glEnd();\n gl.glColor4f(0.0f, 0.0f, 0.0f, 1.0f);\n\n {//Health/Shield Bar\n float xStart = 0;\n float xEnd = WIDTH;\n \n float yStart = -HEIGHT;\n float yEnd = HEIGHT;\n\n if(healthbackdrop != null) { \n healthbackdrop.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd );\n gl.glEnd();\n\n\n if(healthbar != null) {\n healthbar.bind(gl);\n }\n\n //draws the health bar\n gl.glBegin(GL2.GL_QUADS );\n drawBarGraph(xStart, yStart, xEnd , yEnd , ship.health()*0.72f);\n gl.glEnd();\n\n if(shieldbar!=null){\n shieldbar.bind(gl);\n }\n gl.glBegin(GL2.GL_QUADS );\n drawBarGraph(xStart, yStart, xEnd , yEnd , ship.shield()*0.70f);\n gl.glEnd();\n\n //health cross\n if(healthcross != null) {\n healthcross.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd );\n gl.glEnd();\n }\n\n {//Gun bar code\n float xStart = -WIDTH;\n float xEnd = WIDTH;\n \n float yStart = -HEIGHT;\n float yEnd = HEIGHT;\n \n if(gunbackdrop != null) {\n gunbackdrop.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd);\n gl.glEnd();\n\n if(gunbar != null) {\n gunbar.bind(gl);\n }\n\n //draw the percent bar for the gun\n gl.glBegin(GL2.GL_QUADS );\n drawBarGraph(xStart, yStart, xEnd , yEnd,ship.getWeapon().getAmmoPercent()*0.72f);\n gl.glEnd();\n\n if(gunammo != null) {\n gunammo.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd);\n gl.glEnd();\n }\n\n gl.glFlush();\n stop2D();\n }", "public void renderTileEntityAt(TileGolemBuilder tile, double par2, double par4, double par6, float pt, int destroyStage) {\n/* 41 */ GL11.glPushMatrix();\n/* 42 */ GL11.glTranslatef((float)par2 + 0.5F, (float)par4, (float)par6 + 0.5F);\n/* 43 */ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n/* */ \n/* 45 */ func_147499_a(TEX);\n/* */ \n/* 47 */ if (destroyStage >= 0) {\n/* */ \n/* 49 */ func_147499_a(field_178460_a[destroyStage]);\n/* 50 */ GlStateManager.func_179128_n(5890);\n/* 51 */ GlStateManager.func_179094_E();\n/* 52 */ GlStateManager.func_179152_a(5.0F, 5.0F, 2.0F);\n/* 53 */ GlStateManager.func_179109_b(0.0625F, 0.0625F, 0.0625F);\n/* 54 */ GlStateManager.func_179128_n(5888);\n/* */ } else {\n/* 56 */ GL11.glMatrixMode(5890);\n/* 57 */ GL11.glLoadIdentity();\n/* 58 */ GL11.glScalef(1.0F, -1.0F, 1.0F);\n/* 59 */ GL11.glMatrixMode(5888);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 64 */ EnumFacing facing = BlockStateUtils.getFacing(tile.func_145832_p());\n/* 65 */ if (tile.func_145831_w() != null) {\n/* 66 */ switch (facing.ordinal()) { case 5:\n/* 67 */ GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F); break;\n/* 68 */ case 4: GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); break;\n/* 69 */ case 3: GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);\n/* */ break; }\n/* */ \n/* */ \n/* */ \n/* */ }\n/* 75 */ this.model.renderAllExcept(new String[] { \"press\" });\n/* */ \n/* 77 */ GL11.glPushMatrix();\n/* 78 */ float h = tile.press;\n/* 79 */ double s = Math.sin(Math.toRadians(h)) * 0.625D;\n/* 80 */ GL11.glTranslated(0.0D, -s, 0.0D);\n/* 81 */ this.model.renderPart(\"press\");\n/* 82 */ GL11.glPopMatrix();\n/* */ \n/* 84 */ if (destroyStage >= 0) {\n/* */ \n/* 86 */ GlStateManager.func_179128_n(5890);\n/* 87 */ GlStateManager.func_179121_F();\n/* 88 */ GlStateManager.func_179128_n(5888);\n/* */ } else {\n/* 90 */ GL11.glMatrixMode(5890);\n/* 91 */ GL11.glLoadIdentity();\n/* 92 */ GL11.glScalef(1.0F, 1.0F, 1.0F);\n/* 93 */ GL11.glMatrixMode(5888);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 98 */ GL11.glTranslatef(-0.3125F, 0.625F, 1.3125F);\n/* 99 */ GL11.glRotatef(90.0F, -1.0F, 0.0F, 0.0F);\n/* 100 */ TextureAtlasSprite icon = Minecraft.func_71410_x().func_175602_ab().func_175023_a().func_178122_a(Blocks.field_150353_l.func_176223_P());\n/* 101 */ UtilsFX.renderQuadFromIcon(icon, 0.625F, 1.0F, 1.0F, 1.0F, 200, 771, 1.0F);\n/* */ \n/* 103 */ GL11.glPopMatrix();\n/* */ }", "void glBindTexture(int target, int texture);", "private void drawsegment_texture8(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) { \n // Accurate texture mode added - comments stripped from dupe code, \n // see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode) {\n // see if the precomputation goes well, if so finish the setup\n if (precomputeAccurateTexturing()) { \n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n // if the matrix inversion screwed up, revert to normal rendering \n // (something is degenerate)\n accurateMode = false; \n }\n }\n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n \n int red = m_fill & 0xFF0000;\n int grn = m_fill & 0xFF00;\n int blu = m_fill & 0xFF;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n \n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode && goingIn) {\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU;\n iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else {\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n for ( ; xstart < xend; xstart++ ) {\n if (accurateMode) {\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else {\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n // try-catch just in case pixel offset it out of range\n try {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n //m_zbuffer[xstart] = iz;\n \n int al0;\n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = iu & 0xFFFF;\n al0 = m_texture[ofs] & 0xFF;\n int al1 = m_texture[ofs + 1] & 0xFF;\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int al2 = m_texture[ofs] & 0xFF;\n int al3 = m_texture[ofs + 1] & 0xFF;\n al0 = al0 + (((al1-al0) * iui) >> 16);\n al2 = al2 + (((al3-al2) * iui) >> 16);\n al0 = al0 + (((al2-al0) * (iv & 0xFFFF)) >> 16);\n } else {\n al0 = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)] & 0xFF;\n }\n \n int br = m_pixels[xstart];\n int bg = (br & 0xFF00);\n int bb = (br & 0xFF);\n br = (br & 0xFF0000);\n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al0) >> 8)) & 0xFF0000) | \n ((bg + (((grn - bg) * al0) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al0) >> 8)) & 0xFF);\n // m_stencil[xstart] = p;\n }\n }\n catch (Exception e) {\n }\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n iz+=izadd;\n }\n ypixel++;//accurate mode\n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n uleft+=uleftadd;\n vleft+=vleftadd;\n zleft+=zleftadd;\n }\n }", "@Override\r\n\tpublic void render(Graphics g) {\r\n\t\tg.drawImage(objectsType.texture, (int) (x - handler.getGameCamera().getxOffset()),\r\n\t\t\t\t(int) (y - handler.getGameCamera().getyOffset()), width, height);\r\n\r\n\t\tif (DEBUGMODE) {\r\n\t\t\tg.setColor(Color.WHITE);\r\n\t\t\tg.drawRect((int) (x + bounds.x - handler.getGameCamera().getxOffset()),\r\n\t\t\t\t\t(int) (y + bounds.y - handler.getGameCamera().getyOffset()), bounds.width, bounds.height);\r\n\t\t}\r\n\r\n\t}", "public void drawTile() {\n\n }", "private void renderSprite(RenderEntity ent) {\n float radius = ent.radius;\n boolean useAxis = (ent.flags & RenderEntity.FLAG_SPRITE_AXIS) == RenderEntity.FLAG_SPRITE_AXIS;\n if(useAxis) {\n left.set(ent.axis[0]);\n up.set(ent.axis[1]);\n } else {\n left.set(view.ViewAxis[1]);\n up.set(view.ViewAxis[2]);\n }\n left.scale(radius);\n up.scale(-radius);\n\n float s1 = 0, t1 = 0, s2 = 1, t2 = 1;\n \n if(ent.mat != null && ent.mat.getTexture() != null) {\n Vector2f texSize = ent.mat.getTextureSize();\n Vector2f texOffset = ent.mat.getTextureOffset(ent.frame);\n s1 = texOffset.x;\n t1 = texOffset.y;\n s2 = s1 + texSize.x;\n t2 = t1 + texSize.y;\n } \n \n boolean rendernow = !r_batchsprites.isTrue() || currentRenderFlags != RF_POSTDEFERRED;\n if(rendernow) {\n // Setup render state\n if(ent.mat != null && ent.mat.getTexture() != null) {\n // Grab texture offsets from material\n ent.mat.getTexture().Bind();\n if(ent.mat.blendmode == CubeMaterial.BlendMode.ONE) {\n GLState.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);\n } else {\n GLState.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);\n }\n } else {\n GLState.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);\n Ref.ResMan.getWhiteTexture().Bind();\n }\n\n GL11.glDisable(GL11.GL_CULL_FACE);\n GL11.glDepthMask(false); // dont write to depth\n\n AddQuadStampExt(ent.origin, left, up, ent.outcolor,s1,t1,s2,t2);\n\n // clear renderstate\n GL11.glEnable(GL11.GL_CULL_FACE);\n GL11.glDepthMask(true);\n } else {\n // add to polygon batch and render later\n polyBatcher.addSpriteCall(ent);\n ByteBuffer dst = polyBatcher.getMappedBuffer();\n writeQuadStamp(dst, ent.origin, left, up, ent.outcolor,s1,t1,s2,t2);\n }\n }", "public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_)\n {\n if (this.visible)\n {\n FontRenderer fontrenderer = p_146112_1_.fontRendererObj;\n p_146112_1_.getTextureManager().bindTexture(ThemeRegistry.curTheme().guiTexture());\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n this.hovered = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height;\n int k = this.getHoverState(this.hovered);\n GlStateManager.enableBlend();\n GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);\n GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);\n \n GlStateManager.pushMatrix();\n float sh = height/20F;\n float sw = width >= 196? width/200F : 1F;\n float py = yPosition/sh;\n float px = xPosition/sw;\n GlStateManager.scale(sw, sh, 1F);\n \n if(width > 200) // Could use 396 but limiting it to 200 this makes things look nicer\n {\n \tGlStateManager.translate(px, py, 0F); // Fixes floating point errors related to position\n \tthis.drawTexturedModalRect(0, 0, 48, k * 20, 200, 20);\n } else\n {\n \tthis.drawTexturedModalRect((int)px, (int)py, 48, k * 20, this.width / 2, 20);\n \tthis.drawTexturedModalRect((int)px + width / 2, (int)py, 248 - this.width / 2, k * 20, this.width / 2, 20);\n }\n \n GlStateManager.popMatrix();\n \n this.mouseDragged(p_146112_1_, p_146112_2_, p_146112_3_);\n int l = 14737632;\n\n if (packedFGColour != 0)\n {\n l = packedFGColour;\n }\n else if (!this.enabled)\n {\n l = 10526880;\n }\n else if (this.hovered)\n {\n l = 16777120;\n }\n \n String txt = this.displayString;\n \n if(fontrenderer.getStringWidth(txt) > width) // Auto crop text to keep things tidy\n {\n \tint dotWidth = fontrenderer.getStringWidth(\"...\");\n \ttxt = fontrenderer.trimStringToWidth(txt, width - dotWidth) + \"...\";\n }\n \n this.drawCenteredString(fontrenderer, txt, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);\n }\n }", "@Override\n\tpublic void render() {\n\t\tgl.glEnableClientState(GL2.GL_VERTEX_ARRAY);\n\t\tgl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);\n\t\tgl.glEnableClientState(GL2.GL_NORMAL_ARRAY);\n\t\tfloat posx = startxPos;\n\t\tint[] vboIds;\n\t\tfor(int i=0;i<nbWidth;i++) {\n//\t\t\tindexBuffer = cacheBands.getDataLocalIndex(i); // mapIndexBands[i]\n//\t\t\tindexBuffer.rewind();\n\t\t\tvboIds = cacheBands.getDataLocalIndex(i);\n\t\t\tgl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboIds[1]);\n\t\t\tgl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);\n\t\t\tgl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vboIds[2]);\n\t\t\tgl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);\n\t\t\tgl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboIds[3]);\n\t\t\tgl.glNormalPointer(GL.GL_FLOAT, 0, 0);\n\n\t\t\t\n\t\t\tgl.glPushMatrix();\n\t\t\tgl.glTranslatef(posx, startyPos,0);\n\t\t\t//gl.glCallList(cacheBands.getDataLocalIndex(i));\n\t // gl.glDrawElements(GL2.GL_QUADS, indices.capacity(), GL.GL_UNSIGNED_SHORT, 0);\n\t gl.glDrawArrays(GL2.GL_QUADS, 0, vboIds[0]); \n\t\t\tgl.glPopMatrix();\n\t\t\tposx+=blockWidth;\n\t\t}\n\t\t// unbind vbo\n\t\tgl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);\n\t\tgl.glDisableClientState(GL2.GL_NORMAL_ARRAY);\n gl.glDisableClientState(GL2.GL_TEXTURE_COORD_ARRAY);\n gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);\n\n\t}", "private final void \n renderIt( ) {\n \t\n \tif( this.mImageCount > 0 || this.mLineCount > 0 || this.mRectCount > 0 || this.mTriangleCount > 0 ) {\n\t \n \t\tthis.mVertexBuffer.clear(); //clearing the buffer\n\t GLES11.glEnableClientState( GLES11.GL_VERTEX_ARRAY );\n\n\t //if there are images to render\n\t if( this.mImageCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mImageCount * 16 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glEnableClientState( GLES11.GL_TEXTURE_COORD_ARRAY ); //copy the texture coordinates into the GPU\n\t\t GLES11.glEnable(GLES11.GL_TEXTURE_2D);\n\t\t this.mVertexBuffer.position( 2 ); //put buffer position to the texture coordinates\n\t\t GLES11.glTexCoordPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer );\n\t\t this.mIndexBuffer.limit(this.mImageCount * 6); //DESKTOP VERSION ONLY\n\t\t GLES11.glDrawElements( GLES11.GL_TRIANGLES, this.mImageCount * BitsGLImage.INDICES_PER_SPRITE, GLES11.GL_UNSIGNED_SHORT, this.mIndexBuffer );\n\t \tGLES11.glDisable(GLES11.GL_TEXTURE_2D);\n\t\t GLES11.glDisableClientState( GLES11.GL_TEXTURE_COORD_ARRAY );\n\t }\n\t \n\t //if there are lines to render\n\t if( this.mLineCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mLineCount * 4 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 0, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glDrawArrays( GLES11.GL_LINES, 0, this.mLineCount * 2 ); //* 2 because every line got 2 points\n\t }\n\n\t //if there are rects to render\n\t if( this.mRectCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mRectCount * 8 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t this.mIndexBuffer.limit(this.mRectCount * 6); //DESKTOP VERSION ONLY\n\t \t GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, this.mVertexBuffer); //copy the vertices into the GPU\t \t \n\t \t \tGLES11.glDrawElements( GLES11.GL_TRIANGLES, this.mRectCount * BitsGLImage.INDICES_PER_SPRITE, GLES11.GL_UNSIGNED_SHORT, this.mIndexBuffer );\n\t }\n\t \n\t //if there are triangles to render\n\t if( this.mTriangleCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mTriangleCount * 12 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glEnableClientState( GLES11.GL_TEXTURE_COORD_ARRAY ); //copy the texture coordinates into the GPU\n\t\t GLES11.glEnable(GLES11.GL_TEXTURE_2D);\n\t\t this.mVertexBuffer.position( 2 ); //put buffer position to the texture coordinates\n\t\t GLES11.glTexCoordPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //16 == byteoffset -> es liegen 2 werte dazwischen\n\t\t GLES11.glDrawArrays( GLES11.GL_TRIANGLES, 0, this.mTriangleCount * 3 ); //* 2 because every line got 2 points\t \t\n\t\t GLES11.glDisable(GLES11.GL_TEXTURE_2D);\n\t\t GLES11.glDisableClientState( GLES11.GL_TEXTURE_COORD_ARRAY );\n\t }\n\t \n\t GLES11.glDisableClientState( GLES11.GL_VERTEX_ARRAY );\n \t\t\n\t //resetting counters\n\t this.mBufferIndex = 0;\n\t \tthis.mImageCount = 0;\n\t \tthis.mLineCount = 0;\n\t \tthis.mRectCount = 0;\n\t \tthis.mTriangleCount = 0;\n \t}\n }", "@Override\n public void display(GLAutoDrawable drawable) {\n if (ds == null) {\n return;\n }\n\n //VolumetricDataSet ds = new VolumetricDataSet(FileReader.class.getResourceAsStream(\"/marschnerlobb.raw\"), 41, 41, 41);\n int[][][] allDimensions = ds.getVolumeData();\n\n int[] dimensions = ds.getDimensions();\n\n int x = dimensions[0];\n int y = dimensions[1];\n int z = dimensions[2];\n\n System.out.println(\"x = \" + x);\n System.out.println(\"y = \" + y);\n System.out.println(\"z = \" + z);\n\n GL gl = drawable.getGL();\n\n gl.glClear(GL.GL_COLOR_BUFFER_BIT);\n\n// gl.glColor3f(0.94f, 0.94f, 0.94f);\n// gl.glBegin(GL.GL_POLYGON);\n// gl.glVertex2f(330, 0);\n// gl.glVertex2f(330, 720);\n// gl.glVertex2f(333, 0);\n// gl.glVertex2f(333, 720);\n// gl.glEnd();\n//\n// gl.glBegin(GL.GL_POLYGON);\n// gl.glVertex2f(165, 0);\n// gl.glVertex2f(165, 720);\n// gl.glVertex2f(168, 0);\n// gl.glVertex2f(168, 720);\n// gl.glEnd();\n// gl.glPushMatrix();\n// gl.glTranslated(-200.0, 0.0, 0.0);\n gl.glBegin(GL.GL_QUADS);\n\n for (int i = 0; i < z; i++) {\n for (int j = 0; j < y; j++) {\n float col = (float) allDimensions[j][100][i] / 255f;\n System.out.println(allDimensions[100][j][i] + \": \" + col);\n gl.glColor3f(col, col, col);\n\n gl.glVertex2d(i, j);\n gl.glVertex2d((i + 1), j);\n gl.glVertex2d((i + 1), (j + 1));\n gl.glVertex2d(i, (j + 1));\n System.out.println(\"x \" + i + \": y \" + j);\n }\n\n }\n gl.glEnd();\n //gl.glPopMatrix();\n\n// gl.glPushMatrix();\n// gl.glTranslated(0.0, 0.0, 0.0);\n// gl.glBegin(GL.GL_POLYGON);\n//\n// for (int i = 1; i < 41; i++) {\n// for (int j = 0; j < 41; j++) {\n// if (allDimensions[j][i][0] <= 225) {\n// gl.glColor3f(0, 1, 0);\n// } else {\n// gl.glColor3f(1, 1, 1);\n// }\n//\n// gl.glVertex2d(allDimensions[0][j][i], allDimensions[0][i][j]);\n// }\n//\n// }\n// gl.glEnd();\n// gl.glPopMatrix();\n gl.glFlush();\n }", "public void render(){\n spriteBatch.begin();\n drawEnemies();\n drawPlayer();\n drawBullets();\n spriteBatch.end();\n if(debug){\n drawDebug();\n }\n }", "@Override\n \tpublic void draw() {\n \n \t\tGL11.glPushMatrix();\n \t\t\n \t\tGL11.glTranslatef(super.getX(), super.getY(), 0);\n \t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n \t\tMain.BLANK_TEXTURE.bind();\n \t\tGL11.glBegin(GL11.GL_QUADS);\n \t\t{\n \t\t\t\n \t\t\tGL11.glColor3f(1.0f, 0.0f, 0.0f);\n \t\t\tGL11.glVertex2f(0, 0); // top left\n \t\t\tGL11.glVertex2f(0, Main.gridSize); // bottom left\n \t\t\tGL11.glVertex2f(Main.gridSize, Main.gridSize); // bottom right\n \t\t\tGL11.glVertex2f(Main.gridSize, 0); // top right\n \t\t\t\n \t\t\t\n \t\t\tif (isRight()) {\n \t\t\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n \t\t\t\tGL11.glVertex2f(12, 0);\n \t\t\t\tGL11.glVertex2f(12, 12);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 12);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 0);\n \t\t\t\t\n \t\t\t\tGL11.glColor3f(0.0f, 0.0f, 0.0f);\n \t\t\t\tGL11.glVertex2f(Main.gridSize-6, 3);\n \t\t\t\tGL11.glVertex2f(Main.gridSize-6, 9);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 9);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 3);\n \t\t\t\t\n \t\t\t} else {\n \t\t\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n \t\t\t\tGL11.glVertex2f(0, 0);\n \t\t\t\tGL11.glVertex2f(0, 12);\n \t\t\t\tGL11.glVertex2f(12, 12);\n \t\t\t\tGL11.glVertex2f(12, 0);\n \t\t\t\t\n \t\t\t\tGL11.glColor3f(0.0f, 0.0f, 0.0f);\n \t\t\t\tGL11.glVertex2f(0, 3);\n \t\t\t\tGL11.glVertex2f(0, 9);\n \t\t\t\tGL11.glVertex2f(4, 9);\n \t\t\t\tGL11.glVertex2f(4, 3);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\tGL11.glEnd();\n \n \t\tGL11.glPopMatrix();\n \t\t\n \t}", "@Override\n public void render() {\n\n renderer.prepWindowRender(globalGameData.getGameWindow());\n renderer.setRenderSpace(0,0,500,500);\n\n\n renderEnvironment(getMainCamera(),testPlayer.getPlayerEntity().getEntityView().getViewableRegions(), instancedGridMesh);\n renderer.enableTransparency();\n walkieTalkie.render(renderer,renderer.getRenderWidth());\n renderer.disableTransparency();\n\n\n\n renderer.setRenderSpace(500,0,500,500);\n if (currentPlayers.containsKey(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\"))) {\n renderEnvironment(getMainCamera(),currentPlayers.get(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\")).getEntityView().getViewableRegions(), instancedGridMesh);\n }\n\n renderer.setRenderSpace(1000,0,500,500);\n renderer.enableTransparency();\n renderer.render2DTextItems(debugItems, \"Default2D\");\n renderer.disableTransparency();\n\n /*\n if (currentPlayers.containsKey(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\"))) {\n renderer.setRenderSpace(500, 0, 500, 500);\n for (Region region : currentPlayers.get(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\")).getEntityView().getViewableRegions()) {\n for (Block block : region.getBlocksArray()) {\n if (block instanceof CustomRenderBlock) {\n ((CustomRenderBlock) block).renderCustomBlock(renderer, camera);\n }\n }\n for (Entity entity : region.getEntities()) {\n entity.render(renderer, camera);\n }\n }\n }\n */\n\n\n //renderer.setRenderSpace(500,0,280,500);\n //SpriteItem spriteItem = new SpriteItem(AssetLoader.getTextureAsset(\"Noise\"),280,500,true);\n //spriteItem.setPosition(0,0,0);\n //renderer.render2DSpriteItem(spriteItem,\"Default2D\");\n //spriteItem.cleanup();\n\n\n\n /*\n renderer.getShader(\"DebugShader2D\").bind();\n glActiveTexture(GL_TEXTURE1);\n glBindTexture(GL_TEXTURE_2D, shaderTestBitmap.getId());\n glActiveTexture(GL_TEXTURE2);\n glBindTexture(GL_TEXTURE_2D, shaderTestEffect1.getId());\n glActiveTexture(GL_TEXTURE3);\n glBindTexture(GL_TEXTURE_2D, shaderTestEffect2.getId());\n glActiveTexture(GL_TEXTURE4);\n glBindTexture(GL_TEXTURE_2D, shaderTestEffect3.getId());\n renderer.getShader(\"DebugShader2D\").setUniform(\"bitmap\", 1);\n renderer.getShader(\"DebugShader2D\").setUniform(\"effect1\", 2);\n renderer.getShader(\"DebugShader2D\").setUniform(\"effect2\", 3);\n renderer.getShader(\"DebugShader2D\").setUniform(\"effect3\", 4);\n i++;\n i %= 600;\n float framePercent = i / 600.0f;\n renderer.getShader(\"DebugShader2D\").setUniform(\"frame\", framePercent);\n System.out.println(i);\n shaderTest.setPosition((float)gameInput.getMouseX(),(float)gameInput.getMouseY(),0);\n renderer.render2DSprite(shaderTest, \"DebugShader2D\");\n */\n\n\n\n\n\n }", "private void initRendering() {\n ring = new Ring(0.3f, 0.7f);\n line = new Line(ImageTargets.screenWidth / 2, ImageTargets.screenHeight / 2);\n state_txt = createObject(68f, state_txt_cx, state_txt_cy, R.drawable.state);\n state_img = createObject(120f, state_img_cx, state_img_cy, R.drawable.open);\n record_txt = createObject(68f, record_txt_cx, record_txt_cy, R.drawable.record_txt);\n record_img = createObject(95f, record_img_cx, record_img_cy, R.drawable.record_img);\n recog_txt = createObject(68f, recog_txt_cx, recog_txt_cy, R.drawable.recog_txt);\n recog_img = createObject(155, recog_img_cx, recog_img_cy, R.drawable.person);\n record_num = createObject(85, record_num_cx, record_num_cy, R.drawable.num);\n\n histogram = createHistogram(85, 275.0f, 1150, 2.0f);\n histogram1 = createHistogram(85, 405, 1150, 2.2f);\n histogram2 = createHistogram(85, 540, 1150, 2.58f);\n histogram3 = createHistogram(85, 675, 1150, 0.9f);\n mRenderer = Renderer.getInstance();\n\n GLES20.glClearColor(0.0f, 0.0f, 0.0f, Vuforia.requiresAlpha() ? 0.0f\n : 1.0f);\n setBgTransparent();\n //初始化纹理\n initTexture(res);\n mActivity.loadingDialogHandler\n .sendEmptyMessage(LoadingDialogHandler.HIDE_LOADING_DIALOG);\n\n }", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "SurfaceTexture mo17006a();", "private void drawsegment_gouraud_texture24_alpha\n (\n float leftadd,\n float rghtadd,\n int ytop,\n int ybottom\n ) {\n \n //Accurate texture mode added - comments stripped from dupe code, see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode){\n if(precomputeAccurateTexturing()){ //see if the precomputation goes well, if so finish the setup\n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n accurateMode = false; //if the matrix inversion screwed up, revert to normal rendering (something is degenerate)\n }\n }\n \n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n float iaf = iaadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n int ia = (int) (iaf * xdiff + aleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode&&goingIn){\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU; iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else{\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n for ( ;xstart < xend; xstart++ ) {\n if(accurateMode){\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else{\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n \n // get texture pixel color\n try\n {\n //if (iz < m_zbuffer[xstart]) {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) { // [fry 041114]\n //m_zbuffer[xstart] = iz;\n \n // blend\n int al = ia >> 16;\n \n int red;\n int grn;\n int blu;\n \n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = (iu & 0xFFFF) >> 9;\n int ivi = (iv & 0xFFFF) >> 9;\n \n // get texture pixels\n int pix0 = m_texture[ofs];\n int pix1 = m_texture[ofs + 1];\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int pix2 = m_texture[ofs];\n int pix3 = m_texture[ofs + 1];\n \n // red\n int red0 = (pix0 & 0xFF0000);\n int red2 = (pix2 & 0xFF0000);\n int up = red0 + ((((pix1 & 0xFF0000) - red0) * iui) >> 7);\n int dn = red2 + ((((pix3 & 0xFF0000) - red2) * iui) >> 7);\n red = (up + (((dn-up) * ivi) >> 7)) >> 16;\n \n // grn\n red0 = (pix0 & 0xFF00);\n red2 = (pix2 & 0xFF00);\n up = red0 + ((((pix1 & 0xFF00) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF00) - red2) * iui) >> 7);\n grn = (up + (((dn-up) * ivi) >> 7)) >> 8;\n \n // blu\n red0 = (pix0 & 0xFF);\n red2 = (pix2 & 0xFF);\n up = red0 + ((((pix1 & 0xFF) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF) - red2) * iui) >> 7);\n blu = up + (((dn-up) * ivi) >> 7);\n } else {\n blu = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)];\n red = (blu & 0xFF0000) >> 16; // 0 - 255\n grn = (blu & 0xFF00) >> 8; // 0 - 255\n blu = (blu & 0xFF); // 0 - 255\n }\n \n // multiply with gouraud color\n red = (red * ir) >>> 8; // 0x00FF????\n grn = (grn * ig) >>> 16; // 0x0000FF??\n blu = (blu * ib) >>> 24; // 0x000000FF\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n \n //\n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al) >> 8)) & 0xFF0000) |\n ((bg + (((grn - bg) * al) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al) >> 8)) & 0xFF);\n // m_stencil[xstart] = p;\n }\n }\n catch (Exception e) {\n }\n \n //\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n ia+=iaadd;\n iz+=izadd;\n }\n \n ypixel++;//accurate mode\n \n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n uleft+=uleftadd;\n vleft+=vleftadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n aleft+=aleftadd;\n zleft+=zleftadd;\n }\n }", "@Override\n\t\tpublic void render()\n\t\t{\n\t\t\tif(color.alpha() > 0)\n\t\t\t{\n\t\t\t\tbind();\n\t\t\t\tGL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);\n\t\t\t\tGL11.glBegin(GL11.GL_TRIANGLE_STRIP);\n\t\t\t\t\tfloat screenWidth = WindowManager.controller().width();\n\t\t\t\t\tfloat screenHeight = WindowManager.controller().height();\n\t\t\t\t\tGL11.glVertex2f(0, 0);\n\t\t\t\t\tGL11.glVertex2f(screenWidth, 0);\n\t\t\t\t\tGL11.glVertex2f(0, screenHeight);\n\t\t\t\t\tGL11.glVertex2f(screenWidth, screenHeight);\n\t\t\t\tGL11.glEnd();\n\t\t\t\trelease();\n\t\t\t}\n\t\t}", "SurfaceTexture mo17015a();", "public Level()\n {\n //Initialise Tile Types\n try \n {\n //Dynamically assign texture paints\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/surface.jpg\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/rover.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/rock.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/mineral.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/target.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/warning.png\")), tile));\n } catch(FileNotFoundException fnfe) {\n System.out.println(\"ERROR: Invalid texture paint, file not found\" + fnfe);\n }\n catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {}", "private void drawFire(Graphics g)\n {\n for (int x = 0; x < 19; x++)\n {\n for (int y = 0; y < 15; y++)\n {\n if (fire[x][y] != null)\n {\n switch(fire[x][y].getDirection())\n {\n case 10:\n {\n tileset.getSprite(8, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 1:\n {\n tileset.getSprite(12, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 2:\n {\n tileset.getSprite(9, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 3:\n {\n tileset.getSprite(13, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 4:\n {\n tileset.getSprite(7, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 5:\n {\n tileset.getSprite(11, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 6:\n {\n tileset.getSprite(10, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 7:\n {\n tileset.getSprite(14, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 8:\n {\n tileset.getSprite(6, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n }\n }\n }\n }\n }", "protected void drawGuiContainerBackgroundLayer(float f, int x, int y)\n {\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n super.mc.getTextureManager().bindTexture(background);\n int j = (super.width - super.xSize) / 2;\n int k = (super.height - super.ySize) / 2;\n this.drawTexturedModalRect(j, k, 0, 0, super.xSize, super.ySize);\n int i1;\n\n if (this.container.tileEntity.energy > 0)\n {\n i1 = this.container.tileEntity.energy * 14 / 200;\n\n if (i1 > 14)\n {\n i1 = 14;\n }\n\n this.drawTexturedModalRect(j + 62, k + 36 + 14 - i1, 176, 14 - i1, 14, i1);\n }\n\n i1 = this.container.tileEntity.pumpCharge * 41 / 200;\n\n if (i1 > 41)\n {\n i1 = 41;\n }\n\n this.drawTexturedModalRect(j + 99, k + 61 - i1, 176, 55, 12, 5);\n\n if (i1 > 0)\n {\n this.drawTexturedModalRect(j + 99, k + 25 + 41 - i1, 176, 14, 12, i1);\n }\n\n this.drawTexturedModalRect(j + 98, k + 19, 188, 14, 13, 47);\n }", "@Override\n\tpublic void show () {\n overWorld = new Sprite(new TextureRegion(new Texture(Gdx.files.internal(\"Screens/overworldscreen.png\"))));\n overWorld.setPosition(0, 0);\n batch = new SpriteBatch();\n batch.getProjectionMatrix().setToOrtho2D(0, 0, 320, 340);\n\n // Creates the indicator and sets it to the position of the first grid item.\n indicator = new MapIndicator(screen.miscAtlases.get(2));\n // Creates the icon of Daur that indicates his position.\n icon = new DaurIcon(screen.miscAtlases.get(2));\n // Sets the mask position to zero, as this screen does not lie on the coordinate plane of any tiled map.\n screen.mask.setPosition(0, 0);\n screen.mask.setSize(320, 340);\n Gdx.input.setInputProcessor(inputProcessor);\n\n // Creates all relevant text.\n createText();\n // Sets numX and numY to the position of Daur on the map.\n numX = storage.cellX;\n numY = storage.cellY;\n indicator.setPosition(numX * 20, numY * 20 + 19);\n // Sets the icon to the center of this cell.\n icon.setPosition(numX * 20 + 10 - icon.getWidth() / 2, numY * 20 + 29 - icon.getHeight() / 2);\n // Creates all the gray squares necessary.\n createGraySquares();\n }", "private void drawScreen(Sprite spr) {\n\t\tTexture tex = spr.getTexture();\n\t\t\n\t\ttex.bind();\n\t\t\n\t\tglBegin(GL_QUADS);\n\t\t{\n\t\t\tglTexCoord2f(0, tex.getHeight());\n\t\t\tglVertex2f(0, spr.getHeight());\n\t\t\tglTexCoord2f(tex.getWidth(), tex.getHeight());\n\t\t\tglVertex2f(spr.getWidth(), spr.getHeight());\n\t\t\tglTexCoord2f(tex.getWidth(), 0);\n\t\t\tglVertex2f(spr.getWidth(), 0);\n\t\t\tglTexCoord2f(0, 0);\n\t\t\tglVertex2f(0, 0);\n\t\t}\n\t\tglEnd();\n\t}", "private void renderEngine() {\r\n GL11.glDisable(GL11.GL_LIGHTING);\r\n\r\n GL11.glEnable(GL11.GL_BLEND);\r\n GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);\r\n\r\n shotTexture.bind();\r\n engine.render();\r\n\r\n GL11.glDisable(GL11.GL_BLEND);\r\n }", "public void Render(){\n //player rect\n glPushMatrix();\n glTranslatef(px, py, 0.0f);\n glBegin(GL_TRIANGLES);\n glColor3f(1.0f, 1.0f, 1.0f);\n glVertex2f(-sx, sy);\n glVertex2f(-sx, -sy);\n glVertex2f(sx, sy);\n glVertex2f(sx, sy);\n glVertex2f(-sx, -sy);\n glVertex2f(sx, -sy);\n glEnd();\n glPopMatrix();\n \n if(debug){\n glPushMatrix();\n glBegin(GL_LINES);\n glColor3f(0f, 1f, 0f);\n glVertex2f(px-sx, py+sy/2);\n glVertex2f(px+sx, py+sy/2);\n glColor3f(0f, 1f, 0f);\n glVertex2f(px-sx, py-sy/2);\n glVertex2f(px+sx, py-sy/2);\n glEnd();\n glPopMatrix();\n }\n \n }", "public void renderInvBlock(bbb renderblocks, int md)\r\n/* 73: */ {\r\n/* 74: 72 */ this.block.f();\r\n/* 75: */ \r\n/* 76: 74 */ this.context.setDefaults();\r\n/* 77: 75 */ this.context.setPos(-0.5D, -0.5D, -0.5D);\r\n/* 78: 76 */ this.context.useNormal = true;\r\n/* 79: 77 */ this.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);\r\n/* 80: */ \r\n/* 81: 79 */ RenderLib.bindTexture(\"/eloraam/machine/machine1.png\");\r\n/* 82: 80 */ baz tessellator = baz.a;\r\n/* 83: */ \r\n/* 84: 82 */ tessellator.b();\r\n/* 85: 83 */ this.context.useNormal = true;\r\n/* 86: */ \r\n/* 87: */ \r\n/* 88: 86 */ this.context.setTex(28, 28, 26, 26, 26, 26);\r\n/* 89: */ \r\n/* 90: 88 */ this.context.renderBox(60, 0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D);\r\n/* 91: 89 */ this.context.renderBox(60, 0.6240000128746033D, 0.9990000128746033D, 0.6240000128746033D, 0.3759999871253967D, 0.001000000047497451D, 0.3759999871253967D);\r\n/* 92: 90 */ renderFlanges(3, 27);\r\n/* 93: */ \r\n/* 94: 92 */ tessellator.a();\r\n/* 95: 93 */ RenderLib.unbindTexture();\r\n/* 96: 94 */ this.context.useNormal = false;\r\n/* 97: */ }", "public static void init() {\n // init quad VAO\n vao = glGenVertexArrays();\n glBindVertexArray(vao);\n int positionVbo = glGenBuffers();\n FloatBuffer fb = BufferUtils.createFloatBuffer(2 * 4);\n fb.put(0.0f).put(0.0f);\n fb.put(1.0f).put(0.0f);\n fb.put(1.0f).put(1.0f);\n fb.put(0.0f).put(1.0f);\n fb.flip();\n glBindBuffer(GL_ARRAY_BUFFER, positionVbo);\n glBufferData(GL_ARRAY_BUFFER, fb, GL_STATIC_DRAW);\n glVertexAttribPointer(Main.shader.inPositionLoc, 2, GL_FLOAT, false, 0, 0L);\n glEnableVertexAttribArray(Main.shader.inPositionLoc);\n glBindBuffer(GL_ARRAY_BUFFER, 0);\n glBindVertexArray(0);\n \n // init texture\n IntBuffer width = BufferUtils.createIntBuffer(1);\n IntBuffer height = BufferUtils.createIntBuffer(1);\n IntBuffer components = BufferUtils.createIntBuffer(1);\n byte[] dataArr = Main.loadResource(\"resources/font DF.png\");\n ByteBuffer data = BufferUtils.createByteBuffer(dataArr.length);\n data.put(dataArr).rewind();\n data = Objects.requireNonNull(stbi_load_from_memory(data, width, height, components, 1));\n int imgWidth = width.get();\n int imgHeight = height.get();\n charWidth = imgWidth / 16;\n charHeight = imgHeight / 16;\n \n texture = glGenTextures();\n glBindTexture(GL_TEXTURE_2D, texture);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, imgWidth, imgHeight, 0, GL_RED, GL_UNSIGNED_BYTE, data);\n stbi_image_free(data);\n \n // set texScale uniform\n glUniform2f(Main.shader.texScaleLoc, 1/16f, 1/16f);\n }", "void render(Inventory inventory, Player player, int offsetX, int offsetY);", "private void renderGuiLives(SpriteBatch batch)\n {\n float x = cameraGui.viewportWidth - 50 - Constants.MAX_LIVES * 50;\n float y = -15;\n \n for (int i = 0; i < worldController.lives; i++)\n {\n batch.draw(Assets.instance.gui.pumpkin, x + i * 50, y, 50, 50, 120, 100, 0.35f, -0.35f, 0);\n batch.setColor(1, 1, 1, 1);\n }\n }", "@Override\n public void loadTexture() {\n\n }", "public void russia(){\n stroke(1);\n //back guns\n fill(0);\n rect(73,192,4,15);\n rect(224,192,4,15);\n rect(71,207,8,15);\n rect(222,207,8,15);\n rect(66,207,3,15);\n rect(232,207,3,17);\n rect(122,109,4,15);\n rect(175,110,4,15);\n rect(121,120,6,15);\n rect(174,120,6,15);\n rect(116,124,3,15);\n rect(182,124,3,15);\n\n //wings\n fill(165,0,0);//gray\n beginShape();\n vertex(14,286);\n vertex(61,236);\n vertex(88,308);\n vertex(51,334);\n vertex(14,313);\n endShape(CLOSE);\n beginShape();\n vertex(286,287);\n vertex(286,312);\n vertex(247,335);\n vertex(212,309);\n vertex(238,238);\n endShape(CLOSE);\n\n fill(0);//black\n beginShape();\n vertex(38,307);\n vertex(74,307);\n vertex(80,314);\n vertex(81,337);\n vertex(68,345);\n vertex(38,327);\n endShape(CLOSE);\n beginShape();\n vertex(219,316);\n vertex(226,308);\n vertex(262,308);\n vertex(262,326);\n vertex(231,345);\n vertex(219,336);\n endShape(CLOSE);\n\n fill(18,39,148);//blue\n beginShape();\n vertex(96,191);\n vertex(61,230);\n vertex(60,269);\n vertex(96,312);\n vertex(101,300);\n vertex(100,247);\n vertex(112,232);\n vertex(132,232);\n vertex(131,186);\n endShape(CLOSE);\n beginShape();\n vertex(204,191);\n vertex(240,230);\n vertex(240,270);\n vertex(205,312);\n vertex(200,302);\n vertex(200,248);\n vertex(193,238);\n vertex(185,231);\n vertex(170,230);\n vertex(170,186);\n endShape(CLOSE);\n\n //white\n fill(200);\n beginShape();\n vertex(70,217);\n vertex(74,220);\n vertex(81,210);\n vertex(85,213);\n vertex(75,227);\n vertex(72,229);\n vertex(71,231);\n vertex(73,233);\n vertex(73,268);\n vertex(71,272);\n vertex(76,277);\n vertex(82,274);\n vertex(89,283);\n vertex(90,297);\n vertex(66,272);\n vertex(65,235);\n vertex(68,229);\n vertex(62,228);\n endShape(CLOSE);\n beginShape();\n vertex(228,217);\n vertex(225,218);\n vertex(218,211);\n vertex(215,213);\n vertex(223,227);\n vertex(226,226);\n vertex(230,230);\n vertex(227,233);\n vertex(228,270);\n vertex(229,272);\n vertex(223,276);\n vertex(218,276);\n vertex(210,283);\n vertex(211,296);\n vertex(235,273);\n vertex(234,233);\n vertex(232,228);\n vertex(237,227);\n endShape(CLOSE);\n\n //guns\n //red\n fill(194,24,11);\n beginShape();\n vertex(121,301);\n vertex(98,313);\n vertex(102,336);\n vertex(119,342);\n vertex(139,336);\n vertex(141,313);\n endShape(CLOSE);//l\n beginShape();\n vertex(159,312);\n vertex(162,336);\n vertex(180,342);\n vertex(200,336);\n vertex(202,313);\n vertex(180,302);\n endShape(CLOSE);\n\n //black\n fill(0);\n rect(105,315,30,30);\n rect(166,315,30,30);\n quad(105,344,109,355,131,355,135,344);\n quad(166,344,170,355,192,355,196,344);\n\n rect(103,253,33,62);//l\n rect(164,252,33,62);//r\n //white\n fill(200);\n bezier(103,252,107,230,132,230,136,252);//l\n bezier(164,252,169,230,192,230,197,252);//r\n\n rect(103,280,33,25);//l\n rect(164,280,33,25);//r\n rect(104,319,33,26,3);//l\n rect(165,319,33,26,3);//r\n fill(194,24,11);\n rect(115,310,7,28,8);//l\n rect(178,310,7,28,8);//r\n\n fill(194,24,11);\n rect(105,284,10,15);\n rect(124,284,10,15);\n rect(167,285,10,15);\n rect(185,284,10,15);\n\n //body-wings\n\n fill(0,0,67);//blue\n bezier(107,154,101,162,98,169,98,187);\n bezier(191,153,199,164,202,172,203,187);\n quad(107,154,98,186,98,223,107,224);\n quad(191,153,203,186,202,223,192,223);\n fill(192,0,11);//red\n quad(134,112,108,147,107,239,132,230);\n quad(165,112,192,147,193,239,168,230);\n //black\n fill(0);\n quad(130,122,130,142,111,164,111,147);\n quad(169,122,188,147,188,165,169,144);\n //white\n fill(200);\n beginShape();\n vertex(131,154);\n vertex(129,202);\n vertex(118,202);\n vertex(112,181);\n vertex(110,179);\n vertex(110,171);\n endShape(CLOSE);\n beginShape();\n vertex(170,154);\n vertex(190,172);\n vertex(190,182);\n vertex(188,181);\n vertex(182,201);\n vertex(172,201);\n endShape(CLOSE);\n\n fill(0);\n quad(134,193,166,193,154,342,146,342);\n fill(192,0,11);\n quad(142,180,159,180,152,352,148,352);\n //white\n fill(200);\n ellipse(150,374,6,50);\n\n //head\n fill(160,0,0);\n ellipse(149.5f,72,33,25);\n ellipse(149.5f,94,30,170);\n fill(0);\n ellipse(149.5f,94,20,160);\n fill(154,155,84);\n ellipse(149.5f,94,17,77);\n strokeWeight(2);\n line(143,74,158,74);\n line(142,104,158,104);\n strokeWeight(1);\n fill(200);\n bezier(143,15,147,2,153,2,155.5f,15);\n}", "public void printTexture(Graphics2D bg) {\n\r\n\t\tbg.setColor(Color.RED);\r\n\t\tbg.setStroke(new BasicStroke(0.1f));\r\n\r\n\t\t//lower base\r\n\t\tprintTextureLine(bg,0,1);\r\n\t\tprintTextureLine(bg,1,2);\r\n\t\tprintTextureLine(bg,2,3);\r\n\t\tprintTextureLine(bg,3,4);\r\n\t\tprintTextureLine(bg,4,5);\r\n\t\tprintTextureLine(bg,5,0);\r\n\r\n\t\t//lateral faces\r\n\t\tbg.setColor(Color.BLACK);\r\n\t\tprintTextureLine(bg,6,7);\r\n\t\tprintTextureLine(bg,7,14);\r\n\t\tprintTextureLine(bg,14,13);\r\n\t\tprintTextureLine(bg,13,6);\r\n\t\t\r\n\t\tprintTextureLine(bg,7,8);\r\n\t\tprintTextureLine(bg,8,15);\r\n\t\tprintTextureLine(bg,15,14);\r\n\t\t\r\n\t\tprintTextureLine(bg,8,9);\r\n\t\tprintTextureLine(bg,9,16);\r\n\t\tprintTextureLine(bg,16,15);\r\n\t\t\r\n\t\tprintTextureLine(bg,9,10);\r\n\t\tprintTextureLine(bg,10,17);\r\n\t\tprintTextureLine(bg,17,16);\r\n\t\t\r\n\t\tprintTextureLine(bg,10,11);\r\n\t\tprintTextureLine(bg,11,18);\r\n\t\tprintTextureLine(bg,18,17);\r\n\t\t\r\n\t\tprintTextureLine(bg,11,12);\r\n\t\tprintTextureLine(bg,12,19);\r\n\t\tprintTextureLine(bg,19,18);\r\n\t\r\n\t\t//gables\r\n\t\tbg.setColor(Color.BLUE);\r\n\r\n\t\tprintTextureLine(bg,13,14);\r\n\t\tprintTextureLine(bg,14,20);\r\n\t\tprintTextureLine(bg,20,13);\r\n\t\t\r\n\t\tprintTextureLine(bg,16,17);\r\n\t\tprintTextureLine(bg,17,21);\r\n\t\tprintTextureLine(bg,21,16);\r\n\t\t\r\n\r\n\t\t//roof\r\n\t\tbg.setColor(Color.RED);\r\n\t\tprintTexturePolygon(bg,22,23,28,25);\r\n\t\t\r\n\t\tprintTexturePolygon(bg,23,24,26,28);\r\n\t\tprintTexturePolygon(bg,26,27,29,28);\r\n\t\tprintTexturePolygon(bg,28,29,31,30);\r\n\t\tprintTexturePolygon(bg,30,25,28);\r\n\r\n\t}", "@SuppressWarnings(\"unchecked\")\n @Override\n public void drawScreen(int mouseX, int mouseY, float renderPartialTicks) {\n drawDefaultBackground();\n\n drawGuiContainerBackgroundLayer(renderPartialTicks, mouseX, mouseY);\n GL11.glDisable(GL12.GL_RESCALE_NORMAL);\n RenderHelper.disableStandardItemLighting();\n GL11.glDisable(GL11.GL_LIGHTING);\n GL11.glDisable(GL11.GL_DEPTH_TEST);\n\n // GuiScreen code start\n int k;\n for (k = 0; k < this.buttonList.size(); ++k) {\n ((GuiButton) this.buttonList.get(k)).drawButton(this.mc, mouseX, mouseY);\n }\n\n for (k = 0; k < this.labelList.size(); ++k) {\n ((GuiLabel) this.labelList.get(k)).drawLabel(this.mc, mouseX, mouseY);\n }\n // GuiScreen code end\n\n RenderHelper.enableGUIStandardItemLighting();\n GL11.glPushMatrix();\n GL11.glTranslatef((float) guiLeft, (float) guiTop, 0.0F);\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n GL11.glEnable(GL12.GL_RESCALE_NORMAL);\n OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 240 / 1.0F, (float) 240 / 1.0F);\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n\n this.theSlot = getHoveredSlot(mouseX, mouseY);\n\n drawSlots(inventorySlots.inventorySlots, (this.theSlot == null) ? -1 : this.theSlot.slotNumber);\n\n // Forge: Force lighting to be disabled as there are some issue where\n // lighting would\n // incorrectly be applied based on items that are in the inventory.\n GL11.glDisable(GL11.GL_LIGHTING);\n this.drawGuiContainerForegroundLayer(mouseX, mouseY);\n GL11.glEnable(GL11.GL_LIGHTING);\n\n InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory;\n ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack;\n\n // Draw hold itemStack\n if (itemstack != null) {\n byte b0 = 8;\n int k1 = this.draggedStack == null ? 8 : 16;\n String format = null;\n\n if (this.draggedStack != null && this.isRightMouseClick) {\n itemstack = itemstack.copy();\n itemstack.stackSize = MathHelper.ceiling_float_int((float) itemstack.stackSize / 2.0F);\n } else if (this.dragSplitting && this.dragSplittingSlots.size() > 1) {\n itemstack = itemstack.copy();\n itemstack.stackSize = this.dragSplittingRemnant;\n\n if (itemstack.stackSize == 0) {\n format = \"\" + EnumChatFormatting.YELLOW + \"0\";\n }\n }\n\n this.drawItemStack(itemstack, mouseX - guiLeft - b0, mouseY - guiTop - k1, format);\n }\n\n if (this.returningStack != null) {\n float f1 = (float) (Minecraft.getSystemTime() - this.returningStackTime) / 100.0F;\n\n if (f1 >= 1.0F) {\n f1 = 1.0F;\n this.returningStack = null;\n }\n\n int k1 = this.returningStackDestSlot.xDisplayPosition - this.touchUpX;\n int j2 = this.returningStackDestSlot.yDisplayPosition - this.touchUpY;\n int l1 = this.touchUpX + (int) ((float) k1 * f1);\n int i2 = this.touchUpY + (int) ((float) j2 * f1);\n this.drawItemStack(this.returningStack, l1, i2, null);\n }\n\n GL11.glPopMatrix();\n\n // Render tooltips\n if (inventoryplayer.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) {\n ItemStack itemstack1 = this.theSlot.getStack();\n this.renderToolTip(itemstack1, mouseX, mouseY);\n }\n\n GL11.glEnable(GL11.GL_LIGHTING);\n GL11.glEnable(GL11.GL_DEPTH_TEST);\n RenderHelper.enableStandardItemLighting();\n }", "private void drawsegment_gouraud_texture32_alpha\n (\n float leftadd,\n float rghtadd,\n int ytop,\n int ybottom\n ) {\n //Accurate texture mode added - comments stripped from dupe code, see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode){\n if(precomputeAccurateTexturing()){ //see if the precomputation goes well, if so finish the setup\n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n accurateMode = false; //if the matrix inversion screwed up, revert to normal rendering (something is degenerate)\n }\n }\n \n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n float iaf = iaadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n int ia = (int) (iaf * xdiff + aleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode&&goingIn){\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU; iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else{\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n for ( ;xstart < xend; xstart++ ) {\n if(accurateMode){\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else{\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n \n // get texture pixel color\n try {\n //if (iz < m_zbuffer[xstart]) {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) { // [fry 041114]\n //m_zbuffer[xstart] = iz;\n \n // blend\n int al = ia >> 16;\n \n int red;\n int grn;\n int blu;\n \n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = (iu & 0xFFFF) >> 9;\n int ivi = (iv & 0xFFFF) >> 9;\n \n // get texture pixels\n int pix0 = m_texture[ofs];\n int pix1 = m_texture[ofs + 1];\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int pix2 = m_texture[ofs];\n int pix3 = m_texture[ofs + 1];\n \n // red\n int red0 = (pix0 & 0xFF0000);\n int red2 = (pix2 & 0xFF0000);\n int up = red0 + ((((pix1 & 0xFF0000) - red0) * iui) >> 7);\n int dn = red2 + ((((pix3 & 0xFF0000) - red2) * iui) >> 7);\n red = (up + (((dn-up) * ivi) >> 7)) >> 16;\n \n // grn\n red0 = (pix0 & 0xFF00);\n red2 = (pix2 & 0xFF00);\n up = red0 + ((((pix1 & 0xFF00) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF00) - red2) * iui) >> 7);\n grn = (up + (((dn-up) * ivi) >> 7)) >> 8;\n \n // blu\n red0 = (pix0 & 0xFF);\n red2 = (pix2 & 0xFF);\n up = red0 + ((((pix1 & 0xFF) - red0) * iui) >> 7);\n dn = red2 + ((((pix3 & 0xFF) - red2) * iui) >> 7);\n blu = up + (((dn-up) * ivi) >> 7);\n \n // alpha\n pix0>>>=24;\n pix2>>>=24;\n up = pix0 + ((((pix1 >>> 24) - pix0) * iui) >> 7);\n dn = pix2 + ((((pix3 >>> 24) - pix2) * iui) >> 7);\n al = al * (up + (((dn-up) * ivi) >> 7)) >> 8;\n } else {\n blu = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)];\n al = al * (blu >>> 24) >> 8;\n red = (blu & 0xFF0000) >> 16; // 0 - 255\n grn = (blu & 0xFF00) >> 8; // 0 - 255\n blu = (blu & 0xFF); // 0 - 255\n }\n \n // multiply with gouraud color\n red = (red * ir) >>> 8; // 0x00FF????\n grn = (grn * ig) >>> 16; // 0x0000FF??\n blu = (blu * ib) >>> 24; // 0x000000FF\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n \n //\n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al) >> 8)) & 0xFF0000) |\n ((bg + (((grn - bg) * al) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al) >> 8)) & 0xFF);\n // m_stencil[xstart] = p;\n }\n } catch (Exception e) { }\n \n //\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n ia+=iaadd;\n iz+=izadd;\n }\n ypixel++;//accurate mode\n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n uleft+=uleftadd;\n vleft+=vleftadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n aleft+=aleftadd;\n zleft+=zleftadd;\n }\n }", "@Override\n public void display(GLAutoDrawable drawable) {\n // Get the OpenGL context\n gl = drawable.getGL().getGL2();\n\n // Clear some GL buffers\n gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n gl.glLoadIdentity();\n\n // Translate by saved values and set render mode\n gl.glTranslatef(tr_x, tr_y, tr_z);\n gl.glPolygonMode(GL_FRONT_AND_BACK, render_mode);\n\n // Array of light position floats\n // Convert to byte buffer and then float buffer\n float[] light_pos = {1.0f, 1.0f, 1.0f, 1.0f};\n ByteBuffer lbb = ByteBuffer.allocateDirect(16);\n lbb.order(ByteOrder.nativeOrder());\n FloatBuffer fb = lbb.asFloatBuffer();\n fb.put(light_pos);\n fb.position(0);\n\n // Set light on and send position if lights are meant to be on\n if (lights_on) {\n gl.glEnable(GL_LIGHT0);\n gl.glLightfv(GL_LIGHT0, GL_POSITION, fb);\n gl.glColorMaterial(GL_FRONT, GL_DIFFUSE);\n gl.glEnable(GL_COLOR_MATERIAL);\n } else {\n gl.glDisable(GL_LIGHT0);\n }\n\n // Create some more arrays for float buffers\n float[] ambient;\n float[] diffuse;\n float[] specular;\n\n // Use values based on selected material\n if (material % 3 == 0) {\n ambient = new float[]{0.96f, 0.96f, 0.96f, 1.0f};\n diffuse = new float[]{0.96f, 0.96f, 0.96f, 1.0f};\n specular = new float[]{0.96f, 0.96f, 0.96f, 1.0f};\n } else if (material % 3 == 1) {\n ambient = new float[]{1.0f, 0.843f, 0, 1.0f};\n diffuse = new float[]{1.0f, 0.843f, 0, 1.0f};\n specular = new float[]{1.0f, 0.843f, 0, 1.0f};\n } else {\n ambient = new float[]{0.804f, 0.5216f, 0.247f, 1.0f};\n diffuse = new float[]{0.804f, 0.5216f, 0.247f, 1.0f};\n specular = new float[]{0.804f, 0.5216f, 0.247f, 1.0f};\n }\n\n // Ambient settings for GL_LIGHT0\n fb.put(ambient);\n fb.position(0);\n// gl.glLightfv(GL_LIGHT0, GL_AMBIENT, fb);\n\n // Diffuse settings for GL_LIGHT0\n fb.put(diffuse);\n fb.position(0);\n// gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, fb);\n\n // Specular settings for GL_LIGHT0\n fb.put(specular);\n fb.position(0);\n// gl.glLightfv(GL_LIGHT0, GL_SPECULAR, fb);\n\n // Settings for the ambient lighting\n fb.put(new float[]{0.3f, 0.3f, 0.3f, 1.0f});\n fb.position(0);\n// gl.glEnable(GL_LIGHTING);\n// gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, fb);\n\n // Rotate based on saved values\n gl.glRotatef(rt_x, 1, 0, 0);\n gl.glRotatef(rt_y, 0, 1, 0);\n gl.glRotatef(rt_z, 0, 0, 1);\n\n //gl.glColor3f( 1f,0f,0f ); //applying red \n // Begin triangle rendering\n gl.glBegin(GL_POINTS);\n\n if (values != null && values.isVisible()) {\n // Loop over faces, rendering each vertex for each face\n for (int i = 0; i < values.face_list.length; i++) {\n // Set the normal for a vertex and then make the vertex\n gl.glColor3f(0.5f, 0.0f, 1.0f); //applying purpura \n// gl.glNormal3f(values.face_list[i].vertex_list[0].normal.x,\n// values.face_list[i].vertex_list[0].normal.y,\n// values.face_list[i].vertex_list[0].normal.z);\n gl.glVertex3f(values.face_list[i].vertex_list[0].x,\n values.face_list[i].vertex_list[0].y,\n values.face_list[i].vertex_list[0].z);\n\n // And again\n gl.glColor3f(0.5f, 0.0f, 1.0f); //applying red \n// gl.glNormal3f(values.face_list[i].vertex_list[1].normal.x,\n// values.face_list[i].vertex_list[1].normal.y,\n// values.face_list[i].vertex_list[1].normal.z);\n gl.glVertex3f(values.face_list[i].vertex_list[1].x,\n values.face_list[i].vertex_list[1].y,\n values.face_list[i].vertex_list[1].z);\n\n // Third time's the charm\n gl.glColor3f(0.5f, 0.0f, 1.0f); //applying red \n// gl.glNormal3f(values.face_list[i].vertex_list[2].normal.x,\n// values.face_list[i].vertex_list[2].normal.y,\n// values.face_list[i].vertex_list[2].normal.z);\n gl.glVertex3f(values.face_list[i].vertex_list[2].x,\n values.face_list[i].vertex_list[2].y,\n values.face_list[i].vertex_list[2].z);\n }\n\n if (values.face_list.length == 0) {\n for (int i = 0; i < values.vertex_list.length; i++) {\n gl.glColor3f(1f, 0f, 0f); //applying red \n gl.glVertex3f(values.vertex_list[i].x,\n values.vertex_list[i].y,\n values.vertex_list[i].z);\n }\n }\n }\n\n float[] d1f = {0.2f, 0.5f, 0.8f, 1.0f};\n FloatBuffer d1 = FloatBuffer.wrap(d1f);\n\n if (valuesB != null && !valuesB.isEmpty()) {\n for (Reader figura : valuesB) {\n if (figura.isVisible()) {\n FloatBuffer d3U = figura.getColor() == null ? d1 : figura.getColor();\n for (int i = 0; i < figura.vertex_list.length; i++) {\n gl.glColor3fv(d3U); //applying red \n// gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, d2);\n gl.glVertex3f(figura.vertex_list[i].x,\n figura.vertex_list[i].y,\n figura.vertex_list[i].z);\n }\n }\n }\n }\n\n try{\n if (resultadoICPClasico != null && !resultadoICPClasico.isEmpty() && resultadoICPVisible) {\n\n for (Point3d point3d : resultadoICPClasico) {\n gl.glColor3d(1.0f, 1.1f, 0.0f); //applying amarillo? \n // gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, d1);\n gl.glVertex3d(point3d.getX(), point3d.getY(), point3d.getZ());\n }\n }\n }catch(java.util.ConcurrentModificationException ex){\n log.warn(\"Solo si use archivos externos? \"+ex.getMessage()); \n }catch(Exception ex){\n log.warn(\"Otro? \"+ex.getMessage()); \n }\n\n // End rendering\n gl.glEnd();\n gl.glLoadIdentity();\n }", "private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n } else {\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n g.setColor(Color.white);\n g.drawLine(0, 500, 595, 500);\n player.render(g);\n for (int i = 0; i < aliens.size(); i++) {\n Alien al = aliens.get(i);\n al.render(g);\n }\n if (shotVisible) {\n shot.render(g);\n }\n\n if(gameOver==false)\n {\n gameOver();\n }\n for(Alien alien: aliens){\n Bomb b = alien.getBomb();\n b.render(g);\n }\n g.setColor(Color.red);\n Font small = new Font(\"Helvetica\", Font.BOLD, 20);\n g.setFont(small);\n g.drawString(\"G - Guardar\", 10, 50);\n g.drawString(\"C - Cargar\", 10, 70);\n g.drawString(\"P - Pausa\", 10, 90);\n\n if(keyManager.pause)\n {\n g.drawString(\"PAUSA\", 250, 300);\n }\n \n bs.show();\n g.dispose();\n }\n\n }", "@Override\n\tpublic void render(float delta) {\n\t\tbackground.render(camera);\n\t\tui.act();\n\t\tui.draw();\n\t\tif(showG) {\n\t\t\tspriteBatch.begin();\n\t\t\tspriteBatch.draw(texture, 0, 0);\n\t\t\tspriteBatch.end();\n\t\t}\n\t\tif(showA) {\n\t\t\tspriteBatch.begin();\n\t\t\tspriteBatch.draw(texture2, 0, 0);\n\t\t\tspriteBatch.end();\n\t\t}\n\t}", "@Override\n protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n this.mc.renderEngine.bindTexture((ResourceLocation)back);\n int var5 = (this.width - this.xSize) / 2;\n int var6 = (this.height - this.ySize) / 2;\n this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);\n int b = tile.tableBurnTime; // 取得Tile内的燃料燃烧时间\n float maxBurnTime = tile.maxBurnTime*1.0F;// 取得最大燃料燃烧时间,用float,不用的话得不出百分比\n if (b > 0 && maxBurnTime > 0) // 确定描绘的时机\n {\n // 描绘火焰图像\n this.drawTexturedModalRect(this.guiLeft + 81, this.guiTop + 37 + (int)(14 - 14 * ((float)b / maxBurnTime)), 176, (int)(14 - 14 * ((float)b / maxBurnTime)), 14, (int)(14 * ((float)b / maxBurnTime)));\n }\n float hadCopyedTime = tile.hadCopyedTime*1.0F;\n float maxCopyTime = tile.maxCopyTime*1.0F;\n \t\t if(hadCopyedTime > 0 && maxCopyTime > 0){\n \t\t\t this.drawTexturedModalRect(this.guiLeft + 77, this.guiTop + 20, 176, 14, (int)(24*(hadCopyedTime / maxCopyTime)), 17);\n \t\t }\n /*drawCenteredString(fontRendererObj, String.valueOf(tile.hadCopyedTime), 15, 0, 4210752);\n drawCenteredString(fontRendererObj, String.valueOf(tile.maxCopyTime), 15, 25, 4210752);\n drawCenteredString(fontRendererObj, String.valueOf(tile.tableBurnTime), 15, 50, 4210752);\n drawCenteredString(fontRendererObj, String.valueOf(tile.maxBurnTime), 15, 75, 4210752);*/\n }", "public void renderWorldBlock(bbb renderblocks, ym iba, int i, int j, int k, int md)\r\n/* 26: */ {\r\n/* 27: 26 */ int cons = 0;\r\n/* 28: 27 */ TilePipe tt = (TilePipe)CoreLib.getTileEntity(iba, i, j, k, TilePipe.class);\r\n/* 29: 29 */ if (tt == null) {\r\n/* 30: 29 */ return;\r\n/* 31: */ }\r\n/* 32: 31 */ this.context.exactTextureCoordinates = true;\r\n/* 33: 32 */ this.context.setTexFlags(55);\r\n/* 34: 33 */ this.context.setTint(1.0F, 1.0F, 1.0F);\r\n/* 35: 34 */ this.context.setPos(i, j, k);\r\n/* 36: 35 */ if (tt.CoverSides > 0)\r\n/* 37: */ {\r\n/* 38: 36 */ this.context.readGlobalLights(iba, i, j, k);\r\n/* 39: 37 */ renderCovers(tt.CoverSides, tt.Covers);\r\n/* 40: */ }\r\n/* 41: 40 */ cons = PipeLib.getConnections(iba, i, j, k);\r\n/* 42: */ \r\n/* 43: */ \r\n/* 44: */ \r\n/* 45: 44 */ this.context.setBrightness(this.block.e(iba, i, j, k));\r\n/* 46: */ \r\n/* 47: 46 */ this.context.setLocalLights(0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F);\r\n/* 48: 47 */ this.context.setPos(i, j, k);\r\n/* 49: */ \r\n/* 50: 49 */ RenderLib.bindTexture(\"/eloraam/machine/machine1.png\");\r\n/* 51: */ \r\n/* 52: */ \r\n/* 53: */ \r\n/* 54: */ \r\n/* 55: */ \r\n/* 56: */ \r\n/* 57: */ \r\n/* 58: */ \r\n/* 59: */ \r\n/* 60: */ \r\n/* 61: */ \r\n/* 62: */ \r\n/* 63: */ \r\n/* 64: 63 */ renderCenterBlock(cons, 26, 28);\r\n/* 65: */ \r\n/* 66: 65 */ tt.cacheFlange();\r\n/* 67: 66 */ renderFlanges(tt.Flanges, 27);\r\n/* 68: */ \r\n/* 69: 68 */ RenderLib.unbindTexture();\r\n/* 70: */ }", "public void display(GLAutoDrawable gLDrawable) {\n final GL2 gl = gLDrawable.getGL().getGL2(); \n gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); //clear buffers\n gl.glMatrixMode(GL2.GL_MODELVIEW);\n gl.glLoadIdentity();\t\n\n EffectsManager.getManager().updateLights(gl);\n //eye positition is set by Animator class, it looks at 0, 0, 0\n glu.gluLookAt(eyeLocation.x, eyeLocation.y, eyeLocation.z, 0, 0, 0, 0, 1, 0);\n \n gl.glPushMatrix();\n gl.glBegin(GL2.GL_QUADS);\n \n Random rand = new Random(100);\n \n for (QuadFace f : mesh) {\n \tfor (Vector3f v : f.getVertices()) {\n \t\tVector3f norm = normals.get(v);\n \t\tgl.glColor3f(rand.nextFloat(), rand.nextFloat(), rand.nextFloat());\n \t\tgl.glNormal3f(norm.x, norm.y, norm.z);\n \t\tgl.glVertex3f(v.x, v.y, v.z);\n \t}\n }\n gl.glEnd();\n gl.glPopMatrix();\n gl.glFlush(); \n }", "public void render();", "void glActiveTexture(int texture);", "void glActiveTexture(int texture);", "private void drawsegment_gouraud_texture8_alpha(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) {\n // Accurate texture mode added - comments stripped from dupe code, \n // see drawsegment_texture24() for details\n int ypixel = ytop;\n int lastRowStart = m_texture.length - TEX_WIDTH - 2;\n boolean accurateMode = parent.hints[ENABLE_ACCURATE_TEXTURES];\n float screenx = 0; float screeny = 0; float screenz = 0;\n float a = 0; float b = 0; float c = 0;\n int linearInterpPower = TEX_INTERP_POWER;\n int linearInterpLength = 1 << linearInterpPower;\n if (accurateMode) {\n // see if the precomputation goes well, if so finish the setup\n if (precomputeAccurateTexturing()) { \n newax *= linearInterpLength;\n newbx *= linearInterpLength;\n newcx *= linearInterpLength;\n screenz = nearPlaneDepth;\n firstSegment = false;\n } else{\n // if the matrix inversion screwed up, \n // revert to normal rendering (something is degenerate)\n accurateMode = false; \n }\n }\n \n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float iuf = iuadd;\n float ivf = ivadd;\n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n float iaf = iaadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xpixel = xstart;//accurate mode\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int iu = (int) (iuf * xdiff + uleft);\n int iv = (int) (ivf * xdiff + vleft);\n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n int ia = (int) (iaf * xdiff + aleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n if (accurateMode){\n screenx = xmult*(xpixel+.5f-(SCREEN_WIDTH/2.0f));\n screeny = ymult*(ypixel+.5f-(SCREEN_HEIGHT/2.0f));\n a = screenx*ax+screeny*ay+screenz*az;\n b = screenx*bx+screeny*by+screenz*bz;\n c = screenx*cx+screeny*cy+screenz*cz;\n }\n boolean goingIn = ( (newcx > 0) == (c > 0) )?false:true;\n int interpCounter = 0;\n int deltaU = 0; int deltaV = 0;\n float fu = 0; float fv = 0;\n float oldfu = 0; float oldfv = 0;\n \n if (accurateMode&&goingIn){\n int rightOffset = (xend-xstart-1)%linearInterpLength;\n int leftOffset = linearInterpLength-rightOffset;\n float rightOffset2 = rightOffset / ((float)linearInterpLength);\n float leftOffset2 = leftOffset / ((float)linearInterpLength);\n interpCounter = leftOffset;\n float ao = a-leftOffset2*newax;\n float bo = b-leftOffset2*newbx;\n float co = c-leftOffset2*newcx;\n float oneoverc = 65536.0f/co;\n oldfu = (ao*oneoverc); oldfv = (bo*oneoverc);\n a += rightOffset2*newax;\n b += rightOffset2*newbx;\n c += rightOffset2*newcx;\n oneoverc = 65536.0f/c;\n fu = a*oneoverc; fv = b*oneoverc;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n iu = ( (int)oldfu )+(leftOffset-1)*deltaU; iv = ( (int)oldfv )+(leftOffset-1)*deltaV; //another \"off-by-one\" hack\n } else{\n float preoneoverc = 65536.0f/c;\n fu = (a*preoneoverc);\n fv = (b*preoneoverc);\n }\n \n \n for ( ; xstart < xend; xstart++ ) {\n if(accurateMode){\n if (interpCounter == linearInterpLength) interpCounter = 0;\n if (interpCounter == 0){\n a += newax;\n b += newbx;\n c += newcx;\n float oneoverc = 65536.0f/c;\n oldfu = fu; oldfv = fv;\n fu = (a*oneoverc); fv = (b*oneoverc);\n iu = (int)oldfu; iv = (int)oldfv;\n deltaU = ((int)(fu - oldfu)) >> linearInterpPower;\n deltaV = ((int)(fv - oldfv)) >> linearInterpPower;\n } else{\n iu += deltaU;\n iv += deltaV;\n }\n interpCounter++;\n }\n \n try {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n //m_zbuffer[xstart] = iz;\n \n int al0;\n if (m_bilinear) {\n int ofs = (iv >> 16) * TEX_WIDTH + (iu >> 16);\n int iui = iu & 0xFFFF;\n al0 = m_texture[ofs] & 0xFF;\n int al1 = m_texture[ofs + 1] & 0xFF;\n if (ofs < lastRowStart) ofs+=TEX_WIDTH;\n int al2 = m_texture[ofs] & 0xFF;\n int al3 = m_texture[ofs + 1] & 0xFF;\n al0 = al0 + (((al1-al0) * iui) >> 16);\n al2 = al2 + (((al3-al2) * iui) >> 16);\n al0 = al0 + (((al2-al0) * (iv & 0xFFFF)) >> 16);\n } else {\n al0 = m_texture[(iv >> 16) * TEX_WIDTH + (iu >> 16)] & 0xFF;\n }\n al0 = (al0 * (ia >> 16)) >> 8;\n \n // get RGB colors\n int red = ir & 0xFF0000;\n int grn = (ig >> 8) & 0xFF00;\n int blu = (ib >> 16);\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n \n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al0) >> 8)) & 0xFF0000) |\n ((bg + (((grn - bg) * al0) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al0) >> 8)) & 0xFF);\n \n // write stencil\n // m_stencil[xstart] = p;\n }\n } catch (Exception e) { }\n \n //\n xpixel++;//accurate mode\n if (!accurateMode){\n iu+=iuadd;\n iv+=ivadd;\n }\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n ia+=iaadd;\n iz+=izadd;\n }\n ypixel++;//accurate mode\n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n uleft+=uleftadd;\n vleft+=vleftadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n aleft+=aleftadd;\n zleft+=zleftadd;\n }\n }", "public void zeichnen()\r\n {\n if(textur==null)\r\n {\r\n glColor3d(colorrd, colorgr, colorbl);\r\n glBegin(GL_QUADS);\r\n glVertex2i(x,y);\r\n glVertex2i(x+w,y);\r\n glVertex2i(x+w,y+h);\r\n glVertex2i(x,y+h);\r\n glEnd();\r\n }\r\n else\r\n {\r\n textur.bind();\r\n glBegin(GL_TRIANGLES);\r\n glTexCoord2f(1, 0);\r\n glVertex2i(x+w, y);\r\n glTexCoord2f(0, 0);\r\n glVertex2i(x, y);\r\n glTexCoord2f(0, 1);\r\n glVertex2i(x, y+h);\r\n glTexCoord2f(0, 1);\r\n glVertex2i(x, y+h);\r\n glTexCoord2f(1, 1);\r\n glVertex2i(x+w, y+h);\r\n glTexCoord2f(1, 0);\r\n glVertex2i(x+w, y);\r\n glEnd();\r\n }\r\n }", "@ThreadOpenGL\n public void glTexCoord2f()\n {\n GL11.glTexCoord2f(this.x, this.y);\n }", "private void renderHook(){\n\t\thook.setPosition(world.hook.position.x, world.hook.position.y);\n\t\thook.setRotation(world.hook.rotation);\n\t\thook.draw(batch);\n\t}", "public void func_180435_a(TextureAtlasSprite p_180435_1_) {\n/* 215 */ int var2 = getFXLayer();\n/* */ \n/* 217 */ if (var2 == 1) {\n/* */ \n/* 219 */ this.particleIcon = p_180435_1_;\n/* */ }\n/* */ else {\n/* */ \n/* 223 */ throw new RuntimeException(\"Invalid call to Particle.setTex, use coordinate methods\");\n/* */ } \n/* */ }", "public void blit() {}", "public void draw() {\n /* put graphical code here, runs repeatedly at defined framerate in setup, else default at 60fps: */\n if (renderingForce == false) {\n background(255); \n //imageMode(CORNERS);\n image(outputSplat, 0, 0);\n world.draw();\n checkChangeColor();\n }\n}", "public void render() {\r\n\t\t //Draw all of the sprites in the game\r\n\t background.draw(0,backgroudY1);\r\n\t\tbackground.draw(0,backgroudY2);\r\n\t\tbackground.draw(0,backgroudY3);\r\n\t\tbackground.draw(WIDTH/2,backgroudY1);\r\n\t\tbackground.draw(WIDTH/2,backgroudY2);\r\n\t background.draw(WIDTH/2,backgroudY3);\r\n\t \r\n\t // call this method from Player class, to draw the plane.\r\n\t player.render();\r\n\t \r\n\t \r\n\t // loop through every enemy, draw enemy if it's not killed\r\n\t for(int i=0; i<enemy.length; i++) {\r\n\t \t\r\n \tif(enemy[i] != null && enemyKilled[i] == true) {\r\n \t\t\r\n\t \t\t\r\n\t enemy[i].render();\r\n\t \r\n\t \t}\r\n\t \r\n\t }\r\n\t // loop through every laser, if it has not made contact with any enemy,\r\n\t // call its render method to draw it\r\n\t for (int i = 0; i < arr_size; i++) {\r\n\t \tif (lasers[i] != null && laserUsed[i] == true) {\r\n\t lasers[i].render();\r\n \t}\r\n\t \t\r\n\t }\r\n\t \r\n\t}", "private void renderGeom(GL2 gl, int side)\n {\n if(texture[side] == null)\n return;\n\n Integer t_id = textureIdMap[side].get(gl);\n if(t_id != null)\n {\n gl.glBindTexture(GL.GL_TEXTURE_2D, t_id.intValue());\n }\n else\n {\n // NOTE:\n // Assume, for now, that we need to regenerate the entire texture\n // because the imageComponent has changed. Once sub-image update is\n // implemented, we may want to change this logic\n int[] tex_id_tmp = new int[1];\n gl.glGenTextures(1, tex_id_tmp, 0);\n textureIdMap[side].put(gl, new Integer(tex_id_tmp[0]));\n\n gl.glBindTexture(GL.GL_TEXTURE_2D, tex_id_tmp[0]);\n\n gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);\n gl.glTexParameteri(GL.GL_TEXTURE_2D,\n GL.GL_TEXTURE_WRAP_S,\n GL.GL_CLAMP_TO_EDGE);\n\n gl.glTexParameteri(GL.GL_TEXTURE_2D,\n GL.GL_TEXTURE_WRAP_T,\n GL.GL_CLAMP_TO_EDGE);\n\n gl.glTexParameteri(GL.GL_TEXTURE_2D,\n GL.GL_TEXTURE_MAG_FILTER,\n GL.GL_LINEAR);\n\n gl.glTexParameteri(GL.GL_TEXTURE_2D,\n GL.GL_TEXTURE_MIN_FILTER,\n GL.GL_LINEAR);\n\n ByteBuffer pixels = texture[side].getData(0);\n\n int comp_format = texture[side].getFormat(0);\n int width = texture[side].getWidth();\n int height = texture[side].getHeight();\n int int_format = GL.GL_RGB;\n int ext_format = GL.GL_RGB;\n\n switch(comp_format)\n {\n case TextureComponent.FORMAT_RGB:\n int_format = GL.GL_RGB;\n ext_format = GL.GL_RGB;\n break;\n\n case TextureComponent.FORMAT_RGBA:\n int_format = GL.GL_RGBA;\n ext_format = GL.GL_RGBA;\n break;\n\n case TextureComponent.FORMAT_BGR:\n int_format = GL2.GL_BGR;\n ext_format = GL2.GL_BGR;\n break;\n\n case TextureComponent.FORMAT_BGRA:\n int_format = GL.GL_BGRA;\n ext_format = GL.GL_BGRA;\n break;\n\n case TextureComponent.FORMAT_INTENSITY_ALPHA:\n int_format = GL.GL_LUMINANCE_ALPHA;\n ext_format = GL.GL_LUMINANCE_ALPHA;\n break;\n\n case TextureComponent.FORMAT_SINGLE_COMPONENT:\n int_format = GL.GL_LUMINANCE;\n ext_format = GL.GL_LUMINANCE;\n break;\n\n default:\n }\n\n gl.glTexImage2D(GL.GL_TEXTURE_2D,\n 0,\n int_format,\n width,\n height,\n 0,\n ext_format,\n GL.GL_UNSIGNED_BYTE,\n pixels);\n\n }\n\n gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);\n gl.glEnableClientState(GL2.GL_NORMAL_ARRAY);\n gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);\n gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertexBuffer[side]);\n gl.glNormalPointer(GL.GL_FLOAT, 0, normalBuffer[side]);\n gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, textureBuffer);\n\n gl.glDrawArrays(GL2.GL_QUADS, 0, 4);\n\n gl.glDisableClientState(GL2.GL_TEXTURE_COORD_ARRAY);\n gl.glDisableClientState(GL2.GL_NORMAL_ARRAY);\n gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);\n }", "public Tile3D(Context context, int id, float w, float h) {\n\t // Setup vertex array buffer. Vertices in float. A float has 4 bytes\n\t ByteBuffer vbb = ByteBuffer.allocateDirect(12 * 4);\n\t vbb.order(ByteOrder.nativeOrder()); // Use native byte order\n\t vertexBuffer = vbb.asFloatBuffer(); // Convert from byte to float\n\t \n\t imageFileID = id;\n\t bitmap = BitmapFactory.decodeStream(context.getResources().openRawResource(imageFileID));\n\t //bitmap \n\t /*InputStream is= context.getResources().openRawResource(imageFileIDs);\n\t try {\n\t bitmap = BitmapFactory.decodeStream(is);\n\n\t } finally {\n\t //Always clear and close\n\t try {\n\t is.close();\n\t is = null;\n\t } catch (IOException e) {\n\t }\n\t }*/\n\t int imgWidth = bitmap.getWidth();\n\t int imgHeight = bitmap.getHeight();\n\t float faceWidth = w;\n\t float faceHeight = h;\n\t // Adjust for aspect ratio\n\t if (imgWidth > imgHeight) {\n\t faceHeight = faceHeight * imgHeight / imgWidth; \n\t }\n\t else {\n\t faceWidth = faceWidth * imgWidth / imgHeight;\n\t }\n\t float faceLeft = -faceWidth / 2;\n\t float faceRight = -faceLeft;\n\t float faceTop = faceHeight / 2;\n\t float faceBottom = -faceTop;\n\t \n\t \n\t \n\t // Define the vertices for this face\n\t float[] vertices = {\n\t faceLeft, faceBottom, 0.0f, // 0. left-bottom-front\n\t faceRight, faceBottom, 0.0f, // 1. right-bottom-front\n\t faceLeft, faceTop, 0.0f, // 2. left-top-front\n\t faceRight, faceTop, 0.0f, // 3. right-top-front\n\t };\n\t vertexBuffer.put(vertices); // Copy data into buffer\n\t\t vertexBuffer.position(0); // Rewind\n\t \n\t ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);\n\t tbb.order(ByteOrder.nativeOrder());\n\t texBuffer = tbb.asFloatBuffer();\n\t \n\t texBuffer.put(texCoords);\n\t \n\t texBuffer.position(0); // Rewind\n\t \n\t }", "public void drawScreen(int var1, int var2, float var3) {\r\n\t\tthis.drawDefaultBackground();\r\n\t\tthis.guiLeft = (this.width - this.xSize) / 2;\r\n\t\tthis.guiTop = (this.height - this.ySize) / 2;\r\n\t\tGL11.glPushMatrix();\r\n\t\tGL11.glTranslatef(this.guiLeft, this.guiTop, 0.0F);\r\n\t\tthis.mc.renderEngine.bindTexture(this.mc.renderEngine\r\n\t\t\t\t.getTexture(\"/gui/elevatorgui.png\"));\r\n\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tthis.drawTexturedModalRect(0, 0, 0, 0, this.xSize, this.ySize);\r\n\t\tGL11.glTranslatef(0.0F, 0.0F, 0.0F);\r\n\t\tGL11.glPopMatrix();\r\n\t\tsuper.drawScreen(var1, var2, var3);\r\n\r\n\t\tif (!this.optionsOpen) {\r\n\t\t\tif (!this.screenTitle.equals(\"\")) {\r\n\t\t\t\tthis.drawUnshadedCenteredString(this.fontRenderer,\r\n\t\t\t\t\t\tthis.screenTitle, this.width / 2, this.titleTop, 0);\r\n\t\t\t\tthis.drawUnshadedCenteredString(this.fontRenderer, \"\"\r\n\t\t\t\t\t\t+ this.screenSubtitle + \"\", this.width / 2,\r\n\t\t\t\t\t\tthis.subtitleTop, 0);\r\n\t\t\t} else {\r\n\t\t\t\tthis.drawUnshadedCenteredString(this.fontRenderer, \"\"\r\n\t\t\t\t\t\t+ this.screenSubtitle + \"\", this.width / 2,\r\n\t\t\t\t\t\tthis.titleTop, 0);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this.screenTitle != null && !this.screenTitle.equals(\"\")) {\r\n\t\t\t\tthis.drawUnshadedCenteredString(this.fontRenderer,\r\n\t\t\t\t\t\tthis.screenTitle, this.width / 2 - 20,\r\n\t\t\t\t\t\tthis.subtitleTop, 0);\r\n\t\t\t} else {\r\n\t\t\t\tthis.drawUnshadedCenteredString(this.fontRenderer,\r\n\t\t\t\t\t\t\"[Unnamed Elevator]\", this.width / 2, this.subtitleTop,\r\n\t\t\t\t\t\t0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.drawUnshadedCenteredString(this.fontRenderer, \"Options\",\r\n\t\t\t\t\tthis.width / 2, this.titleTop, 0);\r\n\t\t\tthis.floorNamesList.drawScreen(var1, var2, var3);\r\n\t\t}\r\n\t}", "public void uk(){\n stroke(1);\n //back guns\n fill(0);\n rect(73,192,4,15);\n rect(224,192,4,15);\n rect(71,207,8,15);\n rect(222,207,8,15);\n rect(66,207,3,15);\n rect(232,207,3,17);\n rect(122,109,4,15);\n rect(175,110,4,15);\n rect(121,120,6,15);\n rect(174,120,6,15);\n rect(116,124,3,15);\n rect(182,124,3,15);\n\n //wings--england\n fill(1,0,74);//dark blue\n beginShape();\n vertex(14,286);\n vertex(61,236);\n vertex(88,308);\n vertex(51,334);\n vertex(14,313);\n endShape(CLOSE);\n beginShape();\n vertex(286,287);\n vertex(286,312);\n vertex(247,335);\n vertex(212,309);\n vertex(238,238);\n endShape(CLOSE);\n\n noStroke();\n fill(255);\n rect(15,286,74,20);\n rect(212,284,74,20);\n rect(48,248,20,74);\n rect(233,248,20,74);\n quad(26,272,35,260,83,312,72,320);\n quad(262,260,272,272,229,312,220,318);\n quad(25,318,38,328,85,278,75,263);\n quad(264,324,280,316,228,262,214,274);\n\n fill(207,20,43);\n rect(51,248,15,74);\n rect(235,247,15,74);\n rect(15,289,74,15);\n rect(211,286,74,15);\n\n stroke(1);\n fill(0);//white\n beginShape();\n vertex(38,307);\n vertex(74,307);\n vertex(80,314);\n vertex(81,337);\n vertex(68,345);\n vertex(38,327);\n endShape(CLOSE);\n beginShape();\n vertex(219,316);\n vertex(226,308);\n vertex(262,308);\n vertex(262,326);\n vertex(231,345);\n vertex(219,336);\n endShape(CLOSE);\n\n fill(0,36,125);//red\n beginShape();\n vertex(96,191);\n vertex(61,230);\n vertex(60,269);\n vertex(96,312);\n vertex(101,300);\n vertex(100,247);\n vertex(112,232);\n vertex(132,232);\n vertex(131,186);\n endShape(CLOSE);\n beginShape();\n vertex(204,191);\n vertex(240,230);\n vertex(240,270);\n vertex(205,312);\n vertex(200,302);\n vertex(200,248);\n vertex(193,238);\n vertex(185,231);\n vertex(170,230);\n vertex(170,186);\n endShape(CLOSE);\n\n //gray\n fill(200);\n beginShape();\n vertex(70,217);\n vertex(74,220);\n vertex(81,210);\n vertex(85,213);\n vertex(75,227);\n vertex(72,229);\n vertex(71,231);\n vertex(73,233);\n vertex(73,268);\n vertex(71,272);\n vertex(76,277);\n vertex(82,274);\n vertex(89,283);\n vertex(90,297);\n vertex(66,272);\n vertex(65,235);\n vertex(68,229);\n vertex(62,228);\n endShape(CLOSE);\n beginShape();\n vertex(228,217);\n vertex(225,218);\n vertex(218,211);\n vertex(215,213);\n vertex(223,227);\n vertex(226,226);\n vertex(230,230);\n vertex(227,233);\n vertex(228,270);\n vertex(229,272);\n vertex(223,276);\n vertex(218,276);\n vertex(210,283);\n vertex(211,296);\n vertex(235,273);\n vertex(234,233);\n vertex(232,228);\n vertex(237,227);\n endShape(CLOSE);\n\n //guns\n //white\n fill(200);\n beginShape();\n vertex(121,301);\n vertex(98,313);\n vertex(102,336);\n vertex(119,342);\n vertex(139,336);\n vertex(141,313);\n endShape(CLOSE);//l\n beginShape();\n vertex(159,312);\n vertex(162,336);\n vertex(180,342);\n vertex(200,336);\n vertex(202,313);\n vertex(180,302);\n endShape(CLOSE);\n\n //black\n fill(0);\n rect(105,315,30,30);\n rect(166,315,30,30);\n quad(105,344,109,355,131,355,135,344);\n quad(166,344,170,355,192,355,196,344);\n\n fill(207,20,43);\n rect(103,253,33,62);//l\n rect(164,252,33,62);//r\n\n fill(200);\n bezier(103,252,107,230,132,230,136,252);//l\n bezier(164,252,169,230,192,230,197,252);//r\n rect(103,280,33,25);//l\n rect(164,280,33,25);//r\n fill(0,36,125);\n rect(104,319,33,26,3);//l\n rect(165,319,33,26,3);//r\n fill(200);\n rect(115,310,7,28,8);//l\n rect(178,310,7,28,8);//r\n\n fill(0,0,67);\n rect(105,284,10,15);\n rect(124,284,10,15);\n rect(167,285,10,15);\n rect(185,284,10,15);\n\n //body-wings\n\n fill(0,0,67);//blue\n bezier(107,154,101,162,98,169,98,187);\n bezier(191,153,199,164,202,172,203,187);\n quad(107,154,98,186,98,223,107,224);\n quad(191,153,203,186,202,223,192,223);\n fill(0,36,125);//red\n quad(134,112,108,147,107,239,132,230);\n quad(165,112,192,147,193,239,168,230);\n //black\n fill(0);\n quad(130,122,130,142,111,164,111,147);\n quad(169,122,188,147,188,165,169,144);\n //white\n fill(200);\n beginShape();\n vertex(131,154);\n vertex(129,202);\n vertex(118,202);\n vertex(112,181);\n vertex(110,179);\n vertex(110,171);\n endShape(CLOSE);\n beginShape();\n vertex(170,154);\n vertex(190,172);\n vertex(190,182);\n vertex(188,181);\n vertex(182,201);\n vertex(172,201);\n endShape(CLOSE);\n\n\n fill(0,36,125);\n quad(134,193,166,193,154,342,146,342);\n fill(192,0,11);\n quad(142,180,159,180,152,352,148,352);\n //white\n fill(200);\n ellipse(150,374,6,50);\n\n //head\n\n fill(1,1,75);\n ellipse(149.5f,72,33,25);\n ellipse(149.5f,94,30,170);\n fill(0);\n ellipse(149.5f,94,20,160);\n fill(154,155,84);\n ellipse(149.5f,94,17,77);\n strokeWeight(2);\n line(143,74,158,74);\n line(142,104,158,104);\n strokeWeight(1);\n fill(200);\n bezier(143,15,147,2,153,2,155.5f,15);\n}", "private void createText() {\n Texture texture = new Texture(Gdx.files.internal(\"Text/item.png\"));\n texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);\n TextureRegion region = new TextureRegion(texture);\n display = new BitmapFont(Gdx.files.internal(\"Text/item.fnt\"), region, false);\n display.setUseIntegerPositions(false);\n display.setColor(Color.BLACK);\n }", "public void showTexturePage(String selection, int page){\n \n ArrayList<String> idSubStages = control.getIdsSubStages(selection);\n ArrayList<String> idsTexturesOrSubMeshes = control.getIdsTexturesORSubMeshes(idSubStages.get(0));\n unCheck();\n subStageSelected = \"\";\n nifty.getScreen(stageType).findElementByName(\"panel_color\").setVisible(false);\n for(int i=page*TEXTURES_PAGE; i<control.getNumTexturesORSubMeshes(idSubStages.get(0)); i++){\n if(i<((page+1)*TEXTURES_PAGE)){\n Element image = nifty.getScreen(stageType).findElementByName(\"i\"+Integer.toString(i%TEXTURES_PAGE));\n List<Effect> effects = image.getEffects(EffectEventId.onHover,Tooltip.class);\n String idTexturesOrSubMeshes = i18nModel.getString(control.getTextTexturesORSubMeshes(idsTexturesOrSubMeshes.get(i)));\n if(idTexturesOrSubMeshes==null){\n idTexturesOrSubMeshes=control.getTextTexturesORSubMeshes(idsTexturesOrSubMeshes.get(i));\n }\n effects.get(0).getParameters().setProperty(\"hintText\",idTexturesOrSubMeshes);\n image.setVisible(true);\n ImageRenderer imager = image.getRenderer(ImageRenderer.class);\n String imagePath = control.getIconPathTexturesORSubMeshes(idsTexturesOrSubMeshes.get(i));\n if(imagePath!=null){\n imager.setImage(nifty.getRenderEngine().createImage(imagePath, false));\n }\n else{\n imager.setImage(nifty.getRenderEngine().createImage(Resources.x, false));\n }\n if (control.isChecked(idSubStages.get(0), idsTexturesOrSubMeshes.get(i))){\n nifty.getScreen(stageType).findElementByName(\"t\"+Integer.toString(i%TEXTURES_PAGE)).setVisible(true);\n subStageSelected = idSubStages.get(0);\n if(!seleccionado.containsKey(subStageSelected)){\n seleccionado.put(subStageSelected, idsTexturesOrSubMeshes.get(i));\n }\n }\n else{\n nifty.getScreen(stageType).findElementByName(\"t\"+Integer.toString(i%TEXTURES_PAGE)).setVisible(false);\n }\n }\n }\n if(seleccionado.containsKey(subStageSelected)){\n if(!(control.getTextureType(seleccionado.get(subStageSelected)) == TexturesMeshType.simpleTexture)){\n nifty.getScreen(stageType).findElementByName(\"panel_color\").setVisible(true);\n }\n else{\n nifty.getScreen(stageType).findElementByName(\"panel_color\").setVisible(false);\n }\n }\n else{\n nifty.getScreen(stageType).findElementByName(\"panel_color\").setVisible(false);\n }\n for(int i=control.getNumTexturesORSubMeshes(idSubStages.get(0));i<((page+1)*TEXTURES_PAGE);i++){\n Element image = nifty.getScreen(stageType).findElementByName(\"i\"+Integer.toString(i%TEXTURES_PAGE));\n image.setVisible(false);\n }\n if(page > 0){\n nifty.getScreen(stageType).findElementByName(\"leftT\").setVisible(true);\n }\n else{\n nifty.getScreen(stageType).findElementByName(\"leftT\").setVisible(false);\n }\n if((((double)control.getNumTexturesORSubMeshes(idSubStages.get(0))/(double)TEXTURES_PAGE) - page) > 1){\n nifty.getScreen(stageType).findElementByName(\"rightT\").setVisible(true);\n }\n else{\n nifty.getScreen(stageType).findElementByName(\"rightT\").setVisible(false);\n }\n }", "private void drawGame(){\n drawBackGroundImage();\n drawWalls();\n drawPowerups();\n drawBullet();\n }", "public void renderTileManager()\n {\n background(background);\n tiles[activeTile].drawGrid();\n tiles[activeTile].drawCellHover();\n createPreview(tiles[activeTile]);\n drawPreviewHover();\n drawPreviews();\n }", "public void create() {\r\n\t\t\r\n\t\tTexture.setEnforcePotImages(false);\r\n\t\t\r\n\t\tGdx.input.setInputProcessor(new MyInputProcessor());\r\n\t\t\r\n\t\t\r\n\t\ttextures = Tex.getTex();\r\n\t\t// load images\r\n\t\ttextures.loadTexture(\"res/images/guyDown.png\", \"guyDown\");\r\n\t\ttextures.loadTexture(\"res/images/guyUp.png\", \"guyUp\");\r\n\t\ttextures.loadTexture(\"res/images/guy2Down.png\", \"guyDown2\");\r\n\t\ttextures.loadTexture(\"res/images/guy2Up.png\", \"guyUp2\");\r\n\t\ttextures.loadTexture(\"res/images/enemyDown.png\", \"enemyDown\");\r\n\t\ttextures.loadTexture(\"res/images/enemyUp.png\", \"enemyUp\");\r\n\t\t\r\n\t\ttextures.loadTexture(\"res/images/skyline.png\", \"skyline\");\r\n\t\ttextures.loadTexture(\"res/images/skyline2.jpg\", \"skyline2\");\r\n\t\ttextures.loadTexture(\"res/images/skyline3.png\", \"skyline3\");\t\t\r\n\t\ttextures.loadTexture(\"res/images/circuit board.jpg\", \"fundo2\");\r\n\t\ttextures.loadTexture(\"res/images/grav3.jpg\", \"menu\");\r\n\t\t\r\n\t\ttextures.loadTexture(\"res/images/singleplayer.png\", \"single\");\r\n\t\ttextures.loadTexture(\"res/images/multiplayer.png\", \"multi\");\r\n\t\ttextures.loadTexture(\"res/images/exit.png\", \"exit\");\r\n\t\ttextures.loadTexture(\"res/images/level1B.png\", \"B1\");\r\n\t\ttextures.loadTexture(\"res/images/level2B.png\", \"B2\");\r\n\t\ttextures.loadTexture(\"res/images/level3B.png\", \"B3\");\r\n\t\ttextures.loadTexture(\"res/images/mainMenuB.png\", \"mainB\");\r\n\t\ttextures.loadTexture(\"res/images/win1.png\", \"win1\");\r\n\t\ttextures.loadTexture(\"res/images/win2.png\", \"win2\");\r\n\t\ttextures.loadTexture(\"res/images/tryagain.png\", \"retry\");\r\n\t\ttextures.loadTexture(\"res/images/easy.png\", \"easy\");\r\n\t\ttextures.loadTexture(\"res/images/medium.png\", \"medium\");\r\n\t\ttextures.loadTexture(\"res/images/hard.png\", \"hard\");\r\n\t\ttextures.loadTexture(\"res/images/difficulty.png\", \"difficulty\");\r\n\t\ttextures.loadTexture(\"res/images/thunder2.png\", \"thunder\");\r\n\t\r\n\t\ttextures.loadTexture(\"res/images/levelcleared.png\", \"cleared\");\r\n\t\ttextures.loadTexture(\"res/images/you lost.png\", \"lost\");\r\n\t\ttextures.loadTexture(\"res/images/playerpress.png\", \"playerp\");\r\n\t\ttextures.loadTexture(\"res/images/player1press.png\", \"player1p\");\r\n\t\ttextures.loadTexture(\"res/images/player2press.png\", \"player2p\");\r\n\t\ttextures.loadTexture(\"res/images/selectthelevel.png\", \"select\");\r\n\t\t\r\n\t\t\r\n\t\tsb = new SpriteBatch();\r\n\t\tcam = new OrthographicCamera();\r\n\t\tcam.setToOrtho(false, V_WIDTH, V_HEIGHT);\r\n\t\thudCam = new OrthographicCamera();\r\n\t\thudCam.setToOrtho(false, V_WIDTH, V_HEIGHT);\r\n\t\tgsm = new GameStateManager(this);\r\n\t\t\t\t\r\n\t}", "private void render(){\n planeImage.draw(currPos.x,currPos.y, drawOps);\n }", "public void drawScreen(int var1, int var2, float var3) {\r\n String[] var13 = field_989;\r\n String var5 = \"Activer ToggleSneak\";\r\n String var6 = \"Activer ToggleSprint\";\r\n String var7 = \"Afficher le HUD\";\r\n String var8 = \"Position horizontal du HUD\";\r\n String var9 = \"Position vertical du HUD\";\r\n String var10 = \"Activer le double-tapping\";\r\n String var11 = \"Activer le fly boost\";\r\n String var12 = \"Fly boost X\";\r\n this.method_873();\r\n boolean var10000 = method_1147();\r\n this.drawCenteredString(this.fontRendererObj, \"ToggleMod - Options\", this.width / 2, this.field_985, 16777215);\r\n this.method_657(this.fontRendererObj, var5, this.width / 2 - 100 - this.fontRendererObj.getCharWidth(var5), this.method_1143(1) + 6, 16777215);\r\n this.method_657(this.fontRendererObj, var6, this.width / 2 + 100 - this.fontRendererObj.getCharWidth(var6), this.method_1143(1) + 6, 16777215);\r\n this.method_657(this.fontRendererObj, var7, this.width / 2 - 3 - this.fontRendererObj.getCharWidth(var7), this.method_1143(2) + 6, 16777215);\r\n boolean var4 = var10000;\r\n this.method_657(this.fontRendererObj, var8, this.width / 2 - 3 - this.fontRendererObj.getCharWidth(var8), this.method_1143(3) + 6, 16777215);\r\n this.method_657(this.fontRendererObj, var9, this.width / 2 - 3 - this.fontRendererObj.getCharWidth(var9), this.method_1143(4) + 6, 16777215);\r\n this.method_657(this.fontRendererObj, var10, this.width / 2 - 3 - this.fontRendererObj.getCharWidth(var10), this.method_1143(5) + 6, 16777215);\r\n this.method_657(this.fontRendererObj, var11, this.width / 2 - 3 - this.fontRendererObj.getCharWidth(var11), this.method_1143(6) + 6, 16777215);\r\n this.method_657(this.fontRendererObj, var12, this.width / 2 - 3 - this.fontRendererObj.getCharWidth(var12), this.method_1143(7) + 6, 16777215);\r\n super.drawScreen(var1, var2, var3);\r\n if(class_689.method_3976() != 0) {\r\n method_1145(!var4);\r\n }\r\n\r\n }", "public abstract void render(SpriteBatch batch);", "public void draw() {\r\n background(255);\r\n\r\n float mouseXFactor = map(mouseX, 0, width, 0.05f, 1);\r\n float mouseYFactor = map(mouseY, 0, height, 0.05f, 1);\r\n\r\n for (int gridX = 0; gridX < img.width; gridX++) {\r\n for (int gridY = 0; gridY < img.height; gridY++) {\r\n // grid position + tile size\r\n float tileWidth = width / (float) img.width;\r\n float tileHeight = height / (float) img.height;\r\n float posX = tileWidth * gridX;\r\n float posY = tileHeight * gridY;\r\n\r\n // get current color\r\n int c = pixelArray[gridX][gridY];\r\n\r\n // greyscale conversion\r\n int greyscale = round(red(c) * 0.222f + green(c) * 0.707f + blue(c) * 0.071f);\r\n\r\n if (drawMode == 1) {\r\n // greyscale to ellipse area\r\n fill(0);\r\n noStroke();\r\n float r2 = 1.1284f * sqrt(tileWidth * tileWidth * (1 - greyscale / 255.0f));\r\n r2 = r2 * mouseXFactor * 3;\r\n ellipse(posX, posY, r2, r2);\r\n } else if (drawMode == 2) {\r\n // greyscale to rotation, line length and stroke weight\r\n stroke(0);\r\n float w4 = map(greyscale, 0, 255, 10, 0);\r\n strokeWeight(w4 * mouseXFactor + 0.1f);\r\n float l4 = map(greyscale, 0, 255, 35, 0);\r\n l4 = l4 * mouseYFactor;\r\n pushMatrix();\r\n translate(posX, posY);\r\n rotate(greyscale / 255.0f * PI);\r\n line(0, 0, 0 + l4, 0 + l4);\r\n popMatrix();\r\n } else if (drawMode == 3) {\r\n // greyscale to line relief\r\n float w5 = map(greyscale, 0, 255, 5, 0.2f);\r\n strokeWeight(w5 * mouseYFactor + 0.1f);\r\n // get neighbour pixel, limit it to image width\r\n int /* color */ c2 = img.get(min(gridX + 1, img.width - 1), gridY);\r\n stroke(c2);\r\n int greyscale2 = (int) (red(c2) * 0.222f + green(c2) * 0.707f + blue(c2) * 0.071f);\r\n float h5 = 50 * mouseXFactor;\r\n float d1 = map(greyscale, 0, 255, h5, 0);\r\n float d2 = map(greyscale2, 0, 255, h5, 0);\r\n line(posX - d1, posY + d1, posX + tileWidth - d2, posY + d2);\r\n } else if (drawMode == 4) {\r\n // pixel color to fill, greyscale to ellipse size\r\n float w6 = map(greyscale, 0, 255, 25, 0);\r\n noStroke();\r\n fill(c);\r\n ellipse(posX, posY, w6 * mouseXFactor, w6 * mouseXFactor);\r\n // TODO 2: Add the following: if(Math.random()<0.1) {pixelArray[gridX][gridY] = lerpColor(c,0xff0000, 0.1f);}\r\n } else if (drawMode == 5) {\r\n stroke(c);\r\n float w7 = map(greyscale, 0, 255, 5, 0.1f);\r\n strokeWeight(w7);\r\n fill(255, 255 * mouseXFactor);\r\n pushMatrix();\r\n translate(posX, posY);\r\n rotate(greyscale / 255.0f * PI * mouseYFactor);\r\n rect(0, 0, 15, 15);\r\n popMatrix();\r\n }\r\n /*\r\n * TODO 3: Add a drawMode == 6 case. \r\n * Try modifying the pixelArray \r\n * Try drawing shapes or colors depending on c and grayscale variables \r\n * Try adding other forms of animation\r\n */\r\n }\r\n }\r\n }", "protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3)\n {\n int var4 = this.mc.renderEngine.getTexture(\"/shadow/lavafurnace.png\");\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n this.mc.renderEngine.bindTexture(var4);\n int var5 = (this.width - this.xSize) / 2;\n int var6 = (this.height - this.ySize) / 2;\n this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);\n int var8 = this.furnaceInventory.getFuelScaled(63);\n this.drawTexturedModalRect(var5 + 144, var6 + 11 + 63 - var8, 176, 94 - var8, 17, 31 + var8);\n int var7 = this.furnaceInventory.getCookProgressScaled(24);\n this.drawTexturedModalRect(var5 + 59, var6 + 33, 176, 14, var7 + 1, 16);\n }", "public void drawScreen(int par1, int par2, float par3)\n {\n\t\tGL11.glClearColor(0.1f, 0.1f, 0.1f, 1.0f);\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n Tessellator var4 = Tessellator.instance;\n short var5 = 274;\n int var6 = (int)((float)(this.width / 2 - var5 / 2) * 1.2f);\n byte var7 = 30;\n GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(\"/title/emberlogo.png\"));\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n\t\tthis.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44);\n\t\tthis.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);\n\n String emberTag = \"Ember 0.1.2\";\n String var9 = \"Minecraft 1.4.5\";\n\n this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215);\n this.drawString(this.fontRenderer, emberTag, 2, this.height - 20, 16777215);\n String var10 = \"Minecraft is a copyright of Mojang AB.\";\n this.drawString(this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215);\n super.drawScreen(par1, par2, par3);\n }" ]
[ "0.66482276", "0.65916455", "0.6562017", "0.6548862", "0.6538504", "0.65056556", "0.64797324", "0.6471934", "0.63905627", "0.6349934", "0.63314146", "0.63146824", "0.6311244", "0.6298943", "0.6221687", "0.6221049", "0.619413", "0.6179418", "0.61682886", "0.6119944", "0.6103074", "0.6082147", "0.6079113", "0.6062853", "0.598511", "0.5962079", "0.59511554", "0.5930645", "0.59224594", "0.5920509", "0.5912157", "0.59082025", "0.590673", "0.59024614", "0.5890717", "0.58798563", "0.5879649", "0.5874817", "0.5865653", "0.5857069", "0.5852963", "0.5835216", "0.58345413", "0.5833881", "0.58322614", "0.58092636", "0.5808367", "0.5799483", "0.57896674", "0.5786004", "0.57826674", "0.5782401", "0.57791585", "0.57787967", "0.5776776", "0.5769082", "0.5765195", "0.57616794", "0.57565117", "0.57543916", "0.57355124", "0.5730924", "0.5724257", "0.57228535", "0.5719854", "0.57194334", "0.5718209", "0.57175094", "0.5706547", "0.5705165", "0.5702374", "0.57012886", "0.5689993", "0.56890035", "0.5676804", "0.5673546", "0.5673546", "0.56652164", "0.56640315", "0.56586444", "0.5655819", "0.56477904", "0.56439215", "0.56388193", "0.56351763", "0.56295085", "0.56290466", "0.5620662", "0.56125313", "0.5611879", "0.5600991", "0.5594682", "0.5592962", "0.55776906", "0.5577504", "0.55767137", "0.5573507", "0.55713856", "0.5568708", "0.556422" ]
0.56127125
88
Adds a quad to the rendering pipeline. Call startDrawingQuads beforehand. You need to call draw() yourself.
private void putTiledTextureQuads(BufferBuilder renderer, int x, int y, int width, int height, float depth, TextureAtlasSprite sprite, boolean upsideDown) { sprite.initSprite(0, 0, 0, 0, false); float u1 = sprite.getMinU(); float v1 = sprite.getMinV(); // tile vertically do { int renderHeight = Math.min(sprite.getIconHeight(), height); height -= renderHeight; float v2 = sprite.getInterpolatedV(16f * renderHeight / sprite.getIconHeight()); // we need to draw the quads per width too int x2 = x; int width2 = width; // tile horizontally do { int renderWidth = Math.min(sprite.getIconWidth(), width2); width2 -= renderWidth; float u2 = sprite.getInterpolatedU(16f * renderWidth / sprite.getIconWidth()); if (upsideDown) { renderer.pos(x2, y, depth).tex(u2, v1).endVertex(); renderer.pos(x2, y + renderHeight, depth).tex(u2, v2).endVertex(); renderer.pos(x2 + renderWidth, y + renderHeight, depth).tex(u1, v2).endVertex(); renderer.pos(x2 + renderWidth, y, depth).tex(u1, v1).endVertex(); } else { renderer.pos(x2, y, depth).tex(u1, v1).endVertex(); renderer.pos(x2, y + renderHeight, depth).tex(u1, v2).endVertex(); renderer.pos(x2 + renderWidth, y + renderHeight, depth).tex(u2, v2).endVertex(); renderer.pos(x2 + renderWidth, y, depth).tex(u2, v1).endVertex(); } x2 += renderWidth; } while (width2 > 0); y += renderHeight; } while (height > 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void AddQuad(Quadruple quad)\n {\n Quadruple.add(nextQuad, quad);\n nextQuad++;\n }", "public void draw() {\n\t\tGL11.glColor3f(0.5f,0.5f,1.0f);\n\t\n\t\t// draw quad\n\t\tGL11.glBegin(GL11.GL_QUADS);\n\t\t\tGL11.glVertex2f(x,y);\n\t\t\tGL11.glVertex2f(x+width,y);\n\t\t\tGL11.glVertex2f(x+width,y+height);\n\t\t\tGL11.glVertex2f(x,y+height);\n\t\tGL11.glEnd();\n\t\t\n\t\tif(text != null || !text.equals(\"\"))\n\t\t\tfont.drawString(text, x, y);\n\t\n\t}", "public void draw() {\r\n\r\n//\t\tif (textures.length > 1) {\r\n//\t\t\tfor (int i = 1; i < textures.length; i++) {\r\n\t\tif (textures.length > 1) {\r\n\t\t\tDrawQuadWithTexture(textures[0], x, y, width, height);\r\n\t\t\tDrawQuadWithRotatedTexture(textures[1], x, y, width, height, angle);\r\n\t\t} else {\r\n\t\t\tDrawQuadWithRotatedTexture(textures[0], x, y, width, height, angle);\r\n\t\t}\r\n\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\t\r\n\t}", "public void draw()\n\t{\n\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, texture_id);\n\t\tdrawMesh(gl);\n\t}", "public void render() {\r\n glPushMatrix();\r\n glBindBuffer(GL_ARRAY_BUFFER, VBOVertexHandle);\r\n glVertexPointer(3, GL_FLOAT, 0, 0l);\r\n glBindBuffer(GL_ARRAY_BUFFER, VBOColorHandle);\r\n glColorPointer(3, GL_FLOAT, 0, 0l);\r\n glBindBuffer(GL_ARRAY_BUFFER, VBOTextureHandle);\r\n glBindTexture(GL_TEXTURE_2D, 1);\r\n glTexCoordPointer(2, GL_FLOAT, 0, 0l);\r\n glDrawArrays(GL_QUADS, 0, CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE * 24);\r\n glPopMatrix();\r\n }", "public void draw() {\n\t\tfor (int i = 0; i < particleCount; i++) {\r\n\t\t\tif (particles[i] != null) {\r\n\t\t\t\tglBegin(GL_QUADS);\r\n\t\t\t\t{\r\n\t\t\t\t\tparticles[i].draw();\r\n\t\t\t\t}\r\n\t\t\t\tglEnd();\r\n\t\t\t}\r\n\t\t}\r\n\t\tglColor3f(1, 1, 1);\r\n\t}", "public void draw() {\n\t\t\tfloat[] vertices = new float[mVertices.size()];\n\t\t\tfor (int i = 0; i < vertices.length; i++)\n\t\t\t\tvertices[i] = mVertices.get(i);\n\t\t\t\n\t\t\tfloat[] textureCoords = null;\n\t\t\tif (mTextureID != 0) {\n\t\t\t\ttextureCoords = new float[mTextureCoords.size()];\n\t\t\t\tfor (int i = 0; i < textureCoords.length; i++)\n\t\t\t\t\ttextureCoords[i] = mTextureCoords.get(i);\n\t\t\t}\n\t\t\t\n\t\t\tshort[] indices = new short[mIndices.size()];\n\t\t\tfor (int i = 0; i < indices.length; i++)\n\t\t\t\tindices[i] = mIndices.get(i);\n\t\t\t\n\t\t\t// Get OpenGL\n\t\t\tGL10 gl = GameGraphics2D.this.mGL;\n\t\t\t\n\t\t\t// Set render state\n\t\t\tgl.glDisable(GL10.GL_LIGHTING);\n\t\t\tgl.glEnable(GL10.GL_DEPTH_TEST);\n\t\t\tgl.glEnable(GL10.GL_BLEND);\n\n\t\t\tif (mBlendingMode == BLENDING_MODE.ALPHA)\n\t\t\t\tgl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);\n\t\t\telse if (mBlendingMode == BLENDING_MODE.ADDITIVE)\n\t\t\t\tgl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);\n\t\t\t\n\t\t\tif (mTextureID != 0)\n\t\t\t\tgl.glEnable(GL10.GL_TEXTURE_2D);\n\t\t\telse\n\t\t\t\tgl.glDisable(GL10.GL_TEXTURE_2D);\n\t\t\t\n\t\t\t// Draw the batch of textured triangles\n\t\t\tgl.glColor4f(Color.red(mColour) / 255.0f,\n\t\t\t\t\t\t Color.green(mColour) / 255.0f,\n\t\t\t\t\t\t Color.blue(mColour) / 255.0f,\n\t\t\t\t\t\t Color.alpha(mColour) / 255.0f);\n\t\t\t\n\t\t\tif (mTextureID != 0) {\n\t\t\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureID);\n\t\t\t\tgl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, GameGraphics.getFloatBuffer(textureCoords));\n\t\t\t}\n\t\t\t\n\t\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, GameGraphics.getFloatBuffer(vertices));\n\t\t\tgl.glDrawElements(GL10.GL_TRIANGLES, indices.length,\n\t\t\t\t\tGL10.GL_UNSIGNED_SHORT, GameGraphics.getShortBuffer(indices));\n\t\t}", "public void draw() {\n // añadimos el programa al entorno de opengl\n GLES20.glUseProgram(mProgram);\n\n // obtenemos el identificador de los sombreados del los vertices a vPosition\n positionHandle = GLES20.glGetAttribLocation(mProgram, \"vPosition\");\n\n // habilitamos el manejo de los vertices del triangulo\n GLES20.glEnableVertexAttribArray(positionHandle);\n\n // Preparamos los datos de las coordenadas del triangulo\n GLES20.glVertexAttribPointer(positionHandle, COORDS_PER_VERTEX,\n GLES20.GL_FLOAT, false,\n vertexStride, vertexBuffer);\n\n // Obtenemos el identificador del color del sombreado de los fragmentos\n colorHandle = GLES20.glGetUniformLocation(mProgram, \"vColor\");\n\n // Establecemos el color para el dibujo del triangulo\n GLES20.glUniform4fv(colorHandle, 1, color, 0);\n\n // SE dibuja el triangulo\n GLES20.glDrawArrays(GLES20.GL_LINE_LOOP, 0, vertexCount);\n\n // Deshabilitamos el arreglo de los vertices (que dibuje una sola vez)\n GLES20.glDisableVertexAttribArray(positionHandle);\n }", "public static void drawTexturedQuadScaled(int id, int x, int y, int size) {\n\t\tdrawTexturedQuadScaled(x,y,size,size,id);\n\n\t}", "private void renderTex() {\n final float\n w = xdim(),\n h = ydim(),\n x = xpos(),\n y = ypos() ;\n GL11.glBegin(GL11.GL_QUADS) ;\n GL11.glTexCoord2f(0, 0) ;\n GL11.glVertex2f(x, y + (h / 2)) ;\n GL11.glTexCoord2f(0, 1) ;\n GL11.glVertex2f(x + (w / 2), y + h) ;\n GL11.glTexCoord2f(1, 1) ;\n GL11.glVertex2f(x + w, y + (h / 2)) ;\n GL11.glTexCoord2f(1, 0) ;\n GL11.glVertex2f(x + (w / 2), y) ;\n GL11.glEnd() ;\n }", "public void draw(GL10 gl) {\n }", "public void addVertex();", "public void drawElement(GL10 gl){\n\t\tgl.glTranslatef(x, y, 0);\n\t\tbaseDrawElement(gl);\n\t\tgl.glTranslatef(-x, -y, 0);\n//\t\tgl.glColor4f(1, 1, 1, 1);\n\t}", "public static void add() {\n\t\trender();\n\t}", "public static InterleavedVertexBuffer createInterleavedQuadWithTextureCoords() {\n InterleavedVertexBuffer.Builder builder = new InterleavedVertexBuffer.Builder(BufferUsage.STATIC);\n builder.add(\"a_Pos\", new VerticesData(BufferTestUtil.createQuadStrip(0.5f, 0.5f, 0, 0)));\n builder.add(\"a_texCoord\", new TextureCoordData(BufferTestUtil.createQuadTextureCoords()));\n return builder.build();\n }", "@Override\r\n public void addQueryRegion(QueryRegion region)\r\n {\n removeQueryRegion(region.getGeometries());\r\n\r\n synchronized (myQueryRegions)\r\n {\r\n myQueryRegions.add(region);\r\n }\r\n\r\n Collection<PolygonGeometry> geometries = New.collection(region.getGeometries().size());\r\n for (PolygonGeometry polygon : region.getGeometries())\r\n {\r\n if (polygon.getRenderProperties().isDrawable() || polygon.getRenderProperties().isPickable())\r\n {\r\n geometries.add(polygon);\r\n }\r\n }\r\n myToolbox.getGeometryRegistry().addGeometriesForSource(this, geometries);\r\n\r\n myChangeSupport.notifyListeners(listener -> listener.queryRegionAdded(region), myDispatchExecutor);\r\n }", "public void paint(java.awt.Graphics g) {\n super.paint(g);\n // only update the quadrants if pond has a value\n if( pond != null) {\n pond.updateQuads(canvas);\n }\n }", "private ShapeDrawable addPointToShapeDrawablePath_quad(float x, float y, float x_next, float y_next, android.graphics.Path path){\n path.quadTo(x,y,(x_next+x)/2,(y_next+y)/2);\n\n // make local copy of path and store in new ShapeDrawable\n android.graphics.Path currPath = new android.graphics.Path(path);\n\n ShapeDrawable shapeDrawable = new ShapeDrawable();\n //shapeDrawable.getPaint().setColor(Color.MAGENTA);\n float[] color = {40,100,100};\n shapeDrawable.getPaint().setColor(Color.HSVToColor(color));\n shapeDrawable.getPaint().setStyle(Paint.Style.STROKE);\n shapeDrawable.getPaint().setStrokeWidth(10);\n shapeDrawable.getPaint().setStrokeJoin(Paint.Join.ROUND);\n shapeDrawable.getPaint().setStrokeCap(Paint.Cap.ROUND);\n shapeDrawable.getPaint().setPathEffect(new CornerPathEffect(30));\n shapeDrawable.getPaint().setAntiAlias(true); // set anti alias so it smooths\n shapeDrawable.setIntrinsicHeight(displayManager.getHeight());\n shapeDrawable.setIntrinsicWidth(displayManager.getWidth());\n shapeDrawable.setBounds(0, 0, displayManager.getWidth(), displayManager.getHeight());\n\n shapeDrawable.setShape(new PathShape(currPath,displayManager.getWidth(),displayManager.getHeight()));\n\n return shapeDrawable;\n }", "public void Setup(int nPoints, float swp, float shp, float ssu)\n {\n Random rnd = new Random();\n\n // Our collection of vertices\n vertices = new float[nPoints*VERTICES_PER_GLYPH*TOTAL_COMPONENT_COUNT];\n\n // Create the vertex data\n for(int i=0;i<nPoints;i++) {\n int offset_x = rnd.nextInt((int)swp);\n int offset_y = rnd.nextInt((int)shp);\n\n float llu = rnd.nextInt(2) * 0.5f;\n float llv = rnd.nextInt(2) * 0.5f;\n \n \n AddGlyph(offset_x, offset_y, ssu, llu, llv, 0.5f, 0.5f);\n }\n\n // The indices for all textured quads\n indices = new short[nPoints*3*TRIANGLES_PER_GLYPH]; \n int last = 0;\n for(int i=0;i<nPoints;i++) {\n // We need to set the new indices for the new quad\n indices[(i*6) + 0] = (short) (last + 0);\n indices[(i*6) + 1] = (short) (last + 1);\n indices[(i*6) + 2] = (short) (last + 2);\n indices[(i*6) + 3] = (short) (last + 0);\n indices[(i*6) + 4] = (short) (last + 2);\n indices[(i*6) + 5] = (short) (last + 3);\n\n // Our indices are connected to the vertices so we need to keep them\n // in the correct order.\n // normal quad = 0,1,2,0,2,3 so the next one will be 4,5,6,4,6,7\n last = last + 4;\n }\n\n // The vertex buffer.\n ByteBuffer bb = ByteBuffer.allocateDirect(vertices.length * BYTES_PER_FLOAT);\n bb.order(ByteOrder.nativeOrder());\n vertexBuffer = bb.asFloatBuffer();\n vertexBuffer.put(vertices);\n vertexBuffer.position(0);\n\n // initialize byte buffer for the draw list\n ByteBuffer dlb = ByteBuffer.allocateDirect(indices.length * BYTES_PER_SHORT);\n dlb.order(ByteOrder.nativeOrder());\n indexBuffer = dlb.asShortBuffer();\n indexBuffer.put(indices);\n indexBuffer.position(0);\n\n }", "public void render() {\n // Every cell is an individual quad\n for (int x = 0; x < z.length-1; x++)\n {\n beginShape(QUAD_STRIP);\n for (int y = 0; y < z[x].length; y++)\n {\n // one quad at a time\n // each quad's color is determined by the height value at each vertex\n // (clean this part up)\n stroke(0xffff69b4);\n stroke(0xffbbbbbb);\n float currentElevation = z[x][y];\n float currentShade = map(currentElevation, -120, 120, 0, 255);\n // fill(currentShade, 255);\n noFill();\n float xCoordinate = x*scl-w/2;\n float yCoordinate = y*scl-h/2;\n vertex(xCoordinate, yCoordinate, z[x][y]);\n vertex(xCoordinate + scl, yCoordinate, z[x+1][y]);\n }\n endShape();\n }\n }", "public void render() \r\n\t{\r\n \tE3DRenderTree renderTree = new E3DRenderTree(getEngine());\r\n \trenderTree.getTriangleHandler().add(this);\r\n \trenderTree.render();\r\n\t}", "abstract public void draw(GL gl);", "public void drawSegment(Point_3 p, Point_3 q) {\n\t\tthis.frame.drawSegment(p, q);\n\t}", "public void drawRect(float x, float y, float width, float height, float u, float v, float texW, float texH) {\n float a = TextureManager.getBound().w, b = TextureManager.getBound().h;\n float u1 = u / a, v1 = v / a;\n float u2 = (u + texW) / a, v2 = (v + texH) / b;\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x2, y1, u2, v1,\n x1, y1, u1, v1,\n x2, y2, u2, v2,\n x1, y2, u1, v2\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }", "@Override\r\n\tpublic void draw(GL10 gl) {\n\r\n\t gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);\t\t\t// Clear The Screen And The Depth Buffer\r\n\t gl.glLoadIdentity();\t\t\t\t\t\t\t\t\t\t\t// Reset The Modelview Matrix\r\n//\t gl.glTranslatef(0.0f, 0.0f, -10.0f);\t\t\t\t\t\t\t\t// Translate 20 Units Into The Screen\r\n\r\n\t spin += 0.05f;\t\t\t\t\t\t\t\t\t\t\t\t// Increase Spin\r\n\t \r\n\t gl.glRotatef(spin, 0, 1, 0);\r\n\r\n\t gl.glPushMatrix();\r\n\t gl.glTranslatef(-1.0f, 0, 0);\r\n\t \r\n\t drawSquare(gl);\r\n\t gl.glPopMatrix();\r\n\t \r\n//\t gl.glPushMatrix();\r\n//\t gl.glTranslatef(1.0f, 0, 0);\r\n//\t gl.glBindTexture(GL10.GL_TEXTURE_2D, texture[1].texID[0]);\r\n//\t drawSquare(gl);\r\n//\t gl.glPopMatrix();\r\n\t}", "@Override\n \tpublic void draw() {\n \n \t\tGL11.glPushMatrix();\n \t\t\n \t\tGL11.glTranslatef(super.getX(), super.getY(), 0);\n \t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n \t\tMain.BLANK_TEXTURE.bind();\n \t\tGL11.glBegin(GL11.GL_QUADS);\n \t\t{\n \t\t\t\n \t\t\tGL11.glColor3f(1.0f, 0.0f, 0.0f);\n \t\t\tGL11.glVertex2f(0, 0); // top left\n \t\t\tGL11.glVertex2f(0, Main.gridSize); // bottom left\n \t\t\tGL11.glVertex2f(Main.gridSize, Main.gridSize); // bottom right\n \t\t\tGL11.glVertex2f(Main.gridSize, 0); // top right\n \t\t\t\n \t\t\t\n \t\t\tif (isRight()) {\n \t\t\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n \t\t\t\tGL11.glVertex2f(12, 0);\n \t\t\t\tGL11.glVertex2f(12, 12);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 12);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 0);\n \t\t\t\t\n \t\t\t\tGL11.glColor3f(0.0f, 0.0f, 0.0f);\n \t\t\t\tGL11.glVertex2f(Main.gridSize-6, 3);\n \t\t\t\tGL11.glVertex2f(Main.gridSize-6, 9);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 9);\n \t\t\t\tGL11.glVertex2f(Main.gridSize, 3);\n \t\t\t\t\n \t\t\t} else {\n \t\t\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n \t\t\t\tGL11.glVertex2f(0, 0);\n \t\t\t\tGL11.glVertex2f(0, 12);\n \t\t\t\tGL11.glVertex2f(12, 12);\n \t\t\t\tGL11.glVertex2f(12, 0);\n \t\t\t\t\n \t\t\t\tGL11.glColor3f(0.0f, 0.0f, 0.0f);\n \t\t\t\tGL11.glVertex2f(0, 3);\n \t\t\t\tGL11.glVertex2f(0, 9);\n \t\t\t\tGL11.glVertex2f(4, 9);\n \t\t\t\tGL11.glVertex2f(4, 3);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\tGL11.glEnd();\n \n \t\tGL11.glPopMatrix();\n \t\t\n \t}", "public void draw(GL10 gl) {\n gl.glFrontFace(GL10.GL_CCW);\n // Enable face culling\n gl.glEnable(GL10.GL_CULL_FACE);\n // Cull back face\n gl.glCullFace(GL10.GL_BACK);\n\n // Enable OpenGL ES vertex pipeline\n gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n // Push vertex buffer to OpenGL ES\n gl.glVertexPointer(2, GL10.GL_FLOAT, 0, vertexBuffer);\n // Draw lines(draw the star)\n gl.glDrawArrays(GL10.GL_LINE_LOOP, 0, 5);\n // Disable vertices buffer\n gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);\n // Disable face culling\n gl.glDisable(GL10.GL_CULL_FACE);\n }", "@Override\n \t\t\t\tpublic void doCreateQuadParticle() {\n \n \t\t\t\t}", "public void draw(GL2 gl) {\n\t\tif (disabled > explodeTime) {\n\t\t\treturn;\n\t\t}\n\t\tsphere.draw(gl, texture);\n\t}", "void addVertex(Vertex v);", "public abstract void addComponent(DrawingComponent component);", "void add(Vertex vertex);", "public void draw(GL3 gl) {\n draw(gl, CoordFrame2D.identity());\n }", "public final void addVertex(final Vertex v) {\r\n final Outline lo = getLastOutline();\r\n lo.addVertex(v);\r\n if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {\r\n bbox.resize(v.getCoord());\r\n }\r\n // vertices.add(v); // FIXME: can do and remove DIRTY_VERTICES ?\r\n dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;\r\n }", "public synchronized void addComponent(DrawableVector draw) {\n instructions.add(draw);\n }", "public void beginDraw(int renderMode)\r\n\t{\r\n\r\n\t\tswitch(renderMode) {\r\n\t\tcase POINT:\r\n\t\t\tgl.glBegin(GL_POINTS);\r\n\t\t\tbreak;\r\n\t\tcase POLYGON:\r\n\t\t\tgl.glBegin(GL_POLYGON);\r\n\t\t\tbreak;\r\n\t\tcase POLYLINE:\r\n\t\t\tgl.glBegin(GL_LINE_STRIP);\r\n\t\t\tbreak;\r\n\t\tcase LINE:\r\n\t\t\tgl.glBegin(GL_LINES);\r\n\t\t\tbreak;\r\n\t\tcase TRIANGLE:\r\n\t\t\tgl.glBegin(GL_TRIANGLES);\r\n\t\t\tbreak;\r\n\t\tcase LINE_LOOP:\r\n\t\t\tgl.glBegin(GL_LINE_LOOP);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "@Override\n \t\t\t\tpublic void doCreateQuadWater() {\n \n \t\t\t\t}", "public void setQuadAt(int i, int p0, int p1, int p2, int p3) {\n quadIndices[4*i] = p0;\n quadIndices[4*i+1] = p1;\n quadIndices[4*i+2] = p2;\n quadIndices[4*i+3] = p2;\n\n boundingVolume = null;\n }", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public synchronized void display() {\r\n\r\n\t\t// clear the screen and draw a yellow square\r\n\t\tgl.clear(GL.COLOR_BUFFER_BIT);\r\n\t\t// First rectangle\r\n\t\tgl.pushMatrix();\r\n\t\tgl.translate(-0.5, 0.0, 0.0);\r\n\t\tgl.rotate(spin, 0.0, 0.0, 1.0);\r\n\t\tgl.rect(-0.5, -0.5, 0.5, 0.5);\r\n\t\tgl.popMatrix();\r\n\t\t// Second rectangle\r\n\t\tgl.pushMatrix();\r\n\t\tgl.translate(0.5, 0.0, 0.0);\r\n\t\tgl.rotate(-spin, 0.0, 0.0, 1.0);\r\n\t\tgl.rect(-0.5, -0.5, 0.5, 0.5);\r\n\t\tgl.popMatrix();\r\n\t\tgl.flush(); // Make sure all commands have completed.\r\n\t\tgl.swap();\t // Swap the render buffer with the screen buffer\r\n\t}", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "public void draw(GL10 gl) {\n\n\n\t\t//Point to our buffers\n\t\tgl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\n\n\t\t//Set the face rotation\n\t\tgl.glFrontFace(GL10.GL_CCW);\n\n\t\t//Enable the vertex and texture state\n\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBufferBuffer);\n\t\tgl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBufferBuffer);\n\n\t\t//gl.glDrawArrays(GL10.GL_TRIANGLES, 0, numOfVertices);\n\n\t\tgl.glDrawElements(GL10.GL_TRIANGLES, indices.length,GL10.GL_UNSIGNED_SHORT, indexBufferBuffer);\n\n\t\t//Disable the client state before leaving\n\t\tgl.glDisableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\t}", "public void draw(int texture){\n\t\tGLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);\n\t\tGLES20.glUseProgram(program);\n\t\tGLES20.glDisable(GLES20.GL_BLEND);\n\n\t\tint positionHandle = GLES20.glGetAttribLocation(program, \"aPosition\");\n\t\tint textureHandle = GLES20.glGetUniformLocation(program, \"uTexture\");\n\t\tint texturePositionHandle = GLES20.glGetAttribLocation(program, \"aTexPosition\");\n\n\t\tGLES20.glVertexAttribPointer(texturePositionHandle, 2, GLES20.GL_FLOAT, false, 0, textureBuffer);\n\t\tGLES20.glEnableVertexAttribArray(texturePositionHandle);\n\n\t\tGLES20.glActiveTexture(GLES20.GL_TEXTURE0);\n\t\tGLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture);\n\t\tGLES20.glUniform1i(textureHandle, 0);\n\n\t\tGLES20.glVertexAttribPointer(positionHandle, 2, GLES20.GL_FLOAT, false, 0, verticesBuffer);\n\t\tGLES20.glEnableVertexAttribArray(positionHandle);\n\n\t\tGLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);\n\t\tGLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);\n\t}", "public void draw() {\n \n // TODO\n }", "public void draw(Graphics q) {\n // AMD: moved from DrawSnakeGamePanel\n LinkedList<Point> coordinates = this.segmentsToDraw();\n\n //Draw head in head color\n q.setColor(colorOfHead);\n Point head = coordinates.pop();\n q.fillRect((int) head.getX(), (int) head.getY(), SnakeGame.getSquareSize(), SnakeGame.getSquareSize());\n\n //Draw rest of snake in body color\n q.setColor(colorOfBody);\n for (Point p : coordinates) {\n q.fillRect((int) p.getX(), (int) p.getY(), SnakeGame.getSquareSize(), SnakeGame.getSquareSize());\n }\n }", "private void drawMesh(GL10 gl)\n\t{\n\t\t// Point to our buffers\n\t\tgl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\t\t\n\t\t// Set the face rotation\n\t\tgl.glFrontFace(GL10.GL_CW);\n\t\t\n\t\t// Point to our vertex buffer\n\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);\n\t\tgl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);\n\t\t\n\t\t// Draw the vertices as triangle strip\n\t\t//gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);\n\t\tgl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertexCount / 3);\n\n\t\t//Disable the client state before leaving\n\t\tgl.glDisableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\t}", "public void draw(GL10 gl)\n\t{\t\n\t\t// bind the previously generated texture\n\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);\n\n\t\t// Point to our buffers\n\t\tgl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\n\t\t// Point to our vertex buffer\n\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);\n\t\tgl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);\n\n\t\tvertexBuffer.put(vertices_long);\n\t\tvertexBuffer.position(0);\n\n\t\tgl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices_long.length / 3);\n\n\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]);\n\t\tvertexBuffer.put(vertices_lat);\n\t\tvertexBuffer.position(0);\n\t\tgl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices_lat.length / 3);\n\n\t\t// Disable the client state before leaving\n\t\tgl.glDisableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\t}", "public abstract void render(GL2 gl);", "public void draw (GL10 gl){\n\t\t\n\t\tgl.glFrontFace(GL10.GL_CW);\n\t\tgl.glCullFace(GL10.GL_CULL_FACE);\n\t\tgl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, bufferTock);\n\t\tgl.glColor4f(r, g, b, a);\n\t\tgl.glDrawElements(GL10.GL_TRIANGLES, index.length, GL10.GL_UNSIGNED_SHORT, pBuff);\n\t\tgl.glDisableClientState(GL10.GL_VERTEX_ARRAY);\n\t\t\n\t}", "public void add(SceneShape s)\n {\n shapes.add(s);\n repaint();\n }", "public void render(GL2 gl) {\n renderer.render(gl, state);\n }", "void drawSphere(GL2 gl,GLU glu, double r, int lats, int longs) {\n\n\n\n GLUquadric qobj = glu.gluNewQuadric();\n\n gl.glColor4f(0.0f, 0.0f, 1.0f,0.01f);\n glu.gluQuadricDrawStyle(qobj, GLU.GLU_LINE);\n glu.gluQuadricNormals(qobj, GLU.GLU_SMOOTH);\n\n glu.gluSphere(qobj, r, 70, 70);\n\n /*\n int i, j;\n for(i = 0; i <= lats; i++) {\n float lat0 = (float) (Math.PI * (-0.5 + (double) (i - 1) / lats));\n float z0 = (float) (Math.sin(lat0));\n float zr0 = (float) (Math.cos(lat0));\n\n float lat1 = (float) (Math.PI * (-0.5 + (double) i / lats));\n float z1 = (float) (Math.sin(lat1));\n float zr1 = (float) (Math.expm1(lat1));\n\n gl.glBegin(GL_LINE_STRIP);\n gl.glColor3f(0.0f, 1.0f, 1.0f);\n for(j = 0; j <= longs; j++) {\n float lng = (float) (2. * Math.PI * (double) (j - 1) / longs);\n float x = (float) (r*Math.cos(lng));\n float y = (float) (r*Math.sin(lng));\n\n\n\n gl.glNormal3f(x * z0, y * z0,(float)r* zr0);\n gl.glVertex3f(x * z0, y * z0, (float) r*zr0);\n //gl.glNormal3f(x * zr1, y * zr1, (float) r*z1);\n //gl.glVertex3f(x * zr1, y * zr1, (float)r*z1);\n }\n gl.glEnd();\n }\n */\n }", "void drawShape() {\n System.out.println(\"Drawing Triangle\");\n this.color.addColor();\n }", "@Override\n public void render() {\n Gdx.gl.glClearColor(0, 0, 0, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n // Then we start our shapeRenderer batch, this time with ShapeType.Line\n shapeRenderer.begin(ShapeType.Line);\n // A Simple white line\n shapeRenderer.setColor(Color.WHITE);\n shapeRenderer.line(0, 0, 100, 100);\n // We can set different colors using two methods. We can use constants like so.\n shapeRenderer.setColor(Color.MAGENTA);\n shapeRenderer.line(10, 0, 110, 100);\n // We can also set a color using RGBA values\n shapeRenderer.setColor(0, 1, 0, 1);\n shapeRenderer.line(20, 0, 120, 100);\n // We can also do fancy things like gradients\n shapeRenderer.line(30, 0, 130, 100, Color.BLUE, Color.RED);\n // The last interesting thing we can do is draw a bunch of connected line segments using polyline\n // First we set up the list of vertices, where the even positions are x coordinates, and the odd positions are the y coordinates\n float[] verticies = {100, 200, 300, 300, 200, 300, 300, 200};\n shapeRenderer.polyline(verticies);\n // Finally, as always, we end the batch\n shapeRenderer.end();\n }", "public void Render(){\n //player rect\n glPushMatrix();\n glTranslatef(px, py, 0.0f);\n glBegin(GL_TRIANGLES);\n glColor3f(1.0f, 1.0f, 1.0f);\n glVertex2f(-sx, sy);\n glVertex2f(-sx, -sy);\n glVertex2f(sx, sy);\n glVertex2f(sx, sy);\n glVertex2f(-sx, -sy);\n glVertex2f(sx, -sy);\n glEnd();\n glPopMatrix();\n \n if(debug){\n glPushMatrix();\n glBegin(GL_LINES);\n glColor3f(0f, 1f, 0f);\n glVertex2f(px-sx, py+sy/2);\n glVertex2f(px+sx, py+sy/2);\n glColor3f(0f, 1f, 0f);\n glVertex2f(px-sx, py-sy/2);\n glVertex2f(px+sx, py-sy/2);\n glEnd();\n glPopMatrix();\n }\n \n }", "@Override\n public void draw(final Program program) {\n if (hasColor) {\n color.draw(program);\n }\n\n program.drawArrays(A_POSITION, vertexBuffer, vertexCount);\n }", "public void draw(GL10 gl) {\n\t\t\t// Counterclockwise order for front face vertices\n\t\t\tgl.glFrontFace(GL10.GL_CCW);\n\t\t\t// Points to the vertex buffers\n\t\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);\n\t\t\tgl.glColorPointer(4, GL10.GL_FLOAT, 0, colorBuffer);\n\t\t\t// Enable client states\n\t\t\tgl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n\t\t\tgl.glEnableClientState(GL10.GL_COLOR_ARRAY);\n\t\t\t// Draw vertices as triangles\n\t\t\tgl.glDrawElements(GL10.GL_TRIANGLES, 36, GL10.GL_UNSIGNED_BYTE, indexBuffer);\n\t\t\t// Disable client state\n\t\t\tgl.glDisableClientState(GL10.GL_VERTEX_ARRAY);\n\t\t\tgl.glDisableClientState(GL10.GL_COLOR_ARRAY);\n\t\t}", "private void draw() {\n gsm.draw(g);\n }", "private void drawTriangle(GL2 gl2, int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)\n {\n gl2.glBegin(GL2.GL_TRIANGLES);\n gl2.glColor3f(r, g, b);\n gl2.glVertex2f(x1, y1);\n gl2.glVertex2f(x2, y2);\n gl2.glVertex2f(x3, y3);\n gl2.glEnd();\n }", "public void draw(GL gl)\r\n\t{\r\n\t\tglu = new GLU();\r\n\t\tquadric = glu.gluNewQuadric();\r\n\r\n\t\tgl.glPushMatrix();\r\n\t\t\r\n\t\t gl.glTranslated(loc[0], loc[1], loc[2]);\r\n\t\t gl.glScaled(0.9, 0.9, 0.9);\r\n\t\t gl.glTranslated(0, 2, 0);\r\n\t\t gl.glRotated(heading, 0,1,0); //JW added\r\n\t\t \r\n\t\t //Helicopter Body\r\n\t\t\tgl.glPushMatrix();\r\n\t\t gl.glColor4d(0.2, 0.2, 1, 1);\r\n\t\t gl.glScaled(1, 0.7, 1);\r\n\t\t glu.gluSphere(quadric, 3, 20, 20);\r\n\t gl.glPopMatrix();\r\n\t \r\n\t //Helicopter back part #1\r\n\t gl.glPushMatrix();\r\n\t\t gl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glRotated(-90, 0, 1, 0);\r\n\t\t glu.gluCylinder(quadric, 1, 0, 7, 50, 50);\r\n\t gl.glPopMatrix();\r\n\t \r\n\t //Helicopter back part #2\r\n\t gl.glPushMatrix();\r\n\t \tgl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(-12, 1, 0);\r\n\t\t gl.glRotated(-90, 1, 0, 0);\r\n\t\t glu.gluCylinder(quadric, 0.5, 0.5, 10, 40, 10);\r\n\t gl.glPopMatrix();\r\n\t \r\n\t //Rotor Rod\r\n\t gl.glPushMatrix();\r\n\t \tgl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(0, 21, 0);\r\n\t\t gl.glRotated(-90, 1, 0, 0);\r\n\t\t glu.gluCylinder(quadric, 0.5, 0.5, 15, 35, 15);\r\n\t\t gl.glPopMatrix(); \r\n\t\t \r\n\t //Landing Rods #1\r\n\t gl.glPushMatrix();\r\n\t\t \tgl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(-1, -35, 2);\r\n\t\t gl.glRotated(-90, 1, 0, 0);\r\n\t\t glu.gluCylinder(quadric, 0.3, 0.3, 20, 15, 155);\r\n\t gl.glPopMatrix();\r\n\t \r\n\t gl.glPushMatrix();\r\n\t\t \tgl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(2, -35, 2);\r\n\t\t gl.glRotated(-90, 1, 0, 0);\r\n\t\t glu.gluCylinder(quadric, 0.3, 0.3, 20, 15, 25);\r\n\t\t gl.glPopMatrix();\r\n\t\t \r\n\t\t //Landing Part #1\r\n\t\t gl.glPushMatrix();\r\n\t\t \tgl.glColor4d(0, 0, 0.99, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(-4, -35, 2);\r\n\t\t gl.glRotated(120, 120, 120, 120);\r\n\t\t glu.gluCylinder(quadric, 0.5, 0.5, 10, 35, 15);\r\n\t\t gl.glPopMatrix();\r\n\r\n\t\t //Landing Rods #2\r\n\t gl.glPushMatrix();\r\n\t\t \tgl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(-1, -35, -2);\r\n\t\t gl.glRotated(-90, 1, 0, 0);\r\n\t\t glu.gluCylinder(quadric, 0.3, 0.3, 20, 15, 155);\r\n\t gl.glPopMatrix();\r\n\t \r\n\t gl.glPushMatrix();\r\n\t\t \tgl.glColor4d(1, 0.2, 0, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(2, -35, -2);\r\n\t\t gl.glRotated(-90, 1, 0, 0);\r\n\t\t glu.gluCylinder(quadric, 0.3, 0.3, 20, 15, 25);\r\n\t\t gl.glPopMatrix();\r\n\t\t \r\n\t\t //Landing Part #2\r\n\t\t gl.glPushMatrix();\r\n\t\t \tgl.glColor4d(0, 0, 0.99, 1);\r\n\t\t gl.glScaled(0.5, 0.1, 0.5);\r\n\t\t gl.glTranslated(-4, -35, -2);\r\n\t\t gl.glRotated(120, 120, 120, 120);\r\n\t\t glu.gluCylinder(quadric, 0.5, 0.5, 10, 35, 15);\r\n\t\t gl.glPopMatrix();\r\n\r\n\t\t gl.glPushMatrix();\r\n\t\t\t if(loc[1] > 1 && loc[1] <10)\r\n\t\t\t\t{\r\n\t\t\t\t \txSpeed();\r\n\t\t\t\t \tgl.glRotated(x, 0, 1, 0);\r\n\t\t\t\t} else if (loc[1] == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tgl.glRotated(0, 0, 1, 0);\r\n\t\t\t\t} else if(loc[1] > 10 )\r\n\t\t\t\t{\r\n\t\t\t\t\txSpeedIncrease();\r\n\t\t\t\t\tgl.glRotated(x, 0, 1, 0);\r\n\t\t\t\t}\r\n\t \t\trotors.draw(gl);\r\n\t \tgl.glPopMatrix();\r\n\t \t\r\n\t gl.glPopMatrix();\r\n\t \r\n\t gl.glFlush();\r\n\t\tgl.glEnd();\r\n\t}", "@Override\n\t\tpublic void render()\n\t\t{\n\t\t\tif(color.alpha() > 0)\n\t\t\t{\n\t\t\t\tbind();\n\t\t\t\tGL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);\n\t\t\t\tGL11.glBegin(GL11.GL_TRIANGLE_STRIP);\n\t\t\t\t\tfloat screenWidth = WindowManager.controller().width();\n\t\t\t\t\tfloat screenHeight = WindowManager.controller().height();\n\t\t\t\t\tGL11.glVertex2f(0, 0);\n\t\t\t\t\tGL11.glVertex2f(screenWidth, 0);\n\t\t\t\t\tGL11.glVertex2f(0, screenHeight);\n\t\t\t\t\tGL11.glVertex2f(screenWidth, screenHeight);\n\t\t\t\tGL11.glEnd();\n\t\t\t\trelease();\n\t\t\t}\n\t\t}", "public String getType() {\r\n\t\treturn \"Quad\";\r\n\t}", "private void addGraphicObject(GraphicObject g_obj, int x, int y) {\n\t\tg_obj.setFillColor(this.currentFillColor);\n g_obj.setStroke(this.currentStrokeColor, this.currentStrokeSize.getValue());\n\n\t\tthis.canvas.add(g_obj, x, y);\n\t}", "public void draw(){\n\t\tcomponent.draw();\r\n\t}", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"绘制三角形\");\t\n\t}", "public void draw(float vx, float vy, float tu, float tv, float cr, float cg, float cb, float ca){\n\t\tif(!(currentVertex + 1 < MAX_VERTICES))\n\t\t\tflushToGL();\n\t\t\n\t\tpositions[currentVertex].set(vx, vy);\n\t\ttexcoords[currentVertex].set(tu, tv);\n\t\tcolors[currentVertex].set(cr, cg, cb, ca);\n\t\t++currentVertex;\n\t}", "public void addPolyGon() {\n abstractEditor.drawNewShape(new ESurfaceDT());\n }", "public QuadMesh() {\n lastInfo = new GeometryIntersectionInformation();\n lastRay = null;\n minMax = null;\n boundingVolume = null;\n triangleMeshGroupCache = null;\n\n vertexPositions = null;\n vertexNormals = null;\n vertexBinormals = null;\n vertexTangents = null;\n vertexColors = null;\n vertexUvs = null;\n quadIndices = null;\n incidentQuadsPerVertexArray = null;\n }", "@Override\n public void onDraw(int cameraTexId, int canvasWidth, int canvasHeight) {\n setupShaderInputs(program,\n new int[]{canvasWidth, canvasHeight},\n new int[]{cameraTexId},\n new int[][]{});\n GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);\n }", "synchronized private void draw3DObjects(GL10 gl) {\n\t\tmeshRenderer_.draw(gl);\r\n\t}", "public void plotSurface(double du, double dv) {\n\t\t for (double u = 0.; u <= 1. - du; u += du) {\n\t\t frame.beginShape(frame.QUAD_STRIP);\n\t\t for (double v = 0.; v <= 1.; v += dv) {\n\t\t \tPoint_3 p0, p1; // four points defining a quad\n\t\t \tp0=evaluate(u,v);\n\t\t \tp1=evaluate(u+du,v);\n\t\t frame.noStroke();\n\t\t frame.fill( 255 );\n\t\t frame.vertex( (float)p0.getX(), (float)p0.getY(), (float)p0.getZ() );\n\t\t frame.vertex( (float)p1.getX(), (float)p1.getY(), (float)p1.getZ() );\n\t\t }\n\t\t frame.endShape();\n\t\t }\n\t}", "public void drawRect(float x, float y, float width, float height) {\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x1, y1, 0F, 0F,\n x2, y1, 1F, 0F,\n x2, y2, 1F, 1F,\n x1, y2, 0F, 1F\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }", "public void draw() {\n \n }", "public void render() {\r\n\t\t\r\n\t\tif (page >= 0 && page < pages.length) {\r\n\t\t\tTextures.renderQuad(pages[page][(updates / 90) % pages[page].length], 32, 32, 1024, 512);\r\n\t\t}\r\n\t}", "public void onSurfaceCreated(GL10 unused, EGLConfig config) {\n GLES20.glClearColor(0.1f, 0.1f, 0.25f, 1.0f);\n RSGFXShaderManager.loadShaders();\n next_game_tick = SystemClock.elapsedRealtime();\n // No culling of back faces\n GLES20.glDisable(GLES20.GL_CULL_FACE);\n \n // No depth testing\n //GLES20.glDisable(GLES20.GL_DEPTH_TEST);\n setupRender();\n // Enable blending\n // GLES20.glEnable(GLES20.GL_BLEND);\n // GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE);\n \n // Setup quad \n \t\t// Generate your vertex, normal and index buffers\n \t\t// vertex buffer\n \t\t_qvb = ByteBuffer.allocateDirect(_quadv.length\n \t\t\t\t* FLOAT_SIZE_BYTES).order(ByteOrder.nativeOrder()).asFloatBuffer();\n \t\t_qvb.put(_quadv);\n \t\t_qvb.position(0);\n\n \t\t// index buffer\n \t\t_qib = ByteBuffer.allocateDirect(_quadi.length\n \t\t\t\t* 4).order(ByteOrder.nativeOrder()).asIntBuffer();\n \t\t_qib.put(_quadi);\n \t\t_qib.position(0);\n }", "public abstract void render(GL2 gl, GLU glu);", "void render(Graphics2D brush);", "private void doBeam(Vector3f start, Vector3f end, Vector3f up, float len, float spanWidth, Vector4f color) {\n boolean useSoftSprites = false;//Ref.glRef.srgbBuffer != null && Ref.glRef.r_softparticles.isTrue();\n CubeTexture tex = null; // depth\n\n Shader sh = Ref.glRef.getShader(\"Poly\");\n Ref.glRef.PushShader(sh);\n sh.setUniform(\"ModelView\", view.viewMatrix);\n sh.setUniform(\"Projection\", view.ProjectionMatrix);\n// if(useSoftSprites) {\n// // use soft particle shader\n// Ref.glRef.PushShader(softSprite);\n// softSprite.setUniform(\"res\", Ref.glRef.GetResolution());\n//\n// // Bind depth from FBO\n// int depth = Ref.glRef.srgbBuffer.getDepthTextureId();\n// tex = new CubeTexture(Ref.glRef.srgbBuffer.getTarget(), depth, null);\n// tex.textureSlot = 1;\n// tex.loaded = true;\n// tex.Bind();\n// }\n\n GL11.glDisable(GL11.GL_CULL_FACE);\n\n GL11.glDepthMask(false); // dont write to depth\n GL11.glBegin(GL11.GL_QUADS);\n {\n // Fancy pants shaders\n Vector3f v = Helper.VectorMA(start, spanWidth, up, null);\n GL20.glVertexAttrib2f(Shader.INDICE_COORDS, 1, 0);\n Helper.col(color);\n GL20.glVertexAttrib3f(Shader.INDICE_POSITION, v.x, v.y, v.z);\n\n Helper.VectorMA(start, -spanWidth, up, v);\n GL20.glVertexAttrib2f(Shader.INDICE_COORDS, 1, 1);\n Helper.col(color);\n GL20.glVertexAttrib3f(Shader.INDICE_POSITION, v.x, v.y, v.z);\n\n \n\n Helper.VectorMA(end, -spanWidth, up, v);\n GL20.glVertexAttrib2f(Shader.INDICE_COORDS, 0, 1);\n Helper.col(color);\n GL20.glVertexAttrib3f(Shader.INDICE_POSITION, v.x, v.y, v.z);\n\n Helper.VectorMA(end, spanWidth, up, v);\n GL20.glVertexAttrib2f(Shader.INDICE_COORDS, 0, 0);\n Helper.col(color);\n GL20.glVertexAttrib3f(Shader.INDICE_POSITION, v.x, v.y, v.z);\n }\n GL11.glEnd();\n GL11.glDepthMask(true);\n\n GL11.glEnable(GL11.GL_CULL_FACE);\n\n if(useSoftSprites) {\n tex.Unbind();\n Ref.glRef.PopShader();\n }\n Ref.glRef.PopShader();\n }", "@Override\n\tpublic void addSurface(final int id, final Surface surface, final boolean isRecordable) {\n\t\tmRendererTask.addSurface(id, surface);\n\t}", "private Quad getQuad() {\n final BufferedImage img = getImage();\n if(img == null){\n logger.severe(\"[tweet node] image is null!!!\");\n }\n\n float w = img.getWidth();\n float h = img.getHeight();\n \n height3D = h * fontSizeModifier;\n final Quad ret = new Quad(\"tweet node\", w * fontSizeModifier, height3D);\n\n ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {\n public void update(Object arg0) {\n TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();\n Texture tex = TextureManager.loadTexture(img, MinificationFilter.BilinearNoMipMaps, MagnificationFilter.Bilinear, true);\n \n ts.setTexture(tex);\n ts.setEnabled(true);\n ret.setRenderState(ts);\n\n ret.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);\n\n BlendState as = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();\n as.setBlendEnabled(true);\n as.setTestEnabled(true);\n as.setTestFunction(TestFunction.GreaterThan);\n as.setEnabled(true);\n ret.setRenderState(as);\n\n ret.setLightCombineMode(LightCombineMode.Off);\n ret.updateRenderState();\n\n ClientContextJME.getWorldManager().addToUpdateList(TweetNode.this);\n }\n }, null);\n\n return ret;\n }", "public static void drawRectangle(double width, double height) {\n gl.glPushMatrix();\n gl.glScaled(width, height, 1);\n gl.glBegin(GL.GL_TRIANGLE_FAN);\n gl.glVertex3d(-0.5, -0.5, 0);\n gl.glVertex3d(0.5, -0.5, 0);\n gl.glVertex3d(0.5, 0.5, 0);\n gl.glVertex3d(-0.5, 0.5, 0);\n gl.glEnd();\n gl.glPopMatrix();\n }", "public void drawCube() {\r\n GLES20.glUseProgram(program);\r\n\r\n GLES20.glUniform3fv(lightPosParam, 1, lightPosInEyeSpace, 0);\r\n\r\n // Set the Model in the shader, used to calculate lighting\r\n GLES20.glUniformMatrix4fv(modelParam, 1, false, model, 0);\r\n\r\n // Set the ModelView in the shader, used to calculate lighting\r\n GLES20.glUniformMatrix4fv(modelViewParam, 1, false, modelView, 0);\r\n\r\n // Set the position of the cube\r\n GLES20.glVertexAttribPointer(positionParam, COORDS_PER_VERTEX, GLES20.GL_FLOAT, false, 0, vertices);\r\n\r\n // Set the ModelViewProjection matrix in the shader.\r\n GLES20.glUniformMatrix4fv(modelViewProjectionParam, 1, false, modelViewProjection, 0);\r\n\r\n // Set the normal positions of the cube, again for shading\r\n GLES20.glVertexAttribPointer(normalParam, 3, GLES20.GL_FLOAT, false, 0, normals);\r\n GLES20.glVertexAttribPointer(colorParam, 4, GLES20.GL_FLOAT, false, 0, isLookingAtObject(this) ? cubeFoundColors : colors);\r\n\r\n GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 36);\r\n checkGLError(\"Drawing cube\");\r\n }", "public void addQuantity(Vector3d v, double q) {\r\n\t\tint[] b = boxCoords(v);\r\n\t\taddQuantity(b[0],b[1],b[2],q);\r\n\t}", "void ldraw_addVertexWithUV(double x, double y, double z, double u, double v) {\n lDraw.a(x, y, z, u, v);\n }", "public void render(Shader shader, RenderingEngine renderingEngine) { meshRenderer.render(shader, renderingEngine); }", "public void draw() {\n\t\tapplyColors();\n\n\t\tfloat halfHeight = height / 2,\n\t\t\t\tdiameter = 2 * radius;\n\n\t\tRobotRun.getInstance().translate(0f, 0f, halfHeight);\n\t\t// Draw top of the cylinder\n\t\tRobotRun.getInstance().ellipse(0f, 0f, diameter, diameter);\n\t\tRobotRun.getInstance().translate(0f, 0f, -height);\n\t\t// Draw bottom of the cylinder\n\t\tRobotRun.getInstance().ellipse(0f, 0f, diameter, diameter);\n\t\tRobotRun.getInstance().translate(0f, 0f, halfHeight);\n\n\t\tRobotRun.getInstance().beginShape(RobotRun.TRIANGLE_STRIP);\n\t\t// Draw a string of triangles around the circumference of the Cylinders top and bottom.\n\t\tfor (int degree = 0; degree <= 360; ++degree) {\n\t\t\tfloat pos_x = RobotRun.cos(RobotRun.DEG_TO_RAD * degree) * radius,\n\t\t\t\t\tpos_y = RobotRun.sin(RobotRun.DEG_TO_RAD * degree) * radius;\n\n\t\t\tRobotRun.getInstance().vertex(pos_x, pos_y, halfHeight);\n\t\t\tRobotRun.getInstance().vertex(pos_x, pos_y, -halfHeight);\n\t\t}\n\n\t\tRobotRun.getInstance().endShape();\n\t}", "public void draw(TextureRegion region, Vector3 position, Vector3 size, float rotation, Color c) {\n if (!drawing)\n throw new IllegalStateException(\"SpriteBatch.begin must be called before draw.\");\n\n Texture texture = region.getTexture();\n if (idx == vertices.length) //\n renderMesh();\n\n float width = size.x;\n float height = size.y;\n float x = position.x;\n float y = position.y;\n float z = position.z;\n\n float x0;\n float y0;\n float z0;\n float x1;\n float y1;\n float z1;\n float x2;\n float y2;\n float z2;\n float x3;\n float y3;\n float z3;\n\n y0 = y - height / 2f;\n y1 = y + height / 2f;\n y2 = y + height / 2f;\n y3 = y - height / 2f;\n\n final float u = region.getU();\n final float v = region.getV2();\n final float u2 = region.getU2();\n final float v2 = region.getV();\n\n // rotate\n final float cos = (float) Math.cos(rotation);\n final float sin = (float) Math.sin(rotation);\n\n x0 = x - cos * (width / 2f);\n z0 = z + sin * (width / 2f);\n\n x1 = x - cos * (width / 2f);\n z1 = z + sin * (width / 2f);\n\n x2 = x + cos * (width / 2f);\n z2 = z - sin * (width / 2f);\n\n x3 = x + cos * (width / 2f);\n z3 = z - sin * (width / 2f);\n\n vertices[idx++] = x0;\n vertices[idx++] = y0;\n vertices[idx++] = z0;\n vertices[idx++] = c.r;\n vertices[idx++] = c.g;\n vertices[idx++] = c.b;\n vertices[idx++] = c.a;\n vertices[idx++] = u;\n vertices[idx++] = v;\n\n vertices[idx++] = x1;\n vertices[idx++] = y1;\n vertices[idx++] = z1;\n vertices[idx++] = c.r;\n vertices[idx++] = c.g;\n vertices[idx++] = c.b;\n vertices[idx++] = c.a;\n vertices[idx++] = u;\n vertices[idx++] = v2;\n\n vertices[idx++] = x2;\n vertices[idx++] = y2;\n vertices[idx++] = z2;\n vertices[idx++] = c.r;\n vertices[idx++] = c.g;\n vertices[idx++] = c.b;\n vertices[idx++] = c.a;\n vertices[idx++] = u2;\n vertices[idx++] = v2;\n\n vertices[idx++] = x3;\n vertices[idx++] = y3;\n vertices[idx++] = z3;\n vertices[idx++] = c.r;\n vertices[idx++] = c.g;\n vertices[idx++] = c.b;\n vertices[idx++] = c.a;\n vertices[idx++] = u2;\n vertices[idx++] = v;\n }", "@Override\n public void render() {\n // Set the background color to opaque black\n Gdx.gl.glClearColor(0, 0, 0, 1);\n // Actually tell OpenGL to clear the screen\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n // First we begin a batch of points\n shapeRenderer.begin(ShapeType.Point);\n // Then we draw a point\n shapeRenderer.point(100, 100, 0);\n // And make sure we end the batch\n shapeRenderer.end();\n }", "public void queueEvent(Runnable r) {\n renderqueue.add(r);\n }", "@Override\n public void add(PaintOrder order) {\n queue.add(order);\n queuedOrders ++;\n }", "private final void \n renderIt( ) {\n \t\n \tif( this.mImageCount > 0 || this.mLineCount > 0 || this.mRectCount > 0 || this.mTriangleCount > 0 ) {\n\t \n \t\tthis.mVertexBuffer.clear(); //clearing the buffer\n\t GLES11.glEnableClientState( GLES11.GL_VERTEX_ARRAY );\n\n\t //if there are images to render\n\t if( this.mImageCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mImageCount * 16 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glEnableClientState( GLES11.GL_TEXTURE_COORD_ARRAY ); //copy the texture coordinates into the GPU\n\t\t GLES11.glEnable(GLES11.GL_TEXTURE_2D);\n\t\t this.mVertexBuffer.position( 2 ); //put buffer position to the texture coordinates\n\t\t GLES11.glTexCoordPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer );\n\t\t this.mIndexBuffer.limit(this.mImageCount * 6); //DESKTOP VERSION ONLY\n\t\t GLES11.glDrawElements( GLES11.GL_TRIANGLES, this.mImageCount * BitsGLImage.INDICES_PER_SPRITE, GLES11.GL_UNSIGNED_SHORT, this.mIndexBuffer );\n\t \tGLES11.glDisable(GLES11.GL_TEXTURE_2D);\n\t\t GLES11.glDisableClientState( GLES11.GL_TEXTURE_COORD_ARRAY );\n\t }\n\t \n\t //if there are lines to render\n\t if( this.mLineCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mLineCount * 4 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 0, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glDrawArrays( GLES11.GL_LINES, 0, this.mLineCount * 2 ); //* 2 because every line got 2 points\n\t }\n\n\t //if there are rects to render\n\t if( this.mRectCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mRectCount * 8 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t this.mIndexBuffer.limit(this.mRectCount * 6); //DESKTOP VERSION ONLY\n\t \t GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, this.mVertexBuffer); //copy the vertices into the GPU\t \t \n\t \t \tGLES11.glDrawElements( GLES11.GL_TRIANGLES, this.mRectCount * BitsGLImage.INDICES_PER_SPRITE, GLES11.GL_UNSIGNED_SHORT, this.mIndexBuffer );\n\t }\n\t \n\t //if there are triangles to render\n\t if( this.mTriangleCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mTriangleCount * 12 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glEnableClientState( GLES11.GL_TEXTURE_COORD_ARRAY ); //copy the texture coordinates into the GPU\n\t\t GLES11.glEnable(GLES11.GL_TEXTURE_2D);\n\t\t this.mVertexBuffer.position( 2 ); //put buffer position to the texture coordinates\n\t\t GLES11.glTexCoordPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //16 == byteoffset -> es liegen 2 werte dazwischen\n\t\t GLES11.glDrawArrays( GLES11.GL_TRIANGLES, 0, this.mTriangleCount * 3 ); //* 2 because every line got 2 points\t \t\n\t\t GLES11.glDisable(GLES11.GL_TEXTURE_2D);\n\t\t GLES11.glDisableClientState( GLES11.GL_TEXTURE_COORD_ARRAY );\n\t }\n\t \n\t GLES11.glDisableClientState( GLES11.GL_VERTEX_ARRAY );\n \t\t\n\t //resetting counters\n\t this.mBufferIndex = 0;\n\t \tthis.mImageCount = 0;\n\t \tthis.mLineCount = 0;\n\t \tthis.mRectCount = 0;\n\t \tthis.mTriangleCount = 0;\n \t}\n }", "public void draw(Polygon poly, float x, float y, float width, float height) {\n draw(poly, x, y, width, height, x, y, 0, 1, 1, 1, 1);\n }", "@Override\n public void draw(GL2 gl) {\n gl.glPushMatrix();\n float[] translate = GLScene.P(translateX, translateY);\n gl.glTranslatef(translate[0], translate[1], translate[2]);\n gl.glScalef(scaleX, scaleY, scaleZ);\n gl.glRotated(rotation * 180 / Math.PI, 0, 0, 1);\n gl.glBegin(GL2.GL_LINE_STRIP);\n GLPanel.V(gl, controlPoints[1].x, controlPoints[1].y);\n GLPanel.V(gl, controlPoints[0].x, controlPoints[0].y);\n GLPanel.V(gl, controlPoints[2].x, controlPoints[2].y);\n gl.glEnd();\n gl.glPopMatrix();\n }", "public QuadMesh\n (boolean isBeingSplit,\n Matrix4f cubeMatrix, \n\t\tVector3f color,\n\t\tboolean inAtmosphere, \n\t\tVector3f meshOffset, \n\t\tboolean inFrustum, \n\t\tfloat arcLengthOverSize, \n\t\tVector3f center, \n\t\tfloat intensity, \n\t\tTexture2D Heightmap, \n\t\tString f ,\n\t\tQuadMesh p, \n\t\tVector3f v1, \n\t\tVector3f v2, \n\t\tVector3f v3, \n\t\tVector3f v4,\n\t\tfloat size,\n\t\tint x, \n\t\tint y, \n\t\tboolean hasChildren, \n\t\tArrayList<QuadMesh> children, \n\t\tBoundingSphere sphere, \n\t\tGeometry mesh, \n\t\tVector3f faceIndex, \n\t\tfloat centerOff,\n\t\tGeometry bsp)\t\n{\n\t\tfirst = v1;\n\t\tsecond = v2;\n\t\tthird = v3;\n\t\tfourth = v4;\n\t\twidth = size;\n\t\tindex1 = x;\n\t\tindex2 = y;\n\t\tthis.hasChildren = hasChildren;\n\t\tthis.children = children;\n\t\tparent = p;\n\t\tface = f;\n\t\tthis.sphere = sphere;\n\t\tthis.mesh = mesh;\n\t\tthis.faceIndex = faceIndex;\n\t\tthis.centerOff = centerOff;\n\t\tthis.Heightmap = Heightmap;\n\t\tthis.intensity = intensity;\n\t\tthis.arcLengthOverSize = arcLengthOverSize;\n\t\tthis.center = center;\n\t\tthis.inFrustum = inFrustum;\n\t\tthis.meshOffset = meshOffset;\n\t\tthis.inAtmosphere = inAtmosphere;\n\t\tthis.color = color;\n\t\tthis.cubeMatrix = cubeMatrix;\n\t\tthis.bsp = bsp;\n\n\t\n\t}", "private void drawScreen(Sprite spr) {\n\t\tTexture tex = spr.getTexture();\n\t\t\n\t\ttex.bind();\n\t\t\n\t\tglBegin(GL_QUADS);\n\t\t{\n\t\t\tglTexCoord2f(0, tex.getHeight());\n\t\t\tglVertex2f(0, spr.getHeight());\n\t\t\tglTexCoord2f(tex.getWidth(), tex.getHeight());\n\t\t\tglVertex2f(spr.getWidth(), spr.getHeight());\n\t\t\tglTexCoord2f(tex.getWidth(), 0);\n\t\t\tglVertex2f(spr.getWidth(), 0);\n\t\t\tglTexCoord2f(0, 0);\n\t\t\tglVertex2f(0, 0);\n\t\t}\n\t\tglEnd();\n\t}", "public void draw(){\n textAlign(CENTER);\n route.update(pp, qq);\n SoundSys();\n fill(0xff31F0FF, 127);\n noStroke();\n ellipse(mouseX, mouseY, 30, 30);\n}", "public void display(GLAutoDrawable drawable) {\t\n\t\n\tSystem.out.println(times++);\n\n\t\n\tfbo.attach(gl);\n\t\n\t\tclear(gl);\n\t\t\n\t\tgl.glColor4f(1.f, 1.f, 1.f, 1f);\n\t\tgl.glBegin(GL2.GL_QUADS);\n\t\t{\n\t\t gl.glVertex3f(0.0f, 0.0f, 1.0f);\n\t\t gl.glVertex3f(0.0f, 1.0f, 1.0f);\n\t\t gl.glVertex3f(1.0f, 1.0f, 1.0f);\n\t\t gl.glVertex3f(1.0f, 0.0f, 1.0f);\n\t\t}\n\t\tgl.glEnd();\n\t\t\n\t\tgl.glColor4f(1.f, 0.f, 0.f, 1f);\n\t\tgl.glBegin(GL2.GL_TRIANGLES);\n\t\t{\n\t\t gl.glVertex3f(0.0f, 0.0f, 1.0f);\n\t\t gl.glVertex3f(0.0f, 1.0f, 1.0f);\n\t\t gl.glVertex3f(1.0f, 1.0f, 1.0f);\n\t\t}\n\t\tgl.glEnd();\n\tfbo.detach(gl);\n\n \n\tclear(gl);\n\n \n gl.glColor4f(1.f, 1.f, 1.f, 1f);\n fbo.bind(gl);\n\t gl.glBegin(GL2.GL_QUADS);\n\t {\n\t gl.glTexCoord2f(0.0f, 0.0f);\n\t \tgl.glVertex3f(0.0f, 1.0f, 1.0f);\n\t gl.glTexCoord2f(1.0f, 0.0f);\n\t \tgl.glVertex3f(1.0f, 1.0f, 1.0f);\n\t gl.glTexCoord2f(1.0f, 1.0f);\n\t \tgl.glVertex3f(1.0f, 0.0f, 1.0f);\n\t gl.glTexCoord2f(0.0f, 1.0f);\n\t \tgl.glVertex3f(0.0f, 0.0f, 1.0f);\n\t }\n gl.glEnd();\n fbo.unbind(gl);\n}", "@Override\n\tpublic void display(GLAutoDrawable glDrawable) {\n\t\tGL2 gl = glDrawable.getGL().getGL2();\n\n\t\t// turn on/off multi-sampling\n\t\tgl.glEnable(GL.GL_MULTISAMPLE);\n\t\t\n\t\t// turn on/off vertical sync\n\t\tgl.setSwapInterval(1);\n\t\t\n\t\t// clear the screen\n\t\tgl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);\n\t\t// switch to the model view matrix\n\t\tgl.glMatrixMode(GL2.GL_MODELVIEW);\n\t\t// initialize the matrix (0,0) is in the center of the window\n\t\tgl.glLoadIdentity();\n\n\t\t// render the scene\n\t\tthis.render(gl);\n\t\tthis.update();\n\t}", "void add(int vertex);", "public void draw(int displayListId) {\n\t\tif (!loaded)\n\t\t\tpreload();\n\n\t\ttexture.bind();\n\t\tGL11.glCallList(displayListId);\n\t}", "@Override\n\tpublic void onDrawFrame(GL10 gl) {\n\t\tLibNative.render();\n\t}" ]
[ "0.67824733", "0.6126707", "0.6054694", "0.54966193", "0.5450226", "0.54296714", "0.53773975", "0.5266873", "0.52446663", "0.5172934", "0.5168416", "0.51650935", "0.51399827", "0.51297873", "0.51207966", "0.5117103", "0.5086103", "0.5069959", "0.5061255", "0.5013598", "0.5010217", "0.49970433", "0.49915507", "0.49721035", "0.4965127", "0.49606168", "0.4960488", "0.49320787", "0.49214375", "0.49027", "0.48832127", "0.48816076", "0.48753563", "0.4872393", "0.48714453", "0.4870568", "0.48643845", "0.48581535", "0.4847069", "0.48321083", "0.48169622", "0.4806692", "0.47914633", "0.47877735", "0.4782264", "0.4772353", "0.4770294", "0.476976", "0.47618663", "0.4745093", "0.4744259", "0.47408417", "0.47372824", "0.4727357", "0.47250438", "0.47190684", "0.47159597", "0.47039208", "0.47027177", "0.46806982", "0.46753737", "0.4672202", "0.4671553", "0.46659642", "0.46650162", "0.46635988", "0.4659574", "0.46589553", "0.46569598", "0.46534553", "0.46477062", "0.46472564", "0.46414748", "0.46412894", "0.46402648", "0.46359217", "0.46221462", "0.46208912", "0.46146646", "0.46047103", "0.46002817", "0.45783445", "0.45782954", "0.4575338", "0.45725584", "0.45668563", "0.45637852", "0.45607948", "0.45517895", "0.45473862", "0.45471746", "0.45444837", "0.45364648", "0.45329154", "0.45310593", "0.45273605", "0.4526762", "0.45260683", "0.45179197", "0.4516249", "0.45099634" ]
0.0
-1
This method implements mapping for registering checked URL. It converts POST request body JSON content to
@RequestMapping(value = "registerurl", method = RequestMethod.POST) @ResponseBody @ResponseStatus(HttpStatus.OK) public void registerUrl(@RequestBody RegisterUrlMsg msg, @RequestHeader("apikey") String token) { System.out.println("url:"); System.out.println(msg.getUrl()); System.out.println("freq:"); System.out.println(msg.getFreq()); System.out.println("expCode:"); System.out.println(msg.getExpCode()); System.out.println("expString:"); System.out.println(msg.getExpString()); System.out.println("token:"); System.out.println(token); // check whether token is permitted authService.checkCredentials(token); // add URL to the database urlChecker.addUrl(msg.getUrl(), msg.getFreq(), msg.getExpCode(), msg.getExpString()); // start checking URL urlChecker.checkUrl(msg.getUrl(), msg.getFreq(), msg.getExpCode(), msg.getExpString(), token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "public void processUrl() {\n try {\n\n JsonNode rootNode = getJsonRootNode(getJsonFromURL()); // todo: pass url in this method (to support multi-urls)\n getValuesFromJsonNodes(rootNode);\n setAndFormatValues();\n\n } catch (Exception e) {\n System.out.println(\"ERROR: caught error in processUrl()\");\n e.printStackTrace();\n }\n }", "public interface ShortUrlApi {\n\n @POST(\"shorturl\")\n @Converter(ShortUrlConverter.class)\n Call<String> shortUrl(@Body String longUrl,@Query(\"access_token\")String accessToken);\n\n class ShortUrlConverter extends JacksonConverter<String,String> {\n @Override\n public byte[] request(ObjectMapper mapper, Type type, String longUrl) throws IOException {\n return String.format(\"{\\\"action\\\":\\\"long2short\\\",\\\"long_url”:”%s”}\",longUrl).getBytes(CHARSET_UTF8);\n }\n\n @Override\n public String response(ObjectMapper mapper, Type type, byte[] response) throws IOException {\n JsonNode jsonNode = mapper.readTree(response);\n return jsonNode.path(\"short_url\").asText();\n }\n }\n}", "@Override\n public String handleRoute(String requestBody) {\n Gson gson = new Gson();\n Wrap sessionWrap = null;\n try {\n sessionWrap = gson.fromJson(requestBody, Wrap.class);\n } catch (JsonSyntaxException e) {\n logger.log(Level.WARNING, \"Failed to unwrap Json wrapper\", e);\n }\n Expression expression = sessionWrap.getExpression();\n // Extract protocol from expression\n String protocol = expression.getProtocol();\n // Forward to correct protocol application\n String protocolServicePath = \"NotSet\";\n if (protocolMap.containsKey(protocol)) {\n protocolServicePath = protocolMap.get(protocol);\n logger.log(Level.INFO, \"Sending packet to a protocol service..\");\n return transmissionHandler.handleTransmission(sessionWrap, protocolServicePath);\n } else {// Else inform service is down\n logger.log(Level.WARNING, \"Protocolservice: \" + protocol\n + \" not found, either it is down, or the service reference is wrong.\");\n }\n return protocolServicePath; // returns string NotSet\n }", "private Map<String, String> processPostRequest(String content) {\n Map<String, String> store = new HashMap<String, String>();\n\n // Split the post data by &\n for (String entry : content.split(\"&\")) {\n // Split it by =\n String[] data = entry.split(\"=\");\n\n // Check that there is sufficient data in the data array\n if (data.length != 2) {\n continue;\n }\n\n // decode the data\n String key = URLUtils.decode(data[0]);\n String value = URLUtils.decode(data[1]);\n\n // Add it to the store\n store.put(key, value);\n }\n\n return store;\n }", "@FormUrlEncoded\n// @Headers(\"Oakey:ipv4api22344\")\n @Headers(\"Appkey:N8e1WhJ42OmkYJStLX4TEvzk0EblN38W\")\n @POST(Urls.REGISTRATION)\n Single<ResponseBody> register(@FieldMap HashMap<String, String> params);", "public interface ApiService {\n\n @FormUrlEncoded\n @Headers(\"X-Requested-With: XMLHttpRequest\")\n @POST(\"Dealer_userLogin\")\n Call<LoginBean> login(@Field(\"username\") String userName, @Field(\"password\") String psw);\n\n\n @POST(\"D{ealer_estateLis}t\")\n Call<NewListBean> newList(@Path(\"ealer_estateLis\") String replaceableUrl);\n\n @FormUrlEncoded\n @Headers(\"X-Requested-With: XMLHttpRequest\")\n @POST(\"Dealer_estateDetail\")\n Call<SecondHandListBean> getSecondList(@Field(\"project_key\") String key);\n\n}", "@Override\r\n /**\r\n * Recieves the request from the client, calls the register service, and returns the result\r\n */\r\n public void handle(HttpExchange exchange) throws IOException {\n InputStreamReader reader = new InputStreamReader(exchange.getRequestBody());\r\n try {\r\n request = gson.fromJson(reader,RegisterRequest.class);\r\n if(validate(request)) {\r\n service = new RegisterService(request);\r\n result = service.register();\r\n }\r\n else {\r\n result = new ErrorResult(\"ERROR: Invalid Request body. Please check documentation for correct request body parameters\");\r\n }\r\n }\r\n catch(IllegalArgumentException e) {\r\n result = new ErrorResult(\"ERROR: Invalid request body. Please check documentation for correct request body parematers.\");\r\n }\r\n finally {\r\n PrintWriter out = new PrintWriter(exchange.getResponseBody());\r\n if(result.getMessage() == null) {\r\n //send as RegisterResult object\r\n LoginRegisterResult newResult = (LoginRegisterResult) result;\r\n json = gson.toJson(newResult);\r\n }\r\n else {\r\n json = gson.toJson(result);\r\n }\r\n exchange.sendResponseHeaders(HTTP_OK, 0);\r\n out.print(json);\r\n out.close();\r\n exchange.getResponseBody().flush();\r\n exchange.getResponseBody().close();\r\n }\r\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "@Override\r\n\tprotected void validateData(ActionMapping arg0, HttpServletRequest arg1) {\n\t\t\r\n\t}", "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (URISyntaxException ex) {\r\n Logger.getLogger(Residencia.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n// trying to make the big deal post insertable but didn't worked out because of the parsing in java\n public String addVote(String body) {\n return \"test\";\n }", "public interface UserService {\r\n @FormUrlEncoded\r\n @POST(\"user/login\")\r\n Observable<Response<Json<User>>> login(@FieldMap Map<String,String> map);\r\n\r\n @FormUrlEncoded\r\n @POST(\"user/QRCode\")\r\n Observable<Response<Json>> getVerificationCode(@FieldMap Map<String,String> map);\r\n\r\n @FormUrlEncoded\r\n @POST(\"user/register\")\r\n Observable<Response<Json<User>>> signUp(@FieldMap Map<String,String> map);\r\n}", "private void setupRoutes() {\n\t\tpost(\"/messages\", (req, res) -> {\n\n\t\t\ttry {\n\t\t\t\tMessage newMessage = mapper.readValue(req.body(), Message.class);\n\t\t\t\t// Message newMessage = gson.fromJson(req.body(),\n\t\t\t\t// Message.class);\n\t\t\t\tif (!newMessage.isValid()) {\n\t\t\t\t\tres.status(HTTP_BAD_REQUEST);\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t\tservice.messagePost(newMessage);\n\t\t\t\tres.status(HTTP_OK_REQUEST);\n\t\t\t\treturn res;\n\t\t\t} catch (Exception e) {\n\t\t\t\tres.status(HTTP_BAD_REQUEST);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * \n\t\t */\n\t\tget(\"/messages/syntesis\", (request, response) -> {\n\t\t\treturn new Synthesis(1, 12l, 12l, 12L);\n\t\t} , new JsonTransformer());\n\n\t}", "public interface Links {\r\n\r\n /**\r\n * 上传图片\r\n *\r\n * @param parts\r\n * @return\r\n */\r\n @Multipart\r\n @POST(\"user/login\")\r\n Call<ResponseBody> userLogin(@Part List<MultipartBody.Part> parts);\r\n\r\n /**\r\n * 添加技术\r\n *\r\n * @param userInfoId\r\n * @param userSkillId\r\n * @param skillTypeId\r\n * @return\r\n */\r\n @POST(\"/yetdwell/skill/addSkill.do\")\r\n Call<ResponseBody> addSkill(@Query(\"userInfoId\") int userInfoId,\r\n @Query(\"userSkillId\") int userSkillId,\r\n @Query(\"skillTypeId\") int skillTypeId);\r\n\r\n}", "@Override\n @JsonIgnore\n public void validateRequest(Map<String, Object> map) throws EntityError {\n }", "public interface PostRequest {}", "@Override\n public void ParseRequestBean() {\n\n }", "public void catalogProductWebsiteLinkRepositoryV1SavePost (String sku, Body2 body, final Response.Listener<Boolean> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n \n // verify the required parameter 'sku' is set\n if (sku == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'sku' when calling catalogProductWebsiteLinkRepositoryV1SavePost\",\n new ApiException(400, \"Missing the required parameter 'sku' when calling catalogProductWebsiteLinkRepositoryV1SavePost\"));\n }\n \n\n // create path and map variables\n String path = \"/v1/products/{sku}/websites\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"sku\" + \"\\\\}\", apiInvoker.escapeString(sku.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"POST\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((Boolean) ApiInvoker.deserialize(localVarResponse, \"\", Boolean.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }", "public interface BaseRequstBody {\n\n @GET(\"/product/getCarts\")\n Observable<HomeBean> requstAllData();\n\n\n @POST(\"product/updateCarts/\")\n @FormUrlEncoded\n Observable<HomeBean> UpDataData(@FieldMap HashMap<String,String> parms);\n\n\n}", "public interface RestApi {\n @POST(\"{url}\")\n Call<BaseResponseEntity<LoginEntity>> login(\n @Path(value = \"url\", encoded = true) String psUrl, @Body LoginEntity poBody);\n}", "public interface AsyncHttpLink{\n// @FormUrlEncoded\n// @POST(\"{url}\")\n// Call<ResponseBody> request(@Path(value = \"url\", encoded = true) String url, @FieldMap Map<String, String> params);\n\n @FormUrlEncoded\n @POST\n Call<ResponseBody> request(@Url String url, @FieldMap Map<String, String> params);\n\n @FormUrlEncoded\n @Headers(\"Authorization: basic dGFjY2lzdW06YWJjZGU=\")\n @POST\n Call<ResponseBody> login(@Url String url, @FieldMap Map<String, String> params);\n}", "public Map<String, Object> uriToValueMap();", "public interface Find_myHttpUtiles {\n @FormUrlEncoded\n @POST(\"home/nearest\")\n Call<Bean3> gethttp(@FieldMap Map<String, String> m);\n\n}", "@Override\n public JSONObject postToWalletServer(String urlSegment, String body) {\n HttpHeaders header = constructHttpHeaders();\n // Construct the http URL.\n String baseUrl = ConfigUtil.instants().getValue(\"walletServerBaseUrl\");\n String walletServerUrl = baseUrl + urlSegment;\n\n // Send the http request and get response.\n HttpEntity<JSONObject> entity = new HttpEntity<>(JSONObject.parseObject(body), header);\n ResponseEntity<JSONObject> exchange =\n REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.POST, entity, JSONObject.class);\n\n // Return the posted model or instance or NFC card personalized data.\n return exchange.getBody();\n }", "@PostMapping(\"/add\")\n public Result addUrl(@RequestBody CreateLinkRequest request){\n return this.urlMapService.addUrlIntoUser(request.getUserId(), request.getToLink());\n }", "public void handleRequest(Request req) {\n\n }", "public abstract RequestMappingInfo build();", "@Test\n void incorrectPostPathTest() {\n URI uri = URI.create(endBody + \"/dummy\");\n\n // create a dummy body for easy JSON conversion\n QuestionText newQuestion = new QuestionText(\"Test\");\n\n // convert to json and send / store the response\n HttpResponse<String> response = HttpMethods.post(uri, gson.toJson(newQuestion));\n\n // it should receive 404\n assertNotEquals(200, response.statusCode());\n assertEquals(404, response.statusCode());\n }", "public interface RegisterService {\n @POST(\"register.php\")\n Call<RegisterResponse>getRegisterResponse(@Body RegisterForm registerForm);\n}", "void shouldParseTheJsonPostData() {\n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "@Override\n public void fromWXRegister(Map<String, Object> data, String token, final IBaseModel.OnCallbackListener listener) {\n RequestBody body = RequestBody.create(MediaType.parse(\"application/json;charset=UTF-8\"),\n GsonUtils.parseToJson(data));\n final Request request = new Request.Builder()\n .url(\"URL\")\n .header(\"Authorization\", token)\n .post(body)//默认就是GET请求,可以不写\n .build();\n HttpProvider.getOkHttpClient().newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n Log.d(\"onFailure: \", e.getMessage());\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n if (response.isSuccessful()) {\n delayedExecuteCallback(response.body().string(), new TypeToken<ResponseEntity<UserInfoEntity>>() {\n }.getType(), listener);\n } else {\n delayedExecuteCallback(null, new TypeToken<ResponseEntity<UserInfoEntity>>() {\n }.getType(), listener);\n }\n }\n });\n\n /* HttpProvider.doPost(URL, data, new HttpProvider.ResponseCallback() {\n @Override\n public void callback(String responseText) {\n delayedExecuteCallback(responseText, new TypeToken<ResponseEntity<UserInfoEntity>>() {\n }.getType(), listener);\n }\n });*/\n }", "@Override\n public String getBodyContentType() {\n return \"application/x-www-form-urlencoded; charset=UTF-8\";\n }", "public interface BeforeHandler {\n void execute(Map<String, Object> body,HttpServletRequest request) throws Exception;\n}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (URISyntaxException ex) {\r\n Logger.getLogger(AsignarEstudiantes.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@JsonPost\n @RequestMapping(mapping = \"/new-connection-application\", requestMethod = RequestMethod.POST)\n public void postCoLocationNewConnectionApplicationForm(@RequestParameter(isJsonBody = true, value = \"application\") String jsonString, LoginDTO loginDTO, HttpServletRequest request) throws Exception {\n\n JsonElement jelement = new JsonParser().parse(jsonString);\n\n JsonObject jsonObject = jelement.getAsJsonObject();\n\n CoLocationApplicationDTO coLocationApplicationDTO = new CoLocationApplicationDeserializer().deserialize_custom(jelement, loginDTO);\n coLocationApplicationDTO.setApplicationType(CoLocationConstants.NEW_CONNECTION);\n coLocationApplicationDTO.setState(CoLocationConstants.STATE.SUBMITTED.getValue());\n coLocationApplicationService.insertApplication(coLocationApplicationDTO, loginDTO);\n\n// return CoLocationConstants.CO_LOCATION_BASE_URL;\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract FullResponse onServeFormParams(Map<String, List<String>> formParams);", "@Override\n protected Map<String,String> getParams(){\n return postParameters;\n }", "@Override\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tString request = exchange.getRequestText();\n\t\t\n\t\t// converte JSON recebido em objeto\n\t\tActuator actuatorLED = gson.fromJson(request, Actuator.class);\n\n\t\t// seta os valores\n\t\tString temperatureLEDState = actuatorLED.getSenseLED().getTemperatureLed().getState();\n\t\tString humidityLedState = actuatorLED.getSenseLED().getHumidityLed().getState();\n\t\tthis.ledResource.update(temperatureLEDState, humidityLedState);\n\n\t\t// notifica que o recurso foi modificado\n\t\tthis.changed();\n\n\t\t// retorna mensagem de sucesso\n\t\tString response = getName() + \" has been successful configured\";\n\t\texchange.respond(ResponseCode.CONTENT, \"{ message: \" + response + \" }\", MediaTypeRegistry.TEXT_PLAIN);\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n protected final void parseRequest(final HttpServletRequest request, HttpServletResponse response) {\n\n parsePath(request);\n\n LOGGER.warning(\"[REST]: \" + request.getMethod() + \"|\" + apiName + \"/\" + resourceName + \"|\" + request.getHeader(\"Current-Page\"));\n\n // Fixes BS-400. This is ugly.\n I18n.getInstance();\n\n api = APIs.get(apiName, resourceName);\n api.setCaller(this);\n\n super.parseRequest(request, response);\n\n }", "Registry getRequestRegistry();", "private boolean sendRequest(Map<?, ?> msbRegistionBodyMap) \n {\n LOGGER.info(\"Start registering to microservice bus\");\n String rawData = JsonUtil.toJson(msbRegistionBodyMap); \n MsbDetails oMsbDetails = MsbDetailsHolder.getMsbDetails();\n if(null == oMsbDetails) {\n LOGGER.info(\"MSB Details is NULL , Registration Failed !!!\");\n return false;\n } \n RestResponse oResponse = RestfulClient.sendPostRequest(oMsbDetails.getDefaultServer().getHost(),\n oMsbDetails.getDefaultServer().getPort(),\n MSB_REGISTION_URL, rawData);\n \n if(null == oResponse){\n LOGGER.info(\"Null Unregister Response for \" + MSB_REGISTION_URL);\n return false;\n } \n LOGGER.info(\"Response Code Received for MBS Registration:\" + oResponse.getStatusCode()); \n return isSuccess(oResponse.getStatusCode()) ? true : false;\n }", "public RequestUrlHandler() {\n // requestService = SpringContextHolder.getBean(ScfRequestService.class);\n }", "void handleRequest();", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "public void postRequestPrepare(Request<?> request);", "public interface ApiInterface {\n\n // POST queries\n\n @FormUrlEncoded\n @POST(\"login\")\n Call<ResponseBody> hitLoginApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"sociallogin\")\n Call<ResponseBody> hitSocialLoginApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"signup\")\n Call<ResponseBody> hitSignUpApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"forgot\")\n Call<ResponseBody> hitForgotPasswordApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"otpgenerate\")\n Call<ResponseBody> hitResendOtpApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"resetpass\")\n Call<ResponseBody> hitResetPasswordApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"changepassword\")\n Call<ResponseBody> hitChangePasswordApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"otpverify\")\n Call<ResponseBody> hitVerifyOtpApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"saveotherdetails\")\n Call<ResponseBody> hitSaveInformationApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"deals\")\n Call<ResponseBody> hitLikeDealsApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"bookmarkdeal\")\n Call<ResponseBody> hitBookmarkProductsApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"edit\")\n Call<ResponseBody> hitEditProfileDataApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"savelocation\")\n Call<ResponseBody> hitSaveAddressApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"createorder\")\n Call<ResponseBody> hitCreateOrderApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"follow\")\n Call<ResponseBody> hitBuddyFollowApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"savecategorybyuser\")\n Call<ResponseBody> hitSavePreferredCategoryApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"sharedealrequest\")\n Call<ResponseBody> hitShareDealApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"blockdeal\")\n Call<ResponseBody> hitBlockDealApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"reportdeal\")\n Call<ResponseBody> hitReportDealApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"savedeal\")\n Call<ResponseBody> hitAddDealApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"editdeal\")\n Call<ResponseBody> hitEditDealApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"updatebuddyrequest\")\n Call<ResponseBody> hitUpdateRequestApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"orderupdatebuddy\")\n Call<ResponseBody> hitUpdateOrderStatusApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"savefeedback\")\n Call<ResponseBody> hitFeedbackApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"deleteskills\")\n Call<ResponseBody> hitDeleteSkillsApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"sendemaillink\")\n Call<ResponseBody> hitResendLinkApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"acceptstatus\")\n Call<ResponseBody> hitAcceptMerchantApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"updatereadcount\")\n Call<ResponseBody> hitUpdateCountApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"generatechecksum\")\n Call<ResponseBody> hitGenerateChecksumApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"paybuddydue\")\n Call<ResponseBody> hitPayBuddyDueApi(@FieldMap HashMap<String, String> map);\n\n @FormUrlEncoded\n @POST(\"checkversion\")\n Call<ResponseBody> hitCheckVersionApi(@FieldMap HashMap<String, String> map);\n\n\n\n // Put queries\n\n @FormUrlEncoded\n @PUT(\"logout\")\n Call<ResponseBody> hitLogoutApi(@FieldMap HashMap<String, String> map);\n\n\n\n // GET queries\n\n @GET(\"banner\")\n Call<ResponseBody> hitLauncherHomeApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"categories\")\n Call<ResponseBody> hitCategoriesListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"deals\")\n Call<ResponseBody> hitProductsDealsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"deals\")\n Call<ResponseBody> hitProductServiceDetailsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"Myprofile\")\n Call<ResponseBody> hitProfileDataApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getlocation\")\n Call<ResponseBody> hitGetAddressesApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getshopperbuddy\")\n Call<ResponseBody> hitBuddyListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getschedulebuddy\")\n Call<ResponseBody> hitBuddyScheduleApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getbuddyorder\")\n Call<ResponseBody> hitOrdersListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getstore\")\n Call<ResponseBody> hitStoreListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getbuddydetail\")\n Call<ResponseBody> hitBuddyDetailsListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getdealbuddy\")\n Call<ResponseBody> hitBuddyDealsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"searches\")\n Call<ResponseBody> hitSearchListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"categories\")\n Call<ResponseBody> hitGetPreferredCategoryListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"subcategory\")\n Call<ResponseBody> hitGetSubCategoryListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getratereview\")\n Call<ResponseBody> hitGetRatingAndReviewApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getbuddyearning\")\n Call<ResponseBody> hitBuddyEarningApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getbuddylastearning\")\n Call<ResponseBody> hitBuddyLastEarningApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getearninglist\")\n Call<ResponseBody> hitBuddyEarningListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getdealbuddy\")\n Call<ResponseBody> hitPostByMeApi(@QueryMap HashMap<String,String> map);\n\n @GET(\"getbuddyrequest\")\n Call<ResponseBody> hitgetRequestApi(@QueryMap HashMap<String,String> map);\n\n @GET(\"getuserfans\")\n Call<ResponseBody> hitGetMyFansApi(@QueryMap HashMap<String,String> map);\n\n @GET(\"getusernotification\")\n Call<ResponseBody> hitGetNotificationListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"clearsearch\")\n Call<ResponseBody> hitClearListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getdistance\")\n Call<ResponseBody> hitGetRangeApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"chekuseremail\")\n Call<ResponseBody> hitEmailValidateApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getblockdeals\")\n Call<ResponseBody> hitBlockDealsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getorderdetail\")\n Call<ResponseBody> hitOrderDetailsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getrequestdetail\")\n Call<ResponseBody> hitRequestDetailsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"gethuntdetail\")\n Call<ResponseBody> hitHuntDetailsApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"permanentbuddyrequest\")\n Call<ResponseBody> hitMerchantListApi(@QueryMap HashMap<String, String> map);\n\n @GET(\"getnotificationcount\")\n Call<ResponseBody> hitGetUnreadCountApi(@QueryMap HashMap<String, String> map);\n\n\n}", "void onInterceptRequest(String url, String requestBody, String responseBody);", "public Object register(HttpServletRequest req);", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"name\", name);\n\n\n Log.e(TAG, \"Posting params: \" + params.toString());\n\n return params;\n }", "@Override\n public String performGet(HttpServletRequest request) {\n return performPost(request);\n }", "public void postRequest() {\n apiUtil = new APIUtil();\n // As this is an API call , we are not setting up any base url but defining the individual calls\n apiUtil.setBaseURI(configurationReader.get(\"BaseURL\"));\n //This is used to validate the get call protected with basic authentication mechanism\n basicAuthValidation();\n scenario.write(\"Request body parameters are :-\");\n SamplePOJO samplePOJO = new SamplePOJO();\n samplePOJO.setFirstName(scenarioContext.getContext(\"firstName\"));\n samplePOJO.setLastName(scenarioContext.getContext(\"lastName\"));\n\n ObjectMapper objectMapper = new ObjectMapper();\n try {\n apiUtil.setRequestBody(objectMapper.writeValueAsString(samplePOJO));\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(req.getInputStream()));\n\n String json = \"\";\n if(br != null){\n json = br.readLine();\n System.out.println(json);\n }\n\n // 2. initiate jackson mapper\n ObjectMapper mapper = new ObjectMapper();\n\n // 3. Convert received JSON to Article\n Product product = mapper.readValue(json, Product.class);\n\n // 4. Set response type to JSON\n resp.setContentType(\"application/json\");\n\n ProductService productService = new ProductService();\n productService.addProduct(product);\n\n String productsJsonString = this.gson.toJson(productService.getAllProducts());\n PrintWriter out = resp.getWriter();\n resp.setContentType(\"application/json\");\n resp.setCharacterEncoding(\"UTF-8\");\n out.print(productsJsonString);\n out.flush();\n\n }", "public abstract String toURLParam();", "@RequestMapping(value = \"/greeting\", method = POST)\n\npublic ResponseEntity<?> addName(@RequestBody String name) {\n\ngreetingObj.addName(name);\n\n// Because there is no validation, we can return that the request succeeded.\n\nreturn new ResponseEntity<>(HttpStatus.OK);\n\n}", "@Override\n\tpublic ResponseEntity<Object> generateMessage(Map<String, Object> processedRequest, String url) \n\t{\n\t\tJSONObject response = new JSONObject();\n\n\t\tresponse = new JSONObject();\n\t\tresponse.put(\"FName\", \"FirtName\");\n\t\tresponse.put(\"LName\", \"Second Nmae\");\n\n\t\tResponseEntity<Object> validationResponse = new ResponseEntity<Object>(response, HttpStatus.OK);\n\t\treturn validationResponse;\n\t}", "private void handleRequestOnPost(String result) {\n ConnectionsFragment frag = (ConnectionsFragment) getSupportFragmentManager()\n .findFragmentByTag(getString(R.string.keys_fragment_connections));\n\n try {\n JSONObject resultsJSON = new JSONObject(result);\n boolean success = resultsJSON.getBoolean(\"success\");\n String username = resultsJSON.getString(\"username\");\n boolean accept = resultsJSON.getBoolean(\"accept\");\n if (success) {\n frag.handleRequestOnPost(success, username, accept);\n } else {\n Toast.makeText(this, \"Your action for contact request was not valid\",\n Toast.LENGTH_SHORT).show();\n }\n\n } catch (JSONException e) {\n frag.setError(\"Something strange happened\");\n frag.handleOnError(e.toString());\n }\n }", "@Handle(method = HttpMethod.POST, path = \"/body\")\n void post(@Handle.Body String one, @Handle.Body String two, @Handle.Body String three);", "public String post();", "@RequestMapping(value = \"/shopressource\", method = RequestMethod.POST)\n String addShopRessource(@RequestBody ShopRessource shopRessource);", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n }", "@Override\n public void doPost(HttpServletRequest request, HttpServletResponse response) {\n String handler = MapReduceServlet.getHandler(request);\n if (handler.startsWith(CONTROLLER_PATH)) {\n if (!checkForTaskQueue(request, response)) {\n return;\n }\n handleController(request, response);\n } else if (handler.startsWith(MAPPER_WORKER_PATH)) {\n if (!checkForTaskQueue(request, response)) {\n return;\n }\n handleMapperWorker(request, response);\n } else if (handler.startsWith(START_PATH)) {\n // We don't add a GET handler for this one, since we're expecting the user \n // to POST the whole XML specification.\n // TODO(frew): Make name customizable.\n // TODO(frew): Add ability to specify a redirect.\n handleStart(\n ConfigurationXmlUtil.getConfigurationFromXml(request.getParameter(\"configuration\")),\n \"Automatically run request\", request);\n } else if (handler.startsWith(COMMAND_PATH)) {\n if (!checkForAjax(request, response)) {\n return;\n }\n handleCommand(handler.substring(COMMAND_PATH.length() + 1), request, response);\n } else {\n throw new RuntimeException(\n \"Received an unknown MapReduce request handler. See logs for more detail.\");\n }\n }", "public interface AppApi {\n\n @POST(\"/login/auto/{phone}\")\n Observable<BaseResponse> checkLogin(@Path(\"phone\") String phone);\n}", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "public interface IUser {\n @POST(\"check\")\n Call<login> loginUser(@Body HashMap<String, Object> paramHashMap);\n\n @POST(\"register\")\n Call<register> registerUser(@Body HashMap<String, Object> paramHashMap);\n}", "public interface EasyService {\r\n @GET(\"{path}\")\r\n Observable<ResponseBody> get(\r\n @Path(value = \"path\", encoded = true) String path,\r\n @QueryMap() Map<String, Object> map\r\n );\r\n\r\n @FormUrlEncoded\r\n @POST(\"{path}\")\r\n Observable<ResponseBody> post(\r\n @Path(value = \"path\", encoded = true) String path,\r\n @FieldMap() Map<String, Object> map\r\n );\r\n\r\n @POST(\"{path}\")\r\n Observable<ResponseBody> postJson(\r\n @Path(value = \"path\", encoded = true) String path,\r\n @Body RequestBody body\r\n );\r\n\r\n @Multipart\r\n @POST\r\n Observable<ResponseBody> uploadFile(\r\n @Url String url,\r\n @PartMap() Map<String, String> description,\r\n @Part List<MultipartBody.Part> bodys);\r\n\r\n}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.POST)\n public void post(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tInteger method = Integer.parseInt(req.getParameter(\"method\"));\n\t\tLocaleMissionManager locmissMgr = new LocaleMissionManager();\n\t\tLocaleApplianceItemManager locAppItemMgr = new LocaleApplianceItemManager();\n\t\t\n\t\tswitch (method) {\n\t\tcase 1: // 添加现场任务委托单\n\t\t\tJSONObject retObj = new JSONObject();\n\t\t\ttry{\n\t\t\t\tString Name = req.getParameter(\"Name\").trim();\n\t\t\t\tint CustomerId = Integer.parseInt(req.getParameter(\"CustomerId\").trim());\n\t\t\t\tString ZipCode = req.getParameter(\"ZipCode\");\n\t\t\t\tString Department = req.getParameter(\"Department\");\n\t\t\t\tString Address = req.getParameter(\"Address\");\n\t\t\t\tString Tel = req.getParameter(\"Tel\");\n\t\t\t\tString ContactorTel = req.getParameter(\"ContactorTel\");\n\t\t\t\tString TentativeDate = req.getParameter(\"TentativeDate\");\n\t\t\t\t//String MissionDesc = req.getParameter(\"MissionDesc\").trim();\t//检测项目及台件数\n\t\t\t\t//String Staffs = req.getParameter(\"Staffs\").trim();\n\t\t\t\tString SiteManagerId = req.getParameter(\"SiteManagerId\");\n\t\t\t\tString Contactor = req.getParameter(\"Contactor\");\n\t\t\t\tString RegionId = req.getParameter(\"RegionId\");\n\t\t\t\tString Remark = req.getParameter(\"Remark\");\n\t\t\t\tString Appliances = req.getParameter(\"Appliances\").trim();\t//检验的器具\n\t\t\t\tJSONArray appliancesArray = new JSONArray(Appliances);\t//检查的器具\n\t\t\t\t\n\t\t\t\tString HeadNameId = req.getParameter(\"HeadName\");\n\t\t\t\tif(HeadNameId==null||HeadNameId.length()==0){\n\t\t\t\t\tthrow new Exception(\"抬头名称不能为空!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\tAddressManager addrMgr = new AddressManager();\t\t\t\n\t\t\t\tAddress HeadNameAddr = new AddressManager().findById(Integer.parseInt(HeadNameId));\t//台头名称的单位\n\t\t\t\t\n\t\t\t\t/************ 检查输入的人员信息中的用户是否存在 *******************/\n\t\t\t\t/*StringBuffer staffs = new StringBuffer(\"\");\n\t\t\t\tif(Staffs!=null&&Staffs.length()>0){\n\t\t\t\t\tStaffs = Staffs.replace(';', ';');// 分号若为全角转为半角\n\t\t\t\t\tUserManager userMgr = new UserManager();\n\t\t\t\t\tKeyValueWithOperator k1 = new KeyValueWithOperator(\"status\", 0, \"=\"); \n\t\t\t\t\tString[] staff = Staffs.split(\";+\");\n\t\t\t\t\t\n\t\t\t\t\tfor(String user : staff){\n\t\t\t\t\t\tKeyValueWithOperator k2 = new KeyValueWithOperator(\"name\", user, \"=\"); \n\t\t\t\t\t\tif(userMgr.getTotalCount(k1,k2) <= 0){\n\t\t\t\t\t\t\tthrow new Exception(String.format(\"现场检测人员 ‘%s’ 不存在或无效!\", user));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstaffs.append(user).append(\";\");\n\t\t\t\t\t}\n\t\t\t\t}*/\n\t\t\t\tTimestamp ts;\n if(TentativeDate==null||TentativeDate.length()==0){\n\t\t\t\t ts = null;\t//暂定日期\n }else{\n\t\t\t ts = new Timestamp(DateTimeFormatUtil.DateFormat.parse(TentativeDate).getTime());\t//暂定日期\n }\n String Brief = com.jlyw.util.LetterUtil.String2Alpha(Name);\n\t\t\t\t\n Customer cus=new Customer();\n \n cus.setId(CustomerId);\n\t\t\t\tLocaleMission localmission = new LocaleMission();\n\t\t\t\tlocalmission.setAddress_1(Address==null?\"\":Address);\n\t\t\t\tlocalmission.setCustomer(cus);\n\t\t\t\tlocalmission.setCustomerName(Name);\n\t\t\t\tlocalmission.setBrief(Brief);\n\t\t\t\tlocalmission.setZipCode(ZipCode==null?\"\":ZipCode);\n\t\t\t\tlocalmission.setContactor(Contactor==null?\"\":Contactor);\n\t\t\t\tlocalmission.setTel(Tel==null?\"\":Tel);\n\t\t\t\tlocalmission.setContactorTel(ContactorTel==null?\"\":ContactorTel);\n\t\t\t\t//localmission.setMissionDesc(MissionDesc);\n\t\t\t\tlocalmission.setDepartment(Department);\n\t\t\t\t//localmission.setStaffs(staffs.toString());\n\t\t\t\tlocalmission.setTentativeDate(ts);\n\t\t\t\tRegion region = new Region();\n\t\t\t\tregion.setId(Integer.parseInt(RegionId));\n\t\t\t\tlocalmission.setRegion(region);\n\t\t\t\tlocalmission.setRemark(Remark);\n\t\t\t\tlocalmission.setAddress(HeadNameAddr);\n\t\t\t\t\n\t\t\t\t/************更新委托单位信息***********/\n\t\t\t\tCustomer cus0=(new CustomerManager()).findById(CustomerId);\n\t\t\t\tif(Name!=null&&Name.length()>0){\n\t\t\t\t\tcus0.setName(Name);\n\t\t\t\t}\n\t\t\t\tif(Address!=null&&Address.length()>0){\n\t\t\t\t\tcus0.setAddress(Address);\n\t\t\t\t}\n\t\t\t\tif(Tel!=null&&Tel.length()>0){\n\t\t\t\t\tcus0.setTel(Tel);\n\t\t\t\t}\n\t\t\t\tif(ZipCode!=null&&ZipCode.length()>0){\n\t\t\t\t\tcus0.setZipCode(ZipCode);\n\t\t\t\t}\n\t\t\t\tif(!(new CustomerManager()).update(cus0)){\n\t\t\t\t\tthrow new Exception(\"更新委托单位失败!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\t/************更新委托单位联系人信息***********/\t\n\t\t\t\t Timestamp now = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\tCustomerContactorManager cusConMgr = new CustomerContactorManager();\n\t\t\t\tList<CustomerContactor> cusConList = cusConMgr.findByVarProperty(new KeyValueWithOperator(\"customerId\", CustomerId, \"=\"), new KeyValueWithOperator(\"name\", Contactor, \"=\"));\n\t\t\t\tif(cusConList != null){\n\t\t\t\t\tif(cusConList.size() > 0){\n\t\t\t\t\t\tCustomerContactor c = cusConList.get(0);\n\t\t\t\t\t\tif(ContactorTel.length() > 0){\n\t\t\t\t\t\t\tif(!ContactorTel.equalsIgnoreCase(c.getCellphone1()) && (c.getCellphone2() == null || c.getCellphone2().length() == 0)){\n\t\t\t\t\t\t\t\tc.setCellphone2(c.getCellphone1());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tc.setCellphone1(ContactorTel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc.setLastUse(now);\n\t\t\t\t\t\tc.setCount(c.getCount()+1);\n\t\t\t\t\t\tif(!cusConMgr.update(c))\n\t\t\t\t\t\t\tthrow new Exception(\"更新单位联系人失败!\");\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tCustomerContactor c = new CustomerContactor();\n\t\t\t\t\t\tc.setCustomerId(CustomerId);\n\t\t\t\t\t\tc.setName(Contactor);\n\t\t\t\t\t\tc.setCellphone1(ContactorTel);\n\t\t\t\t\t\tc.setLastUse(now);\n\t\t\t\t\t\tc.setCount(1);\n\t\t\t\t\t\tif(!cusConMgr.save(c))\n\t\t\t\t\t\t\tthrow new Exception(\"更新单位联系人失败!\");\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//生成现场任务委托书号\n\t\t\t\tString year = String.format(\"%04d\", Calendar.getInstance().get(Calendar.YEAR));\n\t\t\t\tString queryString = \"select max(model.code) from LocaleMission as model where model.code like ? and LENGTH(model.code)=10\";\n\t\t\t\tList<Object> retList = locmissMgr.findByHQL(queryString, year+\"%\");\n\t\t\t\tInteger codeBeginInt = Integer.parseInt(\"000000\");\n\t\t\t\tif(retList.size() > 0 && retList.get(0) != null){\n\t\t\t\t\tcodeBeginInt = Integer.parseInt(retList.get(0).toString().substring(4,10)) + 1;\n\t\t\t\t}\n\t\t\t\tString Code = year + String.format(\"%06d\", codeBeginInt);\n\t\t\t\tlocalmission.setCode(Code);\n\t\t\t\t\n\n\t\t\t\tSysUser newUser = new SysUser();;\n\t\t\t\tif(SiteManagerId!=null&&SiteManagerId.length()>0){\n\t\t\t\t\tnewUser.setId(Integer.parseInt(SiteManagerId));\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(newUser);\n\t\t\t\t}else{\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(null);\n\t\t\t\t}\n\t\t\t\tlocalmission.setStatus(4);// status: 1 未完成 2 已完成 3已删除 4负责人未核定 5负责人已核定\t\t\t\t\n\n\t\t\t\t\n\t\t\t\tTimestamp now0 = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\tlocalmission.setCreateTime(now0);// 创建时间为当前时间\n\t\t\t\tlocalmission.setSysUserByCreatorId((SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser));\n\t\t\t\tlocalmission.setModificatorDate(now0);// 记录时间为当前时间\n\t\t\t\tlocalmission.setSysUserByModificatorId((SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser));\n\t\t\t\t\n\t\t\t\tApplianceSpeciesManager speciesMgr = new ApplianceSpeciesManager();\t//器具分类管理Mgr\n\t\t\t\tApplianceStandardNameManager sNameMgr = new ApplianceStandardNameManager();\t//器具标准名称管理Mgr\n\t\t\t\tAppliancePopularNameManager popNameMgr = new AppliancePopularNameManager();\t//器具常用名称管理Mgr\n\t\t\t\tQualificationManager qualMgr = new QualificationManager();\t//检测人员资质管理Mgr\n\t\t\t\tApplianceManufacturerManager mafMgr = new ApplianceManufacturerManager();\t//制造厂管理Mgr\n\t\t\t\tList<LocaleApplianceItem> localeAppItemList = new ArrayList<LocaleApplianceItem>();\t//现场业务中要添加的器具\n\t\t\t\tList<SysUser> alloteeList = new ArrayList<SysUser>();\t//委托单列表对应的派定人:\n\t\t\t\tList<Integer> qualList = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/******************** 添加器具信息 ******************/\n\t\t\t\tfor(int i = 0; i < appliancesArray.length(); i++){\n\t\t\t\t\tJSONObject jsonObj = appliancesArray.getJSONObject(i);\n\t\t\t\t\tLocaleApplianceItem localeAppItem = new LocaleApplianceItem();\n\t\t\t\t\t\n\t\t\t\t\t/********************** 添加器具信息 ************************/\n\t\t\t\t\tString SpeciesType = jsonObj.get(\"SpeciesType\").toString();\t//器具分类类型\n\t\t\t\t\tString ApplianceSpeciesId = jsonObj.get(\"ApplianceSpeciesId\").toString();\t//器具类别ID/标准名称ID\n\t\t\t\t\tString ApplianceName = jsonObj.getString(\"ApplianceName\");\t//器具名称\n\t\t\t\t\tString Manufacturer= jsonObj.getString(\"Manufacturer\");\t//制造厂\n\t\t\t\t\t\n\t\t\t\t\tif(SpeciesType!=null&&SpeciesType.length()>0){\n\t\t\t\t\t\tif(Integer.parseInt(SpeciesType) == 0){\t//0:标准名称;1:分类名称\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(false);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tString stdName = sNameMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = stdName;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//按需增加制造厂\n\t\t\t\t\t\t\tif(Manufacturer != null && Manufacturer.trim().length() > 0){\n\t\t\t\t\t\t\t\tint intRet = mafMgr.getTotalCount(new KeyValueWithOperator(\"applianceStandardName.id\", Integer.parseInt(ApplianceSpeciesId), \"=\"), new KeyValueWithOperator(\"manufacturer\", Manufacturer.trim(), \"=\"));\n\t\t\t\t\t\t\t\tif(intRet == 0){\n\t\t\t\t\t\t\t\t\tApplianceStandardName sNameTemp = new ApplianceStandardName();\n\t\t\t\t\t\t\t\t\tsNameTemp.setId(Integer.parseInt(ApplianceSpeciesId));\n\t\t\t\t\t\t\t\t\tApplianceManufacturer maf = new ApplianceManufacturer();\n\t\t\t\t\t\t\t\t\tmaf.setApplianceStandardName(sNameTemp);\n\t\t\t\t\t\t\t\t\tmaf.setManufacturer(Manufacturer.trim());\n\t\t\t\t\t\t\t\t\tmaf.setBrief(LetterUtil.String2Alpha(Manufacturer.trim()));\n\t\t\t\t\t\t\t\t\tmaf.setStatus(0);\n\t\t\t\t\t\t\t\t\tmafMgr.save(maf);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(true);\t\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = speciesMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocaleAppItem.setApplianceSpeciesId(Integer.parseInt(ApplianceSpeciesId));\t\t\t\t\t\n\t\t\t\t\t\tlocaleAppItem.setApplianceName(ApplianceName);\t//存器具名称\t\t\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setAppFactoryCode(jsonObj.getString(\"ApplianceCode\"));\t\t//出厂编号\n\t\t\t\t\tlocaleAppItem.setAppManageCode(jsonObj.getString(\"AppManageCode\"));\t\t//管理编号\n\t\t\t\t\tlocaleAppItem.setModel(jsonObj.getString(\"Model\"));\t\t//型号规格\n\t\t\t\t\tlocaleAppItem.setRange(jsonObj.getString(\"Range\"));\t\t//测量范围\n\t\t\t\t\tlocaleAppItem.setAccuracy(jsonObj.getString(\"Accuracy\"));\t//精度等级\n\t\t\t\t\tlocaleAppItem.setManufacturer(jsonObj.getString(\"Manufacturer\"));\t\t//制造厂商\n\t\t\t\t\tlocaleAppItem.setCertType(jsonObj.getString(\"ReportType\"));\t//报告形式\n\t\t\t\t\tif(jsonObj.has(\"TestFee\")&&jsonObj.getString(\"TestFee\").length()>0&&jsonObj.getString(\"TestFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setTestCost(Double.valueOf(jsonObj.getString(\"TestFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"RepairFee\")&&jsonObj.getString(\"RepairFee\").length()>0&&jsonObj.getString(\"RepairFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setRepairCost(Double.valueOf(jsonObj.getString(\"RepairFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"MaterialFee\")&&jsonObj.getString(\"MaterialFee\").length()>0&&jsonObj.getString(\"MaterialFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setMaterialCost(Double.valueOf(jsonObj.getString(\"MaterialFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setQuantity(Integer.parseInt(jsonObj.get(\"Quantity\").toString()));//台件数\t\n\t\t\t\t\tif(jsonObj.has(\"AssistStaff\")&&jsonObj.getString(\"AssistStaff\")!=null&&jsonObj.getString(\"AssistStaff\").trim().length()>0){\n\t\t\t\t\t\tlocaleAppItem.setAssistStaff(jsonObj.getString(\"AssistStaff\"));\t//存辅助派定人或替代人\t\t\n\t\t\t\t\t}\t\t\n\t\t\t\t\t/********************** 判断派定人是否存在及有效,并加入到alloteeList ****************************/\n\t\t\t\t\tString Allotee = jsonObj.getString(\"WorkStaff\");\n\t\t\t\t\tif(Allotee != null && Allotee.trim().length() > 0){\n\t\t\t\t\t\tAllotee = Allotee.trim();\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Object[]> qualRetList = qualMgr.getQualifyUsers(Allotee, localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, qualList);\n\t\t\t\t\t\tif(qualRetList != null && qualRetList.size() > 0){\n\t\t\t\t\t\t\tboolean alloteeChecked = false;\n\t\t\t\t\t\t\tfor(Object[] objArray : qualRetList){\n\t\t\t\t\t\t\t\tif(!qualMgr.checkUserQualify((Integer)objArray[0], localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, FlagUtil.QualificationType.Type_Except)){\t//没有该检验项目的检验排外属性\n\t\t\t\t\t\t\t\t\talloteeChecked = true;\n\t\t\t\t\t\t\t\t\tSysUser tempUser = new SysUser();\n\t\t\t\t\t\t\t\t\ttempUser.setId((Integer)objArray[0]);\n\t\t\t\t\t\t\t\t\ttempUser.setName((String)objArray[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlocaleAppItem.setSysUser(tempUser);\t\t//派定人\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!alloteeChecked){\n\t\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlocaleAppItem.setSysUser(null);\t\t//派定人\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tlocaleAppItemList.add(localeAppItem);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (locAppItemMgr.saveByBatch(localeAppItemList,localmission)) { // 添加成功\n\t\t\t\t\tretObj.put(\"IsOK\", true);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\"写入数据库失败!\");\n\t\t\t\t}\n\n\t\t\t}catch (Exception e) {\n\t\t\t\ttry {\n\t\t\t\t\tretObj.put(\"IsOK\", false);\n\t\t\t\t\tretObj.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage():\"无\"));\n\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 1\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 1\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retObj.toString());\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 2: // 通过customerName查询现场任务委托单\n\t\t\tJSONObject resObj2 = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString localmissionName = req.getParameter(\"QueryName\");\n\n\t\t\t\tif (localmissionName == null) {// 避免NullPointerException\n\t\t\t\t\tlocalmissionName = \"\";\n\t\t\t\t}\n\t\t\t\tString LocalemissionName = URLDecoder.decode(localmissionName,\"UTF-8\");\n\t\t\t\t\n\t\t\t\tint page = 1;// 查询页码\n\t\t\t\tif (req.getParameter(\"page\") != null)\n\t\t\t\t\tpage = Integer.parseInt(req.getParameter(\"page\").toString());\n\t\t\t\tint rows = 10;// 每页显示10行\n\t\t\t\tif (req.getParameter(\"rows\") != null)\n\t\t\t\t\trows = Integer.parseInt(req.getParameter(\"rows\").toString());\n\t\t\t\tList<LocaleMission> result;\n\t\t\t\tint total = 0;// 查询结果总数\n\t\t\t\tif (LocalemissionName == null || LocalemissionName.trim().length() == 0){// 默认查询,不输入单位名称\n\t\t\t\t\tresult = locmissMgr.findPagedAll(page, rows, new KeyValueWithOperator(\"status\", 3, \"<>\"));// 查询未被删除的任务\n\t\t\t\t\ttotal = locmissMgr.getTotalCount(new KeyValueWithOperator(\"status\", 3, \"<>\"));// 未被删除的任务总数\n\t\t\t\t} else{// 输入单位名称\n\t\t\t\t\tresult = locmissMgr.findPagedAll(page, rows, \n\t\t\t\t\t\t\tnew KeyValueWithOperator(\"customerName\", LocalemissionName,\"=\"), \n\t\t\t\t\t\t\tnew KeyValueWithOperator(\"status\", 3, \"<>\"));// 根据单位名称查询未被删除任务\n\t\t\t\t\ttotal = locmissMgr.getTotalCount(new KeyValueWithOperator(\"customer\", LocalemissionName, \"=\"),\n\t\t\t\t\t\t\tnew KeyValueWithOperator(\"status\", 3, \"<>\"));// 根据单位名称查询未被删除的任务总数\n\t\t\t\t}\n\t\t\t\tTimestamp today = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\t\n\t\t\t\tJSONArray options = new JSONArray();\n\t\t\t\tfor (LocaleMission loc : result) {\n\t\t\t\t\t// System.out.println(\"loc.getStatus():\"+loc.getStatus());\n\t\t\t\t\tif (loc.getStatus() != 3) {\n\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\toption.put(\"Id\", loc.getId());\n\t\t\t\t\t\toption.put(\"Name\", loc.getCustomerName());\n\t\t\t\t\t\toption.put(\"Code\", loc.getCode());\n\t\t\t\t\t\toption.put(\"CustomerId\", loc.getCustomer().getId());\n\t\t\t\t\t\toption.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\t\t\toption.put(\"Brief\", loc.getBrief());\n\t\t\t\t\t\toption.put(\"Region\", loc.getRegion().getName());\n\t\t\t\t\t\toption.put(\"RegionId\", loc.getRegion().getId());\n\t\t\t\t\t\toption.put(\"Address\", loc.getAddress_1());\n\t\t\t\t\t\toption.put(\"Remark\", loc.getRemark()==null?\"\":loc.getRemark());\n\t\t\t\t\t\toption.put(\"Tel\", loc.getTel());\n\t\t\t\t\t\toption.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\t\t\toption.put(\"Status\", loc.getStatus());\n\t\t\t\t\t\toption.put(\"Contactor\", loc.getContactor());\n\t\t\t\t\t\toption.put(\"ContactorTel\", loc.getContactorTel());\n\t\t\t\t\t\toption.put(\"Department\", loc.getDepartment());\n\t\t\t\t\t\toption.put(\"ExactTime\", loc.getExactTime()==null?\"\":DateTimeFormatUtil.DateTimeFormat.format(loc.getExactTime()));\n\t\t\t\t\t\t//option.put(\"MissionDesc\", loc.getMissionDesc());\n\t\t\t\t\t\toption.put(\"ModificatorDate\", loc.getModificatorDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getModificatorDate()));\n\t\t\t\t\t\toption.put(\"ModificatorId\", loc.getSysUserByModificatorId().getName());\n\t\t\t\t\t\toption.put(\"SiteManagerName\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\t\t\toption.put(\"SiteManagerId\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getId());\n\t\t\t\t\t\toption.put(\"Staffs\", loc.getStaffs());\n\t\t\t\t\t\t//option.put(\"MissionDescEnter\", loc.getMissionDesc().replace(\"\\r\\n\", \"<br/>\"));\n\t\t\t\t\t\toption.put(\"Status\", loc.getStatus());\n\t\t\t\t\t\toption.put(\"Tag\", \"0\");//已核定\n\t\t\t\t\t\toption.put(\"CheckDate\", loc.getCheckDate()==null?\"\":DateTimeFormatUtil.DateTimeFormat.format(loc.getCheckDate()));//核定时间\n\t\t\t\t\t\toption.put(\"TentativeDate\", loc.getTentativeDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getTentativeDate()));\n\t\t\t\t\t\tif(loc.getStatus()==4&&loc.getTentativeDate()!=null){ //未核定\n\t\t\t\t\t\t\tif(loc.getTentativeDate().after(today)){//已到暂定日期可是未安排\n\t\t\t\t\t\t\t\toption.put(\"Tag\", \"1\");//未核定;;;已到暂定日期可是未安排\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\toption.put(\"Tag\", \"2\");//未核定;;;未到暂定日期\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\toptions.put(option);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresObj2.put(\"total\", total);\n\t\t\t\tresObj2.put(\"rows\", options);\n\t\t\t} catch (Exception e) {\n\t\t\t\ttry{\n\t\t\t\t\tresObj2.put(\"total\", 0);\n\t\t\t\t\tresObj2.put(\"rows\", new JSONArray());\n\t\t\t\t}catch(Exception ex){}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 2\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 2\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\t\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(resObj2.toString());\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 3: // 修改现场任务委托单\n\t\t\tJSONObject retObj3 = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString Id = req.getParameter(\"Id\").trim();\n\t\t\t\tString CustomerName = req.getParameter(\"Name\");\n\t\t\t\tint CustomerId=Integer.parseInt(req.getParameter(\"CustomerId\"));\n\t\t\t\tString ZipCode = req.getParameter(\"ZipCode\");\n\t\t\t\tString Department = req.getParameter(\"Department\");\n\t\t\t\tString Address = req.getParameter(\"Address\");\n\t\t\t\tString Tel = req.getParameter(\"Tel\");\n\t\t\t\tString ContactorTel = req.getParameter(\"ContactorTel\");\n\t\t\t\tString TentativeDate = req.getParameter(\"TentativeDate\");\n\t\t\t\tString CheckDate = req.getParameter(\"CheckDate\");//核定日期\n\t\t\t\t\n\t\t\t\tString SiteManagerId = req.getParameter(\"SiteManagerId\");\n\t\t\t\n\t\t\t\tString Contactor = req.getParameter(\"Contactor\");\n\t\t\t\tString RegionId = req.getParameter(\"RegionId\");\n\t\t\t\tString Remark = req.getParameter(\"Remark\");\n\t\t\t\tString HeadNameId = req.getParameter(\"HeadName\");\n\t\t\t\tif(HeadNameId==null||HeadNameId.length()==0){\n\t\t\t\t\tthrow new Exception(\"抬头名称不能为空!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\tAddressManager addrMgr = new AddressManager();\t\t\t\n\t\t\t\tAddress HeadNameAddr = new AddressManager().findById(Integer.parseInt(HeadNameId));\t//台头名称的单位\n\t\t\t\tString Appliances = req.getParameter(\"Appliances\").trim();\t//检验的器具\n\t\t\t\t\n\t\t\t\tJSONArray appliancesArray = new JSONArray(Appliances);\t//检查的器具\n\t\t\t\t\n\t\t\t\tint lid = Integer.parseInt(Id);// 获取Id\n\t\t\t\tLocaleMission localmission = locmissMgr.findById(lid);// 根据查询现场任务\n\t\t\t\tif(localmission == null){\n\t\t\t\t\tthrow new Exception(\"该现场检测业务不存在!\");\n\t\t\t\t}\n\t\t\t\tif(localmission.getStatus()==2||localmission.getStatus()==3){\n\t\t\t\t\tthrow new Exception(\"该现场检测业务'已完工'或‘已注销’,不能修改!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tTimestamp ts;\n if(TentativeDate==null||TentativeDate.length()==0){\n\t\t\t\t ts = null;\t//暂定日期\n }else{\n\t\t\t ts = new Timestamp(DateTimeFormatUtil.DateFormat.parse(TentativeDate).getTime());\t//暂定日期\n }\n Timestamp now = new Timestamp(System.currentTimeMillis());// 取当前时间\n \n localmission.setCustomerName(CustomerName==null?\"\":CustomerName);\n\t\t\t\tlocalmission.setAddress_1(Address==null?\"\":Address);\n\t\t\t\tlocalmission.setZipCode(ZipCode==null?\"\":ZipCode);\n\t\t\t\tlocalmission.setContactor(Contactor==null?\"\":Contactor);\n\t\t\t\tlocalmission.setTel(Tel==null?\"\":Tel);\n\t\t\t\tlocalmission.setContactorTel(ContactorTel==null?\"\":ContactorTel);\n\t\t\t\t//localmission.setMissionDesc(MissionDesc);\n\t\t\t\tlocalmission.setDepartment(Department);\n\t\t\t\t//localmission.setStaffs(staffs.toString());\n\t\t\t\tlocalmission.setTentativeDate(ts);\n\t\t\t\tRegion region = new Region();\n\t\t\t\tregion.setId(Integer.parseInt(RegionId));\n\t\t\t\tlocalmission.setRegion(region);\n\t\t\t\tlocalmission.setRemark(Remark);\n\t\t\t\tlocalmission.setAddress(HeadNameAddr);\n\t\t\t\t/************更新委托单位信息***********/\n\t\t\t\tCustomer cus=(new CustomerManager()).findById(CustomerId);\n\t\t\t\tif(CustomerName!=null&&CustomerName.length()>0){\n\t\t\t\t\tcus.setName(CustomerName);\n\t\t\t\t}\n\t\t\t\tif(Address!=null&&Address.length()>0){\n\t\t\t\t\tcus.setAddress(Address);\n\t\t\t\t}\n\t\t\t\tif(Tel!=null&&Tel.length()>0){\n\t\t\t\t\tcus.setTel(Tel);\n\t\t\t\t}\n\t\t\t\tif(ZipCode!=null&&ZipCode.length()>0){\n\t\t\t\t\tcus.setZipCode(ZipCode);\n\t\t\t\t}\n\t\t\t\tif(!(new CustomerManager()).update(cus)){\n\t\t\t\t\tthrow new Exception(\"更新委托单位失败!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\t/************更新委托单位联系人信息***********/\t\n\t\t\t\tCustomerContactorManager cusConMgr = new CustomerContactorManager();\n\t\t\t\tList<CustomerContactor> cusConList = cusConMgr.findByVarProperty(new KeyValueWithOperator(\"customerId\", CustomerId, \"=\"), new KeyValueWithOperator(\"name\", Contactor, \"=\"));\n\t\t\t\tif(cusConList != null){\n\t\t\t\t\tif(cusConList.size() > 0){\n\t\t\t\t\t\tCustomerContactor c = cusConList.get(0);\n\t\t\t\t\t\tif(ContactorTel.length() > 0){\n\t\t\t\t\t\t\tif(!ContactorTel.equalsIgnoreCase(c.getCellphone1()) && (c.getCellphone2() == null || c.getCellphone2().length() == 0)){\n\t\t\t\t\t\t\t\tc.setCellphone2(c.getCellphone1());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tc.setCellphone1(ContactorTel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc.setLastUse(now);\n\t\t\t\t\t\tc.setCount(c.getCount()+1);\n\t\t\t\t\t\tif(!cusConMgr.update(c))\n\t\t\t\t\t\t\tthrow new Exception(\"更新单位联系人失败!\");\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tCustomerContactor c = new CustomerContactor();\n\t\t\t\t\t\tc.setCustomerId(CustomerId);\n\t\t\t\t\t\tc.setName(Contactor);\n\t\t\t\t\t\tc.setCellphone1(ContactorTel);\n\t\t\t\t\t\tc.setLastUse(now);\n\t\t\t\t\t\tc.setCount(1);\n\t\t\t\t\t\tif(!cusConMgr.save(c))\n\t\t\t\t\t\t\tthrow new Exception(\"更新单位联系人失败!\");\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlocalmission.setCustomer(cus);\t\t\t\n\t\t\t\tif(CheckDate!=null&&CheckDate.length()>0){ //核定\n\t\t\t\t\tTimestamp CheckTime = new Timestamp(DateTimeFormatUtil.DateFormat.parse(CheckDate).getTime());\n\t\t\t\t\tlocalmission.setCheckDate(CheckTime);\n\t\t\t\t\tif(localmission.getStatus()==4){\n\t\t\t\t\t\t//localmission.setStatus(5);//已核定\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSysUser newUser = new SysUser();\n\t\t\t\tif(SiteManagerId!=null&&SiteManagerId.length()>0){ //负责人\n\t\t\t\t\tnewUser.setId(Integer.parseInt(SiteManagerId));\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(newUser);\t\n\t\t\t\t}else{\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(null);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlocalmission.setModificatorDate(now);// 记录时间为当前时间\n\t\t\t\tlocalmission.setSysUserByModificatorId((SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser));\n\t\t\t\t\n\t\t\t\tApplianceSpeciesManager speciesMgr = new ApplianceSpeciesManager();\t//器具分类管理Mgr\n\t\t\t\tApplianceStandardNameManager sNameMgr = new ApplianceStandardNameManager();\t//器具标准名称管理Mgr\n\t\t\t\tAppliancePopularNameManager popNameMgr = new AppliancePopularNameManager();\t//器具常用名称管理Mgr\n\t\t\t\tQualificationManager qualMgr = new QualificationManager();\t//检测人员资质管理Mgr\n\t\t\t\tApplianceManufacturerManager mafMgr = new ApplianceManufacturerManager();\t//制造厂管理Mgr\n\t\t\t\t\n\t\t\t\tList<LocaleApplianceItem> localeAppItemList = new ArrayList<LocaleApplianceItem>();\t//现场业务中要添加的器具\n\t\t\t\tList<SysUser> alloteeList = new ArrayList<SysUser>();\t//委托单列表对应的派定人:\n\t\t\t\tList<Integer> qualList = new ArrayList<Integer>();\n\t\t\t\n\t\t\t\t/******************** 添加器具信息 ******************/\n\t\t\t\tfor(int i = 0; i < appliancesArray.length(); i++){\n\t\t\t\t\tJSONObject jsonObj = appliancesArray.getJSONObject(i);\n\t\t\t\t\tLocaleApplianceItem localeAppItem = new LocaleApplianceItem();\n\t\t\t\t\t\n\t\t\t\t\t/********************** 添加器具信息 ************************/\n\t\t\t\t\tString SpeciesType = (jsonObj.has(\"SpeciesType\")?jsonObj.get(\"SpeciesType\").toString():\"\");\t//器具分类类型\n\t\t\t\t\tString ApplianceSpeciesId = (jsonObj.has(\"ApplianceSpeciesId\")?jsonObj.get(\"ApplianceSpeciesId\").toString():\"\");\t//器具类别ID/标准名称ID\n\t\t\t\t\tString ApplianceName = jsonObj.getString(\"ApplianceName\");\t//器具名称\n\t\t\t\t\tString Manufacturer= jsonObj.getString(\"Manufacturer\");\t//制造厂\n\t\t\t\t\tif(SpeciesType!=null&&SpeciesType.length()>0){\n\t\t\t\t\t\tif(Integer.parseInt(SpeciesType) == 0){\t//0:标准名称;1:分类名称\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(false);\t\n\t\t\t\t\t\t\tString stdName = sNameMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = stdName;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//按需增加制造厂\n\t\t\t\t\t\t\tif(Manufacturer != null && Manufacturer.trim().length() > 0){\n\t\t\t\t\t\t\t\tint intRet = mafMgr.getTotalCount(new KeyValueWithOperator(\"applianceStandardName.id\", Integer.parseInt(ApplianceSpeciesId), \"=\"), new KeyValueWithOperator(\"manufacturer\", Manufacturer.trim(), \"=\"));\n\t\t\t\t\t\t\t\tif(intRet == 0){\n\t\t\t\t\t\t\t\t\tApplianceStandardName sNameTemp = new ApplianceStandardName();\n\t\t\t\t\t\t\t\t\tsNameTemp.setId(Integer.parseInt(ApplianceSpeciesId));\n\t\t\t\t\t\t\t\t\tApplianceManufacturer maf = new ApplianceManufacturer();\n\t\t\t\t\t\t\t\t\tmaf.setApplianceStandardName(sNameTemp);\n\t\t\t\t\t\t\t\t\tmaf.setManufacturer(Manufacturer.trim());\n\t\t\t\t\t\t\t\t\tmaf.setBrief(LetterUtil.String2Alpha(Manufacturer.trim()));\n\t\t\t\t\t\t\t\t\tmaf.setStatus(0);\n\t\t\t\t\t\t\t\t\tmafMgr.save(maf);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(true);\t\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = speciesMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocaleAppItem.setApplianceSpeciesId(Integer.parseInt(ApplianceSpeciesId));\t\t\t\t\t\n\t\t\t\t\t\tlocaleAppItem.setApplianceName(ApplianceName);\t//存器具名称\t\t\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setAppFactoryCode(jsonObj.getString(\"ApplianceCode\"));\t\t//出厂编号\n\t\t\t\t\tlocaleAppItem.setAppManageCode(jsonObj.getString(\"AppManageCode\"));\t\t//管理编号\n\t\t\t\t\tlocaleAppItem.setModel(jsonObj.getString(\"Model\"));\t\t//型号规格\n\t\t\t\t\tlocaleAppItem.setRange(jsonObj.getString(\"Range\"));\t\t//测量范围\n\t\t\t\t\tlocaleAppItem.setAccuracy(jsonObj.getString(\"Accuracy\"));\t//精度等级\n\t\t\t\t\tlocaleAppItem.setManufacturer(jsonObj.getString(\"Manufacturer\"));\t\t//制造厂商\n\t\t\t\t\tlocaleAppItem.setCertType(jsonObj.getString(\"ReportType\"));\t//报告形式\n\t\t\t\t\tif(jsonObj.has(\"TestFee\")&&jsonObj.getString(\"TestFee\").length()>0&&jsonObj.getString(\"TestFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setTestCost(Double.valueOf(jsonObj.getString(\"TestFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"RepairFee\")&&jsonObj.getString(\"RepairFee\").length()>0&&jsonObj.getString(\"RepairFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setRepairCost(Double.valueOf(jsonObj.getString(\"RepairFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"MaterialFee\")&&jsonObj.getString(\"MaterialFee\").length()>0&&jsonObj.getString(\"MaterialFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setMaterialCost(Double.valueOf(jsonObj.getString(\"MaterialFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setQuantity(Integer.parseInt(jsonObj.get(\"Quantity\").toString()));//台件数\t\n\t\t\t\t\tif(jsonObj.has(\"AssistStaff\")&&jsonObj.getString(\"AssistStaff\")!=null&&jsonObj.getString(\"AssistStaff\").trim().length()>0)\n\t\t\t\t\t\tlocaleAppItem.setAssistStaff(jsonObj.getString(\"AssistStaff\"));\t//存辅助派定人或替代人\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t/********************** 判断派定人是否存在及有效,并加入到alloteeList ****************************/\n\t\t\t\t\tString Allotee = jsonObj.getString(\"WorkStaff\");\n\t\t\t\t\tif(Allotee != null && Allotee.trim().length() > 0){\n\t\t\t\t\t\tAllotee = Allotee.trim();\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Object[]> qualRetList = qualMgr.getQualifyUsers(Allotee, localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, qualList);\n\t\t\t\t\t\tif(qualRetList != null && qualRetList.size() > 0){\n\t\t\t\t\t\t\tboolean alloteeChecked = false;\n\t\t\t\t\t\t\tfor(Object[] objArray : qualRetList){\n\t\t\t\t\t\t\t\tif(!qualMgr.checkUserQualify((Integer)objArray[0], localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, FlagUtil.QualificationType.Type_Except)){\t//没有该检验项目的检验排外属性\n\t\t\t\t\t\t\t\t\talloteeChecked = true;\n\t\t\t\t\t\t\t\t\tSysUser tempUser = new SysUser();\n\t\t\t\t\t\t\t\t\ttempUser.setId((Integer)objArray[0]);\n\t\t\t\t\t\t\t\t\ttempUser.setName((String)objArray[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlocaleAppItem.setSysUser(tempUser);\t\t//派定人\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!alloteeChecked){\n\t\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlocaleAppItem.setSysUser(null);\t\t//派定人\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\tif(jsonObj.has(\"Id\")&&jsonObj.getString(\"Id\")!=null&&jsonObj.getString(\"Id\").trim().length()>0)\n\t\t\t\t\t\tlocaleAppItem.setId(Integer.parseInt(jsonObj.getString(\"Id\")));\n\t\t\t\t\tlocaleAppItemList.add(localeAppItem);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (locAppItemMgr.updateByBatch(localeAppItemList,localmission)) { // 修改现场业务,删除原现场业务中的器具信息,添加新的器具信息\n\t\t\t\t\tretObj3.put(\"IsOK\", true);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\"更新数据库失败!\");\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\ttry {\n\t\t\t\t\tretObj3.put(\"IsOK\", false);\n\t\t\t\t\tretObj3.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage() : \"无\"));\n\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 3\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 3\", e);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retObj3.toString());\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 4: // 删除现场任务委托单\n\t\t\tJSONObject retJSON4 = new JSONObject();\n\t\t\ttry{\n\t\t\t\tint id = Integer.parseInt(req.getParameter(\"id\"));\n\t\t\t\tLocaleMission localmission = locmissMgr.findById(id);\n\t\t\t\tif(localmission.getStatus()==2||localmission.getStatus()==3){\n\t\t\t\t\tthrow new Exception(\"该现场检测业务'已完工'或‘已注销’,不能修改!\");\n\t\t\t\t}\n\t\t\t\tSysUser user = (SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser);\n\t\t\n\t\t\t\tif((!user.getId().equals(localmission.getSysUserByCreatorId().getId()))&&(!user.getName().equals(\"系统管理员\"))){\n\t\t\t\t\tthrow new Exception(\"你不是创建人或者系统管理员,不能删除!\");\n\t\t\t\t}\n\t\t\t\n\t\t\t\tlocalmission.setStatus(3);// 将指定Id任务状态置为3,表示已删除\n\t\t\t\tif(locmissMgr.update(localmission)){\n\t\t\t\t\tretJSON4.put(\"IsOK\", true);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"更新数据库失败!\");\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\ttry{\n\t\t\t\t\tretJSON4.put(\"IsOK\", false);\n\t\t\t\t\tretJSON4.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage() : \"无\"));\n\t\t\t\t}catch(Exception ex){}\n\t\t\t\t\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 3\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 3\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retJSON4.toString());\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // 查询车辆出车情况\n\t\t{\n\t\t\t\n\t\t\tString dateTime = req.getParameter(\"dateTime\");\n\t\t\tTimestamp ts = Timestamp.valueOf(String.format(\"%s 00:00:00\",\n\t\t\t\t\tdateTime.trim()));\n\t\t\tString CarNo = \"\";\n\t\t\tif (req.getParameter(\"Lisence\") != null)\n\t\t\t\tCarNo = URLDecoder.decode(req.getParameter(\"Lisence\").trim(),\n\t\t\t\t\t\t\"UTF-8\"); // 解决jquery传递中文乱码问题\n\t\t\tVehicleMissionManager vemissmag = new VehicleMissionManager();\n\t\t\tVehicleManager vemag = new VehicleManager();\n\t\t\tJSONObject res = new JSONObject();\n\t\t\ttry {\n\t\t\t\tint page = 1;\n\t\t\t\tif (req.getParameter(\"page\") != null)\n\t\t\t\t\tpage = Integer\n\t\t\t\t\t\t\t.parseInt(req.getParameter(\"page\").toString());\n\t\t\t\tint rows = 10;\n\t\t\t\tif (req.getParameter(\"rows\") != null)\n\t\t\t\t\trows = Integer\n\t\t\t\t\t\t\t.parseInt(req.getParameter(\"rows\").toString());\n\t\t\t\tList<VehicleMission> vehiclemission;\n\t\t\t\tList<Vehicle> vehicle;\n\t\t\t\tint total = 0;\n\t\t\t\tint limit=0;\n\t\t\t\tJSONArray options = new JSONArray();\n\n\t\t\t\tif (CarNo.length() == 0) {// 没有填写车辆牌照\n\t\t\t\t\t// System.out.println(\"0001111\");\n\t\t\t\t\tvehicle = vemag.findPagedAll(page, rows,\n\t\t\t\t\t\t\tnew KeyValueWithOperator(\"status\", 0, \"=\"));// 查询正常车辆\n\t\t\t\t\ttotal = vemag.getTotalCount(new KeyValueWithOperator(\n\t\t\t\t\t\t\t\"status\", 0, \"=\"));// 正常车辆数量\n\t\t\t\t\tfor (Vehicle ve : vehicle) {\n\t\t\t\t\t\tint[] CCCS = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n\t\t\t\t\t\n\t\t\t\t\t\tint veid = ve.getId();\n\t\t\t\t\t\tString license = vemag.findById(veid).getLicence();// 根据车辆id获取车牌号\n\t\t\t\t\t\tlimit= (vemag.findById(veid).getLimit()==null?0:vemag.findById(veid).getLimit());\n\t\t\t\t\t\tString driverName = \"\";\n\t\t\t\t\t\tif (vemag.findById(veid).getSysUser() != null) {\n\t\t\t\t\t\t\tdriverName = vemag.findById(veid).getSysUser().getName();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// System.out.println(license);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.println(driverName);\n\t\t\t\t\t\tCalendar ca = Calendar.getInstance();// 新建一个日历实例\n\t\t\t\t\t\tca.setTime(ts);\n\t\t\t\t\t\tint dow = ca.get(Calendar.DAY_OF_WEEK);// 得到选择的日期是一周的第几天\n\t\t\t\t\t\t//System.out.println(dow);\n\t\t\t\t\t\tif(dow==1)//选择的日期为周日,系统默认周日为一周第一天,可是咱们的周日为第七天\n\t\t\t\t\t\t\tca.add(Calendar.DATE, 2 - dow-7);// 获取该周的星期一的日期,周一为一周第一天 (刘振修改了,因为发现之前得到的是周日)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tca.add(Calendar.DATE, 2 - dow);// 获取该周的星期一的日期,周一为一周第一天 (刘振修改了,因为发现之前得到的是周日)\n\t\t\t\t\t\tTimestamp mon = new Timestamp(ca.getTimeInMillis());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//System.out.println(mon);\n\t\t\t\t\t\tca.add(Calendar.DATE, 7);// 获取该周周日的日期,周日为一周最后一天\n\t\t\t\t\t\tTimestamp nextmon = new Timestamp(ca.getTimeInMillis());\n\t\t\t\t\t\t//System.out.println(nextmon);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvehiclemission = vemissmag.findByVarProperty(new KeyValueWithOperator(\"drivingVehicle.vehicle\", ve, \"=\"),\n\t\t\t\t\t\t\t\tnew KeyValueWithOperator(\"drivingVehicle.beginDate\", nextmon,\"<\"), new KeyValueWithOperator(\"drivingVehicle.endDate\", mon, \">=\"),\n\t\t\t\t\t\t\t\tnew KeyValueWithOperator(\"localeMission.status\", 3, \"<>\"),new KeyValueWithOperator(\"drivingVehicle.vehicle.status\", 1, \"<>\"));// 查询任务安排在该周的现场任务\n\t\t\t\t\t\tif (vehiclemission.size() > 0) {// 如果存在查询结果\n\t\t\t\t\t\t\tString[] available = timeJudge(vehiclemission, mon,CCCS);\n\t\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\t\toption.put(\"driverName\", driverName);\n\t\t\t\t\t\t\toption.put(\"limit\", limit);\n\t\t\t\t\t\t\toption.put(\"vehicleid\", license);\n\t\t\t\t\t\t\toption.put(\"onea\", available[0]);\n\t\t\t\t\t\t\toption.put(\"onep\", available[1]);\n\t\t\t\t\t\t\toption.put(\"twoa\", available[2]);\n\t\t\t\t\t\t\toption.put(\"twop\", available[3]);\n\t\t\t\t\t\t\toption.put(\"threea\", available[4]);\n\t\t\t\t\t\t\toption.put(\"threep\", available[5]);\n\t\t\t\t\t\t\toption.put(\"foura\", available[6]);\n\t\t\t\t\t\t\toption.put(\"fourp\", available[7]);\n\t\t\t\t\t\t\toption.put(\"fivea\", available[8]);\n\t\t\t\t\t\t\toption.put(\"fivep\", available[9]);\n\t\t\t\t\t\t\toption.put(\"sixa\", available[10]);\n\t\t\t\t\t\t\toption.put(\"sixp\", available[11]);\n\t\t\t\t\t\t\toption.put(\"sevena\", available[12]);\n\t\t\t\t\t\t\toption.put(\"sevenp\", available[13]);\n\t\t\t\t\t\t\toptions.put(option);\n\t\t\t\t\t\t} else {// 查找不到任务说明本周都是空闲\n\t\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\t\toption.put(\"driverName\", driverName);\n\t\t\t\t\t\t\toption.put(\"limit\", limit);\n\t\t\t\t\t\t\toption.put(\"vehicleid\", license);\n\t\t\t\t\t\t\toption.put(\"onea\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"onep\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"twoa\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"twop\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"threea\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"threep\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"foura\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"fourp\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"fivea\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"fivep\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"sixa\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"sixp\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"sevena\", \"空闲\");\n\t\t\t\t\t\t\toption.put(\"sevenp\", \"空闲\");\n\t\t\t\t\t\t\toptions.put(option);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {// 填写了车辆牌照\n\t\t\t\t\tvehicle = vemag.findPagedAll(page, rows,\n\t\t\t\t\t\t\tnew KeyValueWithOperator(\"licence\", \"%\"+CarNo+\"%\", \"like\"),\n\t\t\t\t\t\t\tnew KeyValueWithOperator(\"status\", 0, \"=\"));// 根据填写车牌查找车辆\n\t\t\t\t\tint[] CCCS = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n\t\t\t\t\tif (vehicle.size() > 0) {// 查找到车辆\n\t\t\t\t\t\tfor (Vehicle ve : vehicle) {\n\t\t\t\t\t\t\ttotal = 1;\n\t\t\t\t\t\t\tint veid = ve.getId();// 获取车辆Id\n\t\t\t\t\t\t\tString driverName = \"\";\n\t\t\t\t\t\t\tlimit= (vemag.findById(veid).getLimit()==null?0:vemag.findById(veid).getLimit());\n\t\t\t\t\t\t\tif (vemag.findById(veid).getSysUser() != null) {\n\t\t\t\t\t\t\t\tdriverName = vemag.findById(veid).getSysUser()\n\t\t\t\t\t\t\t\t\t\t.getName();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCalendar ca = Calendar.getInstance();// 新建一个日历实例\n\t\t\t\t\t\t\tca.setTime(ts);\n\t\t\t\t\t\t\tint dow = ca.get(Calendar.DAY_OF_WEEK);// 得到选择的日期是一周的第几天\n\t\t\t\t\t\t\t//System.out.println(dow);\n\t\t\t\t\t\t\tif(dow==1)//选择的日期为周日,系统默认周日为一周第一天,可是咱们的周日为第七天\n\t\t\t\t\t\t\t\tca.add(Calendar.DATE, 2 - dow-7);// 获取该周的星期一的日期,周一为一周第一天 (刘振修改了,因为发现之前得到的是周日)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tca.add(Calendar.DATE, 2 - dow);// 获取该周的星期一的日期,周一为一周第一天 (刘振修改了,因为发现之前得到的是周日)\n\t\t\t\t\t\t\tTimestamp mon = new Timestamp(ca.getTimeInMillis());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(mon);\n\t\t\t\t\t\t\tca.add(Calendar.DATE, 7);// 获取该周周日的日期,周日为一周最后一天\n\t\t\t\t\t\t\tTimestamp nextmon = new Timestamp(ca.getTimeInMillis());\n\t\t\t\t\t\t\tvehiclemission = vemissmag.findByVarProperty(new KeyValueWithOperator(\"drivingVehicle.vehicle\", ve, \"=\"),\n\t\t\t\t\t\t\t\t\tnew KeyValueWithOperator(\"drivingVehicle.beginDate\", nextmon,\"<\"), new KeyValueWithOperator(\"drivingVehicle.beginDate\",mon, \">=\"),\n\t\t\t\t\t\t\t\t\tnew KeyValueWithOperator(\"localeMission.status\", 3, \"<>\"),new KeyValueWithOperator(\"drivingVehicle.vehicle.status\", 1, \"<>\"));\n\t\t\t\t\t\t\tif (vehiclemission.size() > 0) {\n\t\t\t\t\t\t\t\tString[] available = timeJudge(vehiclemission, mon,CCCS);\n\t\t\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\t\t\toption.put(\"driverName\", ve.getSysUser()==null?\"\":ve.getSysUser().getName());\n\t\t\t\t\t\t\t\toption.put(\"vehicleid\", ve.getLicence());\n\t\t\t\t\t\t\t\toption.put(\"limit\", limit);\n\t\t\t\t\t\t\t\toption.put(\"onea\", available[0]);\n\t\t\t\t\t\t\t\toption.put(\"onep\", available[1]);\n\t\t\t\t\t\t\t\toption.put(\"twoa\", available[2]);\n\t\t\t\t\t\t\t\toption.put(\"twop\", available[3]);\n\t\t\t\t\t\t\t\toption.put(\"threea\", available[4]);\n\t\t\t\t\t\t\t\toption.put(\"threep\", available[5]);\n\t\t\t\t\t\t\t\toption.put(\"foura\", available[6]);\n\t\t\t\t\t\t\t\toption.put(\"fourp\", available[7]);\n\t\t\t\t\t\t\t\toption.put(\"fivea\", available[8]);\n\t\t\t\t\t\t\t\toption.put(\"fivep\", available[9]);\n\t\t\t\t\t\t\t\toption.put(\"sixa\", available[10]);\n\t\t\t\t\t\t\t\toption.put(\"sixp\", available[11]);\n\t\t\t\t\t\t\t\toption.put(\"sevena\", available[12]);\n\t\t\t\t\t\t\t\toption.put(\"sevenp\", available[13]);\n\t\t\t\t\t\t\t\toptions.put(option);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\t\t\toption.put(\"driverName\", ve.getSysUser()==null?\"\":ve.getSysUser().getName());\n\t\t\t\t\t\t\t\toption.put(\"vehicleid\", ve.getLicence());\n\t\t\t\t\t\t\t\toption.put(\"limit\", limit);\n\t\t\t\t\t\t\t\toption.put(\"onea\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"onep\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"twoa\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"twop\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"threea\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"threep\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"foura\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"fourp\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"fivea\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"fivep\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"sixa\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"sixp\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"sevena\", \"空闲\");\n\t\t\t\t\t\t\t\toption.put(\"sevenp\", \"空闲\");\n\t\t\t\t\t\t\t\toptions.put(option);\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\n\t\t\t\tres.put(\"total\", total);\n\t\t\t\tres.put(\"rows\", options);\n\t\t\t} catch (Exception e) {\n\t\t\t\ttry{\n\t\t\t\t\tres.put(\"total\", 0);\n\t\t\t\t\tres.put(\"rows\", new JSONArray());\n\t\t\t\t}catch(Exception e1){}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 5\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 5\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(res.toString());\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 6:// 业务调度中查询现场业务\n\t\t{\n\t\t\tJSONObject res = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString QueryName = req.getParameter(\"QueryName\");\n\t\t\t\tString BeginDate = req.getParameter(\"History_BeginDate\");\n\t\t\t\tString EndDate = req.getParameter(\"History_EndDate\");\n\t\t\t\t//String MissionStatus = req.getParameter(\"MissionStatus\");\n\t\t\t\tString Department = req.getParameter(\"Department\");\n\t\t\t\tif (QueryName == null) {// 避免NullPointerException\n\t\t\t\t\tQueryName = \"\";\n\t\t\t\t}\n\t\t\t\tif (BeginDate == null) {// 避免NullPointerException\n\t\t\t\t\tBeginDate = \"\";\n\t\t\t\t}\n\t\t\t\tif (EndDate == null) {// 避免NullPointerException\n\t\t\t\t\tEndDate = \"\";\n\t\t\t\t}\n\t\t\t\t//if (MissionStatus == null) {// 避免NullPointerException\n\t\t\t\t//\tMissionStatus = \"\";\n\t\t\t\t//}\n\t\t\t\tif (Department == null) {// 避免NullPointerException\n\t\t\t\t\tDepartment = \"\";\n\t\t\t\t}\n\t\t\t\tint page = 1;// 查询页码\n\t\t\t\tif (req.getParameter(\"page\") != null)\n\t\t\t\t\tpage = Integer\n\t\t\t\t\t\t\t.parseInt(req.getParameter(\"page\").toString());\n\t\t\t\tint rows = 10;// 每页显示10行\n\t\t\t\tif (req.getParameter(\"rows\") != null)\n\t\t\t\t\trows = Integer\n\t\t\t\t\t\t\t.parseInt(req.getParameter(\"rows\").toString());\n\n\t\t\t\tString queryStr = \"from LocaleMission as model where (model.status = 1 or model.status = 5)\"; //已分配或已核定\n\t\t\t\tList<Object> keys = new ArrayList<Object>();\n\t\t\t\t//List<KeyValueWithOperator> condList = new ArrayList<KeyValueWithOperator>();\n\t\t\t\t//condList.add(new KeyValueWithOperator(\"status\", 3, \"<>\"));//注销\n\t\t\t\t\n\t\t\t\tif (QueryName != null && QueryName.trim().length() > 0) {\n\t\t\t\t\tString Name = URLDecoder.decode(QueryName.trim(),\n\t\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\t\t\n\t\t\t\t\t//condList.add(new KeyValueWithOperator(\"customerName\",Name, \"=\"));\n\t\t\t\t\tqueryStr=queryStr+\" and model.customerName like ?\";\n\t\t\t\t\tkeys.add(\"%\" + Name + \"%\");\n\t\t\t\t}\n\n\t\t\t\tif (Department != null && Department.trim().length() > 0) {\n\t\t\t\t\tString department = URLDecoder.decode(Department.trim(),\n\t\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tqueryStr=queryStr+\" and model.department like ?\";\n\t\t\t\t\tkeys.add(\"%\" + department + \"%\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (BeginDate != null && BeginDate.trim().length() > 0&&(EndDate == null || EndDate.trim().length() == 0)) {\n\t\t\t\t\tTimestamp beginTs = Timestamp.valueOf(String.format(\"%s 00:00:00\", BeginDate.trim()));\n\t\t\t\t\t//condList.add(new KeyValueWithOperator(\"tentativeDate\",beginTs, \">=\"));\n\t\t\t\t\t\n\t\t\t\t\tqueryStr=queryStr+\" and (model.tentativeDate >= ? or model.checkDate >= ? or model.exactTime >= ?)\";\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\t\n\t\t\t\t}else if (EndDate != null && EndDate.trim().length() > 0&&(BeginDate == null || BeginDate.trim().length() == 0)) {\n\t\t\t\t\tTimestamp endTs = Timestamp.valueOf(String.format(\n\t\t\t\t\t\t\t\"%s 23:59:00\", EndDate.trim()));\n\t\t\t\t\t\n\t\t\t\t // condList.add(new KeyValueWithOperator(\"tentativeDate\",endTs, \"<=\"));\n\t\t\t\t\tqueryStr=queryStr+\" and (model.tentativeDate <= ? or model.checkDate <= ? or model.exactTime <= ?)\";\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t}else if (BeginDate != null && BeginDate.trim().length() > 0&&EndDate != null && EndDate.trim().length() > 0) {\n\t\t\t\t\tTimestamp endTs = Timestamp.valueOf(String.format(\n\t\t\t\t\t\t\t\"%s 23:59:00\", EndDate.trim()));\n\t\t\t\t\tTimestamp beginTs = Timestamp.valueOf(String.format(\"%s 00:00:00\", BeginDate.trim()));\n\t\t\t\t\n\t\t\t\t // condList.add(new KeyValueWithOperator(\"tentativeDate\",endTs, \"<=\"));\n\t\t\t\t\tqueryStr=queryStr+\" and ((model.tentativeDate >= ? and model.tentativeDate <= ? ) or (model.checkDate >= ? and model.checkDate <= ? ) or (model.exactTime >= ? and model.exactTime <= ?))\";\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t}\n\n\t\t\t\tList<LocaleMission> result = locmissMgr.findPageAllByHQL(queryStr+\" order by model.createTime desc,model.id asc\",page,rows, keys);// \n\t\t\t\tint total = locmissMgr.getTotalCountByHQL(\"select count(model)\"+queryStr,keys);// \n\n\t\t\t\tJSONArray options = new JSONArray();\n\t\t\t\tTimestamp today = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\tfor (LocaleMission loc : result) {\n\t\t\t\t\t// System.out.println(\"loc.getStatus():\"+loc.getStatus());\n\t\t\t\t\t\n\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\toption.put(\"Id\", loc.getId());\n\t\t\t\t\t\toption.put(\"Name\", loc.getCustomerName());\n\t\t\t\t\t\toption.put(\"Code\", loc.getCode());\n\t\t\t\t\t\toption.put(\"CustomerId\", loc.getCustomer().getId());\n\t\t\t\t\t\toption.put(\"CreatorName\", loc.getSysUserByCreatorId().getName());\n\t\t\t\t\t\toption.put(\"CreateDate\",DateTimeFormatUtil.DateTimeFormat.format(loc.getCreateTime()) + loc.getSysUserByCreatorId().getName());\n\t\t\t\t\t\toption.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\t\t\toption.put(\"Brief\", loc.getBrief());\n\t\t\t\t\t\toption.put(\"RegionId\", loc.getRegion().getId());\n\t\t\t\t\t\toption.put(\"Region\", loc.getRegion().getName());\n\t\t\t\t\t\toption.put(\"Address\", loc.getAddress_1());\n\t\t\t\t\t\toption.put(\"Remark\", loc.getRemark()==null?\"\":loc.getRemark());\n\t\t\t\t\t\toption.put(\"Tel\", loc.getTel());\n\t\t\t\t\t\toption.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\t\t\toption.put(\"Status\", loc.getStatus());\n\t\t\t\t\t\toption.put(\"Contactor\", loc.getContactor());\n\t\t\t\t\t\toption.put(\"ContactorTel\", loc.getContactorTel());\n\t\t\t\t\t\toption.put(\"Department\", loc.getDepartment());\n\t\t\t\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\toption.put(\"ExactTime\", loc.getExactTime()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getExactTime()));\n\t\t\t\t\t\t//option.put(\"MissionDesc\", loc.getMissionDesc());\n\t\t\t\t\t\toption.put(\"ModificatorDate\", loc.getModificatorDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getModificatorDate()));\n\t\t\t\t\t\toption.put(\"ModificatorId\", loc.getSysUserByModificatorId().getName());\n\t\t\t\t\t\toption.put(\"SiteManagerName\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\t\t\toption.put(\"SiteManagerId\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getId());\n\t\t\t\t\t\t//找现场业务下面的各个器具指派人\n\t\t\t\t\t\tString staffs=\"\";\n\t\t\t\t\t\tString queryString=\"from LocaleApplianceItem as a where a.localeMission.id = ?\";\n\t\t\t\t\t\tList<SysUser> workStaffs= locAppItemMgr.findByHQL(\"select distinct a.sysUser \"+queryString, loc.getId());\n\t\t\t\t\t\tif(!workStaffs.isEmpty()){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (SysUser user : workStaffs) {\n\t\t\t\t\t\t\t\tstaffs = staffs + user.getName()+\";\"; \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\tif(loc.getSysUserBySiteManagerId()!=null){\n\t\t\t\t\t\t\tif(staffs.indexOf(loc.getSysUserBySiteManagerId().getName()+\";\")<0){\n\t\t\t\t\t\t\t\tstaffs = staffs + loc.getSysUserBySiteManagerId().getName()+\";\"; \t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//找现场业务下面的各个器具信息\n\t\t\t\t\t\tString missionDesc=\"\";\n\t\t\t\t\t\tList<LocaleApplianceItem> locAppList= locAppItemMgr.findByHQL(queryString, loc.getId());\n\t\t\t\t\t\tif(!locAppList.isEmpty()){\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (LocaleApplianceItem locApp : locAppList) {\n\t\t\t\t\t\t\t\tmissionDesc = missionDesc + locApp.getApplianceName()+\" \"+locApp.getQuantity()+\"<br/>\"; \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"Staffs\", staffs);\n\t\t\t\t\t\toption.put(\"VehicleLisences\", loc.getVehicleLisences()==null?\"\":loc.getVehicleLisences());\n\t\t\t\t\t\toption.put(\"MissionDesc\", missionDesc);\n\t\t\t\t\t\toption.put(\"Status\", loc.getStatus());\n\t\t\t\t\t\toption.put(\"Tag\", \"0\");//已核定\n\t\t\t\t\t\toption.put(\"Feedback\", loc.getFeedback()==null?\"\":loc.getFeedback());//反馈\n\t\t\t\t\t\toption.put(\"CheckDate\", loc.getCheckDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getCheckDate()));//核定时间\n\t\t\t\t\t\toption.put(\"TentativeDate\", loc.getTentativeDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getTentativeDate()));\n\t\t\t\t\t\tif(loc.getStatus()==4&&loc.getTentativeDate()!=null){ //未核定\n\t\t\t\t\t\t\tif(loc.getTentativeDate().after(today)){//已到暂定日期可是未安排\n\t\t\t\t\t\t\t\toption.put(\"Tag\", \"1\");//未核定;;;已到暂定日期可是未安排\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\toption.put(\"Tag\", \"2\");//未核定;;;未到暂定日期\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\toptions.put(option);\n\t\t\t\t}\n\t\t\t\tres.put(\"total\", total);\n\t\t\t\tres.put(\"rows\", options);\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tres.put(\"total\", 0);\n\t\t\t\t\tres.put(\"rows\", new JSONArray());\n\t\t\t\t} catch (JSONException ex) {\n\t\t\t\t}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 6\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 6\", e);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\t\n\t\t\t\tresp.getWriter().write(res.toString());\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 7:// 车辆调度\n\t\t{\n\t\t\tJSONObject retObj7 = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString vehiclearrange = req.getParameter(\"vehiclearrange\").trim();// 车辆安排JSON\n\t\t\t\tJSONArray vehiclearrangeArray = new JSONArray(vehiclearrange);\n\t\t\t\tString missionarrange = req.getParameter(\"missionarrange\").trim();// 任务安排JSON\n\t\t\t\tJSONArray missionarrangeArray = new JSONArray(missionarrange);\n\t\t\t\tTimestamp beginTs;// 调度起始时间\n\t\t\t\tTimestamp endTs ;// 调度结束时间\n\t\t\t\n\t\t\t\tString ExactTime = req.getParameter(\"ExactTime\").trim();// 确定时间\n\t\t\t\tString BeginDate = req.getParameter(\"BeginDate\").trim();// 开始时间(发车时间)\n\t\t\t\tString AssemblingPlace = req.getParameter(\"AssemblingPlace\");// 集合地点\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\tbeginTs = Timestamp.valueOf(BeginDate);\n\t\t\t\tendTs = Timestamp.valueOf(String.format(\"%s 17:00:00\", ExactTime.trim()));\n\t\t\t\t\n\t\t\t\tVehicleManager vehmag = new VehicleManager();\n\t\t\t\tVehicleMissionManager vmmag = new VehicleMissionManager();\n\t\t\t\tLocaleMissionManager lmmag = new LocaleMissionManager();\n\t\t\t\tUserManager umag = new UserManager();\n\t\t\t\t\n\t\t\t\t/****************新建出车记录***********/\n\t\t\t\tString license = vehiclearrangeArray.getJSONObject(0).getString(\"vehicleid\"); // 获取调度车辆的牌照\n\t\t\t\tDrivingVehicle drivingvehicle=new DrivingVehicle();\n\t\t\t\tString driverName = req.getParameter(\"DriverName\");// 获取司机姓名\n\t\t\t\tList<SysUser> driver = umag.findByVarProperty(new KeyValueWithOperator(\"name\", driverName, \"=\"));// 获取司机的SysUser对象\n\t\t\t\tint driverid = -1;\n\t\t\t\tif (driver.size() > 0) {\n\t\t\t\t\tdriverid = driver.get(0).getId();// 获取司机id\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\"司机姓名错误!\");\n\t\t\t\t}\n\t\t\t\tString People = req.getParameter(\"People\");// 坐车人员\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t/************ 检查输入的“坐车人员”信息中的用户是否存在 *******************/\t\n\t\t\t\tStringBuffer staffs = new StringBuffer(\"\");\n\t\t\t\tif(People!=null&&People.length()>0){\t\t\t\t\t\t\n\t\t\t\t\tPeople = People.replace(';', ';');// 分号若为全角转为半角\n\t\t\t\t\tUserManager userMgr = new UserManager();\n\t\t\t\t\tKeyValueWithOperator k1 = new KeyValueWithOperator(\"status\", 0, \"=\"); \n\t\t\t\t\tString[] staff = People.split(\";+\");\n\t\t\t\t\t\n\t\t\t\t\tfor(String user : staff){\n\t\t\t\t\t\tKeyValueWithOperator k2 = new KeyValueWithOperator(\"name\", user, \"=\"); \n\t\t\t\t\t\tif(userMgr.getTotalCount(k1,k2) <= 0){\n\t\t\t\t\t\t\tthrow new Exception(String.format(\"现场检测人员 ‘%s’ 不存在或无效!\", user));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstaffs.append(user).append(\";\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tPeople=staffs.toString();\t\n\t\t\t\t\n\t\t\t\tdrivingvehicle.setAssemblingPlace(AssemblingPlace);\n\t\t\t\tdrivingvehicle.setBeginDate(beginTs);\n\t\t\t\tdrivingvehicle.setStatus(0);\n\t\t\t\tdrivingvehicle.setSysUserByDriverId(driver.get(0)); // 驾驶员\n\t\t\t\tdrivingvehicle.setEndDate(endTs);\t\t\t\t\t\n\t\t\t\tdrivingvehicle.setPeople(People);\n\t\t\t\tdrivingvehicle.setVehicle(vehmag.findByVarProperty(new KeyValueWithOperator(\"licence\", license,\"=\")).get(0));// 车辆\n\t\t\t\tif (!(new DrivingVehicleManager()).save(drivingvehicle)) {\n\t\t\t\t\tthrow new Exception(\"新建出车记录失败\");\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*********************对每一个现场任务,新增一条VehicleMission记录*****************************/\n\t\t\t\tif (vehiclearrangeArray.length() > 0&& missionarrangeArray.length() > 0) {//,任务安排和车辆安排不为空\t\t\t\t\n//\t\t\t\t\tif (beginTs.after(endTs)) {\n//\t\t\t\t\t\tthrow new Exception(\"调度时间错误,任务发车时间和任务确定时间不在同一天\");\n//\t\t\t\t\t}\n\t\t\t\t\tfor (int i = 0; i < missionarrangeArray.length(); i++) {// 任务JSONArray遍历\n\t\t\t\t\t\tJSONObject misarr = missionarrangeArray.getJSONObject(i);\n\t\t\t\t\t\tint missionId = misarr.getInt(\"Id\");// 获取任务id\n\t\t\t\t\t\tLocaleMission lmission = lmmag.findById(missionId);// 根据任务id获取任务\n\t\t\t\t\t\tif(lmission.getStatus()==2||lmission.getStatus()==3){\n\t\t\t\t\t\t\tthrow new Exception(\"该现场检测业务'已完工'或‘已注销’,不能修改!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tString templisences=(lmission.getVehicleLisences()==null?\"\":lmission.getVehicleLisences());//原任务所乘坐的车的车牌号\n\t\t\t\t\t\tString sssemblingPlace=(AssemblingPlace==null?\"\":AssemblingPlace);\n\t\t\t\t\t\tif(templisences.indexOf(license)<0){\n\t\t\t\t\t\t\tlmission.setVehicleLisences(templisences + license +\"(\"+ sssemblingPlace + \");\");//更新现场任务中的所乘车辆信息\n\t\t\t\t\t\t\t//lmission.setVehicleLisences(templisences + license + \";\");//更新现场任务中的所乘车辆信息\n\t\t\t\t\t\t}\n\t\t\t\t\t\tVehicleMission vm=new VehicleMission();//新增任务-出车记录信息\n\t\t\t\t\t\tvm.setDrivingVehicle(drivingvehicle);\n\t\t\t\t\t\tvm.setLocaleMission(lmission);\t\n\t\t\t\t\t\tif (vmmag.save(vm)) {\n\t\t\t\t\t\t\t// System.out.println(\"分配成功\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception(\"分配失败\");//新增任务-出车记录信息\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tlmission.setStatus(1);//更新现场任务的状态(已分配),(是不是也要更新任务“确定时间”)\n\t\t\t\t\t\tlmission.setExactTime(beginTs);\t\t\t\t\t\t\n\t\t\t\t\t\tif (lmmag.update(lmission)) {\n\t\t\t\t\t\t\t//System.out.println(\"更新成功\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception(\"任务状态更新失败\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tretObj7.put(\"IsOK\", true);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// System.out.println(\"update failed\");\n\t\t\t\ttry {\n\t\t\t\t\tretObj7.put(\"IsOK\", false);\n\t\t\t\t\tretObj7.put(\"msg\", String.format(\"处理失败!错误信息:%s\",\n\t\t\t\t\t\t\t(e != null && e.getMessage() != null) ? e\n\t\t\t\t\t\t\t\t\t.getMessage() : \"无\"));\n\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 7\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 7\", e);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retObj7.toString());\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 8:// 查询现场业务(现场业务管理中使用)\n\t\t{\n\t\t\tJSONObject res = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString QueryName = req.getParameter(\"QueryName\");\n\t\t\t\tString BeginDate = req.getParameter(\"History_BeginDate\");\n\t\t\t\tString EndDate = req.getParameter(\"History_EndDate\");\n\t\t\t\tString MissionStatus = req.getParameter(\"MissionStatus\");\n\t\t\t\tString Department = req.getParameter(\"Department\");\n\t\t\t\tString Code = req.getParameter(\"Code\");\n\t\t\t\tif (QueryName == null) {// 避免NullPointerException\n\t\t\t\t\tQueryName = \"\";\n\t\t\t\t}\n\t\t\t\tif (BeginDate == null) {// 避免NullPointerException\n\t\t\t\t\tBeginDate = \"\";\n\t\t\t\t}\n\t\t\t\tif (EndDate == null) {// 避免NullPointerException\n\t\t\t\t\tEndDate = \"\";\n\t\t\t\t}\n\t\t\t\tif (MissionStatus == null) {// 避免NullPointerException\n\t\t\t\t\tMissionStatus = \"\";\n\t\t\t\t}\n\t\t\t\tif (Department == null) {// 避免NullPointerException\n\t\t\t\t\tDepartment = \"\";\n\t\t\t\t}\n\t\t\t\tint page = 1;// 查询页码\n\t\t\t\tif (req.getParameter(\"page\") != null)\n\t\t\t\t\tpage = Integer\n\t\t\t\t\t\t\t.parseInt(req.getParameter(\"page\").toString());\n\t\t\t\tint rows = 10;// 每页显示10行\n\t\t\t\tif (req.getParameter(\"rows\") != null)\n\t\t\t\t\trows = Integer\n\t\t\t\t\t\t\t.parseInt(req.getParameter(\"rows\").toString());\n\n\t\t\t\tString queryStr = \"from LocaleMission as model where model.status <> 3 \";\n\t\t\t\tList<Object> keys = new ArrayList<Object>();\n\t\t\t\t//List<KeyValueWithOperator> condList = new ArrayList<KeyValueWithOperator>();\n\t\t\t\t//condList.add(new KeyValueWithOperator(\"status\", 3, \"<>\"));//注销\n\t\t\t\t\n\t\t\t\tif (QueryName != null && QueryName.trim().length() > 0) {\n\t\t\t\t\tString Name = URLDecoder.decode(QueryName.trim(),\n\t\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\t\t\n\t\t\t\t\t//condList.add(new KeyValueWithOperator(\"customerName\",Name, \"=\"));\n\t\t\t\t\tqueryStr=queryStr+\" and model.customerName like ?\";\n\t\t\t\t\tkeys.add(\"%\" + Name + \"%\");\n\t\t\t\t}\n\t\t\t\tif (MissionStatus != null && MissionStatus.trim().length() > 0) {\n\t\t\t\t\tint status = Integer.parseInt(URLDecoder.decode(MissionStatus.trim(),\"UTF-8\"));\n\n\t\t\t\t\tif(status==0){//未完工\n\t\t\t\t\t\tqueryStr=queryStr+\" and model.status <> ?\";\n\t\t\t\t\t\n\t\t\t\t\t\tkeys.add(2);\n\t\t\t\t\t}else{\n\t\t\t\t\t//condList.add(new KeyValueWithOperator(\"status\",status, \"=\"));\n\t\t\t\t\t\tqueryStr=queryStr+\" and model.status = ?\";\n\t\t\t\t\t\tkeys.add(status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (Department != null && Department.trim().length() > 0) {\n\t\t\t\t\tString department = URLDecoder.decode(Department.trim(),\n\t\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\t\t\n\t\t\t\t\t//condList.add(new KeyValueWithOperator(\"department\",\"%\"+department+\"%\", \"like\"));\n\t\t\t\t\tqueryStr=queryStr+\" and model.department like ?\";\n\t\t\t\t\tkeys.add(\"%\" + department + \"%\");\n\t\t\t\t}\n\t\t\t\tif (BeginDate != null && BeginDate.trim().length() > 0&&(EndDate == null || EndDate.trim().length() == 0)) {\n\t\t\t\t\tTimestamp beginTs = Timestamp.valueOf(String.format(\"%s 00:00:000\", BeginDate.trim()));\n\t\t\t\t\t//condList.add(new KeyValueWithOperator(\"tentativeDate\",beginTs, \">=\"));\n\t\t\t\t\t\n\t\t\t\t\tqueryStr=queryStr+\" and (model.tentativeDate >= ? or model.checkDate >= ? or model.exactTime >= ?)\";\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\t\n\t\t\t\t}else if (EndDate != null && EndDate.trim().length() > 0&&(BeginDate == null || BeginDate.trim().length() == 0)) {\n\t\t\t\t\tTimestamp endTs = Timestamp.valueOf(String.format(\n\t\t\t\t\t\t\t\"%s 23:59:00\", EndDate.trim()));\n\t\t\t\t\t\n\t\t\t\t // condList.add(new KeyValueWithOperator(\"tentativeDate\",endTs, \"<=\"));\n\t\t\t\t\tqueryStr=queryStr+\" and (model.tentativeDate <= ? or model.checkDate <= ? or model.exactTime <= ?)\";\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t}else if (BeginDate != null && BeginDate.trim().length() > 0&&EndDate != null && EndDate.trim().length() > 0) {\n\t\t\t\t\tTimestamp endTs = Timestamp.valueOf(String.format(\"%s 23:59:00\", EndDate.trim()));\n\t\t\t\t\tTimestamp beginTs = Timestamp.valueOf(String.format(\"%s 00:00:000\", BeginDate.trim()));\n\t\t\t\t\n\t\t\t\t // condList.add(new KeyValueWithOperator(\"tentativeDate\",endTs, \"<=\"));\n\t\t\t\t\tqueryStr=queryStr+\" and ((model.tentativeDate >= ? and model.tentativeDate <= ? ) or (model.checkDate >= ? and model.checkDate <= ? ) or (model.exactTime >= ? and model.exactTime <= ?))\";\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t\tkeys.add(beginTs);\n\t\t\t\t\tkeys.add(endTs);\n\t\t\t\t}\n\t\t\t\tif (Code != null && Code.trim().length() > 0) {\n\t\t\t\t\tString code = URLDecoder.decode(Code.trim(),\n\t\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\t\tqueryStr=queryStr+\" and model.code like ?\";\n\t\t\t\t\tkeys.add(\"%\" + code + \"%\");\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\tList<LocaleMission> result = locmissMgr.findPageAllByHQL(queryStr+\" order by model.checkDate asc,model.id asc\",page,rows, keys);// 查询未被删除的任务\n\t\t\t\tint total = locmissMgr.getTotalCountByHQL(\"select count(model)\"+queryStr,keys);// 未被删除的任务总数\n\n\t\t\t\tJSONArray options = new JSONArray();\n\t\t\t\tTimestamp today = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\tfor (LocaleMission loc : result) {\n\t\t\t\t\t// System.out.println(\"loc.getStatus():\"+loc.getStatus());\n\t\t\t\t\t\n\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\toption.put(\"Id\", loc.getId());\n\t\t\t\t\t\toption.put(\"Name\", loc.getCustomerName());\n\t\t\t\t\t\toption.put(\"Code\", loc.getCode());\n\t\t\t\t\t\toption.put(\"CustomerId\", loc.getCustomer().getId());\n\t\t\t\t\t\t//option.put(\"CreatorName\", loc.getSysUserByCreatorId().getName());\n\t\t\t\t\t\toption.put(\"CreateDate\",DateTimeFormatUtil.DateTimeFormat.format(loc.getCreateTime())+\" \"+loc.getSysUserByCreatorId().getName());\n\t\t\t\t\t\toption.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\t\t\toption.put(\"Brief\", loc.getBrief());\n\t\t\t\t\t\toption.put(\"RegionId\", loc.getRegion().getId());\n\t\t\t\t\t\toption.put(\"Region\", loc.getRegion().getName());\n\t\t\t\t\t\toption.put(\"Address\", loc.getAddress_1());\n\t\t\t\t\t\toption.put(\"Remark\", loc.getRemark()==null?\"\":loc.getRemark());\n\t\t\t\t\t\toption.put(\"Tel\", loc.getTel());\n\t\t\t\t\t\toption.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\t\t\toption.put(\"Status\", loc.getStatus());\n\t\t\t\t\t\toption.put(\"Contactor\", loc.getContactor());\n\t\t\t\t\t\toption.put(\"ContactorTel\", loc.getContactorTel());\n\t\t\t\t\t\toption.put(\"Department\", loc.getDepartment());\n\t\t\t\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\toption.put(\"ExactTime\", loc.getExactTime()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getExactTime()));\n\t\t\t\t\t\t//option.put(\"MissionDesc\", loc.getMissionDesc());\n\t\t\t\t\t\toption.put(\"ModificatorDate\", loc.getModificatorDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getModificatorDate()));\n\t\t\t\t\t\toption.put(\"ModificatorId\", loc.getSysUserByModificatorId().getName());\n\t\t\t\t\t\toption.put(\"SiteManagerName\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\t\t\toption.put(\"SiteManagerId\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getId());\n\t\t\t\t\t\t//找现场业务下面的各个器具指派人\n\t\t\t\t\t\tString staffs=\"\";\n\t\t\t\t\t\tString queryString=\"from LocaleApplianceItem as a where a.localeMission.id = ?\";\n\t\t\t\t\t\tList<SysUser> workStaffs= locAppItemMgr.findByHQL(\"select distinct a.sysUser \"+queryString, loc.getId());\n\t\t\t\t\t\tif(!workStaffs.isEmpty()){\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (SysUser user : workStaffs) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tstaffs = staffs + user.getName()+\";\"; \t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(loc.getSysUserBySiteManagerId()!=null){\n\t\t\t\t\t\t\tif(staffs.indexOf(loc.getSysUserBySiteManagerId().getName()+\";\")<0){\n\t\t\t\t\t\t\t\tstaffs = staffs + loc.getSysUserBySiteManagerId().getName()+\";\"; \t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//找现场业务下面的各个器具指派人\n\t\t\t\t\t\t//String AssistStaff=\"\";\n\t\t\t\t\t\t//String queryString1=\"from LocaleApplianceItem as a where a.localeMission.id = ?\";\n\t\t\t\t\t\tList<String> AssistStaffs= locAppItemMgr.findByHQL(\"select distinct a.assistStaff \"+queryString, loc.getId());\n\t\t\t\t\t\tif(!AssistStaffs.isEmpty()){\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String staff : AssistStaffs) {\n\t\t\t\t\t\t\t\tif(staff!=null)\n\t\t\t\t\t\t\t\t\tstaffs = staffs + staff +\";\"; \t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//找现场业务下面的各个器具信息\n\t\t\t\t\t\tString missionDesc=\"\";\n\t\t\t\t\t\tList<LocaleApplianceItem> locAppList= locAppItemMgr.findByHQL(queryString, loc.getId());\n\t\t\t\t\t\tif(!locAppList.isEmpty()){\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (LocaleApplianceItem locApp : locAppList) {\n\t\t\t\t\t\t\t\tmissionDesc = missionDesc + locApp.getApplianceName()+\" \"+locApp.getQuantity()+\"<br/>\"; \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"Staffs\", staffs);\n\t\t\t\t\t\toption.put(\"VehicleLisences\", loc.getVehicleLisences()==null?\"\":loc.getVehicleLisences());\n\t\t\t\t\t\toption.put(\"MissionDesc\", missionDesc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//option.put(\"Status\", loc.getStatus());\n\t\t\t\t\t\toption.put(\"Tag\", \"0\");//已核定\n\t\t\t\t\t\toption.put(\"Feedback\", loc.getFeedback()==null?\"\":loc.getFeedback());//反馈\n\t\t\t\t\t\toption.put(\"CheckDate\", loc.getCheckDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getCheckDate()));//核定时间\n\t\t\t\t\t\toption.put(\"TentativeDate\", loc.getTentativeDate()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getTentativeDate()));\n\t\t\t\t\t\tif(loc.getStatus()==4&&loc.getTentativeDate()!=null){ //未核定\n\t\t\t\t\t\t\tif(loc.getTentativeDate().after(today)){//已到暂定日期可是未安排\n\t\t\t\t\t\t\t\toption.put(\"Tag\", \"1\");//未核定;;;已到暂定日期可是未安排\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\toption.put(\"Tag\", \"2\");//未核定;;;未到暂定日期\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\toption.put(\"HeadNameId\", loc.getAddress()==null?\"\":loc.getAddress().getId());\n\t\t\t\t\t\toption.put(\"HeadNameName\", loc.getAddress()==null?\"\":loc.getAddress().getHeadName());\n\t\t\t\t\t\toptions.put(option);\n\t\t\t\t}\n\t\t\t\tres.put(\"total\", total);\n\t\t\t\tres.put(\"rows\", options);\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tres.put(\"total\", 0);\n\t\t\t\t\tres.put(\"rows\", new JSONArray());\n\t\t\t\t} catch (JSONException ex) {\n\t\t\t\t}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 8\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 8\", e);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\t\n\t\t\t\tresp.getWriter().write(res.toString());\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 9: // 现场任务反馈操作\n\t\t\tJSONObject retJSON9 = new JSONObject();\n\t\t\ttry{\n\t\t\t\tint id = Integer.parseInt(req.getParameter(\"Id\"));\n\t\t\t\tString Feedback = req.getParameter(\"Feedback\");\n\t\t\t\tLocaleMission localmission = locmissMgr.findById(id);\n\t\t\t\n\t\t\t\tSysUser loginuser=(SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser);\n\t\t\t\tTimestamp today = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\tString loginname = (loginuser==null?\"\":loginuser.getName());\n\t\t\t\tString now=DateTimeFormatUtil.DateTimeFormat.format(today);\n\t\t\t\t\n\t\t\t\tFeedback=String.format(\"%s (%s %s)\", Feedback,loginname,now);\t\t\t\n\t\t\t\tlocalmission.setFeedback(Feedback);\n\t\t\t\t//localmission.setStatus(2);// 将指定Id任务状态置为2,表示已完工\n\t\t\t\t\n\t\t\t\tif(locmissMgr.update(localmission)){\n\t\t\t\t\tretJSON9.put(\"IsOK\", true);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"更新数据库失败!\");\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\ttry{\n\t\t\t\t\tretJSON9.put(\"IsOK\", false);\n\t\t\t\t\tretJSON9.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage() : \"无\"));\n\t\t\t\t}catch(Exception ex){}\n\t\t\t\t\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 9\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 9\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retJSON9.toString());\n\t\t\t}\n\t\t\tbreak;\t\n\t\tcase 10: // 其他交通方式,车辆信息里面添“来车”“自行车”等;\n\t\t\tJSONObject retJSON10 = new JSONObject();\n\t\t\ttry{\n\t\t\t\tint id = Integer.parseInt(req.getParameter(\"id\"));\n\t\t\t\n\t\t\t\tString ExactTime =req.getParameter(\"ExactTime\");\n\t\t\t\tString Remark =req.getParameter(\"Remark\");\n\t\t\t\tString QTway =req.getParameter(\"QTway\");\n\t\t\t\t\n\t\t\t\tTimestamp extime=new java.sql.Timestamp(DateTimeFormatUtil.DateFormat.parse(ExactTime).getTime());\t\n\t\t\t\tLocaleMission localmission = locmissMgr.findById(id);\n\t\t\t\tif(localmission.getStatus()==2||localmission.getStatus()==3){\n\t\t\t\t\tthrow new Exception(\"该现场检测业务'已完工'或‘已注销’,不能修改!\");\n\t\t\t\t}\n\t\t\t\tif(QTway!=null&&QTway.length()>0){\n\t\t\t\t\tlocalmission.setVehicleLisences(URLDecoder.decode(QTway.trim(),\"UTF-8\"));\n\t\t\t\t}\n\t\t\t\tlocalmission.setStatus(1);// 将指定Id任务状态置为1,表示已分配\n\t\t\t\tlocalmission.setExactTime(extime);// \n\t\t\t\tif(Remark!=null&&Remark.length()>0){\n\t\t\t\t\tlocalmission.setRemark(URLDecoder.decode(Remark,\"UTF-8\"));// \n\t\t\t\t}\n\t\t\t\t//List<VehicleMission> veMiList = (new VehicleMissionManager()).findByVarProperty(new KeyValueWithOperator(\"localeMission\",localmission,\"=\"));\n\t\t\t\t\n\t\t\t\tif(!locmissMgr.update(localmission))\n\t\t\t\t\tthrow new Exception(\"更新数据库失败!\");;\n\t\t\t\tretJSON10.put(\"IsOK\", true);\n\t\t\t}catch(Exception e){\n\t\t\t\ttry{\n\t\t\t\t\tretJSON10.put(\"IsOK\", false);\n\t\t\t\t\tretJSON10.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage() : \"无\"));\n\t\t\t\t}catch(Exception ex){}\n\t\t\t\t\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 10\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 10\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retJSON10.toString());\n\t\t\t}\n\t\t\tbreak;\n\t \tcase 11:// 查询现场业务的器具信息\n\t\t\n\t\t\tJSONObject res = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString Id = req.getParameter(\"Id\");\n\t\t\t\tif(Id!=null&&Id.length()>0){\n\t\t\t\t \n\t\t\t\t\tList<LocaleApplianceItem> result = locAppItemMgr.findByVarProperty(new KeyValueWithOperator(\"localeMission.id\",Integer.parseInt(Id),\"=\"));// \n\t\t\t\t\tint total = locAppItemMgr.getTotalCount(new KeyValueWithOperator(\"localeMission.id\",Integer.parseInt(Id),\"=\"));// \n\t\t\t\t\tApplianceSpeciesManager speciesMgr = new ApplianceSpeciesManager();\n\t\t\t\t\tApplianceStandardNameManager standardNameMgr = new ApplianceStandardNameManager();\n\t\t\t\t\tJSONArray options = new JSONArray();\n\t\t\t\t\tif(result != null && result.size() > 0){\n\t\t\t\t\t\tfor (LocaleApplianceItem loc : result) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\t\t\toption.put(\"Id\", loc.getId());\n\t\t\t\t\t\t\t\tif(loc.getSpeciesType()!=null){\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesId\", loc.getApplianceSpeciesId());\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\t\tif(loc.getSpeciesType()){\t//器具授权(分类)名称\n\t\t\t\t\t\t\t\t\t\toption.put(\"SpeciesType\", \"1\");\t//器具分类类型\n\t\t\t\t\t\t\t\t\t\tApplianceSpecies spe = speciesMgr.findById(loc.getApplianceSpeciesId());\n\t\t\t\t\t\t\t\t\t\tif(spe != null){\n\t\t\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesName\", spe.getName());\n\t\t\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesNameStatus\", spe.getStatus());\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else{\t//器具标准名称\n\t\t\t\t\t\t\t\t\t\toption.put(\"SpeciesType\", \"0\");\n\t\t\t\t\t\t\t\t\t\tApplianceStandardName stName = standardNameMgr.findById(loc.getApplianceSpeciesId());\n\t\t\t\t\t\t\t\t\t\tif(stName != null){\n\t\t\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesName\", stName.getName());\n\t\t\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesNameStatus\", stName.getStatus());\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceName\", loc.getApplianceName()==null?\"\":loc.getApplianceName());\t//器具名称(常用名称)\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesId\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesName\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceName\", \"\");\t//\n\t\t\t\t\t\t\t\t\toption.put(\"SpeciesType\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceSpeciesNameStatus\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\toption.put(\"ApplianceCode\", loc.getAppFactoryCode()==null?\"\":loc.getAppFactoryCode());\t//出厂编号\n\t\t\t\t\t\t\t\toption.put(\"AppManageCode\", loc.getAppManageCode()==null?\"\":loc.getAppManageCode());\t//管理编号\n\t\t\t\t\t\t\t\toption.put(\"Model\", loc.getApplianceName()==null?\"\":loc.getModel()==null?\"\":loc.getModel());\t//型号规格\n\t\t\t\t\t\t\t\toption.put(\"Range\", loc.getRange()==null?\"\":loc.getRange());\t\t//测量范围\n\t\t\t\t\t\t\t\toption.put(\"Accuracy\", loc.getAccuracy()==null?\"\":loc.getAccuracy());\t//精度等级\n\t\t\t\t\t\t\t\toption.put(\"Manufacturer\", loc.getManufacturer()==null?\"\":loc.getManufacturer());\t//制造厂商\n\t\t\t\t\t\t\t\toption.put(\"ReportType\", loc.getCertType()==null?\"\":loc.getCertType());\t//报告形式\n\t\t\t\t\t\t\t\toption.put(\"TestFee\", loc.getTestCost()==null?\"\":loc.getTestCost());\t//检测费\n\t\t\t\t\t\t\t\toption.put(\"RepairFee\", loc.getRepairCost()==null?\"\":loc.getRepairCost());\t//检测费\n\t\t\t\t\t\t\t\toption.put(\"MaterialFee\", loc.getMaterialCost()==null?\"\":loc.getMaterialCost());\t//检测费\n\t\t\t\t\t\t\t\toption.put(\"Quantity\", loc.getQuantity()==null?\"\":loc.getQuantity());\t//台/件数\n\t\t\t\t\t\t\t\toption.put(\"WorkStaff\", loc.getSysUser()==null?\"\":loc.getSysUser().getName());\t//派定人\n\t\t\t\t\t\t\t\toption.put(\"AssistStaff\", loc.getAssistStaff()==null?\"\":loc.getAssistStaff());\t//\n\t\t\t\t\t\t\t\toption.put(\"Remark\", loc.getRemark()==null?\"\":loc.getRemark());\t//\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\toptions.put(option);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tres.put(\"total\", total);\n\t\t\t\t\t\tres.put(\"rows\", options);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tres.put(\"total\", 0);\n\t\t\t\t\t\tres.put(\"rows\", new JSONArray());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"Id空\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tres.put(\"total\", 0);\n\t\t\t\t\tres.put(\"rows\", new JSONArray());\n\t\t\t\t} catch (JSONException ex) {\n\t\t\t\t}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 11\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 11\", e);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\t\n\t\t\t\tresp.getWriter().write(res.toString());\n\t\t\t}\n\n\t\t\tbreak;\n\t \tcase 12: //查找委托单位的现场任务的历史器具信息\n\t\t\tJSONObject retJSON = new JSONObject();\n\t\t\tint totalSize = 0;\n\t\t\ttry {\n\t\t\t\tJSONArray jsonArray = new JSONArray();\n\t\t\t\tint page = 0;\t//当前页面\n\t\t\t\tif (req.getParameter(\"page\") != null)\n\t\t\t\t\tpage = Integer.parseInt(req.getParameter(\"page\").toString());\n\t\t\t\tint rows = 10;\t//页面大小\n\t\t\t\tif (req.getParameter(\"rows\") != null)\n\t\t\t\t\trows = Integer.parseInt(req.getParameter(\"rows\").toString());\n\t\t\t\tString CustomerName = req.getParameter(\"CustomerName\");\n\t\t\t\tif(CustomerName != null && CustomerName.trim().length() > 0){\n\t\t\t\t\tString ApplianceName = req.getParameter(\"ApplianceName\");\n\t\t\t\t\tString BeginDate = req.getParameter(\"BeginDate\");\n\t\t\t\t\tString EndDate = req.getParameter(\"EndDate\");\n\t\t\t\t\tString cusName = URLDecoder.decode(CustomerName.trim(), \"UTF-8\"); //解决jquery传递中文乱码问题\n\t\t\t\t\t//System.out.println(cusName);\n\t\t\t\t\tList<KeyValueWithOperator> condList = new ArrayList<KeyValueWithOperator>();\n\t\t\t\t\t\n\t\t\t\t\tcondList.add(new KeyValueWithOperator(\"localeMission.customerName\",cusName,\"=\"));\n\t\t\t\t\tif(BeginDate != null && BeginDate.length() > 0){\n\t\t\t\t\t\tcondList.add(new KeyValueWithOperator(\"localeMission.exactTime\", new Timestamp(java.sql.Date.valueOf(BeginDate).getTime()), \">=\"));\n\t\t\t\t\t}\n\t\t\t\t\tif(EndDate != null && EndDate.length() > 0){\n\t\t\t\t\t\tcondList.add(new KeyValueWithOperator(\"localeMission.exactTime\", new Timestamp(java.sql.Date.valueOf(EndDate).getTime()), \"<\"));\n\t\t\t\t\t}\n\t\t\t\t\tif(ApplianceName != null && ApplianceName.trim().length() > 0 ){\n\t\t\t\t\t\tString appName = URLDecoder.decode(ApplianceName.trim(), \"UTF-8\");\n\t\t\t\t\t\tcondList.add(new KeyValueWithOperator(\"applianceName\", \"%\"+appName+\"%\", \"like\"));\n\t\t\t\t\t}\n\t\t\t\t\tcondList.add(new KeyValueWithOperator(\"localeMission.status\", 3, \"<>\"));\n\t\t\t\t\ttotalSize = locAppItemMgr.getTotalCount(condList);\n\t\t\t\t\tList<LocaleApplianceItem> retList = locAppItemMgr.findPagedAllBySort(page, rows, \"localeMission.exactTime\", false, condList);\n\t\t\t\t\tif(retList != null && retList.size() > 0){\n\t\t\t\t\t\tApplianceSpeciesManager speciesMgr = new ApplianceSpeciesManager();\n\t\t\t\t\t\tApplianceStandardNameManager standardNameMgr = new ApplianceStandardNameManager();\n\t\t\t\t\t\n\t\t\t\t\t\tSimpleDateFormat sf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor(LocaleApplianceItem locApp : retList){\n\t\t\t\t\t\t\tJSONObject jsonObj = new JSONObject();\n\t\t\t\t\t\t\tjsonObj.put(\"CustomerName\", locApp.getLocaleMission().getCustomerName());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(locApp.getSpeciesType()!=null){\n\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesId\", locApp.getApplianceSpeciesId());\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(locApp.getSpeciesType()){\t//器具授权(分类)名称\n\t\t\t\t\t\t\t\t\tjsonObj.put(\"SpeciesType\", 1);\t//器具分类类型\n\t\t\t\t\t\t\t\t\tApplianceSpecies spe = speciesMgr.findById(locApp.getApplianceSpeciesId());\n\t\t\t\t\t\t\t\t\tif(spe != null){\n\t\t\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesName\", spe.getName());\n\t\t\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesNameStatus\", spe.getStatus());\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\t//器具标准名称\n\t\t\t\t\t\t\t\t\tjsonObj.put(\"SpeciesType\", 0);\n\t\t\t\t\t\t\t\t\tApplianceStandardName stName = standardNameMgr.findById(locApp.getApplianceSpeciesId());\n\t\t\t\t\t\t\t\t\tif(stName != null){\n\t\t\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesName\", stName.getName());\n\t\t\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesNameStatus\", stName.getStatus());\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tcontinue;\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\tjsonObj.put(\"ApplianceName\", locApp.getApplianceName()==null?\"\":locApp.getApplianceName());\t//器具名称(常用名称)\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesId\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesName\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceName\", \"\");\t//\n\t\t\t\t\t\t\t\tjsonObj.put(\"SpeciesType\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t\tjsonObj.put(\"ApplianceSpeciesNameStatus\", \"\");\t//器具分类Id(或器具标准名称ID)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//jsonObj.put(\"ApplianceName\", locApp.getApplianceName()==null?\"\":locApp.getApplianceName());\t//器具名称(常用名称)\n\t\t\t\t\t\t\tjsonObj.put(\"ApplianceCode\", locApp.getAppFactoryCode()==null?\"\":locApp.getAppFactoryCode());\t//出厂编号\n\t\t\t\t\t\t\tjsonObj.put(\"AppManageCode\", locApp.getAppManageCode()==null?\"\":locApp.getAppManageCode());\t//管理编号\n\t\t\t\t\t\t\tjsonObj.put(\"Model\", locApp.getApplianceName()==null?\"\":locApp.getModel()==null?\"\":locApp.getModel());\t//型号规格\n\t\t\t\t\t\t\tjsonObj.put(\"Range\", locApp.getRange()==null?\"\":locApp.getRange());\t\t//测量范围\n\t\t\t\t\t\t\tjsonObj.put(\"Accuracy\", locApp.getAccuracy()==null?\"\":locApp.getAccuracy());\t//精度等级\n\t\t\t\t\t\t\tjsonObj.put(\"Manufacturer\", locApp.getManufacturer()==null?\"\":locApp.getManufacturer());\t//制造厂商\n\t\t\t\t\t\t\tjsonObj.put(\"ReportType\", locApp.getCertType()==null?\"\":locApp.getCertType());\t//报告形式\n\t\t\t\t\t\t\tjsonObj.put(\"TestFee\", locApp.getTestCost()==null?\"\":locApp.getTestCost());\t//检测费\n\t\t\t\t\t\t\tjsonObj.put(\"Quantity\", locApp.getQuantity()==null?\"\":locApp.getQuantity());\t//台/件数\n\t\t\t\t\t\t\tjsonObj.put(\"WorkStaff\", locApp.getSysUser()==null?\"\":locApp.getSysUser().getName());\t//派定人\n\t\t\t\t\t\t\tjsonObj.put(\"AssistStaff\", locApp.getAssistStaff()==null?\"\":locApp.getAssistStaff());\t//\n\t\t\t\t\t\t\tjsonObj.put(\"Remark\", locApp.getRemark()==null?\"\":locApp.getRemark());\t//\n\t\t\t\t\t\t\tjsonArray.put(jsonObj);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"委托单位名称为空!\");\n\t\t\t\t}\n\t\t\t\tretJSON.put(\"total\", totalSize);\n\t\t\t\tretJSON.put(\"rows\", jsonArray);\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tretJSON.put(\"total\", 0);\n\t\t\t\t\tretJSON.put(\"rows\", new JSONArray());\n\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t}\n\t\t\t\tif(e.getClass() == java.lang.Exception.class){\t//自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 12\", e);\n\t\t\t\t}else{\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 12\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/json;charset=utf-8\");\n\t\t\t\t//System.out.println(retJSON.toString());\n\t\t\t\tresp.getWriter().write(retJSON.toString());\n\t\t\t}\n\t\t\tbreak;\n\t \tcase 13://查询现场任务条目(用于打印)\n\t\t\tJSONObject resJson7 = new JSONObject();\n\t\t\ttry{\n\t\t\t\tString localeMissionId = req.getParameter(\"localeMissionId\"); \n\t\t\t\tList<KeyValueWithOperator> quoList = new ArrayList<KeyValueWithOperator>();\n\t\t\t\tList<LocaleApplianceItem> locAppItemList;\n\t\t\t\tCustomerManager cusMgr=new CustomerManager();\n\t\t\t\tCommissionSheetManager comsheetMgr=new CommissionSheetManager();\n\t\t\t\tList<CommissionSheet> comsheetList=new ArrayList<CommissionSheet>();\n\t\t\t\tint total5;\n\t\t\t\tif(localeMissionId == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"任务书号无效!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlocAppItemList = locAppItemMgr.findByVarProperty(new KeyValueWithOperator(\"localeMission.id\",Integer.parseInt(localeMissionId),\"=\"));\n\t\t\t\t\ttotal5 = locAppItemMgr.getTotalCount(new KeyValueWithOperator(\"localeMission.id\",Integer.parseInt(localeMissionId),\"=\"));\n\t\t\t\t}\n\t\t\t\tJSONArray optionsq = new JSONArray();\n\t\t\t\tint id=0;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (LocaleApplianceItem locAppItem : locAppItemList) {\n\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\tString applianceInfo=\"\";\n\t\t\t\t\tif(locAppItem.getSpeciesType()!=null){\n\t\t\t\t\t\toption.put(\"Id\", id++);\n\t\t\t\t\t\tif(locAppItem.getApplianceName()==null||locAppItem.getApplianceName().length()==0){\n\t\t\t\t\t\t\tif(!locAppItem.getSpeciesType()){\n\t\t\t\t\t\t\t\tApplianceStandardNameManager standardNameMgr = new ApplianceStandardNameManager();\n\t\t\t\t\t\t\t\tApplianceStandardName stName = standardNameMgr.findById(locAppItem.getApplianceSpeciesId());\n\t\t\t\t\t\t\t\tif(stName != null){\n\t\t\t\t\t\t\t\t\toption.put(\"ApplianceName\", stName.getName());\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\toption.put(\"ApplianceName\", locAppItem.getApplianceName());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"Quantity\", locAppItem.getQuantity());\n\t\t\t\t\t\t\n\t\t\t\t\t\tcomsheetList=comsheetMgr.findByVarProperty(new KeyValueWithOperator(\"localeApplianceItemId\", locAppItem.getId(), \"=\"),\n\t\t\t\t\t\t\t\t\tnew KeyValueWithOperator(\"status\",FlagUtil.CommissionSheetStatus.Status_YiZhuXiao, \"<>\"));\n\t\t\t\t\t\tif(comsheetList!=null&&comsheetList.size()>0){\n\t\t\t\t\t\t\tapplianceInfo = applianceInfo + comsheetList.get(0).getCode()+\"/\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tapplianceInfo = applianceInfo + option.getString(\"ApplianceName\");\n\t\t\t\t\t\toption.put(\"Model\",locAppItem.getModel()==null?\"\":locAppItem.getModel());\n\t\t\t\t\t\toption.put(\"Accuracy\", locAppItem.getAccuracy()==null?\"\":locAppItem.getAccuracy());\n\t\t\t\t\t\toption.put(\"Range\", locAppItem.getRange()==null?\"\":locAppItem.getRange());\t\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"AppFactoryCode\", locAppItem.getAppFactoryCode()==null?\"\":locAppItem.getAppFactoryCode());\n\t\t\t\t\t\toption.put(\"AppManageCode\", locAppItem.getAppManageCode()==null?\"\":locAppItem.getAppManageCode());\n\t\t\t\t\t\toption.put(\"Manufacturer\", locAppItem.getManufacturer()==null?\"\":locAppItem.getManufacturer());\n\t\t\t\t\t\tif(option.getString(\"Model\").length()>0){\n\t\t\t\t\t\t\tapplianceInfo = applianceInfo + \"/\" + option.getString(\"Model\");\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tif(option.getString(\"Range\").length()>0){\n\t\t\t\t\t\t\tapplianceInfo = applianceInfo + \"/\" + option.getString(\"Range\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(option.getString(\"Accuracy\").length()>0){\n\t\t\t\t\t\t\tapplianceInfo = applianceInfo + \"/\" + option.getString(\"Accuracy\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(option.getString(\"AppFactoryCode\").length()>0){\n\t\t\t\t\t\t\tapplianceInfo = applianceInfo + \"/\" + option.getString(\"AppFactoryCode\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(option.getString(\"AppManageCode\").length()>0){\n\t\t\t\t\t\t\tapplianceInfo = applianceInfo + \"/\" + option.getString(\"AppManageCode\");\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"applianceInfo\", applianceInfo);\n\t\t\t\t\t\tString CertType=\"\";\n\t\t\t\t\t\tif(locAppItem.getCertType()!=null&&locAppItem.getCertType().length()>0){\n\t\t\t\t\t\t\tif(locAppItem.getCertType().equals(\"1\")){\n\t\t\t\t\t\t\t\tCertType=\"检定\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(locAppItem.getCertType().equals(\"2\")){\n\t\t\t\t\t\t\t\tCertType=\"校准\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(locAppItem.getCertType().equals(\"3\")){\n\t\t\t\t\t\t\t\tCertType=\"检测\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(locAppItem.getCertType().equals(\"4\")){\n\t\t\t\t\t\t\t\tCertType=\"检验\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\toption.put(\"CertType\", CertType);\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"TestCost\",locAppItem.getTestCost()==null?\"\":locAppItem.getTestCost());\n\t\t\t\t\t\toption.put(\"RepairCost\",locAppItem.getRepairCost()==null?\"\":locAppItem.getRepairCost());\n\t\t\t\t\t\toption.put(\"MaterialCost\",locAppItem.getMaterialCost()==null?\"\":locAppItem.getMaterialCost());\n\t\t\t\t\t\toption.put(\"WorkStaff\",locAppItem.getSysUser()==null?\"\":locAppItem.getSysUser().getName());\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toptionsq.put(option);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tfor (int i=0;i<21;i++) { //为了调试,空21行\n//\t\t\t\t\tJSONObject option = new JSONObject();\n//\t\t\t\t\toption.put(\"Id\", id++);\n//\t\t\t\t\toption.put(\"ApplianceName\", \" \");\t\n//\t\t\t\t\toption.put(\"applianceInfo\", \"\");\n//\t\t\t\t\toption.put(\"Model\",\" \");\n//\t\t\t\t\toption.put(\"Accuracy\", \" \");\n//\t\t\t\t\toption.put(\"Range\", \" \");\n//\t\t\t\t\toption.put(\"Quantity\", \" \");\n//\t\t\t\t\toption.put(\"AppFactoryCode\",\"\");\n//\t\t\t\t\toption.put(\"AppManageCode\", \"\");\n//\t\t\t\t\toption.put(\"Manufacturer\", \"\");\n//\t\t\t\t\toption.put(\"CertType\", \" \");\n//\t\t\t\t\toption.put(\"RepairCost\",\"\");\n//\t\t\t\t\toption.put(\"MaterialCost\",\"\");\n//\t\t\t\t\toption.put(\"TestCost\",\"\");\n//\t\t\t\t\toption.put(\"WorkStaff\",\"\");\n//\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\toptionsq.put(option);\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(id<=10){\n\t\t\t\t\tint temp=id;\n\t\t\t\t\tfor (int i=0;i<(10-temp);i++) { //首页10行\n\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\toption.put(\"Id\", id++);\n\t\t\t\t\t\toption.put(\"ApplianceName\", \" \");\t\n\t\t\t\t\t\toption.put(\"applianceInfo\", \"\");\n\t\t\t\t\t\toption.put(\"Model\",\" \");\n\t\t\t\t\t\toption.put(\"Accuracy\", \" \");\n\t\t\t\t\t\toption.put(\"Range\", \" \");\n\t\t\t\t\t\toption.put(\"Quantity\", \" \");\n\t\t\t\t\t\toption.put(\"AppFactoryCode\",\"\");\n\t\t\t\t\t\toption.put(\"AppManageCode\", \"\");\n\t\t\t\t\t\toption.put(\"Manufacturer\", \"\");\n\t\t\t\t\t\toption.put(\"CertType\", \" \");\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"TestCost\",\"\");\n\t\t\t\t\t\toption.put(\"RepairCost\",\"\");\n\t\t\t\t\t\toption.put(\"MaterialCost\",\"\");\n\t\t\t\t\t\toption.put(\"WorkStaff\",\"\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toptionsq.put(option);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tint temp=id-10;\n\t\t\t\t\tfor (int i=0;i<(23-temp%22);i++) { //每页22行\n\t\t\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\t\t\toption.put(\"Id\", id++);\n\t\t\t\t\t\toption.put(\"ApplianceName\", \" \");\n\t\t\t\t\t\toption.put(\"applianceInfo\", \"\");\n\t\t\t\t\t\toption.put(\"Model\",\" \");\n\t\t\t\t\t\toption.put(\"Accuracy\", \" \");\n\t\t\t\t\t\toption.put(\"Range\", \" \");\n\t\t\t\t\t\toption.put(\"Quantity\", \" \");\n\t\t\t\t\t\toption.put(\"AppFactoryCode\",\"\");\n\t\t\t\t\t\toption.put(\"AppManageCode\", \"\");\n\t\t\t\t\t\toption.put(\"Manufacturer\", \"\");\n\t\t\t\t\t\toption.put(\"CertType\", \" \");\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toption.put(\"TestCost\",\"\");\n\t\t\t\t\t\toption.put(\"RepairCost\",\"\");\n\t\t\t\t\t\toption.put(\"MaterialCost\",\"\");\n\t\t\t\t\t\toption.put(\"WorkStaff\",\"\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toptionsq.put(option);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresJson7.put(\"total\", id);\n\t\t\t\tresJson7.put(\"rows\", optionsq);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tLocaleMission loc=locmissMgr.findById(Integer.parseInt(localeMissionId));\n\t\t\t\tresJson7.put(\"CustomerName\", loc.getCustomerName());\n\t\t\t\tresJson7.put(\"Code\", loc.getCode());\n\t\t\t\tresJson7.put(\"Department\", loc.getDepartment());\n\t\t\t\tresJson7.put(\"Address\", loc.getAddress_1());\n\t\t\t\tresJson7.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\tresJson7.put(\"Contactor\", loc.getContactor());\n\t\t\t\tresJson7.put(\"ContactorTel\", loc.getTel()==null?\"\":loc.getTel());\n\t\t\t\tresJson7.put(\"SiteManager\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\tresJson7.put(\"HeadNameName\", loc.getAddress().getHeadName());\n\t\t\t\tresJson7.put(\"HeadNameAddress\", loc.getAddress().getAddress());\n\t\t\t\tresJson7.put(\"HeadNameFax\", loc.getAddress().getFax()==null?\"\":loc.getAddress().getFax());\n\t\t\t\tresJson7.put(\"HeadNameTel\", loc.getAddress().getTel()==null?\"\":loc.getAddress().getTel());//查询电话\n\t\t\t\tresJson7.put(\"HeadNameComplainTel\", loc.getAddress().getComplainTel()==null?\"\":loc.getAddress().getComplainTel());//投诉电话\n\t\t\t\tresJson7.put(\"HeadNameZipCode\", loc.getAddress().getZipCode()==null?\"\":loc.getAddress().getZipCode());//\n\t\t\t\t\n\t\t\t\tresJson7.put(\"PrintType\", \"\");//打印类型,0代表正常的表,1代表空表\n\t\t\t\t\n\t\t\t\tSimpleDateFormat sf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\tif(loc.getExactTime()!=null){\n\t\t\t\t\tresJson7.put(\"ExactTime\", sf.format(loc.getExactTime()));//报价时间\\\n\t\t\t\t}else{\n\t\t\t\t\tresJson7.put(\"ExactTime\", \"\");//报价时间\\\n\t\t\t\t}\n\t\t\t\tresJson7.put(\"IsOK\", true);\n\t\t\t\treq.getSession().setAttribute(\"AppItemsList\", resJson7);\n\t\t\t\n\t\t\t\tresp.sendRedirect(\"/jlyw/TaskManage/LocaleMissionPrint.jsp\");\n\t\t\t}catch(Exception e){\n\t\t\t\ttry {\n\t\t\t\t\tresJson7.put(\"total\", 0);\n\t\t\t\t\tresJson7.put(\"rows\", new JSONArray());\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresJson7.put(\"IsOK\", false);\n\t\t\t\t\t\tresJson7.put(\"msg\", String.format(\"查找现场委托书器具条目失败!错误信息:%s\", (e!=null && e.getMessage()!=null)?e.getMessage():\"无\"));\n\t\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (JSONException e1) {}\n\t\t\t\tif(e.getClass() == java.lang.Exception.class){\t//自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 13\", e);\n\t\t\t\t}else{\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 13\", e);\n\t\t\t\t}\n\t\t\t\treq.getSession().setAttribute(\"AppItemsList\", resJson7);\n\t\t\t\t\n\t\t\t\tresp.sendRedirect(\"/jlyw/TaskManage/LocaleMissionPrint.jsp\");\n\t\t\t}\n\t\t\tbreak;\t\n\t \tcase 14: // 现场业务书导入到现场委托单时,根据委托单位名查询现场委托书号\n\t\t\tJSONArray jsonArray = new JSONArray();\n\t\t\ttry {\n\t\t\t\tString queryNameStr = req.getParameter(\"QueryName\");\t//查询的 “名称”\n\t\t\t\t\n\t\t\t\tif(queryNameStr != null && queryNameStr.trim().length() > 0){\n\t\t\t\t\tString queryName = new String(queryNameStr.trim().getBytes(\"ISO-8859-1\"), \"UTF-8\");\t//解决URL传递中文乱码问题\n\t\t\t\t\t\n\t\t\t\t\tList<LocaleMission> locList = locmissMgr.findPagedAllBySort(0,50,\"tentativeDate\",false,new KeyValueWithOperator(\"customerName\", queryName, \"=\"),new KeyValueWithOperator(\"status\", 3, \"<>\"));//\n\t\t\t\t\tfor(LocaleMission loc : locList){\n\t\t\t\t\t\tJSONObject jsonObj = new JSONObject();\t\t\t\t\t\t\n\t\t\t\t\t\tjsonObj.put(\"code\", loc.getCode());\t//现场委托书号\t\n\t\t\t\t\t\tjsonObj.put(\"Id\", loc.getId());\t//现场任务ID\t\t\n\t\t\t\t\t\tjsonObj.put(\"CustomerName\", loc.getCustomerName());\t\t\t\t\t\n\t\t\t\t\t\tjsonObj.put(\"CustomerAddress\", loc.getAddress_1());\n\t\t\t\t\t\tjsonObj.put(\"CustomerTel\", loc.getTel());\n\t\t\t\t\t\tjsonObj.put(\"CustomerZipCode\", loc.getZipCode());\n\t\t\t\t\t\tjsonObj.put(\"LocaleCommissionDate\",loc.getExactTime()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getExactTime()));\n\t\t\t\t\t\t/*if(loc.getExactTime() != null){\n\t\t\t\t\t\t\tTimestamp eTime = loc.getExactTime();\n\t\t\t\t\t\t\teTime.setDate(eTime.getDate() + 7);\n\t\t\t\t\t\t\tjsonObj.put(\"PromiseDate\",DateTimeFormatUtil.DateFormat.format(eTime));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tjsonObj.put(\"PromiseDate\",\"\");\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\tjsonObj.put(\"ContactPerson\", loc.getContactor());\n\t\t\t\t\t\tjsonObj.put(\"ContactorTel\", loc.getContactorTel()==null?\"\":loc.getContactorTel());\n\t\t\t\t\t\tjsonObj.put(\"LocaleStaffId\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\t\t\tjsonArray.put(jsonObj);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tif(e.getClass() == java.lang.Exception.class){\t//自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 14\", e);\n\t\t\t\t}else{\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 14\", e);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(SysStringUtil.ResponseContentType.Type_EasyUICombobox);\n\t\t\t\tresp.getWriter().write(jsonArray.toString());\n\t\t\t}\n\t\t\tbreak;\n\t \tcase 15: // 现场委托书号的模糊查询\n\t\t\tJSONArray jsonarray = new JSONArray();\n\t\t\ttry {\n\t\t\t\tString queryNameStr = req.getParameter(\"QueryName\");\t//查询的 “名称”\n\t\t\t\t\n\t\t\t\tif(queryNameStr != null && queryNameStr.trim().length() > 0){\n\t\t\t\t\tString queryName = new String(queryNameStr.trim().getBytes(\"ISO-8859-1\"), \"UTF-8\");\t//解决URL传递中文乱码问题\n\t\t\t\n\t\t\t\t\tList<LocaleMission> locList = locmissMgr.findPagedAllBySort(0,50,\"tentativeDate\",false,new KeyValueWithOperator(\"code\", \"%\"+queryName+\"%\", \"like\"),new KeyValueWithOperator(\"status\", 3, \"<>\"));//非注销\n\t\t\t\t\tfor(LocaleMission loc : locList){\n\t\t\t\t\t\tJSONObject jsonObj = new JSONObject();\t\t\t\t\t\t\n\t\t\t\t\t\tjsonObj.put(\"code\", loc.getCode());\t//现场委托书号\t\n\t\t\t\t\t\tjsonObj.put(\"Id\", loc.getId());\t//现场任务ID\t\t\n\t\t\t\t\t\tjsonObj.put(\"CustomerName\", loc.getCustomerName());\t\t\t\t\t\n\t\t\t\t\t\tjsonObj.put(\"CustomerAddress\", loc.getAddress_1());\n\t\t\t\t\t\tjsonObj.put(\"LocaleCommissionDate\",loc.getExactTime()==null?\"\":DateTimeFormatUtil.DateFormat.format(loc.getExactTime()));\n\t\t\t\t\t\tif(loc.getExactTime() != null){\n\t\t\t\t\t\t\tTimestamp eTime = loc.getExactTime();\n\t\t\t\t\t\t\teTime.setDate(eTime.getDate() + 9);\n\t\t\t\t\t\t\tjsonObj.put(\"PromiseDate\",DateTimeFormatUtil.DateFormat.format(eTime));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tjsonObj.put(\"PromiseDate\",\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjsonObj.put(\"CustomerTel\", loc.getTel());\n\t\t\t\t\t\tjsonObj.put(\"CustomerZipCode\", loc.getZipCode());\n\t\t\t\t\t\tjsonObj.put(\"ContactPerson\", loc.getContactor());\n\t\t\t\t\t\tjsonObj.put(\"ContactorTel\", loc.getContactorTel()==null?\"\":loc.getContactorTel());\n\t\t\t\t\t\tjsonObj.put(\"LocaleStaffId\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\t\t\tjsonarray.put(jsonObj);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tif(e.getClass() == java.lang.Exception.class){\t//自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 15\", e);\n\t\t\t\t}else{\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 15\", e);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(SysStringUtil.ResponseContentType.Type_EasyUICombobox);\n\t\t\t\tresp.getWriter().write(jsonarray.toString());\n\t\t\t}\n\t\t\tbreak;\n\t \tcase 16: // 核定现场任务委托单\n\t\t\tJSONObject retObj16 = new JSONObject();\n\t\t\ttry {\n\t\t\t\tString Id = req.getParameter(\"Id\").trim();\n\t\t\t\tString CustomerName = req.getParameter(\"Name\");\n\t\t\t\tint CustomerId=Integer.parseInt(req.getParameter(\"CustomerId\"));\n\t\t\t\tString ZipCode = req.getParameter(\"ZipCode\");\n\t\t\t\tString Department = req.getParameter(\"Department\");\n\t\t\t\tString Address = req.getParameter(\"Address\");\n\t\t\t\tString Tel = req.getParameter(\"Tel\");\n\t\t\t\tString ContactorTel = req.getParameter(\"ContactorTel\");\n\t\t\t\tString TentativeDate = req.getParameter(\"TentativeDate\");\n\t\t\t\tString CheckDate = req.getParameter(\"CheckDate\");//核定日期\n\t\t\t\t\n\t\t\t\tString SiteManagerId = req.getParameter(\"SiteManagerId\");\n\t\t\t\n\t\t\t\tString Contactor = req.getParameter(\"Contactor\");\n\t\t\t\tString RegionId = req.getParameter(\"RegionId\");\n\t\t\t\tString Remark = req.getParameter(\"Remark\");\n\t\t\t\tString HeadNameId = req.getParameter(\"HeadName\");\n\t\t\t\tif(HeadNameId==null||HeadNameId.length()==0){\n\t\t\t\t\tthrow new Exception(\"抬头名称不能为空!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\tAddressManager addrMgr = new AddressManager();\t\t\t\n\t\t\t\tAddress HeadNameAddr = new AddressManager().findById(Integer.parseInt(HeadNameId));\t//台头名称的单位\n\t\t\t\tString Appliances = req.getParameter(\"Appliances\").trim();\t//检验的器具\n\t\t\t\t\n\t\t\t\tJSONArray appliancesArray = new JSONArray(Appliances);\t//检查的器具\n\t\t\t\t\n\t\t\t\tint lid = Integer.parseInt(Id);// 获取Id\n\t\t\t\tLocaleMission localmission = locmissMgr.findById(lid);// 根据查询现场任务\n\t\t\t\tif(localmission == null){\n\t\t\t\t\tthrow new Exception(\"该现场检测业务不存在!\");\n\t\t\t\t}\n\t\t\t\tif(localmission.getStatus()==2||localmission.getStatus()==3){\n\t\t\t\t\tthrow new Exception(\"该现场检测业务'已完工'或‘已注销’,不能修改!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tTimestamp ts;\n if(TentativeDate==null||TentativeDate.length()==0){\n\t\t\t\t ts = null;\t//暂定日期\n }else{\n\t\t\t ts = new Timestamp(DateTimeFormatUtil.DateFormat.parse(TentativeDate).getTime());\t//暂定日期\n }\n Timestamp now = new Timestamp(System.currentTimeMillis());// 取当前时间\n \n localmission.setCustomerName(CustomerName==null?\"\":CustomerName);\n\t\t\t\tlocalmission.setAddress_1(Address==null?\"\":Address);\n\t\t\t\tlocalmission.setAddress(HeadNameAddr);\n\t\t\t\tlocalmission.setZipCode(ZipCode==null?\"\":ZipCode);\n\t\t\t\tlocalmission.setContactor(Contactor==null?\"\":Contactor);\n\t\t\t\tlocalmission.setTel(Tel==null?\"\":Tel);\n\t\t\t\tlocalmission.setContactorTel(ContactorTel==null?\"\":ContactorTel);\n\t\t\t\t//localmission.setMissionDesc(MissionDesc);\n\t\t\t\tlocalmission.setDepartment(Department);\n\t\t\t\t//localmission.setStaffs(staffs.toString());\n\t\t\t\tlocalmission.setTentativeDate(ts);\n\t\t\t\tRegion region = new Region();\n\t\t\t\tregion.setId(Integer.parseInt(RegionId));\n\t\t\t\tlocalmission.setRegion(region);\n\t\t\t\tlocalmission.setRemark(Remark);\n\t\t\t\t/************更新委托单位信息***********/\n\t\t\t\tCustomer cus=(new CustomerManager()).findById(CustomerId);\n\t\t\t\tif(CustomerName!=null&&CustomerName.length()>0){\n\t\t\t\t\tcus.setName(CustomerName);\n\t\t\t\t}\n\t\t\t\tif(Address!=null&&Address.length()>0){\n\t\t\t\t\tcus.setAddress(Address);\n\t\t\t\t}\n\t\t\t\tif(Tel!=null&&Tel.length()>0){\n\t\t\t\t\tcus.setTel(Tel);\n\t\t\t\t}\n\t\t\t\tif(ZipCode!=null&&ZipCode.length()>0){\n\t\t\t\t\tcus.setZipCode(ZipCode);\n\t\t\t\t}\n\t\t\t\tif(!(new CustomerManager()).update(cus)){\n\t\t\t\t\tthrow new Exception(\"更新委托单位失败!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\t/************更新委托单位联系人信息***********/\t\n\t\t\t\tCustomerContactorManager cusConMgr = new CustomerContactorManager();\n\t\t\t\tList<CustomerContactor> cusConList = cusConMgr.findByVarProperty(new KeyValueWithOperator(\"customerId\", CustomerId, \"=\"), new KeyValueWithOperator(\"name\", Contactor, \"=\"));\n\t\t\t\tif(cusConList != null){\n\t\t\t\t\tif(cusConList.size() > 0){\n\t\t\t\t\t\tCustomerContactor c = cusConList.get(0);\n\t\t\t\t\t\tif(ContactorTel.length() > 0){\n\t\t\t\t\t\t\tif(!ContactorTel.equalsIgnoreCase(c.getCellphone1()) && (c.getCellphone2() == null || c.getCellphone2().length() == 0)){\n\t\t\t\t\t\t\t\tc.setCellphone2(c.getCellphone1());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tc.setCellphone1(ContactorTel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc.setLastUse(now);\n\t\t\t\t\t\tc.setCount(c.getCount()+1);\n\t\t\t\t\t\tif(!cusConMgr.update(c))\n\t\t\t\t\t\t\tthrow new Exception(\"更新单位联系人失败!\");\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tCustomerContactor c = new CustomerContactor();\n\t\t\t\t\t\tc.setCustomerId(CustomerId);\n\t\t\t\t\t\tc.setName(Contactor);\n\t\t\t\t\t\tc.setCellphone1(ContactorTel);\n\t\t\t\t\t\tc.setLastUse(now);\n\t\t\t\t\t\tc.setCount(1);\n\t\t\t\t\t\tif(!cusConMgr.save(c))\n\t\t\t\t\t\t\tthrow new Exception(\"更新单位联系人失败!\");\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(CheckDate!=null&&CheckDate.length()>0){ //核定\n\t\t\t\t\tTimestamp CheckTime = new Timestamp(DateTimeFormatUtil.DateFormat.parse(CheckDate).getTime());\n\t\t\t\t\tlocalmission.setCheckDate(CheckTime);\n\t\t\t\t\tif(localmission.getStatus()==4){\n\t\t\t\t\t\tlocalmission.setStatus(5);//已核定\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSysUser newUser = new SysUser();\n\t\t\t\tif(SiteManagerId!=null&&SiteManagerId.length()>0){ //负责人\n\t\t\t\t\tnewUser.setId(Integer.parseInt(SiteManagerId));\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(newUser);\t\n\t\t\t\t}else{\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(null);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlocalmission.setModificatorDate(now);// 记录时间为当前时间\n\t\t\t\tlocalmission.setSysUserByModificatorId((SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser));\n\t\t\t\t\n\t\t\t\tApplianceSpeciesManager speciesMgr = new ApplianceSpeciesManager();\t//器具分类管理Mgr\n\t\t\t\tApplianceStandardNameManager sNameMgr = new ApplianceStandardNameManager();\t//器具标准名称管理Mgr\n\t\t\t\tAppliancePopularNameManager popNameMgr = new AppliancePopularNameManager();\t//器具常用名称管理Mgr\n\t\t\t\tQualificationManager qualMgr = new QualificationManager();\t//检测人员资质管理Mgr\n\t\t\t\tApplianceManufacturerManager mafMgr = new ApplianceManufacturerManager();\t//制造厂管理Mgr\n\t\t\t\t\n\t\t\t\tList<LocaleApplianceItem> localeAppItemList = new ArrayList<LocaleApplianceItem>();\t//现场业务中要添加的器具\n\t\t\t\tList<SysUser> alloteeList = new ArrayList<SysUser>();\t//委托单列表对应的派定人:\n\t\t\t\tList<Integer> qualList = new ArrayList<Integer>();\n\t\t\t\n\t\t\t\t/******************** 添加器具信息 ******************/\n\t\t\t\tfor(int i = 0; i < appliancesArray.length(); i++){\n\t\t\t\t\tJSONObject jsonObj = appliancesArray.getJSONObject(i);\n\t\t\t\t\tLocaleApplianceItem localeAppItem = new LocaleApplianceItem();\n\t\t\t\t\t\n\t\t\t\t\t/********************** 添加器具信息 ************************/\n\t\t\t\t\tString SpeciesType = jsonObj.get(\"SpeciesType\").toString();\t//器具分类类型\n\t\t\t\t\tString ApplianceSpeciesId = jsonObj.get(\"ApplianceSpeciesId\").toString();\t//器具类别ID/标准名称ID\n\t\t\t\t\tString ApplianceName = jsonObj.getString(\"ApplianceName\");\t//器具名称\n\t\t\t\t\tString Manufacturer= jsonObj.getString(\"Manufacturer\");\t//制造厂\n\t\t\t\t\tif(SpeciesType!=null&&SpeciesType.length()>0){\n\t\t\t\t\t\tif(Integer.parseInt(SpeciesType) == 0){\t//0:标准名称;1:分类名称\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(false);\t\n\t\t\t\t\t\t\tString stdName = sNameMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = stdName;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//按需增加制造厂\n\t\t\t\t\t\t\tif(Manufacturer != null && Manufacturer.trim().length() > 0){\n\t\t\t\t\t\t\t\tint intRet = mafMgr.getTotalCount(new KeyValueWithOperator(\"applianceStandardName.id\", Integer.parseInt(ApplianceSpeciesId), \"=\"), new KeyValueWithOperator(\"manufacturer\", Manufacturer.trim(), \"=\"));\n\t\t\t\t\t\t\t\tif(intRet == 0){\n\t\t\t\t\t\t\t\t\tApplianceStandardName sNameTemp = new ApplianceStandardName();\n\t\t\t\t\t\t\t\t\tsNameTemp.setId(Integer.parseInt(ApplianceSpeciesId));\n\t\t\t\t\t\t\t\t\tApplianceManufacturer maf = new ApplianceManufacturer();\n\t\t\t\t\t\t\t\t\tmaf.setApplianceStandardName(sNameTemp);\n\t\t\t\t\t\t\t\t\tmaf.setManufacturer(Manufacturer.trim());\n\t\t\t\t\t\t\t\t\tmaf.setBrief(LetterUtil.String2Alpha(Manufacturer.trim()));\n\t\t\t\t\t\t\t\t\tmaf.setStatus(0);\n\t\t\t\t\t\t\t\t\tmafMgr.save(maf);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(true);\t\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = speciesMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocaleAppItem.setApplianceSpeciesId(Integer.parseInt(ApplianceSpeciesId));\t\t\t\t\t\n\t\t\t\t\t\tlocaleAppItem.setApplianceName(ApplianceName);\t//存器具名称\t\t\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setAppFactoryCode(jsonObj.getString(\"ApplianceCode\"));\t\t//出厂编号\n\t\t\t\t\tlocaleAppItem.setAppManageCode(jsonObj.getString(\"AppManageCode\"));\t\t//管理编号\n\t\t\t\t\tlocaleAppItem.setModel(jsonObj.getString(\"Model\"));\t\t//型号规格\n\t\t\t\t\tlocaleAppItem.setRange(jsonObj.getString(\"Range\"));\t\t//测量范围\n\t\t\t\t\tlocaleAppItem.setAccuracy(jsonObj.getString(\"Accuracy\"));\t//精度等级\n\t\t\t\t\tlocaleAppItem.setManufacturer(jsonObj.getString(\"Manufacturer\"));\t\t//制造厂商\n\t\t\t\t\tlocaleAppItem.setCertType(jsonObj.getString(\"ReportType\"));\t//报告形式\n\t\t\t\t\tif(jsonObj.has(\"TestFee\")&&jsonObj.getString(\"TestFee\").length()>0&&jsonObj.getString(\"TestFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setTestCost(Double.valueOf(jsonObj.getString(\"TestFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"RepairFee\")&&jsonObj.getString(\"RepairFee\").length()>0&&jsonObj.getString(\"RepairFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setRepairCost(Double.valueOf(jsonObj.getString(\"RepairFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"MaterialFee\")&&jsonObj.getString(\"MaterialFee\").length()>0&&jsonObj.getString(\"MaterialFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setMaterialCost(Double.valueOf(jsonObj.getString(\"MaterialFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setQuantity(Integer.parseInt(jsonObj.get(\"Quantity\").toString()));//台件数\t\n\t\t\t\t\tif(jsonObj.has(\"AssistStaff\")&&jsonObj.getString(\"AssistStaff\")!=null&&jsonObj.getString(\"AssistStaff\").trim().length()>0)\n\t\t\t\t\t\tlocaleAppItem.setAssistStaff(jsonObj.getString(\"AssistStaff\"));\t//存辅助派定人或替代人\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t/********************** 判断派定人是否存在及有效,并加入到alloteeList ****************************/\n\t\t\t\t\tString Allotee = jsonObj.getString(\"WorkStaff\");\n\t\t\t\t\tif(Allotee != null && Allotee.trim().length() > 0){\n\t\t\t\t\t\tAllotee = Allotee.trim();\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Object[]> qualRetList = qualMgr.getQualifyUsers(Allotee, localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, qualList);\n\t\t\t\t\t\tif(qualRetList != null && qualRetList.size() > 0){\n\t\t\t\t\t\t\tboolean alloteeChecked = false;\n\t\t\t\t\t\t\tfor(Object[] objArray : qualRetList){\n\t\t\t\t\t\t\t\tif(!qualMgr.checkUserQualify((Integer)objArray[0], localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, FlagUtil.QualificationType.Type_Except)){\t//没有该检验项目的检验排外属性\n\t\t\t\t\t\t\t\t\talloteeChecked = true;\n\t\t\t\t\t\t\t\t\tSysUser tempUser = new SysUser();\n\t\t\t\t\t\t\t\t\ttempUser.setId((Integer)objArray[0]);\n\t\t\t\t\t\t\t\t\ttempUser.setName((String)objArray[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlocaleAppItem.setSysUser(tempUser);\t\t//派定人\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!alloteeChecked){\n\t\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlocaleAppItem.setSysUser(null);\t\t//派定人\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t\tif(jsonObj.has(\"Id\")&&jsonObj.getString(\"Id\")!=null&&jsonObj.getString(\"Id\").trim().length()>0)\n\t\t\t\t\t\tlocaleAppItem.setId(Integer.parseInt(jsonObj.getString(\"Id\")));\n\t\t\t\t\tlocaleAppItemList.add(localeAppItem);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (locAppItemMgr.updateByBatch(localeAppItemList,localmission)) { // 修改现场业务,删除原现场业务中的器具信息,添加新的器具信息\n\t\t\t\t\tretObj16.put(\"IsOK\", true);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\"更新数据库失败!\");\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\ttry {\n\t\t\t\t\tretObj16.put(\"IsOK\", false);\n\t\t\t\t\tretObj16.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage() : \"无\"));\n\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 16\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 16\", e);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retObj16.toString());\n\t\t\t}\n\t\t\tbreak;\n\t \tcase 17: // 补登现场任务委托单\n\t\t\tJSONObject retObj17 = new JSONObject();\n\t\t\ttry{\n\t\t\t\tString Name = req.getParameter(\"Name\").trim();\n\t\t\t\tint CustomerId = Integer.parseInt(req.getParameter(\"CustomerId\").trim());\n\t\t\t\tString ZipCode = req.getParameter(\"ZipCode\");\n\t\t\t\tString Department = req.getParameter(\"Department\");\n\t\t\t\tString Address = req.getParameter(\"Address\");\n\t\t\t\tString Tel = req.getParameter(\"Tel\");\n\t\t\t\tString ContactorTel = req.getParameter(\"ContactorTel\");\n\t\t\t\tString TentativeDate = req.getParameter(\"TentativeDate\");\n\t\t\t\t//String MissionDesc = req.getParameter(\"MissionDesc\").trim();\t//检测项目及台件数\n\t\t\t\t//String Staffs = req.getParameter(\"Staffs\").trim();\n\t\t\t\tString SiteManagerId = req.getParameter(\"SiteManagerId\");\n\t\t\t\tString Contactor = req.getParameter(\"Contactor\");\n\t\t\t\tString RegionId = req.getParameter(\"RegionId\");\n\t\t\t\tString Remark = req.getParameter(\"Remark\");\n\t\t\t\tString Appliances = req.getParameter(\"Appliances\").trim();\t//检验的器具\n\t\t\t\tJSONArray appliancesArray = new JSONArray(Appliances);\t//检查的器具\n\t\t\t\t\n\t\t\t\tString ExactTime = req.getParameter(\"ExactTime\").trim();\t//确定检验时间\n\t\t\t\tString LocaleMissionCode = req.getParameter(\"LocaleMissionCode\").trim();\t//委托书号\n\t\t\t\tString Drivername=req.getParameter(\"Drivername\");\n\t\t\t\tString Licence=req.getParameter(\"Licence\");\n\t\t\t\t\n\t\t\t\tString QTway = req.getParameter(\"QTway\");\n\t\t\t\tQTway = URLDecoder.decode(new String(QTway.trim().getBytes(\"ISO-8859-1\")),\"UTF-8\"); \n\t\t\t\tSystem.out.println(QTway);\n\t\t\t\tTimestamp beginTs = Timestamp.valueOf(String.format(\"%s 08:30:00\", ExactTime.trim()));\n\t\t\t\tTimestamp endTs = Timestamp.valueOf(String.format(\"%s 17:00:00\", ExactTime.trim()));\n\t\t\t\t\n\t\t\t\tTimestamp ts;\n if(TentativeDate==null||TentativeDate.length()==0){\n\t\t\t\t ts = null;\t//暂定日期\n }else{\n\t\t\t ts = new Timestamp(DateTimeFormatUtil.DateFormat.parse(TentativeDate).getTime());\t//暂定日期\n }\n String Brief = com.jlyw.util.LetterUtil.String2Alpha(Name);\n\t\t\t\t\n Customer cus=new Customer();\n cus.setId(CustomerId);\n\t\t\t\tLocaleMission localmission = new LocaleMission();\n\t\t\t\tlocalmission.setAddress_1(Address==null?\"\":Address);\n\t\t\t\tlocalmission.setCustomer(cus);\n\t\t\t\tlocalmission.setCustomerName(Name);\n\t\t\t\tlocalmission.setBrief(Brief);\n\t\t\t\tlocalmission.setZipCode(ZipCode==null?\"\":ZipCode);\n\t\t\t\tlocalmission.setContactor(Contactor==null?\"\":Contactor);\n\t\t\t\tlocalmission.setTel(Tel==null?\"\":Tel);\n\t\t\t\tlocalmission.setContactorTel(ContactorTel==null?\"\":ContactorTel);\n\t\t\t\t//localmission.setMissionDesc(MissionDesc);\n\t\t\t\tlocalmission.setDepartment(Department);\n\t\t\t\t//localmission.setStaffs(staffs.toString());\n\t\t\t\tlocalmission.setTentativeDate(ts);\n\t\t\t\tRegion region = new Region();\n\t\t\t\tregion.setId(Integer.parseInt(RegionId));\n\t\t\t\tlocalmission.setRegion(region);\n\t\t\t\tlocalmission.setRemark(Remark);\n\t\t\t\tlocalmission.setVehicleLisences(URLDecoder.decode(new String(Licence.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\"));\n\t\t\t\t\n\t\t\t\tString Code=URLDecoder.decode(new String(LocaleMissionCode.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\");\n\t\t\t\tif(Code==null||Code.length()!=7)\n\t\t\t\t\tthrow new Exception(\"委托书号\"+Code+\"格式不正确,只能是七位\");\n\t\t\t\tList<LocaleMission> locMissionList = locmissMgr.findByVarProperty(new KeyValueWithOperator(\"code\",Code,\"=\"),new KeyValueWithOperator(\"status\",3,\"<>\"));\n\t\t\t\t\n\t\t\t\tif(locMissionList==null||locMissionList.size()==0){\n\t\t\t\t\tlocalmission.setCode(Code);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"已存在委托书号\"+Code);\n\t\t\t\t}\n\t\t\t\t//System.out.println();\n\t\t\t\t\n\t\t\t\tSysUser newUser = new SysUser();\n\t\t\t\t\n\t\t\t\tif(SiteManagerId!=null&&SiteManagerId.length()>0){\n\t\t\t\t\tnewUser.setId(Integer.parseInt(SiteManagerId));\n\t\t\t\t\tlocalmission.setSysUserBySiteManagerId(newUser);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"现场负责人不能为空\");\n\t\t\t\t}\n\t\t\t\tTimestamp CheckTime = new Timestamp(DateTimeFormatUtil.DateFormat.parse(ExactTime).getTime());\n\t\t\t\tlocalmission.setCheckDate(CheckTime);\n\t\t\t\tlocalmission.setExactTime(CheckTime);\n\t\t\t\t\n\t\t\t\tlocalmission.setStatus(1);// status: 1 已分配 2 已完成 3已删除 4负责人未核定 5负责人已核定\t\t\n\t\t\t\t\n\t\t\t\tString HeadNameId = req.getParameter(\"HeadName\");\n\t\t\t\tif(HeadNameId==null||HeadNameId.length()==0){\n\t\t\t\t\tthrow new Exception(\"抬头名称不能为空!\");\t\t\t\t\n\t\t\t\t}\n\t\t\t\tAddressManager addrMgr = new AddressManager();\t\t\t\n\t\t\t\tAddress HeadNameAddr = new AddressManager().findById(Integer.parseInt(HeadNameId));\t//台头名称的单位\n\t\t\t\tlocalmission.setAddress(HeadNameAddr);\n\t\t\t\t\n\t\t\t\tTimestamp now = new Timestamp(System.currentTimeMillis());// 取当前时间\n\t\t\t\tlocalmission.setCreateTime(now);// 创建时间为当前时间\n\t\t\t\tlocalmission.setSysUserByCreatorId((SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser));\n\t\t\t\tlocalmission.setModificatorDate(now);// 记录时间为当前时间\n\t\t\t\tlocalmission.setSysUserByModificatorId((SysUser) req.getSession().getAttribute(SystemCfgUtil.SessionAttrNameLoginUser));\n\t\t\t\t\n\t\t\t\tApplianceSpeciesManager speciesMgr = new ApplianceSpeciesManager();\t//器具分类管理Mgr\n\t\t\t\tApplianceStandardNameManager sNameMgr = new ApplianceStandardNameManager();\t//器具标准名称管理Mgr\n\t\t\t\tAppliancePopularNameManager popNameMgr = new AppliancePopularNameManager();\t//器具常用名称管理Mgr\n\t\t\t\tQualificationManager qualMgr = new QualificationManager();\t//检测人员资质管理Mgr\n\t\t\t\tApplianceManufacturerManager mafMgr = new ApplianceManufacturerManager();\t//制造厂管理Mgr\n\t\t\t\tList<LocaleApplianceItem> localeAppItemList = new ArrayList<LocaleApplianceItem>();\t//现场业务中要添加的器具\n\t\t\t\tList<SysUser> alloteeList = new ArrayList<SysUser>();\t//委托单列表对应的派定人:\n\t\t\t\tList<Integer> qualList = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/******************** 添加器具信息 ******************/\n\t\t\t\tfor(int i = 0; i < appliancesArray.length(); i++){\n\t\t\t\t\tJSONObject jsonObj = appliancesArray.getJSONObject(i);\n\t\t\t\t\tLocaleApplianceItem localeAppItem = new LocaleApplianceItem();\n\t\t\t\t\t\n\t\t\t\t\t/********************** 添加器具信息 ************************/\n\t\t\t\t\tString SpeciesType = jsonObj.get(\"SpeciesType\").toString();\t//器具分类类型\n\t\t\t\t\tString ApplianceSpeciesId = jsonObj.get(\"ApplianceSpeciesId\").toString();\t//器具类别ID/标准名称ID\n\t\t\t\t\tString ApplianceName = jsonObj.getString(\"ApplianceName\");\t//器具名称\n\t\t\t\t\tString Manufacturer= jsonObj.getString(\"Manufacturer\");\t//制造厂\n\t\t\t\t\t\n\t\t\t\t\tif(SpeciesType!=null&&SpeciesType.length()>0){\n\t\t\t\t\t\tif(Integer.parseInt(SpeciesType) == 0){\t//0:标准名称;1:分类名称\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(false);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tString stdName = sNameMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = stdName;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//按需增加制造厂\n\t\t\t\t\t\t\tif(Manufacturer != null && Manufacturer.trim().length() > 0){\n\t\t\t\t\t\t\t\tint intRet = mafMgr.getTotalCount(new KeyValueWithOperator(\"applianceStandardName.id\", Integer.parseInt(ApplianceSpeciesId), \"=\"), new KeyValueWithOperator(\"manufacturer\", Manufacturer.trim(), \"=\"));\n\t\t\t\t\t\t\t\tif(intRet == 0){\n\t\t\t\t\t\t\t\t\tApplianceStandardName sNameTemp = new ApplianceStandardName();\n\t\t\t\t\t\t\t\t\tsNameTemp.setId(Integer.parseInt(ApplianceSpeciesId));\n\t\t\t\t\t\t\t\t\tApplianceManufacturer maf = new ApplianceManufacturer();\n\t\t\t\t\t\t\t\t\tmaf.setApplianceStandardName(sNameTemp);\n\t\t\t\t\t\t\t\t\tmaf.setManufacturer(Manufacturer.trim());\n\t\t\t\t\t\t\t\t\tmaf.setBrief(LetterUtil.String2Alpha(Manufacturer.trim()));\n\t\t\t\t\t\t\t\t\tmaf.setStatus(0);\n\t\t\t\t\t\t\t\t\tmafMgr.save(maf);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tlocaleAppItem.setSpeciesType(true);\t\n\t\t\t\t\t\t\tif(ApplianceName == null || ApplianceName.trim().length() == 0){\n\t\t\t\t\t\t\t\tApplianceName = speciesMgr.findById(Integer.parseInt(ApplianceSpeciesId)).getName();;\t//器具名称未填写,则默认为标准名称或分类名称\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlocaleAppItem.setApplianceSpeciesId(Integer.parseInt(ApplianceSpeciesId));\t\t\t\t\t\n\t\t\t\t\t\tlocaleAppItem.setApplianceName(ApplianceName);\t//存器具名称\t\t\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setAppFactoryCode(jsonObj.getString(\"ApplianceCode\"));\t\t//出厂编号\n\t\t\t\t\tlocaleAppItem.setAppManageCode(jsonObj.getString(\"AppManageCode\"));\t\t//管理编号\n\t\t\t\t\tlocaleAppItem.setModel(jsonObj.getString(\"Model\"));\t\t//型号规格\n\t\t\t\t\tlocaleAppItem.setRange(jsonObj.getString(\"Range\"));\t\t//测量范围\n\t\t\t\t\tlocaleAppItem.setAccuracy(jsonObj.getString(\"Accuracy\"));\t//精度等级\n\t\t\t\t\tlocaleAppItem.setManufacturer(jsonObj.getString(\"Manufacturer\"));\t\t//制造厂商\n\t\t\t\t\tlocaleAppItem.setCertType(jsonObj.getString(\"ReportType\"));\t//报告形式\n\t\t\t\t\tif(jsonObj.has(\"TestFee\")&&jsonObj.getString(\"TestFee\").length()>0&&jsonObj.getString(\"TestFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setTestCost(Double.valueOf(jsonObj.getString(\"TestFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"RepairFee\")&&jsonObj.getString(\"RepairFee\").length()>0&&jsonObj.getString(\"RepairFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setRepairCost(Double.valueOf(jsonObj.getString(\"RepairFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tif(jsonObj.has(\"MaterialFee\")&&jsonObj.getString(\"MaterialFee\").length()>0&&jsonObj.getString(\"MaterialFee\")!=null){\n\t\t\t\t\t\tlocaleAppItem.setMaterialCost(Double.valueOf(jsonObj.getString(\"MaterialFee\")));\n\t\t\t\t\t}\n\t\t\t\t\tlocaleAppItem.setQuantity(Integer.parseInt(jsonObj.get(\"Quantity\").toString()));//台件数\t\n\t\t\t\t\tif(jsonObj.has(\"AssistStaff\")&&jsonObj.getString(\"AssistStaff\")!=null&&jsonObj.getString(\"AssistStaff\").trim().length()>0){\n\t\t\t\t\t\tlocaleAppItem.setAssistStaff(jsonObj.getString(\"AssistStaff\"));\t//存辅助派定人或替代人\t\t\n\t\t\t\t\t}\t\t\n\t\t\t\t\t/********************** 判断派定人是否存在及有效,并加入到alloteeList ****************************/\n\t\t\t\t\tString Allotee = jsonObj.getString(\"WorkStaff\");\n\t\t\t\t\tif(Allotee != null && Allotee.trim().length() > 0){\n\t\t\t\t\t\tAllotee = Allotee.trim();\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Object[]> qualRetList = qualMgr.getQualifyUsers(Allotee, localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, qualList);\n\t\t\t\t\t\tif(qualRetList != null && qualRetList.size() > 0){\n\t\t\t\t\t\t\tboolean alloteeChecked = false;\n\t\t\t\t\t\t\tfor(Object[] objArray : qualRetList){\n\t\t\t\t\t\t\t\tif(!qualMgr.checkUserQualify((Integer)objArray[0], localeAppItem.getApplianceSpeciesId(), localeAppItem.getSpeciesType()?1:0, FlagUtil.QualificationType.Type_Except)){\t//没有该检验项目的检验排外属性\n\t\t\t\t\t\t\t\t\talloteeChecked = true;\n\t\t\t\t\t\t\t\t\tSysUser tempUser = new SysUser();\n\t\t\t\t\t\t\t\t\ttempUser.setId((Integer)objArray[0]);\n\t\t\t\t\t\t\t\t\ttempUser.setName((String)objArray[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlocaleAppItem.setSysUser(tempUser);\t\t//派定人\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!alloteeChecked){\n\t\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthrow new Exception(String.format(\"派定人 '%s' 不存在或没有资质检验项目:%s,请重新选择!\", Allotee, localeAppItem.getApplianceName()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlocaleAppItem.setSysUser(null);\t\t//派定人\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tlocaleAppItemList.add(localeAppItem);\n\t\t\t\t}\n\t\t\t\tDrivingVehicle drivingvehicle = null; //新建出车记录\n\t\t\t\t\n\t\t\t\tif(QTway!=null&&QTway.length()>0&&QTway.equals(\"所内派车\")){\n\t\t\t\t\t//车辆处理\n\t\t\t\t\tif(Licence==null||Licence.trim().length()==0||Drivername==null||Drivername.trim().length()==0){\n\t\t\t\t\t\tthrow new Exception(\"选择“所内派车”后,车牌号和司机名不能为空\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\tVehicleManager VeMgr=new VehicleManager();\n\t\t\t\t\tList<Vehicle> vehivleList=VeMgr.findByVarProperty(new KeyValueWithOperator(\"licence\",URLDecoder.decode(new String(Licence.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\") , \"=\"),\n\t\t\t\t\t\t\t\t\t\t new KeyValueWithOperator(\"status\", 0, \"=\"));\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(URLDecoder.decode(new String(Licence.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\"));\n\t\t\t\t\tVehicle vehicle=new Vehicle();\n\t\t\t\t\tUserManager userMgr=new UserManager();\n\t\t\t\t\tSysUser driver =new SysUser();\n\t\t\t\t\tif(Drivername!=null&&Drivername.length()>0){\n\t\t\t\t\t\tdriver= userMgr.findByVarProperty(new KeyValueWithOperator(\"name\",URLDecoder.decode(new String(Drivername.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\") , \"=\")).get(0);\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(vehivleList!=null&&vehivleList.size()>0){\n\t\t\t\t\t\tvehicle=vehivleList.get(0);\n\t\t\t\t\t}else{\t\n\t\t\t\t\t\tthrow new Exception(\"找不到车牌号为\"+URLDecoder.decode(new String(Licence.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\")+\"的车,请重新输入!\");\t\t\n\t\t\t\t\t\t/*vehicle.setLicence(URLDecoder.decode(new String(Licence.trim().getBytes(\"ISO-8859-1\")) , \"UTF-8\"));\n\t\t\t\t\t\t\n\t\t\t\t\t\tvehicle.setSysUser(driver);\n\t\t\t\t\t\tvehicle.setBrand(\"\");\n\t\t\t\t\t\tvehicle.setFuelFee(0.0);\n\t\t\t\t\t\tvehicle.setLicenceType(\"\");\n\t\t\t\t\t\tvehicle.setLimit(0);\n\t\t\t\t\t\tvehicle.setModel(\"\");\n\t\t\t\t\t\tvehicle.setStatus(0);\t\t\t\t\t\n\t\t\t\t\t\tVeMgr.save(vehicle);\t\t*/\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//找现场业务下面的各个器具指派人\n\t\t\t\t\tString staffs=\"\";\n\t\t\t\t\tif(!localeAppItemList.isEmpty()){\t\t\t\t\t\t\n\t\t\t\t\t\tfor (LocaleApplianceItem user : localeAppItemList) {\n\t\t\t\t\t\t\tString name=(user.getSysUser()==null?\"\":user.getSysUser().getName());\n\t\t\t\t\t\t\tif(staffs.indexOf(name+\";\")<0){\n\t\t\t\t\t\t\t\tstaffs = staffs + name +\";\"; \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\tif(localmission.getSysUserBySiteManagerId()!=null){\n\t\t\t\t\t\tif(staffs.indexOf(localmission.getSysUserBySiteManagerId().getName()+\";\")<0){\n\t\t\t\t\t\t\tstaffs = staffs + localmission.getSysUserBySiteManagerId().getName()+\";\"; \t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tdrivingvehicle=new DrivingVehicle(); //新建出车记录\n\t\t\t\t\tdrivingvehicle.setAssemblingPlace(\"\");\n\t\t\t\t\tdrivingvehicle.setBeginDate(beginTs);\n\t\t\t\t\tdrivingvehicle.setEndDate(endTs);\t\n\t\t\t\t\tdrivingvehicle.setStatus(0);\n\t\t\t\t\tdrivingvehicle.setSysUserByDriverId(driver); // 驾驶员\t\t\t\t\t\t\t\n\t\t\t\t\tdrivingvehicle.setPeople(staffs);\n\t\t\t\t\tdrivingvehicle.setVehicle(vehicle);// 车辆\n\t\t\t\t\t\n\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\tif(QTway!=null&&QTway.length()>0){\n\t\t\t\t\t\tlocalmission.setVehicleLisences(QTway);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\tif (locAppItemMgr.saveByBatchBD(localeAppItemList,localmission,drivingvehicle)) { // 补登成功\n\t\t\t\t\tretObj17.put(\"IsOK\", true);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\"写入数据库失败!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}catch (Exception e) {\n\t\t\t\ttry {\n\t\t\t\t\tretObj17.put(\"IsOK\", false);\n\t\t\t\t\tretObj17.put(\"msg\", String.format(\"处理失败!错误信息:%s\",(e != null && e.getMessage() != null)?e.getMessage():\"无\"));\n\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tif (e.getClass() == java.lang.Exception.class) { // 自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 17\", e);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 17\", e);\n\t\t\t\t}\n\t\t\t}finally{\n\t\t\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\t\t\tresp.getWriter().write(retObj17.toString());\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 18://查询现场任务条目(用于打印)(空表)\n\t\t\tJSONObject resJson18 = new JSONObject();\n\t\t\ttry{\n\t\t\t\tString localeMissionId = req.getParameter(\"localeMissionId\"); \n\t\t\t\tList<KeyValueWithOperator> quoList = new ArrayList<KeyValueWithOperator>();\n\t\t\t\tList<LocaleApplianceItem> locAppItemList;\n\t\t\t\tCustomerManager cusMgr=new CustomerManager();\n\t\t\t\tCommissionSheetManager comsheetMgr=new CommissionSheetManager();\n\t\t\t\tList<CommissionSheet> comsheetList=new ArrayList<CommissionSheet>();\n\t\t\t\tint total5;\n\t\t\t\tif(localeMissionId == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"任务书号无效!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlocAppItemList = locAppItemMgr.findByVarProperty(new KeyValueWithOperator(\"localeMission.id\",Integer.parseInt(localeMissionId),\"=\"));\n\t\t\t\t\ttotal5 = locAppItemMgr.getTotalCount(new KeyValueWithOperator(\"localeMission.id\",Integer.parseInt(localeMissionId),\"=\"));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tJSONArray optionsq = new JSONArray();\n\t\t\t\tint id=1;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tJSONObject option = new JSONObject();\n\t\t\t\tString applianceInfo=\"\";\n\n\t\t\t\toption.put(\"Id\", id++);\n\t\t\t\t\n\t\t\t\toption.put(\"ApplianceName\", \"\");\n\t\t\t\t\n\t\t\t\toption.put(\"Quantity\", \"\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\toption.put(\"Model\",\"\");\n\t\t\t\toption.put(\"Accuracy\", \"\");\n\t\t\t\toption.put(\"Range\", \"\");\t\t\t\t\t\t\n\t\t\t\toption.put(\"AppFactoryCode\", \"\");\n\t\t\t\toption.put(\"AppManageCode\", \"\");\n\t\t\t\toption.put(\"Manufacturer\", \"\");\n\t\t\t\t\t\t\n\t\t\t\toption.put(\"applianceInfo\", \"\");\n\t\t\t\tString CertType=\"\";\n\t\t\t\t\n\t\t\t\toption.put(\"CertType\", CertType);\t\t\t\t\t\n\t\t\t\toption.put(\"TestCost\",\"\");\n\t\t\t\toption.put(\"RepairCost\",\"\");\n\t\t\t\toption.put(\"MaterialCost\",\"\");\n\t\t\t\toption.put(\"WorkStaff\",\"\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\toptionsq.put(option);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (int i=0;i<21;i++) { //为了调试,空21行\n\t\t\t\t\tJSONObject option2 = new JSONObject();\n\t\t\t\t\toption2.put(\"Id\", id++);\n\t\t\t\t\toption2.put(\"ApplianceName\", \" \");\t\n\t\t\t\t\toption2.put(\"applianceInfo\", \"\");\n\t\t\t\t\toption2.put(\"Model\",\" \");\n\t\t\t\t\toption2.put(\"Accuracy\", \" \");\n\t\t\t\t\toption2.put(\"Range\", \" \");\n\t\t\t\t\toption2.put(\"Quantity\", \" \");\n\t\t\t\t\toption2.put(\"AppFactoryCode\",\"\");\n\t\t\t\t\toption2.put(\"AppManageCode\", \"\");\n\t\t\t\t\toption2.put(\"Manufacturer\", \"\");\n\t\t\t\t\toption2.put(\"CertType\", \" \");\n\t\t\t\t\toption2.put(\"RepairCost\",\"\");\n\t\t\t\t\toption2.put(\"MaterialCost\",\"\");\n\t\t\t\t\toption2.put(\"TestCost\",\"\");\n\t\t\t\t\toption2.put(\"WorkStaff\",\"\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\toptionsq.put(option2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(id<=10){\n\t\t\t\t\tint temp=id;\n\t\t\t\t\tfor (int i=0;i<(11-temp%10);i++) { //首页10行\n\t\t\t\t\t\tJSONObject option1 = new JSONObject();\n\t\t\t\t\t\toption1.put(\"Id\", id++);\n\t\t\t\t\t\toption1.put(\"ApplianceName\", \" \");\t\n\t\t\t\t\t\toption1.put(\"applianceInfo\", \"\");\n\t\t\t\t\t\toption1.put(\"Model\",\" \");\n\t\t\t\t\t\toption1.put(\"Accuracy\", \" \");\n\t\t\t\t\t\toption1.put(\"Range\", \" \");\n\t\t\t\t\t\toption1.put(\"Quantity\", \" \");\n\t\t\t\t\t\toption1.put(\"AppFactoryCode\",\"\");\n\t\t\t\t\t\toption1.put(\"AppManageCode\", \"\");\n\t\t\t\t\t\toption1.put(\"Manufacturer\", \"\");\n\t\t\t\t\t\toption1.put(\"CertType\", \" \");\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toption1.put(\"TestCost\",\"\");\n\t\t\t\t\t\toption1.put(\"RepairCost\",\"\");\n\t\t\t\t\t\toption1.put(\"MaterialCost\",\"\");\n\t\t\t\t\t\toption1.put(\"WorkStaff\",\"\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toptionsq.put(option1);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tint temp=id-10;\n\t\t\t\t\tfor (int i=0;i<(23-temp%22);i++) { //每页20行\n\t\t\t\t\t\tJSONObject option1 = new JSONObject();\n\t\t\t\t\t\toption1.put(\"Id\", id++);\n\t\t\t\t\t\toption1.put(\"ApplianceName\", \" \");\n\t\t\t\t\t\toption1.put(\"applianceInfo\", \"\");\n\t\t\t\t\t\toption1.put(\"Model\",\" \");\n\t\t\t\t\t\toption1.put(\"Accuracy\", \" \");\n\t\t\t\t\t\toption1.put(\"Range\", \" \");\n\t\t\t\t\t\toption1.put(\"Quantity\", \" \");\n\t\t\t\t\t\toption1.put(\"AppFactoryCode\",\"\");\n\t\t\t\t\t\toption1.put(\"AppManageCode\", \"\");\n\t\t\t\t\t\toption1.put(\"Manufacturer\", \"\");\n\t\t\t\t\t\toption1.put(\"CertType\", \" \");\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toption1.put(\"TestCost\",\"\");\n\t\t\t\t\t\toption1.put(\"RepairCost\",\"\");\n\t\t\t\t\t\toption1.put(\"MaterialCost\",\"\");\n\t\t\t\t\t\toption1.put(\"WorkStaff\",\"\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\toptionsq.put(option1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresJson18.put(\"total\", id);\n\t\t\t\tresJson18.put(\"rows\", optionsq);\n\t\t\t\t\n\t\t\t\tLocaleMission loc=locmissMgr.findById(Integer.parseInt(localeMissionId));\n\t\t\t\tresJson18.put(\"CustomerName\", loc.getCustomerName());\n\t\t\t\tresJson18.put(\"Code\", loc.getCode());\n\t\t\t\tresJson18.put(\"Department\", loc.getDepartment());\n\t\t\t\tresJson18.put(\"Address\", loc.getAddress_1());\n\t\t\t\tresJson18.put(\"ZipCode\", loc.getZipCode());\n\t\t\t\tresJson18.put(\"Contactor\", loc.getContactor());\n\t\t\t\tresJson18.put(\"ContactorTel\", loc.getTel()==null?\"\":loc.getTel());\n\t\t\t\tresJson18.put(\"SiteManager\", loc.getSysUserBySiteManagerId()==null?\"\":loc.getSysUserBySiteManagerId().getName());\n\t\t\t\tresJson18.put(\"HeadNameName\", loc.getAddress().getHeadName());\n\t\t\t\tresJson18.put(\"HeadNameAddress\", loc.getAddress().getAddress());\n\t\t\t\tresJson18.put(\"HeadNameFax\", loc.getAddress().getFax()==null?\"\":loc.getAddress().getFax());\n\t\t\t\tresJson18.put(\"HeadNameTel\", loc.getAddress().getTel()==null?\"\":loc.getAddress().getTel());//查询电话\n\t\t\t\tresJson18.put(\"HeadNameComplainTel\", loc.getAddress().getComplainTel()==null?\"\":loc.getAddress().getComplainTel());//投诉电话\n\t\t\t\tresJson18.put(\"HeadNameZipCode\", loc.getAddress().getZipCode()==null?\"\":loc.getAddress().getZipCode());//\n\t\t\t\t\n\t\t\t\tSimpleDateFormat sf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\tif(loc.getExactTime()!=null){\n\t\t\t\t\tresJson18.put(\"ExactTime\", sf.format(loc.getExactTime()));//报价时间\\\n\t\t\t\t}else{\n\t\t\t\t\tresJson18.put(\"ExactTime\", \"\");//报价时间\\\n\t\t\t\t}\n\t\t\t\tresJson18.put(\"PrintType\", \"1\");//打印类型,“”代表正常的表,\"1\"代表空表\n\t\t\t\tresJson18.put(\"IsOK\", true);\n\t\t\t\treq.getSession().setAttribute(\"AppItemsList\", resJson18);\n\t\t\t\n\t\t\t\tresp.sendRedirect(\"/jlyw/TaskManage/LocaleMissionPrint.jsp\");\n\t\t\t}catch(Exception e){\n\t\t\t\ttry {\n\t\t\t\t\tresJson18.put(\"total\", 0);\n\t\t\t\t\tresJson18.put(\"rows\", new JSONArray());\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresJson18.put(\"IsOK\", false);\n\t\t\t\t\t\tresJson18.put(\"msg\", String.format(\"打印空表失败!错误信息:%s\", (e!=null && e.getMessage()!=null)?e.getMessage():\"无\"));\n\t\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (JSONException e1) {}\n\t\t\t\tif(e.getClass() == java.lang.Exception.class){\t//自定义的消息\n\t\t\t\t\tlog.debug(\"exception in LocaleMissionServlet-->case 18\", e);\n\t\t\t\t}else{\n\t\t\t\t\tlog.error(\"error in LocaleMissionServlet-->case 18\", e);\n\t\t\t\t}\n\t\t\t\treq.getSession().setAttribute(\"AppItemsList\", resJson18);\n\t\t\t\t\n\t\t\t\tresp.sendRedirect(\"/jlyw/TaskManage/LocaleMissionPrint.jsp\");\n\t\t\t}\n\t\t\tbreak;\t\n\t\t}\n\t\t\n\t}", "void projectSurveyUriRequest(Request request);", "public interface FindPasswordApiService {\n\n @FormUrlEncoded\n @POST(api.GET_VERIFY_CODE)\n Observable<HttpRes<VerifyCodeBean>> getVerifyCode(@FieldMap Map<String, String> map);\n\n @FormUrlEncoded\n @POST(api.MODIIFY_PASSWORD)\n Observable<HttpRes<LoginBean>> modifyPassword(@FieldMap Map<String, String> map);\n}", "public Boolean register(HttpServletRequest request) throws Exception;", "public void usersPost (User body, final Response.Listener<User> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n\n // create path and map variables\n String path = \"/users\".replaceAll(\"\\\\{format\\\\}\",\"json\");\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \"application/json\"\n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"POST\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, \"\", User.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@POST\n \t@Path(\"/form\")\n \t@Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n \t@Produces(MediaType.TEXT_PLAIN)\n \tpublic String formMethod(@QueryParam(\"token\") String token,\n \t\t\t@FormParam(\"name\") String name,\n \t\t\t@FormParam(\"location\") String location) {\n \t\t// map json to json object \n \t\treturn token + \"::\" + name + \"::\" + location + \"\\n\";\n \t}", "@Override\r\n public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n ModelAndView modelAndView) throws Exception {\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "public interface APIService {\n@FormUrlEncoded\n @POST(Urls.REGISTER_URL)\n Call<ModelRegister>register(@FieldMap HashMap<String,String>params);\n @FormUrlEncoded\n @POST(Urls.LOGIN_URL)\n Call<ModelLogin>login(@FieldMap HashMap<String,String>params);\n @FormUrlEncoded\n @POST(Urls.FBLOGIN)\n Call<ModelFbRegister>fbregister(@FieldMap HashMap<String,String>params);\n @FormUrlEncoded\n @POST(Urls.CHANGE_PASSWORD)\n Call<ModelchangePassword>chnagepassword(@FieldMap HashMap<String,String>params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelregister> register(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modellogin> login_email(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelallreminder> all_reminder(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelsetreminder> add_reminder(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelloadcategory> load_category(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<ModelLoadIncome> load_income(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelbanks> load_banks(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modeladdaccount> add_account(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modeloadaccount> load_accounts(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modeladdrecord> add_record(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modeldelaccount> del_account(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modeladdcategory> add_category(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelgetprofile> get_profile(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelupdate_profile> update_profile(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelupdate_profile> update_password(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modelcontact> contactus(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<ModelYearlyCategoryReport> yearlycategoryreport(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<ModelYearlyReport> yearlyreport(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<Modeloadaccount> load_status(@FieldMap HashMap<String, String> params);\n// @Headers(\"Oakey:try\")\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<ModelFblogin> fb_login(@FieldMap HashMap<String, String> params);\n//\n//\n//\n// @FormUrlEncoded\n// @POST(Urls.register)\n// Call<ModelRegister> register(@FieldMap HashMap<String, String> params);\n//\n// @FormUrlEncoded\n// @POST(Urls.facebookRegister)\n// Call<ModelFbRegister> facebookRegister(@FieldMap Map<String, String> map);\n//\n// @FormUrlEncoded\n// @POST(Urls.facebookLogin)\n// Call<ModelLogin> facebookLogin(@FieldMap Map<String, String> map);\n//\n// @POST(Urls.getJobList)\n// Call<ModelJobs> getJobs(@QueryMap Map<String, String> map);\n//\n// @FormUrlEncoded\n// @POST(Urls.getnotification)\n// Call<ModelJobs>getnotification(@FieldMap Map<String, String> map);\n// @FormUrlEncoded\n// @POST(Urls.getaboutus)\n// Call<ModelAboutUs>getaboutus(@FieldMap Map<String, String> map);\n// @FormUrlEncoded\n// @POST(Urls.getnotificationcount)\n// Call<ModelNotificationCount>getnotificationcount(@FieldMap Map<String, String> map);\n// @FormUrlEncoded\n// @POST(Urls.getlogout)\n// Call<Modellogout>getlogout(@FieldMap Map<String, String> map);\n// @FormUrlEncoded\n// @POST(Urls.getPutYourSkillsToWork)\n// Call<ModelPutYourSkillsToWork> getJobseekers(@FieldMap Map<String, String> map);\n// @FormUrlEncoded\n// @POST(Urls.getPlants)\n// Call<ModelPlants> getPlants(@FieldMap Map<String, String> map);\n// @POST(Urls.getplant1)\n// Call<ModelPlants> getPlants1(@QueryMap Map<String, String> map);\n//\n// @POST(Urls.getRequirements)\n// Call<ModelRequirements> getRequirements(@QueryMap Map<String, String> map);\n//\n// @FormUrlEncoded\n// @POST(Urls.getJobDetail)\n// Call<ModelJobDetail> getJobDetail(@FieldMap Map<String, String> map);\n//\n//\n// @FormUrlEncoded\n// @POST(Urls.getPutPlantDetail)\n// Call<ModelPutPlantDetail> getPutPlantDetail(@FieldMap Map<String, String> map);\n//\n// @FormUrlEncoded\n// @POST(Urls.updateProfile)\n// Call<ModelUpadateJobprofile> getUpdateProfile(@FieldMap Map<String, String> map);\n//\n// @FormUrlEncoded\n// @POST(Urls.jobSeekerDetail)\n// Call<ModelJobSeekerDetail> getJobSeekerDetail(@FieldMap Map<String, String> map);\n//\n// @FormUrlEncoded\n// @POST(Urls.applyNow)\n// Call<ModelApplyNow> getApplyNow(@FieldMap Map<String, String> map);\n\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "private void createPostMap() {\n Map<String, String> map = new HashMap<>();\n map.put(\"userId\", \"12\");\n map.put(\"title\", \"New Title\");\n Call<PostModel> call = jsonPlaceHolderAPI.createPostMap(map);\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getTitle() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "@PostMapping(\"registrar\")\n public ResponseEntity<?> registrar(@RequestBody String payload) {\n\n JsonObject json = new Gson().fromJson(payload, JsonObject.class);\n try {\n log.info(\"Pude crear el objeto básico JSON \");\n log.info(\"siendo: \" + payload.toString());\n //log.info( \" Como yo se los objetos que vienen, puedo castear los wrappers por parte\");\n //log.info( \"Objeto 1: LoginDatos, Objeto 2: Formulario (String), 3: String[+ \");\n Usuario usuario = new Gson().fromJson(json.get(\"usuario\"), Usuario.class);\n JsonObject formulario = new Gson().fromJson(json.get(\"formulario\"), JsonObject.class);\n log.info(\"FORM: \" + formulario.toString());\n boolean artista = formulario.get(\"isArtista\").getAsBoolean();\n\n if (artista) {\n String instrumentos = new Gson().fromJson(json.get(\"instrumentos\"), String.class);\n this.usuarioServicio.guardarArtista(usuario, formulario, instrumentos);\n return new ResponseEntity(new Mensaje(\" El usuario ARTISTA se creó correctamente\"), HttpStatus.OK);\n } else {\n this.usuarioServicio.guardarComercio(usuario, formulario);\n return new ResponseEntity(new Mensaje(\" El usuario COMERCIO se creó correctamente\"), HttpStatus.OK);\n\n }\n\n } catch (Exception e) {\n return new ResponseEntity(new Mensaje(\" El uNOOOOOOOOOOOOOOOOOOOO se creó correctamente\"), HttpStatus.BAD_REQUEST);\n }\n }", "public interface ApiService {\n @POST(\"/AutoComplete/autocomplete/json\")\n void placeAuto(@Query(\"input\") String input, @Query(\"key\") String key, Callback<AutoComplete> callback);\n\n @POST(\"/geocode/json\")\n void getLatLng(@Query(\"address\") String address, @Query(\"key\") String key, Callback<GeocodingMain> callback);\n\n @POST(\"/directions/json\")\n void getroute(@Query(\"origin\") String origin, @Query(\"destination\") String destination, @Query(\"key\") String key, Callback<Directions> callback);\n\n @POST(\"/geocode/json\")\n void reverseGeoCoding(@Query(\"latlng\") String latLng, @Query(\"key\") String key, Callback<RevGeocodingMain> callback);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}", "private void StringRequest_POST() {\n\t\tString POST = \"http://api.juheapi.com/japi/toh?\";\n\t\trequest = new StringRequest(Method.POST, POST, new Listener<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tToast.makeText(MainActivity.this, arg0, Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}, new ErrorListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onErrorResponse(VolleyError arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tToast.makeText(MainActivity.this, arg0.toString(), Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}){@Override\n\t\tprotected Map<String, String> getParams() throws AuthFailureError {\n\t\t\tHashMap< String , String> map = new HashMap<String,String>();\n\t\t\tmap.put(\"key\", \"7bc8ff86168092de65576a6166bfc47b\");\n\t\t\tmap.put(\"v\", \"1.0\");\n\t\t\tmap.put(\"month\", \"11\");\n\t\t\tmap.put(\"day\", \"1\");\n\t\t\treturn map;\n\t\t}};\n\t\trequest.addMarker(\"StringRequest_GET\");\n\t\tMyApplication.getHttpRequestQueue().add(request);\n\t}", "BodyHandler getBodyHandler();", "Object handle(Object request);", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@BodyParser.Of(play.mvc.BodyParser.Json.class)\n public static Result create() throws JsonParseException, JsonMappingException, IOException {\n JsonNode json = request().body().asJson();\n Thing thing = mapper.treeToValue(json, Thing.class);\n thing.save();\n return ok(mapper.valueToTree(thing));\n }" ]
[ "0.58018225", "0.5422599", "0.5394169", "0.5283255", "0.52690256", "0.5232308", "0.51962245", "0.5084384", "0.5073526", "0.50688833", "0.5062166", "0.50521827", "0.50044817", "0.49669054", "0.49453196", "0.49341598", "0.49288177", "0.49136826", "0.4895739", "0.48862863", "0.48749313", "0.48640826", "0.48632252", "0.48476654", "0.48455194", "0.48394498", "0.48384345", "0.48222613", "0.4812461", "0.4810886", "0.4805276", "0.47990364", "0.47986165", "0.47925976", "0.47849217", "0.4775255", "0.47709346", "0.47580728", "0.47407264", "0.47359937", "0.4706956", "0.4702875", "0.47016037", "0.47015163", "0.47015163", "0.47005904", "0.46618405", "0.4656282", "0.46494552", "0.46422172", "0.46416956", "0.46410173", "0.46403176", "0.46329483", "0.4628285", "0.4627126", "0.46220747", "0.46193755", "0.4616903", "0.4607399", "0.46049076", "0.4604072", "0.4600201", "0.45936263", "0.45927346", "0.4589825", "0.45815334", "0.4579949", "0.457827", "0.4576981", "0.45755953", "0.45726123", "0.45670193", "0.45664436", "0.45638388", "0.45614067", "0.45575604", "0.45570466", "0.45436564", "0.45430318", "0.45420897", "0.45361042", "0.45346758", "0.4532129", "0.45293027", "0.4527685", "0.45269635", "0.45262608", "0.45205006", "0.45194685", "0.4516445", "0.45157722", "0.4515392", "0.45139104", "0.45126757", "0.45123956", "0.45121506", "0.45016253", "0.44966882", "0.44929165" ]
0.507039
9
This method returns a list of monitored URLs as JSON object.
@RequestMapping(value = "urls", method = RequestMethod.GET) @ResponseBody @ResponseStatus(HttpStatus.OK) public List<MonitoredUrl> getUrls() { System.out.println("geturls"); return urlChecker.getMonitoredUrls(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Map<String,Object>> getURLs() {\n return urls;\n }", "public List<String> getUrls() {\n\t\treturn urls;\n\t}", "public URL[] getUrls() {\n\t\treturn urls.toArray(new URL[urls.size()]);\n\t}", "public ArrayList<String> getWebserverUrl() {\n\n if (webListener.isServiceFound()) {\n return webListener.getServiceURLs();\n }\n return new ArrayList<>();\n }", "public Stream<ParsedURL> urls() {\n return stream().map(req -> new ParsedURL(req.getUrl()));\n }", "@Scheduled(fixedRate = checkRate - 1000) // Un minuto menos\n public void getUrls() {\n urlList = shortURLRepository.listAll();\n }", "public ExternalUrl getExternalUrls() {\n return externalUrls;\n }", "public String[] getUrls() {\n\t\tif (results == null)\n\t\t\treturn null;\n\t\tWebSearchResult[] resultsArray = results.listResults();\n\t\tString[] urls = new String[resultsArray.length];\n\t\tfor (int i = 0; i < urls.length; i++) {\n\t\t\turls[i] = resultsArray[i].getUrl();\n\t\t}\n\t\treturn urls;\n\t}", "@RequestMapping(value = \"urlchecks\", method = RequestMethod.GET)\n @ResponseBody\n @ResponseStatus(HttpStatus.OK)\n public List<UrlCheck> getUrlChecks()\n {\n System.out.println(\"urlchecks\");\n return urlChecker.getUrlChecks();\n }", "public Map<String, URLValue> loadAllURLs()\n\t{\n\t\tEntityCursor<URLEntity> results = this.env.getEntityStore().getPrimaryIndex(String.class, URLEntity.class).entities();\n\t\tMap<String, URLValue> urls = new HashMap<String, URLValue>();\n\t\tURLValue url;\n\t\tfor (URLEntity entity : results)\n\t\t{\n\t\t\turl = new URLValue(entity.getKey(), entity.getURL(), entity.getUpdatingPeriod());\n\t\t\turls.put(url.getKey(), url);\n\t\t}\n\t\tresults.close();\n\t\treturn urls;\n\t}", "public List<URL> newURLs() {\r\n // TODO: Implement this!\r\n return new LinkedList<URL>();\r\n }", "public List<String> getLinks();", "public ArrayList<URI> getList() { return new ArrayList<URI>(); }", "public ArrayList<String> getWebLink(){\r\n\t\treturn webLinks;\t\t\r\n\t}", "public Collection<Map<String, String>> getLinks();", "public List<Address> getWatchedAddresses() {\n try {\n List<Address> addresses = new LinkedList<Address>();\n for (Script script : watchedScripts)\n if (script.isSentToAddress())\n addresses.add(script.getToAddress(params));\n return addresses;\n } finally {\n }\n }", "public com.google.protobuf.ProtocolStringList\n getHotelImageURLsList() {\n return hotelImageURLs_.getUnmodifiableView();\n }", "java.util.List<java.lang.String>\n getPeerURLsList();", "public String getRouters(){\n wifi.startScan();\n results = wifi.getScanResults();\n size = results.size();\n String jsonRouter = new Gson().toJson(results);\n return jsonRouter;\n }", "public ArrayList<String> getNameServerUrl() {\n\n if (nameListener.isServiceFound()) {\n return nameListener.getServiceURLs();\n }\n return new ArrayList<>();\n }", "public String getFinalUrls() {\r\n return finalUrls;\r\n }", "public List<String> listAllRemoteSites () {\r\n\t\ttry {\r\n\t\t\tList<String> urls = new ArrayList<String>();\r\n\t\t\tpstmt = conn.prepareStatement(\"SELECT * FROM RemoteSite\");\r\n\t\t\trset = pstmt.executeQuery();\r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\turls.add(rset.getString(\"url\"));\r\n\t\t\t}\r\n\t\t\treturn urls;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t} finally {\r\n\t\t\tDatabaseConnection.closeStmt(pstmt, rset);\r\n\t\t}\r\n\t}", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n public List<URL> index() throws MalformedURLException {\n\n List<URL> urls = new ArrayList<URL>();\n\n urls.add(new URL(\"http://localhost:8080/halogens\"));\n urls.add(new URL(\"http://localhost:8080/neutrons\"));\n urls.add(new URL(\"http://localhost:8080/weight/50\"));\n\n return urls;\n }", "private List<Woacrawledurl> readCrawledUrls()\n\t{\n\t\tString hql = \"from Woacrawledurl where instanceId=\"\n\t\t\t\t+ this.param.instance.getTaskinstanceId() + \"order by id\";\n\t\tSessionFactory sessionFactory = TaskFactory.getSessionFactory(this.param.dbid);\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tTransaction t = session.beginTransaction();\n\t\tQuery q = session.createQuery(hql);\n\t\tList<Woacrawledurl> list = q.list();\n\t\tt.commit();\n\t\treturn list;\n\t}", "public List<String> getPhotoUrls() {\n return photoUrls;\n }", "public Set<String> getURLs() {\n return pageURLs;\n }", "public List<ResourceLink> links() {\n return links;\n }", "@GET\t\n\t@Produces(\"application/json\")\n\t@Path(\"/\")\n\tpublic List<Site> findAllSites(){\n\t\treturn siteDaoObj.findAllSites();\n\t\t\n\t}", "public ObservableList<Connect> getLinks() {\n return this.links;\n }", "public List<URI> getLinks() {\n return links; // this is already unmodifiable\n }", "public List<String> getImagesUrl() {\n\t\tif (imagesUrl == null) {\n\t\t\timagesUrl = new ArrayList<String>();\n\t\t}\n\t\treturn imagesUrl;\n\t}", "public List<Object> getCrawlersLocalData()\n\t{\n\t\treturn crawlersLocalData;\n\t}", "List<String> getHosts();", "public com.google.protobuf.ProtocolStringList\n getHotelImageURLsList() {\n return hotelImageURLs_;\n }", "public List<String> listeners();", "com.google.protobuf.ProtocolStringList\n getHotelImageURLsList();", "public List<WatchRecord> getWatchList() throws Exception {\r\n List<WatchRecord> watchList = new Vector<WatchRecord>();\r\n List<WatchRecordXML> chilluns = this.getChildren(\"watch\", WatchRecordXML.class);\r\n for (WatchRecordXML wr : chilluns) {\r\n watchList.add(new WatchRecord(wr.getPageKey(), wr.getLastSeen()));\r\n }\r\n return watchList;\r\n }", "public List<String> getTotalLaunchers() {\n return persistence.getTotalLauncherUrls();\n }", "public List<String> getUris()\r\n/* 125: */ {\r\n/* 126:129 */ return this.uris;\r\n/* 127: */ }", "public String getFinalAppUrls() {\r\n return finalAppUrls;\r\n }", "public String[] listConnections() {\n\t\t\tString[] conns = new String[keyToConn.entrySet().size()];\n\t\t\tint i = 0;\n\n\t\t\tfor (Map.Entry<String, Connection> entry : keyToConn.entrySet()) {\n\t\t\t\t// WebSocket ws = entry.getKey();\n\t\t\t\tConnection conn = entry.getValue();\n\t\t\t\tconns[i] = String.format(\"%s@%s\", conn.user, entry.getKey());\n\t\t\t\t++i;\n\t\t\t}\n\t\t\tArrays.sort(conns);\n\t\t\treturn conns;\n\t\t}", "public List<Map> getWatchListBasedOnUserName(String userName);", "List<Link> getLinks();", "public List<Script> getWatchedScripts() {\n try {\n return new ArrayList<Script>(watchedScripts);\n } finally {\n }\n }", "public List<String> getLinks() {\r\n\t\treturn this.links;\r\n\t}", "java.util.List<online_info>\n getInfoList();", "public List<Link> getLinks()\n {\n return links;\n }", "public List<String> streams() {\n return this.streams;\n }", "@Override\n\tpublic Collection<URL> getUrlsToFilter() {\n\t\tSet<URL> filterSet = new HashSet<URL>();\n\t\tString url=\"http://www.infoq.com/news/2012/11/Panel-WinRT-Answers;jsessionid=91AB81A159E85692E6F1199644E2053C \";\n\t\tfilterSet.add(URL.valueOf(url));\n\t\treturn filterSet;\n\t}", "public List<arc> getOutcomingLinks() {\r\n\t\treturn outcoming;\r\n\t}", "public Urls getUrlsCreatedAndApprovedToday() {\n\t\treturn (Urls) selectByMethod(\"isCreatedAndApprovedToday\", null);\n\t}", "public List<Link> links() {\n return this.links;\n }", "private static ArrayList<String> fetchHistory() {\n\t\tScanner s;\n\t\tint count = 0;\n\t\tArrayList<String> historyList = new ArrayList<String>();\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"History.txt\"));\n\t\t\twhile (s.hasNext()) {\n\t\t\t\thistoryList.add(s.next());\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tSystem.out.println(\"Number of converted urls fetched: \" + count);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn historyList;\n\t}", "java.util.List<org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto> \n getLinksList();", "public List<arc> getIncomingLinks() {\r\n\t\treturn incoming;\r\n\t}", "public int getListCount() { return this.urlSeries.size(); }", "public Map<String, LearnlabDomainMetricsReport> getRemoteInstanceReports() {\n return remoteInstanceReports;\n }", "public void list(yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksResponse> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver);\n }", "@GetMapping(\"/stats.latest\")\n @ResponseBody\n public List<ShortUrl> latestStats() {\n\n // Simple return of last 10 urls and access records. This would need a lot more\n // work to scale, including creating a more granular API\n\n List<ShortUrl> latest = repository.findTop10ByOrderByCreatedOnDesc();\n\n return latest;\n }", "public List<URL> getURLList(final String key) {\n return getURLList(key, new ArrayList<>());\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksResponse> list(\n yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getListMethod(), getCallOptions()), request);\n }", "public void list(yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksResponse> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver);\n }", "public String getFinalMobileUrls() {\r\n return finalMobileUrls;\r\n }", "public URL[] getURLs(String mkey) {\n\t\tURL last;\n\t\tint i = 0;\n\t\tArrayList<URL> v = new ArrayList<>();\n\t\twhile (true) {\n\t\t\tlast = getURL(mkey + i);\n\t\t\ti++;\n\t\t\tif (last == null)\n\t\t\t\tbreak;\n\t\t\tv.add(last);\n\t\t}\n\t\tif (v.size() != 0) {\n\t\t\tURL[] path = new URL[v.size()];\n\t\t\treturn v.toArray(path);\n\t\t} else {\n\t\t\treturn (URL[]) getDefault(mkey);\n\t\t}\n\t}", "public String getUrl(){\n return urlsText;\n }", "public URL[] getJARs() throws MalformedURLException {\n return (urlsFromJARs(getJARNames()));\n }", "@GET\n @Produces(\"application/json\")\n public List<Photos> getPhotos() {\n \tPhotosDAO dao = new PhotosDAO();\n List photos = dao.getPhotos();\n return photos;\n }", "public static List getAllUrl() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT url FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String naziv = result.getString(\"url\");\n polovniautomobili.add(naziv);\n\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "private static String getList(String responseString) throws JSONException {\n\t\tJSONObject array = new JSONObject(responseString);\n\t\treturn array.getString(\"url\");\n\t}", "public List<Connection> getConnections() {\n\t\treturn new ArrayList<Connection>(connectionsByUri.values());\n\t}", "private Future<List<Record>> getAllEndpoints() {\n Future<List<Record>> future = Future.future();\n discovery.getRecords(record -> record.getType().equals(HttpEndpoint.TYPE),\n future.completer());\n return future;\n }", "protected List<List<URL>> getDefaultUrlList() throws MalformedURLException {\n URL[] urls1 = { \n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/ka.png\"),\n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/uci.png\"),\n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/gifs/dougs-small.jpg\")\n };\n URL[] urls2 = {\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/lil-doug.jpg\"),\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/wm.jpg\"),\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/ironbound.jpg\")\n };\n\n \tList<List<URL>> variableNumberOfInputURLs = \n new ArrayList<List<URL>>();\n variableNumberOfInputURLs.add(Arrays.asList(urls1));\n variableNumberOfInputURLs.add(Arrays.asList(urls2));\n \treturn variableNumberOfInputURLs;\n }", "@java.lang.Override\n public java.util.List<org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto> getLinksList() {\n return java.util.Collections.unmodifiableList(\n instance.getLinksList());\n }", "public ArrayList<String> getBrowseHistory() {\n \treturn this.browseHistory;\n }", "public JSONObject jsonSerialize() {\n JSONObject jsonObject = new JSONObject();\n\n // Serialize the UrlDevices\n JSONArray urlDevices = new JSONArray();\n for (UrlDevice urlDevice : mDeviceIdToUrlDeviceMap.values()) {\n urlDevices.put(urlDevice.jsonSerialize());\n }\n jsonObject.put(DEVICES_KEY, urlDevices);\n\n // Serialize the URL metadata\n JSONArray metadata = new JSONArray();\n for (PwsResult pwsResult : mBroadcastUrlToPwsResultMap.values()) {\n metadata.put(pwsResult.jsonSerialize());\n }\n jsonObject.put(METADATA_KEY, metadata);\n\n jsonObject.put(SCHEMA_VERSION_KEY, SCHEMA_VERSION);\n return jsonObject;\n }", "public yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksResponse list(yandex.cloud.api.logging.v1.SinkServiceOuterClass.ListSinksRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getListMethod(), getCallOptions(), request);\n }", "public java.util.List<MonitoringOutput> getMonitoringOutputs() {\n return monitoringOutputs;\n }", "public String getLiveNodes()\n {\n return ssProxy.getLiveNodes();\n }", "public Set<URLPair> getVisited() { return this.pool.getVisitedKeys(); }", "private List<IntWatcher> getWatchers(String name) {\n List<IntWatcher> ws = watchers.get(name);\n if (ws == null) {\n ws = new ArrayList<>();\n watchers.put(name, ws);\n }\n return ws;\n }", "public static String[] getHttpExportURLs() {\n\t\tif (xml == null) return new String[0];\n\t\treturn httpExportURLs;\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response index() {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n String methodType=\"GET\";\n URL url = new URL(endpoint);\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_JSON\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_JSON\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n BufferedReader in = new BufferedReader(\n new InputStreamReader(urlConnection.getInputStream()));\n String inputLine;\n StringBuilder content = new StringBuilder();\n while ((inputLine = in.readLine()) != null) {\n content.append(inputLine);\n }\n return Response.ok(content.toString()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n } \n } catch (IOException ex) {\n System.err.println(ex);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }", "@GET\n @Path(\"/endpoints\")\n @Produces(ApiOverviewRestEndpoint.MEDIA_TYPE_JSON_V1)\n @Cache\n Response getAvailableEndpoints(@Context final Dispatcher dispatcher);", "public List<WebResource> getImages() {\r\n\t\tList<WebResource> result = new Vector<WebResource>();\r\n\t\tList<WebComponent> images = wcDao.getImages();\r\n\t\t// settare l'href corretto...\r\n\t\tfor (Iterator<WebComponent> iter = images.iterator(); iter.hasNext();) {\r\n\t\t\tresult.add((WebResource) iter.next());\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public List<Crawler> getCrawlerList() {\n return crawlerList;\n }", "@Override\n public List<ServiceEndpoint> listServiceEndpoints() {\n return new ArrayList<>(serviceEndpoints.values());\n }", "java.util.List<io.netifi.proteus.admin.om.Connection> \n getConnectionsList();", "@Deprecated\n public Map<File, FileWatcher> getWatchers() {\n final Map<File, FileWatcher> map = new HashMap<>(watchers.size());\n for (Map.Entry<Source, ConfigurationMonitor> entry : watchers.entrySet()) {\n if (entry.getValue().getWatcher() instanceof ConfigurationFileWatcher) {\n map.put(entry.getKey().getFile(), (FileWatcher) entry.getValue().getWatcher());\n } else {\n map.put(entry.getKey().getFile(), new WrappedFileWatcher((FileWatcher) entry.getValue().getWatcher()));\n }\n }\n return map;\n }", "static List<String> read() {\n String fileName = getFilePath();\n List<String> urls = new ArrayList<>();\n \n if (Files.notExists(Paths.get(fileName))) {\n return urls;\n }\n \n try (Stream<String> stream = Files.lines(Paths.get(fileName))) {\n urls = stream\n // Excludes lines that start with # as that is used for comments\n // and must start with http:// as that is required by crawler4j.\n .filter(line -> !line.startsWith(\"#\") &&\n line.startsWith(\"http://\") || line.startsWith(\"https://\"))\n .map(String::trim)\n .map(String::toLowerCase)\n .collect(Collectors.toList());\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n return urls;\n }", "@Override\r\n public List<String> getMatchedURIs() {\n return null;\r\n }", "public List<Link> getOutLinks() {\r\n return outLinks;\r\n }", "List<String> getListPaths();", "public List<WebComponent> getWebResources() {\r\n\t\treturn wcDao.getWebResources();\r\n\t}", "public List updaters() {\n return updaters; }", "public List<Observer> getList() {\n return list;\n }", "public com.google.protobuf.ProtocolStringList\n getNonResourceUrlsList() {\n return nonResourceUrls_.getUnmodifiableView();\n }", "public List<String> getRunLogAsList();", "public Set<String> getLinks() {\n return links;\n }", "public Set<URL> getTargetPageURLs(){\n\t\tSet<URL> urls = new HashSet<URL>();\n\t\tString url = \"http://www.infoq.com/news/2012/12/twemproxy;jsessionid=1652D82C3359CBAB67DA00B26BE7784B\";\n\t\turls.add(URL.valueOf(url));\n\t\treturn urls;\n\t}", "@GET\n public Response getLinks() {\n List<Link> links = new ArrayList<>();\n links.add(Link.fromUri(CommonConstants.API_URI+\"users/login\").rel(\"login\").build());\n links.add(Link.fromUri(CommonConstants.API_URI+\"users/\").rel(\"users\").build());\n links.add(Link.fromUri(CommonConstants.API_URI+\"boardgames/\").rel(\"boardgames\").build());\n\n return Response.ok().links(links.toArray(new Link[links.size()])).build();\n }" ]
[ "0.6858596", "0.6374427", "0.6042415", "0.6040149", "0.5977192", "0.58303726", "0.58038765", "0.57970715", "0.5726692", "0.5660005", "0.55810416", "0.55491424", "0.5492921", "0.54559857", "0.5424667", "0.540827", "0.5381189", "0.53807545", "0.53776944", "0.5370763", "0.5342677", "0.5341817", "0.53379834", "0.53143513", "0.5273051", "0.52625984", "0.5262153", "0.52568066", "0.52420634", "0.5237507", "0.52316666", "0.52207476", "0.52195656", "0.52129847", "0.52067655", "0.5205061", "0.51938444", "0.5192538", "0.5174475", "0.51538306", "0.51485515", "0.51476675", "0.5116078", "0.51071954", "0.5078993", "0.5071042", "0.50681555", "0.50595003", "0.5051617", "0.50336593", "0.50289637", "0.50269693", "0.5023887", "0.50222045", "0.50204057", "0.50138044", "0.5007284", "0.5003476", "0.49977747", "0.49864715", "0.49858448", "0.49783418", "0.49746814", "0.4967934", "0.4954096", "0.4952082", "0.49432465", "0.49358124", "0.4933329", "0.4923094", "0.49094203", "0.49064147", "0.49020803", "0.4892317", "0.48873475", "0.4885418", "0.48835167", "0.48814556", "0.48739424", "0.4873857", "0.4859018", "0.48560423", "0.48361862", "0.48269415", "0.48239136", "0.4820549", "0.48204625", "0.4818904", "0.48179057", "0.4817741", "0.4816764", "0.48050952", "0.47996426", "0.47988725", "0.47866988", "0.4785343", "0.47852793", "0.4781457", "0.47760493", "0.47760457" ]
0.76772785
0
This method returns a list of URL checks as JSON object.
@RequestMapping(value = "urlchecks", method = RequestMethod.GET) @ResponseBody @ResponseStatus(HttpStatus.OK) public List<UrlCheck> getUrlChecks() { System.out.println("urlchecks"); return urlChecker.getUrlChecks(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value = \"urls\", method = RequestMethod.GET)\n @ResponseBody\n @ResponseStatus(HttpStatus.OK)\n public List<MonitoredUrl> getUrls()\n {\n System.out.println(\"geturls\");\n return urlChecker.getMonitoredUrls();\n }", "public List<Map<String,Object>> getURLs() {\n return urls;\n }", "private ArrayList<ResultPair> InitializeManualUrls()\n {\n\t ArrayList<ResultPair> fileUrls = new ArrayList<ResultPair>();\n\t fileUrls.add(new ResultPair(\"https://www.google.com\", true));\n\t fileUrls.add(new ResultPair(\"https://///www.google.com\", false));\n\t fileUrls.add(new ResultPair(\"\", false));\n\t fileUrls.add(new ResultPair(\"http://74.125.224.72/\", true));\n\t fileUrls.add(new ResultPair(\"file:///C:/\", true));\n\t fileUrls.add(new ResultPair(\"http://WWW.GOOGLE.COM\", true));\n\t fileUrls.add(new ResultPair(\"http://www.google.com:80/test1\", true));\n\t fileUrls.add(new ResultPair(\"h3t://go.cc:65a/$23?action=edit&mode=up\", false));\n\t fileUrls.add(new ResultPair(\"12345\", false));\n\t fileUrls.add(new ResultPair(\"http://www.space in here.com\", false));\n\t fileUrls.add(new ResultPair(\"http://site.com/#citation\", true));\n\t fileUrls.add(new ResultPair(\"ftp://site.com\", true));\n\t fileUrls.add(new ResultPair(\"http://site.com/hyphen-here\", true));\n\t fileUrls.add(new ResultPair(\"http://www.example.com:8080\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com:80/over/there?name=ferret#nose\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com:80/over/there#nose\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com/there?name=ferret\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com:8042/over/there?name=ferret#nose\", true));\n\t fileUrls.add(new ResultPair(\"http://[email protected]\", true));\n\t fileUrls.add(new ResultPair(\"http://142.10.5.2:8080/\", true));\n\t return fileUrls;\n }", "public List<String> getLinks();", "public List<String> getUrlsToCheck(CachedUrl cu) {\n List<String> res = new ArrayList<String>(3);\n Properties props;\n switch (detectNoSubstanceRedirectUrl) {\n case First:\n return ListUtil.list(cu.getUrl());\n case Last:\n props = cu.getProperties();\n String url = props.getProperty(CachedUrl.PROPERTY_CONTENT_URL);\n if (url == null) {\n\turl = cu.getUrl();\n }\n return ListUtil.list(url);\n case All:\n return AuUtil.getRedirectChain(cu);\n }\n return res;\n }", "public String setUrl() throws JSONException {\n url = baseUrl + searchName;\n for(int i = 0; i < typesCheckList.size(); i++) {\n if(typesObj.has(typesCheckList.get(i))){\n url += typesObj.getString(typesCheckList.get(i));\n }\n }\n if(V)System.out.println(url);\n return url;\n }", "@Scheduled(fixedRate = checkRate - 1000) // Un minuto menos\n public void getUrls() {\n urlList = shortURLRepository.listAll();\n }", "@GET\n public Response getLinks() {\n List<Link> links = new ArrayList<>();\n links.add(Link.fromUri(CommonConstants.API_URI+\"users/login\").rel(\"login\").build());\n links.add(Link.fromUri(CommonConstants.API_URI+\"users/\").rel(\"users\").build());\n links.add(Link.fromUri(CommonConstants.API_URI+\"boardgames/\").rel(\"boardgames\").build());\n\n return Response.ok().links(links.toArray(new Link[links.size()])).build();\n }", "List<Link> getLinks();", "public Collection<Map<String, String>> getLinks();", "public ExternalUrl getExternalUrls() {\n return externalUrls;\n }", "public List<String> getUrls() {\n\t\treturn urls;\n\t}", "public String[] getUrls() {\n\t\tif (results == null)\n\t\t\treturn null;\n\t\tWebSearchResult[] resultsArray = results.listResults();\n\t\tString[] urls = new String[resultsArray.length];\n\t\tfor (int i = 0; i < urls.length; i++) {\n\t\t\turls[i] = resultsArray[i].getUrl();\n\t\t}\n\t\treturn urls;\n\t}", "public URL[] getUrls() {\n\t\treturn urls.toArray(new URL[urls.size()]);\n\t}", "java.util.List<org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto> \n getLinksList();", "@Override\n\tpublic Collection<URL> getUrlsToFilter() {\n\t\tSet<URL> filterSet = new HashSet<URL>();\n\t\tString url=\"http://www.infoq.com/news/2012/11/Panel-WinRT-Answers;jsessionid=91AB81A159E85692E6F1199644E2053C \";\n\t\tfilterSet.add(URL.valueOf(url));\n\t\treturn filterSet;\n\t}", "public void getLinks() {\n\n var client = HttpClient.newBuilder()\n .followRedirects(HttpClient.Redirect.ALWAYS)\n .build();\n\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(URL_PREFIX))\n .build();\n client.sendAsync(request, HttpResponse.BodyHandlers.ofLines())\n .thenApply(HttpResponse::body)\n .thenApply(this::processLines)\n .thenApply(versions -> tasks(versions))\n .join();\n }", "public static List<UrlInfo> searchAllUrl() {\n\n //getSynonyms(queryKeywords);\n\n ArrayList<Long> keywordIdList = new ArrayList<Long>();\n ArrayList<Long> finalIdList = new ArrayList<Long>();\n\n String email = Secured.getUser(ctx());\n List<UrlEntry> entryIdList = UrlEntry.find()\n .select(\"entryId\")\n .where()\n .eq(\"email\", email)\n .findList();\n for (UrlEntry entry : entryIdList) {\n finalIdList.add(entry.getEntryId());\n }\n System.out.println(\"finalIdList---\" + finalIdList);\n List<UrlInfo> urlList = UrlInfo.find().select(\"url\").where().in(\"urlEntryId\", finalIdList).findList();\n /*ArrayList<String> urls = new ArrayList<String>();\n for (UrlInfo urlInfo : urlList) {\n urls.add(urlInfo.getUrl());\n }\n System.out.println(\"urls in search----\" + urls);*/\n return urlList;\n }", "private static String getList(String responseString) throws JSONException {\n\t\tJSONObject array = new JSONObject(responseString);\n\t\treturn array.getString(\"url\");\n\t}", "java.util.List<java.lang.String>\n getPeerURLsList();", "public ArrayList<URI> getList() { return new ArrayList<URI>(); }", "protected List<List<URL>> getDefaultUrlList() throws MalformedURLException {\n URL[] urls1 = { \n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/ka.png\"),\n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/uci.png\"),\n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/gifs/dougs-small.jpg\")\n };\n URL[] urls2 = {\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/lil-doug.jpg\"),\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/wm.jpg\"),\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/ironbound.jpg\")\n };\n\n \tList<List<URL>> variableNumberOfInputURLs = \n new ArrayList<List<URL>>();\n variableNumberOfInputURLs.add(Arrays.asList(urls1));\n variableNumberOfInputURLs.add(Arrays.asList(urls2));\n \treturn variableNumberOfInputURLs;\n }", "public Stream<ParsedURL> urls() {\n return stream().map(req -> new ParsedURL(req.getUrl()));\n }", "public List<HealthCheck> getServiceChecks(String service);", "@Override\r\n public List<String> getMatchedURIs() {\n return null;\r\n }", "@Override\r\n\tprotected String doInBackground(String... params) {\r\n\t\t\r\n\t\tString uri = params[0];\r\n\t\tString jsonValidRules = getValidRules(uri);\r\n\t\t\r\n\t\treturn jsonValidRules;\r\n\t}", "@RequestMapping(\"/getResult\")\r\n @ResponseBody\r\n public String prob(@RequestParam String URL){\n \tHashSet<String> res= new CrawlerService().getPageLinks(URL); \t\r\n \tStringBuffer result =new StringBuffer(); \t\r\n \tfor (String item:res){\r\n \t\tresult.append(item+\"<br>\");\r\n \t} \t\r\n return result.toString();\r\n\r\n }", "protected static ArrayList<UrlResource> parseUrlArray(JSONArray jsonArray) throws JSONException, MalformedURLException {\n ArrayList<UrlResource> ret = new ArrayList<>();\n String url;\n String description;\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject obj = jsonArray.getJSONObject(i);\n url=obj.getString(\"url\");\n description = obj.getString(\"descricao\");\n if(!YoutubeUrlResource.isValidYoutubeLink(url)){\n ret.add(new UrlResource(new URL(url), description));\n }else{\n try {\n ret.add(new YoutubeUrlResource(new URL(url), description));\n } catch (Exception e) {\n e.printStackTrace();\n ret.add(new UrlResource(new URL(url), description));\n }\n }\n\n }\n return ret;\n }", "List<WebURL> Filter(List<WebURL> urls){\n return null;\n }", "public abstract List<Requirement> getFailedChecks();", "@Override\r\n public List<String> getMatchedURIs(boolean arg0) {\n return null;\r\n }", "public List<ResourceLink> links() {\n return links;\n }", "private List<Woacrawledurl> readCrawledUrls()\n\t{\n\t\tString hql = \"from Woacrawledurl where instanceId=\"\n\t\t\t\t+ this.param.instance.getTaskinstanceId() + \"order by id\";\n\t\tSessionFactory sessionFactory = TaskFactory.getSessionFactory(this.param.dbid);\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tTransaction t = session.beginTransaction();\n\t\tQuery q = session.createQuery(hql);\n\t\tList<Woacrawledurl> list = q.list();\n\t\tt.commit();\n\t\treturn list;\n\t}", "@Test\r\n public void testParseConnection() throws MalformedURLException {\r\n JsonArray array = null;\r\n JsonParser parser = new JsonParser();\r\n URL url = new URL(\"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&titles=\\\" + \\\"Ball State\\\" + \\\"&rvprop=timestamp|user&rvlimit=24&redirects\");\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 for (Map.Entry<String, JsonElement> entry : pages.entrySet()) {\r\n JsonObject entryObject = entry.getValue().getAsJsonObject();\r\n array = entryObject.getAsJsonArray(\"revisions\");\r\n }\r\n System.out.println(array);\r\n System.out.println(url);\r\n }", "public List<String> getUris()\r\n/* 125: */ {\r\n/* 126:129 */ return this.uris;\r\n/* 127: */ }", "private static ArrayList<String> fetchHistory() {\n\t\tScanner s;\n\t\tint count = 0;\n\t\tArrayList<String> historyList = new ArrayList<String>();\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"History.txt\"));\n\t\t\twhile (s.hasNext()) {\n\t\t\t\thistoryList.add(s.next());\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tSystem.out.println(\"Number of converted urls fetched: \" + count);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn historyList;\n\t}", "public ArrayList<String> getWebLink(){\r\n\t\treturn webLinks;\t\t\r\n\t}", "com.google.protobuf.ProtocolStringList\n getHotelImageURLsList();", "@SuppressWarnings(\"unchecked\")\n\tpublic List<SetupUrls> findAll() {\n\n\t\tSession session = getSession();\n\n\t\tCriteria crit = session.createCriteria(SetupUrls.class)\n\t\t\t\t.addOrder(Order.asc(ORDER));\n\n\t\treturn (List<SetupUrls>) crit.list();\n\t}", "public Map<String, URLValue> loadAllURLs()\n\t{\n\t\tEntityCursor<URLEntity> results = this.env.getEntityStore().getPrimaryIndex(String.class, URLEntity.class).entities();\n\t\tMap<String, URLValue> urls = new HashMap<String, URLValue>();\n\t\tURLValue url;\n\t\tfor (URLEntity entity : results)\n\t\t{\n\t\t\turl = new URLValue(entity.getKey(), entity.getURL(), entity.getUpdatingPeriod());\n\t\t\turls.put(url.getKey(), url);\n\t\t}\n\t\tresults.close();\n\t\treturn urls;\n\t}", "private String getValidRules(String uri) {\r\n\t\t\r\n\t\tHttpClient httpClient = new DefaultHttpClient();\r\n\t\tHttpGet getRequest = new HttpGet(uri);\r\n\t\tgetRequest.addHeader(\"Content-Type\", \"application/json\");\r\n\t\t\r\n\t\tString jsonValidRules = \"\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tHttpResponse httpResponse = httpClient.execute(getRequest);\r\n\t\t\tHttpEntity httpResponseEntity = httpResponse.getEntity();\r\n\t\t\tjsonValidRules = CommunicationUtils.getEntityAsString(httpResponseEntity);\r\n\t\t\t\r\n\t\t} catch (ClientProtocolException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn jsonValidRules;\r\n\t}", "@RequestMapping(path = \"/theYadaList\", method = RequestMethod.GET)\n public ResponseEntity<ArrayList<Link>> getYadaList() {\n\n ArrayList<Link> linkList = (ArrayList<Link>) links.findAll();\n generateLinkScore(linkList);\n\n return new ResponseEntity<>(links.findAllByOrderByLinkScoreDesc(), HttpStatus.OK);\n }", "private RedirectUrls getRedirectURLs() {\n RedirectUrls redirectUrls = new RedirectUrls();\n redirectUrls.setReturnUrl(URL_RETURN);\n redirectUrls.setCancelUrl(URL_CANCEL);\n\n return redirectUrls;\n }", "static List<String> read() {\n String fileName = getFilePath();\n List<String> urls = new ArrayList<>();\n \n if (Files.notExists(Paths.get(fileName))) {\n return urls;\n }\n \n try (Stream<String> stream = Files.lines(Paths.get(fileName))) {\n urls = stream\n // Excludes lines that start with # as that is used for comments\n // and must start with http:// as that is required by crawler4j.\n .filter(line -> !line.startsWith(\"#\") &&\n line.startsWith(\"http://\") || line.startsWith(\"https://\"))\n .map(String::trim)\n .map(String::toLowerCase)\n .collect(Collectors.toList());\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n return urls;\n }", "private ArrayList<String> permaLinkParser(String response, ArrayList<String> permaLinkUrls){\n\t\tJsonElement element = new JsonParser().parse(response);\n\t\tJsonArray array = element.getAsJsonArray();\n\t\t\n\t\tfor(int i = 0; i < array.size(); i++){\n\t\t\tJsonObject currentObject = array.get(i).getAsJsonObject().getAsJsonObject();\n\t\t\t\n\t\t\tString key = currentObject.get(\"permalink_url\").toString().replaceAll(\"\\\"\", \"\");\n\t\t\tpermaLinkUrls.add(key);\n\t\t}\n\t\t\n\t\treturn permaLinkUrls;\n\t\t\n\t}", "public SortedMap<String, File> download() {\n Set<String> versionsToCheck = getAvailableVersions();\n\n SortedMap<String, File> versionMap = new TreeMap<>(new VersionStringComparator());\n\n System.out.print(ansi().saveCursorPosition());\n\n int i = 1;\n for (String ver : versionsToCheck) {\n String filename = \"checkstyle-\" + ver + \".jar\";\n File f = new File(csBinaries, filename);\n if (!f.exists()) {\n if (print)\n System.out.print(ansi()\n .eraseLine()\n .restoreCursorPosition()\n .a(MessageFormat.format(res.getString(\"downloadprogmsg\"),\n i++, versionsToCheck.size(), ver)));\n try {\n FileUtils.copyURLToFile(new URL(res.getString(\"mavenCheckstyleURL\") + ver + \"/\" + filename), f);\n versionMap.put(ver, f);\n } catch (IOException e) {\n System.err.print(\"Failed: \");\n System.err.println(e.getMessage());\n System.err.println(\"Skipping...\");\n }\n } else {\n versionMap.put(ver, f);\n }\n }\n\n if (print)\n System.out.println();\n\n return versionMap;\n }", "public List<URL> newURLs() {\r\n // TODO: Implement this!\r\n return new LinkedList<URL>();\r\n }", "@GetMapping(\"/linkage/list\")\n public R getLinkageList() {\n List<LinkageRule> list = linkageCache.cacheLinkageListGet();\n return R.ok().data(\"list\", list);\n }", "public static List<String> getURLs(List<WebElement> links) {\n\t\t List<String> ListHref = new ArrayList<String>();\n\t\t \n\t\t //loops through all links\n\t\t for(WebElement Webhref:links) {\n\t\t\t \n\t\t\t //if element isn't null\n\t\t\t if (Webhref.getAttribute(\"href\") != null) {\n\t\t\t\t String StringHref = (Webhref.getAttribute(\"href\")).toString();\n\n\t\t\t\t //if page isn't part of domain, ignore\n\t\t\t\t if (StringHref.startsWith(variables.domain)) {\n\t\t\t\t\t //System.out.println(StringHref);\n\t\t\t\t\t \n\t\t\t\t\t //if page doesn't have an octothorpe\n\t\t\t\t\t if (!StringHref.contains(\"#\")) {\n\t\t\t\t\t\t \n\t\t\t\t\t\t//if page doesn't ends with one of the file extensions to not use\n\t\t\t\t\t\t String extension = getExtension(StringHref);//gets TLD from URL\n\t\t\t\t\t\t if(!variables.list.stream().anyMatch(extension::contains)) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t//if value isn't already part of this array or the already crawled array\n\t\t\t\t\t\t\t if(!ListHref.contains(StringHref) && !variables.crawled.contains(StringHref)) {\n\t\t\t\t\t\t\t\t ListHref.add(StringHref);\n\t\t\t\t\t\t\t\t //System.out.println(StringHref);\n\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 }\n\t\t\t }\n\t\t }\n\n\t\treturn ListHref;\n\t}", "private static List<InOut> getJsonTestCases() {\n final List<InOut> testCases = new ArrayList<>();\n // allowed\n addTestCase(testCases, \"{\\\"bool\\\":true}\");\n // will be corrected\n addTestCase(testCases, \"{\\\"bool\\\":true\", \"{\\\"bool\\\":true}\");\n // will be stripped down\n addTestCase(testCases, \"\\\"bool\\\":true}\", \"\\\"bool\\\"\");\n // will be stripped down\n addTestCase(testCases, \"\\\"bool\\\":true\", \"\\\"bool\\\"\");\n // check sanitized HTML\n final InOut combinedJsonTestCase = getCombinedJsonTestCase();\n addTestCase(testCases, combinedJsonTestCase);\n return testCases;\n }", "public List<String> validate()\n {\n List<String> errs = new ArrayList<String>();\n\n if (StringUtils.isEmpty(startingUrl))\n errs.add(\"Missing starting URL.\");\n else\n {\n String[] schemes = {\"http\", \"https\"};\n UrlValidator urlValidator = new UrlValidator(schemes);\n if (!urlValidator.isValid(startingUrl))\n errs.add(\"Invalid starting URL.\");\n }\n\n if (StringUtils.isEmpty(outputPath))\n errs.add(\"Missing output path.\");\n else\n {\n try\n {\n Path path = Paths.get(outputPath);\n File dir = path.toFile();\n if (!dir.exists())\n dir.mkdirs();\n else if (!dir.isDirectory())\n errs.add(\"Output path exists but is not a directory.\");\n }\n catch (Exception ex)\n {\n errs.add(\"Invalid output path or unable to create the directory.\");\n }\n }\n\n if (StringUtils.isEmpty(resultFile))\n errs.add(\"Missing result file.\");\n else if (errs.isEmpty())\n {\n // Only do this check if the output path is valid.\n try\n {\n Paths.get(outputPath, resultFile);\n }\n catch (Exception ex)\n {\n errs.add(\"Invalid result file.\");\n }\n }\n\n if (numThreads < CrawlerImpl.MIN_THREADS)\n numThreads = CrawlerImpl.MIN_THREADS;\n\n if (crawlTimeoutSeconds < MIN_CRAWL_TIMEOUT_SECONDS)\n crawlTimeoutSeconds = MIN_CRAWL_TIMEOUT_SECONDS;\n\n return errs;\n }", "public ArrayList<String> getWebserverUrl() {\n\n if (webListener.isServiceFound()) {\n return webListener.getServiceURLs();\n }\n return new ArrayList<>();\n }", "public String getFinalUrls() {\r\n return finalUrls;\r\n }", "List<Status> getAllChecklistStatus() throws ServiceException;", "@GET\t\n\t@Produces(\"application/json\")\n\t@Path(\"/\")\n\tpublic List<Site> findAllSites(){\n\t\treturn siteDaoObj.findAllSites();\n\t\t\n\t}", "java.util.List<java.lang.String>\n getResourcePatternsList();", "public List<Link> getLinks()\n {\n return links;\n }", "private List<URL> getJsonUrls(\n TreeLogger treeLogger,\n URL[] urls\n ) throws UnableToCompleteException {\n List<URL> jsonUrls = new ArrayList<>();\n for (URL url : urls) {\n\n jsonUrls.add(url);\n\n /**\n * check if filename is in format that could indicate that we have\n * url series <resourceName>_0.json\n */\n final RegExp compile = RegExp.compile(\"(.+)_(\\\\d+)\\\\.(\\\\w+)\");\n final MatchResult exec = compile.exec(url.getPath().substring(url.getPath().lastIndexOf(\"/\") + 1));\n if (exec != null) {\n final String filePrefix = exec.getGroup(1);\n int fileSequenceIndex = Integer.valueOf(exec.getGroup(2));\n final String fileExtension = exec.getGroup(3);\n URL siblingUrl = null;\n\n try {\n while (true) {\n String siblingUri = filePrefix + \"_\" + (++fileSequenceIndex) + \".\" + fileExtension;\n siblingUrl = new URL(url, siblingUri);\n siblingUrl.openStream();\n if (!jsonUrls.contains(siblingUrl)) {\n jsonUrls.add(siblingUrl);\n }\n }\n } catch (MalformedURLException e) {\n treeLogger.log(TreeLogger.ERROR, \"Reading of sibling texture atlas failed \", e);\n throw new UnableToCompleteException();\n } catch (IOException e) {\n if (Objects.equals(siblingUrl, url)) {\n treeLogger.log(TreeLogger.ERROR, \"Reading of sibling texture atlas failed \", e);\n throw new UnableToCompleteException();\n } else {\n // all siblings found process is finished\n }\n }\n }\n }\n return jsonUrls;\n }", "ArrayList<Episode> getEpisodes(){\n\n\n Uri builtUri = Uri.parse(episodesURL)\n .buildUpon()\n .build();\n String url = builtUri.toString();\n\n return doCallEpisode(url);\n\n }", "public Urls getUrlsCreatedAndApprovedToday() {\n\t\treturn (Urls) selectByMethod(\"isCreatedAndApprovedToday\", null);\n\t}", "@Test\r\n\tpublic void testGetDNSList(){\r\n\t\tList<String> lst = new ArrayList<String>();\r\n\t\tlst = dnsService.getAllDNS();\r\n\t\tSystem.out.println(\"==>dns list:\");\r\n\t\tSystem.out.println(JSON.toJSONString(lst));\r\n\t}", "@GET(\"pushrules/\")\n Call<PushRulesResponse> getAllRules();", "public static URL[] getClassLoaderURLs(ClassLoader cl)\n {\n URL[] urls = {};\n try\n {\n Class returnType = urls.getClass();\n Class[] parameterTypes = {};\n Method getURLs = cl.getClass().getMethod(\"getURLs\", parameterTypes);\n if( returnType.isAssignableFrom(getURLs.getReturnType()) )\n {\n Object[] args = {};\n urls = (URL[]) getURLs.invoke(cl, args);\n }\n }\n catch(Exception ignore)\n {\n }\n return urls;\n }", "public static JwComparator<AcWebServiceRequestData> getUrlComparator()\n {\n return AcWebServiceRequestDataTools.instance.getUrlComparator();\n }", "List<String> apiVersions();", "List<? extends Link> getLinks();", "private URLs() {\n }", "public List<HealthCheck> getNodeChecks(String node);", "private ResultFormat[] loadFormats() {\n\n final String strURL = buildServletURL(url) + \"/supportedFormats\";\n\n final GetMethod get = new GetMethod(strURL);\n final StringBuilder query = new StringBuilder();\n if (StringUtils.isNotEmpty(username)) {\n query.append(\"username=\").append(username).append(\"&password=\").append(password);\n }\n get.setQueryString(query.toString());\n\n try {\n final HttpClient client = new HttpClient();\n final int result = client.executeMethod(get);\n if (result == HttpServletResponse.SC_OK) {\n final String response = get.getResponseBodyAsString();\n if (StringUtils.isNotBlank(response)) {\n final List<ResultFormat> formats = extractSupportedFormats(response);\n return formats.toArray(new ResultFormat[formats.size()]);\n }\n }\n } catch (RuntimeException | IOException e) {\n // ignore\n } finally {\n get.releaseConnection();\n }\n return DEFAULT_FORMATS.toArray(new ResultFormat[DEFAULT_FORMATS.size()]);\n }", "Collection<? extends Object> getHadithUrl();", "java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> \n getImagesByHandlerList();", "List<Resource> resources();", "List<RuleInfo> listRulesInfo() throws IOException;", "public int getListCount() { return this.urlSeries.size(); }", "public interface URLs\r\n{\r\n String BASIC_URL = \"http://api.timetable.asia/\";\r\n\r\n String KEY = \"221b368d7f5f597867f525971f28ff75\";\r\n\r\n String COMPANY_URL = \"operator.json\";\r\n String LANGUAGE_URL = \"lang.json\";\r\n String VEHICLE_URL = \"fleet.json\";\r\n String ROUTE_URL = \"route.json\";\r\n String TRIP_URL = \"trip.json\";\r\n String COMMIT_URL = \"commit.json\";\r\n String CURRENT_STATIONS_URL = \"station.json\";\r\n public static final String LANGPACK_URL = \"langpack.json\";\r\n}", "@Override\n public ResponseEntity<List<Rule>> getRules() {\n\n String apiKeyId = (String) servletRequest.getAttribute(\"Application\");\n Optional<List<RuleEntity>> ruleEntities = ruleRepository.findByApiKeyEntityValue(apiKeyId);\n List<Rule> rules = new ArrayList<>();\n\n if (ruleEntities.isPresent()) {\n for (RuleEntity ruleEntity : ruleEntities.get()) {\n rules.add(toRule(ruleEntity));\n }\n }\n\n return ResponseEntity.ok(rules);\n }", "@GET(\"v2/top-headlines?country=us&apiKey=\"+ Common.API_KEY)\n Call<Website>getSources();", "public List<TparselinksEntity> getAllLinks();", "public List<URL> getURLList(final String key) {\n return getURLList(key, new ArrayList<>());\n }", "public String getRouters(){\n wifi.startScan();\n results = wifi.getScanResults();\n size = results.size();\n String jsonRouter = new Gson().toJson(results);\n return jsonRouter;\n }", "@GET\n @Path(\"/\")\n public List<HashMap<String, String>> getAllLists() {\n return mailChimpService.getAllLists();\n }", "java.util.List<online_info>\n getInfoList();", "public Set<String> getURLs() {\n return pageURLs;\n }", "public List<HealthCheck> getChecksByState(String state);", "public static List getAllUrl() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT url FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String naziv = result.getString(\"url\");\n polovniautomobili.add(naziv);\n\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "public static String[] getHttpExportURLs() {\n\t\tif (xml == null) return new String[0];\n\t\treturn httpExportURLs;\n\t}", "public static JSONArray getValidationRuleList(JSONObject loginObject, String startdate, String enddate) {\n\t\tJSONArray jsonArray = null;\n\t\tString ObjectRestURL = ToolingQueryList.getValidationRuleID(startdate, enddate);\n\t\tHttpClient httpClient = HttpClientBuilder.create().build();\n\n\t\tString instanceURL = loginObject.getString(\"instance_url\");\n\t\tString AccessToken = loginObject.getString(\"access_token\");\n\n\t\tHeader oauthHeader = new BasicHeader(\"Authorization\", \"OAuth \" + AccessToken);\n\t\tString uri = instanceURL + RestResourceURL.getToolingQueryURL(ObjectRestURL);\n\n\t\tHttpResponse response = null;\n\t\tHttpGet httpget = new HttpGet(uri);\n\t\thttpget.addHeader(oauthHeader);\n\t\ttry {\n\t\t\tresponse = httpClient.execute(httpget);\n\t\t\tif (response.getStatusLine().getStatusCode() == 200) {\n\t\t\t\tString Result = EntityUtils.toString(response.getEntity());\n\t\t\t\tJSONObject jsonObject = new JSONObject(Result);\n\t\t\t\tjsonArray = jsonObject.getJSONArray(\"records\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"getValidationRuleList error \" +response.getStatusLine());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in getValidationRuleList : \" + e);\n\t\t}\n\t\treturn jsonArray;\n\t}", "public List<String> getUrlsANP() {\n\t\treturn urlsANP;\n\t}", "public Urls getNotApprovedUrls() {\n\t\tPropertySelector propertySelector = new PropertySelector(\"approved\");\n\t\tpropertySelector.defineEqual(Boolean.FALSE);\n\t\treturn getUrls(propertySelector);\n\t}", "public interface RequestURLs {\n String DEFAULT_URL = \"http://aperturedev.co.kr:21002/petcommunity/\";\n\n /*\n 매칭 서비스 관련\n */\n String GET_PET_TYPES = DEFAULT_URL + \"services/get-pettypes.php\"; // 강아지 종을 가져온다.\n String REGIST_MATCH_PET = DEFAULT_URL + \"matching/regist-new-pet.php\"; // 팻 등록 실시\n String MATCHING_OTHER_PET = DEFAULT_URL + \"matching/matching.php\"; // 매칭할 팻을 하나 가져옵니다.\n\n /*\n 사용자 정보 관련\n */\n String GET_USER_INFO = DEFAULT_URL + \"users/get-info.php\"; // UUID -> 사용자 정보\n String REGIST_SERVICE = DEFAULT_URL + \"users/signup.php\"; // 회원가입을 실시한다.\n String IS_REGIST_SERVICE = DEFAULT_URL + \"/users/is-registed.php\"; // 회원가입 되어 있는지 확인한다.\n String LOGIN_SERVICE = DEFAULT_URL + \"users/signin.php\"; // 로그인 처리한다.\n\n\n\n\n}", "public Set<String> getLinks() throws SearchResultException;", "public List getLinks() {\r\n List links = getElements(\"a\");\r\n ArrayList result = new ArrayList();\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"href\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n links = getElements(\"FRAME\");\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"src\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n return result;\r\n }", "List<SdkHttpRequest> getRequests();", "@Scheduled(fixedRate = checkRate)\n public void CheckValidated() {\n log.info(\"Checking if links still valid and alive\");\n try{\n for(ShortURL s : urlList) {\n UrlValidatorAndCheckerImpl urlValidatorAndChecker = new UrlValidatorAndCheckerImpl(s.getTarget());\n if(!urlValidatorAndChecker.execute()){\n log.info(\"URL {} dead or not valid anymore.\", s.getTarget());\n s.setMode(HttpStatus.GONE.value());\n } else{\n s.setMode(HttpStatus.TEMPORARY_REDIRECT.value());\n }\n }\n } catch( NullPointerException e) {\n //No se ha inicializado aun\n }\n }", "@java.lang.Override\n public java.util.List<org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto> getLinksList() {\n return links_;\n }", "private static ArrayList<String> fetchSaved() {\n\t\tScanner s;\n\t\tint count = 0;\n\t\tArrayList<String> savedList = new ArrayList<String>();\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"saved.txt\"));\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tsavedList.add(s.next());\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tSystem.out.println(\"Number of converted urls fetched: \" + count);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn savedList;\n\t}", "List<String> getHosts();", "java.util.List<com.google.privacy.dlp.v2.CustomInfoType.DetectionRule> getDetectionRulesList();", "public List<URI> getLinks() {\n return links; // this is already unmodifiable\n }", "@Test \n\tpublic void testJsonPathWithLists() {\n\t\n\t\tMap<String,Integer> requestParamMaps=new HashMap<>();\n\t\t requestParamMaps.put(\"limit\", 100);\n\t\t\n\t\t\tResponse response = given().accept(ContentType.JSON).and().params(requestParamMaps)\n\t\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/\");\n\t\t\t\n\t\t\tassertEquals(response.statusCode(), 200);\n\t\t\t\n\t\t\tJsonPath json = response.jsonPath();\n\t\t\t//get all employee ids into arratlist\n\t\t\tList<Integer> empIDs = json.getList(\"items.employee_id\");\n\t\t\tSystem.out.println(empIDs);\n\t\t\t//assert that there are 100 emp ids\n\t\t\tassertEquals(empIDs.size(), 100);\n\t\t\t\n\t\t\t//get all emails and assign in list \n\t\t\tList<String> emails = json.getList(\"items.email\");\n\t\t\t\n\t\t\tassertEquals(emails.size(), 100);\n\t\t\t\n\t\t\t//get all employee ids that are greater than 150\n\t\t\tList<Integer> empIdList = json.getList(\"items.findAll{it.employee_id > 150}.employee_id\");\n\t\t\tSystem.out.println(empIdList);\n\t\t\t\n\t\t\t//get all employee lastnames, whose salary is more than 7000\n\t\t\t\n\t\t\tList<String> lastNames = json.getList(\"items.findAll{it.salary > 7000}.last_name\");\n\t\t\tSystem.out.println(lastNames);\n\t}" ]
[ "0.6631274", "0.5808778", "0.5529768", "0.55266017", "0.5513494", "0.55114186", "0.5500397", "0.54756397", "0.54225594", "0.5393431", "0.5363545", "0.53373", "0.5324953", "0.5258156", "0.5249033", "0.52462834", "0.522216", "0.52179384", "0.5192472", "0.5183683", "0.5166389", "0.51319027", "0.5128578", "0.5094037", "0.5078605", "0.50772667", "0.5060914", "0.50524974", "0.5039164", "0.50358695", "0.4961285", "0.49430647", "0.49272656", "0.4920732", "0.49184984", "0.49137905", "0.49108046", "0.48957726", "0.48956203", "0.4895549", "0.48909488", "0.48870426", "0.48733014", "0.48673075", "0.48627952", "0.4862779", "0.4851974", "0.48518094", "0.48480496", "0.4843673", "0.48434946", "0.4837917", "0.4829417", "0.48275244", "0.48259467", "0.48096913", "0.4809008", "0.47929418", "0.47877622", "0.47811902", "0.47772408", "0.4775547", "0.47747153", "0.47736612", "0.47663185", "0.4761203", "0.47404364", "0.47388774", "0.47301814", "0.47211733", "0.47193688", "0.47088227", "0.47042102", "0.47016788", "0.4698256", "0.46968302", "0.4696637", "0.46953407", "0.46757308", "0.46694222", "0.46632093", "0.46570528", "0.4649505", "0.4645086", "0.4642835", "0.4640031", "0.46341863", "0.4623259", "0.4622849", "0.4622583", "0.4614151", "0.46132675", "0.46129292", "0.4611656", "0.46113962", "0.46051142", "0.4604977", "0.4603752", "0.4600563", "0.45977026" ]
0.75002104
0
TODO Autogenerated method stub
@Override public List<Person> parse(InputStream xml) throws Exception { final List<Person> list = new ArrayList<Person>(); SAXParserFactory factory = SAXParserFactory.newInstance(); javax.xml.parsers.SAXParser parser = factory.newSAXParser(); parser.parse(xml, new DefaultHandler() { StringBuilder builder; Person t; @Override public void characters(char[] ch, int start, int length) throws SAXException { // TODO Auto-generated method stub super.characters(ch, start, length); builder.append(ch, start, length); Log.d(TAG, "ch=" + builder.toString()); } @Override public void endDocument() throws SAXException { // TODO Auto-generated method stub super.endDocument(); } @Override public void endElement(String uri, String localName, String qName) throws SAXException { // TODO Auto-generated method stub super.endElement(uri, localName, qName); if (localName.equals("id")) { t.setId(Integer.parseInt(builder.toString())); } else if (localName.equals("name")) { t.setName(builder.toString()); } else if (localName.equals("age")) { t.setAge(Integer.parseInt(builder.toString())); } else if (localName.equals("person")) { list.add(t); } } @Override public void startDocument() throws SAXException { // TODO Auto-generated method stub super.startDocument(); builder = new StringBuilder(); } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // TODO Auto-generated method stub super.startElement(uri, localName, qName, attributes); if (localName.equals("person")) { t = new Person(); } builder.setLength(0); } }); return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void characters(char[] ch, int start, int length) throws SAXException { super.characters(ch, start, length); builder.append(ch, start, length); Log.d(TAG, "ch=" + builder.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void endDocument() throws SAXException { super.endDocument(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); if (localName.equals("id")) { t.setId(Integer.parseInt(builder.toString())); } else if (localName.equals("name")) { t.setName(builder.toString()); } else if (localName.equals("age")) { t.setAge(Integer.parseInt(builder.toString())); } else if (localName.equals("person")) { list.add(t); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void startDocument() throws SAXException { super.startDocument(); builder = new StringBuilder(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { super.startElement(uri, localName, qName, attributes); if (localName.equals("person")) { t = new Person(); } builder.setLength(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public String serialize(List<Person> list) throws Exception { SAXTransformerFactory factory = (SAXTransformerFactory) TransformerFactory .newInstance(); TransformerHandler handler = factory.newTransformerHandler(); Transformer transformer = handler.getTransformer(); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer .setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); StringWriter writer = new StringWriter(); Result result = new StreamResult(writer); handler.setResult(result); String uri = ""; String localName = ""; handler.startDocument(); handler.startElement(uri, localName, "persons", null); AttributesImpl attrs = new AttributesImpl(); char[] ch = null; for (Person p : list) { attrs.clear(); attrs.addAttribute(uri, localName, "id", "string", String.valueOf(p.getId())); handler.startElement(uri, localName, "person", attrs); handler.startElement(uri, localName, "name", null); ch = p.getName().toCharArray(); handler.characters(ch, 0, ch.length); handler.endElement(uri, localName, "name"); handler.startElement(uri, localName, "age", null); ch = String.valueOf(p.getAge()).toCharArray(); handler.characters(ch, 0, ch.length); handler.endElement(uri, localName, "age"); handler.endElement(uri, localName, "person"); } handler.endElement(uri, localName, "persons"); handler.endDocument(); return writer.toString(); }
{ "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<Person> parse(InputStream xml) throws Exception { List<Person> list = new ArrayList<Person>(); DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(xml); Element rootElement = doc.getDocumentElement(); NodeList nodes = rootElement.getElementsByTagName("person"); for (int i = 0; i < nodes.getLength(); i++) { Person p = new Person(); Node node = nodes.item(i); NodeList properties = node.getChildNodes(); for (int j = 0; j < properties.getLength(); j++) { Node property = properties.item(j); String nodeName = property.getNodeName(); if (nodeName.equals("id")) { int id = Integer.parseInt(property.getFirstChild() .getNodeValue()); p.setId(id); } else if (nodeName.equals("name")) { String name = property.getFirstChild().getNodeValue(); p.setName(name); } else if (nodeName.equals("age")) { int age = Integer.parseInt(property.getFirstChild() .getNodeValue()); p.setAge(age); } } list.add(p); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public String serialize(List<Person> list) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.newDocument(); Element rootElement = doc.createElement("persons"); for (Person p : list) { Element personElement = doc.createElement("person"); personElement.setAttribute("id", String.valueOf(p.getId())); Element nameElement = doc.createElement("name"); nameElement.setTextContent(p.getName()); personElement.appendChild(nameElement); Element ageElement = doc.createElement("age"); ageElement.setTextContent(String.valueOf(p.getAge())); personElement.appendChild(ageElement); rootElement.appendChild(personElement); } doc.appendChild(rootElement); TransformerFactory transFactory = TransformerFactory.newInstance(); Transformer transformer = transFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer .setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); StringWriter writer = new StringWriter(); Source source = new DOMSource(doc); Result result = new StreamResult(writer); transformer.transform(source, result); return writer.toString(); }
{ "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<Person> parse(InputStream xml) throws Exception { List<Person> list = null; Person p = null; XmlPullParser xpp = Xml.newPullParser(); xpp.setInput(xml, "UTF-8"); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { switch (eventType) { case XmlPullParser.START_DOCUMENT: list = new ArrayList<Person>(); break; case XmlPullParser.START_TAG: String name = xpp.getName(); if (name.equals("person")) { p = new Person(); } else if (name.equals("id")) { String id = xpp.nextText(); p.setId(Integer.parseInt(id)); } else if (name.equals("name")) { String pName = xpp.nextText(); p.setName(pName); } else if (name.equals("age")) { String age = xpp.nextText(); p.setAge(Integer.parseInt(age)); } break; case XmlPullParser.END_TAG: String tagName = xpp.getName(); if (tagName.equals("person")) { list.add(p); p = null; } break; } eventType = xpp.next(); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public String serialize(List<Person> list) throws Exception { XmlSerializer serializer = Xml.newSerializer(); StringWriter writer = new StringWriter(); serializer.setOutput(writer); serializer.startDocument("UTF-8", true); serializer.startTag("", "persons"); for (Person p : list) { serializer.startTag("", "person"); serializer.attribute("", "id", String.valueOf(p.getId())); serializer.startTag("", "name"); serializer.text(p.getName()); serializer.endTag("", "name"); serializer.startTag("", "age"); serializer.text(String.valueOf(p.getAge())); serializer.endTag("", "age"); serializer.endTag("", "person"); } serializer.endTag("", "persons"); serializer.endDocument(); return writer.toString(); }
{ "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
Default event. Just show the page populated with any proj parameters that were passed along.
public String handleDefault() throws HttpPresentationException { return showPage(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "public String fillEditPage() {\n\t\t\n\t\ttry{\n\t\t\t// Putting attribute of playlist inside the page to view it \n\t\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"playlist\", service.viewPlaylist());\n\t\t\t\n\t\t\t// Send user to EditPlaylistPage\n\t\t\treturn \"EditPlaylistPage\";\n\t\t}\n\t\t// Catch exceptions and send to ErrorPage\n\t\tcatch(Exception e) {\n\t\t\treturn \"ErrorPage.xhtml\";\n\t\t}\n\t}", "@SuppressWarnings(\"serial\")\n\tpublic ProjectPage() {\n\t\tagregarForm();\n\t}", "public StartPage() {\n initComponents();\n \n }", "@Given(\"I am on the Project Contact Details Page\")\n public void i_am_on_the_project_contact_details_page(){\n i_logged_into_Tenant_Manager_Project_list_page();\n i_click_on_create_a_new_project();\n\n }", "@Override\n\tprotected void enter(ViewChangeEvent event, List<URIParameter> parameters) {\n\t\tthis.presenter.fillViewWithData();\n\t}", "public ProjectsPage() {\n\t\tthis.driver = DriverManager.getDriver();\n\t\tElementFactory.initElements(driver, this);\n\t\t// sets the name of the project to add, with a random integer ending for slight\n\t\t// ease on multiple test runs\n\t\tnameOfProject = \"testz2018\" + (int) Math.random() * 500;\n\t}", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\n\t\t\t}", "@Override\n\t\tpublic void onPageSelected(int arg0)\n\t\t{\n\t\t\t\n\t\t}", "@Override\r\n public void onSubmit() {\r\n ProjectOverviewerApplication app = (ProjectOverviewerApplication)getApplication();\r\n \r\n // check if any field is missing\r\n boolean hasAllFields = true;\r\n if (this.projectName == null) {\r\n hasAllFields = false;\r\n error(\"Project name is required.\");\r\n }\r\n if (this.ownerName == null) {\r\n hasAllFields = false;\r\n error(\"Owner name is required.\");\r\n }\r\n if (this.password == null) {\r\n hasAllFields = false;\r\n error(\"Password is required.\");\r\n }\r\n if (this.svnUrl == null) {\r\n hasAllFields = false;\r\n error(\"The repository URL is required.\");\r\n }\r\n \r\n if (hasAllFields) {\r\n try {\r\n // check if the owner is a valid hackystat user\r\n String host = app.getSensorBaseHost();\r\n SensorBaseClient client = new SensorBaseClient(host, this.ownerName, this.password);\r\n client.authenticate();\r\n }\r\n catch (SensorBaseClientException e) {\r\n error(\"Owner is not valid Hackystat user or password does not match.\");\r\n }\r\n \r\n try {\r\n // check if the svn url is a valid google host url\r\n WebConversation wc = new WebConversation();\r\n WebResponse response = wc.getResponse(this.svnUrl);\r\n if (!response.getTitle().contains(\"Revision\")) {\r\n error(\"The repository URL is not a valid Google host repository URL.\");\r\n }\r\n }\r\n catch (Exception e) {\r\n error(\"Cannot connect to the repository URL.\");\r\n }\r\n \r\n // if there is no error, create the project and go back to the home page\r\n if (!hasError() && createProject()) {\r\n // redirect to the projects page\r\n setResponsePage(ProjectsPage.class);\r\n }\r\n else {\r\n error(\"The project cannot be created. \" +\r\n \"A project with the same name already exists, or some information are invalid.\");\r\n }\r\n }\r\n \r\n }", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\t\n\t\t\t}", "public static void main(String[] args) {\r\n\t\tProgProjGUI display = new ProgProjGUI();\r\n\t\tdisplay.setVisible(true);\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew ProjectView().init();\r\n\t\t\t}", "void updatePage(String name, String park);", "public static void index()\n {\n String adminId = session.get(\"logged_in_adminid\"); // to display page to logged-in administrator only\n if (adminId == null)\n {\n Logger.info(\"Donor Location: Administrator not logged-in\");\n Welcome.index();\n }\n else\n {\n Logger.info(\"Displaying geolocations of all donors\");\n render();\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlReportGeneration.setVisible(true);\n\t\t\t\tloadProjects();\n\t\t\t}", "@Override\r\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t}", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "@Override\n\tpublic void onPageSelected(int arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onPageSelected(int arg0) {\n\t\t\n\t}", "@Override protected void startup() {\n show(new MIDLetParamsView(this));\n }", "@Override\n\tpublic void onPageSelected(int arg0) {\n\n\t}", "@Override\n\tpublic void onPageSelected(int arg0) {\n\n\t}", "public String handleDefault()\n throws HttpPresentationException\n {\n\t return showPage(null);\n }", "@Override\n public void onPageSelected(int arg0) {\n }", "public static void main(String[] args) {\n TestTerrainPage app = new TestTerrainPage();\n app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG);\n app.start();\n }", "protected void onBeforeDisplayEvent( UserRequest request,\n int pageNumber,\n String buttonPressed )\n {\n // default noop\n }", "void showNoneParametersView();", "public LandRYSettingPage() {\n initComponents();\n }", "public String handleDefault() \n throws HttpPresentationException \n {\n\t return showEditPage(null);\n }", "@Override\r\n\tpublic void mypage() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onPageSelected(int arg0) {\n\r\n\t}", "private void loadDefaultPage() {\n loadPage(DEFAULT_PAGE.toExternalForm());\n }", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tToast.makeText(getBaseContext(), arg0 + \"\", Toast.LENGTH_SHORT).show();\n\t\t\t}", "public String showEditPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n String contactname = this.getComms().request.getParameter(CONTACTNAME);\n String contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n String billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n String billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n String billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n String city = this.getComms().request.getParameter(CITY);\n String state = this.getComms().request.getParameter(STATE);\n String zip = this.getComms().request.getParameter(ZIP);\n String accountid = this.getComms().request.getParameter(ACCOUNTID);\n String outside = this.getComms().request.getParameter(OUTSIDE);\n String exp = this.getComms().request.getParameter(EXP);\n String expday = this.getComms().request.getParameter(EXPDAY);\n String expmonth = this.getComms().request.getParameter(EXPMONTH);\n String expyear = this.getComms().request.getParameter(EXPYEAR);\n String notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\t\n\t // Instantiate the page object\n\t EditHTML page = new EditHTML();\n Project project = null;\n\tString userID = null;\n\n System.out.println(\"project Id at show edit page \"+projectID);\n try {\n project = ProjectFactory.findProjectByID(projectID);\n\t userID = project.getUserID();\n // Catch any possible database exception in findProjectByID()\n } catch(webscheduleBusinessException ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid project to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n try {\n // If we received a valid projectID then try to show the project's contents,\n // otherwise try to use the HTML input parameters\n page.getElementProjID().setValue(project.getHandle());\n\n if(null != proj_name && proj_name.length() != 0) {\n page.getElementProj_name().setValue(proj_name);\n } else {\n page.getElementProj_name().setValue(project.getProj_name());\n }\n\n HTMLOptionElement templateOption = page.getElementTemplateOption();\n Node PersonSelect = templateOption.getParentNode();\n templateOption.removeAttribute(\"id\");\n templateOption.removeChild(templateOption.getFirstChild());\n\n\n try {\n \tPerson[] PersonList = PersonFactory.getPersonsList();\n \tfor (int numPersons = 0; numPersons < PersonList.length; numPersons++) {\n \t Person currentPerson = PersonList[numPersons] ;\n \t HTMLOptionElement clonedOption = (HTMLOptionElement) templateOption.cloneNode(true);\n clonedOption.setValue(currentPerson.getHandle());\n Node optionTextNode = clonedOption.getOwnerDocument().\n createTextNode(currentPerson.getFirstname() + \" \" +\n currentPerson.getLastname());\n\t\t\tif ((currentPerson.getHandle()).equals(userID))\n\t\t\t clonedOption.setSelected(true);\n\t\t\t else \n\t\t\t clonedOption.setSelected(false);\t\t\n\t\t\t \n clonedOption.appendChild(optionTextNode);\n // Do only a shallow copy of the option as we don't want the text child\n // of the node option\n PersonSelect.appendChild(clonedOption);\n // Alternative way to insert nodes below\n // insertBefore(newNode, oldNode);\n // ProjSelect.insertBefore(clonedOption, templateOption);\n\t }\n\t } catch(Exception ex) {\n\t this.writeDebugMsg(\"Error populating Persons List: \" + ex);\n throw new webschedulePresentationException(\"Error getting Persons List: \", ex);\n\t }\n\t\n templateOption.getParentNode().removeChild(templateOption);\n\n /* if (personID.equals(INVALID_ID)){\n \tpage.getElementPersonList().setValue(project.getUserID());\n \t\n }else {\n \tpage.getElementPersonList().setValue(personID);\n }\t\t*/\n\n if(null != password && password.length() != 0) {\n page.getElementPassword().setValue(password);\n } else {\n page.getElementPassword().setValue(project.getPassword());\n }\n\n if(null != discrib && discrib.length() != 0) {\n page.getElementDiscrib().setValue(discrib);\n } else {\n page.getElementDiscrib().setValue(project.getDescription());\n }\n \n if(null != indexnum && indexnum.length() != 0) {\n page.getElementIndexnum().setValue(indexnum);\n } else {\n page.getElementIndexnum().setValue(project.getIndexnum());\n }\n\n if(null != thours && thours.length() != 0) {\n page.getElementThours().setValue(thours);\n } else {\n page.getElementThours().setValue(Double.toString(project.getTotalhours()));\n }\n\n if(null != dhours && dhours.length() != 0) {\n page.getElementDhours().setValue(dhours);\n } else {\n page.getElementDhours().setValue(Double.toString(project.getDonehours()));\n }\n if(null != codeofpay && codeofpay.length() != 0) {\n page.getElementCodeofpay().setValue(codeofpay);\n } else {\n page.getElementCodeofpay().setValue(Integer.toString(project.getCodeofpay()));\n }\n\n \n\t\n\t if(null != contactname && contactname.length() != 0) {\n page.getElementContactname().setValue(contactname);\n } else {\n page.getElementContactname().setValue(project.getContactname());\n }\n\n\t if(null != billaddr1 && billaddr1.length() != 0) {\n page.getElementBilladdr1().setValue(billaddr1);\n } else {\n page.getElementBilladdr1().setValue(project.getBilladdr1());\n }\n\n\n\t if(null != billaddr2 && billaddr2.length() != 0) {\n page.getElementBilladdr2().setValue(billaddr2);\n } else {\n page.getElementBilladdr2().setValue(project.getBilladdr2());\n }\n\n\t\n\t if(null != billaddr3 && billaddr3.length() != 0) {\n page.getElementBilladdr3().setValue(billaddr3);\n } else {\n page.getElementBilladdr3().setValue(project.getBilladdr3());\n }\n\n\n if(null != city && city.length() != 0) {\n page.getElementCity().setValue(city);\n } else {\n page.getElementCity().setValue(project.getCity());\n }\n\n\t if(null != state && state.length() != 0) {\n page.getElementState().setValue(state);\n } else {\n page.getElementState().setValue(project.getState());\n }\n\n if(null != zip && zip.length() != 0) {\n page.getElementZip().setValue(zip);\n } else {\n page.getElementZip().setValue(project.getZip());\n }\n\nif(null != accountid && accountid.length() != 0) {\n page.getElementAccountid().setValue(accountid);\n } else {\n page.getElementAccountid().setValue(project.getAccountid());\n }\n\n\t\n\tif(null != this.getComms().request.getParameter(OUTSIDE)) {\n page.getElementOutsideBox().setChecked(true);\n } else {\n page.getElementOutsideBox().setChecked(project.isOutside());\n }\n\t\n\t\n\tif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(project.isExp());\n }\n\n if(null != expday && expday.length() != 0) {\n page.getElementExpday().setValue(expday);\n } else {\n page.getElementExpday().setValue(Integer.toString(project.getExpday()));\n }\n \n\n\nif(null != expmonth && expmonth.length() != 0) {\n page.getElementExpmonth().setValue(expmonth);\n } else {\n page.getElementExpmonth().setValue(Integer.toString(project.getExpmonth()));\n }\n \nif(null != expyear && expyear.length() != 0) {\n page.getElementExpyear().setValue(expyear);\n } else {\n page.getElementExpyear().setValue(Integer.toString(project.getExpyear())); \t \n}\n\n\n\t if(null != notifycontact && notifycontact.length() != 0) {\n page.getElementNotifycontact().setValue(notifycontact);\n } else {\n page.getElementNotifycontact().setValue(project.getNotifycontact());\n }\n\n\n\n if(null == errorMsg) {\n\n page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n\t } else {\n page.setTextErrorText(errorMsg);\n }\n } catch(webscheduleBusinessException ex) {\n throw new webschedulePresentationException(\"Error populating page for project editing\", ex);\n }\n \n page.getElementEventValue().setValue(EDIT_COMMAND);\n\t return page.toDocument();\n }", "public abstract void pageDisplayed();", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpage3 p9=new page3();\n\t\t\t\tpage3.main(null);\n\t\t\t\tf4.dispose();\n\t\t\t}", "@FXML\n private void callCourseSelectPage(ActionEvent e) {\n\n CourseSelectPage.selectForRecordMode= false;\n\n Pageloader loader = new Pageloader();\n Parent root = loader.getPage(\"GUIcourseSelectPage\");\n Stage stage = new Stage();\n stage.setTitle(\"Add record for student\");\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.setScene(new Scene(root));\n stage.showAndWait();\n }", "@Override\n public void enter(ViewChangeListener.ViewChangeEvent event) {\n Map<String, String> parametersMap = event.getParameterMap();\n Logger.getLogger(this).info(\"Parameters map \" + Arrays.toString(parametersMap.entrySet().toArray()));\n this.selectedCustomerId = Integer.parseInt(parametersMap.getOrDefault(\"customer\", \"0\"));\n this.selectedSiteId = Integer.parseInt(parametersMap.getOrDefault(\"site\", \"0\"));\n this.selectedVehicleId = Integer.parseInt(parametersMap.getOrDefault(\"vehicle\", \"0\"));\n super.enter(event);\n }", "void onSelectProject();", "public SavingsInfoPage() {\n setLocationRelativeTo(null);\n setResizable(false); \n initComponents();\n onRun();\n }", "@Override\r\n\tpublic void index() {\n\t\trender(\"index.jsp\");\r\n\t}", "@RequestMapping(value = \"/*\", method = RequestMethod.GET)\r\n public ModelAndView handleRequest() {\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n ModelAndView mav = new ModelAndView(\"home\");\r\n List<Project> projs = hibernateTemplate.find(\"from Project\");\r\n mav.addObject(\"projs\", projs);\r\n List<Event> events = dataAccessService.getEventsForUser(user, 10);\r\n Map<String, Integer> stats = dataAccessService.getStatistics();\r\n List<SubProject> followedProjects = dataAccessService.getFollowedSubProjectsForUser(user);\r\n Collections.sort(followedProjects, new Comparator<SubProject>() {\r\n\r\n @Override\r\n public int compare(SubProject o1, SubProject o2) {\r\n Integer into1 = o1.getParent().getId();\r\n Integer into2 = o2.getParent().getId();\r\n return into1.compareTo(into2);\r\n }\r\n });\r\n mav.addObject(\"followProjects\", followedProjects);\r\n mav.addObject(\"events\", events);\r\n mav.addObject(\"projects\", stats.get(\"projects\"));\r\n mav.addObject(\"users\", stats.get(\"users\"));\r\n mav.addObject(\"subprojects\", stats.get(\"subprojects\"));\r\n mav.addObject(\"methods\", stats.get(\"methods\"));\r\n mav.addObject(\"results\", stats.get(\"results\"));\r\n mav.addObject(\"comments\", stats.get(\"comments\"));\r\n mav.addObject(\"eventstat\", stats.get(\"events\"));\r\n mav.addObject(\"data\", stats.get(\"data\"));\r\n return mav;\r\n }", "public AbstractSOAProjectWizardPage(String pageName) {\r\n\t\tsuper(pageName);\r\n\t}", "public void viewOptions()\r\n {\r\n SetupScreen setupScreen = new SetupScreen();\r\n pushScreen(setupScreen);\r\n }", "public void parameterChange(ParameterChangeEvent e) {\n\t\tsite.setLocation(new Location(((Double) latitude.getValue())\n\t\t\t\t.doubleValue(), ((Double) longitude.getValue()).doubleValue()));\n\t}", "public String showPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n // String dhours = this.getComms().request.getParameter(DHOURS);\n // String projectID = this.getComms().request.getParameter(PROJ_ID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n String contactname = this.getComms().request.getParameter(CONTACTNAME);\n String contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n String contactemail = this.getComms().request.getParameter(CONTACTEMAIL);\n String billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n String billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n String billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n String city = this.getComms().request.getParameter(CITY);\n String state = this.getComms().request.getParameter(STATE);\n String zip = this.getComms().request.getParameter(ZIP);\n // String accountid = this.getComms().request.getParameter(ACCOUNTID);\n // String outside = this.getComms().request.getParameter(OUTSIDE);\n // String exp = this.getComms().request.getParameter(EXP);\n String expday = this.getComms().request.getParameter(EXPDAY);\n String expmonth = this.getComms().request.getParameter(EXPMONTH);\n String expyear = this.getComms().request.getParameter(EXPYEAR);\n String notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n // String iexpday = this.getComms().request.getParameter(IEXPDAY);\n // String iexpmonth = this.getComms().request.getParameter(IEXPMONTH);\n //String iexpyear = this.getComms().request.getParameter(IEXPYEAR);\n \n String modby= this.getComms().request.getParameter(MODBY);\n String moddate= this.getComms().request.getParameter(MODDATE);\n String notes= this.getComms().request.getParameter(NOTES);\n \n String irbnum = this.getComms().request.getParameter(IRBNUM);\n \n // Instantiate the page object\n ucsdprojectseditHTML page = new ucsdprojectseditHTML();\n \n HTMLSelectElement\texpday_select, expmonth_select, expyear_select;\n\tHTMLCollection\t\texpday_selectCollection, expmonth_selectCollection, expyear_selectCollection;\n\tHTMLOptionElement\texpday_option, expmonth_option, expyear_option;\n\tString\t\t\texpday_optionName, expmonth_optionName, expyear_optionName;\n\t\t\n\t\t\n\texpday_select = (HTMLSelectElement)page.getElementExpday();\n\texpday_selectCollection = expday_select.getOptions();\t\n\t\t\t\n expmonth_select = (HTMLSelectElement)page.getElementExpmonth();\n\texpmonth_selectCollection = expmonth_select.getOptions();\t\n\n\texpyear_select = (HTMLSelectElement)page.getElementExpyear();\n\texpyear_selectCollection = expyear_select.getOptions();\t\n\t\n \n \n HTMLSelectElement\tiexpday_select, iexpmonth_select, iexpyear_select;\n\tHTMLCollection\t\tiexpday_selectCollection, iexpmonth_selectCollection, iexpyear_selectCollection;\n\tHTMLOptionElement\tiexpday_option, iexpmonth_option, iexpyear_option;\n\tString\t\t\tiexpday_optionName, iexpmonth_optionName, iexpyear_optionName;\n\t\t\n\t\t\n\tiexpday_select = (HTMLSelectElement)page.getElementIexpday();\n\tiexpday_selectCollection = iexpday_select.getOptions();\t\n\t\t\t\n iexpmonth_select = (HTMLSelectElement)page.getElementIexpmonth();\n\tiexpmonth_selectCollection = iexpmonth_select.getOptions();\t\n\n\tiexpyear_select = (HTMLSelectElement)page.getElementIexpyear();\n\tiexpyear_selectCollection = iexpyear_select.getOptions();\t\n\t\n\t\n\t \n\t \n\t \n Project theProject = null;\n\tString userID = null;\n\t\n\tString proj_describ, firstname, lastname, piname, user_email, proj_notes;\n\tint expdayi, expmonthi, expyeari;\n\t\n\tdouble dhours;\n\t Date iacucdate = new Date();\n\t java.sql.Date moddated ;\n\t \nString projectID = this.getProjectID();\n\n System.out.println(\"project Id at show edit page \"+projectID);\n try {\n theProject = ProjectFactory.findProjectByID(projectID);\n\t// userID = project.getUserID();\n\t \n\t // proj_name = theProject.getProj_name();\n\t proj_describ = theProject.getDescription();\n\t \n\t firstname = theProject.getUserFirstName();\t \n\t lastname = theProject.getUserLastName();\t\n\t user_email = theProject.getUserEmail();\t\n\t piname = firstname+\" \"+lastname;\n\t \n\t //cname = theProject.getCname();\n\t //cphone = theProject.getCphone();\n\t //cemail = theProject.getCemail();\n\t \n\t// indexnum = theProject.getIndexnum();\n\t\n\t \n\t// Baline1 = theProject.getBilladdr1();\n\t// Baline2 = theProject.getBilladdr2();\n\t// Baline3 = theProject.getBilladdr3();\n\t // Bacity = theProject.getCity();\n\t // Bast = theProject.getState();\n\t // Bazip = theProject.getZip();\n\t \n\t expdayi = theProject.getExpday();\t \n\t expmonthi = theProject.getExpmonth();\t \n\t expyeari = theProject.getExpyear();\t \n\t \n\t // fpname = theProject.getContactname();\n\t // fpphone = theProject.getContactphone();\n\t \n\t moddated = theProject.getModDate();\n\t // thours = theProject.getTotalhours();\n\t dhours = theProject.getDonehours();\n\t iacucdate = theProject.getIACUCDate();\n\t proj_notes = theProject.getNotes();\n\t \n /* // Catch any possible database exception in findProjectByID()\n } catch(webscheduleBusinessException ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid project to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n */\n int iexpyeari = iacucdate.getYear();\n iexpyeari = iexpyeari + 1900;\n \n \n int iexpmonthi = iacucdate.getMonth();\n //add one\n iexpmonthi = iexpmonthi+1;\n int iexpdatei = iacucdate.getDate();\n String iexpyears = Integer.toString(iexpyeari);\n String iexpmonths = Integer.toString(iexpmonthi);\n String iexpdates = Integer.toString(iexpdatei);\t\t\n\t\nString expyears = Integer.toString(expyeari);\n String expmonths = Integer.toString(expmonthi);\n String expdays = Integer.toString(expdayi);\t\t\n \n // try {\n // If we received a valid projectID then try to show the project's contents,\n // otherwise try to use the HTML input parameters\n //page.getElementProjID().setValue(project.getHandle());\n\npage.setTextPiname(piname);\npage.setTextEmail(user_email);\n if(null != proj_name && proj_name.length() != 0) {\n page.getElementProj_name().setValue(proj_name);\n } else {\n page.getElementProj_name().setValue(theProject.getProj_name());\n }\n\t \n\t\n if(null != discrib && discrib.length() != 0) {\n page.getElementDiscrib().setValue(discrib);\n } else {\n page.getElementDiscrib().setValue(proj_describ);\n }\n \n if(null != indexnum && indexnum.length() != 0) {\n page.getElementIndexnum().setValue(indexnum);\n } else {\n page.getElementIndexnum().setValue(theProject.getIndexnum());\n }\n\n if(null != thours && thours.length() != 0) {\n page.getElementThours().setValue(thours);\n } else {\n page.getElementThours().setValue(Double.toString(theProject.getTotalhours()));\n }\n\npage.setTextDhour(Double.toString(theProject.getDonehours()));\n\n/* if(null != dhours && dhours.length() != 0) {\n page.getElementDhours().setValue(dhours);\n } else {\n page.getElementDhours().setValue(Double.toString(project.getDonehours()));\n }*/\n\t \n if(null != codeofpay && codeofpay.length() != 0) {\n page.getElementCodeofpay().setValue(codeofpay);\n } else {\n page.getElementCodeofpay().setValue(Integer.toString(theProject.getCodeofpay()));\n }\n\n \n\t\n\t if(null != contactname && contactname.length() != 0) {\n page.getElementContactname().setValue(contactname);\n } else {\n page.getElementContactname().setValue(theProject.getContactname());\n }\n\t \n\t if(null != contactphone && contactphone.length() != 0) {\n page.getElementContactphone().setValue(contactphone);\n } else {\n page.getElementContactphone().setValue(theProject.getContactphone());\n }\n\t \n\t if(null != contactemail && contactemail.length() != 0) {\n page.getElementContactemail().setValue(contactemail);\n } else {\n page.getElementContactemail().setValue(theProject.getFpemail());\n }\n\n\t if(null != billaddr1 && billaddr1.length() != 0) {\n page.getElementBilladdr1().setValue(billaddr1);\n } else {\n page.getElementBilladdr1().setValue(theProject.getBilladdr1());\n }\n\n\n\t /* if(null != billaddr2 && billaddr2.length() != 0) {\n page.getElementBilladdr2().setValue(billaddr2);\n } else {\n page.getElementBilladdr2().setValue(theProject.getBilladdr2());\n }\n*/\n\t\n\t if(null != billaddr3 && billaddr3.length() != 0) {\n page.getElementBilladdr3().setValue(billaddr3);\n } else {\n page.getElementBilladdr3().setValue(theProject.getBilladdr3());\n }\n\n\n if(null != city && city.length() != 0) {\n page.getElementCity().setValue(city);\n } else {\n page.getElementCity().setValue(theProject.getCity());\n }\n\n\t if(null != state && state.length() != 0) {\n page.getElementState().setValue(state);\n } else {\n page.getElementState().setValue(theProject.getState());\n }\n\n if(null != zip && zip.length() != 0) {\n page.getElementZip().setValue(zip);\n } else {\n page.getElementZip().setValue(theProject.getZip());\n }\n\n\t\n\t\n/*\tif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(project.isExp());\n }\n*/\n\n if(null != expday && expday.length() != 0) {\n page.getElementExpday().setValue(expday);\n } else {\n page.getElementExpday().setValue(Integer.toString(theProject.getExpday()));\n }\n \n\n\nif(null != expmonth && expmonth.length() != 0) {\n page.getElementExpmonth().setValue(expmonth);\n } else {\n page.getElementExpmonth().setValue(Integer.toString(theProject.getExpmonth()));\n }\n \nif(null != expyear && expyear.length() != 0) {\n page.getElementExpyear().setValue(expyear);\n } else {\n page.getElementExpyear().setValue(Integer.toString(theProject.getExpyear())); \t \n}\n\n\n\t if(null != notifycontact && notifycontact.length() != 0) {\n page.getElementNotifycontact().setValue(notifycontact);\n } else {\n page.getElementNotifycontact().setValue(theProject.getNotifycontact());\n }\n\n if(null != notes && notes.length() != 0) {\n\tNode notesText = page.getElementNotes().getOwnerDocument().createTextNode(notes); \n page.getElementNotes().appendChild(notesText);\n } else {\n\t Node notesText = page.getElementNotes().getOwnerDocument().createTextNode(theProject.getNotes()); \n page.getElementNotes().appendChild(notesText); \n }\n\t \n\t System.out.println(\" *** Notes of UCSD project Edit *** \"+notes);\n\n\nif (expyeari > 2000)\n {\n int expday_optionlen = expday_selectCollection.getLength();\n for (int i=0; i< expday_optionlen; i++) {\n\t expday_option = (HTMLOptionElement)expday_selectCollection.item(i);\n\t expday_optionName = expday_option.getValue();\n\t if (expday_optionName.equals(expdays))\n\t expday_option.setSelected(true);\n\t else\n\t expday_option.setSelected(false);\n\t } \n\n int expmonth_optionlen = expmonth_selectCollection.getLength();\n for (int i=0; i< expmonth_optionlen; i++) {\n\t expmonth_option = (HTMLOptionElement)expmonth_selectCollection.item(i);\n\t expmonth_optionName = expmonth_option.getValue();\n\t if (expmonth_optionName.equals(expmonths))\n\t expmonth_option.setSelected(true);\n\t else\n\t expmonth_option.setSelected(false);\n\t } \n\t \n\t int expyear_optionlen = expyear_selectCollection.getLength();\n\tfor (int i=0; i< expyear_optionlen; i++) {\n\t expyear_option = (HTMLOptionElement)expyear_selectCollection.item(i);\n\t expyear_optionName = expyear_option.getValue();\n\t if (expyear_optionName.equals(expyears))\n\t expyear_option.setSelected(true);\n\t else\n\t expyear_option.setSelected(false);\n\t } \n\n }\n\n\nif (iexpyeari > 2000)\n {\n int iexpday_optionlen = iexpday_selectCollection.getLength();\n for (int i=0; i< iexpday_optionlen; i++) {\n\t iexpday_option = (HTMLOptionElement)iexpday_selectCollection.item(i);\n\t iexpday_optionName = iexpday_option.getValue();\n\t if (iexpday_optionName.equals(iexpdates))\n\t iexpday_option.setSelected(true);\n\t else\n\t iexpday_option.setSelected(false);\n\t } \n\n int iexpmonth_optionlen = iexpmonth_selectCollection.getLength();\n for (int i=0; i< iexpmonth_optionlen; i++) {\n\t iexpmonth_option = (HTMLOptionElement)iexpmonth_selectCollection.item(i);\n\t iexpmonth_optionName = iexpmonth_option.getValue();\n\t if (iexpmonth_optionName.equals(iexpmonths))\n\t iexpmonth_option.setSelected(true);\n\t else\n\t iexpmonth_option.setSelected(false);\n\t } \n\t \n\t int iexpyear_optionlen = iexpyear_selectCollection.getLength();\n\tfor (int i=0; i< iexpyear_optionlen; i++) {\n\t iexpyear_option = (HTMLOptionElement)iexpyear_selectCollection.item(i);\n\t iexpyear_optionName = iexpyear_option.getValue();\n\t if (iexpyear_optionName.equals(iexpyears))\n\t iexpyear_option.setSelected(true);\n\t else\n\t iexpyear_option.setSelected(false);\n\t } \n\n }\n\n\nif(null != irbnum && irbnum.length() != 0) {\n page.getElementIrbnum().setValue(irbnum);\n } else {\n\t page.getElementIrbnum().setValue(theProject.getIRBnum());\n }\n\n\n\t page.setTextModdate(moddated.toString()); \n\tpage.setTextModby(theProject.getModifiedby()); \n\n\n\n\n if(null == errorMsg) {\n\n page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n\t } else {\n page.setTextErrorText(errorMsg);\n }\n } catch(webscheduleBusinessException ex) {\n throw new webschedulePresentationException(\"Error populating page for project editing\", ex);\n }\n \n // page.getElementEventValue().setValue(EDIT_COMMAND);\n\t return page.toDocument();\n }", "public DisplayPage(SplashPage parent) {\n initComponents();\n this.parent = parent;\n }", "@Override\n\tpublic void showPostLocation() {\n\t\t\n\t}", "@Override\r\n\tpublic int buildPage(String name, Map<?, ?> data, File file) {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic void addPages() {\n\t\tprojectPage = new NewProjectWizardPage();\r\n\t\taddPage(projectPage);\r\n\t}", "public void execute(){\r\n\t\tapplicationController.about();\r\n\t}", "public project() {\n\n initComponents();\n }", "public PersonalPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "@SneakyThrows\n private void premierLeague(ActionEvent event) {\n final Project project = table.getSelectionModel().getSelectedItem();\n if (project == null) {\n NotificationUtil.warningAlert(\"Warning\", \"Select project first\", NotificationUtil.SHORT);\n return;\n } else if (getFreeInstructors().isEmpty()) {\n NotificationUtil.warningAlert(\"Warning\", \"All instructors are busy\", NotificationUtil.SHORT);\n return;\n }\n\n final FXMLLoader fxmlLoader = new FXMLLoader();\n fxmlLoader.setLocation(getClass().getResource(\"/PremierLeague.fxml\"));\n Parent parent = fxmlLoader.load();\n PremierLeagueController premierLeagueController = fxmlLoader.getController();\n premierLeagueController.loadProjectDetails(project);\n\n final Stage stage = new Stage();\n Scene value = new Scene(parent);\n stage.setScene(value);\n value.getStylesheets().add(\"css/main.css\");\n stage.initModality(Modality.WINDOW_MODAL);\n Window window = ((Node) event.getSource()).getScene().getWindow();\n stage.initOwner(window);\n stage.show();\n\n stage.setOnHiding(e -> loadProjects());\n }", "private void init(final DccdSB dccdHit)\n\t{\n\t\tLink viewResultLink = new Link(\"viewResult\")\n\t\t{\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\t// now navigate to view page with given project;\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}\n };\n add(viewResultLink);\n\n\t\taddObjectInformation(viewResultLink, dccdHit);\n\t\taddProjectInformation(viewResultLink, dccdHit);\n\t\t\n\t\tboolean hasMarkerOnMap = false;\n\t\tif (dccdHit.hasLatLng())\n\t\t{\n\t\t\t//Check for permission\n\t\t\tDccdUser user = (DccdUser) ((DccdSession) getSession()).getUser();\n\t\t\tProjectPermissionLevel effectivelevel = dccdHit.getEffectivePermissionLevel(user);\n\t\t\tBoolean isAllowedToViewLocation = ProjectPermissionLevel.OBJECT.isPermittedBy(effectivelevel);\n\t\t\thasMarkerOnMap = isAllowedToViewLocation;\n\t\t}\n\t\t// add location marker icon\n\t\tResourceReference markerIconImageReference = GeoViewer.getDefaultMarkerIconImageReference();\n\t\tif(hasMarkerOnMap) \n\t\t{\n\t\t\t// use index specific marker icon image\n\t\t\tint latLngMarkerIndex = dccdHit.latLngMarkerIndex;\n\t\t\tlogger.debug(\"Marker index to use on HitPanel: \" + latLngMarkerIndex);\n\t\t\tif (latLngMarkerIndex >= 0)\n\t\t\t\tmarkerIconImageReference = GeoViewer.getLetterMarkerIconImageReference(latLngMarkerIndex);\n\t\t}\n\t\tImage geoMarkerIconImage = new Image(\"geoMarkerIconImage\", markerIconImageReference);\n\t\tviewResultLink.add(geoMarkerIconImage);\n\t\t// only show icon if marker is on the map\n\t\tgeoMarkerIconImage.setVisible(hasMarkerOnMap);\n\t}", "public String showAddPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n\n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String password = this.getComms().request.getParameter(PASSWORD);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n\tString contactname = this.getComms().request.getParameter(CONTACTNAME);\n\tString contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n\tString billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n\tString billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n\tString billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n\tString city = this.getComms().request.getParameter(CITY);\n\tString state = this.getComms().request.getParameter(STATE);\n\tString zip = this.getComms().request.getParameter(ZIP);\n\tString accountid = this.getComms().request.getParameter(ACCOUNTID);\n\tString isoutside = this.getComms().request.getParameter(OUTSIDE);\n\tString exp = this.getComms().request.getParameter(EXP);\n\tString expday = this.getComms().request.getParameter(EXPDAY);\n\tString expmonth = this.getComms().request.getParameter(EXPMONTH);\n\tString expyear = this.getComms().request.getParameter(EXPYEAR);\n\tString notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\n\n\t // Instantiate the page object\n\t EditHTML page = new EditHTML();\n\n\tHTMLOptionElement templateOption = page.getElementTemplateOption();\n Node PersonSelect = templateOption.getParentNode();\n templateOption.removeAttribute(\"id\");\n templateOption.removeChild(templateOption.getFirstChild());\n\n if(null != this.getComms().request.getParameter(PROJ_NAME)) {\n page.getElementProj_name().setValue(this.getComms().request.getParameter(PROJ_NAME));\n }\n\n try {\n \tPerson[] PersonList = PersonFactory.getPersonsList();\n \tfor (int numPersons = 0; numPersons < PersonList.length; numPersons++) {\n \t Person currentPerson = PersonList[numPersons] ;\n \t HTMLOptionElement clonedOption = (HTMLOptionElement) templateOption.cloneNode(true);\n clonedOption.setValue(currentPerson.getHandle());\n Node optionTextNode = clonedOption.getOwnerDocument().\n createTextNode(currentPerson.getFirstname() + \" \" +\n currentPerson.getLastname());\n clonedOption.appendChild(optionTextNode);\n // Do only a shallow copy of the option as we don't want the text child\n // of the node option\n PersonSelect.appendChild(clonedOption);\n // Alternative way to insert nodes below\n // insertBefore(newNode, oldNode);\n // ProjSelect.insertBefore(clonedOption, templateOption);\n\t }\n\t } catch(Exception ex) {\n\t this.writeDebugMsg(\"Error populating Persons List: \" + ex);\n throw new webschedulePresentationException(\"Error getting Persons List: \", ex);\n\t }\n\t\n templateOption.getParentNode().removeChild(templateOption);\n\n if(null != this.getComms().request.getParameter(PASSWORD)) {\n page.getElementPassword().setValue(this.getComms().request.getParameter(PASSWORD));\n }\n\n if(null != this.getComms().request.getParameter(DISCRIB)) {\n page.getElementDiscrib().setValue(this.getComms().request.getParameter(DISCRIB));\n }\n if(null != this.getComms().request.getParameter(INDEXNUM)) {\n page.getElementIndexnum().setValue(this.getComms().request.getParameter(INDEXNUM));\n }\n\n if(null != this.getComms().request.getParameter(THOURS)) {\n page.getElementThours().setValue(this.getComms().request.getParameter(THOURS));\n }\n\n if(null != this.getComms().request.getParameter(DHOURS)) {\n page.getElementDhours().setValue(this.getComms().request.getParameter(DHOURS));\n }\n\n if(null != this.getComms().request.getParameter(CODEOFPAY)) {\n page.getElementCodeofpay().setValue(this.getComms().request.getParameter(CODEOFPAY));\n }\n\n if(null != this.getComms().request.getParameter(CONTACTNAME)) {\n page.getElementContactname().setValue(this.getComms().request.getParameter(CONTACTNAME));\n }\n\n if(null != this.getComms().request.getParameter(CONTACTPHONE)) {\n \npage.getElementContactphone().setValue(this.getComms().request.getParameter(CONTACTPHONE));\n }\n\n\nif(null != this.getComms().request.getParameter(BILLADDR1)) {\n \npage.getElementBilladdr1().setValue(this.getComms().request.getParameter(BILLADDR1));\n }\n\n\n\nif(null != this.getComms().request.getParameter(BILLADDR2)) {\n \npage.getElementBilladdr2().setValue(this.getComms().request.getParameter(BILLADDR2));\n }\n\n\nif(null != this.getComms().request.getParameter(BILLADDR3)) {\n \npage.getElementBilladdr3().setValue(this.getComms().request.getParameter(BILLADDR3));\n }\n\nif(null != this.getComms().request.getParameter(STATE)) {\n \npage.getElementState().setValue(this.getComms().request.getParameter(STATE));\n }\n\nif(null != this.getComms().request.getParameter(ZIP)) {\n \npage.getElementZip().setValue(this.getComms().request.getParameter(ZIP));\n }\n\n if(null != this.getComms().request.getParameter(OUTSIDE)) {\n page.getElementOutsideBox().setChecked(true);\n } else {\n page.getElementOutsideBox().setChecked(false);\n }\n\t\nif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(false);\n }\t\n\t\nif(null != this.getComms().request.getParameter(ACCOUNTID)) {\n \npage.getElementAccountid().setValue(this.getComms().request.getParameter(ACCOUNTID));\n }\n\t\n\t\nif(null != this.getComms().request.getParameter(EXPDAY)) {\n \npage.getElementExpday().setValue(this.getComms().request.getParameter(EXPDAY));\n }\n\n\nif(null != this.getComms().request.getParameter(EXPMONTH)) {\n \npage.getElementExpmonth().setValue(this.getComms().request.getParameter(EXPMONTH));\n }\nif(null != this.getComms().request.getParameter(EXPYEAR)) {\n \npage.getElementExpyear().setValue(this.getComms().request.getParameter(EXPYEAR));\n }\n\n if(null != this.getComms().request.getParameter(NOTIFYCONTACT)) {\n page.getElementNotifycontact().setValue(this.getComms().request.getParameter(NOTIFYCONTACT));\n }\n\n if(null == errorMsg) { \n\t page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n } else {\n page.setTextErrorText(errorMsg);\n }\n \n\t return page.toDocument();\n }", "public NewCZ_DPPHRProcessPage(){ super(); }", "public void showConfigN3(ActionEvent event) {\r\n\t\tlog.info(\"-----------------------Debugging EstrucOrgController.showConfigN3-----------------------------\");\r\n\t\tlog.info(\"renderConfigN3: \"+getRenderConfigN3());\r\n\t\tif(getRenderConfigN3()==false){\r\n\t\t\tsetRenderConfigN3(true);\r\n\t\t\tsetStrBtnAgregarN3(\"Ocultar Configuración\");\r\n\t\t}else{\r\n\t\t\tsetRenderConfigN3(false);\r\n\t\t\tsetStrBtnAgregarN3(\"Agregar Configuración\");\r\n\t\t}\r\n\t}", "public void handleCreateProject(SelectEvent event) {\n\t}", "@Subscribe\n public void handlePhotoGalleryPageSelected(OnPhotoGalleryPhotoSelect event) {\n displayPhoto(event.getPhotoDisplayInfo());\n }", "public void processRequest(OAPageContext pageContext, OAWebBean webBean) {\n super.processRequest(pageContext, webBean);\n\n String hrSourceType = pageContext.getParameter(\"HrSourceType\");\n OAApplicationModule am = pageContext.getApplicationModule(webBean);\n if (hrSourceType != null && !\"\".equals(hrSourceType)) {\n am.getOADBTransaction().putValue(\"HrSourceType\", hrSourceType);\n }\n initLayout(hrSourceType, webBean);\n if (\"M\".equals(hrSourceType)) {\n pageContext.getPageLayoutBean().setWindowTitle(\"项目管理人才库\");\n OAWebBean WorkExperience = \n webBean.findChildRecursive(\"WorkExperience\");\n WorkExperience.setAttributeValue(this.PROMPT_ATTR, \"项目管理年限\");\n OAHeaderBean queryHeader = \n (OAHeaderBean)webBean.findChildRecursive(\"QueryRN\");\n queryHeader.setText(pageContext, \"项目管理人才库查询\");\n OAMessageStyledTextBean PersonName = \n (OAMessageStyledTextBean)webBean.findChildRecursive(\"PersonName\");\n PersonName.setDestination(\"OA.jsp?page=/cux/oracle/apps/pa/source/webui/EmployeeProjectListPG&personId={@PersonId}&retainAM=Y&HrSourceType=M\");\n } else if (\"D\".equals(hrSourceType)) {\n pageContext.getPageLayoutBean().setWindowTitle(\"设计人员人才库\");\n OAWebBean WorkExperience = \n webBean.findChildRecursive(\"WorkExperience\");\n WorkExperience.setAttributeValue(this.PROMPT_ATTR, \"设计工作年限\");\n OAHeaderBean queryHeader = \n (OAHeaderBean)webBean.findChildRecursive(\"QueryRN\");\n queryHeader.setText(pageContext, \"设计人员人才库查询\");\n OAMessageStyledTextBean PersonName = \n (OAMessageStyledTextBean)webBean.findChildRecursive(\"PersonName\");\n PersonName.setDestination(\"OA.jsp?page=/cux/oracle/apps/pa/source/webui/EmployeeProjectListPG&personId={@PersonId}&retainAM=Y&HrSourceType=D\");\n }\n am.invokeMethod(\"initSearchPVO\");\n }", "public MainPage() {\n initComponents();\n \n initPage();\n }", "private void showUI(HttpServletRequest req, HttpServletResponse resp, String pageName) throws ServletException, IOException{\n\t\tGetPageByName pagecontroller = new GetPageByName();\n\t\tPage page = pagecontroller.getPageByName(pageName,currentProject.getProjectID());\n\t\treq.setAttribute(\"Page\", page);\n\t\t/*\n\t\t * Translation Code???\n\t\t * \n\t\t */\n\t\t\n\t\t// Display UI\n\t\treq.getRequestDispatcher(\"/_view/pages.jsp\").forward(req,resp);\t\t\t\n\t}", "@Override\r\n\tpublic void onPageRender(ComponentSystemEvent event) throws Throwable {\n\t}", "public SearchPage() {\n\t\tdoRender();\n\t}", "@Override\r\n\tpublic void start(Stage primaryStage) {\r\n\t\tthis.primaryStage=primaryStage;\r\n\t\tthis.primaryStage.setTitle(\"AmwayWinston\");\r\n\t\t\r\n\t\tinitRootLayout();\r\n\t\t\r\n\t\tshowPersonOverview();\r\n\t\t\r\n\t}", "@RequestMapping(\"/showForm\")\n\t\tpublic String displayDetails(){\n\t\t\treturn \"mngt-page\";\n\t\t}", "@Override\n protected void display() {\n System.out.println(\"Welcome to team builder tool!\");\n System.out.println(\"Current team: \" + team.getName());\n }", "public void onGoToSearchModule() {\n GWT.log(\"SearchModule loaded\");\n //nothing by default\n }", "public CreateProjectPanel() {\n isFinished = true;\n }", "public void showBlank() {\n reportContainer.setVisible( false );\n url = ABOUT_BLANK;\n reportContainer.setUrl( url ); //$NON-NLS-1$\n }", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\treporteViewStage(stage);\n\t\t\t\t}", "@Override\n\tprotected void init() throws Exception {\n\t\toid = getParameter(\"oid\");\n\t\tif (AppUtil.isEmpty(oid)) {\n\t\t\toid = getArgument(\"oid\");\n\t\t}\n\t\tif (AppUtil.isEmpty(oid)) {\n\t\t\tsetupNewPage();\n\t\t} else {\n\t\t\tsetupEditPage();\n\t\t}\n\t}", "public void doRender(GridSphereEvent event) throws PortletLayoutException, IOException {\n PortletResponse res = event.getPortletResponse();\n PrintWriter out = res.getWriter();\n \n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<meta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=iso-8859-1\\\">\");\n out.println(\" <title>\" + name + \"</title>\");\n out.println(\" <link type=\\\"text/css\\\" href=\\\"themes/\" + theme + \"/css\" +\n \"/default.css\\\" rel=\\\"STYLESHEET\\\"/>\");\n out.println(\"<script language=\\\"JavaScript\\\" src=\\\"javascript/gridsphere.js\\\"></script>\");\n out.println(\"</head>\\n<body>\");\n \n Iterator it = components.iterator();\n while (it.hasNext()) {\n PortletComponent comp = (PortletComponent) it.next();\n comp.doRender(event);\n }\n out.println(\"</body></html>\");\n }", "@Then(\"I land on datepicker page\")\n public void i_land_on_datepicker_page() {\n System.out.println(\" landing page\");\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tframe.setVisible(false);\r\n\t\t\t\tnew ReportPage(value);\r\n\t\t\t}", "public void handleResetPersonPanelRequestEvent(ResetPersonPanelRequestEvent event) {\n logger.info(LogsCenter.getEventHandlingLogMessage(event));\n loadBlankPersonPage();\n }", "private void viewPage(String club) throws JSONException, InterruptedException {\r\n logger.log(Level.INFO, \"Would you like to view the \" + \r\n club + \" clubpage? (y/n)\");\r\n \r\n // if yes, go to club page\r\n // else return to display prompt\r\n if(\"y\".equalsIgnoreCase(in.nextLine())) {\r\n \t Club clubToView = new Club(club);\r\n \t clubToView.printClubPromptsAndInfo(PolyClubsConsole.user instanceof ClubAdmin);\r\n }\r\n \r\n else \r\n displaySearch(); \r\n }", "public void viewUser(ActionEvent actionEvent) throws IOException {\n Parent root = FXMLLoader.load(getClass().getResource(\"/sample/view/platoStatistics.fxml\"));\n Scene pageTwoScene = new Scene(root);\n Main.allStage.setScene(pageTwoScene);\n Main.allStage.show();\n\n }", "@Override\n public void afterNavigation(AfterNavigationEvent event) {\n List<Person> persons = Arrays.asList( //\n createPerson(\"https://avatars.githubusercontent.com/u/64605113?s=400&u=113297bed9816b716db08eee82e617f6b1e8ef38&v=4\", \"Andrei Kviatkouski\", \"February 23\",\n \"In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content (also called greeking).\",\n \"1K\", \"500\", \"20\"),\n createPerson(\"https://randomuser.me/api/portraits/women/42.jpg\", \"Abagail Libbie\", \"May 3\",\n \"In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content (also called greeking).\",\n \"1K\", \"500\", \"20\"));\n\n grid.setItems(persons);\n }", "@Override\n public void onPageSelected(int arg0) {\n current = arg0;\n // title.setText(content[current]);\n\n //\tToast.makeText(LearningActivity.this, \"Current = \"+arg0, Toast.LENGTH_SHORT).show();\n\n }", "public void createHomePage(){\n\t\tsetLayout(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints(); \n\t\t//insert username and password fields\n\t\tJLabel title;\n\n\t\t//build the title panel\n\t\ttitlePanel = new JPanel();\n\t\ttitle = new JLabel(\"Budgie\");\n\t\ttitle.setSize(new Dimension(40, 40));\n\t\ttitlePanel.add(title);\n\n\t\tc.anchor = GridBagConstraints.CENTER;\n\t\tc.gridy = 0;\n\t\tc.weighty = .5;\n\t\tadd(titlePanel, c);\n\n\t\tinputField = addinputField();\n\n\t\t//positioning of the grid field\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\n\t\tc.gridy = 1;\n\t\tc.ipady = 10;\n\t\tc.weighty = .5;\n\t\tadd(inputField, c);\n\n\t\tc.gridy++;\n\t\tJButton debug = new JButton(\"Debug\");\n\t\tdebug.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tDebugPrinter.toggleDebug();\n\t\t\t}\n\n\t\t});\n\t\tadd(debug,c);\n\n\n\t\tpack();\n\n\n\t}", "@Override\n public void handle(ActionEvent event) \n {\n if(userRole == 1)\n {\n stage.setScene(ReporterPage(stage));\n }\n else if(userRole == 2)\n {\n stage.setScene(DeveloperPage(stage));\n }\n else if(userRole == 3)\n {\n stage.setScene(ReviewerPage(stage));\n }\n else if(userRole == 4)\n {\n stage.setScene(TriagerPage(stage));\n }\n }", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tclientAnchor.setHref(GWT.getHostPageBaseURL() + \"IT_Projekt.html\");\r\n\t\t}", "public PagePane() {\n instance = this;\n u = CommonUtil.getInstance();\n toolBar = ToolBar.getInstance();\n MsgBoard.getInstance().subscribe(this);\n generalModel = (GeneralModel) GeneralEditor.getInstance().getModel();\n gridModel = (GridModel) GridEditor.getInstance().getModel();\n model = new PageModel();\n mousePt = new Point(generalModel.getWidth() / 2, generalModel.getHeight() / 2);\n canvasWidth = Builder.CANVAS_WIDTH;\n canvasHeight = Builder.CANVAS_HEIGHT;\n this.addMouseListener(new MouseHandler());\n this.addMouseMotionListener(new MouseMotionHandler());\n this.addKeyListener(new DeleteKeyListener());\n this.setLocation(0, 0);\n this.setOpaque(true);\n this.setFocusable( true ); \n this.setBorder(BorderFactory.createLineBorder(Color.black));\n this.setVisible(true);\n bZoom = true;\n }", "@Override\r\n\tpublic void onModuleLoad() {\n\t\tProposalHistory history=new ProposalHistory();\t\r\n\t\tPresenter presenter=new ProposalHistoryPresenter(history.addProposal(), new ProposalHistoryWidget());\r\n\t\tpresenter.go(RootPanel.get());\r\n\t}", "public ActionForward populatePublications(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n HttpServletResponse response) throws Exception {\n setCancerModel(request);\n \n setComments(request, Constants.Pages.PUBLICATIONS);\n \n return mapping.findForward(\"viewPublications\");\n }", "public static void main(String[] args) throws MyException {\n\n PessoaView2 tela = new PessoaView2();\n tela.setVisible(true);\n tela.setLocationRelativeTo(null);\n \n// PessoaDAO pdao = new PessoaDAO();\n// pdao.Salvar(new PessoaVO(1,\"hueberto1\", 32122));\n \n \n }", "@Given(\"I am on the Home Page\")\n public void i_am_on_the_home_page(){\n i_logged_into_Tenant_Manager_Project_list_page();\n\n }", "public void initialScreen() {\n PortfolioStocksVOImpl vo = getPortfolioStocksVO();\n //Number numb = (Number)2;\n Number num = new Number(2);\n vo.setBindPortfolioID(2);\n vo.executeQuery();\n //System.out.println(\"\\n\\n\\n End initial screen method \\n\\n\");\n }", "private void info(ActionEvent x) {\n\t\tProject p = this.list.getSelectedValue();\n\t\tif (p != null) {\n\t\t\tcontroller.moreinfo(p.getName());\n\t\t}\n\t}", "public static void main(String[] args) {\n People people0 = new People(\"Albert\", \"Einstein\", true);\n //People people1 = new People(\"Marie\",\"Curie\", false);\n ViewPeople view1 = new ViewPeople();\n\n ControlPeaple guiControl = new ControlPeaple(people0,view1);\n guiControl.startView();\n\n //System.out.println(people0);\n //System.out.println(people1);\n }", "protected void aboutUs(ActionEvent arg0) {\n\t\tJOptionPane.showMessageDialog(this,\r\n\t\t\t\t\"A Curriculum Design of DBMS By psiphonc in NOV.2019\");\r\n\t}", "public void actionPerformed(ActionEvent e) {\r\n\t\t// create an instance of NewPage\r\n\t\tNewPage newPage = new NewPage(canvas);\r\n\t\t// create new WhiteBoard Page\r\n\t\tnewPage.createNewWbPage();\r\n\t\t// create an instance PresentationInfoListData object to \r\n\t\t//add to PresentationList.\r\n\t\tPresentationInfoListData data =\r\n\t\t\tnew PresentationInfoListData(0, false, newPage.getKey());\r\n\t\tpresentationInfo.add(data);\r\n\t\t// notify all the participants that a new WhiteBoard has been opened\r\n\t\t// and selected\r\n\t\tDataEvent.notifySender(\r\n\t\t\tcanvas.getApplicationType(),\r\n\t\t\tpresentationInfo.getListModel().getSize(),\r\n\t\t\tnewPage.getKey(),\r\n\t\t\tgetToolString());\r\n\t\t\t\r\n\t\t// select the current new WhiteBoard\r\n\t\tpresentationInfo.getPresentationList().setSelectedValue(data, true);\r\n\r\n\t}", "@Override\r\n\t\t\t\tpublic void onSuccess(final Map<String, String> result) {\r\n\t\t\t\t\tcatalogue_search_param_panel.setVisible(true);\r\n\r\n\t\t\t\t\tcatalogue_search_panel_see_description_button.setVisible(true);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Click on this button to see the description file\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatalogue_search_panel_see_description_button.addClickHandler(new ClickHandler() {\r\n\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tWindow.open(result.get(\"description\"), \"description\", result.get(\"description\"));\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * If the map doesn't contain the parameter then the field\r\n\t\t\t\t\t * is disabled. Otherwise, the parameter's key is register\r\n\t\t\t\t\t * to build the request url later\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (!result.containsKey(\"eo:platform\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_platform.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_platform.setName(result.get(\"eo:platform\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:orbitType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitType.setName(result.get(\"eo:orbitType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:instrument\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensor.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensor.setName(result.get(\"eo:instrument\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:sensorType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensortype.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensortype.setName(result.get(\"eo:sensorType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:sensorMode\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensorMode.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensorMode.setName(result.get(\"eo:sensorMode\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:resolution\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMax.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMin.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMax.setName(result.get(\"eo:resolution\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMin.setName(result.get(\"eo:resolution\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:swathId\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_swathId.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_swathId.setName(result.get(\"eo:swathId\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:wavelength\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght1.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght2.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght1.setName(result.get(\"eo:wavelength\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght2.setName(result.get(\"eo:wavelength\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:spectralRange\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_spectralRange.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_spectralRange.setName(result.get(\"eo:spectralRange\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:orbitNumber\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMax.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMin.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMax.setName(result.get(\"eo:orbitNumber\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMin.setName(result.get(\"eo:orbitNumber\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:orbitDirection\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitDirection.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitDirection.setName(result.get(\"eo:orbitDirection\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:track\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAccross.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAlong.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAccross.setName(result.get(\"eo:track\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAlong.setName(result.get(\"eo:track\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:frame\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_frame1.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_frame2.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_frame1.setName(result.get(\"eo:frame\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_frame2.setName(result.get(\"eo:frame\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:identifier\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_identifier.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_identifier.setName(result.get(\"eo:identifier\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:type\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_entryType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_entryType.setName(result.get(\"eo:type\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:acquisitionType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionType.setName(result.get(\"eo:acquisitionType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:status\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_status.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_status.setName(result.get(\"eo:status\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:archivingCenter\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_archivingCenter.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_archivingCenter.setName(result.get(\"eo:archivingCenter\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:acquisitionStation\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionStation.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionStation.setName(result.get(\"eo:acquisitionStation\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingCenter\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingCenter.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingCenter.setName(result.get(\"eo:processingCenter\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingSoftware\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingSoftware.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingSoftware.setName(result.get(\"eo:processingSoftware\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingDate\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate1.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate2.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate1.setName(result.get(\"eo:processingDate\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate2.setName(result.get(\"eo:processingDate\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingLevel\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingLevel.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingLevel.setName(result.get(\"eo:processingLevel\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:compositeType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_compositeType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_compositeType.setName(result.get(\"eo:compositeType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:contents\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_contents.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_contents.setName(result.get(\"eo:contents\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:cloudCover\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_cloud.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_cloud.setName(result.get(\"eo:cloudCover\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:snowCover\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_snow.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_snow.setName(result.get(\"eo:snowCover\"));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.out.println(\"success!\");\r\n\t\t\t\t}", "public Homepage() {\n initComponents();\n }", "public PropertyClassificationPage() {\n initComponents();\n }" ]
[ "0.59014076", "0.59014076", "0.56847924", "0.56101286", "0.55569184", "0.5459683", "0.5440466", "0.54337335", "0.54229224", "0.54207087", "0.5416874", "0.5405528", "0.5405528", "0.5403235", "0.5395078", "0.538768", "0.53737897", "0.5364722", "0.5351773", "0.53463376", "0.53327787", "0.53327787", "0.5331658", "0.5330658", "0.5330658", "0.5326916", "0.5316188", "0.53052646", "0.52966905", "0.5286263", "0.5281278", "0.5274454", "0.5270182", "0.5261685", "0.5258462", "0.525518", "0.5227175", "0.52156717", "0.52096534", "0.5194349", "0.518724", "0.5162672", "0.5162668", "0.51508826", "0.51479775", "0.51442474", "0.51413137", "0.5141141", "0.51230055", "0.51149845", "0.51088667", "0.5099217", "0.50976694", "0.5086529", "0.50822973", "0.5074892", "0.5056366", "0.5050355", "0.5041848", "0.5026928", "0.5026446", "0.5022489", "0.50124884", "0.4999176", "0.49983832", "0.49969533", "0.4993019", "0.49893734", "0.49876362", "0.49829438", "0.4978544", "0.49772882", "0.4964902", "0.4962292", "0.49622902", "0.49614793", "0.49594775", "0.4958468", "0.49574053", "0.4953789", "0.49532467", "0.49523622", "0.49484655", "0.49458596", "0.49410167", "0.4938614", "0.49377897", "0.49325746", "0.4927397", "0.4921822", "0.49092045", "0.4908294", "0.49056408", "0.49056143", "0.49053413", "0.49046963", "0.49013987", "0.4900576", "0.48972383", "0.4896516" ]
0.5421779
9
/ Edits an existing proj in the proj database
public String handleEdit() throws webschedulePresentationException, HttpPresentationException { Project project = null; // Try to get the proj by its ID try { project = ProjectFactory.findProjectByID(this.getProjectID()); String title = project.getProj_name(); System.out.println("project title: "+title); } catch(Exception ex) { this.getSessionData().setUserMessage("Please choose a valid PROJECT to edit"); throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE); } // If we got a valid project then try to save it // If any fields were missing then redisplay the edit page, // otherwise redirect to the project catalog page try { saveProject(project); throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE); } catch(Exception ex) { return showPage("You must fill out all fields to edit this project"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean updateProject(Project project);", "public void saveNewProject(){\n String pn = tGUI.ProjectTextField2.getText();\n String pd = tGUI.ProjectTextArea1.getText();\n String statusID = tGUI.StatusComboBox.getSelectedItem().toString();\n String customerID = tGUI.CustomerComboBox.getSelectedItem().toString();\n\n int sstatusID = getStatusID(statusID);\n int ccustomerID = getCustomerID(customerID);\n\n try {\n pstat = cn.prepareStatement (\"insert into projects (project_name, project_description, project_status_id, customer_id) VALUES (?,?,?,?)\");\n pstat.setString(1, pn);\n pstat.setString(2,pd);\n pstat.setInt(3, sstatusID);\n pstat.setInt(4, ccustomerID);\n pstat.executeUpdate();\n\n }catch (SQLException ex) {\n Logger.getLogger(ProjectMethods.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void updateArchitect(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects \" +\r\n \" SET architect_name = ?, architect_tel = ?, architect_email = ?, architect_address = ?\" +\r\n \"WHERE project_num = \" +projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setString(1, NewProject.architect_name);\r\n pstmt.setString(2, NewProject.architect_tel);\r\n pstmt.setString(3, NewProject.architect_email);\r\n pstmt.setString(4, NewProject.architect_address);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public static void updateContractor(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects\" +\r\n \" SET contract_name = ?, contract_tel = ?, contract_email = ?, contract_address = ?\" +\r\n \"WHERE project_num = \" +projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setString(1, NewProject.contract_name);\r\n pstmt.setString(2, NewProject.contract_tel);\r\n pstmt.setString(3, NewProject.contract_email);\r\n pstmt.setString(4, NewProject.contract_address);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n\tpublic Integer modifyProject(ProjectInfo project) {\n\t\treturn sqlSession.update(\"cn.sep.samp2.project.modifyProject\", project);\n\t}", "@SneakyThrows\n private void editProject(MouseEvent event) {\n final Project project = table.getSelectionModel().getSelectedItem();\n if (project == null) {\n NotificationUtil.warningAlert(\"Warning\", \"Select project first\", NotificationUtil.SHORT);\n return;\n }\n final FXMLLoader fxmlLoader = new FXMLLoader();\n fxmlLoader.setLocation(getClass().getResource(\"/entity/update/UpdateProject.fxml\"));\n Parent parent = fxmlLoader.load();\n UpdateProjectController updateProjectController = fxmlLoader.getController();\n updateProjectController.editCurrentProject(project);\n\n final Stage stage = new Stage();\n Scene value = new Scene(parent);\n value.getStylesheets().add(\"css/main.css\");\n stage.setScene(value);\n stage.initModality(Modality.WINDOW_MODAL);\n Window window = ((Node) event.getSource()).getScene().getWindow();\n stage.initOwner(window);\n stage.show();\n\n stage.setOnHiding(e -> loadProjects());\n }", "int updateByPrimaryKey(UserOperateProject record);", "int updateByPrimaryKey(Project record);", "public boolean updateProject(Project p) {\n\n try {\n String update = \"UPDATE PROJECTS SET \" + \"DESCRIPTION = ?, \"\n + \"HOURS = ?, \" + \"STARTDATE = ?, \" + \"DUEDATE = ?, \" + \"INVOICESENT = ? \"\n + \"WHERE PROJECT_ID = ?\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(update);\n ps.setString(1, p.getDescription());\n ps.setString(2, p.getHours());\n ps.setString(3, p.getStartdate());\n ps.setString(4, p.getDuedate());\n ps.setString(5, p.getInvoicesent());\n ps.setString(6, p.getProjectId());\n ps.executeUpdate();\n\n logger.info(\"ps {}\", ps);\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n\n return false;\n }\n }", "public void changeCurrProject(ProjectModel p) {\n \tprojects.remove(p);\n \tprojects.add(0, p);\n }", "public void saveProject(Project project) {\n\t\tContentValues vals = new ContentValues();\n\t\tProject existing = getProjectById(project.getId());\n\n\t\t// update\n\t\tif (existing != null) {\n\t\t\tvals.put(Constants.COLUMN_STARRED, project.isStarred() ? 1 : 0);\n\t\t\tvals.put(Constants.COLUMN_SHARED, project.isShared() ? 1 : 0);\n\t\t\tvals.put(Constants.COLUMN_TITLE, project.getTitle());\n\t\t\tvals.put(Constants.COLUMN_HISTORY, project.getSerializedHistory());\n\t\t\tString where = Constants.COLUMN_ID + \" = ?\";\n\t\t\tString[] args = new String[] { project.getId() };\n\n\t\t\tdatabase.update(Constants.TABLE_PROJECTS, vals, where, args);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// add\n\t\tvals.put(Constants.COLUMN_ID, project.getId());\n\t\tvals.put(Constants.COLUMN_TITLE, project.getTitle());\n\t\tvals.put(Constants.COLUMN_STARRED, project.isStarred() ? 1 : 0);\n\t\tvals.put(Constants.COLUMN_SHARED, project.isShared() ? 1 : 0);\n\t\tvals.put(Constants.COLUMN_HISTORY, project.getSerializedHistory());\n\t\tdatabase.insert(Constants.TABLE_PROJECTS, null, vals);\n\t}", "@Override\n\tpublic void createProjects(Projects proj) {\n\t\tString sql = \"INSERT INTO projects VALUES (?,?,?,?,?,?,now(),now(),?)\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tproj.getProj_id(),\n\t\t\t\tproj.getProj_name(),\n\t\t\t\tproj.getProj_desc(),\n\t\t\t\tproj.getFile_id(),\n\t\t\t\tproj.getCus_id(),\n\t\t\t\tproj.getCretd_usr(),\n\t\t\t\tproj.getProj_currency()\n\t\t});\n\t\t\n\t\tUserDetailsApp user = UserLoginDetail.getUser();\n\t\t\n\t\tCustomer cus = new Customer();\n\t\tcus = getJdbcTemplate().queryForObject(\"select * from customer where cus_id=\"+proj.getCus_id(), new BeanPropertyRowMapper<Customer>(Customer.class));\n\t\tString file_name = \"\";\n\t\tif(proj.getFile_id() != 0){\n\t\t\tFileModel myFile = new FileModel();\n\t\t\tmyFile = getJdbcTemplate().queryForObject(\"select * from file where file_id=\"+proj.getFile_id(), new BeanPropertyRowMapper<FileModel>(FileModel.class));\n\t\t\tfile_name = myFile.getFile_name();\n\t\t}\n\t\t\n\t\tString audit = \"INSERT INTO audit_logging (aud_id,parent_id,parent_object,commit_by,commit_date,commit_desc,parent_ref) VALUES (default,?,?,?,now(),?,?)\";\n\t\tthis.getJdbcTemplate().update(audit, new Object[]{\n\t\t\t\t\n\t\t\t\tproj.getProj_id(),\n\t\t\t\t\"Projects\",\n\t\t\t\tuser.getUserModel().getUsr_name(),\n\t\t\t\t\"Created row on Projects name=\"+proj.getProj_name()+\", desc=\"+proj.getProj_desc()+\", file_name=\"+file_name\n\t\t\t\t+\", customer=\"+cus.getCus_code()+\", proj_currency=\"+proj.getProj_currency(),\n\t\t\t\tproj.getProj_name()\n\t\t});\n\t}", "public void createProject(Project newProject);", "public boolean insertProject(Project project) throws EmployeeManagementException;", "@Override\r\n\tpublic Project updateProjectById(Project projectId) {\n\t\treturn projectDAO.updateProjectById(projectId);\r\n\t}", "public void save() throws InvalidIDException, SQLException {\r\n\t\t// Whether or not this is a new project being added to the database\r\n\t\tboolean newProject;\r\n\r\n\t\tif (super.id == 0) { newProject = true; }\r\n\t\telse { newProject = false; }\r\n\r\n\t\t// Call save in the Project class first. This will save general project data.\r\n\t\tsuper.save();\r\n\r\n\t\t// Get our connection to the database.\r\n\t\tConnection conn = DBConnectionManager.getPrConnection();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);\r\n\r\n\t\t\t// Get our updatable result set\r\n\t\t\tString sqlStr = \"SELECT * FROM tblTechnology WHERE projectID = \" + super.id;\r\n\t\t\trs = stmt.executeQuery(sqlStr);\r\n\r\n\t\t\t// See if we're updating a row or adding a new row.\r\n\t\t\tif (newProject == false) {\r\n\r\n\t\t\t\t// Make sure this row is actually in the database. This shouldn't ever happen.\r\n\t\t\t\tif (!rs.next()) {\r\n\t\t\t\t\tthrow new InvalidIDException(\"ID was set in Technology, but not found in database on save()\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Make sure the result set is set up w/ current values from this object\r\n\t\t\t\tif (this.groups == null) { rs.updateNull(\"techGroups\"); }\r\n\t\t\t\telse { rs.updateString(\"techGroups\", StringUtils.join(this.groups.toArray(), \",\")); }\r\n\r\n\t\t\t\t// Update the row\r\n\t\t\t\trs.updateRow();\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// We're adding a new row.\r\n\r\n\t\t\t\trs.moveToInsertRow();\r\n\r\n\t\t\t\trs.updateInt(\"projectID\", super.id);\r\n\r\n\t\t\t\tif (this.groups == null) { rs.updateNull(\"techGroups\"); }\r\n\t\t\t\telse { rs.updateString(\"techGroups\", StringUtils.join(this.groups.toArray(), \",\")); }\r\n\r\n\t\t\t\trs.insertRow();\r\n\t\t\t}\r\n\r\n\t\t\trs.close();\r\n\t\t\trs = null;\r\n\t\t\t\r\n\t\t\tstmt.close();\r\n\t\t\tstmt = null;\r\n\t\t\t\r\n\t\t\tconn.close();\r\n\t\t\tconn = null;\r\n\t\t}\r\n\t\tcatch(SQLException e) { throw e; }\r\n\t\tcatch(InvalidIDException e) { throw e; }\r\n\t\tfinally {\r\n\r\n\t\t\t// Always make sure result sets and statements are closed,\r\n\t\t\t// and the connection is returned to the pool\r\n\t\t\tif (rs != null) {\r\n\t\t\t\ttry { rs.close(); } catch (SQLException e) { ; }\r\n\t\t\t\trs = null;\r\n\t\t\t}\r\n\t\t\tif (stmt != null) {\r\n\t\t\t\ttry { stmt.close(); } catch (SQLException e) { ; }\r\n\t\t\t\tstmt = null;\r\n\t\t\t}\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry { conn.close(); } catch (SQLException e) { ; }\r\n\t\t\t\tconn = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "int modifyProject(Project project) throws WrongIDException, WrongDurationException;", "int updateByPrimaryKey(ProjGroup record);", "public void editProjectAction() throws IOException {\n\t\tfinal List<Project> projects = selectionList.getSelectionModel().getSelectedItems();\n\t\tif (projects.size() == 1) {\n\t\t\tfinal Project project = projects.get(0);\n\t\t\tfinal FXMLSpringLoader loader = new FXMLSpringLoader(appContext);\n\t\t\tfinal Dialog<Project> dialog = loader.load(\"classpath:view/Home_AddProjectDialog.fxml\");\n\t\t\tdialog.initOwner(addProject.getScene().getWindow());\n\t\t\t((AddProjectDialogController) loader.getController()).getContentController().setProjectToEdit(project);\n\t\t\tfinal Optional<Project> result = dialog.showAndWait();\n\t\t\tif (result.isPresent()) {\n\t\t\t\tlogger.trace(\"dialog 'edit project' result: {}\", result::get);\n\t\t\t\tupdateProjectList();\n\t\t\t}\n\t\t}\n\t}", "private void setProject()\n\t{\n\t\tproject.setName(tf0.getValue().toString());\n \t\tproject.setDescription(tf8.getValue().toString());\n \t\tproject.setEndDate(df4.getValue());\n \t\tif (sf6.getValue().toString().equals(\"yes\"))project.setActive(true);\n \t\telse project.setActive(false);\n \t\tif (!tf7.getValue().toString().equals(\"\"))project.setBudget(Float.parseFloat(tf7.getValue().toString()));\n \t\telse project.setBudget(-1);\n \t\tproject.setNextDeadline(df5.getValue());\n \t\tproject.setStartDate(df3.getValue());\n \t\ttry \n \t\t{\n \t\t\t\tif (sf1.getValue()!=null)\n\t\t\t\tproject.setCustomerID(db.selectCustomerforName( sf1.getValue().toString()));\n\t\t}\n \t\tcatch (SQLException|java.lang.NullPointerException e) \n \t\t{\n \t\t\tErrorWindow wind = new ErrorWindow(e); \n \t UI.getCurrent().addWindow(wind);\t\t\n \t e.printStackTrace();\n\t\t\t}\n \t\tproject.setInserted_by(\"Grigoris\");\n \t\tproject.setModified_by(\"Grigoris\");\n \t\tproject.setRowversion(1);\n \t\tif (sf2.getValue()!=null)project.setProjectType(sf2.getValue().toString());\n \t\telse project.setProjectType(null);\n\t }", "public void testUpdateProjeto() {\n Projeto p = ProjetoDAO.getProjetoByNome(\"proj4\");\n p.setDuracao(100);\n ProjetoDAO.updateProjeto(p);\n Projeto aux = ProjetoDAO.getProjetoByNome(\"proj4\");\n assertEquals(100, aux.getDuracao());\n }", "@TransactionAttribute(TransactionAttributeType.REQUIRED)\r\n\tpublic ProyectoDO update(ProyectoDO project) throws ConectelException {\r\n\t\t/*try {\r\n\t\t\tProyectoDO current = transformacionService\r\n\t\t\t\t\t.map(project, ProyectoDO.class);*/\r\n\t\t\tentityManager.merge(project);\r\n\t\t/*} catch (ConectelMappingException e) {\r\n\t\t\tthrow new ConectelException(\"Error de sistema.\");\r\n\t\t}*/\r\n\t\treturn null;\r\n\t}", "public Project editProject(Project project, boolean isUndoOrRedo)\n\t\t\tthrows StorageException, ConstraintCheckingException {\n\t\tproject.checkConstraints();\n\t\tProject projectBeforeEdition = listProject(\"_id = \\\"\" + project.get_Id() + \"\\\"\").get(0);\n\t\ttry {\n\t\t\tContentValues projectValues = new ContentValues();\n\t\t\tprojectValues.put(\"NAME\", project.getName());\n\t\t\tprojectValues.put(\"DESCRIPTION\", project.getDescription());\n\t\t\tcontentResolver.update(LocalStorageContentProvider.PROJECT_URI, projectValues,\n\t\t\t\t\t\"_id = \\\"\" + project.get_Id() + \"\\\"\", null);\n\t\t} catch (Exception e) {\n\t\t\tthrow new StorageException();\n\t\t}\n\t\tif (!isUndoOrRedo) {\n\t\t\tthis.getProjectEditedReversedList().add(0, projectBeforeEdition);\n\t\t\tthis.getProjectEditedList().add(project);\n\t\t}\n\t\treturn project;\n\t}", "@Override\n\tpublic int updateProject(Project project) {\n\t\treturn pm.updateProject(project);\n\t}", "public static void updateFinal(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects\" +\r\n \" SET completed = ?\" +\r\n \"WHERE project_num = \" + projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setString(1, \"YES\");\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void edit(Note editedProject) {\n\t\tfor (Note project : getNotes()) {\n\t\t\tif (project.getId().equals(editedProject.getId())) {\n\n\t\t\t\tString sql = \"DELETE FROM todo WHERE ID='\" + project.getId() + \"';\";\n\t\t\t\tsqlUpdate(sql);\n\n\t\t\t\tsql = \"INSERT INTO todo VALUES ('\" + editedProject.getId() + \"','\" + editedProject.getName() + \"','\"\n\t\t\t\t\t\t+ editedProject.getAbbreviation() + \"','\" + editedProject.getDescription() + \"' );\";\n\n\t\t\t\tList<Note> todos = sqlUpdate(sql);\n\n\t\t\t\tsetNotes(todos);\n\t\t\t}\n\t\t}\n\n\t}", "public void addProj() {\n\t\tbtnAdd.click();\n\t}", "public void store() throws IOException, SQLException {\r\n \r\n /* Project section */\r\n final HashMap<Object, Object> projectdata = new HashMap<Object, Object>(8);\r\n \r\n if(project == null){\r\n \t// The title \r\n projectdata.put(ProjectAccessor.TITLE, title);\r\n // Create the project database object.\r\n final ProjectAccessor newProject = new ProjectAccessor(projectdata);\r\n newProject.persist(conn);\r\n projectid = (Long) newProject.getGeneratedKeys()[0];\r\n } else {\r\n \tprojectid = project.getProjectid();\r\n }\r\n }", "private void add_proj_DATABASE(Project project) {\n }", "public static void updatePayment(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n\r\n String sqlInsert = \"UPDATE projects SET tot_paid = ?\" +\r\n \"WHERE project_num = \" + projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setDouble(1, NewProject.tot_paid);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void insertEmpProject(String projectID, String employeeId) {\n\t\tString query=\"INSERT INTO TA_EMPLOYEE_PROJECT(PROJECT_ID,EMPLOYEE_ID) VALUES('\" + projectID + \"','\" + employeeId +\"')\";\r\n\t\tjdbcTemplate.update(query);\r\n\t}", "public String editProjectQuery(String field, String value, String pID) \r\n\t{\r\n\t\tString query = \"UPDATE Project SET \"+field+\" = \"+\"\\\"\"+value+\"\\\" WHERE ProjectID = \\\"\"+pID+\"\\\"\";\r\n\t\tSystem.out.println(query);\r\n\t\treturn query;\r\n\t}", "public String editProjectQuery(String field, String value, String pID) \r\n\t{\r\n\t\tString query = \"UPDATE Project SET \"+field+\" = \"+\"\\\"\"+value+\"\\\" WHERE ProjectID = \\\"\"+pID+\"\\\"\";\r\n\t\tSystem.out.println(query);\r\n\t\treturn query;\r\n\t}", "public void updateCalendarProject(String id, CalendarProject project) {\n String sql = \"UPDATE calendar_projects SET name = :name, duration = :duration WHERE id = :id \";\n Map params = new HashMap();\n params.put(\"id\", id);\n params.put(\"name\", project.getProject());\n params.put(\"duration\", project.getDuration());\n int rows = jdbcTemplate.update(sql, params);\n if (rows != 1) {\n throw new DataAccessException(\"Unexpected rows. Expected: 1 Rows: \" + rows) {\n };\n }\n }", "@Override\n\tpublic Integer addProject(ProjectInfo project) {\n\t\treturn sqlSession.insert(\"cn.sep.samp2.project.addProject\", project);\n\t}", "public static void editDatabase(String sql){\n Connection connection = dbConnection();\n\n try{\n PreparedStatement pst = connection.prepareStatement(sql);\n pst.executeUpdate();\n pst.close();\n connection.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void createProjectsReference(ProjectsReference proj) {\n\t\tString sql = \"INSERT INTO projects_reference VALUES (?,?,?,?,?,?,now(),now(),?,?,?,?)\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tproj.getProj_ref_id(),\n\t\t\t\tproj.getProj_id(),\n\t\t\t\tproj.getItm_id(),\n\t\t\t\tproj.getTime(),\n\t\t\t\tproj.getPrice(),\n\t\t\t\tproj.getCretd_usr(),\n\t\t\t\tproj.getProj_ref_desc(),\n\t\t\t\tproj.getActual_time(),\n\t\t\t\tproj.getTopix_article_id(),\n\t\t\t\tproj.getActivated()\n\t\t});\n\t\t\n\t\tUserDetailsApp user = UserLoginDetail.getUser();\n\t\t\n\t\tProjects proj2 = new Projects();\n\t\tproj2 = getJdbcTemplate().queryForObject(\"select * from projects where proj_id=\"+proj.getProj_id(), new BeanPropertyRowMapper<Projects>(Projects.class));\n\t\tItem itm = new Item();\n\t\titm = getJdbcTemplate().queryForObject(\"select * from item where itm_id=\"+proj.getItm_id(), new BeanPropertyRowMapper<Item>(Item.class));\n\t\tCustomer cus = new Customer();\n\t\tcus = getJdbcTemplate().queryForObject(\"select * from customer where cus_id =\"+proj2.getCus_id(), new BeanPropertyRowMapper<Customer>(Customer.class));\n\t\t\n\t\tString audit = \"INSERT INTO audit_logging (aud_id,parent_id,parent_object,commit_by,commit_date,commit_desc,parent_ref) VALUES (default,?,?,?,now(),?,?)\";\n\t\tthis.getJdbcTemplate().update(audit, new Object[]{\n\t\t\t\t\n\t\t\t\tproj.getProj_ref_id(),\n\t\t\t\t\"Projects Reference:\"+proj2.getProj_id(),\n\t\t\t\tuser.getUserModel().getUsr_name(),\n\t\t\t\t\"Created Item name=\"+itm.getItm_name()+\" on Project name=\"+proj2.getProj_name()+\", customer=\"+cus.getCus_name()\n\t\t\t\t+\", target_time=\"+proj.getTime()+\", actual_time=\"+proj.getActual_time()+\", price=\"+proj.getPrice()+\", desc=\"+proj.getProj_ref_desc()\n\t\t\t\t+\", topix_article_id=\"+proj.getTopix_article_id()+\", activated=\"+((proj.getActivated() == 0) ? \"No\" : \"Yes\"),\n\t\t\t\tproj2.getProj_name()+\" : \"+itm.getItm_name()\n\t\t});\n\t}", "public void update(Pessoa p) {\n\t\tdb.save(p);\t\t\n\t}", "public boolean projectSet(String name, String q1, String q2, String q3){\n\tString projectSet = \"insert into projects values(?, ?, ?, ?)\";\n\tPreparedStatement pSet = null;\n\ttry{\n\t\tpSet = conn.prepareStatement(projectSet);\n\t\tpSet.setString(1, name);\n\t\tpSet.setString(2, q1);\n\t\tpSet.setString(3, q2);\n\t\tpSet.setString(4, q3);\n\t\tif(pSet.executeUpdate() ==1){\n\t\t\treturn true;\n\t\t}\n\t}catch (SQLException e){\n\t\tSystem.out.println(e.getMessage());\n\t\treturn false;\n\t}\n\treturn false;\n\t}", "private static void update_project_status() {\r\n\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Select a project ID to modify it.\");\r\n\t\t\t\r\n\t\t\t// Prints out all project ids and names:\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t// This creates a list of project ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> project_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"ID: \" + project_rset.getInt(\"project_id\") + \", Name:\" + project_rset.getString(\"project_name\"));\r\n\t\t\t\tproject_id_list.add(project_rset.getInt(\"project_id\"));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a project to update \r\n\t\t\tBoolean select_project = true;\r\n\t\t\tint project_id = 0;\r\n\t\t\twhile (select_project == true) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \");\r\n\t\t\t\tString project_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_id = Integer.parseInt(project_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < project_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (project_id == project_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_project = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_project == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available project id.\");\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 * @exception Throws exception if the users input for project id is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t// The user can select either to change the due date, the status or the amount paid\r\n\t\t\t// The values are printed out so that the user can physically see the fields and decide\r\n\t\t\tSystem.out.println(\"Select 1, 2 or 3 depending on which field you want to update: \");\r\n\t\t\t\r\n\t\t\tResultSet project_select_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_select_rset.next()) {\r\n\t\t\t\tif (project_select_rset.getInt(\"project_id\") == project_id) {\r\n\t\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"ID: \" + project_select_rset.getInt(\"project_id\") + \r\n\t\t\t\t\t\"\\nName: \" + project_select_rset.getString(\"project_name\") + \r\n\t\t\t\t\t\"\\nCharged: R\" + project_select_rset.getInt(\"charged\") + \r\n\t\t\t\t\t\"\\n1. Paid: R\" + project_select_rset.getInt(\"paid\") + \r\n\t\t\t\t\t\"\\n2. Due on: \" + project_select_rset.getDate(\"deadline_date\") + \r\n\t\t\t\t\t\"\\n3. Status: \" + project_select_rset.getString(\"status\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Here the user can select the field to update's number\r\n\t\t\t// This allows the user to enter a charged amount \r\n\t\t\tBoolean select_update_field = true;\r\n\t\t\tint update_field = 0;\r\n\t\t\twhile (select_update_field == true) {\r\n\t\t\t\tSystem.out.print(\"Field number \");\r\n\t\t\t\tString field_change_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tupdate_field = Integer.parseInt(field_change_str);\r\n\t\t\t\t\tif (update_field == 1 || update_field == 2 || update_field == 3) {\r\n\t\t\t\t\t\tselect_update_field = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (update_field != 1 && update_field != 2 && update_field != 3) {\r\n\t\t\t\t\t\tSystem.out.println(\"You can only select 1, 2 or 3. Please try again\");\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 * @exception Throws exception if the users input for selected field to update is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The selected field number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\tif (update_field == 1) {\r\n\t\t\t\t// This allows the user to enter update the amount paid \r\n\t\t\t\tBoolean update_paid = true;\r\n\t\t\t\tint prev_paid = 0;\r\n\t\t\t\tint paid = 0;\r\n\t\t\t\twhile (update_paid == true) {\r\n\t\t\t\t\tSystem.out.println(\"How much has been paid: R\");\r\n\t\t\t\t\tString paid_amount_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tpaid = Integer.parseInt(paid_amount_str);\r\n\t\t\t\t\t\tupdate_paid = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * @exception Throws exception if the users input for amount paid is not a number\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The paid amount cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Fetches any previous paid amount to add it to the new amount\r\n\t\t\t\tResultSet project_paid_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t\twhile (project_paid_rset.next()) {\r\n\t\t\t\t\tprev_paid = project_paid_rset.getInt(\"paid\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Calculates the total\r\n\t\t\t\tint total_paid = prev_paid + paid;\r\n\r\n\t\t\t\t// Updates the field\r\n\t\t\t\tPreparedStatement ps_paid = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE project_statuses SET paid = ? WHERE project_id = ?;\");\r\n\t ps_paid.setInt(1, total_paid);\r\n\t ps_paid.setInt(2, project_id);\r\n\t ps_paid.executeUpdate();\r\n\t System.out.println(\"\\nUpdated Paid Amount to R\" + total_paid + \".\\n\");\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif (update_field == 2) {\r\n\t\t\t\t\r\n\t\t\t\t// Allows the user to update the due date\r\n\t\t\t\tBoolean update_deadline_date = true;\r\n\t\t\t\tDate deadline_date = null;\r\n\t\t\t\twhile (update_deadline_date == true) {\r\n\t\t\t\t\tSystem.out.print(\"Deadline Date (YYYY-MM-DD): \");\r\n\t\t\t\t\tString deadline_date_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tdeadline_date= Date.valueOf(deadline_date_str);\r\n\t\t\t\t\t\tupdate_deadline_date = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * @exception Throws exception if the users input for deadline date is not in the correct format\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Updates the value\r\n\t\t\t\tPreparedStatement ps_update_date = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE project_statuses SET completion_date = ? WHERE project_id = ?;\");\r\n\t\t\t\tps_update_date.setDate(1, deadline_date);\r\n\t\t\t\tps_update_date.setInt(2, project_id);\r\n\t\t\t\tps_update_date.executeUpdate();\r\n\t\t\t\tSystem.out.println(\"\\nUpdated deadline date to \" + deadline_date + \".\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (update_field == 3) {\r\n\t\t\t\tSystem.out.print(\"In order to set the status to complete select finalize project from the project menu.\\n\"\r\n\t\t\t\t\t\t+ \"Select status number from list of statuses: \\n\");\r\n\t\t\t\tString[] statuses = new String[] {\"Initialised\", \"Paperwork Phase\", \"Foundations\", \"Primary Construction\", \"Finishes\"};\r\n\t\t\t\tfor (int i = 0; i < 5; i ++) {\r\n\t\t\t\t\tSystem.out.println((i + 1) + \". \" + statuses[i]);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// Allows a user to select a new status\r\n\t\t\t\tBoolean update_status = true;\r\n\t\t\t\tint status_index = 0;\r\n\t\t\t\twhile (update_status == true) {\r\n\t\t\t\t\tSystem.out.println(\"Status No: \");\r\n\t\t\t\t\tString status_index_str = input.nextLine();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tstatus_index = Integer.parseInt(status_index_str);\r\n\t\t\t\t\t\tfor (int i = 0; i < 5; i ++) {\r\n\t\t\t\t\t\t\tif (status_index == i) { \r\n\t\t\t\t\t\t\t\tupdate_status = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (update_status == true) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Please only select an available status numbers.\");\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 * @exception Throws exception if the users input for status index is not a number\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t\t System.out.println(\"The status number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\tPreparedStatement ps_status = conn.prepareStatement(\r\n\t\t\t\t\t\t\"UPDATE project_statuses SET status = ? WHERE project_id = ?;\");\r\n\t ps_status.setString(1, statuses[status_index - 1]);\r\n\t ps_status.setInt(2, project_id);\r\n\t ps_status.executeUpdate();\r\n\t System.out.println(\"\\nThe status has been updated to \" + statuses[status_index -1] + \".\\n\");\r\n\t\t\t}\r\n\t\t/**\r\n\t\t * @exception If the table entry cannot be updated due to database constrains then the SQLException is thrown\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "@Test\n\tpublic void saveProjects() throws ParseException {\n\t\tproject.setEstimates(5);\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tDate parsed = format.parse(\"20110210\");\n\t\tjava.sql.Date sql = new java.sql.Date(parsed.getTime());\n\t\tproject.setdRequested(sql);\n\t\tproject.setdRequired(sql);\n\t\tproject.setCritical(true);\n\t\tproject.setType(\"DOCSMANAGE\");\n\t\tProjectKeyContacts contacts = new ProjectKeyContacts();\n\t\tcontacts.setEmail(\"assdasd.gmail.com\");\n\t\tcontacts.setFname(\"sdsd\");\n\t\tcontacts.setLname(\"asdasd\");\n\t\tcontacts.setPhone(\"asd\");\n\t\tcontacts.setRole(\"asda\");\n\t\tcontacts.setTeam(\"saad\");\n\t\tproject.setContacts(contacts);\n\t\tProjectDetails det = new ProjectDetails();\n\t\tdet.setDescription(\"asdsd\");\n\t\tdet.setName(\"asd\");\n\t\tdet.setName(\"asdad\");\n\t\tdet.setSummary(\"asdd\");\n\t\tproject.setProjectDetails(det);\n\t\tproject.setType(\"DOCSMANAGE\");\n\t\tassertEquals(controller.saveProject(project).getStatusCode(), HttpStatus.CREATED);\n\t}", "public ProjectCart updateProjectCart(ProjectCart pc) {\n Session session = ConnectionFactory.getInstance().getSession();\n boolean tf = true;\n\n Transaction tx = null;\n\n try {\n\n tx = session.beginTransaction();\n\n session.saveOrUpdate(pc);\n\n tx.commit();\n } catch (HibernateException e) {\n try {\n tx.rollback(); //error\n } catch (HibernateException he) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n return pc;\n }", "private AppTProject populateAndSaveProjectDetails(Project project, boolean isNewProject) {\r\n\t\t// Project Details\r\n\t\tAppTProject appTProject = null;\r\n\t\tif (isNewProject) {\r\n\t\t\t// Creates a new Project Entity\r\n\t\t\tappTProject = new AppTProject();\r\n\t\t\tappTProject.setCreatedDate(new Date(System.currentTimeMillis()));\r\n\t\t} else {\r\n\t\t\t// Retrieves the existing Project Entity \r\n\t\t\tappTProject = projectRepository.getOne(project.getProjectId());\r\n\t\t\tappTProject.setModifiedDate(new Date(System.currentTimeMillis()));\r\n\t\t}\r\n\t\tappTProject.setProjectName(project.getProjectName());\r\n\t\tappTProject.setPriority(project.getPriority());\r\n\t\tappTProject.setStartDate(project.getStartDate());\r\n\t\tappTProject.setEndDate(project.getEndDate());\r\n\t\tappTProject.setActive(project.getActive());\r\n\t\tif (null != project.getUser()) {\r\n\t\t\tAppTUser appTUser = new AppTUser();\r\n\t\t\tBeanUtils.copyProperties(project.getUser(), appTUser);\r\n\t\t\tappTProject.setUser(appTUser);\r\n\t\t}\r\n\t\treturn projectRepository.save(appTProject);\r\n\t}", "int insert(Project record);", "public boolean addProject(Project p) {\n try {\n String insert = \"INSERT INTO PROJECTS\"\n + \"(CLIENT,DESCRIPTION,HOURS,STARTDATE,DUEDATE,INVOICESENT,CLIENT_ID,PROJECT_ID) \"\n + \"VALUES(?,?,?,?,?,?,?,PROJECTS_SEQ.NEXTVAL)\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(insert);\n ps.setString(1, p.getClientId());\n ps.setString(2, p.getDescription());\n ps.setString(3, p.getHours());\n ps.setString(4, p.getStartdate());\n ps.setString(5, p.getDuedate());\n ps.setString(6, p.getInvoicesent());\n ps.setString(7, p.getClientId());\n\n ps.executeUpdate();\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "@Override\n public void onClick(View view) {\n String projectName = etProjectName.getText().toString();\n String projectOwner = etProjectOwner.getText().toString();\n String projectDescription = etProjectDescription.getText().toString();\n long projectId = 0; // This is just to give some value. Not used when saving new project because auto-increment in DB for this value.\n\n\n // USerid and projectname are mandatory parameters\n if( userId != 0 && projectName != null) {\n newProject = new Project(projectId, userId, projectName, projectOwner, projectDescription);\n dbHelper.saveProject(newProject);\n// showToast(\"NewprojectId:\" + newProject.projectId+ \"-->UserId: \"+ userId + \"--> ProjectName\" + newProject.projectName +\"->Owner\"+newProject.projectOwner);\n dbHelper.close();\n\n // SIIRRYTÄÄN PROJEKTILISTAUKSEEN\n Intent newProjectList = new Intent( NewProject.this, ProjectListActivity.class);\n newProjectList.putExtra(\"userId\", userId);\n startActivity(newProjectList);\n }\n\n }", "public void save(Project project) {\n\t\tcreate(project);\n\t}", "public void setProject(int projId) {\n projectId = projId;\n titleTextView.setText(Project.projects[projectId].getTitle());\n summaryTextView.setText(Project.projects[projectId].getSummary());\n favCheckBox.setChecked(Project.projects[projectId].isFavorite());\n Log.d(\"favorite setproject \",favCheckBox.isChecked()+\" \" + Project.projects[projectId].isFavorite());\n\n }", "@HTTP(\n method = \"PUT\",\n path = \"/apis/config.openshift.io/v1/projects/{name}\",\n hasBody = true\n )\n @Headers({ \n \"Content-Type: application/json\",\n \"Accept: */*\"\n })\n KubernetesCall<Project> replaceProject(\n @Path(\"name\") String name, \n @Body Project body);", "public void update(int index, int id, String newName, String newField) throws DisciplineRepoException {\r\n if (index < this.disciplines.size() && index >= 0) {\r\n this.disciplines.get(index).setName(newName);\r\n this.disciplines.get(index).setField(newField);\r\n this.disciplines.get(index).setId(id);\r\n } else {\r\n throw new DisciplineRepoException(\"Discipline repo index out of bounds...\");\r\n }\r\n }", "int updateByPrimaryKeySelective(UserOperateProject record);", "int updateByPrimaryKey(Ltsprojectpo record);", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n String projID = this.getComms().request.getParameter(PROJ_ID);\n Project project = null;\n\n System.out.println(\" trying to edit a project \"+ projID);\n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(projID);\n\t System.out.println(\" trying to edit a project 2\"+ projID);\n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n } catch(Exception ex) {\n return showEditPage(\"You must fill out all fields to edit this project\");\n } \n }", "public void updateProject(\n int projectId,\n String newProjectTitle,\n String newAssigneeName,\n String newSupervisorName,\n LocalDate newDeadline,\n String newDescription,\n Project.Importance importance)\n throws NoSignedInUserException, SQLException, InexistentProjectException,\n InexistentDatabaseEntityException, UnauthorisedOperationException,\n InexistentUserException, DuplicateProjectNameException, UnregisteredMemberRoleException,\n InvalidDeadlineException {\n User currentUser = getMandatoryCurrentUser();\n Project project = getMandatoryProject(projectId);\n guaranteeUserIsSupervisor(\n currentUser, project, \"change data of project\", \"they are not the \" + \"supervisor\");\n User assignee = getMandatoryUser(newAssigneeName);\n guaranteeUserIsTeamMember(assignee, project.getTeamId(), \"be assignee\");\n User supervisor = getMandatoryUser(newSupervisorName);\n guaranteeUserIsTeamMember(supervisor, project.getTeamId(), \"be supervisor\");\n // check that there is no other project with the new name\n if (!newProjectTitle.equals(project.getTitle())\n && projectRepository.getProject(project.getTeamId(), newProjectTitle).isPresent()) {\n throw new DuplicateProjectNameException(newProjectTitle);\n }\n // check that the new deadline of the project is valid\n if (!project.getDeadline().equals(newDeadline) && isOutdatedDate(newDeadline)) {\n throw new InvalidDeadlineException();\n }\n // update project\n project.setAssigneeId(assignee.getId());\n project.setSupervisorId(supervisor.getId());\n project.setDescription(newDescription);\n project.setTitle(newProjectTitle);\n project.setDeadline(newDeadline);\n project.setImportance(importance);\n projectRepository.updateProject(project);\n support.firePropertyChange(\n ProjectChangeablePropertyName.UPDATE_PROJECT.toString(), OLD_VALUE, NEW_VALUE);\n }", "private void cloneProject(Company cloneCompany, Project originalProj, Project cloneProj,\n\t Set<Staff> originalStaffSet, Map<Long, Staff> oldIdToNewStaff) {\n\n\t// Get the set of original staff,\n\t// loop through the processed map and\n\t// get equivalent clones given the ID.\n\tcloneProj.setId(0);\n\tcloneProj.setCompany(cloneCompany);\n\tcloneProj.setAuditLogs(null);\n\n\t// Update collections.\n\tSet<Staff> clonedStaffSet = getClonedEquivalent(originalStaffSet, oldIdToNewStaff);\n\tcloneProj.setAssignedFields(null);\n\tcloneProj.setAssignedTasks(null);\n\tcloneProj.setAssignedStaff(clonedStaffSet);\n\tthis.projectDAO.create(cloneProj);\n }", "public int DSAddProject(String ProjectName, String ProjectLocation);", "@HTTP(\n method = \"PUT\",\n path = \"/apis/config.openshift.io/v1/projects/{name}\",\n hasBody = true\n )\n @Headers({ \n \"Content-Type: application/json\",\n \"Accept: */*\"\n })\n KubernetesCall<Project> replaceProject(\n @Path(\"name\") String name, \n @Body Project body, \n @QueryMap ReplaceProject queryParameters);", "int updateByPrimaryKey(ParkCurrent record);", "public void openUpProject(Subproject project) {\n\t\tSubprojectField field=project.setChip(current.removeChip());\n\t\tcurrent.raiseScore(field.getAmountSZT());\n\t}", "public void editarPrograma(Programa prog) throws Exception {\r\n\t\tEntityManager em = AdministradorEntityManager.getEntityManager();\r\n\t\tem.getTransaction().begin();\r\n\t\tem.merge(prog);\r\n\t\tem.getTransaction().commit();\t\t\r\n\t}", "public static void updateDueDate(){\n projectChosen = getQuestionInput();\r\n try {\r\n Connection myConn = DriverManager.getConnection(url, user, password);\r\n String sqlInsert = \"UPDATE projects SET due_date = ? \" +\r\n \"WHERE project_num = \" + projectChosen;\r\n\r\n PreparedStatement pstmt = myConn.prepareStatement(sqlInsert);\r\n pstmt.setString(1, NewProject.due_date);\r\n pstmt.executeUpdate(); //Execute update of database.\r\n pstmt.close();\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "int updateByPrimaryKey(SysTeam record);", "void setProject(InternalActionContext ac, HibProject project);", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\n\t\t\t\t\tif(validateForm()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tProject prj = compileProject();\n\t\t\t\t\t\tportfolio.add(prj,config.isUpdateDB());\n\t\t\t\t\t\tif(prj instanceof OngoingProject) {\n\t\t\t\t\t\t\tProjectTableModel tm = (ProjectTableModel) opTable.getModel();\n\t\t\t\t\t\t\ttm.addRow(prj.toTable());\n\t\t\t\t\t\t\topTable.setModel(tm);\n\t\t\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\t\ttoggleSaved(false);\n\t\t\t\t\t\t\tsel.add(pCode.getText());\n\t\t\t\t\t\t} else if (prj instanceof FinishedProject) {\n\t\t\t\t\t\t\tProjectTableModel tm = (ProjectTableModel) fpTable.getModel();\n\t\t\t\t\t\t\ttm.addRow(prj.toTable());\n\t\t\t\t\t\t\tfpTable.setModel(tm);\n\t\t\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\t\ttoggleSaved(false);\n\t\t\t\t\t\t\tsel.add(pCode.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnpd.dispose();\n\t\t\t\t\t}\n\t\t\t\t}", "private static void finalise_project() {\r\n\t\tDate deadline_date = null;\r\n\t\tint paid = 0;\r\n\t\tint charged = 0;\r\n\t\tString project_name = \"\";\r\n\t\tString email = \"\";\r\n\t\tString number = \"\";\r\n\t\tString full_name = \"\";\r\n\t\tString address = \"\";\r\n\t\tDate completion_date = null;\r\n\t\t\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Select a project ID to modify it.\");\r\n\t\t\t\r\n\t\t\t// Prints out all project ids and names that are not complete:\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id INNER JOIN people ON projects.project_id = people.projects \"\r\n\t\t\t\t\t+ \"WHERE project_statuses.status <>'Complete';\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t// This creates a list of project ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> project_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tSystem.out.println(\"ID: \" + project_rset.getInt(\"project_id\") + \", Name:\" + project_rset.getString(\"project_name\"));\r\n\t\t\t\tproject_id_list.add(project_rset.getInt(\"project_id\"));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows user to select a project to finalize \r\n\t\t\tBoolean select_project = true;\r\n\t\t\tint project_id = 0;\r\n\t\t\twhile (select_project == true) {\r\n\t\t\t\tSystem.out.println(\"Project ID: \");\r\n\t\t\t\tString project_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tproject_id = Integer.parseInt(project_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < project_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (project_id == project_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_project = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_project == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available project id.\");\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 * @exception Throws exception if the users input for project number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The project number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from the selected project\r\n\t\t\tResultSet project_select_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_select_rset.next()) {\r\n\t\t\t\tif (project_select_rset.getInt(\"project_id\") == project_id) {\r\n\t\t\t\t\tproject_id = project_select_rset.getInt(\"project_id\");\r\n\t\t\t\t\tproject_name = project_select_rset.getString(\"project_name\");\r\n\t\t\t\t\tdeadline_date = project_select_rset.getDate(\"deadline_date\");\r\n\t\t\t\t\tpaid = project_select_rset.getInt(\"paid\");\r\n\t\t\t\t\tcharged = project_select_rset.getInt(\"charged\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Gets values needed from related customer\r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectCustomer = String.format(\"SELECT * FROM people WHERE projects = '%s'\", project_id);\r\n\t\t\tResultSet customer_rset = stmt.executeQuery(strSelectCustomer);\r\n\t\t\twhile (customer_rset.next()) {\r\n\t\t\t\tfull_name = customer_rset.getString(\"name\") + \" \" + customer_rset.getString(\"surname\");\r\n\t\t\t\taddress = customer_rset.getString(\"address\");\r\n\t\t\t\temail = customer_rset.getString(\"email_address\");\r\n\t\t\t\tnumber = customer_rset.getString(\"telephone_number\");\r\n\t\t\t}\r\n\r\n\t\t\t// This updates the completion date\r\n\t\t\tBoolean update_completion_date = true;\r\n\t\t\twhile (update_completion_date == true) {\r\n\t\t\t\tSystem.out.print(\"Date Complete (YYYY-MM-DD): \");\r\n\t\t\t\tString completion_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcompletion_date = Date.valueOf(completion_date_str);\r\n\t\t\t\t\tupdate_completion_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the completion date is in the wrong format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Updates the value\r\n\t\t\tPreparedStatement ps_finalise = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE project_statuses SET completion_date = ?, status = ? WHERE project_id = ?;\");\r\n\t\t\tps_finalise.setDate(1, completion_date);\r\n\t\t\tps_finalise.setString(2, \"Complete\");\r\n\t\t\tps_finalise.setInt(3, project_id);\r\n\t\t\tps_finalise.executeUpdate();\r\n\t\t\tSystem.out.println(\"\\nUpdated completion date to \" + completion_date + \".\\n\");\r\n\t\t}\t\r\n\t\t/**\r\n\t\t * @exception If the project status table cannot be updated because of field constraints then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\tcatch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t\t// Calculates the amount due and prints out an invoice\r\n\t\tint due = charged - paid;\r\n\t\tif (due > 0) {\r\n\t\t\tString content = \"\\t\\t\\t\\tInvoice\\n\" + \r\n\t\t\t\t\t\"\\nDate: \" + completion_date +\r\n\t\t\t\t\t\"\\n\\nName: \" + full_name +\r\n\t\t\t\t\t\"\\nContact Details: \" + email + \"\\n\" + number + \r\n\t\t\t\t\t\"\\nAddress: \" + address + \r\n\t\t\t\t\t\"\\n\\nAmount due for \" + project_name + \r\n\t\t\t\t\t\":\\nTotal Cost:\\t\\t\\t\\t\\t\\t\\tR \" + charged + \r\n\t\t\t\t\t\"\\nPaid: \\t\\t\\t\\t\\t\\t\\tR \" + paid +\r\n\t\t\t\t\t\"\\n\\n\\nDue: \\t\\t\\t\\t\\t\\t\\tR \" + due;\r\n\t\t\tCreateFile(project_name);\r\n\t\t\tWriteToFile(project_name, content);\r\n\t\t}\r\n\t}", "@Test\n public void testUpdateOrg() {\n Organization org = new Organization();\n org.setOrgId(1);\n org.setOrgName(\"Avenger\");\n org.setDescription(\"blah blah\");\n org.setAddress(ad);\n dao.addOrg(org);\n org.setOrgName(\"X-Men\");\n assertNotEquals(org, dao.getOrg(org.getOrgId()));\n Organization fromDao = dao.updateOrg(org);\n assertEquals(org, fromDao);\n }", "@Override\n\tpublic Integer removeProject(Integer projId) {\n\t\treturn sqlSession.delete(\"cn.sep.samp2.project.removeProject\", projId);\n\t}", "public void edit_carrer_profile_project(Connection con, int user_id,int carrer_profile_project_id,String project_name,Date project_start_date,Date project_end_date,String project_organisation_associated_with,String project_cast_associated_with,String project_website_link,String project_instgram_link,String project_facebook_link,String project_twitter_link,String project_other_link,String project_description,HashMap carrer_profile_media)\n\t{\n\t\t\n\t\t// connect insta for instagram_followers etc..\t\n\t\tResultSet rs; \n\t\tPreparedStatement pst;\n\t\t DateFormat dateFormat = new SimpleDateFormat(\"yyyy-mm-dd\"); \n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tpst=con.prepareStatement(\"update carrer_profile_project set project_name=?,project_start_date=?,project_end_date=?, project_organisation_associated_with=?,project_cast_associated_with=?,project_website_link=?,project_instgram_link=?,project_facebook_link=?,project_twitter_link=?,project_other_link=?,project_description=? where e_id=? and carrer_profile_project_id=?\");\n\t\t\tpst.setString(1, project_name);\n\t\t\tpst.setDate(2, new java.sql.Date( project_start_date.getTime()));\n\t\t\tpst.setDate(3, new java.sql.Date(project_end_date.getTime()));\n\t\t\tpst.setString(4, project_organisation_associated_with); // csv\n\t\t\tpst.setString(5, project_cast_associated_with);//csv\n\t\t\tpst.setString(6, project_website_link);\n\t\t\tpst.setString(7, project_instgram_link);\n\t\t\tpst.setString(8, project_facebook_link); \n\t\t\tpst.setString(9, project_twitter_link);\n\t\t\tpst.setString(10, project_other_link); //csv\n\t\t\tpst.setString(11, project_description);\n\t\t\tpst.setInt(12, user_id);\n\t\t\tpst.setInt(13, carrer_profile_project_id);\n\t\t\t\n\t\t\t//pst=con.prepareStatement(\"update basic_profile set name=?,whatsapp_number=?,calling_number=?,email_id=?,website_link=?,instgram_link=?,facebook_link=?,twitter_link=?,other_link=?,about_us=?,plot_or_building_number=?,building_name=?,floor_number=?,street,locality=?,landmark=?,city=?,state=?,pincode=?,country=?,google_map_link=?,logo=?) where eid=? \");\n\t\t\t//create table database.carrer_profile_media( e_id integer, carrer_profile_id integer,carrer_profile_type String, media_id integer,media longblob,media_type varchar(20))\n\t\t\t\n\t\t\tif(!carrer_profile_media.isEmpty())\n\t\t\t\tadd_carrer_profile_media(con, user_id,carrer_profile_project_id, \"carrer_profile_project\", carrer_profile_media);\n\t\t\t\t\n\t\t\t\tpst.execute();\n\t\t\t\t\n\t\t\t}catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t\t\n\t\t\t// create carrer project profile detail image and store it \n\t\t} \n\t\t\n\t\tArrayList<String> values=new ArrayList<String>();\n\t\tvalues.add(Integer.toString(user_id));\n\t\tvalues.add(Integer.toString(carrer_profile_project_id));\n\t\tvalues.add(project_name);\n\t\tvalues.add(dateFormat.format(project_start_date));\n\t\tvalues.add(dateFormat.format(project_end_date));\n\t\tvalues.add(project_organisation_associated_with);\n\t\t\n\t\tvalues.add(project_cast_associated_with);\n\t\tvalues.add(project_website_link);\n\t\tvalues.add(project_instgram_link);\n\t\tvalues.add(project_facebook_link);\n\t\tvalues.add(project_twitter_link);\n\t\tvalues.add(project_other_link);\n\t\tvalues.add(project_description);\n\t\t\n\t\t\n\t\tArrayList<String> labels=new ArrayList<String>();\n\t\tlabels.add(\"user_id\");\n\t\tlabels.add(\"carrer_profile_project_id\");\n\t\tlabels.add(\"project_name\");\n\t\tlabels.add(\"project_start_date\");\n\t\tlabels.add(\"project_end_date\");\n\t\tlabels.add(\"project_organisation_associated_with\");\n\t\t\n\t\tlabels.add(\"project_cast_associated_with\");\n\t\tlabels.add(\"project_website_link\");\n\t\tlabels.add(\"project_instgram_link\");\n\t\tlabels.add(\"project_facebook_link\");\n\t\tlabels.add(\"project_twitter_link\");\n\t\tlabels.add(\"project_other_link\");\n\t\tlabels.add(\"project_description\");\n\t\t// create carrer project profile detail image and store it \n\t\tmake_snapshot_carrer_profile(values, labels, con, user_id);\n\t\t\t\n\t}", "private void updateDB() {\n }", "int updateByPrimaryKeySelective(ProjGroup record);", "int insert(CliStaffProject record);", "@Override\n\tpublic Integer delProject(ProjectInfo project) {\n\t\treturn sqlSession.update(\"cn.sep.samp2.project.delProject\", project);\n\t}", "public AddProject() {\n try\n {\n infDB = new InfDB(\"\\\\Users\\\\Oliver\\\\Documents\\\\Skola\\\\Mini_sup\\\\Realisering\\\\MICEDB.FDB\");\n System.out.println(\"Uppkopplingen lyckades\");\n }\n catch(InfException e)\n {\n System.out.println(e.getMessage());\n }\n \n try\n {\n infDB = new InfDB(\"C:\\\\Users\\\\TP300LA-C4034\\\\Desktop\\\\Delkurs 4, Lill-supen\\\\InformatikDB\\\\MICEDB.FDB\");\n System.out.println(\"Uppkopplingen lyckades\");\n }\n catch(InfException e)\n {\n System.out.println(e.getMessage());\n }\n getPlatforms();\n initComponents();\n setLocationRelativeTo(null);\n \n }", "public boolean addTask(Project p) {\n try {\n String update = \"INSERT INTO TASKS (PROJECT_ID,HOURS_ADDED,DESCRIPTION,HOURS) VALUES(?,?,?,?) \";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(update);\n ps.setString(1, p.getProjectId());\n ps.setString(2, p.getHoursadded());\n ps.setString(3, p.getDescription());\n ps.setString(4, p.getHours());\n\n ps.executeUpdate();\n\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "@Override\r\n\tpublic int insertProject(Project p) throws MyException {\n\t\tlogger.debug(\"프로젝트 생성전no:\"+p.getProjectNo());\r\n\t\tint result=dao.insertProject(session, p);\r\n\t\tif(result==0) {\r\n\t\t\tthrow new MyException(\"프로젝트 삽입에러\");\r\n\t\t}\r\n\t\tlogger.debug(\"프로젝트 생성후no:\"+p.getProjectNo());\r\n\t\t\r\n\t\tp.setProjectNo(p.getProjectNo());\r\n\t\tresult=dao.insertProjectMember(session,p);\r\n\t\t\r\n\t\tif(result==0){\r\n\t\t\tthrow new MyException(\"프로젝트멤버 삽입에러\");\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private static void updateRecords() {\n for (Team t: Main.getTeams()){\n //If the team already exists\n if (SqlUtil.doesTeamRecordExist(c,TABLE_NAME,t.getIntValue(Team.NUMBER_KEY))){\n //Update team record\n updateTeamRecord(t);\n } else {\n //Create a new row in database\n addNewTeam(t);\n\n }\n }\n\n }", "public void deleteProjectRecord(int pgId) {\n String sql = \"DELETE FROM Project_Commit_Record WHERE pgid=?\";\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n preStmt.setInt(1, pgId);\n preStmt.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void addProject(Project p){\n this.projects.addProject(p);\n }", "public void addNewProject(final String name) {\n Project p = new Project(name);\n ApplicationWideData.addNewProject(p);\n\n Callback<Response> responseCallback = new Callback<Response>() {\n @Override\n public void success(Response response, Response response2) {\n context.refreshLists();\n }\n\n @Override\n public void failure(RetrofitError error) {\n Log.e(\"RetrofitError\", \"Actions: AddNewProject: \"+error.getMessage());\n }\n };\n\n// boolean success = LocalDataSaver.addProject(p);\n// if (success) {\n// Toast.makeText(context, \"Successful adding of new project: \" + name + \" to local database\", Toast.LENGTH_LONG).show();\n// }\n if (!ApplicationWideData.getManualSync()) {\n service.addNewProject(p, userID, responseCallback);\n }\n else{\n LocalDataSaver.addNewSelectable(p, \"Project\");\n context.refreshLists();\n }\n LocalDataSaver.saveProject(p);\n Log.wtf(\"Added project\", \"to added table\");\n\n\n Log.wtf(\"Size of added table\", LocalDataRetriver.getAllAdded().size() + \"\");\n\n }", "int updateByPrimaryKey(Depart record);", "public static void updateDetails(Project proj) {\n System.out.print(\"Whose details do you want to update (contractor / architect / client): \");\n String type = input.nextLine();\n\n System.out.print(\"\\nContact number: \");\n String contactNo = input.nextLine();\n\n System.out.print(\"\\nEmail address : \");\n String email = input.nextLine();\n\n System.out.print(\"\\nAddress: \");\n String address = input.nextLine();\n\n if (type == \"architect\") {\n proj.architect.updateDetails(contactNo, email, address);\n } else if (type == \"contractor\") {\n proj.contractor.updateDetails(contactNo, email, address);\n } else if (type == \"client\") {\n proj.client.updateDetails(contactNo, email, address);\n }\n }", "private static void add_project() {\r\n\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t//List of building types\r\n\t\t\tString[] building_types = new String[] {\"House\", \"Apartment Block\", \"Commercial Property\", \"Industrial Property\", \"Agricultural Building\"};\r\n\t\t\t\r\n\t\t\t// Variables that are needed\r\n\t\t\tint project_id = 0;\r\n\t\t\tString project_name = \"\";\r\n\t\t\tString building_type = \"\";\r\n\t\t\tString physical_address = \"\";\r\n\t\t\tint erf_num = 0;\r\n\t\t\tString cust_surname = \"\";\r\n\t\t\tDate deadline_date = null;\r\n\t\t\tint charged = 0;\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//So first we need to select the correct customer\r\n\t\t\tString strSelect = \"SELECT * FROM people WHERE type = 'Customer'\";\r\n\t\t\tResultSet rset = stmt . executeQuery ( strSelect );\r\n\t\t\t\r\n\t\t\t// Loops through available customers from the people table so that the user can select one\r\n\t\t\tSystem.out.println(\"\\nSelect a customer for the project by typing the customers number.\");\r\n\t\t\t// This creates a list of customer ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> cust_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\tSystem.out.println ( \r\n\t\t\t\t\t\t\"Customer Num: \" + rset.getInt(\"person_id\") + \", Fullname: \" + rset.getString(\"name\") + \" \" + rset.getString(\"surname\"));\r\n\t\t\t\tcust_id_list.add(rset.getInt(\"person_id\"));\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a customer\r\n\t\t\tBoolean select_cust = true;\r\n\t\t\tint customer_id = 0;\r\n\t\t\twhile (select_cust == true) {\r\n\t\t\t\tSystem.out.println(\"Customer No: \");\r\n\t\t\t\tString customer_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcustomer_id = Integer.parseInt(customer_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < cust_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (customer_id == cust_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_cust = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_cust == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available customer id.\");\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 * @exception Throws exception if the users input for customer id is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The customer number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all available building types form the building type list\r\n\t\t\tSystem.out.print(\"Select a building type by typing the number: \\n\");\r\n\t\t\tfor (int i=0; i < 5; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \": \" + building_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a building type\r\n\t\t\tBoolean select_building = true;\r\n\t\t\tint building_index = 0;\r\n\t\t\twhile (select_building == true) {\r\n\t\t\t\tSystem.out.println(\"Building type no: \");\r\n\t\t\t\tString building_type_select_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbuilding_index = Integer.parseInt(building_type_select_str) - 1;\r\n\t\t\t\t\tbuilding_type = building_types[building_index];\r\n\t\t\t\t\tselect_building = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for building type is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The building type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// User gets to decide whether they want an automatically generated name.\r\n\t\t\tBoolean select_project_name = true;\r\n\t\t\twhile (select_project_name == true) {\r\n\t\t\t\tSystem.out.println(\"Would you like to have the project automatically named (y or n)?\");\r\n\t\t\t\tString customer_project_name_choice = input.nextLine();\r\n\t\t\t\tif (customer_project_name_choice.equals(\"y\")){\r\n\t\t\t\t\t// Gets the customers surname for the project name\r\n\t\t\t\t\tString strSelectCustSurname = String.format(\"SELECT surname FROM people WHERE person_id = '%s'\", customer_id);\r\n\t\t\t\t\tResultSet cust_surname_rset = stmt . executeQuery ( strSelectCustSurname );\r\n\t\t\t\t\twhile (cust_surname_rset.next()) {\r\n\t\t\t\t\t\tcust_surname = cust_surname_rset.getString(\"surname\");\r\n\t\t\t\t\t\tproject_name = building_type + \" \" + cust_surname;\r\n\t\t\t\t\t\tSystem.out.println(\"Project name: \" + project_name);\r\n\t\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (customer_project_name_choice.equals(\"n\")) {\r\n\t\t\t\t\tSystem.out.println(\"Provide project name: \");\r\n\t\t\t\t\tproject_name = input.nextLine();\r\n\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!customer_project_name_choice.equals(\"y\") && !customer_project_name_choice.equals(\"n\")){\r\n\t\t\t\t\tSystem.out.println(\"You can only select either y or n. Please try again\");\r\n\t\t\t\t\tselect_project_name = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter an erf number\r\n\t\t\tBoolean select_erf_num = true;\r\n\t\t\twhile (select_erf_num == true) {\r\n\t\t\t\tSystem.out.print(\"ERF number: \");\r\n\t\t\t\tString erf_num_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\terf_num = Integer.parseInt(erf_num_str);\r\n\t\t\t\t\tselect_erf_num = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for erf number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The erf number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a physical address\r\n\t\t\tSystem.out.print(\"Physical Address: \");\r\n\t\t\tphysical_address = input.nextLine();\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a date\r\n\t\t\tBoolean select_deadline_date = true;\r\n\t\t\twhile (select_deadline_date == true) {\r\n\t\t\t\tSystem.out.print(\"Deadline Date (YYYY-MM-DD): \");\r\n\t\t\t\tString deadline_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdeadline_date= Date.valueOf(deadline_date_str);\r\n\t\t\t\t\tselect_deadline_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for deadline date is not in the correct format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter a charged amount \r\n\t\t\tBoolean select_charged = true;\r\n\t\t\twhile (select_charged == true) {\r\n\t\t\t\tSystem.out.print(\"Total Cost: R \");\r\n\t\t\t\tString charged_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcharged = Integer.parseInt(charged_str);\r\n\t\t\t\t\tselect_charged = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the charged amount is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The charged amount cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the projects table\r\n PreparedStatement ps = conn.prepareStatement(\"INSERT INTO projects (project_name , building_type, physical_address, erf_num) VALUES(?,?,?,?)\");\r\n ps.setString(1, project_name);\r\n ps.setString(2, building_type);\r\n ps.setString(3, physical_address);\r\n ps.setInt(4, erf_num);\r\n \r\n // Executes the statement\r\n ps.executeUpdate();\r\n \r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects WHERE project_name = '%s'\", project_name);\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tproject_id = project_rset.getInt(\"project_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the people table\r\n\t\t\tPreparedStatement ps_customer = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\tps_customer.setInt(1, project_id);\r\n\t\t\tps_customer.setInt(2, customer_id);\r\n\t\t\tps_customer.executeUpdate();\r\n \r\n\t\t\t// This adds all the values to a prepared statement to update the project_statuses table\r\n PreparedStatement ps_status = conn.prepareStatement(\"INSERT INTO project_statuses (charged , deadline_date, project_id) VALUES(?,?,?)\");\r\n ps_status.setInt(1, charged);\r\n ps_status.setDate(2, deadline_date);\r\n ps_status.setInt(3, project_id);\r\n ps_status.executeUpdate();\r\n\r\n // Once everything has been added to the tables the project that has been added gets printed out\r\n\t\t\tResultSet project_added_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_added_rset.next()){\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"\\nProjects Added: \\n\" +\r\n\t\t\t\t\t\t\"Project Sys ID: \" + project_added_rset.getInt(\"project_id\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Project Name: \" + project_added_rset.getString(\"project_name\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Building Type: \" + project_added_rset.getString(\"building_type\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Physical Address: \" + project_added_rset.getString(\"physical_address\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Erf Number: \" + project_added_rset.getInt(\"erf_num\") + \"\\n\");\r\n\t\t\t}\r\n\t\t/**\r\n\t\t * @exception If any of the table entries cannot be created due to database constrains then the SQLException is thrown\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "Update withLabPlanId(String labPlanId);", "@TransactionAttribute(TransactionAttributeType.REQUIRED)\r\n\tpublic void hechoFase(long idProject) throws ConectelException {\r\n\t\tProyectoDO project = entityManager.find(ProyectoDO.class, idProject);\r\n\t\tif (project == null) {\r\n\t\t\tthrow new ConectelException(\"El proyecto no existe\");\r\n\t\t}\r\n\t\tEstadoDO estado = new EstadoDO(EstadoProyecto.DATOS_GRLS.getId());\r\n\t\tproject.setEstado(estado);\r\n\t\tentityManager.merge(project);\r\n\t}", "private void changeProject(IProject newProject) {\n mProject = newProject;\n\n // enable types based on new API level\n enableTypesBasedOnApi();\n\n // update the folder name based on API level\n resetFolderPath(false /*validate*/);\n\n // update the Type with the new descriptors.\n initializeRootValues();\n\n // update the combo\n updateRootCombo(getSelectedType());\n\n validatePage();\n }", "int insert(ProjGroup record);", "public void setProject(org.eclipse.core.resources.IProject newProject) {\n \t\tproject = newProject;\n \t}", "int updateByPrimaryKey(ProEmployee record);", "private void setActiveValue(int projectId, String value) {\n\t\tConnection conn = getConnection();\n\t\tPreparedStatement stmtUpdate = null;\n\t\ttry {\n\t\t\tStringBuilder sbUpdate = new StringBuilder(UPDATE)\n\t\t\t\t.append(projectTableName)\n\t\t\t\t.append(SET)\n\t\t\t\t.append(projectActiveColumnName).append(EQUAL).append(value) //$NON-NLS-1$\n\t\t\t\t.append(WHERE)\n\t\t\t\t.append(projectIdColumnName).append(EQUAL).append(projectId); //$NON-NLS-1$\n\n\t\t\tstmtUpdate = conn.prepareStatement(sbUpdate.toString());\n\t\t\tstmtUpdate.executeUpdate();\n\t\t\t\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new DAOException(ex);\n\t\t\t\n\t\t} finally {\n\t\t\tDbUtils.closeQuietly(conn);\n\t\t\tDbUtils.closeQuietly(stmtUpdate);\n\t\t}\n\t\t\n\t}", "public void setProject(Project project){\n\t\tthis.project = project;\n\t\tif (project!=null){\n\t\t\tfor (final Iterator it = project.getRoot().getProgresses ().iterator ();it.hasNext ();){\n\t\t\t\tnew com.ost.timekeeper.actions.commands.DeleteProgress ((Progress)it.next ()).execute ();\n\t\t\t}\n\t\t}\n\t\tif (project!=null){\n\t\t\tthis.setSelectedItem (project.getRoot());\n\t\t} else {\n\t\t\tthis.setSelectedItem (null);\n\t\t}\n\t\t//notifica cambiamento di progetto\n\t\tsynchronized (this){\n\t\t\tthis.setChanged();\n\t\t\tthis.notifyObservers(ObserverCodes.PROJECTCHANGE);\n\t\t}\n\t}", "int updateByPrimaryKey(SysOrganization record);", "int insert(ProjectOtherView record);", "@Override\n public void update(Person p) throws SQLException, ClassNotFoundException\n {\n\n BasicDBObject query = new BasicDBObject();\n query.put(\"Id\", p.getId()); // old data, find key Id\n\n BasicDBObject newDocument = new BasicDBObject();\n\n// newDocument.put(\"Id\", p.getId()); // new data\n newDocument.put(\"FName\", p.getFName()); // new data\n newDocument.put(\"LName\", p.getLName()); // new data\n newDocument.put(\"Age\", p.getAge()); // new data\n System.out.println(newDocument);\n\n BasicDBObject updateObj = new BasicDBObject();\n updateObj.put(\"$set\", newDocument);\n System.out.println(updateObj);\n\n table.update(query, updateObj);\n }", "int updateByPrimaryKey(Organization record);", "@Override\n\t@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)\n\tpublic void saveDevPlan(Map<String, Object> map) throws AppException, IllegalAccessException, InvocationTargetException {\n\t\tString optFlag = map.get(\"optFlag\")==null?\"\":map.get(\"optFlag\").toString();\n\t\tString projectid = map.get(\"projectid\")==null?\"\":map.get(\"projectid\").toString();\n\t\tString deveid = map.get(\"deveid\")==null?\"\":map.get(\"deveid\").toString();\n\t\tProDevelop dev = new ProDevelop();\n\t\tBeanUtils.populate(dev, map);\n\t\tSysUser user = SecureUtil.getCurrentUser();\n\t\tif(\"add\".equals(optFlag)){\n\t\t\tdev.setCreateuser(user.getUserid().toString());\n\t\t\tdev.setCreatetime(DateUtil.getCurrentDate(\"yyyy-MM-dd HH:mm:ss\"));\n\t\t\tproDevelopDao.save(dev);\n\t\t}else if(\"edit\".equals(optFlag)){\n\t\t\tif(\"\".equals(deveid)){\n\t\t\t\tthrow new AppException(\"信息主键没找到!\");\n\t\t\t}\n\t\t\tdev.setUpdateuser(user.getUserid().toString());\n\t\t\tdev.setUpdatetime(DateUtil.getCurrentDate(\"yyyy-MM-dd HH:mm:ss\"));\n\t\t\tproDevelopDao.update(dev);\n\t\t}\n\t\t//add by 辛鹏 2016年3月22日19:45:26\n\t\t//增加修改项目环节\n\t\tString sql = \"update PRO_PROJECT set xmdqhj ='2' where projectid=\"+projectid;\n\t\tproDevelopDao.updateBySql(sql);\n\t}", "int updateByPrimaryKey(CrmDept record);", "public void update(ProjectPk pk, Project dto) throws ProjectDaoException {\n\t\tlong t1 = System.currentTimeMillis();\n\t\t// declare variables\n\t\tfinal boolean isConnSupplied = (userConn != null);\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry{\n\t\t\t// get the user-specified connection or get a connection from the\n\t\t\t// ResourceManager\n\t\t\tconn = isConnSupplied ? userConn : ResourceManager.getConnection();\n\t\t\tif (logger.isDebugEnabled()){\n\t\t\t\tlogger.debug(\"Executing \" + SQL_UPDATE + \" with DTO: \" + dto);\n\t\t\t}\n\n\t\t\tstmt = conn.prepareStatement(SQL_UPDATE);\n\t\t\tint index = 1;\n\t\t\tstmt.setInt(index++, dto.getId());\n\t\t\tstmt.setInt(index++, dto.getOwnerId());\n\t\t\tstmt.setInt(index++, dto.getCreatorId());\n\t\t\tstmt.setString(index++, dto.getName());\n\t\t\tstmt.setString(index++, dto.getDescription());\n\t\t\tif (dto.isCompanyIdNull()){\n\t\t\t\tstmt.setNull(index++, java.sql.Types.INTEGER);\n\t\t\t} else{\n\t\t\t\tstmt.setInt(index++, dto.getCompanyId());\n\t\t\t}\n\n\t\t\tstmt.setString(index++, dto.getBillAddress());\n\t\t\tstmt.setString(index++, dto.getBillCity());\n\t\t\tif (dto.isBillZipCodeNull()){\n\t\t\t\tstmt.setNull(index++, java.sql.Types.INTEGER);\n\t\t\t} else{\n\t\t\t\tstmt.setInt(index++, dto.getBillZipCode());\n\t\t\t}\n\n\t\t\tstmt.setString(index++, dto.getBillState());\n\t\t\tstmt.setString(index++, dto.getBillCountry());\n\t\t\tstmt.setString(index++, dto.getBillTelNum());\n\t\t\tstmt.setString(index++, dto.getBillFaxNum());\n\t\t\tstmt.setString(index++, dto.getIsEnable());\n\t\t\tstmt.setString(index++, dto.getMessageBody());\n\t\t\tstmt.setInt(index++, dto.getEsrqmId());\n\t\t\tstmt.setTimestamp(index++, dto.getCreateDate() == null ? null : new java.sql.Timestamp(dto.getCreateDate().getTime()));\n\t\t\tstmt.setInt(index++, dto.getLastModifiedBy());\n\t\t\tstmt.setTimestamp(index++, dto.getLastModifiedOn() == null ? null : new java.sql.Timestamp(dto.getLastModifiedOn().getTime()));\n\t\t\tstmt.setInt(20, pk.getId());\n\t\t\tint rows = stmt.executeUpdate();\n\t\t\treset(dto);\n\t\t\tlong t2 = System.currentTimeMillis();\n\t\t\tif (logger.isDebugEnabled()){\n\t\t\t\tlogger.debug(rows + \" rows affected (\" + (t2 - t1) + \" ms)\");\n\t\t\t}\n\t\t} catch (Exception _e){\n\t\t\tlogger.error(\"Exception: \" + _e.getMessage(), _e);\n\t\t\tthrow new ProjectDaoException(\"Exception: \" + _e.getMessage(), _e);\n\t\t} finally{\n\t\t\tResourceManager.close(stmt);\n\t\t\tif (!isConnSupplied){\n\t\t\t\tResourceManager.close(conn);\n\t\t\t}\n\n\t\t}\n\n\t}", "private boolean createProject() {\r\n ProjectOverviewerApplication app = (ProjectOverviewerApplication)getApplication();\r\n Projects projects = app.getProjects();\r\n String userHome = System.getProperty(\"user.home\");\r\n // master file for projects management\r\n File projectsFile = new File(userHome + \"/.hackystat/projectoverviewer/projects.xml\");\r\n \r\n // create new project and add it to the projects\r\n Project project = new Project();\r\n project.setProjectName(this.projectName);\r\n project.setOwner(this.ownerName);\r\n project.setPassword(this.password);\r\n project.setSvnUrl(this.svnUrl);\r\n for (Project existingProject : projects.getProject()) {\r\n if (existingProject.getProjectName().equalsIgnoreCase(this.projectName)) {\r\n return false;\r\n }\r\n }\r\n projects.getProject().add(project);\r\n \r\n try {\r\n // create the specific tm3 file and xml file for the new project\r\n File tm3File = new File(userHome + \r\n \"/.hackystat/projectoverviewer/\" + this.projectName + \".tm3\");\r\n File xmlFile = new File(userHome + \r\n \"/.hackystat/projectoverviewer/\" + this.projectName + \".xml\");\r\n tm3File.createNewFile();\r\n \r\n // initialize the data for the file\r\n SensorDataCollector collector = new SensorDataCollector(app.getSensorBaseHost(), \r\n this.ownerName, \r\n this.password);\r\n collector.getRepository(this.svnUrl, this.projectName);\r\n collector.write(tm3File, xmlFile);\r\n } \r\n catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n // write the projects.xml file with the new project added\r\n String packageName = \"org.hackystat.iw.projectoverviewer.jaxb.projects\";\r\n return XmlConverter.objectToXml(projects, projectsFile, packageName);\r\n }", "public Project updateProject(String projectName, String directoryPath) {\n Project project = databaseService.getProjectByName(projectName);\n\n TrainingSetBuilder trainingSetBuilder = new TrainingSetBuilder(directoryPath);\n trainingSetBuilder.createFile(project);\n\n issueParser.updateRepoData(directoryPath, project);\n pullRequestParser.updateRepoData(directoryPath, project);\n commitParser.updateCommits(directoryPath, project);\n\n DefectPrediction defectPrediction = databaseService.getDefectPredictionByName(projectName);\n defectPrediction.evaluateClassifierAndPredict(directoryPath + \"/training.arff\", directoryPath + \"/test.arff\");\n project.setDefectPrediction(defectPrediction);\n databaseService.saveDefectPrediction(defectPrediction);\n\n project.setDefectPrediction(defectPrediction);\n databaseService.saveProject(project);\n return project;\n }", "public boolean deleteProject(Project p) {\n try {\n String delete = \"DELETE FROM PROJECTS WHERE PROJECT_ID = ?\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(delete);\n ps.setString(1, p.getProjectId());\n\n ps.executeUpdate();\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }" ]
[ "0.6827991", "0.67728955", "0.67121977", "0.66661334", "0.65613735", "0.6371116", "0.6347543", "0.6300231", "0.62786835", "0.62537575", "0.62527543", "0.6237874", "0.6235085", "0.62149024", "0.62126577", "0.617421", "0.61449784", "0.61319584", "0.608711", "0.6077716", "0.6068065", "0.6067585", "0.6059897", "0.6059337", "0.5974091", "0.5947244", "0.5931472", "0.5921203", "0.58867246", "0.5882502", "0.5846501", "0.5837707", "0.5837707", "0.58301216", "0.58221614", "0.57797736", "0.57556987", "0.5731962", "0.57305527", "0.5715902", "0.5712818", "0.56691855", "0.5668394", "0.56663173", "0.5662251", "0.5626789", "0.562417", "0.5614658", "0.5606572", "0.5606121", "0.5586561", "0.5585646", "0.5572311", "0.5568699", "0.55638325", "0.55502284", "0.5547522", "0.5536646", "0.5531502", "0.55108416", "0.54936016", "0.548502", "0.54769546", "0.547639", "0.5470942", "0.5469859", "0.54659575", "0.54612476", "0.5460215", "0.545489", "0.5442326", "0.5431021", "0.5412233", "0.54115754", "0.5397685", "0.537353", "0.53542304", "0.535351", "0.5346717", "0.53398305", "0.533829", "0.53352404", "0.5335072", "0.53302604", "0.5315532", "0.5309993", "0.5299585", "0.52971804", "0.5289425", "0.5283274", "0.5279728", "0.52792823", "0.52779883", "0.52772665", "0.52725506", "0.52672535", "0.5265103", "0.5261824", "0.52594864", "0.5258381" ]
0.5514552
59
Produce HTML for this PO, populated by the project information that the user wants to edit
public String showPage(String errorMsg) throws HttpPresentationException, webschedulePresentationException { String proj_name = this.getComms().request.getParameter(PROJ_NAME); String personID = this.getComms().request.getParameter(PERSONID); String discrib = this.getComms().request.getParameter(DISCRIB); String indexnum = this.getComms().request.getParameter(INDEXNUM); String thours = this.getComms().request.getParameter(THOURS); // String dhours = this.getComms().request.getParameter(DHOURS); // String projectID = this.getComms().request.getParameter(PROJ_ID); String password = this.getComms().request.getParameter(PASSWORD); String codeofpay = this.getComms().request.getParameter(CODEOFPAY); String contactname = this.getComms().request.getParameter(CONTACTNAME); String contactphone = this.getComms().request.getParameter(CONTACTPHONE); String contactemail = this.getComms().request.getParameter(CONTACTEMAIL); String billaddr1 = this.getComms().request.getParameter(BILLADDR1); String billaddr2 = this.getComms().request.getParameter(BILLADDR2); String billaddr3 = this.getComms().request.getParameter(BILLADDR3); String city = this.getComms().request.getParameter(CITY); String state = this.getComms().request.getParameter(STATE); String zip = this.getComms().request.getParameter(ZIP); // String accountid = this.getComms().request.getParameter(ACCOUNTID); // String outside = this.getComms().request.getParameter(OUTSIDE); // String exp = this.getComms().request.getParameter(EXP); String expday = this.getComms().request.getParameter(EXPDAY); String expmonth = this.getComms().request.getParameter(EXPMONTH); String expyear = this.getComms().request.getParameter(EXPYEAR); String notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT); // String iexpday = this.getComms().request.getParameter(IEXPDAY); // String iexpmonth = this.getComms().request.getParameter(IEXPMONTH); //String iexpyear = this.getComms().request.getParameter(IEXPYEAR); String modby= this.getComms().request.getParameter(MODBY); String moddate= this.getComms().request.getParameter(MODDATE); String notes= this.getComms().request.getParameter(NOTES); String irbnum = this.getComms().request.getParameter(IRBNUM); // Instantiate the page object ucsdprojectseditHTML page = new ucsdprojectseditHTML(); HTMLSelectElement expday_select, expmonth_select, expyear_select; HTMLCollection expday_selectCollection, expmonth_selectCollection, expyear_selectCollection; HTMLOptionElement expday_option, expmonth_option, expyear_option; String expday_optionName, expmonth_optionName, expyear_optionName; expday_select = (HTMLSelectElement)page.getElementExpday(); expday_selectCollection = expday_select.getOptions(); expmonth_select = (HTMLSelectElement)page.getElementExpmonth(); expmonth_selectCollection = expmonth_select.getOptions(); expyear_select = (HTMLSelectElement)page.getElementExpyear(); expyear_selectCollection = expyear_select.getOptions(); HTMLSelectElement iexpday_select, iexpmonth_select, iexpyear_select; HTMLCollection iexpday_selectCollection, iexpmonth_selectCollection, iexpyear_selectCollection; HTMLOptionElement iexpday_option, iexpmonth_option, iexpyear_option; String iexpday_optionName, iexpmonth_optionName, iexpyear_optionName; iexpday_select = (HTMLSelectElement)page.getElementIexpday(); iexpday_selectCollection = iexpday_select.getOptions(); iexpmonth_select = (HTMLSelectElement)page.getElementIexpmonth(); iexpmonth_selectCollection = iexpmonth_select.getOptions(); iexpyear_select = (HTMLSelectElement)page.getElementIexpyear(); iexpyear_selectCollection = iexpyear_select.getOptions(); Project theProject = null; String userID = null; String proj_describ, firstname, lastname, piname, user_email, proj_notes; int expdayi, expmonthi, expyeari; double dhours; Date iacucdate = new Date(); java.sql.Date moddated ; String projectID = this.getProjectID(); System.out.println("project Id at show edit page "+projectID); try { theProject = ProjectFactory.findProjectByID(projectID); // userID = project.getUserID(); // proj_name = theProject.getProj_name(); proj_describ = theProject.getDescription(); firstname = theProject.getUserFirstName(); lastname = theProject.getUserLastName(); user_email = theProject.getUserEmail(); piname = firstname+" "+lastname; //cname = theProject.getCname(); //cphone = theProject.getCphone(); //cemail = theProject.getCemail(); // indexnum = theProject.getIndexnum(); // Baline1 = theProject.getBilladdr1(); // Baline2 = theProject.getBilladdr2(); // Baline3 = theProject.getBilladdr3(); // Bacity = theProject.getCity(); // Bast = theProject.getState(); // Bazip = theProject.getZip(); expdayi = theProject.getExpday(); expmonthi = theProject.getExpmonth(); expyeari = theProject.getExpyear(); // fpname = theProject.getContactname(); // fpphone = theProject.getContactphone(); moddated = theProject.getModDate(); // thours = theProject.getTotalhours(); dhours = theProject.getDonehours(); iacucdate = theProject.getIACUCDate(); proj_notes = theProject.getNotes(); /* // Catch any possible database exception in findProjectByID() } catch(webscheduleBusinessException ex) { this.getSessionData().setUserMessage("Please choose a valid project to edit"); throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE); } */ int iexpyeari = iacucdate.getYear(); iexpyeari = iexpyeari + 1900; int iexpmonthi = iacucdate.getMonth(); //add one iexpmonthi = iexpmonthi+1; int iexpdatei = iacucdate.getDate(); String iexpyears = Integer.toString(iexpyeari); String iexpmonths = Integer.toString(iexpmonthi); String iexpdates = Integer.toString(iexpdatei); String expyears = Integer.toString(expyeari); String expmonths = Integer.toString(expmonthi); String expdays = Integer.toString(expdayi); // try { // If we received a valid projectID then try to show the project's contents, // otherwise try to use the HTML input parameters //page.getElementProjID().setValue(project.getHandle()); page.setTextPiname(piname); page.setTextEmail(user_email); if(null != proj_name && proj_name.length() != 0) { page.getElementProj_name().setValue(proj_name); } else { page.getElementProj_name().setValue(theProject.getProj_name()); } if(null != discrib && discrib.length() != 0) { page.getElementDiscrib().setValue(discrib); } else { page.getElementDiscrib().setValue(proj_describ); } if(null != indexnum && indexnum.length() != 0) { page.getElementIndexnum().setValue(indexnum); } else { page.getElementIndexnum().setValue(theProject.getIndexnum()); } if(null != thours && thours.length() != 0) { page.getElementThours().setValue(thours); } else { page.getElementThours().setValue(Double.toString(theProject.getTotalhours())); } page.setTextDhour(Double.toString(theProject.getDonehours())); /* if(null != dhours && dhours.length() != 0) { page.getElementDhours().setValue(dhours); } else { page.getElementDhours().setValue(Double.toString(project.getDonehours())); }*/ if(null != codeofpay && codeofpay.length() != 0) { page.getElementCodeofpay().setValue(codeofpay); } else { page.getElementCodeofpay().setValue(Integer.toString(theProject.getCodeofpay())); } if(null != contactname && contactname.length() != 0) { page.getElementContactname().setValue(contactname); } else { page.getElementContactname().setValue(theProject.getContactname()); } if(null != contactphone && contactphone.length() != 0) { page.getElementContactphone().setValue(contactphone); } else { page.getElementContactphone().setValue(theProject.getContactphone()); } if(null != contactemail && contactemail.length() != 0) { page.getElementContactemail().setValue(contactemail); } else { page.getElementContactemail().setValue(theProject.getFpemail()); } if(null != billaddr1 && billaddr1.length() != 0) { page.getElementBilladdr1().setValue(billaddr1); } else { page.getElementBilladdr1().setValue(theProject.getBilladdr1()); } /* if(null != billaddr2 && billaddr2.length() != 0) { page.getElementBilladdr2().setValue(billaddr2); } else { page.getElementBilladdr2().setValue(theProject.getBilladdr2()); } */ if(null != billaddr3 && billaddr3.length() != 0) { page.getElementBilladdr3().setValue(billaddr3); } else { page.getElementBilladdr3().setValue(theProject.getBilladdr3()); } if(null != city && city.length() != 0) { page.getElementCity().setValue(city); } else { page.getElementCity().setValue(theProject.getCity()); } if(null != state && state.length() != 0) { page.getElementState().setValue(state); } else { page.getElementState().setValue(theProject.getState()); } if(null != zip && zip.length() != 0) { page.getElementZip().setValue(zip); } else { page.getElementZip().setValue(theProject.getZip()); } /* if(null != this.getComms().request.getParameter(EXP)) { page.getElementExpBox().setChecked(true); } else { page.getElementExpBox().setChecked(project.isExp()); } */ if(null != expday && expday.length() != 0) { page.getElementExpday().setValue(expday); } else { page.getElementExpday().setValue(Integer.toString(theProject.getExpday())); } if(null != expmonth && expmonth.length() != 0) { page.getElementExpmonth().setValue(expmonth); } else { page.getElementExpmonth().setValue(Integer.toString(theProject.getExpmonth())); } if(null != expyear && expyear.length() != 0) { page.getElementExpyear().setValue(expyear); } else { page.getElementExpyear().setValue(Integer.toString(theProject.getExpyear())); } if(null != notifycontact && notifycontact.length() != 0) { page.getElementNotifycontact().setValue(notifycontact); } else { page.getElementNotifycontact().setValue(theProject.getNotifycontact()); } if(null != notes && notes.length() != 0) { Node notesText = page.getElementNotes().getOwnerDocument().createTextNode(notes); page.getElementNotes().appendChild(notesText); } else { Node notesText = page.getElementNotes().getOwnerDocument().createTextNode(theProject.getNotes()); page.getElementNotes().appendChild(notesText); } System.out.println(" *** Notes of UCSD project Edit *** "+notes); if (expyeari > 2000) { int expday_optionlen = expday_selectCollection.getLength(); for (int i=0; i< expday_optionlen; i++) { expday_option = (HTMLOptionElement)expday_selectCollection.item(i); expday_optionName = expday_option.getValue(); if (expday_optionName.equals(expdays)) expday_option.setSelected(true); else expday_option.setSelected(false); } int expmonth_optionlen = expmonth_selectCollection.getLength(); for (int i=0; i< expmonth_optionlen; i++) { expmonth_option = (HTMLOptionElement)expmonth_selectCollection.item(i); expmonth_optionName = expmonth_option.getValue(); if (expmonth_optionName.equals(expmonths)) expmonth_option.setSelected(true); else expmonth_option.setSelected(false); } int expyear_optionlen = expyear_selectCollection.getLength(); for (int i=0; i< expyear_optionlen; i++) { expyear_option = (HTMLOptionElement)expyear_selectCollection.item(i); expyear_optionName = expyear_option.getValue(); if (expyear_optionName.equals(expyears)) expyear_option.setSelected(true); else expyear_option.setSelected(false); } } if (iexpyeari > 2000) { int iexpday_optionlen = iexpday_selectCollection.getLength(); for (int i=0; i< iexpday_optionlen; i++) { iexpday_option = (HTMLOptionElement)iexpday_selectCollection.item(i); iexpday_optionName = iexpday_option.getValue(); if (iexpday_optionName.equals(iexpdates)) iexpday_option.setSelected(true); else iexpday_option.setSelected(false); } int iexpmonth_optionlen = iexpmonth_selectCollection.getLength(); for (int i=0; i< iexpmonth_optionlen; i++) { iexpmonth_option = (HTMLOptionElement)iexpmonth_selectCollection.item(i); iexpmonth_optionName = iexpmonth_option.getValue(); if (iexpmonth_optionName.equals(iexpmonths)) iexpmonth_option.setSelected(true); else iexpmonth_option.setSelected(false); } int iexpyear_optionlen = iexpyear_selectCollection.getLength(); for (int i=0; i< iexpyear_optionlen; i++) { iexpyear_option = (HTMLOptionElement)iexpyear_selectCollection.item(i); iexpyear_optionName = iexpyear_option.getValue(); if (iexpyear_optionName.equals(iexpyears)) iexpyear_option.setSelected(true); else iexpyear_option.setSelected(false); } } if(null != irbnum && irbnum.length() != 0) { page.getElementIrbnum().setValue(irbnum); } else { page.getElementIrbnum().setValue(theProject.getIRBnum()); } page.setTextModdate(moddated.toString()); page.setTextModby(theProject.getModifiedby()); if(null == errorMsg) { page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText()); } else { page.setTextErrorText(errorMsg); } } catch(webscheduleBusinessException ex) { throw new webschedulePresentationException("Error populating page for project editing", ex); } // page.getElementEventValue().setValue(EDIT_COMMAND); return page.toDocument(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n \n Project project = null;\n\n \n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(this.getProjectID());\n\t \n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n } catch(Exception ex) {\n return showPage(\"You must fill out all fields to edit this project\");\n } \n }", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n String projID = this.getComms().request.getParameter(PROJ_ID);\n Project project = null;\n\n System.out.println(\" trying to edit a project \"+ projID);\n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(projID);\n\t System.out.println(\" trying to edit a project 2\"+ projID);\n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n } catch(Exception ex) {\n return showEditPage(\"You must fill out all fields to edit this project\");\n } \n }", "public String showEditPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n String contactname = this.getComms().request.getParameter(CONTACTNAME);\n String contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n String billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n String billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n String billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n String city = this.getComms().request.getParameter(CITY);\n String state = this.getComms().request.getParameter(STATE);\n String zip = this.getComms().request.getParameter(ZIP);\n String accountid = this.getComms().request.getParameter(ACCOUNTID);\n String outside = this.getComms().request.getParameter(OUTSIDE);\n String exp = this.getComms().request.getParameter(EXP);\n String expday = this.getComms().request.getParameter(EXPDAY);\n String expmonth = this.getComms().request.getParameter(EXPMONTH);\n String expyear = this.getComms().request.getParameter(EXPYEAR);\n String notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\t\n\t // Instantiate the page object\n\t EditHTML page = new EditHTML();\n Project project = null;\n\tString userID = null;\n\n System.out.println(\"project Id at show edit page \"+projectID);\n try {\n project = ProjectFactory.findProjectByID(projectID);\n\t userID = project.getUserID();\n // Catch any possible database exception in findProjectByID()\n } catch(webscheduleBusinessException ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid project to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n try {\n // If we received a valid projectID then try to show the project's contents,\n // otherwise try to use the HTML input parameters\n page.getElementProjID().setValue(project.getHandle());\n\n if(null != proj_name && proj_name.length() != 0) {\n page.getElementProj_name().setValue(proj_name);\n } else {\n page.getElementProj_name().setValue(project.getProj_name());\n }\n\n HTMLOptionElement templateOption = page.getElementTemplateOption();\n Node PersonSelect = templateOption.getParentNode();\n templateOption.removeAttribute(\"id\");\n templateOption.removeChild(templateOption.getFirstChild());\n\n\n try {\n \tPerson[] PersonList = PersonFactory.getPersonsList();\n \tfor (int numPersons = 0; numPersons < PersonList.length; numPersons++) {\n \t Person currentPerson = PersonList[numPersons] ;\n \t HTMLOptionElement clonedOption = (HTMLOptionElement) templateOption.cloneNode(true);\n clonedOption.setValue(currentPerson.getHandle());\n Node optionTextNode = clonedOption.getOwnerDocument().\n createTextNode(currentPerson.getFirstname() + \" \" +\n currentPerson.getLastname());\n\t\t\tif ((currentPerson.getHandle()).equals(userID))\n\t\t\t clonedOption.setSelected(true);\n\t\t\t else \n\t\t\t clonedOption.setSelected(false);\t\t\n\t\t\t \n clonedOption.appendChild(optionTextNode);\n // Do only a shallow copy of the option as we don't want the text child\n // of the node option\n PersonSelect.appendChild(clonedOption);\n // Alternative way to insert nodes below\n // insertBefore(newNode, oldNode);\n // ProjSelect.insertBefore(clonedOption, templateOption);\n\t }\n\t } catch(Exception ex) {\n\t this.writeDebugMsg(\"Error populating Persons List: \" + ex);\n throw new webschedulePresentationException(\"Error getting Persons List: \", ex);\n\t }\n\t\n templateOption.getParentNode().removeChild(templateOption);\n\n /* if (personID.equals(INVALID_ID)){\n \tpage.getElementPersonList().setValue(project.getUserID());\n \t\n }else {\n \tpage.getElementPersonList().setValue(personID);\n }\t\t*/\n\n if(null != password && password.length() != 0) {\n page.getElementPassword().setValue(password);\n } else {\n page.getElementPassword().setValue(project.getPassword());\n }\n\n if(null != discrib && discrib.length() != 0) {\n page.getElementDiscrib().setValue(discrib);\n } else {\n page.getElementDiscrib().setValue(project.getDescription());\n }\n \n if(null != indexnum && indexnum.length() != 0) {\n page.getElementIndexnum().setValue(indexnum);\n } else {\n page.getElementIndexnum().setValue(project.getIndexnum());\n }\n\n if(null != thours && thours.length() != 0) {\n page.getElementThours().setValue(thours);\n } else {\n page.getElementThours().setValue(Double.toString(project.getTotalhours()));\n }\n\n if(null != dhours && dhours.length() != 0) {\n page.getElementDhours().setValue(dhours);\n } else {\n page.getElementDhours().setValue(Double.toString(project.getDonehours()));\n }\n if(null != codeofpay && codeofpay.length() != 0) {\n page.getElementCodeofpay().setValue(codeofpay);\n } else {\n page.getElementCodeofpay().setValue(Integer.toString(project.getCodeofpay()));\n }\n\n \n\t\n\t if(null != contactname && contactname.length() != 0) {\n page.getElementContactname().setValue(contactname);\n } else {\n page.getElementContactname().setValue(project.getContactname());\n }\n\n\t if(null != billaddr1 && billaddr1.length() != 0) {\n page.getElementBilladdr1().setValue(billaddr1);\n } else {\n page.getElementBilladdr1().setValue(project.getBilladdr1());\n }\n\n\n\t if(null != billaddr2 && billaddr2.length() != 0) {\n page.getElementBilladdr2().setValue(billaddr2);\n } else {\n page.getElementBilladdr2().setValue(project.getBilladdr2());\n }\n\n\t\n\t if(null != billaddr3 && billaddr3.length() != 0) {\n page.getElementBilladdr3().setValue(billaddr3);\n } else {\n page.getElementBilladdr3().setValue(project.getBilladdr3());\n }\n\n\n if(null != city && city.length() != 0) {\n page.getElementCity().setValue(city);\n } else {\n page.getElementCity().setValue(project.getCity());\n }\n\n\t if(null != state && state.length() != 0) {\n page.getElementState().setValue(state);\n } else {\n page.getElementState().setValue(project.getState());\n }\n\n if(null != zip && zip.length() != 0) {\n page.getElementZip().setValue(zip);\n } else {\n page.getElementZip().setValue(project.getZip());\n }\n\nif(null != accountid && accountid.length() != 0) {\n page.getElementAccountid().setValue(accountid);\n } else {\n page.getElementAccountid().setValue(project.getAccountid());\n }\n\n\t\n\tif(null != this.getComms().request.getParameter(OUTSIDE)) {\n page.getElementOutsideBox().setChecked(true);\n } else {\n page.getElementOutsideBox().setChecked(project.isOutside());\n }\n\t\n\t\n\tif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(project.isExp());\n }\n\n if(null != expday && expday.length() != 0) {\n page.getElementExpday().setValue(expday);\n } else {\n page.getElementExpday().setValue(Integer.toString(project.getExpday()));\n }\n \n\n\nif(null != expmonth && expmonth.length() != 0) {\n page.getElementExpmonth().setValue(expmonth);\n } else {\n page.getElementExpmonth().setValue(Integer.toString(project.getExpmonth()));\n }\n \nif(null != expyear && expyear.length() != 0) {\n page.getElementExpyear().setValue(expyear);\n } else {\n page.getElementExpyear().setValue(Integer.toString(project.getExpyear())); \t \n}\n\n\n\t if(null != notifycontact && notifycontact.length() != 0) {\n page.getElementNotifycontact().setValue(notifycontact);\n } else {\n page.getElementNotifycontact().setValue(project.getNotifycontact());\n }\n\n\n\n if(null == errorMsg) {\n\n page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n\t } else {\n page.setTextErrorText(errorMsg);\n }\n } catch(webscheduleBusinessException ex) {\n throw new webschedulePresentationException(\"Error populating page for project editing\", ex);\n }\n \n page.getElementEventValue().setValue(EDIT_COMMAND);\n\t return page.toDocument();\n }", "public String getHTMLPage() {\r\n String s = \"<html><body>\" + MySystem.lineBreak;\r\n s += \"<h1>Room Control module</h1>\" + MySystem.lineBreak;\r\n s += \"<p>This module controls any on/off-node connected to ARNE bus.</p>\" + MySystem.lineBreak;\r\n s += \"<h2>Controls:</h2>\";\r\n s += \"<center><p><table border=\\\"1\\\" cellpadding=\\\"3\\\" cellspacing=\\\"0\\\">\";\r\n Iterator it = roomObjects.keySet().iterator();\r\n while (it.hasNext()) {\r\n GenRoomObject o = (GenRoomObject)roomObjects.get(it.next());\r\n if (o!=null) {\r\n if (o.displHTML) { //if display this object (configured in modGenRoomControl.xml)\r\n s += \"<tr><td>\" + o.name + \"</td><td>[<a href=\\\"toggle:\" + o.name + \"\\\">toggle</a>]</td><td>[<a href=\\\"on:\" + o.name + \"\\\">ON</a>]</td><td>[<a href=\\\"off:\" + o.name + \"\\\">OFF</a>]</td></tr></tr>\";\r\n }\r\n }\r\n }\r\n s += \"</table></center>\";\r\n s += \"</body></html>\";\r\n return s;\r\n }", "public Project() {\n this.name = \"Paper plane\";\n this.description = \" It's made of paper.\";\n }", "private void setProject()\n\t{\n\t\tproject.setName(tf0.getValue().toString());\n \t\tproject.setDescription(tf8.getValue().toString());\n \t\tproject.setEndDate(df4.getValue());\n \t\tif (sf6.getValue().toString().equals(\"yes\"))project.setActive(true);\n \t\telse project.setActive(false);\n \t\tif (!tf7.getValue().toString().equals(\"\"))project.setBudget(Float.parseFloat(tf7.getValue().toString()));\n \t\telse project.setBudget(-1);\n \t\tproject.setNextDeadline(df5.getValue());\n \t\tproject.setStartDate(df3.getValue());\n \t\ttry \n \t\t{\n \t\t\t\tif (sf1.getValue()!=null)\n\t\t\t\tproject.setCustomerID(db.selectCustomerforName( sf1.getValue().toString()));\n\t\t}\n \t\tcatch (SQLException|java.lang.NullPointerException e) \n \t\t{\n \t\t\tErrorWindow wind = new ErrorWindow(e); \n \t UI.getCurrent().addWindow(wind);\t\t\n \t e.printStackTrace();\n\t\t\t}\n \t\tproject.setInserted_by(\"Grigoris\");\n \t\tproject.setModified_by(\"Grigoris\");\n \t\tproject.setRowversion(1);\n \t\tif (sf2.getValue()!=null)project.setProjectType(sf2.getValue().toString());\n \t\telse project.setProjectType(null);\n\t }", "public JPanel buildProjectProperties()\n\t{\n\t\tprojectProperties.setPreferredSize(new Dimension(200, 190)); //Set the size of the window\n \tprojectProperties.setBorder (projectTitle); //Add a border around the window\n \t\n \treturn projectProperties;\n\t}", "public ProjectsPage() {\n\t\tthis.driver = DriverManager.getDriver();\n\t\tElementFactory.initElements(driver, this);\n\t\t// sets the name of the project to add, with a random integer ending for slight\n\t\t// ease on multiple test runs\n\t\tnameOfProject = \"testz2018\" + (int) Math.random() * 500;\n\t}", "public void setFieldDetails(){\n if (this.project != null){\n projectTitleField.setText( project.getTitle() );\n projectDescriptionField.setText( project.getDescription() );\n colorThemeField.setValue( Color.valueOf(project.getColorTheme()) );\n dueDateField.setValue( project.getDueDate() );\n createProjectBtn.setText( \"Update Project\" );\n }\n\n }", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}", "public void displayProject(Project project) {\n\t\tSystem.out.println(project.getID() + \" \"\n\t\t\t\t+ project.getProjectName() + \" \"\n\t\t\t\t+ project.getStartDate() + \" \"\n\t\t\t\t+ project.getEndDate() + \" \"\n\t\t\t\t+ project.getPriority());\n\t}", "@Override\n public String getProjectURL(ProjectPojo pojo) {\n String bomUrl = serverBean.getServerName()\n + \"/protex/ProtexIPIdentifyFolderBillOfMaterialsContainer?isAtTop=true&ProtexIPProjectId=\"\n + pojo.getProjectKey()\n + \"&ProtexIPIdentifyFileViewLevel=folder&ProtexIPIdentifyFileId=-1\";\n\n log.debug(\"Built URL for project: \" + bomUrl);\n\n return bomUrl;\n }", "private void printBoardAndCandidatesHtmlFile() {\n printBoardAndCandidatesHtmlFile(\"java-implementation/target/classes/sudokuBoard.html\", sudokuBoard);\n }", "public java.lang.String toString() {\n return \"Project name=\" + name;\n }", "public String fillEditPage() {\n\t\t\n\t\ttry{\n\t\t\t// Putting attribute of playlist inside the page to view it \n\t\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"playlist\", service.viewPlaylist());\n\t\t\t\n\t\t\t// Send user to EditPlaylistPage\n\t\t\treturn \"EditPlaylistPage\";\n\t\t}\n\t\t// Catch exceptions and send to ErrorPage\n\t\tcatch(Exception e) {\n\t\t\treturn \"ErrorPage.xhtml\";\n\t\t}\n\t}", "@RequestMapping(\"/new\")\n\tpublic String displayProjectForm(Model model) {\n\t\tProject aproject = new Project();\n\t//Iterable<Employee> employees = \tpro.getall();\n\t\n\t\tmodel.addAttribute(\"project\", aproject);\n\n\t\t//model.addAttribute(\"allEmployees\", employees);\n\t\t\n\t\t\n\t\treturn \"newproject\";\n\t\t\n\t}", "public String create()\n {\n return createHtml();\n }", "@GetMapping(path = \"/detail/\")\n\tpublic String viewProjectDetail() {\n\t\treturn \"sprint-detail\";\n\t}", "@GET\n @Path(\"/configEditorAsTable/{project_id}\")\n @Produces(MediaType.TEXT_HTML)\n public String getConfigEditorAsTable(@PathParam(\"project_id\") Integer projectId) {\n HttpSession session = request.getSession();\n Object username = session.getAttribute(\"user\");\n\n if (username == null) {\n throw new UnauthorizedRequestException(\"You must be this project's admin in order to edit its configuration\");\n }\n\n projectMinter project = new projectMinter();\n String response = project.getProjectConfigEditorAsTable(projectId, username.toString());\n project.close();\n return response;\n }", "@GetMapping(value = \"/project\")\n\tpublic String project(final Model model) {\n\t\tfinal Flux<Project> projectStream = this.projectRepository.findAll().log();\n\t\t\n\t\t// No need to fully resolve the Publisher! We will just let it drive (the \"projects\" variable can be a Publisher<X>, in which case it will drive the execution of the engine and Thymeleaf will be executed as a part of the data flow)\n // Create a data-driver context variable that sets Thymeleaf in data-driven mode,\n // rendering HTML (iterations) as items are produced in a reactive-friendly manner.\n // This object also works as wrapper that avoids Spring WebFlux trying to resolve\n // it completely before rendering the HTML.\n\t\tmodel.addAttribute(\"projects\", new ReactiveDataDriverContextVariable(projectStream, 1000));\n\n\t\t// Will use the same \"sse\" template, but only a fragment: #projectTableBody\n\t\treturn \"sse :: #projectTableBody\";\n\t}", "private String rowFor(GitHubProject project) {\n return PROJECT_LINE_TEMPLATE\n .replace(\"%NAME%\", nameOf(project))\n .replace(\"%STATUS%\", statusOf(project))\n .replace(\"%NUMBER_OF_VIOLATED_RULES%\", numberOfViolatedRulesIn(project));\n }", "public void updateDirectorCovHtml() {\n\n Connection dbConnection = connectToDb();\n String selectIdStmt = \"SELECT id, testposition, directory_cov_html FROM testruns ORDER BY id DESC\";\n System.out.println(selectIdStmt);\n try {\n PreparedStatement selectId = dbConnection\n .prepareStatement(selectIdStmt);\n ResultSet rs = selectId.executeQuery();\n while (rs.next()) {\n Integer testrunId = rs.getInt(\"id\");\n Integer testPosition = rs.getInt(\"testposition\");\n String directory_cov_html = rs.getString(\"directory_cov_html\");\n if (null == directory_cov_html) {\n String directoryFuncCovCsv = \"directoryFuncCov_\"+testPosition +\"__\"+testrunId +\".csv\";\n generateDirectoryFuncCovCsv(sourceDirFilename,\n directoryFuncCovCsv, testrunId, testPosition);\n String outputHTMLFilename= \"function_coverage_\"+testPosition +\"__\"+testrunId +\".html\";\n generateHtmlFromFsTree(outputHTMLFilename);\n addHtmlDocToDb(outputHTMLFilename, testrunId);\n } else {\n System.err\n .println(\"WARNING: directory_cov_html already set for testrunId \"\n + testrunId + \". Skipping testrunId.\");\n }\n }\n rs.close();\n selectId.close();\n } catch (SQLException e) {\n\n myExit(e);\n }\n }", "public String getProjectName(){\n return projectModel.getProjectName();\n }", "protected String generateEditModeHTML() throws DynamicExtensionsSystemException\r\n\t{\r\n\t\tString defaultValue = (String) this.value;\r\n\t\tif (value == null)\r\n\t\t{\r\n\t\t\tdefaultValue = ControlsUtility.getDefaultValue(this.getAbstractAttribute());\r\n\t\t\tif (defaultValue == null)\r\n\t\t\t{\r\n\t\t\t\tdefaultValue = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString htmlComponentName = getHTMLComponentName();\r\n String output=null;\r\n\t\t/*String output = \"<input class='\"\r\n\t\t\t\t+ cssClass\r\n\t\t\t\t+ \"' name='\"\r\n\t\t\t\t+ htmlComponentName\r\n\t\t\t\t+ \"' id='\"\r\n\t\t\t\t+ htmlComponentName\r\n\t\t\t\t+ \"' value='\"\r\n\t\t\t\t+ defaultValue\r\n\t\t\t\t+ \"'/>\"\r\n\t\t\t\t+ \"<A onclick=\\\"showCalendar('\"\r\n\t\t\t\t+ htmlComponentName\r\n\t\t\t\t+ \"', \"\r\n\t\t\t\t+ DynamicExtensionsUtility.getCurrentYear()\r\n\t\t\t\t+ \", \"\r\n\t\t\t\t+ DynamicExtensionsUtility.getCurrentMonth()\r\n\t\t\t\t+ \", \"\r\n\t\t\t\t+ DynamicExtensionsUtility.getCurrentDay()\r\n\t\t\t\t+ \", 'MM-dd-yyyy', 'dataEntryForm', '\"\r\n\t\t\t\t+ htmlComponentName\r\n\t\t\t\t+ \"', event, 1900, 2020);\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n\t\t\t\t+ \"<DIV id=slcalcod\"\r\n\t\t\t\t+ htmlComponentName\r\n\t\t\t\t+ \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";*/\r\n \r\n /*String output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"printMonthYearCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentMonth()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \");\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";*/\r\n \r\n /*String output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"printMonthYearCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentMonth()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \");\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";*/\r\n\t\t/* Obtain the date format */\r\n\t\tAttributeTypeInformationInterface attributeTypeInformationInterface = ((AttributeInterface) this\r\n\t\t\t\t.getAbstractAttribute()).getAttributeTypeInformation();\r\n\t\tString dateFormat = ControlsUtility.getDateFormat(attributeTypeInformationInterface);\r\n\t\tif (dateFormat.equals(ProcessorConstants.DATE_ONLY_FORMAT))\r\n\t\t{\r\n output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"showCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentMonth()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentDay()\r\n + \", 'MM-dd-yyyy', 'dataEntryForm', '\"\r\n + htmlComponentName\r\n + \"', event, 1900, 2020);\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";\r\n\t\t\toutput += \"<SCRIPT>printCalendar('\" + htmlComponentName + \"',\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentDay() + \",\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentMonth() + \",\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentYear() + \");</SCRIPT>\" + \"</DIV>\"\r\n\t\t\t\t\t+ \"[MM-DD-YYYY]&nbsp;\";\r\n\t\t}\r\n\t\telse if (dateFormat.equals(ProcessorConstants.DATE_TIME_FORMAT))\r\n\t\t{\r\n output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"showCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentMonth()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentDay()\r\n + \", 'MM-dd-yyyy', 'dataEntryForm', '\"\r\n + htmlComponentName\r\n + \"', event, 1900, 2020);\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";\r\n\t\t\toutput += \"<SCRIPT>printTimeCalendar('\" + htmlComponentName + \"',\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentDay() + \",\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentMonth() + \",\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentYear() + \",\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentHours() + \",\"\r\n\t\t\t\t\t+ DynamicExtensionsUtility.getCurrentMinutes() + \");</SCRIPT>\" + \"</DIV>\"\r\n\t\t\t\t\t+ \"[MM-DD-YYYY HH:MM]&nbsp;\";\r\n\t\t}\r\n else if (dateFormat.equals(ProcessorConstants.MONTH_YEAR_FORMAT))\r\n {\r\n output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"showCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentMonth()\r\n + \", \"\r\n + 0\r\n + \", 'MM-yyyy', 'dataEntryForm', '\"\r\n + htmlComponentName\r\n + \"', event, 1900, 2020);\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";\r\n /*output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"printMonthYearCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentMonth()\r\n + \", \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \");\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";*/\r\n output += \"<SCRIPT>printMonthYearCalendar('\" + htmlComponentName + \"',\"\r\n + DynamicExtensionsUtility.getCurrentMonth() + \",\"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \");</SCRIPT>\" + \"</DIV>\"\r\n + \"[MM-YYYY]&nbsp;\";\r\n }\r\n else if (dateFormat.equals(ProcessorConstants.YEAR_ONLY_FORMAT))\r\n {\r\n /*output += \"<SCRIPT>printYearCalendar('\" + \"attributeDefaultValue\" + \"',\"\r\n + DynamicExtensionsUtility.getCurrentYear() + \",\"\r\n + \");</SCRIPT>\" + \"</DIV>\"\r\n + \"[YYYY]&nbsp;\";\r\n output += \"<SCRIPT>printYearCalendar('\" + htmlComponentName + \"',\"\r\n + DynamicExtensionsUtility.getCurrentDay() + \",\"\r\n + DynamicExtensionsUtility.getCurrentMonth() + \",\"\r\n + DynamicExtensionsUtility.getCurrentYear() + \",\"\r\n + DynamicExtensionsUtility.getCurrentHours() + \",\"\r\n + DynamicExtensionsUtility.getCurrentMinutes() + \");</SCRIPT>\" + \"</DIV>\"\r\n + \"[MM-DD-YYYY HH:MM]&nbsp;\";*/\r\n output = \"<input class='\"\r\n + cssClass\r\n + \"' name='\"\r\n + htmlComponentName\r\n + \"' id='\"\r\n + htmlComponentName\r\n + \"' value='\"\r\n + defaultValue\r\n + \"'/>\"\r\n + \"<A onclick=\\\"showCalendar('\"\r\n + htmlComponentName\r\n + \"', \"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \", \"\r\n + 0\r\n + \", \"\r\n + 0\r\n + \", 'yyyy', 'dataEntryForm', '\"\r\n + htmlComponentName\r\n + \"', event, 1900, 2020);\\\" href=\\\"javascript://\\\"><IMG alt=\\\"This is a Calendar\\\" src=\\\"images/calendar.gif\\\" border=0 /></A>\"\r\n + \"<DIV id=slcalcod\"\r\n + htmlComponentName\r\n + \" style=\\\"Z-INDEX: 10; LEFT: 100px; VISIBILITY: hidden; POSITION: absolute; TOP: 100px\\\">\";\r\n output += \"<SCRIPT>printYearCalendar('\" + htmlComponentName + \"',\"\r\n + DynamicExtensionsUtility.getCurrentYear()\r\n + \");</SCRIPT>\" + \"</DIV>\"\r\n + \"[YYYY]&nbsp;\";\r\n }\r\n\r\n\t\treturn output;\r\n\t}", "public ProjectViewController(){\n InputStream request = appController.httpRequest(\"http://localhost:8080/project/getProject\", \"GET\");\n try {\n String result = IOUtils.toString(request, StandardCharsets.UTF_8);\n Gson gson = new Gson();\n this.projectModel = gson.fromJson(result, ProjectModel.class);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected String generateProcessEditElement(Element element, String parentName, String targetName) {\n\t\tString elementNameUncapped = ModelLayerHelper.getElementNameUncapped(element);\n\t\t//String targetNameUncapped = NameUtil.uncapName(targetName);\t\t\n\t\t\n\t\tBuf buf = new Buf();\n\t\tbuf.putLine4(\"\t\");\n\t\tbuf.putLine4(\"\t\");\n\t\tbuf.putLine4(\"<!--\");\n\t\tbuf.putLine4(\" ** processEdit\"+targetName+\"(event)\");\n\t\tbuf.putLine4(\" ** Opens \"+targetName+\" for editing. Goes to the \"+targetName+\" Wizard page.\");\n\t\tbuf.putLine4(\" -->\");\n\t\tbuf.putLine4(\"\t\");\n\t\tbuf.putLine4(\"function processEdit\"+targetName+\"(event) {\");\n\t\tbuf.putLine4(\"\ttry {\");\n\t\tbuf.putLine4(\"\t\tsetCursorWait(event.target);\"); \n\t\tbuf.putLine4(\"\t\tsetCursorWait(event.currentTarget);\"); \n\t\tbuf.putLine4(\"\t\tsetCursorWait(#{rich:element('\"+elementNameUncapped+\"Tree')});\");\n\t\tif (parentName != null) {\n\t\t\tbuf.putLine4(\"\t\tif (\"+elementNameUncapped+\"TreeState.nodeLabel != null) {\");\n\t\t\tbuf.putLine4(\"\t\t\tvar label = \"+elementNameUncapped+\"TreeState.nodeLabel;\");\n\t\t\tbuf.putLine4(\"\t\t\tshowProgress('Nam', '\"+targetName+\" Records'. 'Opening \"+targetName+\" for \"+parentName+\" \\\\\\\"' + label + '\\\\\\\"...')\");\n\t\t\tbuf.putLine4(\"\t\t} else showProgress('Nam', '\"+targetName+\" Records', 'Opening \"+targetName+\"...');\");\n\t\t} else {\n\t\t\tbuf.putLine4(\"\t\tshowProgress('Nam', '\"+targetName+\" Records', 'Opening \"+targetName+\"...');\");\n\t\t\t//buf.putLine4(\"\tshowProgress('Nam', 'New \"+elementClassName+\"', 'Creating new \"+elementClassName+\"...')\");\n\t\t}\n\t\tbuf.putLine4(\"\t\tedit\"+targetName+\"(event);\");\n\t\tbuf.putLine4(\"\t} catch(e) {\");\n\t\tbuf.putLine4(\"\t\talert(e);\");\n\t\tbuf.putLine4(\"\t}\");\n\t\tbuf.putLine4(\"}\");\n\t\treturn buf.get();\n\t}", "private String renderEditPage(Model model, VMDTO vmdto) {\n\t\tmodel.addAttribute(\"vmDto\", vmdto);\n\t\tmodel.addAttribute(\"availableProviders\", providerService.getAllProviders());\n\t\treturn \"vm/edit\";\n\t}", "public void showPortfolio(){\n System.out.println(\"PORTFOLIO CONTENTS\");\n for(int i = 0; i < this.projects.size(); i++){\n System.out.println(this.projects.get(i).elevatorPitch());\n }\n System.out.println(\"Total Portfolio Cost: $\" + this.getPortfolioCost());\n }", "@GET\n\t@Path(\"/\") \n\t@Produces(MediaType.TEXT_HTML) \n\tpublic String readItems() \n\t { \n\t return itemObj.readProjects(); \n\t }", "private void generateOutputHTML() {\n\n\t\t\n\t\ttry {\n\t\t\tScanner in = new Scanner(new File(\"data/web/template.html\"));\n\t\t\tPrintStream out = new PrintStream(\"data/web/output\"+count+\".html\");\n\t\t\tSystem.setOut(out);\n\t\t\t\n\t\t\twhile (in.hasNext()) {\n\t\t\t\tString line = in.nextLine();\n\t\t\t\tSystem.out.print(line);\n\t\t\t\t\n\t\t\t\tif (line.equals(\"<title>\")) System.out.println(\"Path #\" +count);\n\t\t\t\t\n\t\t\t\n\t\t\t\tif (line.equals(\"<body>\")) { \t\t\t\t// this is where all the good stuff goes..\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"<div class='bodyHeader'>\");\n\t\t\t\t\tSystem.out.println(\"<p><strong>in order path for driver #\" +count+ \" \" + \"</strong></p>\");\n\t\t\t\t\tSystem.out.println(\"</div>\");\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"<br><br><hr class='hrStyle'/>\");\n\t\t\t\t\t\n\t\t\t\t\t// Creating info about the path in a table format\n\t\t\t\t\tSystem.out.println(\"<div class='pathInfo'>\");\n\t\t\t\t\tSystem.out.println(\"<table class='infoTable' cellpadding='3' cellspacing='10'>\");\n\t\t\t\t\tSystem.out.println(\"<tr><td>City: </td><td> \" + list.get(0).getCity()+ \" - \" + list.get(0).getState() + \"</td></tr>\");\n\t\t\t\t\tSystem.out.println(\"<tr><td>Number of stops: </td><td> \" + (list.size()-1) + \"</td></tr>\");\n\t\t\t\t\tSystem.out.println(\"<tr><td>Store: </td><td> \" + list.get(1).getName().toUpperCase()+ \"</td></tr>\");\n\t\t\t\t\tSystem.out.println(\"</table>\");\n\t\t\t\t\t\n//TODO: get starting address --- System.out.println(\"Starting address: \" + list.get(0).getAddress());\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"</div>\");\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlist.remove(0);\n\t\t\t\t\t\n\t\t\t\t\t//create ordered table/list of path\n\t\t\t\t\tSystem.out.println(\"<div class='pathList'>\");\t\n\t\t\t\t\tSystem.out.println(\"<table class='pathTable' cellspacing='15'>\");\n\t\t\t\t\tSystem.out.println(\"<tr><th>Order</th><th>Address</th><th></th><th>Latitude , Longitude</th></tr>\");\n\t\t\t\t\tint i = 1;\n\t\t\t\t\tfor (Location c: list) {\n\t\t\t\t\t// creating table row for each stop in route\n\t\t\t\t\t\tSystem.out.println(\"<tr>\" + \"<td>\"+(i++)+\"</td>\" + c.toHTMLString() +\"</tr>\");\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"</ol>\");\n\t\t\t\t\tSystem.out.println(\"<br>\");\n\t\t\t\t\tSystem.out.println(\"</div>\");\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tin.close();\n\t\t\tout.close();\n\t\t\t\n\t\t\t//opening html file to the default browser in the system\n\t\t\tFile htmlFile = new File(\"data/web/output\"+count+\".html\");\n\t\t\tDesktop.getDesktop().browse(htmlFile.toURI());\n\t\t}\n\t\t\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(e.getLocalizedMessage());\n\t\t} \n\t}", "public static void finalise() throws IOException {\r\n //Openeing the file and creating a scanner object\r\n File inFile = new File(\"output.txt\");\r\n Scanner sc = new Scanner(inFile);\r\n //Creating empty string to append lines of text file to with a while loop.\r\n String lines = \"\";\r\n while (sc.hasNext()) {\r\n lines += sc.nextLine();\r\n }\r\n //Creating a counter to number the projects printed\r\n int indexCount = 0;\r\n //Creating an array by splitting string by \"#\" which will be written to the text file when a new project is added\r\n String[] lineArr = lines.split(\"#\");\r\n //For loop to print the projects with a counter, which the user will use to select a project to finalise\r\n for (int i = 0; i < lineArr.length; i++) {\r\n indexCount += 1;\r\n String[] projectInfo = lineArr[i].split(\", \");\r\n System.out.println(\"Index number: \" + indexCount);\r\n System.out.println(\"Project name: \" + projectInfo[0]);\r\n System.out.println(\"Project number: \" + projectInfo[1]);\r\n System.out.println(\"Build type: \" + projectInfo[2]);\r\n System.out.println(\"Address: \" + projectInfo[3]);\r\n System.out.println(\"ERF number: \" + projectInfo[4]);\r\n System.out.println(\"Fee: \" + projectInfo[5]);\r\n System.out.println(\"Paid to date: \" + projectInfo[6]);\r\n System.out.println(\"Due date: \" + projectInfo[7] + \"\\n\");\r\n }\r\n sc.close();\r\n finaliseEdit();\r\n }", "public String showAddPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n\n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String password = this.getComms().request.getParameter(PASSWORD);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n\tString contactname = this.getComms().request.getParameter(CONTACTNAME);\n\tString contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n\tString billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n\tString billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n\tString billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n\tString city = this.getComms().request.getParameter(CITY);\n\tString state = this.getComms().request.getParameter(STATE);\n\tString zip = this.getComms().request.getParameter(ZIP);\n\tString accountid = this.getComms().request.getParameter(ACCOUNTID);\n\tString isoutside = this.getComms().request.getParameter(OUTSIDE);\n\tString exp = this.getComms().request.getParameter(EXP);\n\tString expday = this.getComms().request.getParameter(EXPDAY);\n\tString expmonth = this.getComms().request.getParameter(EXPMONTH);\n\tString expyear = this.getComms().request.getParameter(EXPYEAR);\n\tString notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\n\n\t // Instantiate the page object\n\t EditHTML page = new EditHTML();\n\n\tHTMLOptionElement templateOption = page.getElementTemplateOption();\n Node PersonSelect = templateOption.getParentNode();\n templateOption.removeAttribute(\"id\");\n templateOption.removeChild(templateOption.getFirstChild());\n\n if(null != this.getComms().request.getParameter(PROJ_NAME)) {\n page.getElementProj_name().setValue(this.getComms().request.getParameter(PROJ_NAME));\n }\n\n try {\n \tPerson[] PersonList = PersonFactory.getPersonsList();\n \tfor (int numPersons = 0; numPersons < PersonList.length; numPersons++) {\n \t Person currentPerson = PersonList[numPersons] ;\n \t HTMLOptionElement clonedOption = (HTMLOptionElement) templateOption.cloneNode(true);\n clonedOption.setValue(currentPerson.getHandle());\n Node optionTextNode = clonedOption.getOwnerDocument().\n createTextNode(currentPerson.getFirstname() + \" \" +\n currentPerson.getLastname());\n clonedOption.appendChild(optionTextNode);\n // Do only a shallow copy of the option as we don't want the text child\n // of the node option\n PersonSelect.appendChild(clonedOption);\n // Alternative way to insert nodes below\n // insertBefore(newNode, oldNode);\n // ProjSelect.insertBefore(clonedOption, templateOption);\n\t }\n\t } catch(Exception ex) {\n\t this.writeDebugMsg(\"Error populating Persons List: \" + ex);\n throw new webschedulePresentationException(\"Error getting Persons List: \", ex);\n\t }\n\t\n templateOption.getParentNode().removeChild(templateOption);\n\n if(null != this.getComms().request.getParameter(PASSWORD)) {\n page.getElementPassword().setValue(this.getComms().request.getParameter(PASSWORD));\n }\n\n if(null != this.getComms().request.getParameter(DISCRIB)) {\n page.getElementDiscrib().setValue(this.getComms().request.getParameter(DISCRIB));\n }\n if(null != this.getComms().request.getParameter(INDEXNUM)) {\n page.getElementIndexnum().setValue(this.getComms().request.getParameter(INDEXNUM));\n }\n\n if(null != this.getComms().request.getParameter(THOURS)) {\n page.getElementThours().setValue(this.getComms().request.getParameter(THOURS));\n }\n\n if(null != this.getComms().request.getParameter(DHOURS)) {\n page.getElementDhours().setValue(this.getComms().request.getParameter(DHOURS));\n }\n\n if(null != this.getComms().request.getParameter(CODEOFPAY)) {\n page.getElementCodeofpay().setValue(this.getComms().request.getParameter(CODEOFPAY));\n }\n\n if(null != this.getComms().request.getParameter(CONTACTNAME)) {\n page.getElementContactname().setValue(this.getComms().request.getParameter(CONTACTNAME));\n }\n\n if(null != this.getComms().request.getParameter(CONTACTPHONE)) {\n \npage.getElementContactphone().setValue(this.getComms().request.getParameter(CONTACTPHONE));\n }\n\n\nif(null != this.getComms().request.getParameter(BILLADDR1)) {\n \npage.getElementBilladdr1().setValue(this.getComms().request.getParameter(BILLADDR1));\n }\n\n\n\nif(null != this.getComms().request.getParameter(BILLADDR2)) {\n \npage.getElementBilladdr2().setValue(this.getComms().request.getParameter(BILLADDR2));\n }\n\n\nif(null != this.getComms().request.getParameter(BILLADDR3)) {\n \npage.getElementBilladdr3().setValue(this.getComms().request.getParameter(BILLADDR3));\n }\n\nif(null != this.getComms().request.getParameter(STATE)) {\n \npage.getElementState().setValue(this.getComms().request.getParameter(STATE));\n }\n\nif(null != this.getComms().request.getParameter(ZIP)) {\n \npage.getElementZip().setValue(this.getComms().request.getParameter(ZIP));\n }\n\n if(null != this.getComms().request.getParameter(OUTSIDE)) {\n page.getElementOutsideBox().setChecked(true);\n } else {\n page.getElementOutsideBox().setChecked(false);\n }\n\t\nif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(false);\n }\t\n\t\nif(null != this.getComms().request.getParameter(ACCOUNTID)) {\n \npage.getElementAccountid().setValue(this.getComms().request.getParameter(ACCOUNTID));\n }\n\t\n\t\nif(null != this.getComms().request.getParameter(EXPDAY)) {\n \npage.getElementExpday().setValue(this.getComms().request.getParameter(EXPDAY));\n }\n\n\nif(null != this.getComms().request.getParameter(EXPMONTH)) {\n \npage.getElementExpmonth().setValue(this.getComms().request.getParameter(EXPMONTH));\n }\nif(null != this.getComms().request.getParameter(EXPYEAR)) {\n \npage.getElementExpyear().setValue(this.getComms().request.getParameter(EXPYEAR));\n }\n\n if(null != this.getComms().request.getParameter(NOTIFYCONTACT)) {\n page.getElementNotifycontact().setValue(this.getComms().request.getParameter(NOTIFYCONTACT));\n }\n\n if(null == errorMsg) { \n\t page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n } else {\n page.setTextErrorText(errorMsg);\n }\n \n\t return page.toDocument();\n }", "private String getReleaseNotesHtml() {\r\n\t\tString pkgName = _act.getPackageName();\r\n\t\tResources res = _act.getResources();\r\n\t\tint resId = res.getIdentifier(releaseNotesXml, \"xml\", pkgName);\r\n\t\tXmlResourceParser parser = res.getXml(resId);\r\n\r\n\t\tString html = \"<html><head>\" + css + \"</head><body>\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint eventType = parser.getEventType();\r\n\t\t\twhile (eventType != XmlPullParser.END_DOCUMENT) {\r\n\t\t\t\tif ((eventType == XmlPullParser.START_TAG) && (parser.getName().equals(\"release\"))){\r\n\t\t\t\t\thtml = html + parseReleaseNotesXML(parser);\r\n\t\t\t\t}\r\n\t\t\t\teventType = parser.next();\r\n\t\t\t}\r\n\t\t} \r\n\t\tcatch (XmlPullParserException e)\r\n\t\t{\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tparser.close();\r\n\t\t}\r\n\t\thtml = html + \"</body></html>\";\r\n\t\treturn html;\r\n\t}", "public void renderChangeSet() {\n\t\t\n\t\tint saveScope = changeLog.scope; //IMPORTANT\n\t\t\n\t\tchangeLog.scope = attachScope;\t\t\n//\t\tif (attachType==MY_ATTACHMENT) changeHTML += \"<u>Current Committed Changes:</u><br><br>\";\n//\t\telse changeHTML += \"<u>Changes in Annotation Message:</u><br><br>\";\n\t\tJEditorPane[] changePanes = new JEditorPane[changeSet.size()];\n\t\trenderedChangeSet = new ArrayList();\n\t\t\n\t\tint ctr = 0;\n\t\tfor (Iterator iter = changeSet.iterator(); iter.hasNext();) {\n\t\t\t\n\t\t\t// create dynamic jeditorpane\n\t\t\tchangePanes[ctr] = new JEditorPane();\n\t\t\tchangePanes[ctr].setContentType(\"text/html\");\n\t\t\tchangePanes[ctr].setEditable(false);\n\t\t\tchangePanes[ctr].addHyperlinkListener(this);\n\t\t\t\n\t\t\tString changeHTML = \"<FONT FACE=\\\"\"+changeLog.swoopModel.getFontFace()+\"\\\" SIZE=\"+changeLog.swoopModel.getFontSize()+\">\";\n\t\t\tOntologyChange change = (OntologyChange) iter.next();\n\t\t\t\n\t\t\t// skip SaveCheckpointChange(s)\n\t\t\tif (change instanceof SaveCheckpointChange || change instanceof RevertCheckpointChange) continue;\n\t\t\t\n\t\t\tString html = changeLog.getChangeInformation(change, ChangeLog.CHANGE_DESCRIPTION, null, new ArrayList(), null).toString();\n\t\t\tif (!html.trim().equals(\"\")) {\n\t\t\t\trenderedChangeSet.add(ctr, change);\n\t\t\t\tchangeHTML += html;\n\t\t\t\tchangeHTML = changeHTML.replaceAll(\"Undo\", String.valueOf(ctr+1));\n\t\t\t\tchangePanes[ctr].setText(changeHTML);\n\t\t\t\tchangePanes[ctr].setCaretPosition(0);\n\t\t\t\tctr++;\n\t\t\t}\t\t\t\n\t\t}\n\t\tContainer content = this.getContentPane();\n\t\tcontent.removeAll();\n\t\tJPanel centerPane = new JPanel();\n\t\tcenterPane.setLayout(new GridLayout(ctr,1));\n\t\tchecks = new JCheckBox[ctr];\n\t\t\n\t\tfor (int i=0; i<ctr; i++) {\n\t\t\tJPanel singleChangePane = new JPanel();\n\t\t\tsingleChangePane.setLayout(new BorderLayout());\n\t\t\tsingleChangePane.add(new JScrollPane(changePanes[i]), \"Center\");\n\t\t\tchecks[i] = new JCheckBox();\n\t\t\tif (alreadyAttached.contains((OntologyChange) renderedChangeSet.get(i))) checks[i].setSelected(true);\n\t\t\tsingleChangePane.add(checks[i], \"West\");\n\t\t\tcenterPane.add(singleChangePane);\n\t\t}\n\t\tcontent.setLayout(new BorderLayout());\n\t\tcontent.add(scopePanel, \"North\");\n\t\tcontent.add(new JScrollPane(centerPane), \"Center\");\n\t\tcontent.add(toolbar, \"South\");\n\t\tcontent.repaint();\t\t\n\t\tshow();\n\t\t\n\t\tchangeLog.scope = saveScope; //IMPORTANT\n\t}", "public void foreachResultCreateHTML(ParameterHelper _aParam)\n {\n // TODO: auslagern in eine function, die ein Interface annimmt.\n String sInputPath = _aParam.getInputPath();\n File aInputPath = new File(sInputPath);\n// if (!aInputPath.exists())\n// {\n// GlobalLogWriter.println(\"Error, InputPath or File in InputPath doesn't exists. Please check: '\" + sInputPath + \"'\");\n// assure(\"Error, InputPath or File in InputPath doesn't exists. Please check: '\" + sInputPath + \"'\", false);\n// }\n\n // call for a single ini file\n if (sInputPath.toLowerCase().endsWith(\".ini\") )\n {\n callEntry(sInputPath, _aParam);\n }\n else\n {\n // check if there exists an ini file\n String sPath = FileHelper.getPath(sInputPath); \n String sBasename = FileHelper.getBasename(sInputPath);\n\n runThroughEveryReportInIndex(sPath, sBasename, _aParam);\n \n // Create a HTML page which shows locally to all files in .odb\n if (sInputPath.toLowerCase().endsWith(\".odb\"))\n {\n String sIndexFile = FileHelper.appendPath(sPath, \"index.ini\");\n File aIndexFile = new File(sIndexFile);\n if (aIndexFile.exists())\n { \n IniFile aIniFile = new IniFile(sIndexFile);\n\n if (aIniFile.hasSection(sBasename))\n {\n // special case for odb files\n int nFileCount = aIniFile.getIntValue(sBasename, \"reportcount\", 0);\n ArrayList<String> aList = new ArrayList<String>();\n for (int i=0;i<nFileCount;i++)\n {\n String sValue = aIniFile.getValue(sBasename, \"report\" + i);\n\n String sPSorPDFName = getPSorPDFNameFromIniFile(aIniFile, sValue);\n if (sPSorPDFName.length() > 0)\n {\n aList.add(sPSorPDFName);\n }\n }\n if (aList.size() > 0)\n {\n // HTML output for the odb file, shows only all other documents.\n HTMLResult aOutputter = new HTMLResult(sPath, sBasename + \".ps.html\" );\n aOutputter.header(\"content of DB file: \" + sBasename);\n aOutputter.indexSection(sBasename);\n \n for (int i=0;i<aList.size();i++)\n {\n String sPSFile = aList.get(i);\n\n // Read information out of the ini files\n String sIndexFile2 = FileHelper.appendPath(sPath, sPSFile + \".ini\");\n IniFile aIniFile2 = new IniFile(sIndexFile2);\n String sStatusRunThrough = aIniFile2.getValue(\"global\", \"state\");\n String sStatusMessage = \"\"; // aIniFile2.getValue(\"global\", \"info\");\n aIniFile2.close();\n\n\n String sHTMLFile = sPSFile + \".html\";\n aOutputter.indexLine(sHTMLFile, sPSFile, sStatusRunThrough, sStatusMessage);\n }\n aOutputter.close();\n\n// String sHTMLFile = FileHelper.appendPath(sPath, sBasename + \".ps.html\");\n// try\n// {\n//\n// FileOutputStream out2 = new FileOutputStream(sHTMLFile);\n// PrintStream out = new PrintStream(out2);\n//\n// out.println(\"<HTML>\");\n// out.println(\"<BODY>\");\n// for (int i=0;i<aList.size();i++)\n// {\n// // <A href=\"link\">blah</A>\n// String sPSFile = (String)aList.get(i);\n// out.print(\"<A href=\\\"\");\n// out.print(sPSFile + \".html\");\n// out.print(\"\\\">\");\n// out.print(sPSFile);\n// out.println(\"</A>\");\n// out.println(\"<BR>\");\n// }\n// out.println(\"</BODY></HTML>\");\n// out.close();\n// out2.close();\n// }\n// catch (java.io.IOException e)\n// {\n// \n// }\n }\n }\n aIniFile.close();\n }\n\n }\n }\n }", "private void createProjectComposite() {\r\n\t\tGridLayout gridLayout2 = new GridLayout();\r\n\t\tgridLayout2.numColumns = 2;\r\n\t\tprojectComposite = new Composite(composite, SWT.NONE);\r\n\t\tprojectComposite.setLayout(gridLayout2);\r\n\t\tprojectComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r\n\t\toutputChooserTreeViewer = new TreeViewer(projectComposite, SWT.BORDER);\r\n\t\toutputChooserTreeViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r\n\t\toutputChooserTreeViewer.setContentProvider(new ProjectContentProvider());\r\n\t\toutputChooserTreeViewer.setLabelProvider(new DecoratingLabelProvider(\r\n\t\t\t\t\t\t\t\tnew WorkbenchLabelProvider(), \r\n\t\t\t\t\t\t\t\tPlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));\r\n\t\toutputChooserTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());\r\n\t\toutputChooserTreeViewer.getTree().addSelectionListener(new SelectionListener() {\r\n\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent arg0) {\r\n\t\t\t}\r\n\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\t\r\n\t\t\t\tvalidatePage();\r\n\t\t\t}\r\n\t\t});\r\n\t\toutputChooserTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {\r\n\r\n\t\t\tpublic void selectionChanged(SelectionChangedEvent arg0) {\r\n\t\t\t\tTreeSelection selection = (TreeSelection) outputChooserTreeViewer.getSelection();\r\n\t\t\t\tif (selection != null) {\r\n\t\t\t\t\tObject selected = selection.getFirstElement();\r\n\t\t\t\t\tif (selected != null) {\r\n\t\t\t\t\t\tif (selected instanceof IContainer) {\r\n\t\t\t\t\t\t\tNewPIWizardSettings.getInstance().outputContainer = (IContainer) selected;\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\r\n\t\tcreateButtonComposite();\r\n\t}", "public void editProjectAction() throws IOException {\n\t\tfinal List<Project> projects = selectionList.getSelectionModel().getSelectedItems();\n\t\tif (projects.size() == 1) {\n\t\t\tfinal Project project = projects.get(0);\n\t\t\tfinal FXMLSpringLoader loader = new FXMLSpringLoader(appContext);\n\t\t\tfinal Dialog<Project> dialog = loader.load(\"classpath:view/Home_AddProjectDialog.fxml\");\n\t\t\tdialog.initOwner(addProject.getScene().getWindow());\n\t\t\t((AddProjectDialogController) loader.getController()).getContentController().setProjectToEdit(project);\n\t\t\tfinal Optional<Project> result = dialog.showAndWait();\n\t\t\tif (result.isPresent()) {\n\t\t\t\tlogger.trace(\"dialog 'edit project' result: {}\", result::get);\n\t\t\t\tupdateProjectList();\n\t\t\t}\n\t\t}\n\t}", "private void saveProject()\n\t{\n\t\t\n\t\tint fileChooserReturnValue =\n\t\t\twindowTemplate\n\t\t\t\t.getFileChooser()\n\t\t\t\t.showSaveDialog(windowTemplate);\n\t\t\n\t\tif(fileChooserReturnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\t\n\t\t\t// Get the file that the user selected\n\t\t\tFile file = windowTemplate.getFileChooser().getSelectedFile();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// Open the output streams\n\t\t\t\tFileOutputStream fileOutput = new FileOutputStream(file.getAbsolutePath());\n\t\t\t\tObjectOutputStream objectOutput = new ObjectOutputStream(fileOutput);\n\t\t\t\n\t\t\t\t// Write the objects\n\t\t\t\tfor(int i = 0; i < cards.size(); i++) {\n\t\t\t\t\tobjectOutput.writeObject(cards.get(i));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Close the output streams\n\t\t\t\tobjectOutput.close();\n\t\t\t\tfileOutput.close();\n\t\t\t\t\n\t\t\t\t// Update the title of the frame to reflect the file name\n\t\t\t\twindowTemplate.setTitle(file.getName());\n\t\t\t\t\n\t\t\t} catch (IOException e1) {\n\t\t\t\tJOptionPane.showMessageDialog(windowTemplate, \"Could not save the file.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\r\n protected void doCreate(boolean update) throws IOException, ServletException, Descriptor.FormException, InvalidProjectFileException {\r\n // Read the manage project file\r\n FileItem fileItem = getRequest().getFileItem(\"manageProject\");\r\n if (fileItem == null) {\r\n return;\r\n }\r\n\r\n manageFile = fileItem.getString();\r\n manageProject = new ManageProject(manageFile);\r\n manageProject.parse();\r\n\r\n getTopProject().setDescription(\"Top-level multi job to run the manage project: \" + getManageProjectName());\r\n String tmpLabel = getNodeLabel();\r\n if (tmpLabel == null || tmpLabel.isEmpty()) {\r\n tmpLabel = \"master\";\r\n }\r\n Label label = new LabelAtom(tmpLabel);\r\n getTopProject().setAssignedLabel(label);\r\n \r\n // Build actions...\r\n addSetup(getTopProject());\r\n // Add multi-job phases\r\n // Building...\r\n List<PhaseJobsConfig> phaseJobs = new ArrayList<>();\r\n \r\n projectsAdded = new ArrayList<>();\r\n projectsNeeded = new ArrayList<>();\r\n projectsExisting = new ArrayList<>();\r\n \r\n projectsAdded.add(getTopProject().getFullName());\n \r\n String baseName = getBaseName();\r\n if (getJobName() != null && !getJobName().isEmpty()) {\r\n baseName = getJobName();\r\n }\r\n\n String folderName = getTopProject().getParent().getFullName();\n if (folderName != null && !folderName.isEmpty()) {\n folderName = folderName + \"/\";\n }\n\n for (MultiJobDetail detail : manageProject.getJobs()) {\r\n String name = folderName + baseName + \"_\" + detail.getProjectName();\n projectsNeeded.add(name);\r\n PhaseJobsConfig phase = new PhaseJobsConfig(name, \r\n /*jobproperties*/\"\", \r\n /*currParams*/true, \r\n /*configs*/null, \r\n PhaseJobsConfig.KillPhaseOnJobResultCondition.NEVER, \r\n /*disablejob*/false, \r\n /*enableretrystrategy*/false, \r\n /*parsingrulespath*/null, \r\n /*retries*/0, \r\n /*enablecondition*/false, \r\n /*abort*/false, \r\n /*condition*/\"\", \r\n /*buildonly if scm changes*/false,\r\n /*applycond if no scm changes*/false);\r\n phaseJobs.add(phase);\r\n }\r\n MultiJobBuilder multiJobBuilder = new MultiJobBuilder(\"Build, Execute and Report\", phaseJobs, MultiJobBuilder.ContinuationCondition.COMPLETED);\r\n getTopProject().getBuildersList().add(multiJobBuilder);\r\n\r\n // Copy artifacts per building project\r\n for (MultiJobDetail detail : manageProject.getJobs()) {\r\n String name = folderName + baseName + \"_\" + detail.getProjectName();\n String tarFile = \"\";\r\n if (isUsingSCM()) {\r\n tarFile = \", \" + getBaseName() + \"_\" + detail.getProjectName() + \"_build.tar\";\r\n }\r\n CopyArtifact copyArtifact = new CopyArtifact(name);\r\n copyArtifact.setOptional(true);\r\n copyArtifact.setFilter(\"**/*_rebuild*,\" +\r\n \"execution/*.html, \" +\r\n \"management/*.html, \" +\r\n \"xml_data/**\" +\r\n tarFile);\r\n copyArtifact.setFingerprintArtifacts(false);\r\n BuildSelector bs = new WorkspaceSelector();\r\n copyArtifact.setSelector(bs);\r\n getTopProject().getBuildersList().add(copyArtifact);\r\n }\r\n addMultiJobBuildCommand();\r\n \r\n // Post-build actions if doing reporting\r\n if (getOptionUseReporting()) {\r\n addArchiveArtifacts(getTopProject());\r\n addXunit(getTopProject());\r\n addVCCoverage(getTopProject());\r\n addGroovyScriptMultiJob();\r\n }\r\n \r\n getTopProject().save();\r\n \r\n for (MultiJobDetail detail : manageProject.getJobs()) {\r\n String name = baseName + \"_\" + detail.getProjectName();\n createProjectPair(name, detail, update);\r\n }\r\n }", "private Project compileProject() {\n\t\t\tProject p = null;\n\t\t\t\n\t\t\tif(pType.equals(\"o\")) {\n\t\t\t\ttry {\n\t\t\t\t\tp = new OngoingProject(pCode.getText(), pName.getText(), dateFormat.parse(pSDate.getText()),pClient.getText(), dateFormat.parse(pDeadline.getText()), Double.parseDouble(pBudget.getText()), Integer.parseInt(pCompletion.getText()));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else if(pType.equals(\"f\")) {\n\t\t\t\ttry {\n\t\t\t\t\tp = new FinishedProject(pCode.getText(), pName.getText(), dateFormat.parse(pSDate.getText()),pClient.getText(), dateFormat.parse(pEndDate.getText()), Double.parseDouble(pTotalCost.getText()));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\treturn p;\n\t\t}", "public String createHtml()\n {\n StringBuffer strEditor = new StringBuffer();\n\n strEditor.append(\"<div>\");\n String encodedValue = escapeXml(value.replaceAll(\"((\\r?\\n)+|\\t*)\", \"\"));\n\n if (check(request.getHeader(\"user-agent\")))\n {\n strEditor.append(createInputForVariable(instanceName, instanceName, encodedValue));\n // create config html\n String configStr = config.getUrlParams();\n if (configStr != null && configStr.length() > 0)\n {\n configStr = configStr.substring(1);\n strEditor.append(createInputForVariable(null, instanceName.concat(\"___Config\"), configStr));\n }\n\n // create IFrame\n String sLink = basePath.concat(\"/editor/fckeditor.html?InstanceName=\").concat(instanceName);\n if (toolbarSet != null && toolbarSet.length() > 0)\n {\n sLink += \"&Toolbar=\".concat(toolbarSet);\n }\n XHtmlTagTool iframeTag = new XHtmlTagTool(\"iframe\", XHtmlTagTool.SPACE);\n iframeTag.addAttribute(\"id\", instanceName.concat(\"___Frame\"));\n iframeTag.addAttribute(\"src\", sLink);\n iframeTag.addAttribute(\"width\", width);\n iframeTag.addAttribute(\"height\", height);\n iframeTag.addAttribute(\"frameborder\", \"no\");\n iframeTag.addAttribute(\"scrolling\", \"no\");\n strEditor.append(iframeTag);\n\n }\n else\n {\n XHtmlTagTool textareaTag = new XHtmlTagTool(\"textarea\", encodedValue);\n textareaTag.addAttribute(\"name\", instanceName);\n textareaTag.addAttribute(\"rows\", \"4\");\n textareaTag.addAttribute(\"cols\", \"40\");\n textareaTag.addAttribute(\"wrap\", \"virtual\");\n textareaTag.addAttribute(\"style\", \"width: \".concat(width).concat(\"; height: \").concat(height));\n }\n strEditor.append(\"</div>\");\n return strEditor.toString();\n }", "@Given(\"I am on the Project Contact Details Page\")\n public void i_am_on_the_project_contact_details_page(){\n i_logged_into_Tenant_Manager_Project_list_page();\n i_click_on_create_a_new_project();\n\n }", "private void buildView() {\n this.setHeaderInfo(model.getHeaderInfo());\n\n CWButtonPanel buttonPanel = this.getButtonPanel();\n \n buttonPanel.add(saveButton);\n buttonPanel.add(saveAndCloseButton);\n buttonPanel.add(cancelButton);\n \n FormLayout layout = new FormLayout(\"pref, 4dlu, 200dlu, 4dlu, min\",\n \"pref, 2dlu, pref, 2dlu, pref, 2dlu, pref\"); // rows\n\n layout.setRowGroups(new int[][]{{1, 3, 5}});\n \n CellConstraints cc = new CellConstraints();\n this.getContentPanel().setLayout(layout);\n \n this.getContentPanel().add(nameLabel, cc.xy (1, 1));\n this.getContentPanel().add(nameTextField, cc.xy(3, 1));\n this.getContentPanel().add(descLabel, cc.xy(1, 3));\n this.getContentPanel().add(descTextField, cc.xy(3, 3));\n this.getContentPanel().add(amountLabel, cc.xy(1, 5));\n this.getContentPanel().add(amountTextField, cc.xy(3, 5));\n }", "@Override\r\n public void onSubmit() {\r\n ProjectOverviewerApplication app = (ProjectOverviewerApplication)getApplication();\r\n \r\n // check if any field is missing\r\n boolean hasAllFields = true;\r\n if (this.projectName == null) {\r\n hasAllFields = false;\r\n error(\"Project name is required.\");\r\n }\r\n if (this.ownerName == null) {\r\n hasAllFields = false;\r\n error(\"Owner name is required.\");\r\n }\r\n if (this.password == null) {\r\n hasAllFields = false;\r\n error(\"Password is required.\");\r\n }\r\n if (this.svnUrl == null) {\r\n hasAllFields = false;\r\n error(\"The repository URL is required.\");\r\n }\r\n \r\n if (hasAllFields) {\r\n try {\r\n // check if the owner is a valid hackystat user\r\n String host = app.getSensorBaseHost();\r\n SensorBaseClient client = new SensorBaseClient(host, this.ownerName, this.password);\r\n client.authenticate();\r\n }\r\n catch (SensorBaseClientException e) {\r\n error(\"Owner is not valid Hackystat user or password does not match.\");\r\n }\r\n \r\n try {\r\n // check if the svn url is a valid google host url\r\n WebConversation wc = new WebConversation();\r\n WebResponse response = wc.getResponse(this.svnUrl);\r\n if (!response.getTitle().contains(\"Revision\")) {\r\n error(\"The repository URL is not a valid Google host repository URL.\");\r\n }\r\n }\r\n catch (Exception e) {\r\n error(\"Cannot connect to the repository URL.\");\r\n }\r\n \r\n // if there is no error, create the project and go back to the home page\r\n if (!hasError() && createProject()) {\r\n // redirect to the projects page\r\n setResponsePage(ProjectsPage.class);\r\n }\r\n else {\r\n error(\"The project cannot be created. \" +\r\n \"A project with the same name already exists, or some information are invalid.\");\r\n }\r\n }\r\n \r\n }", "public String getProjectTeamName(){\n return \"The name of the project of this researcher is \"+\n name_of_project_team +\n \"\\n*******\\n\";\n }", "private void renderObjetos() {\n \tcpPrincipal.add(_cPrincipal);\n\n _cPrincipal.add(rPrincipal);\n rPrincipal.add(cLabels);\n rPrincipal.add(cTexts);\n \n //rPrincipal.setBorder(new Border(1, Color.BLUE,Border.STYLE_DASHED));\n \n _cPrincipal.add(rMensaje);\n _cPrincipal.add(rBotones); \n \n cLabels.add(lApellido);\n cLabels.add(lNombres);\n cLabels.add(lDocNum);\n cLabels.add(lTelefono);\n cLabels.add(lCelular);\n //cLabels.add(lRazonSocial);\n \n cTexts.add(tApellido);\n cTexts.add(tNombres); \n cTexts.add(tDoc);\n cTexts.add(tTelefono);\n cTexts.add(tCelular);\n //cTexts.add(tRazonSocial); \n \n rMensaje.add(lMensaje);\n\n ApplicationInstance.getActive().setFocusedComponent(tApellido);\n \n }", "@SneakyThrows\n private void editProject(MouseEvent event) {\n final Project project = table.getSelectionModel().getSelectedItem();\n if (project == null) {\n NotificationUtil.warningAlert(\"Warning\", \"Select project first\", NotificationUtil.SHORT);\n return;\n }\n final FXMLLoader fxmlLoader = new FXMLLoader();\n fxmlLoader.setLocation(getClass().getResource(\"/entity/update/UpdateProject.fxml\"));\n Parent parent = fxmlLoader.load();\n UpdateProjectController updateProjectController = fxmlLoader.getController();\n updateProjectController.editCurrentProject(project);\n\n final Stage stage = new Stage();\n Scene value = new Scene(parent);\n value.getStylesheets().add(\"css/main.css\");\n stage.setScene(value);\n stage.initModality(Modality.WINDOW_MODAL);\n Window window = ((Node) event.getSource()).getScene().getWindow();\n stage.initOwner(window);\n stage.show();\n\n stage.setOnHiding(e -> loadProjects());\n }", "public String getProjectTitle()\r\n {\r\n return (m_projectTitle);\r\n }", "public OutputSummary() throws IOException\n\t{\n\t\tsetBorder(BorderFactory.createRaisedBevelBorder());\n\t\tthis.setPreferredSize(new Dimension(500, 600));\n\t\tthis.setVisible(true);\n\t\teditorPane = new JEditorPane();\n\t\teditorPane.setText(\"<output here>\");\n\t\teditorPane.setContentType(\"text/html\");\n\t\tJScrollPane editorScrollPane = new JScrollPane(editorPane);\n\t\teditorScrollPane.setVerticalScrollBarPolicy(\n\t\t JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n\t\teditorScrollPane.setPreferredSize(new Dimension(490, 600));\n\t\tthis.add(editorScrollPane);\n\t}", "public void generateDetailHtml(String filename)\n {\n\tString htmlFileName = \"ddetail.html\";\n\tString panelSection = null;\n\tFileWriter writer = null;\n\tif (filename != null)\n htmlFileName = filename;\n\ttry \n\t {\n\t writer = new FileWriter(htmlFileName);\n\t writer.write(\"<HTML><BODY>\\n\");\n\t Iterator panelIter = panelTable.values().iterator();\n while (panelIter.hasNext())\n\t {\n\t\tPanelInfo panel = (PanelInfo) panelIter.next();\n\t\tif (panel.isPrimary())\n\t\t {\n\t\t panelSection = generatePanelDetails(panel);\n\t\t writer.write(panelSection);\n\t\t }\n\t\t}\n\t writer.write(\"</BODY></HTML>\\n\");\n\t writer.close();\n\t }\n\n\tcatch (IOException ioe)\n\t {\n\t System.out.println(\"Error creating or writing to \" + htmlFileName);\n\t ioe.printStackTrace();\n\t }\n\t}", "public void buildDocument() {\n/* 310 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 312 */ syncAccessMethods();\n/* */ }", "public void buildDocument() {\n/* 248 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 250 */ syncAccessMethods();\n/* */ }", "@GET\r\n @Produces(\"text/html\")\r\n public String getHtml() {\r\n return \"<html><body>the solution is :</body></html> \";\r\n }", "private static JEditorPane editorPane()\n {\n try\n {\n JEditorPane editor = new JEditorPane(); //this will be the editor returned\n editor.setPage(Resources.getResource(filename)); //gives the editor the URL of the HTML file\n editor.setEditable(false); //prevents the about page from being edited\n return editor; //return the editor which is now displaying the HTML file\n } catch(Exception e){\n e.printStackTrace();\n JOptionPane.showMessageDialog(null, \"ERROR: could not access about.HTML file\");\n return null; //if the editor could not be built\n }\n }", "@Override\n public String getHelpFile() {\n final String filePath = \"/descriptor/au.com.centrumsystems.hudson.plugin.buildpipeline.trigger.BuildPipelineTrigger/help\";\n final String fileName = \"buildPipeline.html\";\n return String.format(\"%s/%s\", filePath, fileName);\n }", "public String getProjectTitle() {\n\n\t\tif (projectTitle != null)\n\t\t\treturn ProteomeXchangeFilev2_1.MTD + TAB + \"project_title\" + TAB + projectTitle;\n\t\treturn null;\n\t}", "public void updateDescriptionText() {\n \n String toolTipText = new String(\"<html>\");\n \n if (!m_OptionsWereValid) {\n \n toolTipText += \"<font COLOR=\\\"#FF0000\\\">\"\n\t+ \"<b>Invalid Model:</b><br>\" + m_ErrorText + \"<br></font>\";\n }\n \n toolTipText += \"<TABLE>\";\n \n PropertyDescriptor properties[] = null;\n MethodDescriptor methods[] = null;\n \n try {\n BeanInfo bi = Introspector.getBeanInfo(m_Classifier.getClass());\n properties = bi.getPropertyDescriptors();\n methods = bi.getMethodDescriptors();\n } catch (IntrospectionException ex) {\n System.err.println(\"LibraryModel: Couldn't introspect\");\n return;\n }\n \n for (int i = 0; i < properties.length; i++) {\n \n if (properties[i].isHidden() || properties[i].isExpert()) {\n\tcontinue;\n }\n \n String name = properties[i].getDisplayName();\n Class type = properties[i].getPropertyType();\n Method getter = properties[i].getReadMethod();\n Method setter = properties[i].getWriteMethod();\n \n // Only display read/write properties.\n if (getter == null || setter == null) {\n\tcontinue;\n }\n \n try {\n\tObject args[] = {};\n\tObject value = getter.invoke(m_Classifier, args);\n\t\n\tPropertyEditor editor = null;\n\tClass pec = properties[i].getPropertyEditorClass();\n\tif (pec != null) {\n\t try {\n\t editor = (PropertyEditor) pec.newInstance();\n\t } catch (Exception ex) {\n\t // Drop through.\n\t }\n\t}\n\tif (editor == null) {\n\t editor = PropertyEditorManager.findEditor(type);\n\t}\n\t//editors[i] = editor;\n\t\n\t// If we can't edit this component, skip it.\n\tif (editor == null) {\n\t continue;\n\t}\n\tif (editor instanceof GenericObjectEditor) {\n\t ((GenericObjectEditor) editor).setClassType(type);\n\t}\n\t\n\t// Don't try to set null values:\n\tif (value == null) {\n\t continue;\n\t}\n\t\n\ttoolTipText += \"<TR><TD>\" + name + \"</TD><TD>\"\n\t+ value.toString() + \"</TD></TR>\";\n\t\n } catch (InvocationTargetException ex) {\n\tSystem.err.println(\"Skipping property \" + name\n\t + \" ; exception on target: \" + ex.getTargetException());\n\tex.getTargetException().printStackTrace();\n\tcontinue;\n } catch (Exception ex) {\n\tSystem.err.println(\"Skipping property \" + name\n\t + \" ; exception: \" + ex);\n\tex.printStackTrace();\n\tcontinue;\n }\n }\n \n toolTipText += \"</TABLE>\";\n toolTipText += \"</html>\";\n m_DescriptionText = toolTipText;\n }", "@SuppressWarnings(\"serial\")\n\tpublic ProjectPage() {\n\t\tagregarForm();\n\t}", "void showTodoViewToEdit(Task task);", "public CreateProjectPanel() {\n isFinished = true;\n }", "public String visualizzaCampo(){\n\t\tString info= new String(\"Nome: \"+ nome +\"\\n\" +\"Descrizione: \" + descrizione+ \"\\n\"+ \"Obbligatoria: \" + obbligatorio +\"\\n\");\n\t\treturn info;\n\t}", "public abstract ProjectBean getSystemProject();", "public AbstractProjectTaskPanel(String title, Model model, int width, int height, Color colour) {\n this.model = model;\n setLayout(null);\n this.setSize(width, height);\n this.setBorder(BorderFactory.createLineBorder(colour));\n\n JLabel panelLabel = new JLabel(title, SwingConstants.CENTER);\n panelLabel.setBounds(0, 2, width, 15);\n panelLabel.setForeground(colour);\n panelLabel.setFocusable(false);\n this.add(panelLabel);\n\n JLabel titleLabel = new JLabel(\"Title:\");\n titleLabel.setBounds(5, 22, FIELD_START - 2, 15);\n titleLabel.setFocusable(false);\n this.add(titleLabel);\n titleEntry = new JTextField();\n titleEntry.setBounds(FIELD_START, 18, 240, 20);\n this.add(titleEntry);\n \n JLabel descriptionLabel = new JLabel(\"Description:\");\n descriptionLabel.setBounds(5, 40, FIELD_START - 2, 15);\n descriptionLabel.setFocusable(false);\n this.add(descriptionLabel);\n descriptionEntry = new JTextField();\n descriptionEntry.setBounds(FIELD_START, 38, 340, 20);\n this.add(descriptionEntry);\n\n JLabel parentLabel = new JLabel(\"Parent: \");\n parentLabel.setBounds(5, 60, FIELD_START - 2, 15);\n parentLabel.setFocusable(false);\n this.add(parentLabel);\n parentEntry = new JComboBox<>();\n parentEntry.setModel(model.getProjectComboBoxModel());\n parentEntry.setBounds(FIELD_START, 58, 240, 20);\n this.add(parentEntry);\n\n JLabel due_Date = new JLabel(\"Due Date: \");\n due_Date.setBounds(5, 80, FIELD_START - 2, 15);\n due_Date.setFocusable(false);\n this.add(due_Date);\n\n dueDateModel = new UtilCalendarModel();\n JDatePanelImpl dueDatePanel = new JDatePanelImpl(dueDateModel);\n JDatePickerImpl dueDatePicker = new JDatePickerImpl(dueDatePanel);\n dueDatePicker.setBounds(FIELD_START, 74, 150, 22);\n this.add(dueDatePicker);\n\n addButton = new JButton(\"Add\");\n addButton.setBounds(width - 65, height - 25, 60, 20);\n addButton.setEnabled(true);\n addButton.addActionListener(this::addProjectTask);\n this.add(addButton);\n\n modifyButton = new JButton(\"Modify\");\n modifyButton.setBounds(width - 65, height - 25, 60, 20);\n modifyButton.setEnabled(false);\n modifyButton.setVisible(false);\n modifyButton.addActionListener(this::modifyProjectTask);\n this.add(modifyButton);\n \n model.addSelectionListener(this::treeSelectionChanged);\n }", "private void createGUI() {\n myPanel.setLayout(new GridBagLayout());\n\n // Save\n bSave = new JButton(\"Save\");\n bSave.setMnemonic(KeyEvent.VK_S);\n bSave.setEnabled(false);\n bSave.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n Document doc = view.getDocument();\n try {\n FileWriter w =\n new FileWriter(view.getPage().getFile());\n w.write(view.getText(), 0, view.getText().length());\n w.close();\n }\n catch (IOException ex) {\n // Debug\n ex.printStackTrace();\n }\n setDirty(false);\n }\n });\n bSave.setToolTipText(\"Save changes\");\n\n\t// View\n\tview = new PrintPane();\n view.setEditorKit(view.getEditorKitForContentType(\"text/html\"));\n view.setEditable(false);\n view.setMargin(new Insets(10,10,10,10));\n view.addCaretListener(new CaretListener() {\n public void caretUpdate(CaretEvent e) {\n if (!indocListener.inwork)\n indocListener.setStart(e.getMark());\n }\n });\n\tview.addHyperlinkListener(new HyperlinkListener() {\n\t\tpublic void hyperlinkUpdate(HyperlinkEvent e) {\n\t\t if (e.getEventType() == ACTIVATED) {\n\t\t\ttry {\n String key = myData.getKey(e.getURL().toString());\n if (key.equals(\"---\")) {\n view.setPage(e.getURL());\n title.setText(key);\n }\n else {\n TreePath tp = getTreePath(key);\n indexTree.addSelectionPath(tp);\n }\n\t\t\t}\n\t\t\tcatch(Exception ex) {\n\t\t\t ex.printStackTrace();\n\t\t\t}\n\t\t }\n\t\t}\n\t });\n view.setToolTipText(\"Use popup to print page\");\n\n\t// Index\n indexTree = new JTree();\n indexTree.addTreeSelectionListener(new TreeSelectionListener() {\n public void valueChanged(TreeSelectionEvent e) {\n TreePath p = e.getNewLeadSelectionPath();\n if (p == null) return;\n Object oa[] = p.getPath();\n MutableTreeNode tn = (MutableTreeNode) oa[oa.length - 1];\n if (tn != null && tn.isLeaf()) {\n String key = \"\";\n for (int i = 1; i < oa.length; i++)\n key += \"/\" + oa[i].toString();\n key = key.substring(1);\n String s = myData.getFile(key);\n if (s == null) return;\n try {\n if (s.indexOf(\"pdf:\") == 0) {\n s = s.substring(4);\n Runtime.getRuntime().exec\n (System.getProperty(\"pdf\") + \" \" + myPath + s);\n }\n else {\n URL url = view.getPage();\n if (url != null && !myData.getKey(url.toString()).equals(\"---\")) {\n history.add(url);\n if (!linear) future.clear();\n }\n view.setPage(new URL(\"file:\" + myPath + s));\n title.setText(key);\n }\n }\n catch(Exception ex) {\n ex.printStackTrace();\n }\n myData.getLocation(key).inform();\n // Other selections\n indexTree.scrollPathToVisible(p);\n }\n }\n });\n\tindexTree.getSelectionModel().setSelectionMode\n (TreeSelectionModel.SINGLE_TREE_SELECTION);\n indexTree.setEditable(false);\n\n search = new JTextField();\n inindListener = new IncSearchDocListener(search, indexTree);\n fullListener = new MyFullListener();\n indocListener = new MyDocListener();\n\n curListener = inindListener;\n search.getDocument().addDocumentListener(curListener);\n search.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (curListener == inindListener) {\n inindListener.increment();\n inindListener.work(search.getDocument());\n }\n if (curListener == fullListener) {\n fullListener.work(search.getDocument());\n }\n if (curListener == indocListener) {\n indocListener.increment();\n indocListener.work(search.getDocument());\n }\n }\n });\n\n indexTree.addTreeSelectionListener(new TreeSelectionListener() {\n public void valueChanged(TreeSelectionEvent e) {\n TreePath p = e.getNewLeadSelectionPath();\n DefaultMutableTreeNode tn = null;\n if (p != null)\n tn = (DefaultMutableTreeNode) p.getLastPathComponent();\n if (tn != null) {\n inindListener.setStart(tn.getFirstLeaf());\n indocListener.setStart(0);\n }\n }\n });\n\n // History buttons\n forward = new JButton(\"Forward\");\n forward.setMnemonic(KeyEvent.VK_F);\n forward.setEnabled(false);\n forward.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (future.size() > 0) {\n try {\n String key = myData.getKey(future.getLast().toString());\n TreePath tp = getTreePath(key);\n linear = true;\n indexTree.addSelectionPath(tp);\n linear = false;\n future.removeLast();\n }\n catch(Exception ex) {\n ex.printStackTrace();\n }\n }\n }\n });\n forward.setToolTipText(\"Forward a page in view history\");\n\n back = new JButton(\"Back\");\n back.setMnemonic(KeyEvent.VK_B);\n back.setEnabled(false);\n back.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (history.size() > 0) {\n try {\n String key = myData.getKey(history.getLast().toString());\n TreePath tp = getTreePath(key);\n linear = true;\n indexTree.addSelectionPath(tp);\n linear = false;\n future.add(history.getLast().toString());\n history.removeLast();\n history.removeLast(); \n }\n catch(Exception ex) {\n ex.printStackTrace();\n }\n }\n }\n });\n back.setToolTipText(\"Back a page in view history\");\n\n pMenuHI = new JPopupMenu();\n JMenuItem mi1 = new JMenuItem(\"Locate\");\n pMenuHI.add(mi1);\n mi1.addActionListener(new ActionListener() {\n\t\tpublic void actionPerformed(ActionEvent e) {\n TreePath tp = indexTree.getPathForLocation(gx, gy);\n if (tp == null) return;\n Object[] oa = tp.getPath();\n if (tp.getPath().length < 4) return;\n String entry = \"\";\n for (int i = 1; i < 4; i++)\n entry += \"/\" + oa[i].toString();\n MyLocation loc = myData.getLocation(entry.substring(1));\n loc.locate();\n }\n\t });\n mi1 = new JMenuItem(\"Sound Trigger\");\n pMenuHI.add(mi1);\n mi1.addActionListener(new ActionListener() {\n\t\tpublic void actionPerformed(ActionEvent e) {\n TreePath tp = indexTree.getPathForLocation(gx, gy);\n if (tp == null) return;\n Object[] oa = tp.getPath();\n String entry = oa[oa.length - 1].toString();\n if (oa.length > 1)\n entry = oa[oa.length - 2].toString() + \"/\" + entry;\n if (oa.length > 2)\n entry = oa[oa.length - 3].toString() + \"/\" + entry;\n MyLocation loc = myData.getLocation(entry);\n if (myData.getSoundBank() != null)\n myData.getSoundBank().addLocation(loc);\n }\n\t });\n\n indexTree.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) { popup(e); }\n public void mouseReleased(MouseEvent e) { popup(e); }\n private void popup(MouseEvent e) {\n if (e.isPopupTrigger()) {\n gx = e.getX(); gy = e.getY();\n pMenuHI.show(e.getComponent(), gx, gy);\n }\n }\n });\n\n pMenuV = new JPopupMenu();\n mi1 = new JMenuItem(\"Boldface\");\n pMenuV.add(mi1);\n mi1.addActionListener(new ActionListener() {\n\t\tpublic void actionPerformed(ActionEvent e) {\n int b = view.getSelectionStart();\n String txt = view.getSelectedText();\n view.replaceSelection(\"\");\n try {\n HTMLDocument doc = (HTMLDocument)view.getDocument();\n ((HTMLEditorKit)view.getEditorKit()).insertHTML\n (doc, b, \"<b>\" + txt + \"</b>\", 0, 0, HTML.Tag.B);\n }\n catch (Exception ex) {\n // Debug\n ex.printStackTrace();\n }\n }\n });\n JMenuItem mi2 = new JMenuItem(\"Italics\");\n pMenuV.add(mi2);\n mi2.addActionListener(new ActionListener() {\n\t\tpublic void actionPerformed(ActionEvent e) {\n int b = view.getSelectionStart();\n String txt = view.getSelectedText();\n view.replaceSelection(\"\");\n try {\n HTMLDocument doc = (HTMLDocument)view.getDocument();\n ((HTMLEditorKit)view.getEditorKit()).insertHTML\n (doc, b, \"<i>\" + txt + \"</i>\", 0, 0, HTML.Tag.I);\n }\n catch (Exception ex) {\n // Debug\n ex.printStackTrace();\n }\n }\n });\n\n view.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) { popup(e); }\n public void mouseReleased(MouseEvent e) { popup(e); }\n private void popup(MouseEvent e) {\n if (e.isPopupTrigger()) {\n if (editor != null) {\n gx = e.getX(); gy = e.getY();\n pMenuV.show(e.getComponent(), gx, gy);\n }\n else {\n pPrint.show(e.getComponent(), e.getX(), e.getY());\n }\n }\n }\n });\n pPrint = new JPopupMenu();\n mi1 = new JMenuItem(\"Print\");\n pPrint.add(mi1);\n mi1.addActionListener(new ActionListener() {\n\t\tpublic void actionPerformed(ActionEvent e) {\n PrinterJob job = PrinterJob.getPrinterJob();\n job.setPrintable(view);\n if (job.printDialog()) {\n try {\n job.print();\n }\n catch (PrinterException ex) {\n // Debug\n ex.printStackTrace();\n }\n }\n }\n });\n\n // Panels\n\tJScrollPane sview = new JScrollPane(view);\n sview.getVerticalScrollBar().setUnitIncrement(10);\n sview.getHorizontalScrollBar().setUnitIncrement(10);\n\tJScrollPane sindex = new JScrollPane(indexTree);\n sindex.getVerticalScrollBar().setUnitIncrement(10);\n sindex.getHorizontalScrollBar().setUnitIncrement(10);\n\tresults = new JPanel(new GridBagLayout());\n\tsresults = new JScrollPane(results);\n sresults.getVerticalScrollBar().setUnitIncrement(10);\n sresults.getHorizontalScrollBar().setUnitIncrement(10);\n JSplitPane sp = new JSplitPane\n (JSplitPane.VERTICAL_SPLIT, sview, sresults);\n sp.setResizeWeight(.9);\n\n final JCheckBox full = new JCheckBox(\"Full\");\n full.setToolTipText(\"Full database search (non-incremental)\");\n final JCheckBox inind = new JCheckBox(\"Index\");\n inind.setSelected(true);\n inind.setToolTipText(\"Index search (incremental)\");\n final JCheckBox indoc = new JCheckBox(\"Page\");\n indoc.setToolTipText(\"Search shown page (incremental)\");\n Box three = new Box(BoxLayout.X_AXIS);\n three.add(full);\n three.add(inind);\n three.add(indoc);\n ButtonGroup bg = new ButtonGroup();\n bg.add(full);\n bg.add(inind);\n bg.add(indoc);\n ItemListener il = new ItemListener() {\n public void itemStateChanged(ItemEvent e) {\n if (e.getStateChange() != ItemEvent.SELECTED) return;\n String mod = ((JCheckBox)e.getItem()).getText();\n search.getDocument().removeDocumentListener(curListener);\n if (e.getItem() == full)\n curListener = fullListener;\n if (e.getItem() == inind)\n curListener = inindListener;\n if (e.getItem() == indoc)\n curListener = indocListener;\n results.removeAll();\n results.repaint();\n search.getDocument().addDocumentListener(curListener);\n }\n };\n full.addItemListener(il);\n inind.addItemListener(il);\n indoc.addItemListener(il);\n\n\tGridBagConstraints constr1 = new GridBagConstraints();\n\tconstr1.gridx = 0;\n\tconstr1.weightx = 1;\n\tconstr1.fill = GridBagConstraints.BOTH;\n\n\tJPanel p1 = new JPanel(new GridBagLayout());\n p1.add(back, constr1);\n p1.add(forward, constr1);\n p1.add(bSave, constr1);\n\tconstr1.weighty = 1;\n p1.add(sindex, constr1);\n constr1.weighty = 0;\n p1.add(three, constr1);\n p1.add(search, constr1);\n\n\tGridBagConstraints constr3 = new GridBagConstraints();\n\tconstr3.gridx = constr3.gridy = 0;\n\tconstr3.weightx = 1;\n constr3.weighty = 0;\n\tconstr3.fill = GridBagConstraints.HORIZONTAL;\n\n tp = new JPanel(new GridBagLayout());\n title = new JTextField();\n title.setEnabled(false);\n tp.add(title, constr3);\n\tconstr3.gridy = 1;\n constr3.weighty = 1;\n\tconstr3.fill = GridBagConstraints.BOTH;\n tp.add(sp, constr3);\n\n\tJSplitPane sp4 = new JSplitPane\n (JSplitPane.HORIZONTAL_SPLIT, p1, tp);\n sp4.setResizeWeight(.2);\n\t\n\tconstr1.weighty = 1;\n\tmyPanel.add(sp4, constr1);\n\n\t// If someone turned these value into non-Integers, we throw up\n\tint w = Integer.parseInt(myProps.getProperty(\"display.width\"));\n\tint h = Integer.parseInt(myProps.getProperty(\"display.height\"));\n\tview.setPreferredSize(new Dimension(w, h));\n }", "public String getProjectno() {\r\n return projectno;\r\n }", "private void addObjectInformation(MarkupContainer container, final DccdSB dccdHit)\n\t{\n\t\tString objectTitleStr = \"\";\n\t\tif (dccdHit.hasTridasObjectTitle())\n\t\t\tobjectTitleStr = dccdHit.getTridasObjectTitle().get(0);//tridasObject.getTitle();\n // Make a link to the project view page\n\t\t// using the object title as link text\n Link viewLink = new Link(\"project_view\")//, new Model(resultItem))\n {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t@Override\n\t\t\tpublic void onClick()\n\t\t\t{\n\t\t\t\t// now navigate to view page with given project;\n\t\t\t\tretrieveProjectAndObject(dccdHit);\n\t\t\t\t// Note: could also give selected entity object!\n\t\t\t\tString selectedEntityId = object.getId();\n\n\t\t\t\tsetResponsePage(new ProjectViewPage(project, selectedEntityId));\n\t\t\t}\n };\n container.add(viewLink);\n viewLink.add(new Label(\"object_title_link\",objectTitleStr));\n\n container.add(new Label(\"object_type\", getObjectTypeString(dccdHit)));\n\t}", "@Override\n\tpublic Pane generateForm() {\n\t\treturn painelPrincipal;\n\t}", "public void buildDocument() {\n/* 220 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 222 */ syncAccessMethods();\n/* */ }", "public static void main(String[] args) {\n\n Project project = new Project();\n project.setId(2L);\n project.setTitle(\"Title\");\n System.out.println(project);\n }", "@Override\r\n\tprotected Control createContents(Composite parent) {\n\t\tIProject project = (IProject) getElement().getAdapter(IProject.class);\r\n\t\tdfc = new DeepFileChanger(project.getLocation()\t+ \"/\" + project.getName() + \".deep\");\r\n\r\n\t\tlibPath = dfc.getContent(\"libpath\");\r\n\t\tif (!libPath.equals(\"not available\")) libPath = libPath.substring(1, libPath.length()-1);\r\n\t\tboard = dfc.getContent(\"boardtype\");\r\n\t\tprogrammer = dfc.getContent(\"programmertype\");\r\n\t\tos = dfc.getContent(\"ostype\");\r\n\t\trootclasses = dfc.getContent(\"rootclasses\");\r\n\t\timglocation = dfc.getContent(\"imgfile\");\r\n\t\timgformat = dfc.getContent(\"imgformat\");\r\n\t\tif(imglocation.equalsIgnoreCase(\"not available\") && imgformat.equalsIgnoreCase(\"not available\")){\r\n\t\t\tcreateImgFile = false;\r\n\t\t\tlastImgPathChoice = project.getLocation().toString();\r\n\t\t\tlastImgPathChoice = lastImgPathChoice.replace('/', '\\\\');\r\n\t\t}\r\n\t\telse{\r\n\t\t\tcreateImgFile = true;\r\n\t\t\tlastImgPathChoice = imglocation.replace('/', '\\\\');\r\n\t\t\tlastImgPathChoice = lastImgPathChoice.substring(1,lastImgPathChoice.length() -1 );\r\n\t\t\tint indexOfProjectName = lastImgPathChoice.lastIndexOf(\"\\\\\");\r\n\t\t\tlastImgPathChoice = lastImgPathChoice.substring(0, indexOfProjectName);\r\n\t\t\tlastImgFormatChoice = imgformat;\r\n\t\t}\r\n\t\t\r\n//\t\tSystem.out.println(dfc.fileContent.toString());\t\t\r\n//\t\tSystem.out.println(libPath);\r\n//\t\tSystem.out.println(board);\r\n//\t\tSystem.out.println(programmer);\r\n//\t\tSystem.out.println(os);\r\n//\t\tSystem.out.println(rootclasses);\r\n//\t\tSystem.out.println(lastImgPathChoice);\r\n//\t\tSystem.out.println(lastImgFormatChoice);\r\n//\t\tSystem.out.println(\"\");\r\n\r\n\t\t// read project preferences\r\n\t\tpref = getPref();\r\n\t\t\r\n\t\t// build control\r\n\t\tComposite composite = new Composite(parent, SWT.NONE);\r\n\t\tcomposite.setLayout(new GridLayout(2, false));\r\n\t\r\n\t\tGroup groupLib = new Group(composite, SWT.NONE);\r\n\t\tgroupLib.setText(\"Target Library\");\r\n\t\tGridLayout gridLayout2 = new GridLayout(2, false);\r\n\t\tgroupLib.setLayout(gridLayout2);\r\n\t\tGridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);\r\n\t\tgridData.horizontalSpan = 2;\r\n\t\tgroupLib.setLayoutData(gridData);\r\n\t\tLabel label1 = new Label(groupLib,SWT.NONE);\r\n\t\tlabel1.setText(\"Pleace specify the target library you want to use for this project.\");\r\n\t\tlabel1.setLayoutData(gridData);\r\n\t\tLabel dummy = new Label(groupLib, SWT.NONE);\r\n\t\tdummy.setLayoutData(gridData);\r\n\t\tcheck = new Button(groupLib, SWT.CHECK);\r\n\t\tcheck.setText(\"Use default library path\");\r\n\t\tcheck.setSelection(libPath.equals(defaultPath));\r\n\t\tcheck.addSelectionListener(new SelectionAdapter() {\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tif (e.widget.equals(check)) {\r\n\t\t\t\t\tif (check.getSelection()) {\r\n\t\t\t\t\t\tpath.setEnabled(false);\r\n\t\t\t\t\t\tpath.setText(defaultPath);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpath.setEnabled(true);\r\n\t\t\t\t\t\tpath.setText(lastChoice);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlibPath = path.getText();\r\n\t\t\t\t\tif (checkLibPath()) readLib();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tcheck.setLayoutData(gridData);\r\n\t\tpath = new Text(groupLib, SWT.SINGLE | SWT.BORDER);\r\n\t\tGridData gridData2 = new GridData();\r\n\t\tgridData2.horizontalAlignment = SWT.FILL;\r\n\t\tgridData2.grabExcessHorizontalSpace = true;\r\n\t\tpath.setLayoutData(gridData2);\r\n\t\tpath.setText(libPath);\r\n\t\tpath.setEnabled(!libPath.equals(defaultPath));\r\n\t\tpath.addModifyListener(new ModifyListener() {\r\n\t\t\tpublic void modifyText(ModifyEvent e) {\r\n\t\t\t\tlibPath = path.getText();\r\n\t\t\t\tif (checkLibPath()) readLib();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbrowse = new Button(groupLib, SWT.PUSH);\r\n\t\tbrowse.setText(\"Browse...\");\r\n\t\tbrowse.addSelectionListener(new SelectionAdapter() {\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tif (!check.getSelection()){\t\r\n\t\t\t\t\topenDirectoryDialog();\r\n\t\t\t\t\tif (checkLibPath()) readLib();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tlibState = new Label(groupLib,SWT.NONE);\r\n\t\tlibState.setLayoutData(gridData);\r\n\r\n//\t\tGroup groupBoard = new Group(composite, SWT.BOTTOM);\r\n\t\tGroup groupBoard = new Group(composite, SWT.NONE);\r\n\t\tgroupBoard.setText(\"Board configuration\");\r\n\t\tGridLayout groupLayout1 = new GridLayout(2, false);\r\n\t\tgroupBoard.setLayout(groupLayout1);\r\n\t\tGridData gridData3 = new GridData();\r\n\t\tgridData3.horizontalAlignment = SWT.FILL;\r\n\t\tgridData3.grabExcessHorizontalSpace = true;\r\n\t\tgridData3.horizontalSpan = 2;\r\n\t\tgroupBoard.setLayoutData(gridData3);\r\n\t\tLabel boardLabel = new Label(groupBoard, SWT.NONE);\r\n\t\tboardLabel.setText(\"Select a board\");\r\n\t\tboardCombo = new Combo(groupBoard, SWT.VERTICAL | SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);\r\n\t\tboardCombo.addSelectionListener(listener);\r\n\t\tLabel progLabel = new Label(groupBoard, SWT.NONE);\r\n\t\tprogLabel.setText(\"Select a programmer\");\r\n\t\tprogrammerCombo = new Combo(groupBoard, SWT.VERTICAL | SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);\r\n\t\tprogrammerCombo.addSelectionListener(listener);\r\n\r\n//\t\tGroup groupOS = new Group(composite, SWT.BOTTOM);\r\n\t\tGroup groupOS = new Group(composite, SWT.NONE);\r\n\t\tgroupOS.setText(\"Runtime system\");\r\n\t\tGridLayout groupLayout2 = new GridLayout(2, false);\r\n\t\tgroupOS.setLayout(groupLayout2);\r\n\t\tGridData gridData4 = new GridData();\r\n\t\tgridData4.horizontalAlignment = SWT.FILL;\r\n\t\tgridData4.grabExcessHorizontalSpace = true;\r\n\t\tgridData4.horizontalSpan = 2;\r\n\t\tgroupOS.setLayoutData(gridData4);\r\n\t\tLabel osLabel = new Label(groupOS,SWT.NONE);\r\n\t\tosLabel.setText(\"Select a operating system\");\r\n\t\tosCombo = new Combo(groupOS, SWT.VERTICAL | SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);\r\n\t\tosCombo.addSelectionListener(listener);\r\n\r\n\t\tGroup groupImg = new Group(composite, SWT.NONE);\r\n\t\tgroupImg.setText(\"Image file creation\");\r\n\t\tGridLayout gridLayoutImg = new GridLayout(2,false);\r\n\t\tgroupImg.setLayout(gridLayoutImg);\r\n\t\tGridData gridDataImg = new GridData(SWT.FILL, SWT.CENTER, true, false);\r\n\t\tgridDataImg.horizontalSpan = 2;\t\t\r\n\t\tcheckImg = new Button(groupImg, SWT.CHECK);\r\n\t\tcheckImg.setText(\"Create image file\");\r\n\t\tcheckImg.setSelection(false);\r\n\t\tcheckImg.addSelectionListener(new SelectionAdapter() {\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tif(e.widget.equals(checkImg)) {\r\n\t\t\t\t\tif (checkLibPath()) readLib();\r\n\t\t\t\t\tif(checkImg.getSelection()) {\r\n\t\t\t\t\t\tpathImg.setEnabled(true);\r\n\t\t\t\t\t\tpathImg.setText(lastImgPathChoice);\r\n\t\t\t\t\t\tbrowseImg.setEnabled(true);\r\n\t\t\t\t\t\timgFormatCombo.setEnabled(true);\r\n\t\t\t\t\t\tindexImgFormat = 0;\r\n\t\t\t\t\t\tfor (int i = 0; i < Configuration.formatMnemonics.length; i++) {\r\n\t\t\t\t\t\t\tif (lastImgFormatChoice.equalsIgnoreCase(Configuration.formatMnemonics[i])) indexImgFormat = i;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\timgFormatCombo.select(indexImgFormat);\r\n\t\t\t\t\t\tcreateImgFile = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpathImg.setEnabled(false);\r\n\t\t\t\t\t\tpathImg.setText(lastImgPathChoice);\r\n\t\t\t\t\t\tbrowseImg.setEnabled(false);\r\n\t\t\t\t\t\timgFormatCombo.setEnabled(false);\r\n\t\t\t\t\t\tindexImgFormat = 0;\r\n\t\t\t\t\t\tfor (int i = 0; i < Configuration.formatMnemonics.length; i++) {\r\n\t\t\t\t\t\t\tif (lastImgFormatChoice.equalsIgnoreCase(Configuration.formatMnemonics[i])) indexImgFormat = i;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\timgFormatCombo.select(indexImgFormat);\r\n\t\t\t\t\t\tcreateImgFile = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tcheckImg.setLayoutData(gridDataImg);\r\n\t\t\r\n\t\tGridData gridDataImg2 = new GridData(SWT.FILL, SWT.FILL, true, false);\r\n\t\tpathImg = new Text(groupImg, SWT.SINGLE | SWT.BORDER);\r\n\t\tpathImg.setLayoutData(gridDataImg2);\r\n\t\tpathImg.setEnabled(false);\r\n\t\tpathImg.addModifyListener(new ModifyListener() {\r\n\t\t\tpublic void modifyText(ModifyEvent e) {\r\n\t\t\t\timglocation = pathImg.getText();\r\n\t\t\t\tif (checkLibPath()) readLib();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbrowseImg = new Button(groupImg, SWT.PUSH);\r\n\t\tbrowseImg.setText(\"Browse...\");\r\n\t\tbrowseImg.setEnabled(false);\r\n\t\tbrowseImg.addSelectionListener(new SelectionAdapter() {\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tif (checkImg.getSelection()) {\t\r\n\t\t\t\t\topenImgDirectoryDialog();\r\n\t\t\t\t\tif (checkLibPath()) readLib();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\t\r\n\t\tGridData gridDataImg3 = new GridData(SWT.FILL, SWT.FILL, true, false);\r\n\t\tgridDataImg3.horizontalSpan = 2;\r\n\t\tLabel imgFormatLabel = new Label(groupImg,SWT.NONE);\r\n\t\timgFormatLabel.setText(\"Select image file format\");\r\n\t\timgFormatCombo = new Combo(groupImg, SWT.VERTICAL | SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);\r\n\t\timgFormatCombo.setEnabled(false);\r\n\t\timgFormatCombo.setLayoutData(gridDataImg3);\r\n\t\timgFormatCombo.addSelectionListener(listener);\r\n\t\tindexImgFormat = 0;\r\n\t\tfor (int i = 0; i < Configuration.formatMnemonics.length; i++) {\r\n\t\t\tif (lastImgFormatChoice.equalsIgnoreCase(Configuration.formatMnemonics[i])) indexImgFormat = i;\r\n\t\t}\r\n\t\timgFormatCombo.select(indexImgFormat);\r\n\t\t\r\n\t\t//initial values of Image file creation\r\n\t\tif(createImgFile){\r\n\t\t\tcheckImg.setSelection(true);\r\n\t\t\tpathImg.setEnabled(true);\r\n\t\t\tpathImg.setText(lastImgPathChoice);\r\n\t\t\tbrowseImg.setEnabled(true);\r\n\t\t\timgFormatCombo.setEnabled(true);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tcheckImg.setSelection(false);\r\n\t\t\tpathImg.setEnabled(false);\r\n\t\t\tpathImg.setText(lastImgPathChoice);\r\n\t\t\tbrowseImg.setEnabled(false);\r\n\t\t\timgFormatCombo.setEnabled(false);\r\n\t\t}\r\n\t\t\r\n\t\tif (checkLibPath()) readLib(); else libPath = \"not available\";\r\n\t\treturn composite;\r\n\t}", "protected void createContents() {\n setText(BUNDLE.getString(\"TranslationManagerShell.Application.Name\"));\n setSize(599, 505);\n\n final Composite cmpMain = new Composite(this, SWT.NONE);\n cmpMain.setLayout(new FormLayout());\n\n final Composite cmpControls = new Composite(cmpMain, SWT.NONE);\n final FormData fd_cmpControls = new FormData();\n fd_cmpControls.right = new FormAttachment(100, -5);\n fd_cmpControls.top = new FormAttachment(0, 5);\n fd_cmpControls.left = new FormAttachment(0, 5);\n cmpControls.setLayoutData(fd_cmpControls);\n cmpControls.setLayout(new FormLayout());\n\n final ToolBar modifyToolBar = new ToolBar(cmpControls, SWT.FLAT);\n\n tiSave = new ToolItem(modifyToolBar, SWT.PUSH);\n tiSave.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Save\"));\n tiSave.setEnabled(false);\n tiSave.setDisabledImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/d_save.gif\"));\n tiSave.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_save.gif\"));\n\n tiUndo = new ToolItem(modifyToolBar, SWT.PUSH);\n tiUndo.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Undo\"));\n tiUndo.setEnabled(false);\n tiUndo.setDisabledImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/d_reset.gif\"));\n tiUndo.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_reset.gif\"));\n\n tiDeleteSelected = new ToolItem(modifyToolBar, SWT.PUSH);\n tiDeleteSelected.setDisabledImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/d_remove.gif\"));\n tiDeleteSelected.setEnabled(false);\n tiDeleteSelected.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Delete\"));\n tiDeleteSelected.setImage(SWTResourceManager.getImage(TranslationManagerShell.class,\n \"/images/tools16x16/e_remove.gif\"));\n\n txtFilter = new LVSText(cmpControls, SWT.BORDER);\n final FormData fd_txtFilter = new FormData();\n fd_txtFilter.right = new FormAttachment(25, 0);\n fd_txtFilter.top = new FormAttachment(modifyToolBar, 0, SWT.CENTER);\n fd_txtFilter.left = new FormAttachment(modifyToolBar, 25, SWT.RIGHT);\n txtFilter.setLayoutData(fd_txtFilter);\n\n final ToolBar filterToolBar = new ToolBar(cmpControls, SWT.FLAT);\n final FormData fd_filterToolBar = new FormData();\n fd_filterToolBar.top = new FormAttachment(modifyToolBar, 0, SWT.TOP);\n fd_filterToolBar.left = new FormAttachment(txtFilter, 5, SWT.RIGHT);\n filterToolBar.setLayoutData(fd_filterToolBar);\n\n tiFilter = new ToolItem(filterToolBar, SWT.NONE);\n tiFilter.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_find.gif\"));\n tiFilter.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Filter\"));\n\n tiLocale = new ToolItem(filterToolBar, SWT.DROP_DOWN);\n tiLocale.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Locale\"));\n tiLocale.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_globe.png\"));\n\n menuLocale = new Menu(filterToolBar);\n addDropDown(tiLocale, menuLocale);\n\n lblSearchResults = new Label(cmpControls, SWT.NONE);\n lblSearchResults.setVisible(false);\n final FormData fd_lblSearchResults = new FormData();\n fd_lblSearchResults.top = new FormAttachment(filterToolBar, 0, SWT.CENTER);\n fd_lblSearchResults.left = new FormAttachment(filterToolBar, 5, SWT.RIGHT);\n lblSearchResults.setLayoutData(fd_lblSearchResults);\n lblSearchResults.setText(BUNDLE.getString(\"TranslationManagerShell.Label.Results\"));\n\n final ToolBar translateToolBar = new ToolBar(cmpControls, SWT.NONE);\n final FormData fd_translateToolBar = new FormData();\n fd_translateToolBar.top = new FormAttachment(filterToolBar, 0, SWT.TOP);\n fd_translateToolBar.right = new FormAttachment(100, 0);\n translateToolBar.setLayoutData(fd_translateToolBar);\n\n tiDebug = new ToolItem(translateToolBar, SWT.PUSH);\n tiDebug.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Debug\"));\n tiDebug.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/debug.png\"));\n\n new ToolItem(translateToolBar, SWT.SEPARATOR);\n\n tiAddBase = new ToolItem(translateToolBar, SWT.PUSH);\n tiAddBase.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.AddBase\"));\n tiAddBase.setImage(SWTResourceManager.getImage(TranslationManagerShell.class, \"/images/tools16x16/e_add.gif\"));\n\n tiTranslate = new ToolItem(translateToolBar, SWT.CHECK);\n tiTranslate.setToolTipText(BUNDLE.getString(\"TranslationManagerShell.ToolTip.Translate\"));\n tiTranslate.setImage(SWTResourceManager\n .getImage(TranslationManagerShell.class, \"/images/tools16x16/target.png\"));\n\n cmpTable = new Composite(cmpMain, SWT.NONE);\n cmpTable.setLayout(new FillLayout());\n final FormData fd_cmpTable = new FormData();\n fd_cmpTable.bottom = new FormAttachment(100, -5);\n fd_cmpTable.right = new FormAttachment(cmpControls, 0, SWT.RIGHT);\n fd_cmpTable.left = new FormAttachment(cmpControls, 0, SWT.LEFT);\n fd_cmpTable.top = new FormAttachment(cmpControls, 5, SWT.BOTTOM);\n cmpTable.setLayoutData(fd_cmpTable);\n\n final Menu menu = new Menu(this, SWT.BAR);\n setMenuBar(menu);\n\n final MenuItem menuItemFile = new MenuItem(menu, SWT.CASCADE);\n menuItemFile.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.File\"));\n\n final Menu menuFile = new Menu(menuItemFile);\n menuItemFile.setMenu(menuFile);\n\n menuItemExit = new MenuItem(menuFile, SWT.NONE);\n menuItemExit.setAccelerator(SWT.ALT | SWT.F4);\n menuItemExit.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.File.Exit\"));\n\n final MenuItem menuItemHelp = new MenuItem(menu, SWT.CASCADE);\n menuItemHelp.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.Help\"));\n\n final Menu menuHelp = new Menu(menuItemHelp);\n menuItemHelp.setMenu(menuHelp);\n\n menuItemDebug = new MenuItem(menuHelp, SWT.NONE);\n menuItemDebug.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.Help.Debug\"));\n\n new MenuItem(menuHelp, SWT.SEPARATOR);\n\n menuItemAbout = new MenuItem(menuHelp, SWT.NONE);\n menuItemAbout.setText(BUNDLE.getString(\"TranslationManagerShell.Menu.Help.About\"));\n //\n }", "@Override\n public void showActionsInformation() {\n System.out.println(\"\");\n System.out.println(\"To add a new task, please follow the instructions and press ENTER:\");\n System.out.println(\"IP.TodoListApplication.App.Task ID, IP.TodoListApplication.App.Task Title, Due Date (format: dd-mm-yyyy), IP.TodoListApplication.App.Task Status, Project Name\");\n System.out.println(\"\");\n System.out.println(\"Enter 0 to RETURN\");\n }", "private static String projectLine(double project, String projectDescription)\n {\n String temp = DEC_FORMAT.format(project) + \" - \" + projectDescription;\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, PROJECT_STR, temp);\n }", "public static void main(String[] args) {\n\t\tint i = 0;\r\n\t\tif( i == 0) {\r\n\t\t\tSystem.out.println(\"HTML_Template\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Italic String\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Underline, select, UL & OL\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Textbox, Button\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Textbox, Button value Special Characters\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Textbox, Blank\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Textbox, Special Chars\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Radio & Checkbox\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Blank Commit Msg \");\r\n\t\t\tSystem.out.println(\"HTML_Template : Image Check New\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Kovair To Jira\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Kovair To Jira at 11.07AM\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Kovair To Jira at 11.07AM SyncBack\");\r\n\t\t\tSystem.out.println(\"HTML_Template : TP-134\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Any Random Key\");\r\n\t\t\tSystem.out.println(\"HTML_Template : Test Flowqqq\");\r\n\t\t}\r\n\t}", "@RequestMapping(value= {\"/projects/{projectId}\"}, method= RequestMethod.GET)\r\n\tpublic String project(Model model, @PathVariable Long projectId) {\r\n\t\tProject project = projectService.getProject(projectId);\r\n\t\tif(project==null) { return \"redirect:/projects\"; }\r\n\t\t\r\n\t\tUser loggedUser= sessionData.getLoggedUser();\r\n\t\t\r\n\t\tList<User> members = userService.getMembers(project);\r\n\t\tList<Credentials> credentialsMembers = this.credentialsService.getCredentialsByUsers(members);\r\n\t\t\r\n\t\tif(!project.getOwner().equals(loggedUser) && !members.contains(loggedUser)) {\r\n\t\t\treturn \"redirect:/projects\";\r\n\t\t}\r\n\t\t\r\n\t\tmodel.addAttribute(\"credentialsService\", this.credentialsService);\r\n\t\tmodel.addAttribute(\"credentialsMembers\", credentialsMembers);\r\n\t\tmodel.addAttribute(\"ownerCredentials\", this.credentialsService.getCredentialsByUserId(project.getOwner().getId()));\r\n\t\tmodel.addAttribute(\"loggedCredentials\", sessionData.getLoggedCredentials());\r\n\t\tmodel.addAttribute(\"loggedUser\", loggedUser);\r\n\t\tmodel.addAttribute(\"project\", project);\r\n\t\t\r\n\t\treturn \"project\";\r\n\t}", "@Then(\"^Validate project table against pivotal project$\")\n public void allInformationOfPivotalTrackerProjectsShouldBeDisplayedInProjectTableWidgetOfMach() {\n JsonPath jsonPath = resources.getResponse().jsonPath();\n// assertEquals(jsonPath.get(\"name\"), tableProjectValues.get(\"name\"));\n// assertEquals(jsonPath.get(\"current_iteration_number\"), tableProjectValues.get(\"current_iteration\"));\n// assertEquals(jsonPath.get(\"week_start_day\"), tableProjectValues.get(\"week_start_date\"));\n assertEquals(jsonPath.get(\"name\"), \"AT01 project-01\");\n assertEquals(jsonPath.get(\"week_start_day\"), \"Monday\");\n }", "private void modifyProjectTask(ActionEvent actionEvent) {\n Calendar dueDate = dueDateModel.getValue();\n String title = titleEntry.getText();\n String description = descriptionEntry.getText();\n Project parent = (Project) parentEntry.getSelectedItem();\n modifyProjectTask(title, description, parent, dueDate);\n }", "public String getProjectDescription() {\n\t\tif (projectShortDescription != null)\n\t\t\treturn ProteomeXchangeFilev2_1.MTD + TAB + \"project_description\" + TAB + projectShortDescription;\n\t\treturn null;\n\t}", "private String html(final TableFacade tableFacade, final HttpServletRequest request) {\r\n\t\ttableFacade.setColumnProperties(\"id.invPexProductosExistencia.invArtArticulo.artCodigo\",\r\n\t\t\t\t\"id.invPexProductosExistencia.invArtArticulo.artNombre\",\r\n\t\t\t\t\"eboCantidadProducto\",\"eboSaldo\",\"audFechaCreacion\");\r\n\t\tTable table = tableFacade.getTable();\r\n\t\t\r\n\t\t//---- Titulo de la tabla\r\n\t\ttable.setCaptionKey(\"tbl.abo.caption\");\r\n\t\t\r\n\t\tRow row = table.getRow();\r\n\t\tColumn nombreColumna = row.getColumn(\"id.invPexProductosExistencia.invArtArticulo.artCodigo\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.id.invArtArticulo.artCodigo\");\r\n\r\n\t\tnombreColumna = row.getColumn(\"id.invPexProductosExistencia.invArtArticulo.artNombre\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.id.invArtArticulo.artNombre\");\r\n\t\t\r\n\t\tnombreColumna = row.getColumn(\"eboCantidadProducto\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.eboCantidadProducto\");\r\n\t\t\r\n\t\tnombreColumna = row.getColumn(\"eboSaldo\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.eboSaldo\");\r\n\t\tnombreColumna.getCellRenderer().setCellEditor(new CellEditor() {\r\n\t\t\tpublic Object getValue(Object item, String property, int rowcount) {\r\n\t\t\t\tObject value = new BasicCellEditor().getValue(item, property,\r\n\t\t\t\t\t\trowcount);\r\n\t\t\t\tInvEboExistenciaBodega existenciaBodega = (InvEboExistenciaBodega) item;\r\n\t\t\t\t\r\n\t\t\t\tvalue = \"<div align=\\\"right\\\">\"+Format.formatDinero(existenciaBodega.getEboSaldo())+\"</div>\";\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tnombreColumna = row.getColumn(\"audFechaCreacion\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.acciones\");\r\n\t\tnombreColumna.getCellRenderer().setCellEditor(new CellEditor(){\r\n\r\n\t\t\tpublic Object getValue(Object item, String property, int rowcount) {\r\n\t\t\t\tObject value = new BasicCellEditor().getValue(item, property, rowcount);\r\n\t\t\t\tInvEboExistenciaBodega bodega = (InvEboExistenciaBodega)item;\r\n\t\t\t\t\r\n\t\t\t\tHtmlBuilder html = new HtmlBuilder();\r\n\t\t\t\tvalue = \"Movimientos\";\r\n\t\t\t\tString link = tableFacade.getWebContext().getContextPath();\r\n\t\t\t\tlink += \"/inventario/movimiento.do?accion=lista&bodega=\" + bodega.getId().getInvBodBodegas().getBodId() + \"&artCod=\" + bodega.getId().getInvPexProductosExistencia().getArtCodigo();\r\n\t\t\t\thtml.a().href().quote().append(link).quote().append(\"class=\\\"linkMovimientoBod\\\"\").title(value.toString()).close();\r\n\t\t\t\t//html.a().href(link).close();\r\n\t\t\t\t//html.append(value);\r\n\t\t\t\thtml.aEnd();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\treturn html.toString();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn tableFacade.render();\r\n\t}", "@Override\r\n\tString getProjectName();", "private static void add_project() {\r\n\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t//List of building types\r\n\t\t\tString[] building_types = new String[] {\"House\", \"Apartment Block\", \"Commercial Property\", \"Industrial Property\", \"Agricultural Building\"};\r\n\t\t\t\r\n\t\t\t// Variables that are needed\r\n\t\t\tint project_id = 0;\r\n\t\t\tString project_name = \"\";\r\n\t\t\tString building_type = \"\";\r\n\t\t\tString physical_address = \"\";\r\n\t\t\tint erf_num = 0;\r\n\t\t\tString cust_surname = \"\";\r\n\t\t\tDate deadline_date = null;\r\n\t\t\tint charged = 0;\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//So first we need to select the correct customer\r\n\t\t\tString strSelect = \"SELECT * FROM people WHERE type = 'Customer'\";\r\n\t\t\tResultSet rset = stmt . executeQuery ( strSelect );\r\n\t\t\t\r\n\t\t\t// Loops through available customers from the people table so that the user can select one\r\n\t\t\tSystem.out.println(\"\\nSelect a customer for the project by typing the customers number.\");\r\n\t\t\t// This creates a list of customer ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> cust_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\tSystem.out.println ( \r\n\t\t\t\t\t\t\"Customer Num: \" + rset.getInt(\"person_id\") + \", Fullname: \" + rset.getString(\"name\") + \" \" + rset.getString(\"surname\"));\r\n\t\t\t\tcust_id_list.add(rset.getInt(\"person_id\"));\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a customer\r\n\t\t\tBoolean select_cust = true;\r\n\t\t\tint customer_id = 0;\r\n\t\t\twhile (select_cust == true) {\r\n\t\t\t\tSystem.out.println(\"Customer No: \");\r\n\t\t\t\tString customer_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcustomer_id = Integer.parseInt(customer_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < cust_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (customer_id == cust_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_cust = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_cust == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available customer id.\");\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 * @exception Throws exception if the users input for customer id is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The customer number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all available building types form the building type list\r\n\t\t\tSystem.out.print(\"Select a building type by typing the number: \\n\");\r\n\t\t\tfor (int i=0; i < 5; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \": \" + building_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a building type\r\n\t\t\tBoolean select_building = true;\r\n\t\t\tint building_index = 0;\r\n\t\t\twhile (select_building == true) {\r\n\t\t\t\tSystem.out.println(\"Building type no: \");\r\n\t\t\t\tString building_type_select_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbuilding_index = Integer.parseInt(building_type_select_str) - 1;\r\n\t\t\t\t\tbuilding_type = building_types[building_index];\r\n\t\t\t\t\tselect_building = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for building type is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The building type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// User gets to decide whether they want an automatically generated name.\r\n\t\t\tBoolean select_project_name = true;\r\n\t\t\twhile (select_project_name == true) {\r\n\t\t\t\tSystem.out.println(\"Would you like to have the project automatically named (y or n)?\");\r\n\t\t\t\tString customer_project_name_choice = input.nextLine();\r\n\t\t\t\tif (customer_project_name_choice.equals(\"y\")){\r\n\t\t\t\t\t// Gets the customers surname for the project name\r\n\t\t\t\t\tString strSelectCustSurname = String.format(\"SELECT surname FROM people WHERE person_id = '%s'\", customer_id);\r\n\t\t\t\t\tResultSet cust_surname_rset = stmt . executeQuery ( strSelectCustSurname );\r\n\t\t\t\t\twhile (cust_surname_rset.next()) {\r\n\t\t\t\t\t\tcust_surname = cust_surname_rset.getString(\"surname\");\r\n\t\t\t\t\t\tproject_name = building_type + \" \" + cust_surname;\r\n\t\t\t\t\t\tSystem.out.println(\"Project name: \" + project_name);\r\n\t\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (customer_project_name_choice.equals(\"n\")) {\r\n\t\t\t\t\tSystem.out.println(\"Provide project name: \");\r\n\t\t\t\t\tproject_name = input.nextLine();\r\n\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!customer_project_name_choice.equals(\"y\") && !customer_project_name_choice.equals(\"n\")){\r\n\t\t\t\t\tSystem.out.println(\"You can only select either y or n. Please try again\");\r\n\t\t\t\t\tselect_project_name = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter an erf number\r\n\t\t\tBoolean select_erf_num = true;\r\n\t\t\twhile (select_erf_num == true) {\r\n\t\t\t\tSystem.out.print(\"ERF number: \");\r\n\t\t\t\tString erf_num_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\terf_num = Integer.parseInt(erf_num_str);\r\n\t\t\t\t\tselect_erf_num = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for erf number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The erf number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a physical address\r\n\t\t\tSystem.out.print(\"Physical Address: \");\r\n\t\t\tphysical_address = input.nextLine();\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a date\r\n\t\t\tBoolean select_deadline_date = true;\r\n\t\t\twhile (select_deadline_date == true) {\r\n\t\t\t\tSystem.out.print(\"Deadline Date (YYYY-MM-DD): \");\r\n\t\t\t\tString deadline_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdeadline_date= Date.valueOf(deadline_date_str);\r\n\t\t\t\t\tselect_deadline_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for deadline date is not in the correct format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter a charged amount \r\n\t\t\tBoolean select_charged = true;\r\n\t\t\twhile (select_charged == true) {\r\n\t\t\t\tSystem.out.print(\"Total Cost: R \");\r\n\t\t\t\tString charged_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcharged = Integer.parseInt(charged_str);\r\n\t\t\t\t\tselect_charged = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the charged amount is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The charged amount cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the projects table\r\n PreparedStatement ps = conn.prepareStatement(\"INSERT INTO projects (project_name , building_type, physical_address, erf_num) VALUES(?,?,?,?)\");\r\n ps.setString(1, project_name);\r\n ps.setString(2, building_type);\r\n ps.setString(3, physical_address);\r\n ps.setInt(4, erf_num);\r\n \r\n // Executes the statement\r\n ps.executeUpdate();\r\n \r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects WHERE project_name = '%s'\", project_name);\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tproject_id = project_rset.getInt(\"project_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the people table\r\n\t\t\tPreparedStatement ps_customer = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\tps_customer.setInt(1, project_id);\r\n\t\t\tps_customer.setInt(2, customer_id);\r\n\t\t\tps_customer.executeUpdate();\r\n \r\n\t\t\t// This adds all the values to a prepared statement to update the project_statuses table\r\n PreparedStatement ps_status = conn.prepareStatement(\"INSERT INTO project_statuses (charged , deadline_date, project_id) VALUES(?,?,?)\");\r\n ps_status.setInt(1, charged);\r\n ps_status.setDate(2, deadline_date);\r\n ps_status.setInt(3, project_id);\r\n ps_status.executeUpdate();\r\n\r\n // Once everything has been added to the tables the project that has been added gets printed out\r\n\t\t\tResultSet project_added_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_added_rset.next()){\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"\\nProjects Added: \\n\" +\r\n\t\t\t\t\t\t\"Project Sys ID: \" + project_added_rset.getInt(\"project_id\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Project Name: \" + project_added_rset.getString(\"project_name\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Building Type: \" + project_added_rset.getString(\"building_type\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Physical Address: \" + project_added_rset.getString(\"physical_address\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Erf Number: \" + project_added_rset.getInt(\"erf_num\") + \"\\n\");\r\n\t\t\t}\r\n\t\t/**\r\n\t\t * @exception If any of the table entries cannot be created due to database constrains then the SQLException is thrown\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "private void edit() {\n\n\t}", "public void getProject(){\n\t\n\t String getList[] = clientFacade.GetProjects().split(\"\\n\");\n\t DefaultComboBoxModel addPro = new DefaultComboBoxModel();\n\t\tfor(int i=1; i<getList.length; i+=2) \n\t\t\t addPro.addElement(getList[i]);\n\t\t\t \n\t\tcPro.setModel(addPro);\t\n\t}", "public SelectProjectWizardPage build() {\r\n return new SelectProjectWizardPage(this);\r\n }", "private void buildOutput() {\n\t\tsalesSlip.addName(itemField.getText());\n\t\tsalesSlip.addPrice(Double.parseDouble(costField.getText()), Integer.parseInt(quantityField.getText()));\n\t\tsalesSlip.addQuantity(Integer.parseInt(quantityField.getText()));\n\t\tsalesSlip.updatePrice();\n\t\t\n\t\ttextArea.append(salesSlip.generateOutput(salesSlip.numItems-1));\n\t\ttextArea.append(\"\\n\");\n\t\t\n\t\ttotalArea.setText(\"$\" + salesSlip.totalPrice);\n\t}", "@Override\r\n\tpublic String shortProjectDescr() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String generateHTML() {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tString level = \"\\t\";\n\t\tstringBuilder.append(level.repeat(levelCount)+\"<div>\\n\");\n\t\tlevelCount++;\n\t\tfor (HTMLGenerator htmlGenerator : tags) {\n\t\t\tstringBuilder.append(level.repeat(levelCount)+htmlGenerator.generateHTML());\n\t\t}\n\t\tstringBuilder.append(\"</div>\\n\");\n\t\treturn stringBuilder.toString();\n\t}", "public String handleAdd() \n throws HttpPresentationException, webschedulePresentationException\n { \n\t try {\n\t Project project = new Project();\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n\t } catch(Exception ex) {\n return showAddPage(\"You must fill out all fields to add this project\");\n }\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t\tString line = request.getParameter(\"line\");\r\n\t\tString content = request.getParameter(\"content\");\r\n\t\tint Fid = Integer.parseInt(request.getParameter(\"Fid\"));\r\n\t\tint Uid = Integer.parseInt(request.getParameter(\"Uid\"));\r\n\r\n\t\tProject project = (Project) request.getSession()\r\n\t\t\t\t.getAttribute(\"project\");\r\n\r\n\t\tif (project == null) {\r\n\t\t\trequest.setAttribute(\"message\", \"please choose a project first\");\r\n\t\t\tRequestDispatcher dispatcher = request\r\n\t\t\t\t\t.getRequestDispatcher(\"/showMessage.jsp\");\r\n\t\t\tdispatcher.forward(request, response);\r\n\t\t} else {\r\n\t\t\tFile file = new File(project.getProjectItem(Fid).getPath());\r\n\t\t\tif (file.exists()) {\r\n\t\t\t\tfile.delete();\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tOutputStream out = new FileOutputStream(file);\r\n\t\t\t\tBufferedWriter rd = new BufferedWriter(new OutputStreamWriter(\r\n\t\t\t\t\t\tout, \"utf-8\"));\r\n\t\t\t\trd.write(content);\r\n\t\t\t\trd.close();\r\n\t\t\t\tout.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tRequestDispatcher dispatcher = request\r\n\t\t\t\t\t.getRequestDispatcher(\"/ProjectDetail.do?Pid=\"\r\n\t\t\t\t\t\t\t+ project.getId());\r\n\t\t\tdispatcher.forward(request, response);\r\n\t\t}\r\n\t}", "@GetMapping(\"/edit\")\r\n public String editView() {\r\n return \"modify\";\r\n }", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "private void createContents() {\r\n this.shell = new Shell(this.getParent(), this.getStyle());\r\n this.shell.setText(\"自動プロキシ構成スクリプトファイル生成\");\r\n this.shell.setLayout(new GridLayout(1, false));\r\n\r\n Composite composite = new Composite(this.shell, SWT.NONE);\r\n composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\r\n composite.setLayout(new GridLayout(1, false));\r\n\r\n Label labelTitle = new Label(composite, SWT.NONE);\r\n labelTitle.setText(\"自動プロキシ構成スクリプトファイルを生成します\");\r\n\r\n String server = Filter.getServerName();\r\n if (server == null) {\r\n Group manualgroup = new Group(composite, SWT.NONE);\r\n manualgroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\r\n manualgroup.setLayout(new GridLayout(2, false));\r\n manualgroup.setText(\"鎮守府サーバーが未検出です。IPアドレスを入力して下さい。\");\r\n\r\n Label iplabel = new Label(manualgroup, SWT.NONE);\r\n iplabel.setText(\"IPアドレス:\");\r\n\r\n final Text text = new Text(manualgroup, SWT.BORDER);\r\n GridData gdip = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n gdip.widthHint = SwtUtils.DPIAwareWidth(150);\r\n text.setLayoutData(gdip);\r\n text.setText(\"0.0.0.0\");\r\n text.addModifyListener(new ModifyListener() {\r\n @Override\r\n public void modifyText(ModifyEvent e) {\r\n CreatePacFileDialog.this.server = text.getText();\r\n }\r\n });\r\n\r\n this.server = \"0.0.0.0\";\r\n } else {\r\n this.server = server;\r\n }\r\n\r\n Button storeButton = new Button(composite, SWT.NONE);\r\n storeButton.setText(\"保存先を選択...\");\r\n storeButton.addSelectionListener(new FileSelectionAdapter(this));\r\n\r\n Group addrgroup = new Group(composite, SWT.NONE);\r\n addrgroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\r\n addrgroup.setLayout(new GridLayout(2, false));\r\n addrgroup.setText(\"アドレス(保存先のアドレスより生成されます)\");\r\n\r\n Label ieAddrLabel = new Label(addrgroup, SWT.NONE);\r\n ieAddrLabel.setText(\"IE用:\");\r\n\r\n this.iePath = new Text(addrgroup, SWT.BORDER);\r\n GridData gdIePath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);\r\n gdIePath.widthHint = SwtUtils.DPIAwareWidth(380);\r\n this.iePath.setLayoutData(gdIePath);\r\n\r\n Label fxAddrLabel = new Label(addrgroup, SWT.NONE);\r\n fxAddrLabel.setText(\"Firefox用:\");\r\n\r\n this.firefoxPath = new Text(addrgroup, SWT.BORDER);\r\n GridData gdFxPath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);\r\n gdFxPath.widthHint = SwtUtils.DPIAwareWidth(380);\r\n this.firefoxPath.setLayoutData(gdFxPath);\r\n\r\n this.shell.pack();\r\n }", "public void showProjectContext(@NonNull final Project project) {\n Picasso.with(getApplicationContext()).load(project.photo().full())\n .into(projectPhotoImageView);\n projectNameTextView.setText(project.name());\n creatorNameTextView.setText(project.creator().name());\n }", "@Override //编辑通知\n\tpublic void editPoInfo(PageData pd) throws Exception {\n\t\tdao.update(\"PoInfoMapper.editPoInfo\", pd);\n\t\t\n\t}", "public String getProjectDescribe() {\n return projectDescribe;\n }", "private void updateTexts( DocumentEvent e ) {\n Document doc = e.getDocument();\n if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument()) {\n String projectName = projectNameTextField.getText();\n \n if (doc == projectLocationTextField.getDocument()) {\n if (projectName.equals(generatedProjectName)) {\n File f = new File(projectLocationTextField.getText().trim());\n generatedProjectNameIndex = getValidProjectNameIndex(nameFormatter, generatedProjectNameIndex, f);\n } else {\n generatedProjectNameIndex = 0;\n }\n generatedProjectName = generatedProjectNameIndex > 0 ? getProjectName(nameFormatter, generatedProjectNameIndex) : null;\n if(generatedProjectNameIndex > 0) {\n projectName = generatedProjectName;\n projectNameTextField.setText(generatedProjectName);\n projectNameTextField.selectAll();\n }\n }\n \n String projectFolder = projectLocationTextField.getText();\n String projFolderPath = FileUtil.normalizeFile(new File(projectFolder)).getAbsolutePath();\n if (projFolderPath.endsWith(File.separator)) {\n createdFolderTextField.setText(projFolderPath + projectName);\n } else {\n createdFolderTextField.setText(projFolderPath + File.separator + projectName);\n }\n }\n wizard.fireChangeEvent();\n }", "public String returnXml() {\n String result = String.format(\n \"<projects>\"\n + \"<id_pr>%s</id_pr>\"\n + \"<name_project>%s</name_project>\"\n + \"<description_project>%s</description_project>\"\n + \"<code_project>%s</code_project>\"\n + \"<creationdate_project>%s</creationdate_project>\"\n + \"</projects>\",\n getId_pr(), getName_project(), getDescription_project(), getCode_project(), getCreationdate_project());\n return result;\n }", "private static String projectLine(double project)\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, PROJECT_STR, \n DEC_FORMAT.format(project));\n }", "public interface ProjectPropertiesView extends View<ProjectPropertiesView.ActionDelegate> {\n \n public interface ActionDelegate {\n /** Performs any actions appropriate in response to the user having pressed the Add button. */\n void onAddClicked();\n \n /** Performs any actions appropriate in response to the user having pressed the Edit button. */\n void onEditClicked();\n \n /** Performs any actions appropriate in response to the user having pressed the Delete button. */\n void onDeleteClicked();\n \n /** Performs any actions appropriate in response to the user having pressed the Save button. */\n void onSaveClicked();\n\n /** Performs any actions appropriate in response to the user having pressed the Cancel button. */\n void onCancelClicked();\n \n /** Returns selected property. */\n void selectedProperty(Property property);\n }\n \n /**\n * Sets whether Edit button is enabled.\n *\n * @param isEnabled\n * <code>true</code> to enable the button, <code>false</code> to disable it\n */\n void setEditButtonEnabled(boolean isEnabled);\n \n /**\n * Sets whether Delete button is enabled.\n *\n * @param isEnabled\n * <code>true</code> to enable the button, <code>false</code> to disable it\n */\n void setDeleteButtonEnabled(boolean isEnabled);\n \n /**\n * Sets whether Save button is enabled.\n *\n * @param isEnabled\n * <code>true</code> to enable the button, <code>false</code> to disable it\n */\n void setSaveButtonEnabled(boolean isEnabled);\n\n /**\n * Sets properties.\n *\n * @param projects\n */\n void setProperties(Array<Property> properties);\n \n /** Close dialog. */\n void close();\n\n /** Show dialog. */\n void showDialog();\n}", "@Override\r\n\tprotected String getProjectHelpId() {\n\t\treturn null;\r\n\t}" ]
[ "0.6225283", "0.603159", "0.58903676", "0.5614316", "0.5480011", "0.54556465", "0.5435636", "0.5387595", "0.5374063", "0.53632087", "0.53632087", "0.5337966", "0.5294281", "0.5292047", "0.5281604", "0.52491426", "0.52183545", "0.5202335", "0.5169476", "0.51605606", "0.5145045", "0.5125997", "0.51226515", "0.5117148", "0.51117355", "0.5083923", "0.5082733", "0.5082592", "0.50674325", "0.50579655", "0.5056289", "0.5055124", "0.50327516", "0.50167865", "0.5009277", "0.5006896", "0.49996904", "0.49807894", "0.49745092", "0.49733713", "0.49514607", "0.49464652", "0.49446607", "0.49407497", "0.49348927", "0.49335954", "0.49314582", "0.49301454", "0.49288192", "0.49271795", "0.4924244", "0.4898055", "0.48950323", "0.48947075", "0.48942322", "0.4889233", "0.48862806", "0.488578", "0.48745307", "0.48717356", "0.486911", "0.48689196", "0.48679116", "0.4867469", "0.4867395", "0.4865346", "0.48632622", "0.486221", "0.48615012", "0.4854988", "0.48527688", "0.48519492", "0.4845885", "0.48408297", "0.48394498", "0.4836809", "0.4836311", "0.48303232", "0.48272368", "0.48158398", "0.4813811", "0.4808017", "0.48033282", "0.48005033", "0.47971597", "0.47896725", "0.4789082", "0.47863916", "0.4777953", "0.47760454", "0.47759107", "0.47735885", "0.47700298", "0.47675878", "0.47668594", "0.4765972", "0.47621587", "0.47621563", "0.4761824", "0.4760979", "0.47605926" ]
0.0
-1
Method to save a new or existing project to the database
protected void saveProject(Project theProject) throws HttpPresentationException, webschedulePresentationException { String proj_name = this.getComms().request.getParameter(PROJ_NAME); String personID = this.getComms().request.getParameter(PERSONID); String password = this.getComms().request.getParameter(PASSWORD); String discrib = this.getComms().request.getParameter(DISCRIB); String indexnum = this.getComms().request.getParameter(INDEXNUM); String thours = this.getComms().request.getParameter(THOURS); String dhours = this.getComms().request.getParameter(DHOURS); String codeofpay = this.getComms().request.getParameter(CODEOFPAY); String contactname = this.getComms().request.getParameter(CONTACTNAME); String contactphone = this.getComms().request.getParameter(CONTACTPHONE); String contactemail = this.getComms().request.getParameter(CONTACTEMAIL); String billaddr1 = this.getComms().request.getParameter(BILLADDR1); String billaddr2 = this.getComms().request.getParameter(BILLADDR2); String billaddr3 = this.getComms().request.getParameter(BILLADDR3); String city = this.getComms().request.getParameter(CITY); String state = this.getComms().request.getParameter(STATE); String zip = this.getComms().request.getParameter(ZIP); //String accountid = this.getComms().request.getParameter(ACCOUNTID); //String isoutside = this.getComms().request.getParameter(OUTSIDE); //String exp = this.getComms().request.getParameter(EXP); String expday = this.getComms().request.getParameter(EXPDAY); String expmonth = this.getComms().request.getParameter(EXPMONTH); String expyear = this.getComms().request.getParameter(EXPYEAR); String iexpday = this.getComms().request.getParameter(IEXPDAY); String iexpmonth = this.getComms().request.getParameter(IEXPMONTH); String iexpyear = this.getComms().request.getParameter(IEXPYEAR); String notes = this.getComms().request.getParameter(NOTES); String irbnum = this.getComms().request.getParameter(IRBNUM); System.out.println(" Notes off save module "+ notes); String notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT); java.sql.Date moddatesql; //calculation for the time right now Calendar cancelinfo = Calendar.getInstance(); int todaydate = cancelinfo.get(cancelinfo.DAY_OF_MONTH); int todaymonth = cancelinfo.get(cancelinfo.MONTH); todaymonth= todaymonth+1; int todayyear = cancelinfo.get(cancelinfo.YEAR); String tempmod = todayyear+"-"+todaymonth+"-"+todaydate; moddatesql=java.sql.Date.valueOf(tempmod); java.sql.Date iacucsql,didate; String tempiacuc = iexpyear+"-"+iexpmonth+"-"+iexpday; iacucsql=java.sql.Date.valueOf(tempiacuc); //get old project information // Write to the modification file, format Date, Scanner, Who //Which project Header, Proj_name,Description, // Old project record //New project record double dthours; String dproj_name,dindex,dcname, dcphone, dfemail, dbilladdr1, dbilladdr3,dcity,dstate, dzip,dnemail; int dcode, dexpday, dexpmonth,dexpyear; //f.close(); try { dproj_name=theProject.getProj_name(); dindex=theProject.getIndexnum(); dthours=theProject.getTotalhours(); dcode=theProject.getCodeofpay(); dcname=theProject.getContactname(); dcphone=theProject.getContactphone(); dfemail=theProject.getFpemail(); dbilladdr1=theProject.getBilladdr1(); // theProject.setBilladdr2(theProject.getBilladdr2()); dbilladdr3=theProject.getBilladdr3(); dcity=theProject.getCity(); dstate=theProject.getState(); dzip=theProject.getZip(); //theProject.setAccountid(theProject.getAccountid()); dnemail=theProject.getNotifycontact(); dexpday=theProject.getExpday(); dexpmonth= theProject.getExpmonth(); dexpyear = theProject.getExpyear(); didate= theProject.getIACUCDate(); } catch(Exception ex) { throw new webschedulePresentationException("Error adding project", ex); } String s = "\n proj_name,TotalHours,SchEmail,Code,FCName,FCPhone,FCEmail,BillingAddress,Index,ExpDate,IRBDate"; try { FileOutputStream f = new FileOutputStream ("/home/emang/webschlog/projmodlog.txt",true); for (int i = 0; i < s.length(); ++i) f.write(s.charAt(i)); String s2="\n"+dproj_name+","+Double.toString(dthours)+","+dnemail+","+Integer.toString(dcode)+","+dcname+","+dcphone+","+dfemail+","+dbilladdr1+" "+dbilladdr3+" "+dcity+" "+dstate+" "+dzip+","+dindex+","+","; for (int j = 0; j < s2.length(); ++j) f.write(s2.charAt(j)); f.close(); } catch (IOException ioe) { System.out.println("IO Exception"); } try { System.out.println(" trying to saving a project one "+ proj_name); theProject.setProj_name(proj_name); System.out.println(" trying to saving a project one "+ proj_name); theProject.setPassword( theProject.getPassword()); theProject.setDescription(discrib); theProject.setIndexnum(indexnum); theProject.setTotalhours(Double.parseDouble(thours)); theProject.setDonehours( theProject.getDonehours()); theProject.setCodeofpay(Integer.parseInt(codeofpay)); theProject.setContactname(contactname); theProject.setContactphone(contactphone); theProject.setFpemail(contactemail); theProject.setBilladdr1(billaddr1); theProject.setBilladdr2(theProject.getBilladdr2()); theProject.setBilladdr3(billaddr3); theProject.setCity(city); theProject.setState(state); theProject.setZip(zip); theProject.setAccountid(theProject.getAccountid()); theProject.setNotifycontact(notifycontact); theProject.setOutside(false); theProject.setExp(false); theProject.setInstitute("UCSD"); theProject.setNotes(notes); theProject.setIRBnum(irbnum); //theProject.setCancredit(theProject.getCancredit()); /* if(null != this.getComms().request.getParameter(OUTSIDE)) { theProject.setOutside(true); } else { theProject.setOutside(false); } if(null != this.getComms().request.getParameter(EXP)) { theProject.setExp(true); } else { theProject.setExp(false); }*/ theProject.setExpday(Integer.parseInt(expday)); theProject.setExpmonth(Integer.parseInt(expmonth)); theProject.setExpyear(Integer.parseInt(expyear)); personID = theProject.getOwner().getHandle(); theProject.setOwner(PersonFactory.findPersonByID(personID)); //theProject.setOwner(theProject.getOwner()); theProject.setModDate(moddatesql); theProject.setIACUCDate(iacucsql); theProject.setModifiedby(this.getUser().getLastname()); System.out.println(" trying to saving a project two "+ proj_name); theProject.save(); System.out.println(" trying to saving a project three "+ proj_name); } catch(Exception ex) { throw new webschedulePresentationException("Error adding project", ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveNewProject(){\n String pn = tGUI.ProjectTextField2.getText();\n String pd = tGUI.ProjectTextArea1.getText();\n String statusID = tGUI.StatusComboBox.getSelectedItem().toString();\n String customerID = tGUI.CustomerComboBox.getSelectedItem().toString();\n\n int sstatusID = getStatusID(statusID);\n int ccustomerID = getCustomerID(customerID);\n\n try {\n pstat = cn.prepareStatement (\"insert into projects (project_name, project_description, project_status_id, customer_id) VALUES (?,?,?,?)\");\n pstat.setString(1, pn);\n pstat.setString(2,pd);\n pstat.setInt(3, sstatusID);\n pstat.setInt(4, ccustomerID);\n pstat.executeUpdate();\n\n }catch (SQLException ex) {\n Logger.getLogger(ProjectMethods.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void save(Project project) {\n\t\tcreate(project);\n\t}", "public void store() throws IOException, SQLException {\r\n \r\n /* Project section */\r\n final HashMap<Object, Object> projectdata = new HashMap<Object, Object>(8);\r\n \r\n if(project == null){\r\n \t// The title \r\n projectdata.put(ProjectAccessor.TITLE, title);\r\n // Create the project database object.\r\n final ProjectAccessor newProject = new ProjectAccessor(projectdata);\r\n newProject.persist(conn);\r\n projectid = (Long) newProject.getGeneratedKeys()[0];\r\n } else {\r\n \tprojectid = project.getProjectid();\r\n }\r\n }", "public void saveProject(Project project) {\n\t\tContentValues vals = new ContentValues();\n\t\tProject existing = getProjectById(project.getId());\n\n\t\t// update\n\t\tif (existing != null) {\n\t\t\tvals.put(Constants.COLUMN_STARRED, project.isStarred() ? 1 : 0);\n\t\t\tvals.put(Constants.COLUMN_SHARED, project.isShared() ? 1 : 0);\n\t\t\tvals.put(Constants.COLUMN_TITLE, project.getTitle());\n\t\t\tvals.put(Constants.COLUMN_HISTORY, project.getSerializedHistory());\n\t\t\tString where = Constants.COLUMN_ID + \" = ?\";\n\t\t\tString[] args = new String[] { project.getId() };\n\n\t\t\tdatabase.update(Constants.TABLE_PROJECTS, vals, where, args);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// add\n\t\tvals.put(Constants.COLUMN_ID, project.getId());\n\t\tvals.put(Constants.COLUMN_TITLE, project.getTitle());\n\t\tvals.put(Constants.COLUMN_STARRED, project.isStarred() ? 1 : 0);\n\t\tvals.put(Constants.COLUMN_SHARED, project.isShared() ? 1 : 0);\n\t\tvals.put(Constants.COLUMN_HISTORY, project.getSerializedHistory());\n\t\tdatabase.insert(Constants.TABLE_PROJECTS, null, vals);\n\t}", "public void save() throws InvalidIDException, SQLException {\r\n\t\t// Whether or not this is a new project being added to the database\r\n\t\tboolean newProject;\r\n\r\n\t\tif (super.id == 0) { newProject = true; }\r\n\t\telse { newProject = false; }\r\n\r\n\t\t// Call save in the Project class first. This will save general project data.\r\n\t\tsuper.save();\r\n\r\n\t\t// Get our connection to the database.\r\n\t\tConnection conn = DBConnectionManager.getPrConnection();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);\r\n\r\n\t\t\t// Get our updatable result set\r\n\t\t\tString sqlStr = \"SELECT * FROM tblTechnology WHERE projectID = \" + super.id;\r\n\t\t\trs = stmt.executeQuery(sqlStr);\r\n\r\n\t\t\t// See if we're updating a row or adding a new row.\r\n\t\t\tif (newProject == false) {\r\n\r\n\t\t\t\t// Make sure this row is actually in the database. This shouldn't ever happen.\r\n\t\t\t\tif (!rs.next()) {\r\n\t\t\t\t\tthrow new InvalidIDException(\"ID was set in Technology, but not found in database on save()\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Make sure the result set is set up w/ current values from this object\r\n\t\t\t\tif (this.groups == null) { rs.updateNull(\"techGroups\"); }\r\n\t\t\t\telse { rs.updateString(\"techGroups\", StringUtils.join(this.groups.toArray(), \",\")); }\r\n\r\n\t\t\t\t// Update the row\r\n\t\t\t\trs.updateRow();\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// We're adding a new row.\r\n\r\n\t\t\t\trs.moveToInsertRow();\r\n\r\n\t\t\t\trs.updateInt(\"projectID\", super.id);\r\n\r\n\t\t\t\tif (this.groups == null) { rs.updateNull(\"techGroups\"); }\r\n\t\t\t\telse { rs.updateString(\"techGroups\", StringUtils.join(this.groups.toArray(), \",\")); }\r\n\r\n\t\t\t\trs.insertRow();\r\n\t\t\t}\r\n\r\n\t\t\trs.close();\r\n\t\t\trs = null;\r\n\t\t\t\r\n\t\t\tstmt.close();\r\n\t\t\tstmt = null;\r\n\t\t\t\r\n\t\t\tconn.close();\r\n\t\t\tconn = null;\r\n\t\t}\r\n\t\tcatch(SQLException e) { throw e; }\r\n\t\tcatch(InvalidIDException e) { throw e; }\r\n\t\tfinally {\r\n\r\n\t\t\t// Always make sure result sets and statements are closed,\r\n\t\t\t// and the connection is returned to the pool\r\n\t\t\tif (rs != null) {\r\n\t\t\t\ttry { rs.close(); } catch (SQLException e) { ; }\r\n\t\t\t\trs = null;\r\n\t\t\t}\r\n\t\t\tif (stmt != null) {\r\n\t\t\t\ttry { stmt.close(); } catch (SQLException e) { ; }\r\n\t\t\t\tstmt = null;\r\n\t\t\t}\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry { conn.close(); } catch (SQLException e) { ; }\r\n\t\t\t\tconn = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean insertProject(Project project) throws EmployeeManagementException;", "@Test\n\tpublic void saveProjects() throws ParseException {\n\t\tproject.setEstimates(5);\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tDate parsed = format.parse(\"20110210\");\n\t\tjava.sql.Date sql = new java.sql.Date(parsed.getTime());\n\t\tproject.setdRequested(sql);\n\t\tproject.setdRequired(sql);\n\t\tproject.setCritical(true);\n\t\tproject.setType(\"DOCSMANAGE\");\n\t\tProjectKeyContacts contacts = new ProjectKeyContacts();\n\t\tcontacts.setEmail(\"assdasd.gmail.com\");\n\t\tcontacts.setFname(\"sdsd\");\n\t\tcontacts.setLname(\"asdasd\");\n\t\tcontacts.setPhone(\"asd\");\n\t\tcontacts.setRole(\"asda\");\n\t\tcontacts.setTeam(\"saad\");\n\t\tproject.setContacts(contacts);\n\t\tProjectDetails det = new ProjectDetails();\n\t\tdet.setDescription(\"asdsd\");\n\t\tdet.setName(\"asd\");\n\t\tdet.setName(\"asdad\");\n\t\tdet.setSummary(\"asdd\");\n\t\tproject.setProjectDetails(det);\n\t\tproject.setType(\"DOCSMANAGE\");\n\t\tassertEquals(controller.saveProject(project).getStatusCode(), HttpStatus.CREATED);\n\t}", "public void createProject(Project newProject);", "@PostMapping\n public ResponseEntity<Project> createNewProject(@Valid @RequestBody Project project) {\n\n Project project1 = projectService.saveOrUpdateProject(project);\n return new ResponseEntity<Project>(project1, HttpStatus.CREATED);\n }", "@Override\n public void onClick(View view) {\n String projectName = etProjectName.getText().toString();\n String projectOwner = etProjectOwner.getText().toString();\n String projectDescription = etProjectDescription.getText().toString();\n long projectId = 0; // This is just to give some value. Not used when saving new project because auto-increment in DB for this value.\n\n\n // USerid and projectname are mandatory parameters\n if( userId != 0 && projectName != null) {\n newProject = new Project(projectId, userId, projectName, projectOwner, projectDescription);\n dbHelper.saveProject(newProject);\n// showToast(\"NewprojectId:\" + newProject.projectId+ \"-->UserId: \"+ userId + \"--> ProjectName\" + newProject.projectName +\"->Owner\"+newProject.projectOwner);\n dbHelper.close();\n\n // SIIRRYTÄÄN PROJEKTILISTAUKSEEN\n Intent newProjectList = new Intent( NewProject.this, ProjectListActivity.class);\n newProjectList.putExtra(\"userId\", userId);\n startActivity(newProjectList);\n }\n\n }", "private AppTProject populateAndSaveProjectDetails(Project project, boolean isNewProject) {\r\n\t\t// Project Details\r\n\t\tAppTProject appTProject = null;\r\n\t\tif (isNewProject) {\r\n\t\t\t// Creates a new Project Entity\r\n\t\t\tappTProject = new AppTProject();\r\n\t\t\tappTProject.setCreatedDate(new Date(System.currentTimeMillis()));\r\n\t\t} else {\r\n\t\t\t// Retrieves the existing Project Entity \r\n\t\t\tappTProject = projectRepository.getOne(project.getProjectId());\r\n\t\t\tappTProject.setModifiedDate(new Date(System.currentTimeMillis()));\r\n\t\t}\r\n\t\tappTProject.setProjectName(project.getProjectName());\r\n\t\tappTProject.setPriority(project.getPriority());\r\n\t\tappTProject.setStartDate(project.getStartDate());\r\n\t\tappTProject.setEndDate(project.getEndDate());\r\n\t\tappTProject.setActive(project.getActive());\r\n\t\tif (null != project.getUser()) {\r\n\t\t\tAppTUser appTUser = new AppTUser();\r\n\t\t\tBeanUtils.copyProperties(project.getUser(), appTUser);\r\n\t\t\tappTProject.setUser(appTUser);\r\n\t\t}\r\n\t\treturn projectRepository.save(appTProject);\r\n\t}", "int insert(Project record);", "@Override\n\tpublic int saveProject(Project project) \n\t\t\tthrows DuplicateKeyException, Exception {\n\t\ttry {\n\t\t\tint numObjectUpdated = saveDomainObject(project);\n\t\t\tif (numObjectUpdated == 0) {\n\t\t\t\tthrow new Exception(\"Fail to update the Project obejct\");\n\t\t\t}\n\t\t\treturn numObjectUpdated;\n\t\t}\n\t\tcatch (MustOverrideException e) {\n\t\t\tSystem.out.println(\"JdbcProjectDao.saveProject MustOverrideException: \" + e.getMessage());\n\t\t\treturn -1;\n\t\t}\n\t\tcatch (DuplicateKeyException e) {\n\t\t\tSystem.out.println(\"JdbcProjectDao.saveProject DuplicateKeyException: \" + e.getMessage());\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"JdbcProjectDao.saveProject Exception: \" + e.getMessage());\n\t\t\tthrow e;\n\t\t}\n\t}", "public void save();", "public void save();", "public void save();", "public void save();", "public void addNewProject(final String name) {\n Project p = new Project(name);\n ApplicationWideData.addNewProject(p);\n\n Callback<Response> responseCallback = new Callback<Response>() {\n @Override\n public void success(Response response, Response response2) {\n context.refreshLists();\n }\n\n @Override\n public void failure(RetrofitError error) {\n Log.e(\"RetrofitError\", \"Actions: AddNewProject: \"+error.getMessage());\n }\n };\n\n// boolean success = LocalDataSaver.addProject(p);\n// if (success) {\n// Toast.makeText(context, \"Successful adding of new project: \" + name + \" to local database\", Toast.LENGTH_LONG).show();\n// }\n if (!ApplicationWideData.getManualSync()) {\n service.addNewProject(p, userID, responseCallback);\n }\n else{\n LocalDataSaver.addNewSelectable(p, \"Project\");\n context.refreshLists();\n }\n LocalDataSaver.saveProject(p);\n Log.wtf(\"Added project\", \"to added table\");\n\n\n Log.wtf(\"Size of added table\", LocalDataRetriver.getAllAdded().size() + \"\");\n\n }", "@ApiMethod(\n \t\tname = \"createProject\", \n \t\tpath = \"createProject\", \n \t\thttpMethod = HttpMethod.POST)\n public Project createProject(final ProjectForm projectForm) {\n\n final Key<Project> projectKey = factory().allocateId(Project.class);\n final long projectId = projectKey.getId();\n final Queue queue = QueueFactory.getDefaultQueue();\n \n // Start transactions\n Project project = ofy().transact(new Work<Project>(){\n \t@Override\n \tpublic Project run(){\n \t\tProject project = new Project(projectId, projectForm);\n ofy().save().entities(project).now();\n \n return project;\n \t}\n }); \n return project;\n }", "@PostMapping(value = \"/project\", consumes = \"application/json\", produces = \"application/json\")\n public ResponseEntity<?> addNewProject(@Valid @RequestBody Project newProject) throws URISyntaxException\n {\n newProject.setProjectid(0);\n newProject = projectService.save(newProject);\n\n // set the location header for the newly created resource\n HttpHeaders responseHeaders = new HttpHeaders();\n URI newProjectURI = ServletUriComponentsBuilder.fromCurrentRequest()\n .path(\"/{projectid}\")\n .buildAndExpand(newProject.getProjectid())\n .toUri();\n responseHeaders.setLocation(newProjectURI);\n\n return new ResponseEntity<>(null, responseHeaders, HttpStatus.CREATED);\n }", "private void add_proj_DATABASE(Project project) {\n }", "private void setProject()\n\t{\n\t\tproject.setName(tf0.getValue().toString());\n \t\tproject.setDescription(tf8.getValue().toString());\n \t\tproject.setEndDate(df4.getValue());\n \t\tif (sf6.getValue().toString().equals(\"yes\"))project.setActive(true);\n \t\telse project.setActive(false);\n \t\tif (!tf7.getValue().toString().equals(\"\"))project.setBudget(Float.parseFloat(tf7.getValue().toString()));\n \t\telse project.setBudget(-1);\n \t\tproject.setNextDeadline(df5.getValue());\n \t\tproject.setStartDate(df3.getValue());\n \t\ttry \n \t\t{\n \t\t\t\tif (sf1.getValue()!=null)\n\t\t\t\tproject.setCustomerID(db.selectCustomerforName( sf1.getValue().toString()));\n\t\t}\n \t\tcatch (SQLException|java.lang.NullPointerException e) \n \t\t{\n \t\t\tErrorWindow wind = new ErrorWindow(e); \n \t UI.getCurrent().addWindow(wind);\t\t\n \t e.printStackTrace();\n\t\t\t}\n \t\tproject.setInserted_by(\"Grigoris\");\n \t\tproject.setModified_by(\"Grigoris\");\n \t\tproject.setRowversion(1);\n \t\tif (sf2.getValue()!=null)project.setProjectType(sf2.getValue().toString());\n \t\telse project.setProjectType(null);\n\t }", "@Override\n\tpublic void createProjects(Projects proj) {\n\t\tString sql = \"INSERT INTO projects VALUES (?,?,?,?,?,?,now(),now(),?)\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tproj.getProj_id(),\n\t\t\t\tproj.getProj_name(),\n\t\t\t\tproj.getProj_desc(),\n\t\t\t\tproj.getFile_id(),\n\t\t\t\tproj.getCus_id(),\n\t\t\t\tproj.getCretd_usr(),\n\t\t\t\tproj.getProj_currency()\n\t\t});\n\t\t\n\t\tUserDetailsApp user = UserLoginDetail.getUser();\n\t\t\n\t\tCustomer cus = new Customer();\n\t\tcus = getJdbcTemplate().queryForObject(\"select * from customer where cus_id=\"+proj.getCus_id(), new BeanPropertyRowMapper<Customer>(Customer.class));\n\t\tString file_name = \"\";\n\t\tif(proj.getFile_id() != 0){\n\t\t\tFileModel myFile = new FileModel();\n\t\t\tmyFile = getJdbcTemplate().queryForObject(\"select * from file where file_id=\"+proj.getFile_id(), new BeanPropertyRowMapper<FileModel>(FileModel.class));\n\t\t\tfile_name = myFile.getFile_name();\n\t\t}\n\t\t\n\t\tString audit = \"INSERT INTO audit_logging (aud_id,parent_id,parent_object,commit_by,commit_date,commit_desc,parent_ref) VALUES (default,?,?,?,now(),?,?)\";\n\t\tthis.getJdbcTemplate().update(audit, new Object[]{\n\t\t\t\t\n\t\t\t\tproj.getProj_id(),\n\t\t\t\t\"Projects\",\n\t\t\t\tuser.getUserModel().getUsr_name(),\n\t\t\t\t\"Created row on Projects name=\"+proj.getProj_name()+\", desc=\"+proj.getProj_desc()+\", file_name=\"+file_name\n\t\t\t\t+\", customer=\"+cus.getCus_code()+\", proj_currency=\"+proj.getProj_currency(),\n\t\t\t\tproj.getProj_name()\n\t\t});\n\t}", "Project createProject();", "Project createProject();", "Project createProject();", "@Override\n\tpublic void save(Object o) {\n\t\tem.getTransaction().begin();\n\t\tem.persist((Projecttask) o);\n\t\tem.getTransaction().commit();\n\n\t}", "protected void saveProject(Project theProject)\n throws HttpPresentationException, webschedulePresentationException\n { \n\n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String personID = this.getComms().request.getParameter(PERSONID);\n String password = this.getComms().request.getParameter(PASSWORD);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n\nString contactname = this.getComms().request.getParameter(CONTACTNAME);\n\tString contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n\tString billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n\tString billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n\tString billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n\tString city = this.getComms().request.getParameter(CITY);\n\tString state = this.getComms().request.getParameter(STATE);\n\tString zip = this.getComms().request.getParameter(ZIP);\n\tString accountid = this.getComms().request.getParameter(ACCOUNTID);\n\tString isoutside = this.getComms().request.getParameter(OUTSIDE);\n\tString exp = this.getComms().request.getParameter(EXP);\n\tString expday = this.getComms().request.getParameter(EXPDAY);\n\nString expmonth = this.getComms().request.getParameter(EXPMONTH);\nString expyear = this.getComms().request.getParameter(EXPYEAR);\n\nString notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\n try {\n\tSystem.out.println(\" trying to saving a project one \"+ proj_name);\n theProject.setProj_name(proj_name);\nSystem.out.println(\" trying to saving a project one \"+ proj_name);\n theProject.setPassword(password);\n\t theProject.setDescription(discrib);\n\t theProject.setIndexnum(indexnum);\n\t theProject.setTotalhours(Double.parseDouble(thours));\n\t theProject.setDonehours(Double.parseDouble(dhours));\n theProject.setCodeofpay(Integer.parseInt(codeofpay));\n\t\n\t theProject.setContactname(contactname);\n\t theProject.setContactphone(contactphone);\n\t theProject.setBilladdr1(billaddr1);\n theProject.setBilladdr2(billaddr2);\n\ntheProject.setBilladdr3(billaddr3);\ntheProject.setCity(city);\ntheProject.setState(state);\ntheProject.setZip(zip);\ntheProject.setAccountid(accountid);\ntheProject.setNotifycontact(notifycontact);\n\n\t if(null != this.getComms().request.getParameter(OUTSIDE)) {\n \ttheProject.setOutside(true);\n \t } else {\n \ttheProject.setOutside(false);\n \t }\n if(null != this.getComms().request.getParameter(EXP)) {\n \ttheProject.setExp(true);\n \t } else {\n \ttheProject.setExp(false);\n \t }\ntheProject.setExpday(Integer.parseInt(expday));\ntheProject.setExpmonth(Integer.parseInt(expmonth));\ntheProject.setExpyear(Integer.parseInt(expyear));\n\n\t theProject.setOwner(PersonFactory.findPersonByID(personID));\n\n\ntheProject.setInstitute(\"UCSD\");\ntheProject.setFpemail(\" \");\ntheProject.setPOnum(\"0\");\ntheProject.setPOexpdate(java.sql.Date.valueOf(\"2010-09-31\"));\ntheProject.setPOhours(0);\ntheProject.setIACUCDate(java.sql.Date.valueOf(\"2010-01-01\"));\ntheProject.setModifiedby(\"Ghobrial\");\ntheProject.setModDate(java.sql.Date.valueOf(\"2010-04-30\"));\ntheProject.setNotes(\"*\");\ntheProject.setIRBnum(\"0\");\n\n//theProject.set();\n\nSystem.out.println(\" Person ID \"+ personID);\nSystem.out.println(\" contactname \"+ contactname);\nSystem.out.println(\" contact phone\"+ contactphone);\nSystem.out.println(\" isoutside \"+ isoutside);\nSystem.out.println(\" exp day \"+expday);\nSystem.out.println(\" exp month \"+ expmonth);\nSystem.out.println(\" expyear \"+ expyear);\n\n\n\n\n\nSystem.out.println(\" trying to saving a project two \"+ proj_name);\n\t theProject.save();\t\nSystem.out.println(\" trying to saving a project three \"+ proj_name);\n\t } catch(Exception ex) {\n throw new webschedulePresentationException(\"Error adding project\", ex);\n } \n }", "private boolean createProject() {\r\n ProjectOverviewerApplication app = (ProjectOverviewerApplication)getApplication();\r\n Projects projects = app.getProjects();\r\n String userHome = System.getProperty(\"user.home\");\r\n // master file for projects management\r\n File projectsFile = new File(userHome + \"/.hackystat/projectoverviewer/projects.xml\");\r\n \r\n // create new project and add it to the projects\r\n Project project = new Project();\r\n project.setProjectName(this.projectName);\r\n project.setOwner(this.ownerName);\r\n project.setPassword(this.password);\r\n project.setSvnUrl(this.svnUrl);\r\n for (Project existingProject : projects.getProject()) {\r\n if (existingProject.getProjectName().equalsIgnoreCase(this.projectName)) {\r\n return false;\r\n }\r\n }\r\n projects.getProject().add(project);\r\n \r\n try {\r\n // create the specific tm3 file and xml file for the new project\r\n File tm3File = new File(userHome + \r\n \"/.hackystat/projectoverviewer/\" + this.projectName + \".tm3\");\r\n File xmlFile = new File(userHome + \r\n \"/.hackystat/projectoverviewer/\" + this.projectName + \".xml\");\r\n tm3File.createNewFile();\r\n \r\n // initialize the data for the file\r\n SensorDataCollector collector = new SensorDataCollector(app.getSensorBaseHost(), \r\n this.ownerName, \r\n this.password);\r\n collector.getRepository(this.svnUrl, this.projectName);\r\n collector.write(tm3File, xmlFile);\r\n } \r\n catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n // write the projects.xml file with the new project added\r\n String packageName = \"org.hackystat.iw.projectoverviewer.jaxb.projects\";\r\n return XmlConverter.objectToXml(projects, projectsFile, packageName);\r\n }", "public boolean save();", "public boolean updateProject(Project project);", "public void saveAndCreateNew() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"saveAndCreateNewButton\").click();\n\t}", "@Override\n\tpublic Integer addProject(ProjectInfo project) {\n\t\treturn sqlSession.insert(\"cn.sep.samp2.project.addProject\", project);\n\t}", "@Override\n\tpublic void createProject(ProjectCreate project) {\n\t\tprojectDao.createProject(project);\n\t}", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "@Transactional\n public Long persist(ProjectDto project) {\n Objects.requireNonNull(project);\n Objects.requireNonNull(project.getName());\n if(project.getOrganizationId() == null) throw new EarException(\"Organization ID must be specified\");\n\n User user = userService.getSecurityUser();\n\n // name must not be empty\n if (project.getName().isEmpty()) throw new ValidationException(\"Name of the project can not be empty\");\n\n // project must not exist\n Project foundProject = dao.findByName(project.getName());\n if (foundProject != null) throw new AlreadyExistsException(\"Project with this name already exists\");\n\n Organization foundOrganization = organizationDao.find(project.getOrganizationId());\n if (foundOrganization == null) throw new AlreadyExistsException(\"Organization with this id doesnt exist\");\n\n if (!foundOrganization.isUserPM(user.getId())) {\n throw new ValidationException(\"Not enough rights\");\n }\n Project newProject = project.buildNewProject();\n newProject.setOrganization(foundOrganization);\n dao.persist(newProject);\n\n // Add user to project\n ProjectUser projectUser = new ProjectUser(user, newProject);\n projectUserDao.persist(projectUser);\n\n return newProject.getId();\n }", "private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}", "public boolean addProject(Project p) {\n try {\n String insert = \"INSERT INTO PROJECTS\"\n + \"(CLIENT,DESCRIPTION,HOURS,STARTDATE,DUEDATE,INVOICESENT,CLIENT_ID,PROJECT_ID) \"\n + \"VALUES(?,?,?,?,?,?,?,PROJECTS_SEQ.NEXTVAL)\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(insert);\n ps.setString(1, p.getClientId());\n ps.setString(2, p.getDescription());\n ps.setString(3, p.getHours());\n ps.setString(4, p.getStartdate());\n ps.setString(5, p.getDuedate());\n ps.setString(6, p.getInvoicesent());\n ps.setString(7, p.getClientId());\n\n ps.executeUpdate();\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "@RequestMapping(value = \"/create/project/{projectId}\", method = RequestMethod.GET)\r\n public ModelAndView create(@PathVariable(\"projectId\") String projectId) {\r\n ModelAndView mav = new ModelAndView(\"creates2\");\r\n int pid = -1;\r\n try {\r\n pid = Integer.parseInt(projectId);\r\n } catch (Exception e) {\r\n LOG.error(e);\r\n }\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n Project project = hibernateTemplate.get(Project.class, pid);\r\n if (!dataAccessService.isProjectAvailableToUser(project, user)) {\r\n return accessdenied();\r\n }\r\n List<SubProject> subProjects = dataAccessService.getResearcherSubProjectsForUserInProject(user, project);\r\n mav.addObject(\"projectId\", projectId);\r\n mav.addObject(\"methods\", project.getMethods());\r\n mav.addObject(\"subProjects\", subProjects);\r\n return mav;\r\n }", "public int DSAddProject(String ProjectName, String ProjectLocation);", "@Override\r\n\tpublic int insertProject(Project p) throws MyException {\n\t\tlogger.debug(\"프로젝트 생성전no:\"+p.getProjectNo());\r\n\t\tint result=dao.insertProject(session, p);\r\n\t\tif(result==0) {\r\n\t\t\tthrow new MyException(\"프로젝트 삽입에러\");\r\n\t\t}\r\n\t\tlogger.debug(\"프로젝트 생성후no:\"+p.getProjectNo());\r\n\t\t\r\n\t\tp.setProjectNo(p.getProjectNo());\r\n\t\tresult=dao.insertProjectMember(session,p);\r\n\t\t\r\n\t\tif(result==0){\r\n\t\t\tthrow new MyException(\"프로젝트멤버 삽입에러\");\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private void saveResult() {\n\t\tBuild newBuild = assembleBuild();\n\t\t\n\t\t// last minute sanity checking on user's input before we write it to the database\n\t\tif (newBuild.getName() == null || newBuild.getName().matches(\"\")) {\n\t\t\t// TODO generate one automatically (Untitled Build #1...)\n\t\t\tshowMessage(R.string.edit_build_no_title_error);\n\t\t\treturn;\n\t\t}\n\t\tif (!newBuild.isWellOrdered()) {\n\t\t\tshowMessage(R.string.edit_build_not_well_ordered_error);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlong buildId = -1;\n\t\tif (mCreatingNewBuild) {\n\t\t\t// set creation time\n\t\t\tDate now = new Date();\n\t\t\tnewBuild.setCreated(now);\n\t\t\tnewBuild.setModified(now);\n\t\t} else {\n\t\t\tif (userMadeChanges(newBuild)) {\n\t\t\t\t// set last modified time\n\t\t\t\tnewBuild.setModified(new Date());\t// current time\n\t\t\t\t\n\t\t\t\tbuildId = mBuildId;\n\t\t\t} else {\n\t\t\t\tfinish();\t// no changes made, just finish\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// finishes activity if successful\n\t\tnew WriteBuildTask(newBuild, buildId).execute();\n\t}", "@Override\n\tpublic int addProject(Project project) \n\t\t\tthrows DuplicateKeyException, Exception {\n\t\tif (project == null)\n\t\t\tthrow new Exception(\"Missing input project\");\n\t\ttry {\n\t\t\t// insert Project record\n\t\t\tint retId = addDomainObject(project);\n\t\t\tproject.setId(retId);\n\t\t\treturn retId;\n\t\t}\n\t\tcatch (MustOverrideException e) {\n\t\t\tSystem.out.println(\"JdbcProjectDao.addProject MustOverrideException: \" + e.getMessage());\n\t\t\treturn -1;\n\t\t}\n\t\tcatch (DuplicateKeyException e) {\n\t\t\tSystem.out.println(\"JdbcProjectDao.addProject DuplicateKeyException: \" + e.getMessage());\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"JdbcProjectDao.addProject Exception: \" + e.getMessage());\n\t\t\tthrow e;\n\t\t}\n\t}", "@PostMapping(\"/save/{email:.+}\")\n\t@CrossOrigin(origins = \"http://localhost:3000\")\n\tpublic @ResponseBody Project saveData(@PathVariable(\"email\") String email, \n\t\t\t@RequestBody Project project)\n\t{\n\t\tSystem.out.println(\"Received HTTP POST\");\n\t\tSystem.out.println(project);\n\t\tSystem.out.println(project.getProjectName());\n\t\tproject.setStatusId(1);\n\t\tUser user = userService.findUserByEmail(email);\n\t projectService.save(project);\n\t userService.saveProject(user, project);\n\t\treturn project;\n\t}", "void save() {\n gameModelPoDao.saveToFile(file.getAbsolutePath(), gameModelPo);\n }", "public Project insertProject(Project project, boolean isUndoOrRedo)\n\t\t\tthrows StorageException, ConstraintCheckingException {\n\t\ttry {\n\t\t\tContentValues projectValues = new ContentValues();\n\t\t\tprojectValues.put(\"_ID\", project.get_Id());\n\t\t\tprojectValues.put(\"NAME\", project.getName());\n\t\t\tprojectValues.put(\"DESCRIPTION\", project.getDescription());\n\t\t\tUri uri = contentResolver.insert(LocalStorageContentProvider.PROJECT_URI, projectValues);\n\t\t} catch (Exception e) {\n\t\t\tthrow new StorageException();\n\t\t}\n\t\tif (!isUndoOrRedo) {\n\t\t\tthis.getProjectInsertedList().add(project);\n\t\t}\n\t\treturn project;\n\t}", "private void saveTask(){\n \tZadatakApp app = (ZadatakApp)getApplicationContext();\n \t\n \tTask task = new Task();\n \ttask.set(Task.Attributes.Name, nameText);\n \ttask.set(Task.Attributes.Duedate, datePicker);\n \ttask.set(Task.Attributes.Hours, lengthText);\n \ttask.set(Task.Attributes.Progress, progressBar);\n \ttask.set(Task.Attributes.Priority, priorityBox);\n \t\n \t// Save it to the database either as a new task or over an old task\n \tif (editmode) { app.dbman.editTask(id, task); }\n \telse { app.dbman.insertTask(task); }\n \t\n \t// A task has been added or changed, rescedule\n \tapp.schedule();\n \t\n \tapp.toaster(\"NEW / EDITED TASK\");\n \t\n \t// Quit the activity\n \tfinish();\n }", "public static Projects createEntity() {\n Projects projects = new Projects();\n projects = new Projects()\n .name(DEFAULT_NAME)\n .startDate(DEFAULT_START_DATE)\n .endDate(DEFAULT_END_DATE)\n .status(DEFAULT_STATUS);\n return projects;\n }", "private void saveProject()\n\t{\n\t\t\n\t\tint fileChooserReturnValue =\n\t\t\twindowTemplate\n\t\t\t\t.getFileChooser()\n\t\t\t\t.showSaveDialog(windowTemplate);\n\t\t\n\t\tif(fileChooserReturnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\t\n\t\t\t// Get the file that the user selected\n\t\t\tFile file = windowTemplate.getFileChooser().getSelectedFile();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// Open the output streams\n\t\t\t\tFileOutputStream fileOutput = new FileOutputStream(file.getAbsolutePath());\n\t\t\t\tObjectOutputStream objectOutput = new ObjectOutputStream(fileOutput);\n\t\t\t\n\t\t\t\t// Write the objects\n\t\t\t\tfor(int i = 0; i < cards.size(); i++) {\n\t\t\t\t\tobjectOutput.writeObject(cards.get(i));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Close the output streams\n\t\t\t\tobjectOutput.close();\n\t\t\t\tfileOutput.close();\n\t\t\t\t\n\t\t\t\t// Update the title of the frame to reflect the file name\n\t\t\t\twindowTemplate.setTitle(file.getName());\n\t\t\t\t\n\t\t\t} catch (IOException e1) {\n\t\t\t\tJOptionPane.showMessageDialog(windowTemplate, \"Could not save the file.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void saveFile(boolean newFile) {\n\t\tif(projectFile == null || newFile)\n\t\t\tprojectFile = fileChooser.showSaveDialog(stage);\n\n\t\tif(projectFile != null){\n\t\t\t//Convert the synth object to JSON format\n\t\t\tString projectJson = gson.toJson(new Project(synth.getInstruments(), synth.getBPM(), synth.getVolume(), noteFrequencies), Project.class);\n\n\t\t\ttry {\n\t\t\t\tFiles.writeString(Path.of(projectFile.getAbsolutePath()), projectJson, StandardOpenOption.CREATE);\n\t\t\t} catch (IOException ignored) {}\n\t\t}\n\t}", "void save();", "void save();", "void save();", "public Long createProject(ProjectTo projectTo) {\n\t\tprojectTo = new ProjectTo();\n\t\tprojectTo.setOrg_id(1L);\n\t\tprojectTo.setOrg_name(\"AP\");\n\t\tprojectTo.setName(\"Menlo\");\n\t\tprojectTo.setShort_name(\"Pioneer Towers\");\n\t\tprojectTo.setOwner_username(\"Madhapur\");\n\n\t\ttry {\n\t\t\tWebResource webResource = getJerseyClient(userOptixURL + \"CreateProject\");\n\t\t\tprojectTo = webResource.type(MediaType.APPLICATION_JSON).post(ProjectTo.class, projectTo);\n\t\t\tif(projectTo != null && projectTo.getProject_id() != null) {\n\t\t\t\treturn projectTo.getProject_id() ;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call CreateProject : \"+e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "int insert(UserOperateProject record);", "private IProject createNewProject() {\r\n\t\tif (newProject != null) {\r\n\t\t\treturn newProject;\r\n\t\t}\r\n\r\n\t\t// get a project handle\r\n\t\tfinal IProject newProjectHandle = mainPage.getProjectHandle();\r\n\r\n\t\t// get a project descriptor\r\n\t\tURI location = mainPage.getLocationURI();\r\n\r\n\t\tIWorkspace workspace = ResourcesPlugin.getWorkspace();\r\n\t\tfinal IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());\r\n\t\tdescription.setLocationURI(location);\r\n\r\n\t\tlog.info(\"Project name: \" + newProjectHandle.getName());\r\n\t\t//log.info(\"Location: \" + location.toString());\r\n\t\t\r\n\t\t// create the new project operation\r\n\t\tIRunnableWithProgress op = new IRunnableWithProgress() {\r\n\t\t\tpublic void run(IProgressMonitor monitor)\r\n\t\t\t\t\tthrows InvocationTargetException {\r\n\t\t\t\tCreateProjectOperation op = new CreateProjectOperation(description, ResourceMessages.NewProject_windowTitle);\r\n\t\t\t\ttry {\r\n\t\t\t\t\top.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));\r\n\t\t\t\t} catch (ExecutionException e) {\r\n\t\t\t\t\tthrow new InvocationTargetException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// run the new project creation operation\r\n\t\ttry {\r\n\t\t\tgetContainer().run(true, true, op);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tlog.error(\"Project creation failed.\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t} catch (InvocationTargetException e) {\r\n\t\t\tlog.error(\"Project creation failed.\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tnewProject = newProjectHandle;\r\n\r\n\t\treturn newProject;\r\n\t}", "public void saveTask() {\r\n if (validateTask(textFieldName, textFieldDescription, textFieldDueDate, comboPriority)) {\r\n if (myTask == null) {\r\n myTask = new Task(textFieldName.getText(), textFieldDescription.getText(),\r\n LocalDate.parse(textFieldDueDate.getText()),\r\n Priority.valueOf(Objects.requireNonNull(comboPriority.getSelectedItem()).toString()));\r\n } else {\r\n myTask.setName(textFieldName.getText());\r\n myTask.setDescription(textFieldDescription.getText());\r\n myTask.setDueDate(LocalDate.parse(textFieldDueDate.getText()));\r\n myTask.setPriority(Priority.valueOf(Objects.requireNonNull(\r\n comboPriority.getSelectedItem()).toString()));\r\n }\r\n myTodo.getTodo().put(myTask.getHashKey(), myTask);\r\n todoListGui();\r\n }\r\n }", "public void createProject(\n String projectName,\n int teamId,\n String assigneeName,\n LocalDate deadline,\n String description,\n Project.Importance importance)\n throws NoSignedInUserException, SQLException, InexistentUserException,\n InexistentTeamException, DuplicateProjectNameException, InexistentDatabaseEntityException,\n EmptyFieldsException, InvalidDeadlineException {\n if (isMissingProjectData(projectName, assigneeName, deadline)) {\n throw new EmptyFieldsException();\n }\n User currentUser = getMandatoryCurrentUser();\n User assignee = getMandatoryUser(assigneeName);\n Team team = getMandatoryTeam(teamId);\n // check that there is no other project with the same name\n if (projectRepository.getProject(teamId, projectName).isPresent()) {\n throw new DuplicateProjectNameException(projectName, team.getName());\n }\n // check if the new deadline of project is outdated (before the current date)\n if (isOutdatedDate(deadline)) {\n throw new InvalidDeadlineException();\n }\n // save project\n Project.SavableProject project =\n new Project.SavableProject(\n projectName, teamId, deadline, currentUser.getId(), assignee.getId(), importance);\n project.setDescription(description);\n projectRepository.saveProject(project);\n support.firePropertyChange(\n ProjectChangeablePropertyName.CREATE_PROJECT.toString(), OLD_VALUE, NEW_VALUE);\n }", "public interface DAOProject {\n\n void create(Project project);\n boolean update (int projectId, Project project);\n Project read(int projectId);\n boolean delete(int projectId);\n\n}", "public void save() {\n }", "@PostMapping(\"/projects\")\n @Timed\n public ResponseEntity<ProjectDTO> createProject(@Valid @RequestBody ProjectDTO projectDto)\n throws URISyntaxException, NotAuthorizedException {\n log.debug(\"REST request to save Project : {}\", projectDto);\n var org = projectDto.getOrganization();\n if (org == null || org.getName() == null) {\n throw new BadRequestException(\"Organization must be provided\",\n ENTITY_NAME, ERR_VALIDATION);\n }\n checkPermissionOnOrganization(token, PROJECT_CREATE, org.getName());\n\n if (projectDto.getId() != null) {\n return ResponseEntity.badRequest()\n .headers(HeaderUtil.createFailureAlert(\n ENTITY_NAME, \"idexists\", \"A new project cannot already have an ID\"))\n .body(null);\n }\n if (projectRepository.findOneWithEagerRelationshipsByName(projectDto.getProjectName())\n .isPresent()) {\n return ResponseEntity.badRequest()\n .headers(HeaderUtil.createFailureAlert(\n ENTITY_NAME, \"nameexists\", \"A project with this name already exists\"))\n .body(null);\n }\n ProjectDTO result = projectService.save(projectDto);\n return ResponseEntity.created(ResourceUriService.getUri(result))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getProjectName()))\n .body(result);\n }", "protected void saveProjectSite() {\r\n\t\tlog.debug(\"saveing project site\");\r\n\r\n\t\ttry {\r\n\r\n\t\t\tLocation curLocation = new Location(LocationServiceFactory.getLocationService().getLocation()), lastLocation = site.getLastLocation();\r\n\r\n\t\t\tif (lastLocation == null || (curLocation.getX() != lastLocation.getX() && curLocation.getY() != lastLocation.getY())) {\r\n\t\t\t\tsite.setLastLocation(curLocation);\r\n\r\n\t\t\t\tDao<Location, Integer> locDao = databaseHelper.getDao(Location.class);\r\n\r\n\t\t\t\tif (lastLocation != null) {\r\n\t\t\t\t\t// delete old location\r\n\t\t\t\t\tlocDao.delete(lastLocation);\r\n\t\t\t\t}\r\n\t\t\t\t// and create new one\r\n\t\t\t\tlocDao.create(curLocation);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor (MultiTouchDrawable d : map.getSubDrawables()) {\r\n\r\n\t\t\t\tif (d instanceof AccessPointDrawable) {\r\n\t\t\t\t\tAccessPoint ap = ((AccessPointDrawable) d).getAccessPoint();\r\n\t\t\t\t\t// id is not 0, so this location was never saved\r\n\t\t\t\t\tif (!ap.isCalculated() && ap.getLocation() != null) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tdatabaseHelper.getDao(Location.class).create(ap.getLocation());\r\n\t\t\t\t\t\t\tdatabaseHelper.getDao(AccessPoint.class).update(ap);\r\n\t\t\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t\t\tlog.error(\"could not save location data for an ap: \" + ap.toString(), e);\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\tint changed = projectSiteDao.update(site);\r\n\r\n\t\t\tif (changed > 0) {\r\n\t\t\t\tToast.makeText(this, R.string.project_site_saved, Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\r\n\t\t\tprojectSiteDao.refresh(site);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlog.error(\"could not save or refresh project site\", e);\r\n\t\t\tToast.makeText(this, R.string.project_site_save_failed, Toast.LENGTH_LONG).show();\r\n\t\t}\r\n\r\n\t}", "public boolean addTask(Project p) {\n try {\n String update = \"INSERT INTO TASKS (PROJECT_ID,HOURS_ADDED,DESCRIPTION,HOURS) VALUES(?,?,?,?) \";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(update);\n ps.setString(1, p.getProjectId());\n ps.setString(2, p.getHoursadded());\n ps.setString(3, p.getDescription());\n ps.setString(4, p.getHours());\n\n ps.executeUpdate();\n\n ps.close();\n return true;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return false;\n }\n }", "private void saveToDb() {\r\n ContentValues values = new ContentValues();\r\n values.put(DbAdapter.KEY_DATE, mTime);\r\n if (mPayeeText != null && mPayeeText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_PAYEE, mPayeeText.getText().toString());\r\n if (mAmountText != null && mAmountText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_AMOUNT, mAmountText.getText().toString());\r\n if (mCategoryText != null && mCategoryText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_CATEGORY, mCategoryText.getText().toString());\r\n if (mMemoText != null && mMemoText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_MEMO, mMemoText.getText().toString());\r\n if (mTagText != null && mTagText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_TAG, mTagText.getText().toString());\r\n\r\n \tif (Utils.validate(values)) {\r\n \t\tmDbHelper.open();\r\n \t\tif (mRowId == null) {\r\n \t\t\tlong id = mDbHelper.create(values);\r\n \t\t\tif (id > 0) {\r\n \t\t\t\tmRowId = id;\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tmDbHelper.update(mRowId, values);\r\n \t\t}\r\n \t\tmDbHelper.close();\r\n \t}\r\n\t}", "public void save() throws IOException {\r\n\t\tprojectDir.mkdirs();\r\n\t\tWriter writer = null;\r\n\t\ttry {\r\n\t\t\twriter = new FileWriter(new File(projectDir, TERN_PROJECT));\r\n\t\t\tsuper.writeJSONString(writer);\r\n\t\t} finally {\r\n\t\t\tif (writer != null) {\r\n\t\t\t\tIOUtils.closeQuietly(writer);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void save() {\n Saver.saveTeam(team);\n }", "public AddProject() {\n try\n {\n infDB = new InfDB(\"\\\\Users\\\\Oliver\\\\Documents\\\\Skola\\\\Mini_sup\\\\Realisering\\\\MICEDB.FDB\");\n System.out.println(\"Uppkopplingen lyckades\");\n }\n catch(InfException e)\n {\n System.out.println(e.getMessage());\n }\n \n try\n {\n infDB = new InfDB(\"C:\\\\Users\\\\TP300LA-C4034\\\\Desktop\\\\Delkurs 4, Lill-supen\\\\InformatikDB\\\\MICEDB.FDB\");\n System.out.println(\"Uppkopplingen lyckades\");\n }\n catch(InfException e)\n {\n System.out.println(e.getMessage());\n }\n getPlatforms();\n initComponents();\n setLocationRelativeTo(null);\n \n }", "private void saveProject() {\n File f = new File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS), projectName + File.separator + \"render.cfg\");\n\n JSONObject json = new JSONObject();\n\n try {\n json.put(\"frames\", frames);\n json.put(\"a\", a);\n json.put(\"b\", b);\n json.put(\"P\", P);\n } catch (JSONException e) {\n Log.v(\"RenderSettings\", \"saveProject failed with a JSON Exception: \" + e.getMessage());\n }\n\n try (FileWriter file = new FileWriter(f)) {\n file.write(json.toString());\n } catch (IOException e) {\n Log.v(\"RenderSettings\", \"saveProject failed with a IO Exception: \" + e.getMessage());\n }\n }", "@Override\r\n\tpublic Project updateProjectById(Project projectId) {\n\t\treturn projectDAO.updateProjectById(projectId);\r\n\t}", "private static void add_project() {\r\n\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\t//List of building types\r\n\t\t\tString[] building_types = new String[] {\"House\", \"Apartment Block\", \"Commercial Property\", \"Industrial Property\", \"Agricultural Building\"};\r\n\t\t\t\r\n\t\t\t// Variables that are needed\r\n\t\t\tint project_id = 0;\r\n\t\t\tString project_name = \"\";\r\n\t\t\tString building_type = \"\";\r\n\t\t\tString physical_address = \"\";\r\n\t\t\tint erf_num = 0;\r\n\t\t\tString cust_surname = \"\";\r\n\t\t\tDate deadline_date = null;\r\n\t\t\tint charged = 0;\r\n\t\t\t\r\n\t\t\t// Allows for user input\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//So first we need to select the correct customer\r\n\t\t\tString strSelect = \"SELECT * FROM people WHERE type = 'Customer'\";\r\n\t\t\tResultSet rset = stmt . executeQuery ( strSelect );\r\n\t\t\t\r\n\t\t\t// Loops through available customers from the people table so that the user can select one\r\n\t\t\tSystem.out.println(\"\\nSelect a customer for the project by typing the customers number.\");\r\n\t\t\t// This creates a list of customer ids to check that the user only selects an available one\r\n\t\t\tArrayList<Integer> cust_id_list = new ArrayList<Integer>(); \r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\tSystem.out.println ( \r\n\t\t\t\t\t\t\"Customer Num: \" + rset.getInt(\"person_id\") + \", Fullname: \" + rset.getString(\"name\") + \" \" + rset.getString(\"surname\"));\r\n\t\t\t\tcust_id_list.add(rset.getInt(\"person_id\"));\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a customer\r\n\t\t\tBoolean select_cust = true;\r\n\t\t\tint customer_id = 0;\r\n\t\t\twhile (select_cust == true) {\r\n\t\t\t\tSystem.out.println(\"Customer No: \");\r\n\t\t\t\tString customer_id_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcustomer_id = Integer.parseInt(customer_id_str);\r\n\t\t\t\t\tfor (int i = 0; i < cust_id_list.size(); i ++) {\r\n\t\t\t\t\t\tif (customer_id == cust_id_list.get(i)) { \r\n\t\t\t\t\t\t\tselect_cust = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (select_cust == true) {\r\n\t\t\t\t\t\tSystem.out.println(\"Please only select an available customer id.\");\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 * @exception Throws exception if the users input for customer id is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The customer number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Prints out all available building types form the building type list\r\n\t\t\tSystem.out.print(\"Select a building type by typing the number: \\n\");\r\n\t\t\tfor (int i=0; i < 5; i ++) {\r\n\t\t\t\tSystem.out.println((i + 1) + \": \" + building_types[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to select a building type\r\n\t\t\tBoolean select_building = true;\r\n\t\t\tint building_index = 0;\r\n\t\t\twhile (select_building == true) {\r\n\t\t\t\tSystem.out.println(\"Building type no: \");\r\n\t\t\t\tString building_type_select_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbuilding_index = Integer.parseInt(building_type_select_str) - 1;\r\n\t\t\t\t\tbuilding_type = building_types[building_index];\r\n\t\t\t\t\tselect_building = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for building type is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The building type number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// User gets to decide whether they want an automatically generated name.\r\n\t\t\tBoolean select_project_name = true;\r\n\t\t\twhile (select_project_name == true) {\r\n\t\t\t\tSystem.out.println(\"Would you like to have the project automatically named (y or n)?\");\r\n\t\t\t\tString customer_project_name_choice = input.nextLine();\r\n\t\t\t\tif (customer_project_name_choice.equals(\"y\")){\r\n\t\t\t\t\t// Gets the customers surname for the project name\r\n\t\t\t\t\tString strSelectCustSurname = String.format(\"SELECT surname FROM people WHERE person_id = '%s'\", customer_id);\r\n\t\t\t\t\tResultSet cust_surname_rset = stmt . executeQuery ( strSelectCustSurname );\r\n\t\t\t\t\twhile (cust_surname_rset.next()) {\r\n\t\t\t\t\t\tcust_surname = cust_surname_rset.getString(\"surname\");\r\n\t\t\t\t\t\tproject_name = building_type + \" \" + cust_surname;\r\n\t\t\t\t\t\tSystem.out.println(\"Project name: \" + project_name);\r\n\t\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (customer_project_name_choice.equals(\"n\")) {\r\n\t\t\t\t\tSystem.out.println(\"Provide project name: \");\r\n\t\t\t\t\tproject_name = input.nextLine();\r\n\t\t\t\t\tselect_project_name = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!customer_project_name_choice.equals(\"y\") && !customer_project_name_choice.equals(\"n\")){\r\n\t\t\t\t\tSystem.out.println(\"You can only select either y or n. Please try again\");\r\n\t\t\t\t\tselect_project_name = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter an erf number\r\n\t\t\tBoolean select_erf_num = true;\r\n\t\t\twhile (select_erf_num == true) {\r\n\t\t\t\tSystem.out.print(\"ERF number: \");\r\n\t\t\t\tString erf_num_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\terf_num = Integer.parseInt(erf_num_str);\r\n\t\t\t\t\tselect_erf_num = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for erf number is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The erf number cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a physical address\r\n\t\t\tSystem.out.print(\"Physical Address: \");\r\n\t\t\tphysical_address = input.nextLine();\r\n\t\t\t\r\n\t\t\t// Allows the user to enter a date\r\n\t\t\tBoolean select_deadline_date = true;\r\n\t\t\twhile (select_deadline_date == true) {\r\n\t\t\t\tSystem.out.print(\"Deadline Date (YYYY-MM-DD): \");\r\n\t\t\t\tString deadline_date_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdeadline_date= Date.valueOf(deadline_date_str);\r\n\t\t\t\t\tselect_deadline_date = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for deadline date is not in the correct format\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The date must be in the format YYYY-MM-DD (eg. 2013-01-13). Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This allows the user to enter a charged amount \r\n\t\t\tBoolean select_charged = true;\r\n\t\t\twhile (select_charged == true) {\r\n\t\t\t\tSystem.out.print(\"Total Cost: R \");\r\n\t\t\t\tString charged_str = input.nextLine();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcharged = Integer.parseInt(charged_str);\r\n\t\t\t\t\tselect_charged = false;\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * @exception Throws exception if the users input for the charged amount is not a number\r\n\t\t\t\t */\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\t System.out.println(\"The charged amount cannot contain letters or symbols. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the projects table\r\n PreparedStatement ps = conn.prepareStatement(\"INSERT INTO projects (project_name , building_type, physical_address, erf_num) VALUES(?,?,?,?)\");\r\n ps.setString(1, project_name);\r\n ps.setString(2, building_type);\r\n ps.setString(3, physical_address);\r\n ps.setInt(4, erf_num);\r\n \r\n // Executes the statement\r\n ps.executeUpdate();\r\n \r\n // This gets the created project's table id to use to update the people and project_statuses tables \r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects WHERE project_name = '%s'\", project_name);\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_rset.next()) {\r\n\t\t\t\tproject_id = project_rset.getInt(\"project_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// This adds all the values to a prepared statement to update the people table\r\n\t\t\tPreparedStatement ps_customer = conn.prepareStatement(\r\n\t\t\t\t\t\"UPDATE people SET projects = ? WHERE person_id = ?;\");\r\n\t\t\tps_customer.setInt(1, project_id);\r\n\t\t\tps_customer.setInt(2, customer_id);\r\n\t\t\tps_customer.executeUpdate();\r\n \r\n\t\t\t// This adds all the values to a prepared statement to update the project_statuses table\r\n PreparedStatement ps_status = conn.prepareStatement(\"INSERT INTO project_statuses (charged , deadline_date, project_id) VALUES(?,?,?)\");\r\n ps_status.setInt(1, charged);\r\n ps_status.setDate(2, deadline_date);\r\n ps_status.setInt(3, project_id);\r\n ps_status.executeUpdate();\r\n\r\n // Once everything has been added to the tables the project that has been added gets printed out\r\n\t\t\tResultSet project_added_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\twhile (project_added_rset.next()){\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"\\nProjects Added: \\n\" +\r\n\t\t\t\t\t\t\"Project Sys ID: \" + project_added_rset.getInt(\"project_id\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Project Name: \" + project_added_rset.getString(\"project_name\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Building Type: \" + project_added_rset.getString(\"building_type\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Physical Address: \" + project_added_rset.getString(\"physical_address\") + \"\\n\"\r\n\t\t\t\t\t\t+ \"Erf Number: \" + project_added_rset.getInt(\"erf_num\") + \"\\n\");\r\n\t\t\t}\r\n\t\t/**\r\n\t\t * @exception If any of the table entries cannot be created due to database constrains then the SQLException is thrown\r\n\t\t */\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "public void addProj() {\n\t\tbtnAdd.click();\n\t}", "public boolean projectSet(String name, String q1, String q2, String q3){\n\tString projectSet = \"insert into projects values(?, ?, ?, ?)\";\n\tPreparedStatement pSet = null;\n\ttry{\n\t\tpSet = conn.prepareStatement(projectSet);\n\t\tpSet.setString(1, name);\n\t\tpSet.setString(2, q1);\n\t\tpSet.setString(3, q2);\n\t\tpSet.setString(4, q3);\n\t\tif(pSet.executeUpdate() ==1){\n\t\t\treturn true;\n\t\t}\n\t}catch (SQLException e){\n\t\tSystem.out.println(e.getMessage());\n\t\treturn false;\n\t}\n\treturn false;\n\t}", "int insert(CliStaffProject record);", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "Project findProjectById(String projectId);", "public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}", "public void newProjectAction() throws IOException {\n\t\tfinal FXMLSpringLoader loader = new FXMLSpringLoader(appContext);\n\t\tfinal Dialog<Project> dialog = loader.load(\"classpath:view/Home_NewProjectDialog.fxml\");\n\t\tdialog.initOwner(newProject.getScene().getWindow());\n\t\tfinal Optional<Project> result = dialog.showAndWait();\n\t\tif (result.isPresent()) {\n\t\t\tlogger.trace(\"dialog 'new project' result: {}\", result::get);\n\t\t\tprojectsObservable.add(result.get());\n\t\t}\n\t}", "public Participacao createParticipacao(Participacao model) {\n return participacaoRepository.save(model);\n}", "public interface ProjectDAO {\n Project insert(Project project);\n void delete(Project project);\n Project findById(int id);\n List<Project> findByUserId(int id);\n}", "private void save() {\n if (String.valueOf(tgl_pengobatanField.getText()).equals(null)\n || String.valueOf(waktu_pengobatanField.getText()).equals(null) ) {\n Toast.makeText(getApplicationContext(),\n \"Ada Yang Belum Terisi\", Toast.LENGTH_SHORT).show();\n } else {\n SQLite.insert(nama_pasien2,\n nama_dokter2,\n tgl_pengobatanField.getText().toString().trim(),\n waktu_pengobatanField.getText().toString(),\n keluhan_pasienField.getText().toString().trim(),\n hasil_diagnosaField.getText().toString().trim(),\n biayaField.getText().toString().trim());\n blank();\n finish();\n }\n }", "@Test\r\n\tpublic void saveTeamProgram() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamProgram \r\n\t\tInteger teamId_1 = 0;\r\n\t\tProgram related_program = new wsdm.domain.Program();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamProgram(teamId_1, related_program);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamProgram\r\n\t}", "Product save(Product product);", "@Override\r\n\tpublic void save() throws SaveException {\n\t\t\r\n\t}", "int modifyProject(Project project) throws WrongIDException, WrongDurationException;", "public void saveStudyLanguage(StudyLanguage studyLanguage) {\r\n\t\tQuery query = getSession()\r\n\t\t\t\t.createSQLQuery(\"INSERT INTO study_language (id_project, id_language) VALUES (:valor1, :valor2)\");\r\n\t\tquery.setParameter(\"valor1\", studyLanguage.getProject().getIdProject());\r\n\t\tquery.setParameter(\"valor2\", studyLanguage.getLanguage().getIdLanguage());\r\n\t\tquery.executeUpdate();\r\n\r\n\t}", "@RequestMapping(value = \"/hrProjectInfos\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<HrProjectInfo> createHrProjectInfo(@Valid @RequestBody HrProjectInfo hrProjectInfo) throws URISyntaxException {\n log.debug(\"REST request to save HrProjectInfo : {}\", hrProjectInfo);\n if (hrProjectInfo.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"hrProjectInfo\", \"idexists\", \"A new hrProjectInfo cannot already have an ID\")).body(null);\n }\n HrProjectInfo result = hrProjectInfoRepository.save(hrProjectInfo);\n hrProjectInfoSearchRepository.save(result);\n return ResponseEntity.created(new URI(\"/api/hrProjectInfos/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(\"hrProjectInfo\", result.getId().toString()))\n .body(result);\n }", "public void addProject(){\n AlertDialog.Builder projectBuilder = new AlertDialog.Builder(mainActivity);\n projectBuilder.setTitle(\"New Project Name:\");\n\n final EditText projectNameInput = new EditText(mainActivity);\n\n projectNameInput.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);\n projectBuilder.setView(projectNameInput);\n\n projectBuilder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n String projectName = projectNameInput.getText().toString();\n projectList.add(projectName);\n\n HashSet<String> projectListSet = new HashSet<>(projectList);\n\n SharedPreferences.Editor listPrefsEditor = projectListPrefs.edit();\n listPrefsEditor.putStringSet(\"projectList\", projectListSet);\n listPrefsEditor.apply();\n\n mainActivity.codeStopwatch.pause();\n mainActivity.researchStopwatch.pause();\n final Button codingButton = mainActivity.findViewById(R.id.btn_coding_start);\n codingButton.setText(R.string.start);\n final Button researchButton = mainActivity.findViewById(R.id.btn_research_start);\n researchButton.setText(R.string.start);\n\n if (!selectedProjectName.equals(\"\")){\n mainActivity.manageClocks.saveClocks(selectedProjectName);\n }\n mainActivity.codeStopwatch.reset();\n mainActivity.researchStopwatch.reset();\n\n mainActivity.manageClocks.saveClocks(projectName);\n mainActivity.manageClocks.loadClocks(projectName);\n\n Spinner projectsSpinner = mainActivity.findViewById(R.id.projects_spinner);\n ArrayAdapter<String> projectsArrayAdapter = new ArrayAdapter<String>(\n mainActivity, android.R.layout.simple_spinner_item, projectList);\n projectsArrayAdapter.setDropDownViewResource(\n android.R.layout.simple_spinner_dropdown_item);\n projectsSpinner.setAdapter(projectsArrayAdapter);\n projectsSpinner.setSelection(projectsArrayAdapter.getPosition(projectName));\n\n selectedProjectName = projectName;\n SharedPreferences.Editor selectedProjectPrefsEditor = selectedProjectPrefs.edit();\n selectedProjectPrefsEditor.putString(\"selectedProjectName\", selectedProjectName);\n selectedProjectPrefsEditor.apply();\n }\n });\n projectBuilder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n projectBuilder.show();\n }", "public void create(Connection conn, Object object) \r\n\t\tthrows DAOException {\r\n\r\n\t\tif (!(object instanceof ProjectInfo))\r\n\t\t\tthrow new DAOException (\"invalid.object.projdao\",\r\n\t\t\t\t\tnull, DAOException.ERROR, true);\r\n\t\t\t\r\n\t\t\r\n\t\tString sqlstmt = DAOConstants.PROJ_CREATE;\r\n\t\tProjectInfo project = (ProjectInfo) object;\r\n\r\n\t\tif(project.getProjectId() == null)\r\n\t\t\tthrow new DAOException (\"invalid.object.projdao\",\r\n\t\t\t\t\tnull, DAOException.ERROR, true);\r\n\t\t\t\r\n\t\t\t\r\n\t\tlog.debug(\"creating ProjectInfo entry\");\r\n\t\ttry{\r\n\t\t\tif (conn == null || conn.isClosed())\r\n\t\t\t\tconn = dbAccess.getConnection();\r\n\t\t\tPreparedStatement stmt = conn.prepareStatement(sqlstmt);\r\n\t\t\tProjectAssembler.getPreparedStatement(project, stmt);\r\n\t\t\tstmt.executeUpdate();\r\n\t\t\tlog.debug(\"created ProjectInfo entry\");\r\n\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new DAOException (\"sql.create.exception.projdao\",\r\n\t\t\te, DAOException.ERROR, true);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new DAOException (\"create.exception.projdao\",\r\n\t\t\te.getCause(), DAOException.ERROR, true);\r\n \r\n\t\t} \r\n\t}", "public void save() throws EntityPersistenceException {\n\n }", "@Test\n @org.junit.Ignore\n public void testProject_1()\n throws Exception {\n\n Project result = new Project();\n\n assertNotNull(result);\n assertEquals(null, result.getName());\n assertEquals(null, result.getWorkloadNames());\n assertEquals(null, result.getProductName());\n assertEquals(null, result.getComments());\n assertEquals(null, result.getCreator());\n assertEquals(0, result.getId());\n assertEquals(null, result.getModified());\n assertEquals(null, result.getCreated());\n }", "public boolean save(Product product);", "public void insertEmpProject(String projectID, String employeeId) {\n\t\tString query=\"INSERT INTO TA_EMPLOYEE_PROJECT(PROJECT_ID,EMPLOYEE_ID) VALUES('\" + projectID + \"','\" + employeeId +\"')\";\r\n\t\tjdbcTemplate.update(query);\r\n\t}", "@PostMapping(\"/project\")\n public Object doPost(@RequestBody ProjectLongId[] projectsLongId) throws PrimaryKeyViolationException, NoSuchFieldException, RequiredFieldMissingException {\n service.createAllProjects(projectsLongId);\n return new ResponseTemplate(true, null);\n }", "public static Project createProject() throws ParseException {\n System.out.println(\"Please enter the project number: \");\n int projNum = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the project name: \");\n String projName = input.nextLine();\n\n System.out.println(\"Please enter the type of building: \");\n String buildingType = input.nextLine();\n\n System.out.println(\"Please enter the physical address for the project: \");\n String address = input.nextLine();\n\n System.out.println(\"Please enter the ERF number: \");\n String erfNum = input.nextLine();\n\n System.out.println(\"Please enter the total fee for the project: \");\n int totalFee = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the total amount paid to date: \");\n int amountPaid = input.nextInt();\n input.nextLine();\n\n System.out.println(\"Please enter the deadline for the project (dd/MM/yyyy): \");\n String sdeadline = input.nextLine();\n Date deadline = dateformat.parse(sdeadline);\n\n Person architect = createPerson(\"architect\", input);\n Person contractor = createPerson(\"contractor\", input);\n Person client = createPerson(\"client\", input);\n\n // If the user did not enter a name for the project, then the program will\n // concatenate the building type and the client's surname as the new project\n // name.\n\n if (projName == \"\") {\n String[] clientname = client.name.split(\" \");\n String lastname = clientname[clientname.length - 1];\n projName = buildingType + \" \" + lastname;\n }\n\n return new Project(projNum, projName, buildingType, address, erfNum, totalFee, amountPaid, deadline, contractor,\n architect, client);\n\n }", "@Override\n\tpublic void run(String... args) throws Exception {\n\n\t\tiProjectService.save(new Project(1L, \"Training Allocation to New Joinees\", \n\t\t\t\tLocalDate.of(2021, Month.JANUARY, 25)));\n\t\t\n\t\tiProjectService.save(new Project(2L, \"Machine Allocations and Transport\", \n\t\t\t\tLocalDate.of(2021, Month.JANUARY, 10)));\n\t\t\n\t\tOptional<Project> optional = iProjectService.findById(1L);\n\t\t\n\t\t if(optional.isPresent()) {\n\t\t\t Project project = optional.get();\n\t\t\t System.out.println(\"Project Details - \" + project.getId() + \" \" + project.getName());\n\t \t \n\t\t }\n\n\t}", "public String handleAdd() \n throws HttpPresentationException, webschedulePresentationException\n { \n\t try {\n\t Project project = new Project();\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n\t } catch(Exception ex) {\n return showAddPage(\"You must fill out all fields to add this project\");\n }\n }", "public CreateProject() {\n\t\tsuper();\n\t}", "LectureProject createLectureProject();", "@RequestMapping(value={\"/projects/add\"}, method= RequestMethod.GET)\r\n\tpublic String createProjectForm(Model model) {\r\n\t\tUser loggedUser= sessionData.getLoggedUser();\r\n\t\tmodel.addAttribute(\"loggedUser\", loggedUser);\r\n\t\tmodel.addAttribute(\"projectForm\", new Project());\r\n\t\treturn \"addProject\";\r\n\t}", "public void onSaveButtonClicked() {\n String description = mEditText.getText().toString();\n Date date = new Date();\n\n final DiaryEntry entry = new DiaryEntry(description, date);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n if (mEntryId == DEFAULT_ENTRY_ID) {\n // insert new task\n mDb.entryDao().insertEntry(entry);\n } else {\n //update task\n entry.setId(mEntryId);\n mDb.entryDao().updateEntry(entry);\n }\n finish();\n }\n });\n }" ]
[ "0.76558125", "0.73742956", "0.73615384", "0.7200778", "0.71272445", "0.7020721", "0.6820627", "0.6787085", "0.67776936", "0.6732742", "0.6522473", "0.64736265", "0.64600104", "0.64204234", "0.64204234", "0.64204234", "0.64204234", "0.64040655", "0.6378879", "0.63459873", "0.6287932", "0.6277353", "0.6249957", "0.6244207", "0.6244207", "0.6244207", "0.6231202", "0.6203706", "0.61928684", "0.61925197", "0.6184328", "0.61823606", "0.6175896", "0.61713976", "0.61355335", "0.6125319", "0.6109963", "0.6106394", "0.6101951", "0.6093869", "0.6049096", "0.6045218", "0.5950449", "0.5947543", "0.5932788", "0.5903034", "0.5888499", "0.58692014", "0.58589906", "0.58488137", "0.58383393", "0.58383393", "0.58383393", "0.5835864", "0.58319014", "0.5817563", "0.5815715", "0.5807298", "0.58020425", "0.5784462", "0.578425", "0.575669", "0.5753864", "0.57478696", "0.57443166", "0.5711549", "0.5703035", "0.5697418", "0.56902385", "0.5684824", "0.5678732", "0.5676691", "0.5666033", "0.56548506", "0.56283057", "0.5626878", "0.5622192", "0.56204104", "0.56197065", "0.5605235", "0.56035525", "0.5558314", "0.55569756", "0.5556183", "0.5548529", "0.5541248", "0.55307406", "0.55286866", "0.55208176", "0.5518731", "0.5512504", "0.55124795", "0.5503849", "0.55034715", "0.5495628", "0.5494762", "0.54889315", "0.5484083", "0.5483398", "0.5475844" ]
0.61261564
35
Internal methods Looks up the geometry srs by trying a number of heuristics. Returns 1 if all attempts at guessing the srid failed.
protected int getSRID(SimpleFeatureType featureType) { int srid = -1; CoordinateReferenceSystem flatCRS = CRS.getHorizontalCRS(featureType.getCoordinateReferenceSystem()); try { Integer candidate = CRS.lookupEpsgCode(flatCRS, false); if (candidate != null) srid = candidate; else srid = 4326; } catch (Exception e) { // ok, we tried... } return srid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getCrs(TrackPoint p) {\r\n\t\tint crsindex = 0;\r\n\t\tif (coordinateReferenceSystem.length > 1) {\r\n\t\t\tint ls = TransformCoordinates.getLocalProjectionSystem(coordinateReferenceSystem[0]);\r\n\t\t\tProjectedPoint gkbl = TransformCoordinates.wgs84ToLocalsystem(p, ls); // TODO: think / read about what to do if bottom left and top right are not in the same Gau?-Kr?ger stripe?\r\n\t\t\tint wantepsg = gkbl.getEpsgCode();\r\n\t\t\tfor (crsindex = 0; crsindex < coordinateReferenceSystem.length; crsindex++) {\r\n\t\t\t\tif (coordinateReferenceSystem[crsindex] == wantepsg)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (crsindex >= coordinateReferenceSystem.length) { // not match\r\n\t\t\t\tfor (crsindex = 0; crsindex < coordinateReferenceSystem.length; crsindex++) {\r\n\t\t\t\t\tif (Math.abs(coordinateReferenceSystem[crsindex] - wantepsg) == 1)\r\n\t\t\t\t\t\tbreak; // accept 1 zone deviation\r\n\t\t\t\t}\r\n\t\t\t\tif (crsindex >= coordinateReferenceSystem.length)\r\n\t\t\t\t\tcrsindex = -1;\r\n\r\n\t\t\t}\r\n\t\t\tif (crsindex < 0)\r\n\t\t\t\tthrow new IllegalArgumentException(MyLocale.getMsg(4829, \"getUrlForBoundingBox: Point:\") + \" \" + gkbl.toString() + MyLocale.getMsg(4830, \"no matching Gau?-Kr?ger-Stripe in the EPSG-code list in the .wms\"));\r\n\t\t}\r\n\t\treturn crsindex;\r\n\t}", "public int getSrid() {\n\t\treturn srid;\n\t}", "public void testSpatialQuery(){\n\t\t\r\n\t\tSpatialQueryTest sqt = new SpatialQueryTest();\r\n\t\ttry{\r\n\t\t\tsqt.runSpatialIndexTest();\r\n\t\t}catch(IOException ex){\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "org.hl7.fhir.Integer getCoordinateSystem();", "Integer getSOLid();", "private static RecAnchorIndex getAnchorIndex(String szcolfields, boolean busestrand, boolean busesignal)\n {\n\tint nchromindex=0;\n int npositionindex=1;\n int nstrandindex=2;\n int nsignalindex=3;\n\n\tif (busestrand && busesignal)\n {\n\t if (szcolfields != null)\n {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nstrandindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t}\n else if (busestrand && !busesignal)\n {\n\t if (szcolfields != null)\n {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nstrandindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t}\n else if (!busestrand && busesignal)\n {\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t else //if (szcolfields == null)\n {\n\t nsignalindex = 2;\n\t }\n\t}\n else //both are off\n\t{\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t nchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t npositionindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t}\n\n\treturn new RecAnchorIndex(nchromindex, npositionindex, nstrandindex, nsignalindex);\n }", "@Override\n public void onGeoQueryReady() {\n if (!isAgentFound) {\n radius++;\n getNearestAgent();\n }\n }", "private int getRID() throws SQLException {\n\t\tResultSet result = getRidStatement.executeQuery();\n\t\tif (result.next()) {\n\t\t\tint out = result.getInt(1);\n\t\t\tresult.close();\n\t\t\tif (DEBUG) {\n\t\t\t\tSystem.out.println(\"getRID: \"+out+\"\\n\");\n\t\t\t}\n\t\t\treturn out;\n\t\t} else {\n\t\t\tif (DEBUG) {\n\t\t\t\tSystem.out.println(\"getRID: \"+0+\"\\n\");\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t}", "public ArrayList<ArrayList<String>> extractCoordsFromWfsXml(String xml_og, String url_geofenceWfs, String serviceIdentifier) {\r\n\t\t\r\n\t\t//logger.debug(xml_og);\r\n\t\tnameSpaceUri = getArbeitsbereichXmlTagFromWfs(url_geofenceWfs); //z.B. focus\r\n\t\tPointPolygon point = new PointPolygon();\r\n\t\tArrayList<String> list_objectid = new ArrayList<String>();\r\n\t\tArrayList<String> list_coords = new ArrayList<String>();\r\n\t\tArrayList<ArrayList<String>> list_coords_objectid = new ArrayList<ArrayList<String>>();\r\n\t\t\r\n\t\t\r\n\t\tDocumentBuilder dbuilder = null;\r\n\t\ttry {\t\t\t\r\n\t\t\tXPath xPath = XPathFactory.newInstance().newXPath();\r\n\t\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\r\n\t\t\tdbFactory.setNamespaceAware(true);\r\n\t DocumentBuilder builder = dbFactory.newDocumentBuilder();\r\n\t Document doc = builder.parse(new InputSource(new StringReader(xml_og)));\r\n\t \t \r\n\t \txPath.setNamespaceContext(new NamespaceContext() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic Iterator getPrefixes(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t @Override\r\n\t\t\t public String getNamespaceURI(String args) {\r\n\t\t\t if(nameSpaceUri.equals(args)){\r\n\t\t\t \treturn nameSpaceUri;\r\n\t\t\t }else if(\"gml\".equals(args)){\r\n\t\t\t \treturn \"http://www.opengis.net/gml/3.2\"; \t\r\n\t\t\t }else{\r\n\t\t\t \treturn null;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t});\t\t\r\n//\t \tString path_offering = \"/wfs:FeatureCollection/wfs:member/geofence_sbg:geofence_sbg_bbox/@gml:id\";\r\n//\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n//\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getNodeValue());\r\n\t\t\t\t/*\r\n\t\t\t\tString path_offering = \"/soap:Envelope/soap:Body/sos:Capabilities/@version\";\r\n\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getTextContent());\r\n\t\t\t\t\r\n\t\t\t\tString path_procedures = \"//om:OM_Observation[@name='GetObservation']/ows:Parameter[@name='procedure']/ows:AllowedValues/ows:Value\"; */\r\n//\t\t\t\tString pathToLoading = \"//om:OM_Observation[om:observedProperty[@xlink:href='http://ispace.researchstudio.at/ont/swe/property/Loading']]/om:result\";\r\n\t\t\t\t\r\n\r\n\t \tString pathToObjectid = \"//\"+nameSpaceUri +\":objectid\";\r\n\t \tNodeList nodes_Objectid = (NodeList)xPath.compile(pathToObjectid).evaluate(doc, XPathConstants.NODESET);\r\n\t \t\r\n\t\t\t\tString pathToCoordinates =\"//gml:LinearRing/gml:posList\";\r\n\t\t\t\tNodeList nodes_position = (NodeList)xPath.compile(pathToCoordinates).evaluate(doc, XPathConstants.NODESET);\r\n\t\t\t\t//book[title/@lang = 'it'] [@uom='abc']\r\n\t\t\t\t//myNodeList.item(0).setNodeValue(\"Hi test!\");\r\n\t\t\t\tString xy= \"\";\r\n\t\t\t\t\r\n\t\t\t//\tlogger.debug(\"vor for loop ParserXmlJson.extractPointFromIO:\"+ nodes_position.getLength());\t\r\n\t\t\t\tfor(int n = 0; n<nodes_position.getLength(); n++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(serviceIdentifier.equals(\"within\")){\r\n\t\t\t\t\t\tpoint.list_ofStrConsistingOf5CoordinatesForBoundingBox.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tpoint.list_ofStrConsistingOf5CoordinatesForBoundingBoxWithin.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlist_coords.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\t\r\n\t\t\t\t\tlist_objectid.add(nodes_Objectid.item(n).getTextContent());\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//node_procedures.item(n).setTextContent(\"4444\");\r\n\t\t\t\t\t//System.out.println(\"ParserXmlJson.parseInsertObservation:parser EDITED:\"+node_procedures.item(n).getTextContent());\r\n\t\t\t\t}\t\t\t\r\n\t\t\t//\tSystem.out.println(TextFiles.xmlDocument2StringWithPrettyPrint(doc, 2));\r\n\t\t\t\ttry{\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tSystem.out.println(\"Error: maybe no coordinates!\");\r\n\t\t\t\t\te.printStackTrace();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\t\t\t\r\n\t\tlist_coords_objectid.add(list_coords);\r\n\t\tlist_coords_objectid.add(list_objectid);\r\n\t\treturn list_coords_objectid;//point.list_ofStrConsistingOf5CoordinatesForBoundingBox;\t\t\t\t\r\n\t}", "public int InitVessels() {\n int[] vesselCheck = CircleHood(true, VESSEL_SPACING_MIN);\n int[] circleIs = new int[vesselCheck.length / 2];\n int[] ret= GenIndicesArray(length);\n Shuffle(ret, length, length, rn);\n int[] indices = ret;\n int nVesselsRequested = (int) (length / VESSEL_SPACING_MEAN*VESSEL_SPACING_MEAN);\n int nVesselsPlaced = 0;\n for (int i : indices) {\n int x=ItoX(i);\n int y=ItoY(i);\n //make sure that we aren't putting a vessel too close to the edge\n if(x>=VESSEL_EDGE_MAX_DIST&&y>=VESSEL_EDGE_MAX_DIST&&xDim-x>VESSEL_EDGE_MAX_DIST&&yDim-y>VESSEL_EDGE_MAX_DIST) {\n int nNeigbhors = HoodToOccupiedIs(vesselCheck, circleIs, ItoX(i), ItoY(i));\n for (int j = 0; j < nNeigbhors + 1; j++) {\n if (j == nNeigbhors) {\n MarkCell_II newVessel = NewAgentSQ(i);\n newVessel.InitVessel();\n nVesselsPlaced++;\n if (nVesselsPlaced == nVesselsRequested) {\n return nVesselsPlaced;\n }\n } else if (GetAgent(circleIs[j]).type == VESSEL) {\n break;\n }\n }\n }\n }\n return nVesselsPlaced;\n }", "public int getLocalSimlarityScore(String s1, String s2) {\r\n\t\tint match = 1;\r\n\t\tint mismatch = -1;\r\n\t\tint gap = -2;\r\n\t\tSmithWaterman algorithm = new SmithWaterman();\r\n\t\tBasicScoringScheme scoring = new BasicScoringScheme(match, mismatch, gap);\r\n\t\talgorithm.setScoringScheme(scoring);\r\n\t\talgorithm.loadSequences(s1, s2);\r\n\t\t\r\n\t\tint score = INT_MAX;\r\n\t\ttry {\r\n\t\t\tscore = algorithm.getScore();\r\n\t\t\t//System.out.println(algorithm.getPairwiseAlignment().getGappedSequence1());\r\n\t\t\t//System.out.println(algorithm.getPairwiseAlignment().getGappedSequence2());\r\n\t\t\t//System.out.println(algorithm.getPairwiseAlignment());\r\n\t\t\t//String tmp = algorithm.getPairwiseAlignment().toString();\r\n\t\t\t//System.out.println(tmp);\r\n\t\t} catch (IncompatibleScoringSchemeException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\tif (score < 0) {\r\n\t\t\tscore = 0;\r\n\t\t}\r\n\t\treturn score;\r\n\t}", "private int getStrandNum() { return this.strand.intValue(); }", "synchronized protected int findClosestSegment(final int x_p, final int y_p, final long layer_id, final double mag) {\n\t\tif (1 == n_points) return -1;\n \t\tif (0 == n_points) return -1;\n \t\tint index = -1;\n \t\tdouble d = (10.0D / mag);\n \t\tif (d < 2) d = 2;\n \t\tdouble sq_d = d*d;\n \t\tdouble min_sq_dist = Double.MAX_VALUE;\n \t\tfinal Calibration cal = layer_set.getCalibration();\n \t\tfinal double z = layer_set.getLayer(layer_id).getZ() * cal.pixelWidth;\n \n \t\tdouble x2 = p[0][0] * cal.pixelWidth;\n \t\tdouble y2 = p[1][0] * cal.pixelHeight;\n \t\tdouble z2 = layer_set.getLayer(p_layer[0]).getZ() * cal.pixelWidth;\n \t\tdouble x1, y1, z1;\n \n \t\tfor (int i=1; i<n_points; i++) {\n \t\t\tx1 = x2;\n \t\t\ty1 = y2;\n \t\t\tz1 = z2;\n \t\t\tx2 = p[0][i] * cal.pixelWidth;\n \t\t\ty2 = p[1][i] * cal.pixelHeight;\n \t\t\tz2 = layer_set.getLayer(p_layer[i]).getZ() * cal.pixelWidth;\n \n \t\t\tdouble sq_dist = M.distancePointToSegmentSq(x_p * cal.pixelWidth, y_p * cal.pixelHeight, z,\n \t\t\t\t\t x1, y1, z1,\n \t\t\t\t\t\t\t\t x2, y2, z2);\n \n \t\t\tif (sq_dist < sq_d && sq_dist < min_sq_dist) {\n \t\t\t\tmin_sq_dist = sq_dist;\n \t\t\t\tindex = i-1; // previous\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "int getSs();", "public static boolean isMultiGeom(final String sMapName) throws GrassExecutionException {\r\n\r\n boolean is_multi_geom = false;\r\n\r\n //Get number of objects for each type of geometry in GRASS map\r\n final int num_points = GrassVInfoUtils.getNumPoints(sMapName);\r\n final int num_lines = GrassVInfoUtils.getNumLines(sMapName);\r\n final int num_polygons = GrassVInfoUtils.getNumPolygons(sMapName);\r\n final int num_faces = GrassVInfoUtils.getNumFaces(sMapName);\r\n final int num_kernels = GrassVInfoUtils.getNumKernels(sMapName);\r\n\r\n //Check for type combinations that would lead to multiple geometry types\r\n if (num_points > 0) {\r\n if ((num_kernels > 0) || (num_lines > 0) || (num_polygons > 0) || (num_faces > 0)) {\r\n is_multi_geom = true;\r\n }\r\n }\r\n if (num_kernels > 0) {\r\n if ((num_points > 0) || (num_lines > 0) || (num_polygons > 0) || (num_faces > 0)) {\r\n is_multi_geom = true;\r\n }\r\n }\r\n if (num_lines > 0) {\r\n if ((num_points > 0) || (num_kernels > 0) || (num_polygons > 0) || (num_faces > 0)) {\r\n is_multi_geom = true;\r\n }\r\n }\r\n if (num_polygons > 0) {\r\n if ((num_points > 0) || (num_kernels > 0) || (num_lines > 0) || (num_faces > 0)) {\r\n is_multi_geom = true;\r\n }\r\n }\r\n if (num_faces > 0) {\r\n if ((num_points > 0) || (num_kernels > 0) || (num_lines > 0) || (num_polygons > 0)) {\r\n is_multi_geom = true;\r\n }\r\n }\r\n\r\n if (num_points + num_lines + num_polygons + num_faces + num_kernels == 0) {\r\n //No valid geometries. Maybe a topology error?\r\n JOptionPane.showMessageDialog(null, Sextante.getText(\"grass_error_geometries_none_found\"),\r\n Sextante.getText(\"grass_error_title\"), JOptionPane.WARNING_MESSAGE);\r\n throw new GrassExecutionException();\r\n }\r\n return (is_multi_geom);\r\n\r\n }", "public boolean isSetSldRg()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(SLDRG$8) != 0;\n }\n }", "public boolean sps() {\n\t\tupdateFrontUnknown();\n\t\tboolean successful = false;\n\t\tfor (int i = 0; i < frontUnknown.size(); i++) {\n\t\t\tint x = frontUnknown.get(i)[0];\n\t\t\tint y = frontUnknown.get(i)[1];\n\t\t\tArrayList<int[]> knownNeighbors = findAdjacentSafe(frontUnknown.get(i));\n\t\t\tfor (int[] j: knownNeighbors) {\n\t\t\t\t//all clear neighbours\n\t\t\t\tif (answerMap[j[0]][j[1]] == findAdjacentMark(j).size()) {\n\t\t\t\t\tprobe(x, y);\n\t\t\t\t\tsuccessful = true;\n\t\t\t\t\tSystem.out.println(\"SPS: probe[\" + x + \",\" + y + \"]\");\n\t\t\t\t\tspsCount++;\n\t\t\t\t\tshowMap();\n\t\t\t\t\ti--;\n\t\t\t\t\tupdateFrontUnknown();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//all marked neighbours\n\t\t\t\t\tif (answerMap[j[0]][j[1]] == findAdjacentRisk(j).size()) {\n\t\t\t\t\t\tmark(x, y);\n\t\t\t\t\t\tsuccessful = true;\n\t\t\t\t\t\tSystem.out.println(\"SPS: probe[\" + x + \",\" + y + \"]\");\n\t\t\t\t\t\tspsCount++;\n\t\t\t\t\t\tshowMap();\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tupdateFrontUnknown();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn successful;\n\t}", "public void implLookup(Context context, CharSequence strNumber, boolean isSystemProvided, boolean isNotNanp)\n {\n if (DBG) Log.d(TAG, \"Lookup \" + strNumber.toString());\n ContentResolver cr = context.getContentResolver();\n\n // TODO: OEM must set the String array appropriately\n // \"NOT-NANP\" should be included if the call was NOT received while on an NANP servicing network\n // \"system\" or \"system provided\" should be included if it was an incoming call, or returning a call from a system-provided number\n // \"user\" or \"user provided\" should be included if it cannot be determined to be a system-provided number\n //\n String[] flags;\n if (isNotNanp)\n flags = new String[] { isSystemProvided ? \"system\" : \"user\", \"NOT-NANP\" };\n else\n flags = new String[] { isSystemProvided ? \"system\" : \"user\" };\n\n m_isNanp = !isNotNanp; // Save this for later\n\n Cursor c = cr.query(CONTENT_URI, null, strNumber.toString(), flags, null);\n if (c != null && c.moveToFirst())\n {\n readColumnIds(c);\n m_callerId = getString(c, COLUMN_NUMBER);\n m_cityName = getString(c, COLUMN_CITY);\n m_stateName = getString(c, COLUMN_STATE);\n m_stateAbbr = getString(c, COLUMN_STATE_ABBR);\n m_countryName = getString(c, COLUMN_COUNTRY);\n\n m_bizName = getString(c, COLUMN_COMPANY);\n m_cname = getString(c, COLUMN_NAME);\n m_firstName = getString(c, COLUMN_FIRST_NAME);\n m_lastName = getString(c, COLUMN_LAST_NAME);\n// m_urlPicture = getString(c, COLUMN_IMAGE);\n// m_bSameNetwork = c.getInt(COLUMN_SAME_NETWORK) != 0;\n// m_bFriends = c.getInt(COLUMN_FRIENDS) != 0;\n// m_bPreferCidImage = c.getInt(COLUMN_PREFER_CID_IMAGE) != 0;\n if (COLUMN_NO_OUTGOING_CALL_RESTRICTION >= 0) {\n m_bNoOutgoingCallRestriction = c.getInt(COLUMN_NO_OUTGOING_CALL_RESTRICTION) != 0;\n }\n }\n else\n {\n Log.d(TAG, \"No CityID found\");\n }\n if ( c != null ) c.close(); // IKHSS6UPGR-11068\n }", "static void resolveSids0(java.lang.String r8, jcifs.smb.NtlmPasswordAuthentication r9, jcifs.smb.SID[] r10) throws java.io.IOException {\n /*\n r1 = 0;\n r2 = 0;\n r6 = sid_cache;\n monitor-enter(r6);\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0067 }\n r5.<init>();\t Catch:{ all -> 0x0067 }\n r7 = \"ncacn_np:\";\n r5 = r5.append(r7);\t Catch:{ all -> 0x0067 }\n r5 = r5.append(r8);\t Catch:{ all -> 0x0067 }\n r7 = \"[\\\\PIPE\\\\lsarpc]\";\n r5 = r5.append(r7);\t Catch:{ all -> 0x0067 }\n r5 = r5.toString();\t Catch:{ all -> 0x0067 }\n r1 = jcifs.dcerpc.DcerpcHandle.getHandle(r5, r9);\t Catch:{ all -> 0x0067 }\n r4 = r8;\n r5 = 46;\n r0 = r4.indexOf(r5);\t Catch:{ all -> 0x0067 }\n if (r0 <= 0) goto L_0x003d;\n L_0x002d:\n r5 = 0;\n r5 = r4.charAt(r5);\t Catch:{ all -> 0x0067 }\n r5 = java.lang.Character.isDigit(r5);\t Catch:{ all -> 0x0067 }\n if (r5 != 0) goto L_0x003d;\n L_0x0038:\n r5 = 0;\n r4 = r4.substring(r5, r0);\t Catch:{ all -> 0x0067 }\n L_0x003d:\n r3 = new jcifs.dcerpc.msrpc.LsaPolicyHandle;\t Catch:{ all -> 0x0067 }\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0067 }\n r5.<init>();\t Catch:{ all -> 0x0067 }\n r7 = \"\\\\\\\\\";\n r5 = r5.append(r7);\t Catch:{ all -> 0x0067 }\n r5 = r5.append(r4);\t Catch:{ all -> 0x0067 }\n r5 = r5.toString();\t Catch:{ all -> 0x0067 }\n r7 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r3.<init>(r1, r5, r7);\t Catch:{ all -> 0x0067 }\n resolveSids(r1, r3, r10);\t Catch:{ all -> 0x0079 }\n if (r1 == 0) goto L_0x0065;\n L_0x005d:\n if (r3 == 0) goto L_0x0062;\n L_0x005f:\n r3.close();\t Catch:{ all -> 0x0076 }\n L_0x0062:\n r1.close();\t Catch:{ all -> 0x0076 }\n L_0x0065:\n monitor-exit(r6);\t Catch:{ all -> 0x0076 }\n return;\n L_0x0067:\n r5 = move-exception;\n L_0x0068:\n if (r1 == 0) goto L_0x0072;\n L_0x006a:\n if (r2 == 0) goto L_0x006f;\n L_0x006c:\n r2.close();\t Catch:{ all -> 0x0073 }\n L_0x006f:\n r1.close();\t Catch:{ all -> 0x0073 }\n L_0x0072:\n throw r5;\t Catch:{ all -> 0x0073 }\n L_0x0073:\n r5 = move-exception;\n L_0x0074:\n monitor-exit(r6);\t Catch:{ all -> 0x0073 }\n throw r5;\n L_0x0076:\n r5 = move-exception;\n r2 = r3;\n goto L_0x0074;\n L_0x0079:\n r5 = move-exception;\n r2 = r3;\n goto L_0x0068;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: jcifs.smb.SID.resolveSids0(java.lang.String, jcifs.smb.NtlmPasswordAuthentication, jcifs.smb.SID[]):void\");\n }", "public int getSsNum() {\n return ssNum;\n }", "void checkStationExists() {\n\n stationExists = false;\n dataExists = false;\n stationExistsCount = 0;\n thisSubdesCount = 0;\n// stationIgnore = false;\n\n for (int i = 0; i < MAX_STATIONS; i++) {\n stationExistsArray[i] = false;\n loadedDepthMin[i] = 9999;\n loadedDepthMax[i] = -9999;\n spldattimArray[i] = \"\";\n currentsRecordCountArray[i] = 0;\n watphyRecordCountArray[i] = 0;\n stationStatusDB[i] = \"\";\n subdesCount[i] = 0;\n for (int j = 0; j < MAX_SUBDES; j++) {\n subdesArray[i][j] = \"\";\n } // for (int j = 0; j < MAX_SUBDES; j++)\n\n } // for (int i = 0; i < MAX_STATIONS; i++)\n\n // true if station with same station Id (first select) or\n // station with same date_start & latitude & longitude &\n // <data>.spltim & <data>.subdes (second select)\n String where = MrnStation.STATION_ID + \"='\" + station.getStationId() + \"'\";\n if (dbg) System.out.println(\"<br>checkStationExists: station: where = \" +\n where);\n\n // Is there already a station record with the same station-id?\n MrnStation[] tStation2 = new MrnStation().get(where);\n if (dbg) System.out.println(\"<br>checkStationExists: tStation2.length = \" +\n tStation2.length);\n if (tStation2.length > 0) {\n //stationStatusLD = \"di\"; // == duplicate station-id\n outputDebug(\"checkStationExists: station Id found: \" +\n station.getStationId(\"\"));\n stationExists = true;\n stationExistsArray[0] = true;\n } else {\n //stationStatusLD = \"ds\"; // == duplicate station (lat/lon/date/time)\n outputDebug(\"checkStationExists: station Id not found: \" +\n station.getStationId(\"\"));\n } // if (tStation2.length > 0)\n\n // are there any other stations around the same day that fall within the\n // latitude range? (it could include the station found above)\n\n // get the previous and next day for the select, in case the\n // spldattim is just before or after midnight\n java.text.SimpleDateFormat formatter =\n new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n java.util.GregorianCalendar calDate = new java.util.GregorianCalendar();\n calDate.setTime(station.getDateStart());\n calDate.add(java.util.Calendar.DATE, -1);\n String dateStartMin = formatter.format(calDate.getTime());\n\n calDate.setTime(station.getDateEnd());\n calDate.add(java.util.Calendar.DATE, +1);\n String dateEndMax = formatter.format(calDate.getTime());\n\n where =\n MrnStation.DATE_START + \">=\" +\n Tables.getDateFormat(dateStartMin) + \" and \" +\n MrnStation.DATE_END + \"<=\" +\n Tables.getDateFormat(dateEndMax) + \" and \" +\n MrnStation.LATITUDE + \" between \" +\n (station.getLatitude()-areaRangeVal) + \" and \" +\n (station.getLatitude()+areaRangeVal) + \" and \" +\n MrnStation.LONGITUDE + \" between \" +\n (station.getLongitude()-areaRangeVal) + \" and \" +\n (station.getLongitude()+areaRangeVal);\n if (dbg) System.out.println(\"<br><br>checkStationExists: station: \" +\n \"where = \" + where);\n\n // get the records\n MrnStation[] tStation3 = new MrnStation().get(\n \"*\", where, MrnStation.STATION_ID);\n if (dbg) System.out.println(\"<br><br>checkStationExists: \" +\n \"tStation3.length = \" + tStation3.length);\n\n // put both sets of stations found in one array for processing\n tStation = new MrnStation[tStation2.length + tStation3.length];\n if (dbg) System.out.println(\"<br><br>checkStationExists: \" +\n \"tStation.length = \" + tStation.length);\n int ii = 0;\n for (int i = 0; i < tStation2.length; i++) { // same station_id\n tStation[ii] = tStation2[i];\n ii++;\n } // for (int i = 0; i < tStation2.length; i++)\n for (int i = 0; i < tStation3.length; i++) { // satem lat/lon/date/time\n tStation[ii] = tStation3[i];\n ii++;\n } // for (int i = 0; i < tStation3.length; i++)\n\n // process the records\n stationUpdated = false;\n for (int i = 0; i < tStation.length; i++) {\n\n // same station id already done\n if ((i == 0) ||\n !tStation[i].getStationId().equals(station.getStationId())) {\n\n if (tStation[i].getStationId().equals(station.getStationId())) {\n stationStatusTmp = \"di\"; // == duplicate station-id\n } else {\n stationStatusTmp = \"ds\"; // == duplicate station (lat/lon/date/time)\n } // if (tStation[i].getStationId().equals(station.getStationId()))\n\n String dbgMess = \"checkStationExists: station found in area: \" +\n i + \" \" + station.getStationId(\"\") + \" \" +\n tStation[i].getStationId(\"\");\n\n getExistingStationDetails(tStation[i], i);\n\n if (stationExistsArray[i]) {\n stationExistsCount++;\n\n outputDebug(dbgMess + \": within time range\");\n\n// if (loadFlag) {\n// updateStationDetails(i);\n// } else {\n // d == Duplicate stationId/station only\n // s == Subdes: duplicate Station (lat/lon/date/time) && subdes\n stationStatusDB[i] = stationStatusTmp;\n if (subdesCount[i] == 0) {\n // d == Duplicate stationId/station only (lat/lon/date/time)\n stationStatusDB[i] += \"d\";\n if (\"did\".equals(stationStatusDB[i])) {\n didCount++;\n } else {\n dsdCount++;\n } // if (\"did\".equals(stationStatusDB))\n } else { // if (subdesCount == 0)\n // s == Subdes: duplicate Station (lat/lon/date/time) && subdes\n stationStatusDB[i] += \"s\";\n if (\"dis\".equals(stationStatusDB[i])) {\n disCount++;\n } else {\n dssCount++;\n } // if (\"dia\".equals(stationStatusDB))\n\n thisSubdesCount += subdesCount[i];\n\n } // if (subdesCount == 0)\n// } // if (loadFlag)\n } else {\n outputDebug(dbgMess + \": NOT within time range\");\n } // if (stationExistsArray[i]) {\n\n } // if (!tStation.getStationId().equals(station.getStationId())\n\n } // for (int i = 0; i < tStation.length; i++)\n\n if (dbg) System.out.println(\"checkStationExists: stationStatusTmo = \" + stationStatusTmp);\n\n // either stations with same station Id or within same\n // area & date-time range found\n if (stationExists) {\n duplicateStations = true;\n if (dataExists) {\n stationStatusLD = \"dup\";\n } else {\n stationStatusLD = \"new\";\n newStationCount++;\n } // if (dataExists)\n } else {\n stationStatusLD = \"new\";\n newStationCount++;\n } // if (stationExists)\n\n if (dbg) System.out.println(\"checkStationExists: stationStatusLD = \" + stationStatusLD);\n if (dbg) System.out.println(\"checkStationExists: stationStatusTmo = \" + stationStatusTmp);\n for (int i = 0; i < tStation.length; i++) {\n if (dbg) System.out.println(\"checkStationExists: stationStatusDB[i] = \" +\n i + \" \" + stationStatusDB[i]);\n } // for (int i = 0; i < tStation.length; i++)\n\n }", "public static int checkSrs(int srs,int colsize,int mis)\r\n\t{\r\n\t int checksrs = -1;\r\n\t int mb = 1024*1024;\r\n\t if((srs*colsize*8)/mb < mis)\r\n\t checksrs = srs;\r\n\t else\r\n\t checksrs = checkSrs(srs/2,colsize,mis);\r\n\t if(checksrs!=srs)\r\n\t\tSystem.out.println(\"Argument \\\"subRowSize\\\" is too large: \"+srs+\", automatically reduce to: \"+checksrs);\r\n\t return checksrs;\r\n\t}", "public int getNumber(Resource res, Location loc){\n\t\tif(res.equals(Resource.BRICKS)){\n\t\t\tdouble[] values = new double[3];\n\t\t\tdouble d1 = loc.distance(locBR2);\n\t\t\tdouble d2 = loc.distance(firstLocBR4);\n\t\t\tdouble d3 = loc.distance(secondLocBR4);\n\t\t\tvalues[0] = d1;\n\t\t\tvalues[1] = d2;\n\t\t\tvalues[2] = d3;\n\t\t\tdouble minValue = 10000.00; //Absurdly high value to make sure the first value will always be lower\n\t\t\tfor(int x = 0; x < 3; x++){\n\t\t\t\tif(values[x] < minValue){\n\t\t\t\t\tminValue = values[x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(minValue == d1){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\tif(minValue == d2 || minValue == d3){\n\t\t\t\treturn 4;\n\t\t\t}\n\n\t\t}\n\t\tif(res.equals(Resource.ORE)){\n\t\t\tdouble[] values = new double[3];\n\t\t\tdouble d1 = loc.distance(locOR3);\n\t\t\tdouble d2 = loc.distance(locOR6);\n\t\t\tdouble d3 = loc.distance(locOR8);\n\t\t\tvalues[0] = d1;\n\t\t\tvalues[1] = d2;\n\t\t\tvalues[2] = d3;\n\t\t\tdouble minValue = 10000.00; //Absurdly high value to make sure the first value will always be lower\n\t\t\tfor(int x = 0; x < 3; x++){\n\t\t\t\tif(values[x] < minValue){\n\t\t\t\t\tminValue = values[x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(minValue == d1){\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\tif(minValue == d2){\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t\tif(minValue == d3){\n\t\t\t\treturn 8;\n\t\t\t}\n\t\t}\n\n\t\tif( res.equals(Resource.SHEEP) ){\n\t\t\tdouble[] values = new double[4];\n\t\t\tdouble d1 = loc.distance(locSH10);\n\t\t\tdouble d2 = loc.distance(locSH12);\n\t\t\tdouble d3 = loc.distance(locSH3);\n\t\t\tdouble d4 = loc.distance(locSH5);\n\t\t\tvalues[0] = d1;\n\t\t\tvalues[1] = d2;\n\t\t\tvalues[2] = d3;\n\t\t\tvalues[3] = d4;\n\t\t\tdouble minValue = 10000.00; //Absurdly high value to make sure the first value will always be lower\n\t\t\tfor(int x = 0; x < 4; x++){\n\t\t\t\tif(values[x] < minValue){\n\t\t\t\t\tminValue = values[x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(minValue == d1){\n\t\t\t\treturn 10;\n\t\t\t}\n\t\t\tif(minValue == d2){\n\t\t\t\treturn 12;\n\t\t\t}\n\t\t\tif(minValue == d3){\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\tif(minValue == d4){\n\t\t\t\treturn 5;\n\t\t\t}\n\t\t}\n\t\tif( res.equals(Resource.WOOD) ){\n\t\t\tdouble[] values = new double[4];\n\t\t\tdouble d1 = loc.distance(locWO10);\n\t\t\tdouble d2 = loc.distance(locWO8);\n\t\t\tdouble d3 = loc.distance(locWO9);\n\t\t\tdouble d4 = loc.distance(locWO5);\n\t\t\tvalues[0] = d1;\n\t\t\tvalues[1] = d2;\n\t\t\tvalues[2] = d3;\n\t\t\tvalues[3] = d4;\n\t\t\tdouble minValue = 10000.00; //Absurdly high value to make sure the first value will always be lower\n\t\t\tfor(int x = 0; x < 4; x++){\n\t\t\t\tif(values[x] < minValue){\n\t\t\t\t\tminValue = values[x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(minValue == d1){\n\t\t\t\treturn 10;\n\t\t\t}\n\t\t\tif(minValue == d2){\n\t\t\t\treturn 8;\n\t\t\t}\n\t\t\tif(minValue == d3){\n\t\t\t\treturn 9;\n\t\t\t}\n\t\t\tif(minValue == d4){\n\t\t\t\treturn 5;\n\t\t\t}\n\t\t}\n\t\tif( res.equals(Resource.WHEAT)){\n\t\t\tdouble[] values = new double[4];\n\t\t\tdouble d1 = loc.distance(locWH6);\n\t\t\tdouble d2 = loc.distance(locWH9);\n\t\t\tdouble d3 = loc.distance(firstLocWH11);\n\t\t\tdouble d4 = loc.distance(secondLocWH11);\n\t\t\tvalues[0] = d1;\n\t\t\tvalues[1] = d2;\n\t\t\tvalues[2] = d3;\n\t\t\tvalues[3] = d4;\n\t\t\tdouble minValue = 10000.00; //Absurdly high value to make sure the first value will always be lower\n\t\t\tfor(int x = 0; x < 4; x++){\n\t\t\t\tif(values[x] < minValue){\n\t\t\t\t\tminValue = values[x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(minValue == d1){\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t\tif(minValue == d2){\n\t\t\t\treturn 9;\n\t\t\t}\n\t\t\tif(minValue == d3){\n\t\t\t\treturn 11;\n\t\t\t}\n\t\t\tif(minValue == d4){\n\t\t\t\treturn 11;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public int getTestSrid() {\n return TEST_SRID;\n }", "public boolean isSSparse() {\n int sparse_count= 0;\n for(int i = 0; i <this.r;i++) {\n \tfor(int j = 0 ; j <this.s * 2; j ++) {\n \t\tif(net[i][j].isOneSparse())\n \t\t{\n \t\t\tsparse_count ++;\n \t\t}\n \t}\n }\n if(sparse_count == this.s)\n {\n \treturn true;\n }\n else\n {\n \treturn false;\n }\n \n }", "public int state_regions_stranded(int rcount,HashMap<Integer,Integer> rmap,int chokepoint_path,int max_stranded) {\r\n\t\t\r\n\t\tHashMap<Integer,LinkedList<Integer>> regions=new HashMap<Integer,LinkedList<Integer>> ();\r\n\t\tfor(Integer nodeIndex:rmap.keySet()) {\r\n\t\t\tint region=rmap.get(nodeIndex);\r\n\t\t\tif(region!=-1) {\r\n\t\t\tif(regions.containsKey(region)) {\r\n\t\t\t\tLinkedList<Integer> l=regions.get(region);\r\n\t\t\t\tl.add(nodeIndex);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tLinkedList<Integer> l=new LinkedList<Integer>();\r\n\t\t\t\tl.add(nodeIndex);\r\n\t\t\t\tregions.put(region, l);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tHashMap<Integer,LinkedList<Integer>> regionsNeighbor=new HashMap<Integer,LinkedList<Integer>> ();\r\n\t\t\r\n\t\tfor(Integer regionIndex:regions.keySet()) {\r\n\t\t\tLinkedList<Integer> regionNode=regions.get(regionIndex);\r\n\t\t\t\r\n\t\t\tLinkedList<Integer> regionNeighbor=new LinkedList<Integer>();\r\n\t\t\tfor(Integer nodeIndex:regionNode) {\r\n\t\t\t\tfor(Integer itsNeighbor:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(!regionNode.contains(itsNeighbor))\r\n\t\t\t\t\tif(!regionNeighbor.contains(itsNeighbor))\r\n\t\t\t\t\t\tregionNeighbor.add(itsNeighbor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tregionsNeighbor.put(regionIndex, regionNeighbor);\r\n\t\t}\r\n\t\t\r\n\t\tboolean ok=false;;\r\n\r\n\t\tfor (Integer p : paths.keySet()) {\r\n\t\t\tif(!paths.get(p).peek().equals(EndPoint.get(p))) {\r\n\t\t\tok=false;\r\n\t\t\tint topIndex = paths.get(p).peek().index;\r\n\t\t\tfor (Integer regionIndex : regionsNeighbor.keySet()) {\r\n\t\t\t\tLinkedList<Integer> itsNeighbors = regionsNeighbor.get(regionIndex);\r\n\r\n\t\t\t\tif (itsNeighbors.contains(topIndex)&&itsNeighbors.contains(EndPoint.get(p).index)) {\r\n\t\t\t\t\tok=true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif(!ok) {\r\n\t\t\t\t\r\n\t\t\t\tif(!nowMap.get(paths.get(p).peek().index).contains(EndPoint.get(p).index))\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "public Map<Integer, Integer> getSrid() throws SQLException {\n return retrieveExpected(createNativeSridStatement(), INTEGER);\n }", "private boolean tryFindPath() {\n\t\t\tfor (Node neighbour : neighbours) {\n\t\t\t\tif (neighbour.x == n || neighbour.y == 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (!neighbour.isReachable()) {\n\t\t\t\t\tneighbour.setReachable();\n\t\t\t\t\tif (neighbour.tryFindPath()) {\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\treturn false;\n\t\t}", "private int getSimlarityScore(String s1, String s2) {\r\n\t\tint match = 1;\r\n\t\tint mismatch = -1;\r\n\t\tint gap = -2;\r\n\t\tNeedlemanWunsch algorithm = new NeedlemanWunsch();\r\n\t\tBasicScoringScheme scoring = new BasicScoringScheme(match, mismatch, gap);\r\n\t\talgorithm.setScoringScheme(scoring);\r\n\t\talgorithm.loadSequences(s1, s2);\r\n\t\t\r\n\t\tint score = INT_MAX;\r\n\t\ttry {\r\n\t\t\tscore = algorithm.getScore();\r\n\t\t\t//System.out.println(algorithm.getPairwiseAlignment().getGappedSequence1());\r\n\t\t\t//System.out.println(algorithm.getPairwiseAlignment().getGappedSequence2());\r\n\t\t\t//System.out.println(algorithm.getPairwiseAlignment());\r\n\t\t} catch (IncompatibleScoringSchemeException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\tif (score < 0) {\r\n\t\t\tscore = 0;\r\n\t\t}\r\n\t\treturn score;\r\n\t}", "public int getSs() {\n return ss_;\n }", "public int getSsn() {\n\t\treturn ssn;\n\t}", "boolean hasSsn();", "public int getSsn() {\r\n\t\treturn ssn; //you can define only get to access the data it is not necessary that you define both.\r\n\t}", "@Test\n public void testSfSqlRead() throws SQLException {\n\n GeometryColumnsUtils.testSfSqlRead(geoPackage, null);\n\n }", "public int getNumSols()\n\t{\n\t\treturn numSols;\n\t}", "java.lang.String getSOID();", "public String snum_check(int snum) {\n\t\treturn Sdao.nameselect(snum);\r\n\t}", "public String getSR_ID() {\n\t\treturn SR_ID;\n\t}", "public int getSIDbyName(String sname) {\n String query = \"SELECT \"+DBHelper.STORES_ID+\" FROM \"+DBHelper.TABLE_STORES+\" WHERE \"+DBHelper.STORES_SNAME+\" =?\";\n String[] arg = new String[]{sname};\n\n SQLiteDatabase db = DBHelper.getWritableDatabase();\n Cursor cursor = db.rawQuery(query, arg);\n\n if(cursor.moveToNext()) {\n int sid = cursor.getInt(cursor.getColumnIndex(DBHelper.STORES_ID));\n db.close();\n return sid;\n }\n else{\n return -1;\n }\n }", "boolean search(int count, GraphDatabaseService databaseService, boolean isProtein) {\n boolean completed = false;\n int id = searchOrderSeq.get(count);\n String x = null;\n if(isProtein)\n x = queryGraphNodes.get(id).label;\n else\n x = String.valueOf(queryGraphNodes.get(id).labels.get(0));\n for(Long nodeID: searchSpaceProtein.get(x)) {\n boolean alreadyEncountered = false;\n for(int id1: solution.keySet()) {\n if(solution.get(id1) == nodeID)\n alreadyEncountered = true;\n }\n\n if(!check(nodeID, id, databaseService) || alreadyEncountered)\n continue;\n\n\n solution.put(id, nodeID);\n\n if(solution.size() == searchOrderSeq.size()) {\n listOfSolutions.put(++numSubgraphs, new HashMap<>(solution));\n solution.remove(id);\n }\n if(listOfSolutions.size()>999)\n return true;\n if(count<searchOrderSeq.size() - 1)\n search(count + 1, databaseService, isProtein);\n\n }\n if(listOfSolutions.size()>999)\n return true;\n if(solution.size()>0)\n solution.remove(searchOrderSeq.get(count - 1));\n return completed;\n }", "public int getSs() {\n return ss_;\n }", "private void findPosition() throws Exception {\n \tLocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n\n \t// Define a listener that responds to location updates\n \tLocationListener locationListener = new LocationListener() {\n \t public void onLocationChanged(Location location) {\n \t // Called when a new location is found by the network location provider.\n \t \n \t }\n\n \t public void onStatusChanged(String provider, int status, Bundle extras) {}\n\n \t public void onProviderEnabled(String provider) {}\n\n \t public void onProviderDisabled(String provider) {}\n \t };\n\n \t// Register the listener with the Location Manager to receive location updates\n \ttry {\n \t\tlocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n \tLocation loc = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n \tlatitude = (int)(loc.getLatitude()*1E6);\n \tlongitude = (int)(loc.getLongitude()*1E6);\n\t\t} catch (Exception e) {\n\t\t\tlocationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER, 0, 0, locationListener);\n\t \tLocation loc = locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);\n\t \tlatitude = (int)(loc.getLatitude()*1E6);\n\t \tlongitude = (int)(loc.getLongitude()*1E6);\n\t\t}\n \t//locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n \t//Location loc = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n \t\n \t\n \t\n\t\t\n\t}", "protected SceneLocation locationForBody (int bodyOid)\n {\n return (SceneLocation)_ssobj.occupantLocs.get(new Integer(bodyOid));\n }", "private boolean trySolitude(int x, int y, Assignment assignment){\n\t\tint neighbors = getNeighborCount(x, y, assignment);\n\n\t\tif(neighbors == 0 || neighbors == 1)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "private List<Integer> getInitialCorners_SezginOversegment()\n\t\t\tthrows InvalidParametersException {\n\n\t\tList<Integer> allCorners = new ArrayList<Integer>();\n\n\t\tdouble[] pathLengths = calcPathLengths(m_stroke);\n\t\tdouble[] directions = calcDirections(true);\n\t\tdouble[] curvatures = calcCurvatures(pathLengths, directions, true);\n\t\tdouble[] speeds = calcSpeeds(pathLengths, true);\n\n\t\t// Get the corners from curvature and speed\n\t\t// This has VERY loose thresholds\n\t\tList<Integer> Fc = generateCornersFromCurvature(curvatures, 0.1);\n\t\tList<Integer> Fs = generateCornersFromSpeed(speeds, 3.0);\n\n\t\t// Calculate an initial fit for the corners\n\t\tallCorners.addAll(Fc);\n\t\tallCorners.addAll(Fs);\n\n\t\tCollections.sort(allCorners);\n\n\t\t// Filter out similar corners\n\t\tfilterCorners(allCorners, curvatures, speeds, pathLengths);\n\n\t\treturn allCorners;\n\t}", "@Test\n public void testGetsAroundLocationII() throws InvalidIdentifierException, DataSourceException {\n // Get just one demand from one location\n //\n Location where = new Location();\n where.setPostalCode(RobotResponder.ROBOT_POSTAL_CODE);\n where.setCountryCode(RobotResponder.ROBOT_COUNTRY_CODE);\n where = new LocationOperations().createLocation(where);\n\n ProposalOperations ops = new ProposalOperations();\n\n final Long ownerKey = 45678L;\n final Long storeKey = 78901L;\n Proposal first = new Proposal();\n first.setLocationKey(where.getKey());\n first.setOwnerKey(ownerKey);\n first.setStoreKey(storeKey);\n first = ops.createProposal(first);\n\n Proposal second = new Proposal();\n second.setLocationKey(where.getKey());\n second.setOwnerKey(ownerKey);\n second.setStoreKey(storeKey);\n second = ops.createProposal(second);\n\n first = ops.getProposal(first.getKey(), null, null);\n second = ops.getProposal(second.getKey(), null, null);\n\n List<Location> places = new ArrayList<Location>();\n places.add(where);\n\n List<Proposal> selection = ops.getProposals(places, 1);\n assertNotNull(selection);\n assertEquals(1, selection.size());\n assertTrue (selection.get(0).getKey().equals(first.getKey()) ||\n selection.get(0).getKey().equals(second.getKey()));\n // assertEquals(first.getKey(), selection.get(1).getKey()); // Should be second because of ordered by descending date\n // assertEquals(second.getKey(), selection.get(0).getKey()); // but dates are so closed that sometines first is returned first...\n }", "private boolean findGridlet(Gridlet gl)\n {\n if (gl == null) {\n return false;\n }\n\n boolean result = false;\n int glID = gl.getGridletID();\n int glResID = -1;\n\n switch(searchType_)\n {\n // find a Gridlet that matches with a given id\n case FIND_GRIDLET_ID:\n if (glID == gridletID_) {\n result = true;\n }\n break;\n\n // find a Gridlet that matches with a given id also\n // user and resource id\n case FIND_GRIDLET_WITH_USER_AND_RES_ID:\n int glUserID = gl.getUserID();\n glResID = gl.getResourceID();\n if (glID == gridletID_ && glUserID == userID_ &&\n glResID == resID_)\n {\n result = true;\n }\n break;\n\n // find a Gridlet that matches with a given id and its resource id\n case FIND_GRIDLET_WITH_RES_ID:\n glResID = gl.getResourceID();\n if (glID == gridletID_ && glResID == resID_) {\n result = true;\n }\n break;\n\n default:\n result = false;\n break;\n }\n\n return result;\n }", "@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tint wkid = map.getSpatialReference().getID();\n\n\t\t\t\t\t\t\tLocator locator = Locator\n\t\t\t\t\t\t\t\t\t.createOnlineLocator(floorInfo\n\t\t\t\t\t\t\t\t\t\t\t.getLocatorServerPath());\n\t\t\t\t\t\t\t// Create suggestion parameter\n\t\t\t\t\t\t\tLocatorFindParameters params = new LocatorFindParameters(\n\t\t\t\t\t\t\t\t\taddress);\n\n\t\t\t\t\t\t\t// ArrayList<String> outFields = new\n\t\t\t\t\t\t\t// ArrayList<String>();\n\t\t\t\t\t\t\t// outFields.add(\"*\");\n\t\t\t\t\t\t\t// params.setOutFields(outFields);\n\t\t\t\t\t\t\t// Set the location to be used for proximity based\n\t\t\t\t\t\t\t// suggestion\n\t\t\t\t\t\t\t// params.setLocation(map.getCenter(),map.getSpatialReference());\n\t\t\t\t\t\t\t// Set the radial search distance in meters\n\t\t\t\t\t\t\t// params.setDistance(50000.0);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tlocatorResults = locator.find(params);\n\t\t\t\t\t\t\t\t// HashMap<String, String> params = new\n\t\t\t\t\t\t\t\t// HashMap<String,\n\t\t\t\t\t\t\t\t// String>();\n\t\t\t\t\t\t\t\t// params.put(\"货架编号\", address);\n\t\t\t\t\t\t\t\t// locatorResults = locator.geocode(params,\n\t\t\t\t\t\t\t\t// null,\n\t\t\t\t\t\t\t\t// map.getSpatialReference());\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tSystem.out.println(\"查找:\" + address + \" 出错:\"\n\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (locatorResults != null\n\t\t\t\t\t\t\t\t\t&& locatorResults.size() > 0) {\n\t\t\t\t\t\t\t\t// Add the first result to the map and zoom to\n\t\t\t\t\t\t\t\t// it\n\t\t\t\t\t\t\t\tfor (LocatorGeocodeResult result : locatorResults) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"查找:\" + address + \" 结果:\"\n\t\t\t\t\t\t\t\t\t\t\t+ result.getAddress());\n\n\t\t\t\t\t\t\t\t\tif (result.getAddress() != null\n\t\t\t\t\t\t\t\t\t\t\t&& address.equals(result\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getAddress())) {\n\n\t\t\t\t\t\t\t\t\t\tfloorInfo.getShelfList().add(result);\n\t\t\t\t\t\t\t\t\t\t// shelfList.add(result);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsearchTime++;\n\t\t\t\t\t\t\tSystem.out.println(\"已查找次数:\" + searchTime);\n\t\t\t\t\t\t\tif (searchTime >= mSearchCount) {\n\t\t\t\t\t\t\t\tmHandler.post(mMarkAndRoute);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private void lastResortFindPeer() {\n\t\tDecentLogger.write(\"Resolving peers from DNS (last resort)\");\n\t\tfor(String seed: DNS_SEEDS) {\n\t\t\tArrayList<InetAddress> hosts = DNSResolver.getARecords(seed);\n\t\t\tif(hosts != null) {\n\t\t\t\tcheckList(hosts);\n\t\t\t}\n\t\t}\n\t}", "private FloatCoordinate getCoordinates(InetAddress addr)\n {\n FloatCoordinate coords = null;\n\n /*\n * Look for the geographical coordinates in our database.\n */\n try {\n if (DEBUG && _debugLevel > 1) {\n debugPrintLn(\"Looking for coordinates associated with \"\n + addr.getHostAddress() + \" in Geo db\");\n }\n coords = GlobeRedirector.geoDB.read(addr);\n }\n catch(DBException e) {\n logError(\"GeoDB read failure\" + getExceptionMessage(e));\n\n // CONTINUE\n }\n\n /*\n * If the coordinates are not in the database, retrieve them from\n * the Net GEO server (and store them in the database).\n */\n if (coords == null) {\n if (DEBUG && _debugLevel > 1) {\n debugPrintLn(\"Retrieving coordinates from GEO server\");\n }\n\n if ( (coords = askNetGeo(addr)) == null) {\n if (DEBUG && _debugLevel > 1) {\n debugPrintLn(\"Cannot determine coordinates\");\n }\n return null;\n }\n else {\n try {\n GlobeRedirector.geoDB.write(addr, coords);\n }\n catch(DBException e) {\n logError(\"GeoDB write failure\" + getExceptionMessage(e));\n\n // CONTINUE\n }\n }\n }\n return coords;\n }", "public CMSW4 findW4 (String ssn) throws Exception {\n try {\n this.fireWorkInProgressEvent(true);\n return (CMSW4) CMSFormServices.getCurrent().findW4(ssn);\n } catch (DowntimeException ex) {\n LoggingServices.getCurrent().logMsg(getClass().getName(),\"findW4\",\n \"Primary Implementation for CMSFormServices failed, going Off-Line...\",\n \"See Exception\", LoggingServices.MAJOR, ex);\n offLineMode();\n setOffLineMode();\n return (CMSW4) CMSFormServices.getCurrent().findW4(ssn);\n } finally {\n this.fireWorkInProgressEvent(false);\n }\n }", "@Test\n public void testGetsAroundLocationI() throws DataSourceException, InvalidIdentifierException {\n // Get all demands from one location\n //\n Location where = new Location();\n where.setPostalCode(RobotResponder.ROBOT_POSTAL_CODE);\n where.setCountryCode(RobotResponder.ROBOT_COUNTRY_CODE);\n where = new LocationOperations().createLocation(where);\n\n ProposalOperations ops = new ProposalOperations();\n\n final Long ownerKey = 45678L;\n final Long storeKey = 78901L;\n Proposal first = new Proposal();\n first.setLocationKey(where.getKey());\n first.setOwnerKey(ownerKey);\n first.setStoreKey(storeKey);\n first = ops.createProposal(first);\n\n Proposal second = new Proposal();\n second.setLocationKey(where.getKey());\n second.setOwnerKey(ownerKey);\n second.setStoreKey(storeKey);\n second = ops.createProposal(second);\n\n first = ops.getProposal(first.getKey(), null, null);\n second = ops.getProposal(second.getKey(), null, null);\n\n List<Location> places = new ArrayList<Location>();\n places.add(where);\n\n List<Proposal> selection = ops.getProposals(places, 0);\n assertNotNull(selection);\n assertEquals(2, selection.size());\n assertTrue (selection.get(0).getKey().equals(first.getKey()) && selection.get(1).getKey().equals(second.getKey()) ||\n selection.get(1).getKey().equals(first.getKey()) && selection.get(0).getKey().equals(second.getKey()));\n // assertEquals(first.getKey(), selection.get(1).getKey()); // Should be second because of ordered by descending date\n // assertEquals(second.getKey(), selection.get(0).getKey()); // but dates are so closed that sometines first is returned first...\n }", "private int getSSN (){\n return ssn;\n }", "@Override\r\n\tpublic int findNum(int state) {\n\t\treturn sqlSessionTemplate.selectOne(typeNameSpace + \".findNum\", state);\r\n\t}", "public Geometry snapWith(Geometry geom2snap, Geometry[] geoms,\n\t\t\tint weightGeom, int[] weights) {\n\t\tif (geom2snap instanceof GeometryCollection) {\n\t\t\tGeometryCollection geometryCollection = (GeometryCollection) geom2snap;\n\t\t\tif (geometryCollection.getNumGeometries() > 1)\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"El metodo snap no puede recibir como \"\n\t\t\t\t\t\t\t\t+ \"argumentos GeometryCollection o subclases con mas de un elemento\");\n\n\t\t}\n\n\t\tSnappingCoordinateMap coordinateMap = new SnappingCoordinateMap(\n\t\t\t\tsnapTolerance);\n\t\tGeometry solution = null;\n\n\t\tCoordinate[] coords = geom2snap.getCoordinates();\n\t\tCoordinateList coordList = new CoordinateList(coords);\n\n\t\tfor (int j = 0; j < coords.length; j++) { // for each coordinate of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// geometry to crack\n\t\t\tCoordinate coord = coords[j];\n\t\t\tCoordinate existingSolution = (Coordinate) coordinateMap.get(coord);\n\n\t\t\tif (coordinateMap.get(coord) != null) {// this coordinate has\n\t\t\t\t\t\t\t\t\t\t\t\t\t// already been snapped\n\t\t\t\tcoordList.set(j, existingSolution);// we exchange the coordinate\n\t\t\t\t\t\t\t\t\t\t\t\t\t// for the already computed\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// for the crack operation, we are going to compute the weighted\n\t\t\t// average of a coordinate\n\t\t\t// with all the coordinates of the cracking geometries in cluster\n\t\t\t// tolerance radius\n\t\t\tArrayList<SnapCoordinate> coordsToSnap = new ArrayList<SnapCoordinate>();\n\n\t\t\t// we add the current coordinate\n\t\t\tSnapCoordinate snapCoord = new SnapCoordinate();\n\t\t\tsnapCoord.weight = weightGeom;\n\t\t\tsnapCoord.coordinate = coord;\n\t\t\tcoordsToSnap.add(snapCoord);\n\n\t\t\t// and now we look for coordinates in the snap tolerance radius\n\n\t\t\tfor (int k = 0; k < geoms.length; k++) {// for each cracking\n\t\t\t\t\t\t\t\t\t\t\t\t\t// geometry\n\t\t\t\tGeometry geom2 = geoms[k];\n\t\t\t\tCoordinate[] coords2 = geom2.getCoordinates();\n\t\t\t\tfor (int z = 0; z < coords2.length; z++) {\n\t\t\t\t\tCoordinate coord2 = coords2[z];\n\t\t\t\t\tif (SnapCGAlgorithms.snapEquals2D(coord, coord2,\n\t\t\t\t\t\t\tsnapTolerance)) {\n\t\t\t\t\t\tsnapCoord = new SnapCoordinate();\n\t\t\t\t\t\tsnapCoord.weight = weights[k];\n\t\t\t\t\t\tsnapCoord.coordinate = coord2;\n\t\t\t\t\t\tcoordsToSnap.add(snapCoord);\n\t\t\t\t\t}// if\n\t\t\t\t}// for z\n\t\t\t}// for k\n\n\t\t\tCoordinate newCoord = snapAverage(coordsToSnap);\n\t\t\tcoordList.set(j, newCoord);\n\t\t\tcoordinateMap.put(newCoord, newCoord);\n\t\t}// for j\n\n\t\tCoordinate[] newPts = coordList.toCoordinateArray();\n\n\t\tString geometryType = geom2snap.getGeometryType();\n\n\t\tif (geometryType.equalsIgnoreCase(\"GeometryCollection\")\n\t\t\t\t|| geometryType.equalsIgnoreCase(\"MultiPolygon\")\n\t\t\t\t|| geometryType.equalsIgnoreCase(\"MultiLineString\")\n\t\t\t\t|| geometryType.equalsIgnoreCase(\"MultiPoint\")) {\n\n\t\t\tGeometryCollection geomCol = (GeometryCollection) geom2snap;\n\n\t\t\t// we have already checked that it has no more than 1 geometry\n\t\t\tgeom2snap = geomCol.getGeometryN(0);\n\t\t\tgeometryType = geom2snap.getGeometryType();\n\t\t}\n\n\t\tif (geometryType.equalsIgnoreCase(\"Polygon\")) {\n\t\t\tint[] indexOfParts = JtsUtil.getIndexOfParts((Polygon) geom2snap);\n\t\t\tsolution = JtsUtil.createPolygon(newPts, indexOfParts);\n\t\t} else {\n\t\t\tsolution = JtsUtil.createGeometry(newPts, geometryType);\n\t\t}\n\n\t\treturn solution;\n\t}", "void checkStationUIExists() {\n\n int recordCount = 9999;\n int duplicateCount = 0;\n\n String where = MrnStation.DATE_START + \"=\" +\n Tables.getDateFormat(station.getDateStart()) +\n \" and \" + MrnStation.LATITUDE +\n \" between \" + (station.getLatitude()-areaRangeVal) +\n \" and \" + (station.getLatitude()+areaRangeVal) +\n \" and \" + MrnStation.LONGITUDE +\n \" between \" + (station.getLongitude()-areaRangeVal) +\n \" and \" + (station.getLongitude()+areaRangeVal) ;\n if (dbg) System.out.println(\"<br>checkStationUIExists: where = \" + where);\n //outputDebug(\"checkStationUIExists: where = \" + where);\n\n MrnStation[] stns = new MrnStation().get(where);\n if (dbg) System.out.println(\"<br>checkStationUIExists: stns.length = \" + stns.length);\n //outputDebug(\"checkStationUIExists: number of stations found = \" + stns.length);\n\n String debugMessage = \"\\ncheckStationUIExists: duplicate UI check \\n \" +\n station.getDateStart(\"\").substring(0,10) +\n \", \" + ec.frm(station.getLatitude(),10,5) +\n \", \" + ec.frm(station.getLongitude(),10,5) +\n \", \" + station.getStnnam(\"\") +\n \" (\" + station.getStationId(\"\") + \")\";\n\n if (stns.length == 0) {\n outputDebug(debugMessage + \": duplicate UI not found\");\n } else {\n\n outputDebug(debugMessage);\n\n // check for duplicate station names (stnnam)\n while (recordCount > 0) {\n\n // count station names the same\n recordCount = 0;\n for (int i = 0; i < stns.length; i++) {\n if (stns[i].getStnnam(\"\").equals(station.getStnnam(\"\"))) {\n recordCount++;\n } // if (stns[i].getStnnam(\"\").equals(station.getStnnam(\"\")))\n } // for (int i = 0; i < stns.length; i++)\n\n if (dbg) System.out.println(\"<br>checkStationUIExists: recordCount = \" +\n recordCount + \", stnnam = \" + station.getStnnam(\"\"));\n\n debugMessage = \" \" + station.getStnnam(\"\") +\n \", recordCount (same stnnam) = \" + recordCount;\n\n if (recordCount > 0) {\n duplicateCount++;\n\n station.setStnnam(station.getStnnam(\"\") + duplicateCount);\n\n debugMessage += \" - new stnnam = \" +\n station.getStnnam(\"\");\n //outputDebug(debugMessage);\n if (dbg) System.out.println(\"checkStationUIExists: new stnnam = \" +\n station.getStnnam(\"\"));\n }// if (recordCount > 0)\n\n outputDebug(debugMessage);\n\n } // while (recordCount > 0)\n\n } // if (stns.length == 0)\n\n }", "public void findStreets() {\r\n\t\tpolygonMap.resetStreets();\r\n\t\tpolygonMap.setCurrentPlayerID(client.getSettler().getID());\r\n\t\tfor (int i = 0; i < island.getRoads().length; i++) {\r\n\t\t\tif (buildStreetIsAllowed(island.getRoads()[i])\r\n\t\t\t\t\t&& !isWaterStreet(island.getRoads()[i])) {\r\n\t\t\t\tpolygonMap.addStreet(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private int selectSolr()\n {\n //Select the endpoint with the least amount of load\n //The start index is randomized to reduce bias to nodes earlier\n //in the list.\n int minIndex = -1;\n int minOutstanding = Integer.MAX_VALUE;\n int startIndex = ThreadLocalRandom.current().nextInt(outstandingRequests.length());\n int loopEnd = outstandingRequests.length() + startIndex;\n for (int ii = startIndex; ii < loopEnd; ii++)\n {\n int index = ii % outstandingRequests.length();\n int outstanding = outstandingRequests.get(index);\n if (outstanding < minOutstanding)\n {\n minIndex = index;\n minOutstanding = outstanding;\n }\n }\n\n return minIndex;\n }", "int getMinUtil(int ss, int se, int qs, int qe, int si)\n {\n if (qs <= ss && qe >= se)\n return st[si];\n\n // If segment of this node is outside the given range\n if (se < qs || ss > qe)\n return Integer.MAX_VALUE;\n\n // If a part of this segment overlaps with the given range\n int mid = getMid(ss, se);\n return Math.min(getMinUtil(ss, mid, qs, qe, 2 * si + 1) ,\n \t\t getMinUtil(mid + 1, se, qs, qe, 2 * si + 2));\n }", "@Deprecated\n\tprivate List<Integer> sfs(List<Integer> corners, Stroke stroke,\n\t\t\tIObjectiveFunction objFunction) {\n\t\tif (corners.size() <= 2)\n\t\t\treturn corners;\n\n\t\tList<Integer> cornerSubset = new ArrayList<Integer>();\n\t\tcornerSubset.add(0);\n\t\tcornerSubset.add(stroke.getNumPoints() - 1);\n\n\t\tList<Double> errorList = new ArrayList<Double>();\n\n\t\tfor (int i = 0; i < corners.size() - 2; i++) {\n\n\t\t\tList<Object> results = nextBestCorner(cornerSubset, corners,\n\t\t\t\t\tstroke, objFunction);\n\n\t\t\tint corner = (Integer) results.get(0);\n\t\t\tdouble error = (Double) results.get(1);\n\n\t\t\tcornerSubset.add(corner);\n\t\t\terrorList.add(error);\n\t\t}\n\n\t\tdouble bestError = errorList.get(errorList.size() - 1);\n\t\tList<Integer> bestSubset = new ArrayList<Integer>();\n\t\tfor (int i = errorList.size() - 1; i >= 0; i--) {\n\t\t\tif (errorList.get(i) > bestError * 1.5) {\n\t\t\t\tbestSubset = cornerSubset.subList(0, i + 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tCollections.sort(bestSubset);\n\n\t\treturn bestSubset;\n\t}", "@Override\n\t/*\n\t * public int checkNodeInDBByCoordinate(Coordinate coordinate) {\n\t * \n\t * ResultSet resultSet = null; int x = coordinate.getX(); int y =\n\t * coordinate.getY(); try {\n\t * \n\t * String checkNodesInDB =\n\t * \"select id from routefinder.node where x=? and y=?\"; pstmt =\n\t * conn.prepareStatement(checkNodesInDB); pstmt.setInt(1, x);\n\t * pstmt.setInt(2, y); resultSet = pstmt.executeQuery(); if\n\t * (resultSet.next()) { return resultSet.getInt(\"id\"); } else {\n\t * System.out.println(\"Cannot find node \" + x + \", \" + y); return -1; } }\n\t * catch (SQLException se) { se.printStackTrace(); return -1; } finally {\n\t * JdbcConnect.resultClose(resultSet, pstmt); } }\n\t */\n\tpublic int checkNodeRelationInDBByNodeRelation(NodeRelation[] nodeRelation) {\n\t\treturn 0;\n\t}", "public void fetchLocationOnce() throws LocationException {\n if ( listener != null && hasSystemFeature() && isProviderEnabled() && isSecure()) {\n try {\n locationManager.requestSingleUpdate(provider, listener, null);\n return;\n } catch (SecurityException se) {\n Log.wtf(GeoLocationProvider.class.getSimpleName(), se);\n throw new LocationException(se);\n }\n } else {\n throw new LocationException(listener != null, hasSystemFeature(), isProviderEnabled(), isSecure());\n }\n\n }", "@Test\n public void testGetsAroundLocationIII() throws InvalidIdentifierException, DataSourceException {\n // Get limited number of demands from many locations\n //\n LocationOperations lOps = new LocationOperations();\n ProposalOperations sOps = new ProposalOperations();\n\n Location lFirst = new Location();\n lFirst.setPostalCode(RobotResponder.ROBOT_POSTAL_CODE);\n lFirst.setCountryCode(RobotResponder.ROBOT_COUNTRY_CODE);\n lFirst = lOps.createLocation(lFirst);\n\n final Long ownerKey = 45678L;\n final Long storeKey = 78901L;\n Proposal sFirst = new Proposal();\n sFirst.setLocationKey(lFirst.getKey());\n sFirst.setOwnerKey(ownerKey);\n sFirst.setStoreKey(storeKey);\n sFirst = sOps.createProposal(sFirst);\n\n Location lSecond = new Location();\n lSecond.setPostalCode(\"H1H1H1\");\n lSecond.setCountryCode(RobotResponder.ROBOT_COUNTRY_CODE);\n lSecond = lOps.createLocation(lSecond);\n\n Proposal sSecond = new Proposal();\n sSecond.setLocationKey(lSecond.getKey());\n sSecond.setOwnerKey(ownerKey);\n sSecond.setStoreKey(storeKey);\n sOps.createProposal(sSecond);\n\n Proposal sThird = new Proposal();\n sThird.setLocationKey(lSecond.getKey());\n sThird.setOwnerKey(ownerKey);\n sThird.setStoreKey(storeKey);\n sOps.createProposal(sThird);\n\n sFirst = sOps.getProposal(sFirst.getKey(), null, null);\n sSecond = sOps.getProposal(sSecond.getKey(), null, null);\n sThird = sOps.getProposal(sThird.getKey(), null, null);\n\n List<Location> places = new ArrayList<Location>();\n places.add(lFirst);\n places.add(lSecond);\n\n List<Proposal> selection = sOps.getProposals(places, 2); // Should cut to 2 items\n assertNotNull(selection);\n assertEquals(2, selection.size());\n assertEquals(sFirst.getKey(), selection.get(0).getKey());\n // No more test because it appears sometimes sSecond comes back, sometimes sThird comes back\n // FIXME: re-insert the test for sSecond in the returned list when we're sure the issue related ordering on inherited attribute is fixed.\n }", "private void reverseLookupAD_Org_ID() throws Exception\r\n\t{\r\n\t\tStringBuilder sql = new StringBuilder();\r\n\t\tString msg = new String();\r\n\t\tint no = 0;\r\n\r\n\t\t//Reverese Look up AD_Org ID From JP_Org_Value\r\n\t\tmsg = Msg.getMsg(getCtx(), \"Matching\") + \" : \" + Msg.getElement(getCtx(), \"AD_Org_ID\")\r\n\t\t+ \" - \" + Msg.getMsg(getCtx(), \"MatchFrom\") + \" : \" + Msg.getElement(getCtx(), \"JP_Org_Value\") ;\r\n\t\tsql = new StringBuilder (\"UPDATE I_LocationJP i \")\r\n\t\t\t\t.append(\"SET AD_Org_ID=(SELECT AD_Org_ID FROM AD_org p\")\r\n\t\t\t\t.append(\" WHERE i.JP_Org_Value=p.Value AND (p.AD_Client_ID=i.AD_Client_ID or p.AD_Client_ID=0) ) \")\r\n\t\t\t\t.append(\" WHERE i.JP_Org_Value IS NOT NULL\")\r\n\t\t\t\t.append(\" AND i.I_IsImported='N'\").append(getWhereClause());\r\n\t\ttry {\r\n\t\t\tno = DB.executeUpdateEx(sql.toString(), get_TrxName());\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.fine(msg +\"=\" + no + \":\" + sql);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + sql );\r\n\t\t}\r\n\r\n\t\t//Invalid JP_Org_Value\r\n\t\tmsg = Msg.getMsg(getCtx(), \"Invalid\")+Msg.getElement(getCtx(), \"JP_Org_Value\");\r\n\t\tsql = new StringBuilder (\"UPDATE I_LocationJP \")\r\n\t\t\t.append(\"SET I_ErrorMsg='\"+ msg + \"'\")\r\n\t\t\t.append(\" WHERE AD_Org_ID = 0 AND JP_Org_Value IS NOT NULL AND JP_Org_Value <> '0' \")\r\n\t\t\t.append(\" AND I_IsImported<>'Y'\").append(getWhereClause());\r\n\t\ttry {\r\n\t\t\tno = DB.executeUpdateEx(sql.toString(), get_TrxName());\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.fine(msg +\"=\" + no + \":\" + sql);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + msg +\" : \" + sql );\r\n\t\t}\r\n\r\n\t\tif(no > 0)\r\n\t\t{\r\n\t\t\tcommitEx();\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + msg );\r\n\t\t}\r\n\r\n\t}", "private int searchNumberOfAvailableSeats(@SuppressWarnings(\"rawtypes\") PropertySource ps) {\n\t\tString levelString = (String) ps.getProperty(LEVEL.toString());\n\t\tOptional<Integer> venueLevel = StringUtils.isEmpty(levelString) ? Optional.empty() : Optional.of(Integer.valueOf( levelString ));\n\t\treturn ticketService.numSeatsAvailable(venueLevel);\n\t}", "public boolean hasSLLNGRTTNID() {\n return fieldSetFlags()[8];\n }", "private Student getFoundStudent(ResultSet resultOfTheSearch) throws PhoneException, SQLException, \n\tCPFException, DateException, AddressException, RGException, StudentException, PersonException {\n\n\t\t// Get the data from database\n\t\tString studentName = resultOfTheSearch.getString(NAME_COLUMN);\n\n\t\tString email = resultOfTheSearch.getString(EMAIL_COLUMN);\n\t\tString motherName = resultOfTheSearch.getString(MOTHER_COLUMN);\n\t\tString fatherName = resultOfTheSearch.getString(FATHER_COLUMN);\n\n\t\t//CPF\n\t\tString cpf = resultOfTheSearch.getString(CPF_COLUMN);\n\t\tCPF studentCpf = new CPF(cpf);\n\n\t\t//RG\n\t\tString rg = resultOfTheSearch.getString(RG_NUMBER_COLUMN);\n\t\tString uf = resultOfTheSearch.getString(UF_COLUMN);\n\t\tString issuing_institution = resultOfTheSearch.getString(ISSUING_INSTITUTION_COLUMN);\n\t\tRG studentRg = new RG(rg,issuing_institution,uf);\n\n\t\t//Address\n\t\tString city = resultOfTheSearch.getString(CITY_COLUMN);\n\t\tString addressInfo = resultOfTheSearch.getString(ADDRESS_COLUMN);\n\t\tString complement = resultOfTheSearch.getString(COMPLEMENT_COLUMN);\n\t\tString number = resultOfTheSearch.getString(NUMBER_COLUMN);\n\t\tString cep = resultOfTheSearch.getString(CEP_COLUMN);\n\t\tAddress address = new Address(addressInfo, number, complement, cep,city);\n\n\t\t//Phones\n\t\tString cellPhone = resultOfTheSearch.getString(PRINCIPAL_PHONE_COLUMN);\n\t\tString residencePhone = resultOfTheSearch.getString(SECONDARY_PHONE_COLUMN);\n\t\tString DDDPrincipalPhone = cellPhone.substring(0,2);\n\t\tString numberPrincipalPhone = cellPhone.substring(2,10);\n\t\t\n\t\tString DDDSecondaryPhone;\n\t\tString numberSecondaryPhone;\n\t\tPhone principalPhone;\n\t\tPhone secondaryPhone;\n\t\t\n\t\tif(!residencePhone.isEmpty()){\n\t\t\t\n\t\t\tDDDSecondaryPhone = residencePhone.substring(0,2);\n\t\t\tnumberSecondaryPhone = residencePhone.substring(2,10);\n\t\t\tprincipalPhone = new Phone(DDDPrincipalPhone,numberPrincipalPhone);\n\t\t\tsecondaryPhone = new Phone(DDDSecondaryPhone,numberSecondaryPhone);\n\t\t}else{\n\t\t\tprincipalPhone = new Phone(DDDPrincipalPhone,numberPrincipalPhone);\n\t\t\tsecondaryPhone = null;\n\t\t}\n\n\t\tDate birthdate = birthdate(resultOfTheSearch);\n\t\t//Status\n\t\tint status = resultOfTheSearch.getInt(STATUS_COLUMN);\n\t\t\n\t\tStudent student = new Student(studentName, studentCpf, studentRg, birthdate, email, address,\n\t\t\t\t\t\t\t\t\t principalPhone, secondaryPhone, motherName, fatherName, status);\n\t\n\t\treturn student;\n\t}", "private GM_Object createGeometry(ByteArrayOutputStream bos,\r\n CS_CoordinateSystem srs) throws Exception {\r\n Debug.debugMethodBegin( this, \"createGeometry\" ); \r\n \r\n byte[] wkb = bos.toByteArray();\r\n bos.close(); \r\n \r\n String crs = srs.getName();\r\n crs = crs.replace(' ',':');\r\n crs = StringExtend.replace(crs, \":\", \".xml#\", true ); \r\n \r\n StringBuffer sb = null;\r\n GM_Object geo = null; \r\n \r\n // create geometries from the wkb considering the geomerty typ\r\n switch ( getGeometryType( wkb ) ) {\r\n case 1: geo = factory.createGM_Point( wkb, srs ); break;\r\n case 2: geo = factory.createGM_Curve( wkb, srs); break;\r\n case 3: geo = factory.createGM_Surface( wkb, srs, \r\n new GM_SurfaceInterpolation_Impl(1)); break;\r\n case 4: geo = factory.createGM_MultiPoint( wkb, srs ); break;\r\n case 5: geo = factory.createGM_MultiCurve( wkb, srs ); break;\r\n case 6: geo = factory.createGM_MultiSurface( wkb, srs, \r\n new GM_SurfaceInterpolation_Impl(1) ); break;\r\n default: geo = null;\r\n }\r\n \r\n ((GM_Object_Impl)geo).setCoordinateSystem( srs );\r\n \r\n updateBoundingBox(geo);\r\n \r\n Debug.debugMethodEnd();\r\n return geo;\r\n }", "public long getId(BerylliumSphere s) {\n\t\ttry {\n\t\t\tField f = BerylliumSphere.class.getDeclaredField(\"id\");\n\t\t\tf.setAccessible(true);\n\t\t\treturn f.getLong(s);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn -1L;\n\t}", "int getSnId();", "int getSnId();", "int getSnId();", "int getSnId();", "private void createHeuristics() {\n int linkCount = 0, // Stores the number of linking squares for a\n // particular square\n testRow, // Knight's current row plus a move number value\n testCol; // Knight's current column plus a move number value\n\n // Adds a move number value to the knight's current row and tests\n // whether it is a move candidate.\n // If the location is on the game board, it increments the link count\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n for (int moveNum = 0; moveNum < Knight.NUM_ALLOWED_MOVES; moveNum++) {\n testRow = row + currentKnight.getVerticalMoveValue(moveNum);\n testCol = col\n + currentKnight.getHorizontalMoveValue(moveNum);\n\n if (checkSquareExistsAndIsUnVisted(testRow, testCol) == true) {\n linkCount++;\n }\n }\n\n // Set accessibility and reset link count for next column\n setSquareAccessibility(row, col, linkCount);\n linkCount = 0;\n }\n }\n }", "private void reverseLookupC_Location_ID() throws Exception\r\n\t{\r\n\t\tStringBuilder sql = new StringBuilder();\r\n\t\tString msg = new String();\r\n\t\tint no = 0;\r\n\r\n\t\t//Reverse Loog up C_Location_ID From JP_Location_Label\r\n\t\tmsg = Msg.getMsg(getCtx(), \"Matching\") + \" : \" + Msg.getElement(getCtx(), \"C_Location_ID\")\r\n\t\t+ \" - \" + Msg.getMsg(getCtx(), \"MatchFrom\") + \" : \" + Msg.getElement(getCtx(), \"JP_Location_Label\") ;\r\n\t\tsql = new StringBuilder (\"UPDATE I_LocationJP i \")\r\n\t\t\t\t.append(\"SET C_Location_ID=(SELECT C_Location_ID FROM C_Location p\")\r\n\t\t\t\t.append(\" WHERE i.JP_Location_Label= p.JP_Location_Label AND p.AD_Client_ID=i.AD_Client_ID) \")\r\n\t\t\t\t.append(\" WHERE i.C_Location_ID IS NULL AND JP_Location_Label IS NOT NULL\")\r\n\t\t\t\t.append(\" AND i.I_IsImported='N'\").append(getWhereClause());\r\n\t\ttry {\r\n\t\t\tno = DB.executeUpdateEx(sql.toString(), get_TrxName());\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.fine(msg +\"=\" + no + \":\" + sql);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + sql );\r\n\t\t}\r\n\r\n\t}", "public Geometry[] snap(Geometry[] geoms, int[] weights) {\n\t\t// FIXME En caso de que ve\n\t\tfor (int i = 0; i < geoms.length; i++) {\n\t\t\tif (geoms[i] instanceof GeometryCollection) {\n\t\t\t\tGeometryCollection geometryCollection = (GeometryCollection) geoms[i];\n\t\t\t\tif (geometryCollection.getNumGeometries() > 1)\n\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\"El metodo snap no puede recibir como \"\n\t\t\t\t\t\t\t\t\t+ \"argumentos GeometryCollection o subclases con mas de un elemento\");\n\t\t\t}// if\n\t\t}\n\n\t\tSnappingCoordinateMap coordinateMap = new SnappingCoordinateMap(\n\t\t\t\tsnapTolerance);\n\t\tGeometry[] solution = new Geometry[geoms.length];\n\t\tfor (int i = 0; i < geoms.length; i++) {// for each geometry\n\t\t\tGeometry geom = geoms[i];\n\t\t\tCoordinate[] coords = geom.getCoordinates();\n\t\t\tCoordinateList coordList = new CoordinateList(coords);\n\n\t\t\tfor (int j = 0; j < coords.length; j++) {\n\t\t\t\tCoordinate coord = coords[j];\n\t\t\t\tCoordinate existingSolution = (Coordinate) coordinateMap\n\t\t\t\t\t\t.get(coord);\n\t\t\t\tif (coordinateMap.get(coord) != null) {// this coordinate has\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// already been snapped\n\t\t\t\t\tcoordList.set(j, existingSolution);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tArrayList<SnapCoordinate> coordsToSnap = new ArrayList<SnapCoordinate>();\n\t\t\t\tSnapCoordinate snapCoord = new SnapCoordinate();\n\t\t\t\tsnapCoord.weight = weights[i];\n\t\t\t\tsnapCoord.coordinate = coord;\n\t\t\t\tcoordsToSnap.add(snapCoord);\n\n\t\t\t\tfor (int k = 0; k < geoms.length; k++) {\n\t\t\t\t\tGeometry geom2 = geoms[k];\n\t\t\t\t\tif (i == k)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tCoordinate[] coords2 = geom2.getCoordinates();\n\t\t\t\t\tfor (int z = 0; z < coords2.length; z++) {\n\t\t\t\t\t\tCoordinate coord2 = coords2[z];\n\t\t\t\t\t\tif (SnapCGAlgorithms.snapEquals2D(coord, coord2,\n\t\t\t\t\t\t\t\tsnapTolerance)) {\n\t\t\t\t\t\t\tsnapCoord = new SnapCoordinate();\n\t\t\t\t\t\t\tsnapCoord.weight = weights[k];\n\t\t\t\t\t\t\tsnapCoord.coordinate = coord2;\n\t\t\t\t\t\t\tcoordsToSnap.add(snapCoord);\n\t\t\t\t\t\t}// if\n\t\t\t\t\t}// for z\n\t\t\t\t}// for k\n\n\t\t\t\tCoordinate newCoord = snapAverage(coordsToSnap);\n\t\t\t\tcoordList.set(j, newCoord);\n\t\t\t\tcoordinateMap.put(newCoord, newCoord);\n\t\t\t}// for j\n\n\t\t\tCoordinate[] newPts = coordList.toCoordinateArray();\n\n\t\t\tString geometryType = geom.getGeometryType();\n\t\t\tif (geometryType.equalsIgnoreCase(\"GeometryCollection\")\n\t\t\t\t\t|| geometryType.equalsIgnoreCase(\"MultiPolygon\")\n\t\t\t\t\t|| geometryType.equalsIgnoreCase(\"MultiLineString\")\n\t\t\t\t\t|| geometryType.equalsIgnoreCase(\"MultiPoint\")) {\n\n\t\t\t\tGeometryCollection geomCol = (GeometryCollection) geom;\n\n\t\t\t\t// we have already checked that it has no more than 1 geometry\n\t\t\t\tgeom = geomCol.getGeometryN(0);\n\t\t\t\tgeometryType = geom.getGeometryType();\n\t\t\t}\n\n\t\t\tif (geometryType.equalsIgnoreCase(\"Polygon\")) {\n\t\t\t\tint[] indexOfParts = JtsUtil.getIndexOfParts((Polygon) geom);\n\t\t\t\tPolygon polygon = JtsUtil.createPolygon(newPts, indexOfParts);\n\t\t\t\tsolution[i] = polygon;\n\t\t\t} else {\n\t\t\t\tsolution[i] = JtsUtil.createGeometry(newPts, geometryType);\n\t\t\t}\n\t\t}// for i\n\t\treturn solution;\n\t}", "void makeSTSsHelper(ArrayList<SetAndNd> STSsAndNds,\n FastBitSet possibleSTSRoots,\n // TODO: rename next two params?\n FastBitSet unionOfSubtrees,\n FastBitSet ndOfUnionOfSubtrees,\n int rootDepth,\n HashSet<FastBitSet> newSTSsHashSet) {\n ++Stats.helperCalls;\n for (int w : possibleSTSRoots.toArray()) {\n tryAddingStsRoot(w, unionOfSubtrees, ndOfUnionOfSubtrees, rootDepth,\n newSTSsHashSet);\n }\n\n TrieDataStructure visitedSTSs =\n options.useTrie && STSsAndNds.size() >= MIN_LEN_FOR_TRIE ?\n new STSCollection(n, rootDepth) :\n new ListOfSetAndNd();\n\n for (int i=STSsAndNds.size()-1; i>=0; i--) {\n FastBitSet s = STSsAndNds.get(i).set;\n FastBitSet nd = STSsAndNds.get(i).nd;\n FastBitSet newPossibleSTSRoots = possibleSTSRoots.intersectWith(nd);\n FastBitSet newUnionOfSubtrees = unionOfSubtrees.unionWith(s);\n FastBitSet ndOfNewUnionOfSubtrees = ndOfUnionOfSubtrees\n .unionWith(nd)\n .subtract(newUnionOfSubtrees);\n\n FastBitSet newUnionOfSubtreesAndNd = newUnionOfSubtrees\n .unionWith(ndOfNewUnionOfSubtrees);\n\n // TODO: store SetAndNd references in trie data structure\n ArrayList<SetAndNd> filteredSTSsAndNds = new ArrayList<>();\n for (SetAndNd item : visitedSTSs.query(newUnionOfSubtreesAndNd, ndOfNewUnionOfSubtrees)) {\n if (item.nd.intersects(newPossibleSTSRoots) &&\n ndOfNewUnionOfSubtrees.unionWith(item.nd).cardinality()\n <= rootDepth &&\n !newUnionOfSubtreesAndNd.intersects(item.set)) {\n filteredSTSsAndNds.add(item);\n }\n }\n ++Stats.queries;\n\n filterRoots(newPossibleSTSRoots, filteredSTSsAndNds,\n newUnionOfSubtrees, ndOfNewUnionOfSubtrees, rootDepth);\n\n if (!newPossibleSTSRoots.isEmpty()) {\n filteredSTSsAndNds.sort(new DescendingNdPopcountComparator());\n makeSTSsHelper(filteredSTSsAndNds, newPossibleSTSRoots,\n newUnionOfSubtrees, ndOfNewUnionOfSubtrees, rootDepth,\n newSTSsHashSet);\n }\n visitedSTSs.put(STSsAndNds.get(i));\n }\n }", "public DatabaseQueryEngine(String databaseURL) throws SQLException, IOException {\n this.databaseURL = System.getenv(\"DB_URL\") + databaseURL;\n databaseUser = System.getenv(\"DB_USER\");\n password = System.getenv(\"DB_PASS\");\n connection = DriverManager.getConnection(this.databaseURL, databaseUser, password);\n databaseStatement = connection.createStatement();\n ResultSet databaseResult = databaseStatement.executeQuery(\"SELECT VERSION()\"); //checking if connection worked\n if (databaseResult.next()) {\n System.out.println(databaseResult.getString(1));\n }\n ResultSet smallestX = databaseStatement.executeQuery(\"SELECT *, ST_X(ST_TRANSFORM(geom,4326)) as xCoord FROM NODES ORDER BY xCoord ASC LIMIT 1;\"); //retrieving the smallest X value\n while (smallestX.next()) {\n converterSetX = smallestX.getDouble(\"xCoord\");\n System.out.println(\"Smallest X \" + smallestX.getDouble(\"xCoord\"));\n }\n ResultSet smallestY = databaseStatement.executeQuery(\"SELECT *, ST_Y(ST_TRANSFORM(geom,4326)) as yCoord FROM NODES ORDER BY yCoord ASC LIMIT 1;\"); //retrieving the smallest Y value\n while (smallestY.next()) {\n converterSetY = smallestY.getDouble(\"yCoord\");\n System.out.println(\"Smallest Y \" + smallestY.getDouble(\"yCoord\"));\n\n }\n\n coordinateConverter = new CoordinateConverter(converterSetX, converterSetY); //converting the coordinates so they can be stored in a map later\n }", "public static HashSet<String> getAllSegs(String s, boolean allowUnknowns) {\n int len = s.length();\n //handle strings that are too long for full analysis\n if (len>25) {\n boolean found = false;\n String beg=\"\";\n String mid=\"\";\n String end=\"\";\n for (int i=len; i>=1 && !found; i--) {\n for (int j=0; i+j<=len && !found; j++) {\n beg = s.substring(0,j);\n mid = s.substring(j,j+i);\n end = s.substring(j+i,len);\n if (hasMatch(mid,SAFEDICT)) {\n System.out.println(mid);\n found = true;\n }\n }\n }\n HashSet<String> begSegs = getAllSegs(beg, allowUnknowns);\n HashSet<String> endSegs = getAllSegs(end, allowUnknowns);\n HashSet<String> segs = new HashSet<String>();\n segs.addAll(concat(begSegs,mid,endSegs,beg.length(),end.length()));\n return segs;\n } else {\n return getAllSegsDyn(s, new int[len+1][len+1], 0, len, allowUnknowns);\n }\n }", "public CMSI9 findI9 (String ssn) throws Exception {\n try {\n this.fireWorkInProgressEvent(true);\n return (CMSI9) CMSFormServices.getCurrent().findI9(ssn);\n } catch (DowntimeException ex) {\n LoggingServices.getCurrent().logMsg(getClass().getName(),\"findI9\",\n \"Primary Implementation for CMSFormServices failed, going Off-Line...\",\n \"See Exception\", LoggingServices.MAJOR, ex);\n offLineMode();\n setOffLineMode();\n return (CMSI9) CMSFormServices.getCurrent().findI9(ssn);\n } finally {\n this.fireWorkInProgressEvent(false);\n }\n }", "protected abstract NativeSQLStatement createNativeHavingSRIDStatement(int srid);", "public SearchResultIdentifier getSearchResultIdentifier() throws InvalidFormatException;", "public void doSearch(int referenceId, int smallSetUpperBound,\n\t\tint largeSetLowerBound, int mediumSetPresentNumber,\n\t\tint replaceIndicator, String resultSetName, \n\t\tString databaseNames, String smallSetElementSetNames, \n\t\tString mediumSetElementSetNames, String preferredRecordSyntax, \n\t\tString query, int query_type, String searchResultsOID,\n\t \tDataDir Z39attributesPlusTerm, DataDir oclcUserInfo,\n String oclcUserInfoOID, Object rankQuery, String rankOID,\n boolean fMakeDataDir) \n throws Exception, Diagnostic1, AccessControl {\n\n \n BerString zRequest=null, zResponse=null;\n BerConnect zConnection;\n\n if (zsession == null) \n throw new Diagnostic1(Diagnostic1.temporarySystemError, \n \"User's Z39.50 session is not initialized\");\n\n // Re-init to the server\n if (zsession.isConnected() == false) {\n try {\n\n zsession.init.reInit();\n\n if (zsession.connection == null)\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to connect to the Z39.50 server\");\n }\n catch (Exception e) {\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to connect to the Z39.50 server\");\n } \n catch (Diagnostic1 d) {\n throw d;\n } \n } \n\n\n zConnection = (BerConnect)zsession.connection;\n\n zRequest = Request(referenceId, smallSetUpperBound,\n\t\tlargeSetLowerBound, mediumSetPresentNumber,\n\t\treplaceIndicator, resultSetName, \n\t\tdatabaseNames, smallSetElementSetNames, \n\t\tmediumSetElementSetNames, preferredRecordSyntax, \n\t\tquery, query_type, searchResultsOID,\n Z39attributesPlusTerm, oclcUserInfo, oclcUserInfoOID,\n rankQuery, rankOID, 0, 0);\n \n if (zRequest == null) {\n throw new Diagnostic1(Diagnostic1.malformedQuery, \"Unable to create search request\");\n\n// System.out.println(\"unable to build search request\");\n }\n\n try {\n zResponse = zConnection.doRequest(zRequest); \n }\n\t catch (InterruptedIOException ioe) { \n\t if (zsession.doTRC) { \n\t\t try {\n\t\t if (zsession.logger != null && \n\t\t\t zsession.logger.getLevel() != Z39logging.OFF) {\n\t\t\t synchronized (zsession.logger) {\n\t\t\t zsession.logger.println(\"Sending TRC to search\");\n\t\t\t }\n\t\t } \n\t\t zsession.trc.doTriggerResourceControl(0, 3);\n\t\t }\n\t\t catch (Exception trce) {\n\t\t // trce.printStackTrace();\n\t\t }\n\t\t catch (Diagnostic1 trcd) {\n\t\t // System.out.println(trcd);\n\t\t }\n\t }\n\n //differentiate between 105 and 109 diagnostics\n if (ioe.getMessage().endsWith(\"user\"))\n throw new Diagnostic1(Diagnostic1.terminatedAtOriginRequest,\n \"Unable to send request to the Z39.50 server\");\n else\n throw new Diagnostic1(Diagnostic1.databaseUnavailable,\n \"Unable to send request to the Z39.50 server\");\n\n } \n catch (Exception e1) {\n zsession.reset();\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to send request to the Z39.50 server\");\n }\n\n if (zResponse == null) {\n throw new Diagnostic1(Diagnostic1.temporarySystemError,\n \"Invalid search response received from the Z39.50 Server\");\n }\n\n\n Response(zResponse);\n\n // If flag is set to decode recs into datadir and we\n // got records back, then decode and make sure we got\n // all we wanted \n if (resultCount > 0 && \n Present.numberOfRecordsReturned > 0) {\n\n if (fMakeDataDir) \n Present.decodeRecords();\n\n\n if(Present.numberOfRecordsReturned != mediumSetPresentNumber &&\n resultCount > Present.numberOfRecordsReturned) {\n \n int numrecs = mediumSetPresentNumber - \n Present.numberOfRecordsReturned;\n //System.out.println(\"Numrecs returned = \" + numrecs +\n //\" asked for: \" + mediumSetPresentNumber);\n\n try {\n\n zsession.present.doPresent(zsession.refId > 0 ? \n zsession.refId++ : 0,\n resultSetName, Present.numberOfRecordsReturned+1,\n numrecs, resultCount, \n mediumSetElementSetNames, preferredRecordSyntax, \n fMakeDataDir);\n }\n catch (Exception e) {\n // Don't barf good results received.\n }\n catch (Diagnostic1 d) {\n // Don't barf good results received.\n }\n // If we got the records back. add them to the\n // Present Vector or the BerString\n saveGoodRecords(fMakeDataDir);\n }\n }\n }", "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 ArrayList<ArrayList<String>> extractCoordsFromWfsXml(String xml_og) {\r\n\t\tSystem.out.println(\"ParserXmlJson.extractBoundingBoxFromWfsXml: \"+ xml_og);\r\n\t\tPointPolygon point = new PointPolygon();\r\n\t\tArrayList<String> list_objectid = new ArrayList<String>();\r\n\t\tArrayList<String> list_coords = new ArrayList<String>();\r\n\t\tArrayList<ArrayList<String>> list_coords_objectid = new ArrayList<ArrayList<String>>();\r\n\t\t\r\n\t\t\r\n\t\tDocumentBuilder dbuilder = null;\r\n\t\ttry {\t\t\t\r\n\t\t\tXPath xPath = XPathFactory.newInstance().newXPath();\r\n\t\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\r\n\t\t\tdbFactory.setNamespaceAware(true);\r\n\t DocumentBuilder builder = dbFactory.newDocumentBuilder();\r\n\t Document doc = builder.parse(new InputSource(new StringReader(xml_og)));\r\n\t \t \r\n\t \txPath.setNamespaceContext(new NamespaceContext() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic Iterator getPrefixes(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t @Override\r\n\t\t\t public String getNamespaceURI(String args) {\r\n\t\t\t if(LoadOnStartAppConfiguration.arbeitsbereichXmlTagPolygon.equals(args)){\r\n\t\t\t \treturn LoadOnStartAppConfiguration.arbeitsbereichXmlTagPolygon;\r\n\t\t\t }else if(\"gml\".equals(args)){\r\n\t\t\t \treturn \"http://www.opengis.net/gml/3.2\"; \t\r\n\t\t\t }else{\r\n\t\t\t \treturn null;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t});\t\t\r\n//\t \tString path_offering = \"/wfs:FeatureCollection/wfs:member/geofence_sbg:geofence_sbg_bbox/@gml:id\";\r\n//\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n//\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getNodeValue());\r\n\t\t\t\t/*\r\n\t\t\t\tString path_offering = \"/soap:Envelope/soap:Body/sos:Capabilities/@version\";\r\n\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getTextContent());\r\n\t\t\t\t\r\n\t\t\t\tString path_procedures = \"//om:OM_Observation[@name='GetObservation']/ows:Parameter[@name='procedure']/ows:AllowedValues/ows:Value\"; */\r\n//\t\t\t\tString pathToLoading = \"//om:OM_Observation[om:observedProperty[@xlink:href='http://ispace.researchstudio.at/ont/swe/property/Loading']]/om:result\";\r\n\t\t\t\t\r\n\t\t\t\t//jetzt werden hier aber alle X Y Koordinaten,die sich in InsertObservation.xml wiederholen, ausgelesen werden\r\n\t \tString pathToObjectid = \"//geofence_sbg:objectid\";\r\n\t \tNodeList nodes_Objectid = (NodeList)xPath.compile(pathToObjectid).evaluate(doc, XPathConstants.NODESET);\r\n\t \t\r\n\t\t\t\tString pathToCoordinates =\"//gml:LinearRing/gml:posList\";\r\n\t\t\t\tNodeList nodes_position = (NodeList)xPath.compile(pathToCoordinates).evaluate(doc, XPathConstants.NODESET);\r\n\t\t\t\t//book[title/@lang = 'it'] [@uom='abc']\r\n\t\t\t\t//myNodeList.item(0).setNodeValue(\"Hi mom!\");\r\n\t\t\t\tString xy= \"\";\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"vor for loop ParserXmlJson.extractPointFromIO:\"+ nodes_position.getLength());\t\r\n\t\t\t\tfor(int n = 0; n<nodes_position.getLength(); n++){\r\n\t\t\t\t\tSystem.out.println(\"ParserXmlJson.extractPointFromIO: \"+nodes_position.item(n).getTextContent());\r\n\t\t\t\t\tpoint.list_ofStrConsistingOf5CoordinatesForBoundingBox.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\tlist_coords.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\tSystem.out.println(\"ParserXmlJson.extractPointFromIO objectid: \"+nodes_Objectid.item(n).getTextContent());\r\n\t\t\t\t\tlist_objectid.add(nodes_Objectid.item(n).getTextContent());\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//node_procedures.item(n).setTextContent(\"4444\");\r\n\t\t\t\t\t//System.out.println(\"ParserXmlJson.parseInsertObservation:parser EDITED:\"+node_procedures.item(n).getTextContent());\r\n\t\t\t\t}\t\t\t\r\n\t\t\t//\tSystem.out.println(TextFiles.xmlDocument2StringWithPrettyPrint(doc, 2));\r\n\t\t\t\ttry{\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tSystem.out.println(\"Error: maybe no coordinates!\");\r\n\t\t\t\t\te.printStackTrace();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\t\t\t\r\n\t\tlist_coords_objectid.add(list_coords);\r\n\t\tlist_coords_objectid.add(list_objectid);\r\n\t\treturn list_coords_objectid;//point.list_ofStrConsistingOf5CoordinatesForBoundingBox;\t\t\t\t\r\n\t}", "private ResultSet getSpatialQueryResults(final Connection conn, final SearchRegion region) throws SQLException {\n final Statement stmt = conn.createStatement();\n final double lx = region.getLx(), ly = region.getLy(), rx = region.getRx(), ry = region.getRy();\n\n //Careful about the precision of the float from string formatter\n final String spatial_query = String.format(\"SELECT * FROM item_location WHERE \"\n + \"MBRContains(GeomFromText('Polygon((%f %f, %f %f, %f %f, %f %f, %f %f))'), coord)\", \n lx, ly, lx, ry, rx, ry, rx, ly, lx, ly);\n return stmt.executeQuery(spatial_query);\n }", "private synchronized void initLocation() {\n if (locationManager == null) {\n LocationManager manager =\n (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n Criteria criteriaCoarse = new Criteria();\n /* \"Coarse\" accuracy means \"no need to use GPS\".\n * Typically a gShots phone would be located in a building,\n * and GPS may not be able to acquire a location.\n * We only care about the location to determine the country,\n * so we don't need a super accurate location, cell/wifi is good enough.\n */\n criteriaCoarse.setAccuracy(Criteria.ACCURACY_COARSE);\n criteriaCoarse.setPowerRequirement(Criteria.POWER_LOW);\n String providerName =\n manager.getBestProvider(criteriaCoarse, /*enabledOnly=*/true);\n \n \n List<String> providers = manager.getAllProviders();\n for (String providerNameIter : providers) {\n try {\n LocationProvider provider = manager.getProvider(providerNameIter);\n } catch (SecurityException se) {\n // Not allowed to use this provider\n Logger.w(\"Unable to use provider \" + providerNameIter);\n continue;\n }\n Logger.i(providerNameIter + \": \" +\n (manager.isProviderEnabled(providerNameIter) ? \"enabled\" : \"disabled\"));\n }\n\n /* Make sure the provider updates its location.\n * Without this, we may get a very old location, even a\n * device powercycle may not update it.\n * {@see android.location.LocationManager.getLastKnownLocation}.\n */\n manager.requestLocationUpdates(providerName,\n /*minTime=*/0,\n /*minDistance=*/0,\n new LoggingLocationListener(),\n Looper.getMainLooper());\n locationManager = manager;\n locationProviderName = providerName;\n }\n assert locationManager != null;\n assert locationProviderName != null;\n }", "@Override\r\n\tpublic int getNumberOfLocations() {\n\t\treturn aiSolutionRepresentation.length;\r\n\t}", "final protected int queryHandle(Location m) {\r\n \treturn queryHandle(m.x, m.y);\r\n }", "public int getRegionalGISId() {\n return gisID_;\n }", "private int getReferences() {\n int quantity = 0;\n for (Option o : criteriaList.get(currentCriteria).getOptionList()) {\n boolean wasFound = false;\n for (String s : speciesLeft)\n if (o.getEntities().contains(s))\n wasFound = true;\n if (wasFound)\n ++quantity;\n }\n return quantity;\n }", "public static JavaPairRDD<Envelope, Long> SpatialJoinQueryCountByKey(SpatialRDD spatialRDD,RectangleRDD queryRDD,boolean useIndex) throws Exception {\n\n if(useIndex)\n {\n \t//Check if rawPointRDD have index.\n if(spatialRDD.indexedRDD == null) {\n\t throw new Exception(\"[JoinQuery][SpatialJoinQuery] Index doesn't exist. Please build index.\");\n }\n if(spatialRDD.spatialPartitionedRDD == null) {\n throw new Exception(\"[JoinQuery][SpatialJoinQuery]spatialRDD SpatialPartitionedRDD is null. Please do spatial partitioning.\");\n }\n else if(queryRDD.spatialPartitionedRDD == null)\n {\n throw new Exception(\"[JoinQuery][SpatialJoinQuery]queryRDD SpatialPartitionedRDD is null. Please use the spatialRDD's grids to do spatial partitioning.\");\n }\n else if(queryRDD.grids.equals(spatialRDD.grids)==false)\n {\n throw new Exception(\"[JoinQuery][SpatialJoinQuery]queryRDD is not partitioned by the same grids with spatialRDD. Please make sure they both use the same grids otherwise wrong results will appear.\");\n }\n JavaPairRDD<Integer, Tuple2<Iterable<Object>, Iterable<Object>>> cogroupResult = spatialRDD.indexedRDD.cogroup(queryRDD.spatialPartitionedRDD);\n\n //flatMapToPair, use HashSet.\n\n JavaPairRDD<Envelope, HashSet<Geometry>> joinResultWithDuplicates = cogroupResult.flatMapToPair(new AllByRectangleJudgementUsingIndex());\n \n JavaPairRDD<Envelope, HashSet<Geometry>> joinListResultAfterAggregation = DuplicatesHandler.removeDuplicatesGeometryByRectangle(joinResultWithDuplicates);\n \n JavaPairRDD<Envelope, Long> resultCountByKey = joinListResultAfterAggregation.mapValues(new Function<HashSet<Geometry>,Long>()\n {\n\t\t\t\t@Override\n\t\t\t\tpublic Long call(HashSet<Geometry> spatialObjects) throws Exception {\n\t\t\t\t\treturn (long) spatialObjects.size();\n\t\t\t\t}\n \t\n });\n return resultCountByKey;\n }\n else\n {\n if(spatialRDD.spatialPartitionedRDD == null) {\n throw new Exception(\"[JoinQuery][SpatialJoinQuery]spatialRDD SpatialPartitionedRDD is null. Please do spatial partitioning.\");\n }\n else if(queryRDD.spatialPartitionedRDD == null)\n {\n throw new Exception(\"[JoinQuery][SpatialJoinQuery]queryRDD SpatialPartitionedRDD is null. Please use the spatialRDD's grids to do spatial partitioning.\");\n }\n else if(queryRDD.grids.equals(spatialRDD.grids)==false)\n {\n throw new Exception(\"[JoinQuery][SpatialJoinQuery]queryRDD is not partitioned by the same grids with spatialRDD. Please make sure they both use the same grids otherwise wrong results will appear.\");\n }\n JavaPairRDD<Integer, Tuple2<Iterable<Object>, Iterable<Object>>> cogroupResult = spatialRDD.spatialPartitionedRDD.cogroup(queryRDD.spatialPartitionedRDD);\n \n //flatMapToPair, use HashSet.\n\n JavaPairRDD<Envelope, HashSet<Geometry>> joinResultWithDuplicates = cogroupResult.flatMapToPair(new GeometryByRectangleJudgement());\n \n JavaPairRDD<Envelope, HashSet<Geometry>> joinListResultAfterAggregation = DuplicatesHandler.removeDuplicatesGeometryByRectangle(joinResultWithDuplicates);\n \n JavaPairRDD<Envelope, Long> resultCountByKey = joinListResultAfterAggregation.mapValues(new Function<HashSet<Geometry>,Long>()\n {\n\t\t\t\t@Override\n\t\t\t\tpublic Long call(HashSet<Geometry> spatialObjects) throws Exception {\n\t\t\t\t\treturn (long) spatialObjects.size();\n\t\t\t\t}\n });\n return resultCountByKey;\n }\n }", "RID getRID();", "@SuppressWarnings(\"unchecked\")\n\t@Deprecated\n\tprivate List<Integer> sffs(List<Integer> corners, Stroke stroke,\n\t\t\tIObjectiveFunction objFunction) {\n\n\t\tif (corners.size() <= 2)\n\t\t\treturn corners;\n\n\t\tdouble currError = Double.MAX_VALUE;\n\t\tList<Integer> cornerSubset = new ArrayList<Integer>();\n\t\tcornerSubset.add(0);\n\t\tcornerSubset.add(stroke.getNumPoints() - 1);\n\n\t\tList<Double> errorList = new ArrayList<Double>();\n\t\terrorList.add(objFunction.solve(cornerSubset, stroke));\n\n\t\tList<List<Integer>> cornerSubsetList = new ArrayList<List<Integer>>();\n\t\tcornerSubsetList.add(new ArrayList<Integer>(cornerSubset));\n\n\t\tList<List<Integer>> backOnSubset = new ArrayList<List<Integer>>();\n\n\t\tint n = 0;\n\n\t\twhile (cornerSubset.size() < corners.size()) {\n\n\t\t\t// Go forward\n\t\t\tList<Object> forwardResults = nextBestCorner(cornerSubset, corners,\n\t\t\t\t\tstroke, objFunction);\n\t\t\tint forwardCorner = (Integer) forwardResults.get(0);\n\t\t\tdouble forwardError = (Double) forwardResults.get(1);\n\n\t\t\t// Go backward (if possible)\n\t\t\tint backCorner = -1;\n\t\t\tdouble backError = Double.MAX_VALUE;\n\t\t\tList<Integer> backSubset = null;\n\t\t\tif (cornerSubset.size() < corners.size() - 1) {\n\t\t\t\tList<Object> backResults = prevBestSubset(cornerSubset, stroke,\n\t\t\t\t\t\tobjFunction);\n\t\t\t\tbackSubset = (List<Integer>) backResults.get(0);\n\t\t\t\tbackError = (Double) backResults.get(1);\n\t\t\t}\n\n\t\t\tif (backCorner != -1 && backError < errorList.get(n - 1)\n\t\t\t\t\t&& !alreadySeenSubset(cornerSubset, backOnSubset)) {\n\n\t\t\t\tbackOnSubset.add(cornerSubset);\n\t\t\t\tcornerSubset = new ArrayList<Integer>(backSubset);\n\t\t\t\tcurrError = backError;\n\t\t\t\tn--;\n\t\t\t} else {\n\t\t\t\tcornerSubset.add(forwardCorner);\n\t\t\t\tcurrError = forwardError;\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\tif (cornerSubsetList.size() <= n) {\n\t\t\t\tcornerSubsetList.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.add(currError);\n\t\t\t} else {\n\t\t\t\tcornerSubsetList.set(n, new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.set(n, currError);\n\t\t\t}\n\t\t}\n\n\t\tList<Integer> bestSubset = null;\n\n\t\tdouble d1Errors[] = new double[errorList.size()];\n\t\tfor (int i = 0; i < errorList.size() - 1; i++) {\n\t\t\tdouble deltaError = errorList.get(i + 1) / errorList.get(i);\n\t\t\td1Errors[i] = deltaError;\n\t\t}\n\n\t\tdouble d2Errors[] = new double[errorList.size()];\n\t\tfor (int i = 0; i < errorList.size() - 2; i++) {\n\t\t\tdouble deltaDeltaError = d1Errors[i + 1] / d1Errors[i];\n\t\t\td2Errors[i] = deltaDeltaError;\n\t\t}\n\n\t\tfor (int i = 0; i < d2Errors.length - 3; i++) {\n\t\t\tif (d2Errors[i] > S_THRESHOLD) {\n\t\t\t\tbestSubset = cornerSubsetList.get(i + 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (bestSubset == null)\n\t\t\tbestSubset = cornerSubsetList.get(0);\n\n\t\tCollections.sort(bestSubset);\n\n\t\treturn bestSubset;\n\t}", "public interface ISpatialDatabase {\n\n\t/**\n\t * Return the name of the SpatialDatabase\n\t * \n\t * @return The name of the SpatialDatabase\n\t */\n\tString getName();\n\n\t/**\n\t * Retrieve the bounds which contain all the indexed objects.\n\t * \n\t * @return The bounds\n\t */\n\tRectangleLatLng getBounds();\n\n\t/**\n\t * Store the rectangle in the database.\n\t * \n\t * @param rectangle\n\t * @param id\n\t */\n\tvoid storeObject(RectangleLatLng rectangle, String id);\n\n\t/**\n\t * Store the point in the database\n\t * \n\t * @param point\n\t * @param id\n\t */\n\tvoid storeObject(PointLatLng point, String id);\n\n\t/**\n\t * Store the circle in the database\n\t * \n\t * @param circle\n\t * @param id\n\t */\n\tvoid storeObject(Circle circle, String id);\n\n\t/**\n\t * Store the polygon in the database\n\t * \n\t * @param polygon\n\t * @param id\n\t */\n\tvoid storeObject(Polygon polygon, String id);\n\n\t/**\n\t * Remove the rectangle associated to the given id from the spatial\n\t * database.\n\t * \n\t * @param rectangle\n\t * The rectangle to be removed\n\t * @param id\n\t * The identifier to be removed\n\t * @return True if the removal was successful\n\t */\n\tboolean removeObject(RectangleLatLng rectangle, String id);\n\n\t/**\n\t * Remove the point associated to the given id from the spatial database.\n\t * \n\t * @param point\n\t * The point to be removed\n\t * @param id\n\t * The identifier to be removed\n\t * @return True if the removal was successful\n\t */\n\tboolean removeObject(PointLatLng point, String id);\n\n\t/**\n\t * Remove the circle associated to the given id from the spatial database.\n\t * \n\t * @param circle\n\t * The circle to be removed\n\t * @param id\n\t * The identifier to be removed\n\t * @return True if the removal was successful\n\t */\n\tboolean removeObject(Circle circle, String id);\n\n\t/**\n\t * Remove the polygon associated to the given id from the spatial database.\n\t * \n\t * @param polygon\n\t * The polygon to be removed\n\t * @param id\n\t * The identifier to be removed\n\t * @return True if the removal was successful\n\t */\n\tboolean removeObject(Polygon polygon, String id);\n\n\t/**\n\t * Deletes all the spatial objects associated to the given id\n\t * \n\t * @param id\n\t * The identifier to be removed\n\t * @return True if the database changed its statusF\n\t */\n\tboolean removeObject(String id);\n\n\t/**\n\t * Retrieves the couple (id, geoId) of all the spatial object that\n\t * intersects with the bounds given as input\n\t * \n\t * @param bounds\n\t * @return Map Id->Set&lt;GeoId&gt; resulting from the query\n\t */\n\tMultimap<String, String> intersects(RectangleLatLng bounds);\n\n\t/**\n\t * Retrieves the couple (id, geoId) of all the spatial object that\n\t * intersects with the bounds given as input\n\t * \n\t * @param bounds\n\t * @return Map Id->Set&lt;GeoId&gt; resulting from the query\n\t */\n\tMultimap<String, String> intersects(PointLatLng point);\n\n\t/**\n\t * Retrieves the couple (id, geoId) of all the spatial object that\n\t * intersects with the bounds given as input\n\t * \n\t * @param bounds\n\t * @return Map Id->Set&lt;GeoId&gt; resulting from the query\n\t */\n\tMultimap<String, String> intersects(Circle bounds);\n\n\t/**\n\t * Retrieves the couple (id, geoId) of all the spatial object that\n\t * intersects with the bounds given as input\n\t * \n\t * @param bounds\n\t * @return Map Id->Set&lt;GeoId&gt; resulting from the query\n\t */\n\tMultimap<String, String> intersects(Polygon bounds);\n\n\t/**\n\t * Return true if the specified identifier id is stored in the\n\t * SpatialDatabase\n\t * \n\t * @param id\n\t * @return\n\t */\n\tboolean hasGeoInformation(String id);\n\n\tvoid reset();\n}", "private Optional<Rectangle> resolveGenePosition(String chromosome, String startPos,\n String endPos, String strand) {\n if (Strings.isNullOrEmpty(strand)) {\n strand = \"1\";\n }\n Float s = FloatValidator.getInstance().validate(strand);\n Float y1;\n Float y2;\n if (s > 0.0) {\n y1 = FloatValidator.getInstance().validate(startPos);\n y2 = FloatValidator.getInstance().validate(endPos);\n } else {\n y1 = FloatValidator.getInstance().validate(endPos) * s;\n y2 = FloatValidator.getInstance().validate(startPos) * s;\n }\n\n // convert X & Y chromosome to numeric values (X=22, Y= 23)\n if (chromosome.toUpperCase().equals(\"X\")) {\n chromosome = \"23\";\n } else if (chromosome.toUpperCase().equals(\"Y\")) {\n chromosome = \"24\";\n }\n Float x1 = FloatValidator.getInstance().validate(chromosome);\n\n if (null == x1 || null == y1 || null == y2) {\n return Optional.empty();\n }\n Float x2 = x1; // pseudo rectangle\n return Optional.of(Geometries.rectangle(x1, y1, x2, y2));\n }", "@Override\r\n\tpublic int getSS() {\n\t\treturn SS;\r\n\t}", "private TreeSet<BisectDistInfo> findAllSegments( Coordinate[] poly ) {\n\t\t\n\t\tTreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>();\n\t\t\t\t\t\t\n\t Coordinate[] seg = new Coordinate[2];\n\t boolean qualify;\n\t \n\t\tfor ( int ii = 0; ii < (poly.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (poly.length); jj ++ ) {\n\t\t seg[0] = poly[ii];\n\t\t seg[1] = poly[jj]; \n\t\t \n\t\t\t qualify = polysegIntPoly( seg, poly );\n\t\t\t if ( qualify ) {\n\t\t\t\t double dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M;\n\t\t\t\t if ( dist > GfaSnap.CLUSTER_DIST ) {\n\t\t\t\t\t distInfo.add( new BisectDistInfo( dist, ii, jj ) );\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\t\t\t\n }\n\n\t\treturn distInfo;\n\t\t\n\t}", "@Override\n\t public void error()\n\t {\n\t Log.e(\"MAIN\",\"Error finding best guess location\");\n dS.lat=0;\n dS.lon=0;\n if(once)\n {\n\t //promptSetLocationService(MainActivity.this);\n }\n once=false;\n\t }", "public boolean run()\n throws Exception {\n\n _startTreeCluster.start();\n _refCluster.start();\n\n SegmentInfoProvider segmentInfoProvider = new SegmentInfoProvider(_segmentDirName);\n StarTreeQueryGenerator queryGenerator =\n new StarTreeQueryGenerator(_tableName, segmentInfoProvider.getSingleValueDimensionColumns(),\n segmentInfoProvider.getMetricColumns(), segmentInfoProvider.getSingleValueDimensionValuesMap());\n\n boolean ret = true;\n for (int i = 0; i < _numQueries; i++) {\n String query = queryGenerator.nextQuery();\n LOGGER.info(\"QUERY: {}\", query);\n\n JsonNode refResponse = JsonUtils.stringToJsonNode(_refCluster.query(query));\n JsonNode starTreeResponse = JsonUtils.stringToJsonNode((_startTreeCluster.query(query)));\n\n if (QueryComparison.compare(refResponse, starTreeResponse, false)) {\n LOGGER.error(\"Comparison PASSED: {}\", query);\n } else {\n ret = false;\n LOGGER.error(\"Comparison FAILED: {}\", query);\n LOGGER.info(\"Ref Response: {}\", _refCluster.query(query));\n LOGGER.info(\"StarTree Response: {}\", _startTreeCluster.query(query));\n }\n }\n\n return ret;\n }" ]
[ "0.49542645", "0.4668029", "0.46022487", "0.4600163", "0.44545516", "0.4405548", "0.43641844", "0.4342676", "0.43325192", "0.43279114", "0.4293139", "0.42590252", "0.42536047", "0.4210955", "0.4209224", "0.41946927", "0.41691944", "0.41653278", "0.41546974", "0.41279456", "0.41164926", "0.41123557", "0.41063458", "0.409286", "0.40871114", "0.40810502", "0.40778384", "0.40777335", "0.404791", "0.40463918", "0.4044891", "0.40382266", "0.40305352", "0.40295973", "0.40200606", "0.4013805", "0.39956892", "0.39871544", "0.3986588", "0.3986242", "0.3977241", "0.39581588", "0.39560097", "0.39554024", "0.39479336", "0.39323744", "0.39285982", "0.3925764", "0.3912753", "0.39090997", "0.39016092", "0.39005163", "0.38949436", "0.3885646", "0.38853255", "0.38800466", "0.38764244", "0.38762292", "0.38739473", "0.3873902", "0.38700193", "0.38674635", "0.38586408", "0.3858084", "0.38561422", "0.38552067", "0.3847611", "0.3847131", "0.38380298", "0.3832614", "0.3832614", "0.3832614", "0.3832614", "0.38212103", "0.381725", "0.3812158", "0.38113534", "0.3811096", "0.38072568", "0.38052425", "0.38040638", "0.38028675", "0.3798562", "0.3795847", "0.37931713", "0.37908357", "0.3790077", "0.3789453", "0.3787013", "0.37744066", "0.37645242", "0.37644517", "0.37640545", "0.3763268", "0.3760275", "0.37542605", "0.37491718", "0.3749055", "0.3747109", "0.37466282" ]
0.55451775
0
This method was generated by Abator for iBATIS. This method returns the value of the database column HBDW1.EP_TASK_STEP.ID
public String getId() { return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getStepId() {\n return stepId;\n }", "public int getTaskID() {\n\t\treturn taskID;\n\t}", "public ProcessStep getProcessStepById(int processstepid) {\n\t\tthis.em = EMF.createEntityManager();\r\n\t\t\r\n\t\tList<ProcessStep> content = new ArrayList<ProcessStep>();\r\n\t\tQuery query = em.createQuery(Constants.PROCESSSTEP_ID);\r\n\t\tquery.setParameter(\"processstepid\", processstepid);\r\n\t\tcontent = query.getResultList();\r\n\t\tSystem.out.println(content.get(0));\r\n\t\treturn content.get(0);\r\n\r\n\t}", "public java.lang.Object getTaskID() {\n return taskID;\n }", "public int getTestCaseStepRunId() {\n return testCaseStepRunId;\n }", "protected String getTaskId() {\n\t\tDisplay.debug(\"getTaskId() devuelve %s\", taskId);\n\t\treturn taskId;\n\t}", "String getProcessInstanceID();", "public String getTaskLineId() {\n return taskLineId;\n }", "long getWorkflowID();", "public long getStepNumber() {\n return schedule.getSteps();\n }", "public Integer getTaskId() {\n\t\treturn this.taskId;\n\t}", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "public int getAD_Workflow_ID();", "String getTaskId();", "public int getTaskId() {\n return taskId;\n }", "Object getTaskId();", "public int getStepNumber() {\n return stepNumber;\n }", "int getStep();", "int getStep();", "int getStep();", "public String getTaskId() {\n return this.taskId;\n }", "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public int getUpdatedTaskID(){\r\n int resultID;\r\n synchronized (lock) {\r\n ++baseTaskID;\r\n resultID = baseTaskID;\r\n //insert new parameters to paraList\r\n }\r\n return resultID;\r\n }", "public static int getCurrentStepNumber() {\n return threadStepNumber.get();\n }", "public int getStep () {\n\t\treturn step_;\n\t}", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "public String getSendTaskPartPkid() {\n return sendTaskPartPkid;\n }", "protected String getAppTaskID() {\r\n\t\treturn appTaskID;\r\n\t}", "public String getTaskId() {\n Object ref = taskId_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskId_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getTargetTaskID() {\n\t\treturn this.targetTaskId;\n\t}", "public Integer getTaskId() {\n return taskId;\n }", "public Integer getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n Object ref = taskId_;\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 taskId_ = s;\n return s;\n }\n }", "public int getTaskId() {\n return mTaskId;\n }", "public HistoryStep getStep(String stepId) {\r\n HistoryStep[] steps = currentProcessInstance.getHistorySteps();\r\n \r\n for (int i = 0; i < steps.length; i++) {\r\n if (steps[i].getId().equals(stepId))\r\n return steps[i];\r\n }\r\n \r\n return null;\r\n }", "public int getStep() {\n\t\treturn step;\n\t}", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "protected int getStep() {\n\t\treturn step;\n\t}", "public String getTaskId() {\n\t\treturn taskId;\n\t}", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getStepName() {\n return stepName;\n }", "public long getRouteStepKey() {\n\t\treturn routeStepKey;\n\t}", "public int getTaskType() {\n\t\treturn fieldTaskType;\n\t}", "public String getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n return taskId;\n }", "public int getTaskIndex() {\n return (Integer) commandData.get(CommandProperties.TASK_ID);\n }", "public String getRecvTaskPartPkid() {\n return recvTaskPartPkid;\n }", "public Integer getStep() {\n return step;\n }", "public int getStep() {\n return step;\n }", "public void setStepId(int stepId) {\n this.stepId = stepId;\n }", "public Element getStepExpression() {\n\t\treturn stepExpression;\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Define the identifier for the task.\")\n @JsonProperty(JSON_PROPERTY_ID)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public String getId() {\n return id;\n }", "public TimeStep getTimeStep() {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(fieldTimeStep);\n\t\treturn fieldTimeStep;\n\t}", "int getTask() {\n return task;\n }", "public String getStepDescription()\r\n\t{\r\n\t\treturn stepDescription;\r\n\t}", "public static int getLatestTaskId() {\n\n int id = 0;\n try {\n List<Task> list = Task.listAll(Task.class);\n int size = list.size();\n Task task = list.get(size - 1);\n id = task.getTaskId();\n\n } catch (Exception e) {\n id=0;\n }\n return id;\n\n }", "com.google.protobuf.ByteString\n getTaskIdBytes();", "public ITemplateStep getStepByName(String stepName);", "FlowId id();", "public int getStep() {\r\n\t\t\treturn this.enabled;\r\n\t\t}", "java.lang.String getSetupID();", "public String getIdPath() {\n\t\tif (null != this.idPath) {\n\t\t\treturn this.idPath;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"idPath\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public com.google.protobuf.ByteString\n getTaskIdBytes() {\n Object ref = taskId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public int getPlanner_ID() {\n\t\tInteger ii = (Integer) get_Value(\"Planner_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public int getMaxIdTask()\n {\n SQLiteDatabase db = this.getReadableDatabase();\n \n String query = \"SELECT MAX(id) AS max_id FROM \" + TASK_TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n int id = 0; \n if (cursor.moveToFirst())\n {\n do\n { \n id = cursor.getInt(0); \n } while(cursor.moveToNext()); \n }\n \n return id;\n }", "public String getREF_TASK_CD() {\n return REF_TASK_CD;\n }", "public java.lang.String getProcessDefinitionId() {\n return processDefinitionId;\n }", "private int getEmployeeId() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tint employeeId1 = 0;\r\n\t\tString sql = \"SELECT Patient_Id_Sequence.NEXTVAL FROM DUAL\";\r\n\t\ttry {\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(sql);\r\n\t\t\tResultSet res = pstmt.executeQuery();\r\n\t\t\tif (res.next()) {\r\n\t\t\t\temployeeId1 = res.getInt(1);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"error while fetching data from database\");\r\n\t\t}\r\n\t\treturn employeeId1;\r\n\r\n\t}", "public Integer geteDeptid() {\n return eDeptid;\n }", "public String getELEMENT_ID() {\r\n return ELEMENT_ID;\r\n }", "public String getFlowId() {\n\t\treturn flowId;\n\t}", "public java.lang.String getStepStatus() {\n return stepStatus;\n }", "public com.google.protobuf.ByteString\n getTaskIdBytes() {\n Object ref = taskId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.String getStepDescription() {\n return stepDescription;\n }", "public static TaskProperty getTaskProperty(String sortField) {\r\n TaskProperty taskProperty = TaskProperty.ID;\r\n if (sortField != null) {\r\n taskProperty = TaskProperty.valueOf(sortField);\r\n }\r\n return taskProperty;\r\n }", "public String getempID() {\n\t\treturn _empID;\n\t}", "public static final int getProcessId() {\n\t\treturn ID;\n\t}", "public String getStepDisplayName()\r\n\t{\r\n\t\treturn stepDisplayName;\r\n\t}", "public String getPropertyID()\n {\n String v = (String)this.getFieldValue(FLD_propertyID);\n return StringTools.trim(v);\n }", "public String getStepParameter(boolean isSelectType)\n\t{\n\t\treturn \"#\" + this.stepLineNumber;\n\t}", "public String getStepParameter(boolean isSelectType)\n\t{\n\t\treturn \"#\" + this.stepLineNumber;\n\t}", "public String getFlowLogId() {\n return this.flowLogId;\n }", "public String getEntityId() {\r\n\t\treturn EngineTools.getEntityId(getEntityKeys()[2]);\r\n\t}", "String getExecRefId();", "public String getOrginTaskID() {\n\t\treturn orginTaskID;\n\t}", "public double getStep() {\n\t\treturn step;\n\t}", "public Long getCourseTaskId() {\n return courseTaskId;\n }", "public Integer geteId() {\n return eId;\n }", "public Integer geteId() {\n return eId;\n }", "public String getProcessID()\n {\n return processID;\n }", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public void setTaskID(java.lang.Object taskID) {\n this.taskID = taskID;\n }" ]
[ "0.70393205", "0.6361791", "0.620727", "0.61573064", "0.60319126", "0.5927895", "0.5861183", "0.58392155", "0.58245677", "0.58121943", "0.57691866", "0.5743979", "0.57357156", "0.5673148", "0.56686324", "0.56644917", "0.5641717", "0.5636593", "0.5636593", "0.5636593", "0.5632817", "0.5616593", "0.56152797", "0.56140256", "0.55981976", "0.55669916", "0.5558774", "0.5552858", "0.5552291", "0.55511713", "0.55353963", "0.55353963", "0.5511981", "0.5507814", "0.5505668", "0.5498857", "0.5495737", "0.5495737", "0.5495737", "0.5494452", "0.5487954", "0.5477009", "0.5477009", "0.5477009", "0.5475384", "0.5475384", "0.5470364", "0.5470364", "0.54662323", "0.546523", "0.5462882", "0.5446527", "0.5446527", "0.54434526", "0.54160124", "0.53773314", "0.53418744", "0.53290254", "0.529841", "0.5254647", "0.52345943", "0.5210661", "0.51904154", "0.5181798", "0.5167866", "0.5155619", "0.515457", "0.5145223", "0.5134344", "0.5134217", "0.5122191", "0.5120345", "0.51173896", "0.5100994", "0.507476", "0.5070352", "0.5067062", "0.5064081", "0.50635505", "0.50571156", "0.50503194", "0.5048967", "0.5044339", "0.50440955", "0.5018544", "0.50178725", "0.5010054", "0.49966297", "0.49966297", "0.49862584", "0.4979272", "0.49716488", "0.49567455", "0.4955377", "0.4950586", "0.49413198", "0.49413198", "0.49310353", "0.4918725", "0.4918725", "0.49175525" ]
0.0
-1
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.ID
public void setId(String id) { this.id = id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setProcessstep(ItemI v) throws Exception{\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tif (v instanceof XFTItem)\n\t\t\t{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v,true);\n\t\t\t}else{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v.getItem(),true);\n\t\t\t}\n\t\t} catch (Exception e1) {logger.error(e1);throw e1;}\n\t}", "public int getStepId() {\n return stepId;\n }", "public void setStepId(int stepId) {\n this.stepId = stepId;\n }", "public void setTaskID(java.lang.Object taskID) {\n this.taskID = taskID;\n }", "public void setAD_Workflow_ID (int AD_Workflow_ID);", "@Override\n public void onEditStep(String step, int step_id) {\n\n Intent updateDB = new Intent(this, UpdateStepsService.class);\n updateDB.putExtra(UpdateStepsService.INSTR_KEY, step);\n updateDB.putExtra(UpdateStepsService.STEP_ID_KEY, step_id);\n updateDB.putExtra(UpdateStepsService.ACTION_KEY, UpdateStepsService.Action.UPDATE);\n startService(updateDB);\n\n }", "public void setStep(int step)\n {\n this.step = step;\n this.stepSpecified = true;\n }", "public void setStep(Integer step) {\n this.step = step;\n }", "protected void f_set(Long eID, int flowValue) {\n\t\tincreaseAccess(); // Zugriff auf den Graphen\n\t\tgraph.setValE(eID, flowAttr, flowValue);\n\t}", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[23], value);\n this.taskId = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[9], value);\n this.taskId = value;\n fieldSetFlags()[9] = true;\n return this;\n }", "public void setTask(Task inTask){\n punchTask = inTask;\n }", "public void setTimeStep(TimeStep timeStep) throws java.beans.PropertyVetoException {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(timeStep);\n\t\tif (!Matchable.areEqual(timeStep, fieldTimeStep)) {\n\t\t\tTimeStep oldValue = fieldTimeStep;\n\t\t\tfireVetoableChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t\tfieldTimeStep = timeStep;\n\t\t\tfirePropertyChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t}\n\t}", "public void setStep(int step) {\n\t\tthis.step = step;\n\t}", "public void setStep(int step) {\n this.step = step;\n }", "public int getTestCaseStepRunId() {\n return testCaseStepRunId;\n }", "public int getTaskID() {\n\t\treturn taskID;\n\t}", "public void setTaskType(int taskType) throws java.beans.PropertyVetoException {\n\t\tif (fieldTaskType != taskType) {\n\t\t\tint oldValue = fieldTaskType;\n\t\t\tfireVetoableChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t\tfieldTaskType = taskType;\n\t\t\tfirePropertyChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t}\n\t}", "public ProcessStep getProcessStepById(int processstepid) {\n\t\tthis.em = EMF.createEntityManager();\r\n\t\t\r\n\t\tList<ProcessStep> content = new ArrayList<ProcessStep>();\r\n\t\tQuery query = em.createQuery(Constants.PROCESSSTEP_ID);\r\n\t\tquery.setParameter(\"processstepid\", processstepid);\r\n\t\tcontent = query.getResultList();\r\n\t\tSystem.out.println(content.get(0));\r\n\t\treturn content.get(0);\r\n\r\n\t}", "public void setTaskId(Integer taskId) {\n this.taskId = taskId;\n }", "public void setTaskId(Integer taskId) {\n this.taskId = taskId;\n }", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "public void setStep(double step) {\n\t\tthis.step = step;\n\t}", "public void setTaskId(Integer taskId) {\n\t\tthis.taskId = taskId;\n\t}", "@PUT\n \t@Consumes({MediaType.APPLICATION_JSON })\n \tpublic Response putStep(Step step) {\n \t\tSystem.out.println(\"--> Step gotten: \"+step.toString());\n \t\tSystem.out.println(\"--> Step gotten: \"+step.getDate());\n \t\tSystem.out.println(\"--> Step gotten: \"+step.getId());\n\n \t\tResponse res;;\n \t\t\n \t\tif (step.getId() == 0) { // Create step\n \t\t\tres = Response.noContent().build();\n \t\t\tStep.saveStep(step);\n \t\t} else { // Modify step\n \t\t\tres = Response.created(uriInfo.getAbsolutePath()).build();\n \t\t\tStep.updateStep(step);\n \t\t}\n\n \t\treturn res;\n \t}", "public void setId(VfeWorkflowsAdpId id) { this.id = id; }", "public void setTaskId(String taskId) {\r\n\t\tthis.taskId=taskId;\r\n\t}", "public void seteDeptid(Integer eDeptid) {\n this.eDeptid = eDeptid;\n }", "public void setProcessSteps(com.sforce.soap.enterprise.QueryResult processSteps) {\r\n this.processSteps = processSteps;\r\n }", "public java.lang.Object getTaskID() {\n return taskID;\n }", "public String getTaskLineId() {\n return taskLineId;\n }", "public void setSteps(int steps) {\n\t\tthis.steps = steps;\n\t}", "public void setRouteStepKey(long value) {\n\t\tthis.routeStepKey = value;\n\t}", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "public void setSteps(entity.LoadStep[] value);", "public static int updateStep(int b_ref, int b_step) {\n\t\t\r\n\t\tSqlSession session = factory.openSession(true);\r\n\t\tHashMap<String, Integer> map = new HashMap<String, Integer>();\r\n\t\tmap.put(\"b_ref\", b_ref);\r\n\t\tmap.put(\"b_step\", b_step);\r\n\t\tint re = session.update(\"board.updateStep\", map);\r\n\t\tsession.close();\r\n\t\treturn re;\r\n\t}", "public void setTaskId(UUID taskId) {\n this.taskId = taskId;\n }", "public void setStepName(String stepName)\r\n\t{\r\n\t\tthis.stepName = stepName;\r\n\t}", "@Override\n public void onClick(Step selectedStepItem) {\n parent.setSelectedStepNumber(selectedStepItem.getId());\n Timber.d(selectedStepItem.getDescription());\n }", "public void setLineID(int lineID)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LINEID$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(LINEID$2);\n }\n target.setIntValue(lineID);\n }\n }", "public int getStepNumber() {\n return stepNumber;\n }", "public void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);", "void setSetupID(java.lang.String setupID);", "public void editTask(String newTask) {\n task = newTask;\n }", "public void setStepDescription(String stepDescription)\r\n\t{\r\n\t\tthis.stepDescription = stepDescription;\r\n\t}", "public void setTaskLineId(String taskLineId) {\n this.taskLineId = taskLineId;\n }", "public String getTaskId() {\n return this.taskId;\n }", "public void setStepNumber(int stepNumber) {\n this.stepNumber = stepNumber;\n }", "public Builder setTaskId(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n taskId_ = value;\n onChanged();\n return this;\n }", "public void setStepCount(long stepCount){\n steps = stepCount;\n }", "@Test\r\n public void testSetIdDepto() {\r\n System.out.println(\"setIdDepto\");\r\n Integer idDepto = null;\r\n Departamento instance = new Departamento();\r\n instance.setIdDepto(idDepto);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "public void setSteps(List<Step> steps) {\n mSteps = steps;\n }", "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public void updateTask(int tid,String title,String detail,int money,String type,int total_num,int current_num,Timestamp start_time,Timestamp end_time,String state);", "public void setM_MovementConfirm_ID (int M_MovementConfirm_ID);", "public int getStep () {\n\t\treturn step_;\n\t}", "private void setEmployeeID() {\n try {\n employeeID = userModel.getEmployeeID(Main.getCurrentUser());\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void setTaskId(String taskId) {\n this.taskId = taskId;\n }", "public void setTaskId(String taskId) {\n this.taskId = taskId;\n }", "private void setProcessId(int value) {\n\t\tthis.processId = value;\n\t}", "public void seti_ordertrx_temp_ID (int i_ordertrx_temp_ID);", "public void setBBSStepContent(BBSStep itsStep,BBSStep itsParentBBSStep) {\n \n if(itsStep != null && itsParentBBSStep == null){\n //modify a step\n fillBBSGui(itsStep);\n stepExplorerStepNameText.setEditable(false);\n itsBBSStep = itsStep;\n this.stepExplorerRevertButton.setEnabled(true);\n \n }else if(itsStep == null && itsParentBBSStep != null){\n //creating a new step under a given parent step\n this.itsParentBBSStep = itsParentBBSStep;\n //fill the GUI with the current values of the parent in which the\n //new step will be situated to ease data entry...\n fillBBSGui(itsParentBBSStep);\n stepExplorerStepNameText.setText(\"\");\n \n this.stepExplorerRevertButton.setEnabled(false);\n \n }else if (itsStep ==null && itsParentBBSStep == null){\n //assume a new strategy step will be generated\n this.stepExplorerRevertButton.setEnabled(false);\n }\n }", "public Builder setStep(int value) {\n bitField0_ |= 0x00000002;\n step_ = value;\n onChanged();\n return this;\n }", "public Builder setStep(int value) {\n bitField0_ |= 0x00000002;\n step_ = value;\n onChanged();\n return this;\n }", "public void updateToDone(int _id) {\n\n ContentValues values = new ContentValues();\n String date = DateFormat.getDateInstance().format(new Date());\n\n values.put(\"dateDone\", date);\n values.put(\"done\", 1);\n\n getWritableDatabase().update(\"tasks\", values, \"_id = '\"+_id+\"'\", null);\n }", "void setID(int val)\n throws RemoteException;", "protected int getStep() {\n\t\treturn step;\n\t}", "@Test\n public void updateCompletedAndGetById() {\n mDatabase.taskDao().insertTask(TASK);\n\n // When the task is updated\n mDatabase.taskDao().updateCompleted(TASK.getId(), false);\n\n // When getting the task by id from the database\n Task loaded = mDatabase.taskDao().getTaskById(\"id\");\n\n // The loaded data contains the expected values\n assertTask(loaded, TASK.getId(), TASK.getTitle(), TASK.getDescription(), false);\n }", "public String getSendTaskPartPkid() {\n return sendTaskPartPkid;\n }", "@Override\n public void setSteps(Cursor steps) {\n adapter = new StepAdapter(getContext(), steps);\n stepDataList.setAdapter(adapter);\n }", "public void setTestCaseStepRunId(int testCaseStepRunId) {\n this.testCaseStepRunId = testCaseStepRunId;\n }", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "public abstract void setProcessID(long pid);", "public int getStep() {\n\t\treturn step;\n\t}", "public void setCurrentStep(ElementHeader currentStep)\n {\n this.currentStep = currentStep;\n }", "public Builder setStep(int value) {\n bitField0_ |= 0x00000004;\n step_ = value;\n onChanged();\n return this;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public void setTask(Task task) {\n this.task = task;\n }", "public void setSendTaskPartPkid(String sendTaskPartPkid) {\n this.sendTaskPartPkid = sendTaskPartPkid == null ? null : sendTaskPartPkid.trim();\n }", "public void setTaskData(String mID) throws IOException\n\t{\n\t\ttry\n\t\t{\n\t\t\ttCollect = new TaskCollection(mID, ConnectionManager.getInstance().currentSensor(0).getSerialNumber());\n\t\t\t\n\t\t\tif (tCollect.getMeasTask().isEmpty())\n\t\t\t{\n\t\t\t\tmeasurTaskText.setText(\" \");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < tCollect.getMeasTask().size(); i++)\n\t\t\t\t{\n\t\t\t\t\tmeasurTaskText.setText(tCollect.getMeasTask().get(i).getTaskDetails());\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif (!sensorTaskText.equals(\"\"))\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < tCollect.getSensorTask().size(); i++)\n\t\t\t\t{\n\t\t\t\t\tsensorTaskText.setText(tCollect.getSensorTask().get(i).getTaskDetails());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (SensorNotFoundException e)\n\t\t{\n\t\t\tstatusBar.setText(e.getMessage());\n\t\t}\n\t}", "public void setStepName(java.lang.String stepName) {\n this.stepName = stepName;\n }", "protected TaskFlow( final String id ) {\n this.id = id;\n }", "public void setStepStatus(java.lang.String stepStatus) {\n this.stepStatus = stepStatus;\n }", "public int getTaskId() {\n return taskId;\n }", "int getStep();", "int getStep();", "int getStep();", "public void setStepStart(FieldODEStateAndDerivative<T> stepStart2) {\r\n this.stepStart = stepStart2;\r\n }", "public void setID(int id){\n this.ID = id;\n }", "public void setID(int ID)\r\n {\r\n this.ID = ID;\r\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public void setStepDisplayName(String stepDisplayName)\r\n\t{\r\n\t\tthis.stepDisplayName = stepDisplayName;\r\n\t}", "public int getUpdatedTaskID(){\r\n int resultID;\r\n synchronized (lock) {\r\n ++baseTaskID;\r\n resultID = baseTaskID;\r\n //insert new parameters to paraList\r\n }\r\n return resultID;\r\n }", "public void testCmdUpdate_taskID_field() {\n\t\t// Initialize test variables\n\t\tCommandAction expectedCA;\n\t\tList<Task> expectedTaskList;\n\n\t\t/*\n\t\t * Test 1: Testing ID field\n\t\t */\n\t\tctf.initialize();\n\t\texpectedTaskList = null;\n\n\t\t// Test 1a: ID is null\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, null);\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKIDNOTFOUND, INVALID_TASKID), false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 1b: ID is invalid\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, INVALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKIDNOTFOUND, INVALID_TASKID), false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 1c: ID is valid, but not in list\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, VALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKIDNOTFOUND, VALID_TASKID), false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 1d: ID is valid and is in list, but not update changes\n\t\taddNewTask(TASK_NAME_1);\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, VALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(MSG_TASKNOUPDATE, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t}", "public void setTaskCompleted(TaskAttemptID taskID) {\n taskStatuses.get(taskID).setState(TaskStatus.SUCCEEDED);\n successfulTaskID = taskID;\n activeTasks.remove(taskID);\n }", "public abstract void setEspe_id(java.lang.Integer newEspe_id);", "public static void setIDt(int IDt) {\n Componente.IDt = IDt;\n }" ]
[ "0.6291796", "0.6264319", "0.6257881", "0.5849228", "0.56413877", "0.5582471", "0.55760825", "0.5560233", "0.55572325", "0.5504644", "0.5434589", "0.54309857", "0.5406272", "0.54004014", "0.5309251", "0.523584", "0.523508", "0.51637596", "0.51135546", "0.50977373", "0.50977373", "0.50847155", "0.50827944", "0.508074", "0.5065105", "0.5061358", "0.5039534", "0.5029164", "0.5015442", "0.5004362", "0.49663892", "0.49538827", "0.49520496", "0.4942872", "0.49426305", "0.4922481", "0.49104592", "0.490443", "0.48925412", "0.48916167", "0.4886475", "0.4880563", "0.4874107", "0.48717502", "0.48706043", "0.4858034", "0.48430097", "0.48186654", "0.4818053", "0.48092142", "0.48066172", "0.48028818", "0.47985828", "0.47961923", "0.4789092", "0.47791508", "0.47679427", "0.47679085", "0.47679085", "0.4752902", "0.47465795", "0.47463354", "0.4730794", "0.4730794", "0.47281146", "0.4724424", "0.47222453", "0.47211087", "0.47084022", "0.47030187", "0.47022763", "0.469637", "0.46962103", "0.46959046", "0.46950746", "0.46915567", "0.46895975", "0.46895975", "0.46895975", "0.46887273", "0.46866524", "0.46829268", "0.4678756", "0.46780258", "0.46741235", "0.46708244", "0.46690354", "0.46690354", "0.46690354", "0.4668486", "0.46681407", "0.46672997", "0.46601975", "0.46601975", "0.46601975", "0.4653508", "0.46530724", "0.46421164", "0.46402797", "0.46385983", "0.46368936" ]
0.0
-1
This method was generated by Abator for iBATIS. This method returns the value of the database column HBDW1.EP_TASK_STEP.NAME
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public java.lang.String getStepName() {\n return stepName;\n }", "public String getStepDisplayName()\r\n\t{\r\n\t\treturn stepDisplayName;\r\n\t}", "String getTaskName();", "String getTaskName();", "public String toString()\r\n\t{\r\n\t\treturn ToStringHelper.toString(this, new String [] { \"stepName\" });\r\n\t}", "public String getTaskName(){\r\n\t\treturn this.taskName;\r\n\t}", "public String getTaskName();", "public String getName()\r\n {\r\n return taskName;\r\n }", "public String taskName() {\n return this.taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public TaskName getTaskName() {\n return this.taskName;\n }", "private String getTaskName() {\n \n \t\treturn this.environment.getTaskName() + \" (\" + (this.environment.getIndexInSubtaskGroup() + 1) + \"/\"\n \t\t\t+ this.environment.getCurrentNumberOfSubtasks() + \")\";\n \t}", "public String getTaskName() {\n return this.taskDescription;\n }", "public String getStepDescription()\r\n\t{\r\n\t\treturn stepDescription;\r\n\t}", "public String getTaskName() {\n Object ref = taskName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskName_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public abstract String getTaskName();", "public String getTaskName() {\n Object ref = taskName_;\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 taskName_ = s;\n return s;\n }\n }", "public java.lang.String getStepDescription() {\n return stepDescription;\n }", "java.lang.String getExecutionStageName();", "public ITemplateStep getStepByName(String stepName);", "@Override\n public String getShortName() {\n return step.getShortName();\n }", "public com.google.protobuf.ByteString\n getTaskNameBytes() {\n Object ref = taskName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "com.google.protobuf.ByteString\n getTaskNameBytes();", "public com.google.protobuf.ByteString\n getTaskNameBytes() {\n Object ref = taskName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "String GetTaskName(int Catalog_ID);", "public void setStepName(String stepName)\r\n\t{\r\n\t\tthis.stepName = stepName;\r\n\t}", "public String get_task_title()\n {\n return task_title;\n }", "@Override\n\tpublic String getTaskElementName() {\n\t\treturn null;\n\t}", "public java.lang.String getStepStatus() {\n return stepStatus;\n }", "public void setStepName(java.lang.String stepName) {\n this.stepName = stepName;\n }", "private String getActivityName(Transition transition) {\n\t\tString result = \"\";\n\t\t// get associated log event type\n\t\tLogEvent le = transition.getLogEvent();\n\n\t\t// check for invisible tasks\n\t\tif (le != null) {\n\t\t\tresult = le.getModelElementName();\n\t\t} else {\n\t\t\tresult = transition.getIdentifier();\n\t\t}\n\t\treturn result;\n\t}", "public int getStepId() {\n return stepId;\n }", "public String getTaskName(Long taskId, String language) {\n TaskServiceSession taskSession = null;\n try {\n taskSession = jtaTaskService.createSession();\n Task taskObj = taskSession.getTask(taskId);\n \n Iterator iTasks = taskObj.getNames().iterator();\n while(iTasks.hasNext()){\n I18NText iObj = (I18NText)iTasks.next();\n if(iObj.getLanguage().equals(language))\n return iObj.getText();\n }\n throw new RuntimeException(\"getTaskName() can not find taskName for taskId = \"+taskId+\" : language = \"+language);\n }finally {\n if(taskSession != null)\n taskSession.dispose();\n }\n }", "String getTaskId();", "@Security.Authenticated(Secured.class)\n @CheckPermission(category = Category.TASK, needs = {Operation.GET})\n public Result outputStepsName(long institutionId, long stepId) throws Exception {\n List<String> stepsName = stepRepository.getDestinySteps(stepId)\n .stream().map(s -> s.getLabel()).collect(Collectors.toList());\n\n JSONArray jsonArray = new JSONArray();\n stepsName.stream()\n .forEach(name -> {\n JSONObject jsonObject = new JSONObject();\n jsonObject.put(\"name\", name);\n jsonArray.add(jsonObject);\n });\n return ok(Json.toJson(jsonArray));\n }", "@Override\n public String toString() {\n return String.format(Locale.getDefault(),\n \"Step{id=%d, shortDescription='%s'}\", id, shortDescription);\n }", "protected String getTaskId() {\n\t\tDisplay.debug(\"getTaskId() devuelve %s\", taskId);\n\t\treturn taskId;\n\t}", "public Element getStepExpression() {\n\t\treturn stepExpression;\n\t}", "public void setTaskName(String name) {\n\r\n\t}", "public String getTaskTitle() {\n return String.valueOf(comboBox.getSelectedItem());\n }", "java.lang.String getNextStep();", "public void extractLastTaskName() throws IllegalCommandArgumentException {\n // Adds name that isn't checked by \";\" (i.e. start is < wordsOfInput.length)\n for (int n = start; n < index; n++) {\n if (wordsOfInput[n].indexOf(\"/\") == 0) {\n name += wordsOfInput[n].substring(1);\n } else {\n name += wordsOfInput[n];\n }\n if (n < index-1) {\n name += \" \";\n }\n }\n \n if (name.length() == 0 && parseType == 0) {\n throw new IllegalCommandArgumentException(Constants.FEEDBACK_NO_TASK_NAME, \n Constants.CommandParam.NAME);\n } \n names.add(name);\n }", "public static String getTaskName6(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n return prefs.getString(\"taskName6\", \"click to edit\");\n }", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public TimeStep getTimeStep() {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(fieldTimeStep);\n\t\treturn fieldTimeStep;\n\t}", "int getStep();", "int getStep();", "int getStep();", "public String getDataFlowName() {\n return dataFlowName;\n }", "public String get_task_description()\n {\n return task_description;\n }", "public java.lang.String getRndTaskName() {\n return rndTaskName;\n }", "public String getName() {\n int index = getSplitIndex();\n return path.substring(index + 1);\n }", "@ApiModelProperty(example = \"null\", value = \"The name of the reporting task.\")\n public String getName() {\n return name;\n }", "public int getStep () {\n\t\treturn step_;\n\t}", "public void setStepDisplayName(String stepDisplayName)\r\n\t{\r\n\t\tthis.stepDisplayName = stepDisplayName;\r\n\t}", "public String getTaskUnit() {\n\t\treturn taskUnit;\n\t}", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "public long getStepNumber() {\n return schedule.getSteps();\n }", "public String getEpicsRecordNameSetPoint() {\n\t\treturn epicsRecordNameSetPoint;\n\t}", "public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}", "public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}", "public String getTask(int position) {\n HashMap<String, String> map = list.get(position);\n return map.get(TASK_COLUMN);\n }", "public String getTaskId() {\n Object ref = taskId_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskId_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "@Override\n\t\t\tpublic void setTaskName(String name) {\n\t\t\t\t\n\t\t\t}", "com.google.protobuf.ByteString\n getExecutionStageNameBytes();", "public static String getTaskName1(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n return prefs.getString(\"taskName\", \"click to edit\");\n }", "public int getStep() {\n\t\treturn step;\n\t}", "public String getTask(){\n\treturn task;\n}", "@Test\n public void testGetName_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n\n String result = fixture.getName();\n\n assertEquals(\"\", result);\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public HistoryStep getStep(String stepId) {\r\n HistoryStep[] steps = currentProcessInstance.getHistorySteps();\r\n \r\n for (int i = 0; i < steps.length; i++) {\r\n if (steps[i].getId().equals(stepId))\r\n return steps[i];\r\n }\r\n \r\n return null;\r\n }", "public static String getTaskName4(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n return prefs.getString(\"taskName4\", \"click to edit\");\n }", "protected int getStep() {\n\t\treturn step;\n\t}", "public String getEpicsRecordNameGetPoint() {\n\t\treturn epicsRecordNameGetPoint;\n\t}", "public void setTaskName(String taskName) {\r\n\t\tthis.taskName=taskName;\r\n\t}", "private static String getDescription(Step step) {\n if (step instanceof FlowCall) {\n return \"Flow call: \" + ((FlowCall) step).getFlowName();\n } else if (step instanceof Expression) {\n return \"Expression: \" + ((Expression) step).getExpr();\n } else if (step instanceof ScriptCall) {\n return \"Script: \" + ((ScriptCall) step).getLanguageOrRef();\n } else if (step instanceof IfStep) {\n return \"Check: \" + ((IfStep) step).getExpression();\n } else if (step instanceof SwitchStep) {\n return \"Switch: \" + ((SwitchStep) step).getExpression();\n } else if (step instanceof SetVariablesStep) {\n return \"Set variables\";\n } else if (step instanceof Checkpoint) {\n return \"Checkpoint: \" + ((Checkpoint) step).getName();\n } else if (step instanceof FormCall) {\n return \"Form call: \" + ((FormCall) step).getName();\n } else if (step instanceof GroupOfSteps) {\n return \"Group of steps\";\n } else if (step instanceof ParallelBlock) {\n return \"Parallel block\";\n } else if (step instanceof ExitStep) {\n return \"Exit\";\n } else if (step instanceof ReturnStep) {\n return \"Return\";\n }\n\n return step.getClass().getName();\n }", "public static String getTaskName5(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n return prefs.getString(\"taskName5\", \"click to edit\");\n }", "private String getJiraTestCaseName() {\n String summary = issue.substring(issue.indexOf(\"summary\"), issue.indexOf(\"timetracking\"));\n name = summary.substring(summary.indexOf(\"TC\"));\n name = name.substring(0, name.indexOf(\"\\\",\"));\n return name;\n }", "public String getExerciseName()\n\t{\n\t\treturn this.exerciseName;\n\t}", "public String getDptName() {\n return dptName;\n }", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "@Override\n public String getPieceName() {\n return NAME;\n }", "public int getStepNumber() {\n return stepNumber;\n }", "public String getName()\n {\n \tif (_nodeVRL==null)\n \t\treturn null;\n \t\n return _nodeVRL.getBasename(); // default= last part of path\n }", "public final String getName() {\n /// Since we plan to have only one wizard for each class, we use the name of the class.\n return this.getClass().getSimpleName();\n }", "@Override\n\tpublic String getJobName() {\n\t\treturn model.getJobName();\n\t}", "public String getTaskId() {\n Object ref = taskId_;\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 taskId_ = s;\n return s;\n }\n }", "public String getREF_TASK_CD() {\n return REF_TASK_CD;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }" ]
[ "0.73163444", "0.7163759", "0.686146", "0.67190355", "0.67190355", "0.6707688", "0.66409326", "0.66235846", "0.65849483", "0.64652896", "0.6441308", "0.6441308", "0.6441308", "0.6441308", "0.6422876", "0.6410225", "0.6395543", "0.6306687", "0.6304121", "0.6302669", "0.6248118", "0.6195009", "0.6172297", "0.6100594", "0.60705435", "0.5967156", "0.59389544", "0.5898938", "0.5887754", "0.5887595", "0.57775277", "0.5767794", "0.5746368", "0.5715495", "0.5662465", "0.56515646", "0.5605289", "0.5558047", "0.5557354", "0.55306715", "0.55180115", "0.5514539", "0.5483159", "0.5470845", "0.5469288", "0.546846", "0.54543674", "0.5453339", "0.5453339", "0.54386044", "0.54345816", "0.54345816", "0.54345816", "0.5431784", "0.5430531", "0.5394409", "0.53626984", "0.5351801", "0.534092", "0.5339858", "0.5337682", "0.53360444", "0.53360444", "0.53308946", "0.53299993", "0.53212357", "0.53131354", "0.53131354", "0.53121215", "0.5294508", "0.528883", "0.528883", "0.52874064", "0.52856016", "0.5283909", "0.528198", "0.52812105", "0.52790797", "0.5262503", "0.5262503", "0.52613956", "0.5260577", "0.52547294", "0.52524", "0.52443194", "0.52422696", "0.52412134", "0.5238482", "0.5236112", "0.5229618", "0.5223651", "0.52213985", "0.5205866", "0.51982605", "0.5196363", "0.51943684", "0.5191145", "0.51898974", "0.51890856", "0.51890856", "0.51890856" ]
0.0
-1
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.NAME
public void setName(String name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setStepName(String stepName)\r\n\t{\r\n\t\tthis.stepName = stepName;\r\n\t}", "public void setStepName(java.lang.String stepName) {\n this.stepName = stepName;\n }", "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public java.lang.String getStepName() {\n return stepName;\n }", "public void setCurrentTaskName(String name);", "public void setStepDisplayName(String stepDisplayName)\r\n\t{\r\n\t\tthis.stepDisplayName = stepDisplayName;\r\n\t}", "@Override\n\t\tpublic void setTaskName(String arg0) {\n\n\t\t}", "@Override\r\n\tpublic void setTaskName(String name) {\n\r\n\t}", "public String getStepDisplayName()\r\n\t{\r\n\t\treturn stepDisplayName;\r\n\t}", "@Override\n\t\t\tpublic void setTaskName(String name) {\n\t\t\t\t\n\t\t\t}", "public void setStepTableName(String name)\n\t{\n\t\tm_stepsTableName = name;\n\t}", "public void setTaskName(String name) {\n\r\n\t}", "@Test\n public void testSetName_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n String name = \"\";\n\n fixture.setName(name);\n\n }", "public void setTaskName(String taskName) {\r\n\t\tthis.taskName=taskName;\r\n\t}", "public void setProcessstep(ItemI v) throws Exception{\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tif (v instanceof XFTItem)\n\t\t\t{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v,true);\n\t\t\t}else{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v.getItem(),true);\n\t\t\t}\n\t\t} catch (Exception e1) {logger.error(e1);throw e1;}\n\t}", "public void setTaskName(String taskName)\n\t{\n\t\tthis.taskName = taskName;\n\t}", "public Builder setTaskName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n taskName_ = value;\n onChanged();\n return this;\n }", "public void setStepDescription(String stepDescription)\r\n\t{\r\n\t\tthis.stepDescription = stepDescription;\r\n\t}", "public void setTaskName(String taskName) {\n this.taskName = taskName;\n }", "public void setTaskName(String taskName) {\n this.taskName = taskName;\n }", "public void setStep(int step)\n {\n this.step = step;\n this.stepSpecified = true;\n }", "public String getTaskName(){\r\n\t\treturn this.taskName;\r\n\t}", "public static void setTaskName6(Context context, String taskName6) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"taskName6\", taskName6);\n editor.commit();\n }", "void updateTaskName(int id, String name);", "public String toString()\r\n\t{\r\n\t\treturn ToStringHelper.toString(this, new String [] { \"stepName\" });\r\n\t}", "public void setStep(int step) {\n\t\tthis.step = step;\n\t}", "public void setStepDescription(java.lang.String stepDescription) {\n this.stepDescription = stepDescription;\n }", "public String getStepDescription()\r\n\t{\r\n\t\treturn stepDescription;\r\n\t}", "public void setTask(Task inTask){\n punchTask = inTask;\n }", "public void setTimeStep(TimeStep timeStep) throws java.beans.PropertyVetoException {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(timeStep);\n\t\tif (!Matchable.areEqual(timeStep, fieldTimeStep)) {\n\t\t\tTimeStep oldValue = fieldTimeStep;\n\t\t\tfireVetoableChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t\tfieldTimeStep = timeStep;\n\t\t\tfirePropertyChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t}\n\t}", "public void setStep(int step) {\n this.step = step;\n }", "public void setStep(Integer step) {\n this.step = step;\n }", "public static void setTaskName5(Context context, String taskName5) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"taskName5\", taskName5);\n editor.commit();\n }", "public static void setTaskName1(Context context, String taskName) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"taskName\", taskName);\n editor.commit();\n }", "public ITemplateStep getStepByName(String stepName);", "public String getName()\r\n {\r\n return taskName;\r\n }", "public void setStep(double step) {\n\t\tthis.step = step;\n\t}", "public TaskName getTaskName() {\n return this.taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public void setStepStatus(java.lang.String stepStatus) {\n this.stepStatus = stepStatus;\n }", "public void setStepId(int stepId) {\n this.stepId = stepId;\n }", "public int getStepId() {\n return stepId;\n }", "public void editTask(String newTask) {\n task = newTask;\n }", "public java.lang.String getStepDescription() {\n return stepDescription;\n }", "void Step(String step);", "public String getTaskName();", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "public void onStepStarted(int index, int total, String name);", "@Override\n\tpublic String getTaskElementName() {\n\t\treturn null;\n\t}", "public String taskName() {\n return this.taskName;\n }", "public void setBBSStepContent(BBSStep itsStep,BBSStep itsParentBBSStep) {\n \n if(itsStep != null && itsParentBBSStep == null){\n //modify a step\n fillBBSGui(itsStep);\n stepExplorerStepNameText.setEditable(false);\n itsBBSStep = itsStep;\n this.stepExplorerRevertButton.setEnabled(true);\n \n }else if(itsStep == null && itsParentBBSStep != null){\n //creating a new step under a given parent step\n this.itsParentBBSStep = itsParentBBSStep;\n //fill the GUI with the current values of the parent in which the\n //new step will be situated to ease data entry...\n fillBBSGui(itsParentBBSStep);\n stepExplorerStepNameText.setText(\"\");\n \n this.stepExplorerRevertButton.setEnabled(false);\n \n }else if (itsStep ==null && itsParentBBSStep == null){\n //assume a new strategy step will be generated\n this.stepExplorerRevertButton.setEnabled(false);\n }\n }", "private void updateName(Widget sender){\r\n\t\tint index = getWidgetIndex(sender) - 1;\r\n\t\tTaskParam param = taskDef.getParamAt(index);\r\n\t\tparam.setName(((TextBox)sender).getText());\r\n\t\ttaskDef.setDirty(true);\r\n\t}", "public static void setTaskName4(Context context, String taskName4) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"taskName4\", taskName4);\n editor.commit();\n }", "String getTaskName();", "String getTaskName();", "public Builder setTaskNameBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n taskName_ = value;\n onChanged();\n return this;\n }", "public abstract String getTaskName();", "@Test\n public void testSetScriptGroupName_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n String scriptGroupName = \"\";\n\n fixture.setScriptGroupName(scriptGroupName);\n\n }", "@Override\n public String getShortName() {\n return step.getShortName();\n }", "public void testCmdUpdate_taskName_field() {\n\t\t// Initialize test variables\n\t\tCommandAction expectedCA;\n\t\tTask expectedTask;\n\t\tList<Task> expectedTaskList;\n\n\t\t/*\n\t\t * Test 2: Testing task name field (all ID are valid)\n\t\t */\n\t\tctf.initialize();\n\t\texpectedTaskList = null;\n\t\taddNewTask(TASK_NAME_1);\n\n\t\t// Test 2a: task name is null\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, VALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(MSG_TASKNOUPDATE, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 2b: task name is an empty String\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", EMPTY_STRING, null, null, null);\n\t\texpectedCA = new CommandAction(MSG_TASKNOUPDATE, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 2c: new task name is same as current task name (no changes)\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", TASK_NAME_1, null, null, null);\n\t\texpectedCA = new CommandAction(MSG_TASKNOUPDATE, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 2d: new task name is different from current task name (changes\n\t\t// made)\n\t\texpectedTaskList = new ArrayList<Task>();\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", TASK_NAME_2, null, null, null);\n\t\texpectedTask = ctf.createExpectedTask(TASK_NAME_2, NO_TIME, NO_TIME, PRIORITY_TYPE.NORMAL);\n\t\texpectedTaskList.add(expectedTask);\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKUPDATED, VALID_TASKID), true, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t}", "public void assignTask(String employee, String taskName) {\n \tSystem.out.println(\"Inside assignDeadline()\");\n \t//Task t = new Task();\n \tint count = 0;\n \tfor(Task task : toDoList) {\n \t\tif(task.getTaskName().equals(taskName)) {\n \t\t\t//t = task;\n \t\t\ttask.setEmployee(employee);\n \t\t\ttoDoList.set(count, task);\n \t\t}\n \t\tcount++;\n \t}\n \tSystem.out.println(\"Task Assigned to Employee Sucessfully\");\n \t\n \tdisplay();\n }", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[23], value);\n this.taskId = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public String getTaskName() {\n return this.taskDescription;\n }", "@IcalProperty(pindex = PropertyInfoIndex.NAME,\n required = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true)\n public void setName(final String val) {\n name = val;\n }", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[9], value);\n this.taskId = value;\n fieldSetFlags()[9] = true;\n return this;\n }", "@Override\n public void onClick(Step selectedStepItem) {\n parent.setSelectedStepNumber(selectedStepItem.getId());\n Timber.d(selectedStepItem.getDescription());\n }", "@Override\n public void onEditStep(String step, int step_id) {\n\n Intent updateDB = new Intent(this, UpdateStepsService.class);\n updateDB.putExtra(UpdateStepsService.INSTR_KEY, step);\n updateDB.putExtra(UpdateStepsService.STEP_ID_KEY, step_id);\n updateDB.putExtra(UpdateStepsService.ACTION_KEY, UpdateStepsService.Action.UPDATE);\n startService(updateDB);\n\n }", "private String getTaskName() {\n \n \t\treturn this.environment.getTaskName() + \" (\" + (this.environment.getIndexInSubtaskGroup() + 1) + \"/\"\n \t\t\t+ this.environment.getCurrentNumberOfSubtasks() + \")\";\n \t}", "public void setProcessSteps(com.sforce.soap.enterprise.QueryResult processSteps) {\r\n this.processSteps = processSteps;\r\n }", "public String getTaskName() {\n Object ref = taskName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskName_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public void setCurrentStep(ElementHeader currentStep)\n {\n this.currentStep = currentStep;\n }", "public void setSteps(int steps) {\n\t\tthis.steps = steps;\n\t}", "public String getTaskName() {\n Object ref = taskName_;\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 taskName_ = s;\n return s;\n }\n }", "public void setStepNumber(int stepNumber) {\n this.stepNumber = stepNumber;\n }", "public java.lang.String getStepStatus() {\n return stepStatus;\n }", "public Element getStepExpression() {\n\t\treturn stepExpression;\n\t}", "public void setCheckStep (java.lang.Byte checkStep) {\n\t\tthis.checkStep = checkStep;\n\t}", "@Test\n public void testGetName_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n\n String result = fixture.getName();\n\n assertEquals(\"\", result);\n }", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "public void renameTask(String taskName, Task myTask) {\n \tSystem.out.println(\"Inside renameTask :\" + taskName);\n \t//System.out.println(toDoList);\n \tTask t = new Task();\n \tint count = 0;\n \tfor(Task task : toDoList) {\n \t\tif(task.getTaskName().equals(taskName));{\n \t\tSystem.out.println(\"inside\");\n \t\tt.setTaskName(myTask.getTaskName());\n \t\tt.setEmployee(myTask.getEmployee());\n \t\tt.setDone(myTask.isDone());\n \t\tt.setDeadline(myTask.getDeadline());\n \t\t\n \t\ttoDoList.set(count, t);\n \t}\n \tcount ++;\n }\n \t\n System.out.println(toDoList);\n\tdisplay();\n }", "public void setEpicsRecordNameSetPoint(String epicsRecordNameSetPoint) {\n\t\tthis.epicsRecordNameSetPoint = epicsRecordNameSetPoint;\n\t}", "public String getEpicsRecordNameSetPoint() {\n\t\treturn epicsRecordNameSetPoint;\n\t}", "public void setSteps(List<Step> steps) {\n mSteps = steps;\n }", "public String get_task_title()\n {\n return task_title;\n }", "public void setSteps(entity.LoadStep[] value);", "@Given(\"^I want to write a step with \\\"([^\\\"]*)\\\"$\")\r\n\tpublic void i_want_to_write_a_step_with_name(String arg1) throws Throwable {\n\t System.out.println(arg1);\r\n\t}", "public void setTaskUnit(String taskUnit) {\n\t\tthis.taskUnit = taskUnit;\n\t}", "public static void pass(String stepName, String description) \n\t{\n\t\ttry{\n\t\t\ttest.log(LogStatus.PASS, stepName, description);\n\t\t}catch(Exception e){fnPrintException(e);}\t\t\t\n\t}", "public static void setTaskName2(Context context, String taskName2) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"taskName2\", taskName2);\n editor.commit();\n }", "public static void setTaskName3(Context context, String taskName3) {\n SharedPreferences prefs = context.getSharedPreferences(\"com.mobile.counterappmobile\", 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"taskName3\", taskName3);\n editor.commit();\n }", "public String getIsmtransitionCareflowstepName() {\n\t\treturn ismtransitionCareflowstepName;\n\t}", "public static void error(String stepName, String description) \n\t{\n\t\ttry{\n\t\t\ttest.log(LogStatus.ERROR, stepName, description);\n\t\t\tReporter.blnStatus=false;\n\t\t}catch(Exception e){fnPrintException(e);}\t\n\t}", "public void setOperationName(java.lang.String param){\n localOperationNameTracker = true;\n \n this.localOperationName=param;\n \n\n }", "public void setName(String name) {\n setUserProperty(\"ant.project.name\", name);\n this.name = name;\n }", "java.lang.String getNextStep();", "@Test\n public void testSetProductName_1()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n String productName = \"\";\n\n fixture.setProductName(productName);\n\n }", "public void updateTestStep(String teststep,ExtentReports r,ExtentTest l,WebDriver driver)\n\t{\n\t\tcurrentTestStep=teststep;\n\n\t}", "public com.google.protobuf.ByteString\n getTaskNameBytes() {\n Object ref = taskName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }" ]
[ "0.67248493", "0.65711486", "0.6551747", "0.6268485", "0.62268066", "0.61506414", "0.61169195", "0.60806364", "0.60354817", "0.60177165", "0.60109746", "0.59319866", "0.5767673", "0.57559496", "0.56835574", "0.5665607", "0.5617868", "0.5613317", "0.5586463", "0.5586463", "0.55612856", "0.54626286", "0.54557693", "0.5443429", "0.5426755", "0.54096645", "0.5394242", "0.5372102", "0.53548473", "0.53351295", "0.53057516", "0.52900183", "0.527019", "0.5267798", "0.5259031", "0.5258718", "0.5248512", "0.5238667", "0.52281994", "0.52281994", "0.52281994", "0.52281994", "0.5212211", "0.5188998", "0.5159433", "0.5157236", "0.51487416", "0.5143893", "0.51434034", "0.51423705", "0.51237667", "0.5123224", "0.510997", "0.51075816", "0.5104405", "0.5097703", "0.5090211", "0.5090211", "0.5086914", "0.50820994", "0.50701827", "0.5059427", "0.5036339", "0.5036305", "0.49706247", "0.49696714", "0.49280325", "0.49158686", "0.48874176", "0.4881568", "0.48557967", "0.485499", "0.48500675", "0.48361006", "0.48334962", "0.482931", "0.48202908", "0.47981694", "0.47955745", "0.4785948", "0.477354", "0.47681165", "0.4762296", "0.4757295", "0.47531173", "0.47480577", "0.47459188", "0.47402853", "0.47355855", "0.47343904", "0.47259644", "0.47182938", "0.47029698", "0.47014904", "0.46931636", "0.46845564", "0.4681474", "0.467941", "0.46724597", "0.46720436", "0.46637124" ]
0.0
-1
This method was generated by Abator for iBATIS. This method returns the value of the database column HBDW1.EP_TASK_STEP.SEQ
public Integer getSeq() { return seq; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getSEQN() {\n return SEQN;\n }", "public String getSequence()\n\t{\n\t\treturn this.sequence;\n\t}", "public String getSequence()\r\n\t{\r\n\t\treturn sequence;\r\n\t}", "public long getStepNumber() {\n return schedule.getSteps();\n }", "public String getSequence() \n\t{\n\t\treturn sequence;\n\t\t\n\t}", "public String getSequence() {\r\n return sequence;\r\n }", "public String getSequence() {\n\t\treturn sequence;\n\t}", "public String getSequence() {\n\t\treturn sequence;\n\t}", "public int getSeq() {\n return seq_;\n }", "public int getSeq() {\n return seq_;\n }", "public int getSequence() {\n return sequence;\n }", "public long getSequenceNum() {\n return sequenceNum;\n }", "public int getSeq() {\n return seq_;\n }", "public int getSeq() {\n return seq_;\n }", "public long getSequence() {\n\t\tif (order != null){\n\t\t\treturn order.getSequence();\n\t\t}\n\t\treturn sequence;\n\t}", "public Integer getSequence()\n {\n return sequence;\n }", "public java.lang.Integer getSeqNo () {\n\t\treturn seqNo;\n\t}", "public String getEventSeq() {\r\n\t\treturn eventSeq;\r\n\t}", "public long getSeqNo() {\n return seqNo;\n }", "public Integer getSequence() {\n return sequence;\n }", "public Integer getACTIVITY_SEQ_ID() {\n return ACTIVITY_SEQ_ID;\n }", "public String getSequence() {\r\n return mySequenceFragment;\r\n }", "public int getStepId() {\n return stepId;\n }", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "java.lang.String getNextStep();", "public long getSequenceNo() {\n\treturn sequenceNo;\n }", "public int getSequenceNum() {\n\t\treturn sequenceNumber;\n\t}", "public int getSeqNo();", "public int getSeqNo();", "public int getStep () {\n\t\treturn step_;\n\t}", "@Field(3) \n\tpublic int SequenceNo() {\n\t\treturn this.io.getIntField(this, 3);\n\t}", "@Nullable\n public String getSequence() {\n return XmlUtils.getAttributeValue(this.mAdNode, \"sequence\");\n }", "long getSeqnum();", "long getSeqnum();", "long getSeqnum();", "long getSeqnum();", "long getSeqnum();", "long getSeqnum();", "long getSeqnum();", "long getSequenceNum() {\n return sequenceNum;\n }", "int getStep();", "int getStep();", "int getStep();", "public int getSeq() {\n return -1;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public void obtainStepsProcess(){\n String comp=\"\";\n int pos=0;\n int paso=0;\n for(String i:ejemplo.getCadena()){\n String[] pendExec= i.split(\"pend\");\n String last=\"\";\n if(!pendExec[0].equals(\"\"))\n last=pendExec[0].substring(pendExec[0].length()-1);\n if(!last.equals(comp)){\n stepProcess.put(pos, paso);\n pos++;\n comp=last;\n }\n paso++;\n }\n paso--;\n stepProcess.put(pos, paso);\n }", "public String getSequenceId() {\n return this.placement.getSeqId();\n }", "public int getStep() {\n\t\treturn step;\n\t}", "int getSeq();", "int getSeq();", "int getSeq();", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public String getTransseqnbr() {\n\t\treturn transseqnbr;\n\t}", "public long sequenceNumber() {\n return sequenceNumber;\n }", "public int getSeqNbr() {\n return seqNbr;\n }", "public int getStepNumber() {\n return stepNumber;\n }", "long getOriginseqnum();", "protected int getStep() {\n\t\treturn step;\n\t}", "long getSeq() {\n return seq;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public long getStartSeqNum() {\n return theStartSeqNum;\n }", "@Override\n public String getName() {\n return seqName;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public byte get_seqnum() {\n return (byte)getSIntElement(offsetBits_seqnum(), 8);\n }", "@Override\r\n\tpublic int getSeq() {\n\t\treturn pdsdao.getSeq();\r\n\t}", "public java.lang.String getSeq() {\n java.lang.Object ref = seq_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n seq_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "private long getSeqNum() throws Exception {\n\t\tSystem.out.println(\"seq: \" + seq);\n\t\tif (seq == 256) {\n\t\t\tseq = 0;\n\t\t}\n\t\treturn seq++;\n\t}", "public long getSequenceId()\n {\n return sequence_id_;\n }", "public int getStep() {\n return step;\n }", "public String nextStep();", "java.lang.String getSeq();", "public java.lang.String getSeq() {\n java.lang.Object ref = seq_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n seq_ = s;\n }\n return s;\n }\n }", "public String getSR_SEQ() {\n\t\treturn SR_SEQ;\n\t}", "public java.lang.String getScat_seq_num() {\n\t\treturn scat_seq_num;\n\t}", "public int getTakeupSeqNo() {\n\t\treturn takeupSeqNo;\n\t}", "public Number getSequenceNo() {\n return (Number)getAttributeInternal(SEQUENCENO);\n }", "public static int getCurrentStepNumber() {\n return threadStepNumber.get();\n }", "public String getPModIdseq() {\n return (String) getAttributeInternal(PMODIDSEQ);\n }", "public String getSequenceName() {\n return sequenceName;\n }", "public Integer getStep() {\n return step;\n }", "ViewCycleExecutionSequence getExecutionSequence();", "int getSequenceStepsCount();" ]
[ "0.6163025", "0.61345935", "0.611716", "0.6115748", "0.6084743", "0.6073154", "0.60389984", "0.60389984", "0.59672093", "0.59672093", "0.5962105", "0.5951037", "0.59399134", "0.59399134", "0.58849466", "0.5863822", "0.5834578", "0.58072996", "0.5789976", "0.578773", "0.5784223", "0.5780328", "0.5771436", "0.57609856", "0.57600206", "0.5749977", "0.5744276", "0.57441425", "0.57441425", "0.5726919", "0.5719509", "0.5717018", "0.57082266", "0.57082266", "0.57082266", "0.57082266", "0.57082266", "0.57082266", "0.57082266", "0.5703125", "0.5694366", "0.5694366", "0.5694366", "0.5688773", "0.5679167", "0.5679167", "0.5679167", "0.5679167", "0.5679167", "0.5679167", "0.5679167", "0.5673971", "0.5664734", "0.5664279", "0.5655982", "0.5655982", "0.5655982", "0.5645892", "0.5645892", "0.5645892", "0.5645892", "0.5645892", "0.5645892", "0.5645892", "0.5645806", "0.5643136", "0.5633331", "0.5627087", "0.56254226", "0.5622164", "0.5615598", "0.55740875", "0.55740875", "0.55740875", "0.5552526", "0.55499876", "0.55448705", "0.55448705", "0.55448705", "0.55411196", "0.5532028", "0.5528773", "0.5528738", "0.5526337", "0.55202764", "0.5515148", "0.5497228", "0.5490052", "0.5487672", "0.54812944", "0.54726535", "0.5456849", "0.54530054", "0.5450459", "0.5443236", "0.542836", "0.54280114", "0.5424561" ]
0.5956275
13
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.SEQ
public void setSeq(Integer seq) { this.seq = seq; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@IcalProperty(pindex = PropertyInfoIndex.SEQUENCE,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true\n )\n public void setSequence(final int val) {\n sequence = val;\n }", "void setSeq(long seq) {\n this.seq = seq;\n }", "public void setProcessstep(ItemI v) throws Exception{\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tif (v instanceof XFTItem)\n\t\t\t{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v,true);\n\t\t\t}else{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v.getItem(),true);\n\t\t\t}\n\t\t} catch (Exception e1) {logger.error(e1);throw e1;}\n\t}", "public void setSeqNo (int SeqNo);", "public void setSeqNo (int SeqNo);", "public void setSequenceNumber(int sequence) {\n\t\tfSequenceNumber= sequence;\n\t}", "public void setSEQN(String SEQN) {\n this.SEQN = SEQN;\n }", "public void setACTIVITY_SEQ_ID(Integer ACTIVITY_SEQ_ID) {\n this.ACTIVITY_SEQ_ID = ACTIVITY_SEQ_ID;\n }", "public void setSequence(Integer sequence) {\n this.sequence = sequence;\n }", "void setSequenceNumber(int sequenceNumber);", "public final void setSequence(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer sequence)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Sequence.toString(), sequence);\r\n\t}", "public final void setSequence(java.lang.Integer sequence)\r\n\t{\r\n\t\tsetSequence(getContext(), sequence);\r\n\t}", "public void setPModIdseq(String value) {\n setAttributeInternal(PMODIDSEQ, value);\n }", "public void setSequence(String sequence) {\r\n this.sequence = sequence;\r\n }", "public void set_seqnum(byte value) {\n setSIntElement(offsetBits_seqnum(), 8, value);\n }", "public final void setSequence(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String sequence)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Sequence.toString(), sequence);\r\n\t}", "public void setSeqNo (java.lang.Integer seqNo) {\n\t\tthis.seqNo = seqNo;\n\t}", "public void setStep(int step)\n {\n this.step = step;\n this.stepSpecified = true;\n }", "public void SetSequence(int Sequence, String ElementID){\n\t\t_TEST stack = new _TEST();\t\t\t\t\t\t\t\t /* TEST */\n\t\tstack.PrintHeader(ID,Sequence+\":int, \" + ElementID+\":String\",\"\");\t /* TEST */\n\t\tGENERATOR GEN_to_setsequence;\t\n\t\tGEN_to_setsequence = new GENERATOR(0,0,null);\t\t\t/* Temporalis valtozo */\n\t\tGetElementByID(GEN_to_setsequence.ID);\t\t\t\t\t/* GetElemetByIDvel megkapjuk, az objektumot\t*/\t\t\n\t\tGEN_to_setsequence.SetSequence(Sequence); \t\t\t\t /* az generator objektum SetSequence(...) metodusat meghivjuk */\n\t\tstack.PrintTail(ID,Sequence+\":int, \" + ElementID+\":String\",\"\");\t\t\t\t\t\t\t\t\t /* TEST */\n\t\n\t}", "public void setSequenceNo(long n) {\n\tsequenceNo = n;\n }", "public void setSequenceNumber(long value) {\n this.sequenceNumber = value;\n }", "public void setDeIdseq(String value) {\n setAttributeInternal(DEIDSEQ, value);\n }", "public void setItemSeq(Integer itemSeq) {\n this.itemSeq = itemSeq;\n }", "public void setSequenceNo(Number value) {\n setAttributeInternal(SEQUENCENO, value);\n }", "public Builder setSeq(int value) {\n\n seq_ = value;\n onChanged();\n return this;\n }", "public Builder setSeq(int value) {\n\n seq_ = value;\n onChanged();\n return this;\n }", "public void setSeqNbr(int seqNbr) {\n this.seqNbr = seqNbr;\n }", "public static void setSequence(Sequence m){\n\t\tcurMIDI = m;\n\t}", "public Builder setSeq(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000040;\n seq_ = value;\n onChanged();\n return this;\n }", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[23], value);\n this.taskId = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public String getSEQN() {\n return SEQN;\n }", "public void stepChanged(SequencerEvent<S,B> sequencerEvent);", "public void setSequenceId(long sequence_id)\n {\n sequence_id_ = sequence_id;\n }", "public final void setSequence(java.lang.String sequence)\r\n\t{\r\n\t\tsetSequence(getContext(), sequence);\r\n\t}", "public void setQcIdseq(String value) {\n setAttributeInternal(QCIDSEQ, value);\n }", "public void setStep(Integer step) {\n this.step = step;\n }", "public String getSequence()\r\n\t{\r\n\t\treturn sequence;\r\n\t}", "public String getSequence() {\r\n return sequence;\r\n }", "public void setSR_SEQ(String SR_SEQ) {\n\t\tthis.SR_SEQ = SR_SEQ == null ? null : SR_SEQ.trim();\n\t}", "public void testSetSequenceNumber() {\n System.out.println(\"setSequenceNumber\");\n \n long sequenceNumber = 0L;\n LocalFileState instance = new LocalFileState();\n \n instance.setSequenceNumber(sequenceNumber);\n \n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void setsalehdrseq(BigDecimal value) {\n setAttributeInternal(SALEHDRSEQ, value);\n }", "public void setEventSeq(String eventSeq) {\r\n\t\tthis.eventSeq = eventSeq;\r\n\t}", "public String getSequence() {\n\t\treturn sequence;\n\t}", "public String getSequence() {\n\t\treturn sequence;\n\t}", "public void setStep(int step) {\n\t\tthis.step = step;\n\t}", "public int getSequence() {\n return sequence;\n }", "public String getSequence()\n\t{\n\t\treturn this.sequence;\n\t}", "public String getSequence() \n\t{\n\t\treturn sequence;\n\t\t\n\t}", "protected void resetSequence() {\n doQuery(\"ALTER SEQUENCE feedentryqueue_id_seq RESTART\");\n }", "public long getSequenceNum() {\n return sequenceNum;\n }", "public int getStepId() {\n return stepId;\n }", "public void setStep(int step) {\n this.step = step;\n }", "public Integer getACTIVITY_SEQ_ID() {\n return ACTIVITY_SEQ_ID;\n }", "public int getSeq() {\n return seq_;\n }", "public int getSeq() {\n return seq_;\n }", "public int getSeq() {\n return seq_;\n }", "public int getSeq() {\n return seq_;\n }", "public Integer getSeq() {\n return seq;\n }", "public Integer getSeq() {\n return seq;\n }", "public Integer getSeq() {\n return seq;\n }", "public void setUserSeq(Long userSeq) {\n sessionData.setUserSeq(userSeq);\n }", "public void setConteIdseq(String value) {\n setAttributeInternal(CONTEIDSEQ, value);\n }", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[9], value);\n this.taskId = value;\n fieldSetFlags()[9] = true;\n return this;\n }", "public int getSequenceNum() {\n\t\treturn sequenceNumber;\n\t}", "public Integer getSequence()\n {\n return sequence;\n }", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000002;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000010;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000010;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public void setSequence(String seq) throws Exception {\n seq = seq.toUpperCase();\n seq = seq.trim();\n\n // Verify that the sequence does not contain invalid chars\n if (this.verifySequence(seq)) {\n this.sequence = seq;\n } else {\n throw new Exception(\"Invalid Sub Sequence\");\n }\n }", "public void setAD_Workflow_ID (int AD_Workflow_ID);", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000004;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000004;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000004;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public Builder setSeqnum(long value) {\n bitField0_ |= 0x00000004;\n seqnum_ = value;\n onChanged();\n return this;\n }", "public long getSeqNo() {\n return seqNo;\n }", "public Integer getSequence() {\n return sequence;\n }", "public long getSequenceNo() {\n\treturn sequenceNo;\n }", "public void setTakeupSeqNo(int takeupSeqNo) {\n\t\tthis.takeupSeqNo = takeupSeqNo;\n\t}", "public void setDisplaySequence(Integer value) {\n this.displaySequence = value;\n }", "public java.lang.Integer getSeqNo () {\n\t\treturn seqNo;\n\t}", "public void obtainStepsProcess(){\n String comp=\"\";\n int pos=0;\n int paso=0;\n for(String i:ejemplo.getCadena()){\n String[] pendExec= i.split(\"pend\");\n String last=\"\";\n if(!pendExec[0].equals(\"\"))\n last=pendExec[0].substring(pendExec[0].length()-1);\n if(!last.equals(comp)){\n stepProcess.put(pos, paso);\n pos++;\n comp=last;\n }\n paso++;\n }\n paso--;\n stepProcess.put(pos, paso);\n }", "public void setSteps(entity.LoadStep[] value);", "long getSequenceNum() {\n return sequenceNum;\n }", "public int getStepNumber() {\n return stepNumber;\n }", "public void setUserSeqNbr(Long userSeqNbr) \n\t{\n\t\tthis.userSeqNbr = userSeqNbr;\n\t}", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "public long getSeqnum() {\n return seqnum_;\n }", "@Override\n\tpublic Course updateExperimentSequence(int courseid, int experimentid, int seq) {\n\t\tCourse course = findById(courseid);\n\t\tif(course == null||course.getIsActive() == false)\n\t\t\treturn null;\n\t\tSet<CourseExperiment> ces= course.getCourseExperiment();\n\t\tIterator<CourseExperiment> i = ces.iterator();\n\t\twhile ( i.hasNext()) {\n\t\t\t\n\t\t\tCourseExperiment ce = i.next();\n\t\t\tif(ce.getExperiment().getId()==experimentid)\n\t\t\t\tce.setSequence(seq);\n\t\t\t\n\t\t}\n\t\treturn course;\n\t}", "public void setUserSeqNbr(Long userSeqNbr)\n\t{\n\t\tthis.userSeqNbr = userSeqNbr;\n\t}", "public void setOrderSeqNo(String orderSeqNo) {\n this.orderSeqNo = orderSeqNo;\n }", "public void setRouteStepKey(long value) {\n\t\tthis.routeStepKey = value;\n\t}", "public void setCardgroupSeq(String value) {\r\n setAttributeInternal(CARDGROUPSEQ, value);\r\n }", "public int getStep () {\n\t\treturn step_;\n\t}" ]
[ "0.63038856", "0.60247993", "0.5819558", "0.5797668", "0.5797668", "0.5785295", "0.57681453", "0.5750712", "0.5749563", "0.56875616", "0.56733155", "0.5628525", "0.5598982", "0.55967396", "0.5577912", "0.55091256", "0.5487879", "0.54620665", "0.5437616", "0.5421285", "0.539173", "0.5358018", "0.53328", "0.53044075", "0.53030145", "0.53030145", "0.5293937", "0.5267326", "0.5254599", "0.5250996", "0.5245464", "0.5219305", "0.521185", "0.5200966", "0.5180333", "0.5162536", "0.51509124", "0.5144046", "0.5141365", "0.5133267", "0.5118264", "0.5109078", "0.5106224", "0.5106224", "0.5100172", "0.50981754", "0.5078912", "0.50637406", "0.50533175", "0.5049155", "0.5028167", "0.50224215", "0.50141263", "0.5005791", "0.5005791", "0.5004021", "0.5004021", "0.49819368", "0.49819368", "0.49819368", "0.49703023", "0.49666032", "0.4962915", "0.4942872", "0.49392197", "0.49300918", "0.49144775", "0.49144775", "0.4913199", "0.48935035", "0.48911688", "0.48911688", "0.48911688", "0.48911688", "0.48870975", "0.4873098", "0.48645946", "0.48596686", "0.48574644", "0.48419142", "0.4827822", "0.48266098", "0.4815682", "0.479862", "0.47982183", "0.47950524", "0.47950524", "0.47950524", "0.47950524", "0.47950524", "0.47950524", "0.47950524", "0.47927353", "0.47833467", "0.47821864", "0.47799683", "0.4776463", "0.47742626" ]
0.6135455
3
This method was generated by Abator for iBATIS. This method returns the value of the database column HBDW1.EP_TASK_STEP.TASK_ID
public String getTaskId() { return taskId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getTaskID() {\n\t\treturn taskID;\n\t}", "public java.lang.Object getTaskID() {\n return taskID;\n }", "protected String getTaskId() {\n\t\tDisplay.debug(\"getTaskId() devuelve %s\", taskId);\n\t\treturn taskId;\n\t}", "public Integer getTaskId() {\n\t\treturn this.taskId;\n\t}", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "protected String getAppTaskID() {\r\n\t\treturn appTaskID;\r\n\t}", "public int getStepId() {\n return stepId;\n }", "public int getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n return this.taskId;\n }", "public String getTargetTaskID() {\n\t\treturn this.targetTaskId;\n\t}", "String getTaskId();", "public Integer getTaskId() {\n return taskId;\n }", "public Integer getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n Object ref = taskId_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskId_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "Object getTaskId();", "public String getTaskId() {\n Object ref = taskId_;\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 taskId_ = s;\n return s;\n }\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n\t\treturn taskId;\n\t}", "public int getTaskId() {\n return mTaskId;\n }", "public int getTaskType() {\n\t\treturn fieldTaskType;\n\t}", "public int getUpdatedTaskID(){\r\n int resultID;\r\n synchronized (lock) {\r\n ++baseTaskID;\r\n resultID = baseTaskID;\r\n //insert new parameters to paraList\r\n }\r\n return resultID;\r\n }", "public int getTaskIndex() {\n return (Integer) commandData.get(CommandProperties.TASK_ID);\n }", "String getProcessInstanceID();", "public String getTaskLineId() {\n return taskLineId;\n }", "long getWorkflowID();", "int getTask() {\n return task;\n }", "public com.google.protobuf.ByteString\n getTaskIdBytes() {\n Object ref = taskId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getSendTaskPartPkid() {\n return sendTaskPartPkid;\n }", "public int getAD_Workflow_ID();", "public String getRecvTaskPartPkid() {\n return recvTaskPartPkid;\n }", "public ProcessStep getProcessStepById(int processstepid) {\n\t\tthis.em = EMF.createEntityManager();\r\n\t\t\r\n\t\tList<ProcessStep> content = new ArrayList<ProcessStep>();\r\n\t\tQuery query = em.createQuery(Constants.PROCESSSTEP_ID);\r\n\t\tquery.setParameter(\"processstepid\", processstepid);\r\n\t\tcontent = query.getResultList();\r\n\t\tSystem.out.println(content.get(0));\r\n\t\treturn content.get(0);\r\n\r\n\t}", "public com.google.protobuf.ByteString\n getTaskIdBytes() {\n Object ref = taskId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "com.google.protobuf.ByteString\n getTaskIdBytes();", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public int getTestCaseStepRunId() {\n return testCaseStepRunId;\n }", "public String getOrginTaskID() {\n\t\treturn orginTaskID;\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Define the identifier for the task.\")\n @JsonProperty(JSON_PROPERTY_ID)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public String getId() {\n return id;\n }", "public static int getLatestTaskId() {\n\n int id = 0;\n try {\n List<Task> list = Task.listAll(Task.class);\n int size = list.size();\n Task task = list.get(size - 1);\n id = task.getTaskId();\n\n } catch (Exception e) {\n id=0;\n }\n return id;\n\n }", "net.zyuiop.ovhapi.api.objects.license.Task getServiceNameTasksTaskId(java.lang.String serviceName, long taskId) throws java.io.IOException;", "public String getREF_TASK_CD() {\n return REF_TASK_CD;\n }", "public int getMaxIdTask()\n {\n SQLiteDatabase db = this.getReadableDatabase();\n \n String query = \"SELECT MAX(id) AS max_id FROM \" + TASK_TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n int id = 0; \n if (cursor.moveToFirst())\n {\n do\n { \n id = cursor.getInt(0); \n } while(cursor.moveToNext()); \n }\n \n return id;\n }", "public void setTaskID(java.lang.Object taskID) {\n this.taskID = taskID;\n }", "public String getTaskName(){\r\n\t\treturn this.taskName;\r\n\t}", "@ApiModelProperty(\n example = \"00000000-0000-0000-0000-000000000000\",\n value = \"Identifier of the task that time entry is logged against.\")\n /**\n * Identifier of the task that time entry is logged against.\n *\n * @return taskId UUID\n */\n public UUID getTaskId() {\n return taskId;\n }", "public String taskName() {\n return this.taskName;\n }", "public int getCustTask()\n\t{\n\t\treturn task;\n\t}", "public static TaskProperty getTaskProperty(String sortField) {\r\n TaskProperty taskProperty = TaskProperty.ID;\r\n if (sortField != null) {\r\n taskProperty = TaskProperty.valueOf(sortField);\r\n }\r\n return taskProperty;\r\n }", "public String getTask(){\n\treturn task;\n}", "public Long getCourseTaskId() {\n return courseTaskId;\n }", "public Task getTask(Integer tid);", "public ITask getTask() {\n \t\treturn task;\n \t}", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getTaskType() {\n return taskType;\n }", "String getTaskId(int index);", "public long getStepNumber() {\n return schedule.getSteps();\n }", "private String getTaskName() {\n \n \t\treturn this.environment.getTaskName() + \" (\" + (this.environment.getIndexInSubtaskGroup() + 1) + \"/\"\n \t\t\t+ this.environment.getCurrentNumberOfSubtasks() + \")\";\n \t}", "public String getTaskName() {\n Object ref = taskName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskName_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "@Override\n public String toString() {\n return \"Task no \"+id ;\n }", "public String getTaskUnit() {\n\t\treturn taskUnit;\n\t}", "public String getempID() {\n\t\treturn _empID;\n\t}", "@Override\n public String getTaskType() {\n return this.taskType;\n }", "public String getInspectionTaskCode() {\n return inspectionTaskCode;\n }", "public String getTaskName() {\n return this.taskDescription;\n }", "public String getTaskName() {\n Object ref = taskName_;\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 taskName_ = s;\n return s;\n }\n }", "public String getTaskClass() {\n\t\treturn this.taskClass;\n\t}", "public static int getCurrentStepNumber() {\n return threadStepNumber.get();\n }", "private int getEmployeeId() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tint employeeId1 = 0;\r\n\t\tString sql = \"SELECT Patient_Id_Sequence.NEXTVAL FROM DUAL\";\r\n\t\ttry {\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(sql);\r\n\t\t\tResultSet res = pstmt.executeQuery();\r\n\t\t\tif (res.next()) {\r\n\t\t\t\temployeeId1 = res.getInt(1);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"error while fetching data from database\");\r\n\t\t}\r\n\t\treturn employeeId1;\r\n\r\n\t}", "public TaskType getTaskType() {\n return taskType;\n }", "String getExecRefId();", "public String getTaskId(int index) {\n return taskId_.get(index);\n }", "public String getTaskId(int index) {\n return taskId_.get(index);\n }", "public TaskName getTaskName() {\n return this.taskName;\n }", "public String getTaskName();", "@Override\n\tpublic String getTaskElementName() {\n\t\treturn null;\n\t}", "public String getProcessID()\n {\n return processID;\n }", "String getExecId();", "String getTaskName();", "String getTaskName();", "private String getCorrelationIdFromTask(String TaskContext) {\n String msgContext = TaskContext.substring(TaskContext.indexOf(\":\") + 1);\n logger.debug(String.format(\"msgContext: %s\", msgContext));\n Map msgMap = JSONObjectUtil.toObject(msgContext, LinkedHashMap.class);\n return (String) msgMap.get(ID);\n }", "public String getTestExecutionId() {\n return this.testExecutionId;\n }", "public int getPlanner_ID() {\n\t\tInteger ii = (Integer) get_Value(\"Planner_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "java.lang.String getSetupID();", "public Long getTaskVariantId() {\n return taskVariantId;\n }", "public String get_task_title()\n {\n return task_title;\n }", "java.lang.String getProcessId();", "@Override\n public String getInputParameter(String task) {\n try {\n Set<IInputParameter> inputParameters = dataAccessTosca.getInputParametersByTask(task);\n JSONArray response = new JSONArray();\n if (inputParameters != null) {\n for (IInputParameter input : inputParameters) {\n JSONObject i = new JSONObject();\n i.put(\"id\", input.getId());\n i.put(\"label\", input.getLabel());\n i.put(\"value\", input.getValue());\n i.put(\"tiid\", task);\n response.add(i);\n }\n return response.toString();\n }\n return null;\n\n } catch (DatabaseException e) {\n e.printStackTrace();\n }\n return null;\n }", "String getID(String pid) {\n try {\n Cursor cursor = selectTable(makeMax(TableColumn.ChecklistTable.CID), makeCondition(TableColumn.ChecklistTable.PID, pid));\n cursor.moveToFirst();\n String id = cursor.getString(0);\n cursor.close();\n return id;\n } catch (SQLiteException sql_ex) {\n Log.e(\"SQL\", sql_ex.toString());\n } catch (CursorIndexOutOfBoundsException cur_ex) {\n Log.e(\"SQL\", cur_ex.toString());\n }\n return null;\n }", "public long getProcessID() {\n return processID;\n }", "@Override\n\tpublic long getEmpId() {\n\t\treturn _employee.getEmpId();\n\t}", "public java.lang.String getProcessDefinitionId() {\n return processDefinitionId;\n }" ]
[ "0.71781564", "0.695765", "0.66316676", "0.6512879", "0.64751637", "0.64746296", "0.6384174", "0.63747287", "0.6359147", "0.6327324", "0.6306503", "0.6286572", "0.6286572", "0.62860936", "0.62671936", "0.6246808", "0.62092066", "0.62092066", "0.6208054", "0.6208054", "0.61795235", "0.61787575", "0.6175502", "0.6166564", "0.6152092", "0.6147684", "0.6111358", "0.60233414", "0.6017037", "0.5881547", "0.58708286", "0.5849818", "0.5835622", "0.5822277", "0.58072525", "0.58034825", "0.57771736", "0.57771736", "0.57612795", "0.57568854", "0.5672002", "0.56641614", "0.5652469", "0.5647284", "0.56417215", "0.5636742", "0.55896616", "0.55866367", "0.5573811", "0.55674094", "0.555024", "0.54900885", "0.54708266", "0.5455197", "0.54474074", "0.5444539", "0.5444539", "0.5444539", "0.5444539", "0.54405206", "0.54405206", "0.54260844", "0.5423725", "0.5401459", "0.5385133", "0.53786343", "0.5375604", "0.53751904", "0.5346094", "0.53190607", "0.53154945", "0.5311444", "0.5298133", "0.5289504", "0.52781284", "0.52647287", "0.5255806", "0.525085", "0.524983", "0.5249053", "0.5233114", "0.5225716", "0.5202022", "0.5197565", "0.51821244", "0.5181002", "0.5181002", "0.517944", "0.5166566", "0.5165927", "0.51527894", "0.51502615", "0.51482916", "0.51479447", "0.51399523", "0.513965", "0.51356983", "0.5128097", "0.5126402" ]
0.616223
25
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.TASK_ID
public void setTaskId(String taskId) { this.taskId = taskId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTaskID(java.lang.Object taskID) {\n this.taskID = taskID;\n }", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[23], value);\n this.taskId = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public void setTask(Task inTask){\n punchTask = inTask;\n }", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[9], value);\n this.taskId = value;\n fieldSetFlags()[9] = true;\n return this;\n }", "public int getTaskID() {\n\t\treturn taskID;\n\t}", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "public void setTaskId(Integer taskId) {\n this.taskId = taskId;\n }", "public void setTaskId(Integer taskId) {\n this.taskId = taskId;\n }", "public void setTaskId(Integer taskId) {\n\t\tthis.taskId = taskId;\n\t}", "public void setAD_Workflow_ID (int AD_Workflow_ID);", "public void setTaskType(int taskType) throws java.beans.PropertyVetoException {\n\t\tif (fieldTaskType != taskType) {\n\t\t\tint oldValue = fieldTaskType;\n\t\t\tfireVetoableChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t\tfieldTaskType = taskType;\n\t\t\tfirePropertyChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t}\n\t}", "public void setTaskId(String taskId) {\r\n\t\tthis.taskId=taskId;\r\n\t}", "public java.lang.Object getTaskID() {\n return taskID;\n }", "public void setProcessstep(ItemI v) throws Exception{\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tif (v instanceof XFTItem)\n\t\t\t{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v,true);\n\t\t\t}else{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v.getItem(),true);\n\t\t\t}\n\t\t} catch (Exception e1) {logger.error(e1);throw e1;}\n\t}", "public void setTaskId(UUID taskId) {\n this.taskId = taskId;\n }", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "public void editTask(String newTask) {\n task = newTask;\n }", "public void setTask(Task task) {\n this.task = task;\n }", "public int getStepId() {\n return stepId;\n }", "public String getTaskId() {\n return this.taskId;\n }", "public void setStepId(int stepId) {\n this.stepId = stepId;\n }", "protected String getAppTaskID() {\r\n\t\treturn appTaskID;\r\n\t}", "public Builder setTaskId(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n taskId_ = value;\n onChanged();\n return this;\n }", "protected void f_set(Long eID, int flowValue) {\n\t\tincreaseAccess(); // Zugriff auf den Graphen\n\t\tgraph.setValE(eID, flowAttr, flowValue);\n\t}", "public void updateTask(int tid,String title,String detail,int money,String type,int total_num,int current_num,Timestamp start_time,Timestamp end_time,String state);", "public Integer getTaskId() {\n\t\treturn this.taskId;\n\t}", "public int getTaskId() {\n return taskId;\n }", "public void setTaskInstance(Task taskInstance) {\n\t\tthis.taskInstance = taskInstance;\n\t}", "public void setTaskClass(String taskClass) {\n\t\tthis.taskClass = taskClass;\n\t}", "TaskResponse updateTask(TaskRequest taskRequest, Long taskId);", "public void setTaskCompleted(TaskAttemptID taskID) {\n taskStatuses.get(taskID).setState(TaskStatus.SUCCEEDED);\n successfulTaskID = taskID;\n activeTasks.remove(taskID);\n }", "public int getUpdatedTaskID(){\r\n int resultID;\r\n synchronized (lock) {\r\n ++baseTaskID;\r\n resultID = baseTaskID;\r\n //insert new parameters to paraList\r\n }\r\n return resultID;\r\n }", "public String getTaskLineId() {\n return taskLineId;\n }", "public String getTaskId() {\n\t\treturn taskId;\n\t}", "public Integer getTaskId() {\n return taskId;\n }", "public Integer getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n return taskId;\n }", "public int updateTask(Task task) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_TASKNAME, task.getTaskName());\n values.put(KEY_STATUS, task.getStatus());\n values.put(KEY_DATE,task.getDateAt());\n\n // updating row\n return db.update(TABLE_TASKS, values, KEY_ID + \" = ?\",\n new String[] { String.valueOf(task.getId()) });\n }", "public void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);", "public void setTaskData(String mID) throws IOException\n\t{\n\t\ttry\n\t\t{\n\t\t\ttCollect = new TaskCollection(mID, ConnectionManager.getInstance().currentSensor(0).getSerialNumber());\n\t\t\t\n\t\t\tif (tCollect.getMeasTask().isEmpty())\n\t\t\t{\n\t\t\t\tmeasurTaskText.setText(\" \");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < tCollect.getMeasTask().size(); i++)\n\t\t\t\t{\n\t\t\t\t\tmeasurTaskText.setText(tCollect.getMeasTask().get(i).getTaskDetails());\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif (!sensorTaskText.equals(\"\"))\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < tCollect.getSensorTask().size(); i++)\n\t\t\t\t{\n\t\t\t\t\tsensorTaskText.setText(tCollect.getSensorTask().get(i).getTaskDetails());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (SensorNotFoundException e)\n\t\t{\n\t\t\tstatusBar.setText(e.getMessage());\n\t\t}\n\t}", "public void updateTask(Task task){//needs to depend on row num\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_ID,task.getId());\n values.put(KEY_LABEL,task.getLabel());\n values.put(KEY_TIME, task.getTime());\n db.update(TABLE_NAME, values, KEY_ID+\" = ?\",\n new String[] { String.valueOf(task.getId()) });\n }", "@Test\n public void updateCompletedAndGetById() {\n mDatabase.taskDao().insertTask(TASK);\n\n // When the task is updated\n mDatabase.taskDao().updateCompleted(TASK.getId(), false);\n\n // When getting the task by id from the database\n Task loaded = mDatabase.taskDao().getTaskById(\"id\");\n\n // The loaded data contains the expected values\n assertTask(loaded, TASK.getId(), TASK.getTitle(), TASK.getDescription(), false);\n }", "public void updateToDone(int _id) {\n\n ContentValues values = new ContentValues();\n String date = DateFormat.getDateInstance().format(new Date());\n\n values.put(\"dateDone\", date);\n values.put(\"done\", 1);\n\n getWritableDatabase().update(\"tasks\", values, \"_id = '\"+_id+\"'\", null);\n }", "public void seti_ordertrx_temp_ID (int i_ordertrx_temp_ID);", "public void assignTask(String employee, String taskName) {\n \tSystem.out.println(\"Inside assignDeadline()\");\n \t//Task t = new Task();\n \tint count = 0;\n \tfor(Task task : toDoList) {\n \t\tif(task.getTaskName().equals(taskName)) {\n \t\t\t//t = task;\n \t\t\ttask.setEmployee(employee);\n \t\t\ttoDoList.set(count, task);\n \t\t}\n \t\tcount++;\n \t}\n \tSystem.out.println(\"Task Assigned to Employee Sucessfully\");\n \t\n \tdisplay();\n }", "public Builder setTaskId(\n int index, String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureTaskIdIsMutable();\n taskId_.set(index, value);\n onChanged();\n return this;\n }", "public void testCmdUpdate_taskID_field() {\n\t\t// Initialize test variables\n\t\tCommandAction expectedCA;\n\t\tList<Task> expectedTaskList;\n\n\t\t/*\n\t\t * Test 1: Testing ID field\n\t\t */\n\t\tctf.initialize();\n\t\texpectedTaskList = null;\n\n\t\t// Test 1a: ID is null\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, null);\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKIDNOTFOUND, INVALID_TASKID), false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 1b: ID is invalid\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, INVALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKIDNOTFOUND, INVALID_TASKID), false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 1c: ID is valid, but not in list\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, VALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKIDNOTFOUND, VALID_TASKID), false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 1d: ID is valid and is in list, but not update changes\n\t\taddNewTask(TASK_NAME_1);\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, VALID_TASKID + \"\");\n\t\texpectedCA = new CommandAction(MSG_TASKNOUPDATE, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t}", "public int getTaskId() {\n return mTaskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public void setTaskLineId(String taskLineId) {\n this.taskLineId = taskLineId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public void setM_MovementConfirm_ID (int M_MovementConfirm_ID);", "boolean setTask(UUID uuid, IAnimeTask task);", "int insertDptTask(DptTaskInfo dptTaskInfo);", "public void populateTaskList(String _task){\n\t\ttaskList.getItems().add(_task);\n\t}", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public void startTask(Long taskId, String userId) {\n TaskServiceSession taskSession = null;\n try {\n taskSession = taskService.createSession();\n Task taskObj = taskSession.getTask(taskId);\n int sessionId = taskObj.getTaskData().getProcessSessionId();\n \n taskSession.taskOperation(Operation.Start, taskId, userId, null, null, null);\n eventSupport.fireTaskStarted(taskId, userId);\n }catch(Exception x) {\n throw new RuntimeException(\"startTask\", x);\n }finally {\n if(taskSession != null)\n taskSession.dispose();\n }\n }", "public void seteDeptid(Integer eDeptid) {\n this.eDeptid = eDeptid;\n }", "public void setREF_TASK_CD( String rEF_TASK_CD ) {\n REF_TASK_CD = rEF_TASK_CD;\n }", "public void setParameters(String taskID, String taskName, String startTime, String endTime, String priority) {\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ID, taskID);\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_SNAME, taskName);\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_STARTTIME, startTime);\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_ENDTIME, endTime);\n\t\t_testCmdUpdate.setParameter(CmdParameters.PARAM_NAME_TASK_PRIORITY, priority);\n\t}", "public String getTargetTaskID() {\n\t\treturn this.targetTaskId;\n\t}", "public Builder setTaskIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n taskId_ = value;\n onChanged();\n return this;\n }", "public CompletionStage<Result> updateTaskBegin(long id, long taskId, String newDate) {\n\t\treturn null;\n\t}", "@Transactional( WorkflowPlugin.BEAN_TRANSACTION_MANAGER )\n void removeByIdTask( int nIdTask );", "protected String getTaskId() {\n\t\tDisplay.debug(\"getTaskId() devuelve %s\", taskId);\n\t\treturn taskId;\n\t}", "public void setTaskUnit(String taskUnit) {\n\t\tthis.taskUnit = taskUnit;\n\t}", "public void setupTask(TaskAttemptContext context) throws IOException {\n }", "public void setTask(PickingRequest task) {\n this.task = task;\n }", "@Override\r\n\tpublic void save(ExecuteTask executeTask) {\n\t\tString sql = \"INSERT INTO executetask(et_member_id,et_task_id,et_comments) VALUES(?,?,?)\";\r\n\t\tupdate(sql,executeTask.getMemberId(),executeTask.getTaskId(),executeTask.getComments());\r\n\t}", "public void setId(VfeWorkflowsAdpId id) { this.id = id; }", "public void setCurrentTaskName(String name);", "int getTask() {\n return task;\n }", "public String getSendTaskPartPkid() {\n return sendTaskPartPkid;\n }", "public int getTaskType() {\n\t\treturn fieldTaskType;\n\t}", "private void setEmployeeID() {\n try {\n employeeID = userModel.getEmployeeID(Main.getCurrentUser());\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Test\n public void updateTaskAndGetById() {\n mDatabase.taskDao().insertTask(TASK);\n\n // When the task is updated\n Task updatedTask = new Task(\"title2\", \"description2\", \"id\", true);\n mDatabase.taskDao().updateTask(updatedTask);\n\n // When getting the task by id from the database\n Task loaded = mDatabase.taskDao().getTaskById(\"id\");\n\n // The loaded data contains the expected values\n assertTask(loaded, \"id\", \"title2\", \"description2\", true);\n }", "private void setProcessId(int value) {\n\t\tthis.processId = value;\n\t}", "public int getTestCaseStepRunId() {\n return testCaseStepRunId;\n }", "protected void setupTask(Task task) {\n }", "@Override\r\n\tpublic void deleteByTask(int taskId) {\n\t\tString sql = \"DELETE FROM executetask WHERE et_task_id = ?\";\r\n\t\tupdate(sql,taskId);\r\n\t}", "public abstract void setProcessID(long pid);", "@Override\r\n\tpublic void setTaskPanel(BackOfficePanel panel) {\n\t\ttaskPanel = (TaskPanel) panel;\r\n\t}", "public void setTaskName(String taskName) {\r\n\t\tthis.taskName=taskName;\r\n\t}", "@Override\n public void onEditStep(String step, int step_id) {\n\n Intent updateDB = new Intent(this, UpdateStepsService.class);\n updateDB.putExtra(UpdateStepsService.INSTR_KEY, step);\n updateDB.putExtra(UpdateStepsService.STEP_ID_KEY, step_id);\n updateDB.putExtra(UpdateStepsService.ACTION_KEY, UpdateStepsService.Action.UPDATE);\n startService(updateDB);\n\n }", "public void setTimeStep(TimeStep timeStep) throws java.beans.PropertyVetoException {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(timeStep);\n\t\tif (!Matchable.areEqual(timeStep, fieldTimeStep)) {\n\t\t\tTimeStep oldValue = fieldTimeStep;\n\t\t\tfireVetoableChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t\tfieldTimeStep = timeStep;\n\t\t\tfirePropertyChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t}\n\t}", "public void setSendTaskPartPkid(String sendTaskPartPkid) {\n this.sendTaskPartPkid = sendTaskPartPkid == null ? null : sendTaskPartPkid.trim();\n }", "String getTaskId();", "@Override\r\n\tpublic void update(ExecuteTask executeTask) {\n\t\tString sql = \"UPDATE executetask SET et_comments = ? WHERE et_id = ?\";\r\n\t\tupdate(sql,executeTask.getComments(),executeTask.getId());\r\n\t}", "void onStartEditTask(String taskId) {\n mNavigationProvider.startActivityForResultWithExtra(AddEditTaskActivity.class,\n TaskDetailActivity.REQUEST_EDIT_TASK, AddEditTaskFragment.ARGUMENT_EDIT_TASK_ID,\n taskId);\n }", "public static void setIDt(int IDt) {\n Componente.IDt = IDt;\n }", "private TasksLists setTaskDone(ITaskCluster taskCluster, ICommonTask task, Object taskServiceResult) {\n return nextTasks(taskCluster, task, taskServiceResult);\n }", "private Integer saveTask(Integer taskid,String taskname,String tasktype,String taskcontent,\r\n\t\t\tString taskcomment){\n\t\treturn 1;\r\n\t}", "public void setOrginTaskID(String orginTaskID) {\n\t\tthis.orginTaskID = orginTaskID;\n\t}", "public void setTaskEstimatedEffort(java.lang.Integer taskEstimatedEffort) {\n this.taskEstimatedEffort = taskEstimatedEffort;\n }", "public String getTaskId() {\n Object ref = taskId_;\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 taskId_ = s;\n return s;\n }\n }", "@Override\n public void saveTask(TaskEntity task) {\n this.save(task);\n }", "Object getTaskId();" ]
[ "0.673461", "0.63079375", "0.6125364", "0.6110067", "0.60714877", "0.5916321", "0.5905261", "0.5905261", "0.58749086", "0.5859388", "0.58017474", "0.5798568", "0.57771885", "0.57388365", "0.5721332", "0.56442803", "0.55897135", "0.55859244", "0.5577226", "0.5536555", "0.55316305", "0.5494464", "0.5487084", "0.5464172", "0.54151446", "0.5332773", "0.53213465", "0.5302929", "0.5284877", "0.5272153", "0.52556986", "0.5226707", "0.5204778", "0.5194367", "0.5187397", "0.5187397", "0.51832044", "0.51832044", "0.5164505", "0.5152754", "0.51518726", "0.51293325", "0.51167965", "0.5105733", "0.509972", "0.5072879", "0.5069963", "0.50660926", "0.5062617", "0.50600934", "0.50600934", "0.50600296", "0.5052546", "0.5052546", "0.50496614", "0.50467515", "0.50372726", "0.50308776", "0.50273395", "0.5022074", "0.50203496", "0.50195485", "0.5016688", "0.501438", "0.50120187", "0.5003053", "0.49958706", "0.49941325", "0.49853066", "0.4979883", "0.4978843", "0.49777672", "0.49752972", "0.49741757", "0.49706405", "0.49688724", "0.49676514", "0.49607784", "0.49356863", "0.49331522", "0.49319395", "0.49283364", "0.49268055", "0.492637", "0.49225047", "0.49207476", "0.49179664", "0.49078688", "0.48996684", "0.48958182", "0.4859354", "0.48586643", "0.48566946", "0.48544884", "0.4852566", "0.48523968", "0.48519272", "0.4840174", "0.48399344" ]
0.55357987
21
This method was generated by Abator for iBATIS. This method returns the value of the database column HBDW1.EP_TASK_STEP.NOTE
public String getNote() { return note; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNote() {\n if (MetadataUGWD_Type.featOkTst && ((MetadataUGWD_Type)jcasType).casFeat_note == null)\n jcasType.jcas.throwFeatMissing(\"note\", \"de.aitools.ie.uima.type.argumentation.MetadataUGWD\");\n return jcasType.ll_cas.ll_getStringValue(addr, ((MetadataUGWD_Type)jcasType).casFeatCode_note);}", "public String getNote() {\n\t\treturn _note;\n\t}", "public String getNote()\n {\n return note;\n }", "public String getNote() {\n\t\treturn note;\n\t}", "public String getNote() {\r\n return note;\r\n }", "public String getNote() {\r\n return note;\r\n }", "public String getNote()\n\t{\n\t\treturn note;\n\t}", "public String getNote(){\r\n\t\treturn note;\r\n\t}", "public String getEventNote() {\r\n\t\treturn eventNote;\r\n\t}", "public String getNote() {\r\n return note; \r\n }", "public String getStepDescription()\r\n\t{\r\n\t\treturn stepDescription;\r\n\t}", "public Note getNote() {\n\t \n\t //returns the objected stored in the note field\n\t return this.note;\n }", "@Import(\"notedTemplate\")\n\tint getNote();", "public java.lang.String getStepDescription() {\n return stepDescription;\n }", "public String get_task_description()\n {\n return task_description;\n }", "String getNotesArgument() throws Exception {\n String output = \"\";\n String line = this.readLine().trim();\n\n while (!line.contains(\"[/event]\")) {\n output += line;\n line = this.readLine().trim();\n }\n\n return output;\n }", "String get_note()\n {\n return note;\n }", "public Double getNote()\r\n {\r\n return note;\r\n }", "public String getDocumentNote();", "public String getSerialisedToDo() {\n\t\tString placeholder = \"placeholder\";\n\t\treturn placeholder;\n\t}", "public String getREF_TASK_CD() {\n return REF_TASK_CD;\n }", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "@JsonProperty(\"note\")\n\tpublic String getNote() {\n\t\treturn note;\n\t}", "@AutoEscape\n\tpublic String getNote();", "public int getNoteType() {\n return noteType;\n }", "public String getTODO_ALERT() {\r\n return TODO_ALERT;\r\n }", "public String getInfo()\r\n\t{\r\n\t\treturn theItem.getNote();\r\n\t}", "public String getDescription()\r\n {\r\n return \"Approver of the task \"+taskName();\r\n }", "public java.lang.String getNotes()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NOTES$14, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public void setNote(String note) {\r\n this.note = note;\r\n }", "public String getTaskName() {\n return this.taskDescription;\n }", "public void setNote(String note) {\n this.note = note;\n }", "public void setNote(String note) {\n this.note = note;\n }", "public void setNote(String note) {\n this.note = note;\n }", "public void setNote(String note) {\n this.note = note;\n }", "public void setNote(String note) {\n this.note = note;\n }", "public void setNote(String note) {\n\t\tthis.note = note;\n\t}", "public void setNote(String note) {\r\n\r\n this.note = note;\r\n }", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "public String getTask(){\n\treturn task;\n}", "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public int getStepId() {\n return stepId;\n }", "protected String getTaskId() {\n\t\tDisplay.debug(\"getTaskId() devuelve %s\", taskId);\n\t\treturn taskId;\n\t}", "public void setNote(String note) {\r\n this.note = note; \r\n }", "public String getTaskId() {\n return this.taskId;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "public void setNote(String note) {\n\t\tthis._note = note;\n\t}", "public String getLineRemark() {\n return lineRemark;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "@DISPID(35)\r\n\t// = 0x23. The runtime will prefer the VTID if present\r\n\t@VTID(34)\r\n\tasci.activebatch.enumJobFlags jobStepsToDo();", "public Element getStepExpression() {\n\t\treturn stepExpression;\n\t}", "public Number getWorkflowNotificationId() {\r\n return (Number) getAttributeInternal(WORKFLOWNOTIFICATIONID);\r\n }", "public double getNoteEquilibre() {\n\t\treturn noteEquilibre;\n\t}", "public java.lang.String getStudent_note() {\n\t\treturn _primarySchoolStudent.getStudent_note();\n\t}", "public String updateTaskToFile() {\n String updatedText = Messages.EMPTY_STRING;\n for (int i = 0; i < Parser.getOrderAdded(); i++) {\n updatedText = updatedText.concat(recordedTask.get(i).getCurrentTaskType()\n + Messages.SEPARATOR + recordedTask.get(i).taskStatus()\n + Messages.SEPARATOR + recordedTask.get(i).getTaskName()) + Messages.NEW_LINE;\n }\n return updatedText;\n }", "public String getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n return taskId;\n }", "public int getStep () {\n\t\treturn step_;\n\t}", "@Override\n public String toString()\n {\n\n // IF TASK IS MARKED AS COMPLETE\n if(task_completion_boolean)\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return \"*** \" + String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return \"*** \" + String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END if\n\n /***********************************************************/\n\n // OTHERWISE, TASK IS NOT COMPLETE\n else\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END else\n\n }", "public long getStepNumber() {\n return schedule.getSteps();\n }", "public java.lang.String getStepStatus() {\n return stepStatus;\n }", "public String get_task_title()\n {\n return task_title;\n }", "public static String getInstruction() {\n return \"Adds a todo task to the tasks list\\n\"\n + \"Format: todo [desc]\\n\"\n + \"desc: The description of the todo task\\n\";\n }", "@Override\n\tpublic TextNote getTextNote(TextNote note) {\n\t\tif (note == null) return note;\n\t\t\n\t\tList<TextNote> noteList = repository.findAll();\n\t\tint listIndex = noteList.indexOf(note);\n\t\treturn noteList.get(listIndex);\n\t}", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public String getGoodsNote() {\n return goodsNote;\n }", "public String getTaskId() {\n Object ref = taskId_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskId_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public java.lang.Object getTaskID() {\n return taskID;\n }", "public int getStep() {\n\t\treturn step;\n\t}", "public String getStepDisplayName()\r\n\t{\r\n\t\treturn stepDisplayName;\r\n\t}", "public java.lang.String getStepName() {\n return stepName;\n }", "public static int getNote(MidiMessage mes){\r\n\t\tif (!(mes instanceof ShortMessage))\r\n\t\t\treturn 0;\r\n\t\tShortMessage mes2 = (ShortMessage) mes;\r\n\t\tif (mes2.getCommand() != ShortMessage.NOTE_ON)\r\n\t\t\treturn 0;\t\r\n\t\tif (mes2.getData2() ==0) return -mes2.getData1();\r\n\t\treturn mes2.getData1();\r\n\t}", "public int getStepNumber() {\n return stepNumber;\n }", "protected int getStep() {\n\t\treturn step;\n\t}", "public String getRecvTaskPartPkid() {\n return recvTaskPartPkid;\n }", "public Point getNotePoint() {\r\n\t\tif (rect != null) {\r\n\t\t\treturn new Point((int) rect.getX(), (int) rect.getY());\r\n\t\t} else {\r\n\t\t\treturn new Point(0, 0);\r\n\t\t}\r\n\t}", "public String getToolremark() {\r\n return toolremark;\r\n }", "public String getTaskId() {\n\t\treturn taskId;\n\t}", "public int getTaskType() {\n\t\treturn fieldTaskType;\n\t}", "@Override\n public String getPresentationDetails(String task) {\n try {\n ITaskInstance taskInstance = dataAccessTosca.getTaskInstance(task);\n if (taskInstance != null) {\n JSONObject presentation = new JSONObject();\n presentation.put(\"title\", taskInstance.getPresentationName());\n presentation.put(\"subject\", taskInstance.getPresentationSubject());\n presentation.put(\"description\", taskInstance.getPresentationDescription());\n return presentation.toString();\n }\n } catch (DatabaseException e) {\n e.printStackTrace();\n }\n return null;\n }", "public StoryNoteStatus getStoryNoteStatus()\r\n\t{\r\n\t\treturn storyNoteStatus;\r\n\t}", "@Override\n\tpublic String getDesignation() {\n\t\treturn \"NOTE \";\n\t}", "int getTask() {\n return task;\n }", "public String getTaskId() {\n Object ref = taskId_;\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 taskId_ = s;\n return s;\n }\n }", "public int getTaskID() {\n\t\treturn taskID;\n\t}" ]
[ "0.6287588", "0.61887777", "0.6170853", "0.6164881", "0.6135436", "0.6135436", "0.6122525", "0.6109995", "0.6074176", "0.6044632", "0.60122985", "0.5828486", "0.5828326", "0.5773857", "0.56810945", "0.56602055", "0.5635947", "0.55245596", "0.5447528", "0.5438537", "0.54300565", "0.54047614", "0.54047614", "0.54025936", "0.5341645", "0.53396666", "0.5323492", "0.53214216", "0.53191805", "0.5290886", "0.5267651", "0.52659863", "0.5243928", "0.5243928", "0.5243928", "0.5243928", "0.5243928", "0.5211976", "0.5210167", "0.52079254", "0.52012926", "0.5177872", "0.5147284", "0.51370496", "0.51330143", "0.5123703", "0.5117536", "0.5117536", "0.5117513", "0.5104177", "0.50994694", "0.5089314", "0.5089314", "0.50739926", "0.5065422", "0.50652516", "0.5059526", "0.5057862", "0.50564367", "0.5054984", "0.5054984", "0.50509363", "0.50504977", "0.50427943", "0.5039378", "0.50380117", "0.50361913", "0.5026176", "0.5025691", "0.5025691", "0.5025408", "0.50209874", "0.5015681", "0.50112534", "0.5010912", "0.5009123", "0.50003225", "0.49982074", "0.49979317", "0.4996681", "0.49940783", "0.49918604", "0.4988191", "0.49833363", "0.49694818", "0.4968601", "0.49634507", "0.49632525", "0.49518538", "0.49463448" ]
0.6097361
16
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.NOTE
public void setNote(String note) { this.note = note; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setNote() {\n\t\tNoteOpt.add(\"-nd\");\n\t\tNoteOpt.add(\"/nd\");\n\t\tNoteOpt.add(\"notedetails\");\n\n\t}", "public void setNote(String note) {\r\n\r\n this.note = note;\r\n }", "public void setNote(String note) {\r\n this.note = note; \r\n }", "public void setNote(String note) {\r\n this.note = note;\r\n }", "public void setNote(String note) {\n if(note==null){\n note=\"\";\n }\n this.note = note;\n }", "public void setNote(String note);", "public void setNote(String note) {\n\t\tthis._note = note;\n\t}", "public void setNote(String note) {\n\t\tthis.note = note;\n\t}", "void setNote(int note) {\n\t\tthis.note = note;\n\t}", "public final void setNote(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String note)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Note.toString(), note);\r\n\t}", "public void setProcessstep(ItemI v) throws Exception{\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tif (v instanceof XFTItem)\n\t\t\t{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v,true);\n\t\t\t}else{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v.getItem(),true);\n\t\t\t}\n\t\t} catch (Exception e1) {logger.error(e1);throw e1;}\n\t}", "public void setEventNote(String eventNote) {\r\n\t\tthis.eventNote = eventNote;\r\n\t}", "public final void setNote(java.lang.String note)\r\n\t{\r\n\t\tsetNote(getContext(), note);\r\n\t}", "public void setFinalNote(Note note) {\n\t\tif(notes==null)\n\t\t\treturn;\n\t\tnotes.put(note, Idea.NON_PROMPT_NOTE);\n\t\t\n\t\tthis.finalNote = note;\n\t}", "public void setNote( final Double note )\r\n {\r\n this.note = note;\r\n }", "public void setNote(Note newNote) {\n\t \n\t //stores newNote in the note field\n\t this.note = newNote;\n }", "public void setNote(String note) {\r\n this.note = note == null ? null : note.trim();\r\n }", "public void setDocumentNote (String DocumentNote);", "public void setNote(int note)\r\n {\r\n if (note >= 1 && note <= 5)\r\n this.note = note;\r\n else\r\n System.out.println(\"ungültige Note\");\r\n }", "public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }", "public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }", "public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }", "public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }", "public void setTask(Task inTask){\n punchTask = inTask;\n }", "public void setNote(Note note) {\n this.note = note;\n\n noteContent.setText(note.getNoteText().toString());\n noteContent.setPromptText(\"Enter note here.\");\n }", "public void editTask(String newTask) {\n task = newTask;\n }", "public AddressEntry setNote(String note){\r\n\t\tthis.note=note;\r\n\t\treturn this;\r\n\t}", "public String getNote(){\r\n\t\treturn note;\r\n\t}", "public String getNote()\n {\n return note;\n }", "public void setStep(int step)\n {\n this.step = step;\n this.stepSpecified = true;\n }", "public String getNote() {\r\n return note;\r\n }", "public String getNote() {\r\n return note;\r\n }", "public String getStepDescription()\r\n\t{\r\n\t\treturn stepDescription;\r\n\t}", "@Override\n\tpublic void setNote(java.lang.String note) {\n\t\t_esfShooterAffiliationChrono.setNote(note);\n\t}", "public String getNote() {\n\t\treturn note;\n\t}", "public String getNote() {\r\n return note; \r\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n return note;\n }", "public String getNote() {\n\t\treturn _note;\n\t}", "public void setThenote(String thenote) {\n this.thenote = thenote;\n }", "public void edit_task_description(String description)\n {\n task_description = description;\n }", "public String getNote()\n\t{\n\t\treturn note;\n\t}", "protected void addNotePropertyDescriptor(Object object) {\n itemPropertyDescriptors.add\n (createItemPropertyDescriptor\n (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n getResourceLocator(),\n getString(\"_UI_ProceedingsType_note_feature\"),\n getString(\"_UI_PropertyDescriptor_description\", \"_UI_ProceedingsType_note_feature\", \"_UI_ProceedingsType_type\"),\n BibtexmlPackage.Literals.PROCEEDINGS_TYPE__NOTE,\n true,\n false,\n false,\n ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n null,\n null));\n }", "protected void editNote()\n\t{\n\t\tActivity rootActivity = process_.getRootActivity();\n\t\tActivityPanel rootActivityPanel = processPanel_.getChecklistPanel().getActivityPanel(rootActivity);\n\t\tActivityNoteDialog activityNoteDialog = new ActivityNoteDialog(rootActivityPanel);\n\t\tint dialogResult = activityNoteDialog.open();\n\t\tif (dialogResult == SWT.OK) {\n\t\t\t// Store the previous notes to determine below what note icon to use\n\t\t\tString previousNotes = rootActivity.getNotes();\n\t\t\t// If the new note is not empty, add it to the activity notes\n\t\t\tif (activityNoteDialog.getNewNote().trim().length() > 0)\n\t\t\t{\n\t\t\t\t// Get the current time\n\t\t\t\tString timeStamp = new SimpleDateFormat(\"d MMM yyyy HH:mm\").format(Calendar.getInstance().getTime());\n\t\t\t\t// Add the new notes (with time stamp) to the activity's notes.\n\t\t\t\t//TODO: The notes are currently a single String. Consider using some more sophisticated\n\t\t\t\t// data structure. E.g., the notes for an activity can be a List of Note objects. \n\t\t\t\trootActivity.setNotes(rootActivity.getNotes() + timeStamp + \n\t\t\t\t\t\t\" (\" + ActivityPanel.AGENT_NAME + \"):\\t\" + activityNoteDialog.getNewNote().trim() + \"\\n\");\n\t\t\t}\n\t\t\t\n\t\t\t// Determine whether the note icon should change.\n\t\t\tif (previousNotes.trim().isEmpty())\n\t\t\t{\n\t\t\t\t// There were no previous notes, but now there are -- switch to image of note with text \n\t\t\t\tif (!rootActivity.getNotes().trim().isEmpty())\n\t\t\t\t\tactivityNoteButton_.setCurrentImage(noteWithTextImage_);\n\t\t\t}\n\t\t\telse // There were previous notes, but now there aren't -- switch to blank note image\n\t\t\t\tif (rootActivity.getNotes().trim().isEmpty())\n\t\t\t\t\tactivityNoteButton_.setCurrentImage(noteWithoutTextImage_);\n\t\t\t// END of determine whether the note icon should change\n\t\t\t\n\t\t\t// Set the tooltip text of the activityNoteButton_ to the current notes associated with the activity. \n\t\t\tactivityNoteButton_.setToolTipText(rootActivity.getNotes());\n\t\t\t\n\t\t\tprocessHeaderComposite_.redraw();\t// Need to redraw the activityNoteButton_ since its image changed.\n\t\t\t// We redraw the entire activity panel, because redrawing just the activityNoteButton_ \n\t\t\t// causes it to have different background color from the activity panel's background color\n\t\t\tSystem.out.println(\"Activity Note is \\\"\" + rootActivity.getNotes() + \"\\\".\");\n\t\t}\n\t}", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[23], value);\n this.taskId = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public void setNotes(java.lang.String notes)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NOTES$14, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NOTES$14);\n }\n target.setStringValue(notes);\n }\n }", "public void setStepDescription(String stepDescription)\r\n\t{\r\n\t\tthis.stepDescription = stepDescription;\r\n\t}", "public void addNote(Note note) {\n\t\tthis.notes.put(note,Idea.NON_PROMPT_NOTE);\n\t}", "public void updateTask(int tid,String title,String detail,int money,String type,int total_num,int current_num,Timestamp start_time,Timestamp end_time,String state);", "public void setNoteType(int value) {\n this.noteType = value;\n }", "public void setNote(String v) {\n if (MetadataUGWD_Type.featOkTst && ((MetadataUGWD_Type)jcasType).casFeat_note == null)\n jcasType.jcas.throwFeatMissing(\"note\", \"de.aitools.ie.uima.type.argumentation.MetadataUGWD\");\n jcasType.ll_cas.ll_setStringValue(addr, ((MetadataUGWD_Type)jcasType).casFeatCode_note, v);}", "@Test//ExSkip\n public void fieldNoteRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create a bookmark with a footnote that the NOTEREF field will reference.\n insertBookmarkWithFootnote(builder, \"MyBookmark1\", \"Contents of MyBookmark1\", \"Footnote from MyBookmark1\");\n\n // This NOTEREF field will display the number of the footnote inside the referenced bookmark.\n // Setting the InsertHyperlink property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word.\n Assert.assertEquals(\" NOTEREF MyBookmark2 \\\\h\",\n insertFieldNoteRef(builder, \"MyBookmark2\", true, false, false, \"Hyperlink to Bookmark2, with footnote number \").getFieldCode());\n\n // When using the \\p flag, after the footnote number, the field also displays the bookmark's position relative to the field.\n // Bookmark1 is above this field and contains footnote number 1, so the result will be \"1 above\" on update.\n Assert.assertEquals(\" NOTEREF MyBookmark1 \\\\h \\\\p\",\n insertFieldNoteRef(builder, \"MyBookmark1\", true, true, false, \"Bookmark1, with footnote number \").getFieldCode());\n\n // Bookmark2 is below this field and contains footnote number 2, so the field will display \"2 below\".\n // The \\f flag makes the number 2 appear in the same format as the footnote number label in the actual text.\n Assert.assertEquals(\" NOTEREF MyBookmark2 \\\\h \\\\p \\\\f\",\n insertFieldNoteRef(builder, \"MyBookmark2\", true, true, true, \"Bookmark2, with footnote number \").getFieldCode());\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n insertBookmarkWithFootnote(builder, \"MyBookmark2\", \"Contents of MyBookmark2\", \"Footnote from MyBookmark2\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.NOTEREF.docx\");\n testNoteRef(new Document(getArtifactsDir() + \"Field.NOTEREF.docx\")); //ExSkip\n }", "public void addNote(Note note) throws ChangeVetoException;", "public void setBBSStepContent(BBSStep itsStep,BBSStep itsParentBBSStep) {\n \n if(itsStep != null && itsParentBBSStep == null){\n //modify a step\n fillBBSGui(itsStep);\n stepExplorerStepNameText.setEditable(false);\n itsBBSStep = itsStep;\n this.stepExplorerRevertButton.setEnabled(true);\n \n }else if(itsStep == null && itsParentBBSStep != null){\n //creating a new step under a given parent step\n this.itsParentBBSStep = itsParentBBSStep;\n //fill the GUI with the current values of the parent in which the\n //new step will be situated to ease data entry...\n fillBBSGui(itsParentBBSStep);\n stepExplorerStepNameText.setText(\"\");\n \n this.stepExplorerRevertButton.setEnabled(false);\n \n }else if (itsStep ==null && itsParentBBSStep == null){\n //assume a new strategy step will be generated\n this.stepExplorerRevertButton.setEnabled(false);\n }\n }", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "public void setStep(Integer step) {\n this.step = step;\n }", "public void setTimeStep(TimeStep timeStep) throws java.beans.PropertyVetoException {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(timeStep);\n\t\tif (!Matchable.areEqual(timeStep, fieldTimeStep)) {\n\t\t\tTimeStep oldValue = fieldTimeStep;\n\t\t\tfireVetoableChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t\tfieldTimeStep = timeStep;\n\t\t\tfirePropertyChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t}\n\t}", "public void setStep(int step) {\n\t\tthis.step = step;\n\t}", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "public String getNote() {\n if (MetadataUGWD_Type.featOkTst && ((MetadataUGWD_Type)jcasType).casFeat_note == null)\n jcasType.jcas.throwFeatMissing(\"note\", \"de.aitools.ie.uima.type.argumentation.MetadataUGWD\");\n return jcasType.ll_cas.ll_getStringValue(addr, ((MetadataUGWD_Type)jcasType).casFeatCode_note);}", "public String getEventNote() {\r\n\t\treturn eventNote;\r\n\t}", "public void setStep(int step) {\n this.step = step;\n }", "public java.lang.String getStepDescription() {\n return stepDescription;\n }", "@DISPID(35)\r\n\t// = 0x23. The runtime will prefer the VTID if present\r\n\t@VTID(34)\r\n\tasci.activebatch.enumJobFlags jobStepsToDo();", "public void setStepDescription(java.lang.String stepDescription) {\n this.stepDescription = stepDescription;\n }", "public void setStep(double step) {\n\t\tthis.step = step;\n\t}", "@Override\r\n\tpublic void update(ExecuteTask executeTask) {\n\t\tString sql = \"UPDATE executetask SET et_comments = ? WHERE et_id = ?\";\r\n\t\tupdate(sql,executeTask.getComments(),executeTask.getId());\r\n\t}", "@Generated(hash = 1549336661)\n public void setNoteBK(NoteBK noteBK) {\n synchronized (this) {\n this.noteBK = noteBK;\n NoteBK_ID = noteBK == null ? null : noteBK.get_ID();\n noteBK__resolvedKey = NoteBK_ID;\n }\n }", "public void setInferenceStepInformation(IWInferenceStepOccur infStep)\n\t{\n\t\tIWInferenceRule rule = null;\n\t\tIWIdentifiedThing engine = null;\n\n\t\tif (infStep != null) \n\t\t{\n\t\t\trule = infStep.getHasInferenceRule();\n\t\t\tengine = (IWIdentifiedThing)PMLObjectManager.getPMLObject(infStep.getPropertyObjectByLocalName(PMLJ.hasInferenceEngine_lname));\n\n\t\t\t//using rule....\n\t\t\tif (rule != null)\n\t\t\t{\n\t\t\t\tString[] ruleRes = getProvenanceInfo(rule);\n\t\t\t\tdeclarativeRule = ruleRes[0];\n\t\t\t\tdecRuleURI = ruleRes[1];\n\t\t\t}\n\n\t\t\t//inferred by inference engine....\n\t\t\tif (engine != null)\n\t\t\t{\n\t\t\t\tString[] engineRes = getProvenanceInfo(engine);\n\t\t\t\tinferenceEngine = engineRes[0];\n\t\t\t\tinfEngURI = engineRes[1];\n\t\t\t}\n\n\t\t\t//sets Antecedent URI and Raw string information\n\t\t\tsetAntecedentInformation(infStep);\n\n\n\t\t\t//Metadata\n\n\t\t\t//Assertions\n\t\t}\n\t}", "TaskDetail(int setTask, Integer setDescription, boolean isBasicControl, boolean canRepeat) {\n task = setTask;\n description = setDescription;\n basicControl = isBasicControl;\n canBeRepeated = canRepeat;\n }", "public void setTask(Task task) {\n this.task = task;\n }", "@Override\r\n\tpublic void setTaskPanel(BackOfficePanel panel) {\n\t\ttaskPanel = (TaskPanel) panel;\r\n\t}", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[9], value);\n this.taskId = value;\n fieldSetFlags()[9] = true;\n return this;\n }", "@Override\n public void onClick(Step selectedStepItem) {\n parent.setSelectedStepNumber(selectedStepItem.getId());\n Timber.d(selectedStepItem.getDescription());\n }", "public int getStepId() {\n return stepId;\n }", "public InfoLiveTollsStepDefinition() {\n\t\tsuper();\n\t}", "public void setTaskType(int taskType) throws java.beans.PropertyVetoException {\n\t\tif (fieldTaskType != taskType) {\n\t\t\tint oldValue = fieldTaskType;\n\t\t\tfireVetoableChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t\tfieldTaskType = taskType;\n\t\t\tfirePropertyChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t}\n\t}", "public static int updateStep(int b_ref, int b_step) {\n\t\t\r\n\t\tSqlSession session = factory.openSession(true);\r\n\t\tHashMap<String, Integer> map = new HashMap<String, Integer>();\r\n\t\tmap.put(\"b_ref\", b_ref);\r\n\t\tmap.put(\"b_step\", b_step);\r\n\t\tint re = session.update(\"board.updateStep\", map);\r\n\t\tsession.close();\r\n\t\treturn re;\r\n\t}", "public String editTask(TasksModel obj)\n\t{\n\t\tString memo=\"\"; \n\t\tif(obj.getMemo()!=null)\n\t\t{\n\t\t\tmemo=obj.getMemo().replaceAll(\"'\",\"`\");\n\t\t}\n\t\tobj.setMemo(memo);\n\t\t\n\t\tString commnets=\"\"; \n\t\tif(obj.getComments()!=null)\n\t\t{\n\t\t\tcommnets=obj.getComments().replaceAll(\"'\",\"`\");\n\t\t}\n\t\tobj.setComments(commnets);\n\t\t\t\n\t\tString stepsToReproduce=\"\"; \n\t\tif(obj.getTaskStep()!=null)\n\t\t{\n\t\t\tstepsToReproduce=obj.getTaskStep().replaceAll(\"'\",\"`\");\n\t\t}\n\t\tobj.setTaskStep(stepsToReproduce);\n\t\tquery=new StringBuffer();\n\t\tquery.append(\"Update tasks set customerType='\"+obj.getClientType()+\"',taskNo='\"+obj.getTaskNumber()+\"',tasktype=\"+obj.getTaskTypeId()+\",expectedDateTofinsh='\"+sdf.format(obj.getExpectedDatetofinish())+\"',reminderDate='\"+sdf.format(obj.getReminderDate())+\"',toBeReminderIn=\"+obj.getRemindIn()+\",taskName='\"+obj.getTaskName()+\"',steps='\"+obj.getTaskStep()+\"',linkid=\"+obj.getPrviousTaskLinkId()+\",customerrefKey=\"+obj.getCustomerRefKey()+\",\");\t\n\t\tquery.append(\"projectrefKey=\"+obj.getProjectKey()+\",servicerefKey=\"+obj.getSreviceId()+\",assignedUser=\"+obj.getEmployeeid()+\",ccemployeeKey=\"+obj.getCcEmployeeKey()+\",priorityrefKey=\"+obj.getPriorityRefKey()+\",estTime=\"+obj.getEstimatatedNumber()+\",memo='\"+obj.getMemo()+\"',actualTime=\"+obj.getActualNumber()+\",status=\"+obj.getStatusKey()+\",usercomments='\"+obj.getComments()+\"',hourOrDays='\"+obj.getHoursOrDays()+\"' where taskID=\"+obj.getTaskid()+\"\");\n\t\tquery.append(\" \");\n\t\treturn query.toString();\n\t}", "void onEditTaskComplete(String name, String notes, int position);", "@Override\n public void setNote(int row, int col, int number) {\n boolean[] notes = grid.getNotes(row, col);\n\n // toggle the note in the model\n if (notes[number]) {\n grid.removeNote(row, col, number);\n\n } else {\n grid.setNote(row, col, number);\n }\n\n // toggle the note in the view\n view.toggleNote(row, col, number);\n }", "public void setNotes(com.sforce.soap.enterprise.QueryResult notes) {\r\n this.notes = notes;\r\n }", "public void setTaskId(String taskId) {\r\n\t\tthis.taskId=taskId;\r\n\t}", "@Override\r\n public void save(DiagramTask task)\r\n {\r\n try\r\n {\r\n TASK_DAO.addTask(task);\r\n addMessage(\"Success!\", \"Task added correctly.\");\r\n \r\n }\r\n catch (HibernateException e)\r\n {\r\n addMessage(\"Error!\", \"Please try again.\");\r\n Logger.getLogger(DiagramTaskBean.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n\r\n }", "public void setGoodsNote(String goodsNote) {\n this.goodsNote = goodsNote;\n }", "protected void setHasNote(boolean b) {\n\t\tthis.hasNote = true;\n\t}", "public void setAD_Workflow_ID (int AD_Workflow_ID);" ]
[ "0.5794336", "0.5779322", "0.5774259", "0.57518846", "0.5680649", "0.56667507", "0.56557304", "0.56430894", "0.5634972", "0.55397385", "0.5518551", "0.5517401", "0.5492773", "0.5488075", "0.5486525", "0.5474958", "0.54049206", "0.5398609", "0.5387275", "0.5384179", "0.5384179", "0.5384179", "0.5384179", "0.527907", "0.5277084", "0.5210378", "0.51732486", "0.51540875", "0.5130618", "0.5127168", "0.51169866", "0.51169866", "0.51107883", "0.5097092", "0.5092126", "0.507144", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5054846", "0.5049847", "0.5031315", "0.502584", "0.5025767", "0.50221217", "0.5003188", "0.500038", "0.49905097", "0.49790716", "0.4966758", "0.4961983", "0.49375284", "0.492503", "0.48938495", "0.48910278", "0.48854265", "0.48795322", "0.48686576", "0.48596883", "0.48520982", "0.48464057", "0.48311177", "0.48262957", "0.4787688", "0.47813648", "0.47544637", "0.47481823", "0.47323918", "0.47178954", "0.47045267", "0.47035506", "0.46947426", "0.46780133", "0.46727556", "0.4670315", "0.46670172", "0.466585", "0.46656805", "0.4664787", "0.46637636", "0.46603528", "0.4637999", "0.4635478", "0.46342054", "0.4623663", "0.4616663", "0.46158066", "0.46134102", "0.46124235" ]
0.5652711
10
This method was generated by Abator for iBATIS. This method returns the value of the database column HBDW1.EP_TASK_STEP.DEVICE_TYPE
public String getDeviceType() { return deviceType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDevice_type() {\r\n\t\treturn device_type;\r\n\t}", "public com.sforce.soap._2006._04.metadata.DeviceType getDeviceType() {\r\n return deviceType;\r\n }", "public final String getDeviceType(){\n return TYPE;\n }", "public short getDeviceType() {\r\n return deviceType;\r\n }", "@Override\n public String getDeviceTypeId() {\n \n return this.strTypId;\n }", "public DeviceOptionType getType();", "public Optional<DeviceType> getDeviceType() throws IllegalArgumentException{\n this.deviceTypeDropDown.getValue();\n return DeviceType.typeOf(this.deviceTypeDropDown.getText());\n }", "@Override\n\tpublic List<String> getSensorType(String deviceType) {\n\t\treturn null;\n\t}", "public TaskType getTaskType() {\n return (TaskType) commandData.get(CommandProperties.TASK_TYPE);\n }", "public void setDeviceType(String deviceType) {\n this.deviceType = deviceType;\n }", "java.lang.String getMachineType();", "public String getType() {\n return theTaskType ;\n }", "public int getTaskType() {\n\t\treturn fieldTaskType;\n\t}", "public String getTaskType() {\n return taskType;\n }", "DeviceClass getDeviceClass();", "public String deviceType(){\n String deviceType;\n size = driver.manage().window().getSize();\n if((size.getHeight()>800)&&(size.getWidth()>500)){\n return deviceType = \"iPad\";\n } else {\n return deviceType = \"iPhone\";\n }\n }", "public SmartDevice getDevice(String type) {\n\t\treturn null;\n\t}", "public TaskType getTaskType() {\n return taskType;\n }", "public com.flexnet.opsembedded.webservices.DeviceMachineTypeQueryType getMachineType() {\n return machineType;\n }", "public byte getBDeviceClass() {\r\n\t\treturn bDeviceClass;\r\n\t}", "public int getDtdSpecType() {\n return getDtdSpecType(0);\n }", "public String getProductInstallType();", "@Override\n public String getTaskType() {\n return this.taskType;\n }", "public DeviceClass getDeviceClass() {\n return this.bluetoothStack.getLocalDeviceClass();\n }", "@DISPID(47)\r\n\t// = 0x2f. The runtime will prefer the VTID if present\r\n\t@VTID(52)\r\n\tasci.activebatch.enumJobTypeEx type();", "MachineType getType();", "public String getDeviceId() {\n String info = \"\";\n try {\n Uri queryurl = Uri.parse(REGINFO_URL + CHUNLEI_ID);\n ContentResolver resolver = mContext.getContentResolver();\n info = resolver.getType(queryurl);\n if (null == info && null != mContext) {\n info = getIMEI();\n }\n if (null == info) {\n info = \"\";\n }\n } catch (Exception e) {\n System.out.println(\"in or out strean exception\");\n }\n return info;\n }", "public String getTYPE() {\n return TYPE;\n }", "public void setDeviceType(com.sforce.soap._2006._04.metadata.DeviceType deviceType) {\r\n this.deviceType = deviceType;\r\n }", "@Override\n\tpublic String getRunType() {\n\t\treturn model.getRunType();\n\t}", "public String getDataType()\n {\n String v = (String)this.getFieldValue(FLD_dataType);\n return StringTools.trim(v);\n }", "public boolean isDeviceTypeFieldPresent() {\r\n\t\treturn isElementPresent(addVehiclesHeader.replace(\"Add Vehicle\", \"Select Device Type\"), SHORTWAIT);\r\n\t}", "public Integer getSensorType() {\n return sensorType;\n }", "@Test\n public void getDeviceTypeTest() throws ApiException {\n String deviceTypeId = null;\n // DeviceTypeEnvelope response = api.getDeviceType(deviceTypeId);\n\n // TODO: test validations\n }", "public com.flexnet.opsembedded.webservices.SimpleQueryType getDeviceId() {\n return deviceId;\n }", "public String getTaskType() { return \"?\"; }", "public DriveType getDriveType() {\n return driveType;\n }", "public String getMovementType() {\n\t\treturn (String) get_Value(\"MovementType\");\n\t}", "public DataType getType() {\n return type;\n }", "public Type getType() {\n return this.te.getType();\n }", "@ApiModelProperty(example = \"null\", value = \"The fully qualified type of the reporting task.\")\n public String getType() {\n return type;\n }", "public String getMptType() {\n return mptType;\n }", "public int getType() {\n validify();\n return Client.INSTANCE.pieceGetType(ptr);\n }", "public String getType() {\n\t\treturn String.valueOf(this.pieceType);\n\t}", "x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType.Enum getProductType();", "@Override\n public Class<TblscreenTestOptionRecord> getRecordType() {\n return TblscreenTestOptionRecord.class;\n }", "public String getFileSystemType() {\n return this.fileSystemType;\n }", "public short getType() {\n\t\treturn type;\n\t}", "String getTYPE() {\n return TYPE;\n }", "public String getrType() {\n return rType;\n }", "@Override\r\n\tpublic String getCpDeviceTypeName() {\r\n\t\treturn \"TAPE\";\r\n\t}", "public String getPartitionTypeAsString() {\n\t\tString type = null;\n\t\t\n\t\tswitch (partitionType) {\n\t\tcase FOLDER:\n\t\t\ttype = \"Folder\";\n\t\t\tbreak;\n\t\tcase DOCUMENT:\n\t\t\ttype = \"Document\";\n\t\t\tbreak;\n\t\tcase NOT_SET:\n\t\t\ttype = \"Document\";\n\t\t\tbreak;\n\t\tcase ROOT:\n\t\t\ttype = \"Document\";\n\t\t\tbreak;\n\t\tcase SECTION:\n\t\t\ttype = \"Section\";\n\t\t\tbreak;\n\t\tcase TASK:\n\t\t\ttype = \"Task\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn type;\n\t}", "public String getType()\r\n {\r\n return type;\r\n }", "public MachineType getMachineType() {\n return machineType;\n }", "public int getType() {\r\n return typ;\r\n }", "@Override\n\tpublic DataType getDataType() {\n\t\tif (dataType == null) {\n\t\t\tdataType = getDataType(getProgram());\n\t\t}\n\t\treturn dataType;\n\t}", "public String obtenirType() {\n\t\treturn this.type;\n\t}", "public Class dataType() {\n return this.dataType;\n }", "String getDeptType();", "DType getType();", "public char getType() {\r\n return type;\r\n }", "public static String getDeviceType(Context c) {\r\n\t\tUiModeManager uiModeManager = (UiModeManager) c.getSystemService(Context.UI_MODE_SERVICE);\r\n\t\tint modeType = uiModeManager.getCurrentModeType();\r\n\t\tswitch (modeType){\r\n\t\t\tcase Configuration.UI_MODE_TYPE_TELEVISION:\r\n\t\t\t\treturn \"TELEVISION\";\r\n\t\t\tcase Configuration.UI_MODE_TYPE_WATCH:\r\n\t\t\t\treturn \"WATCH\";\r\n\t\t\tcase Configuration.UI_MODE_TYPE_NORMAL:\r\n\t\t\t\tString type = isTablet(c) ? \"TABLET\" : \"PHONE\";\r\n\t\t\t\treturn type;\r\n\t\t\tcase Configuration.UI_MODE_TYPE_UNDEFINED:\r\n\t\t\t\treturn \"UNKOWN\";\r\n\t\t\tdefault:\r\n\t\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public FactType getFactType() {\r\n\t\treturn factType;\r\n\t}", "public String getDataType() \n {\n System.out.println(dataType.getValue().toString());\n return dataType.getValue().toString(); \n }", "public String getSystemType() {\n \t\treturn fSystemType;\n \t}", "@Override\n\tpublic String getDiType() {\n\t\treturn App.ATZGB_DI_TYPE;\n\t}", "public String getLBR_MDFeDocType();", "public byte getType() {\n return this.type;\n }", "public int getType()\r\n {\r\n return type;\r\n }", "public String get_type()\r\n\t{\r\n\t\treturn this.type;\r\n\t}", "public String getFieldType()\n {\n return m_strFieldType;\n }", "public String getType()\r\n\t{\r\n\t\treturn type;\r\n\t}", "@Override\n\tpublic java.lang.Class<com.cellarhq.generated.tables.records.CellaredDrinkRecord> getRecordType() {\n\t\treturn com.cellarhq.generated.tables.records.CellaredDrinkRecord.class;\n\t}", "public String getType() {\r\n return type;\r\n }", "public String getType() {\r\n return type;\r\n }", "public String getType() {\r\n return type;\r\n }", "public String getType() {\r\n return type;\r\n }", "public String getType() {\r\n return type;\r\n }", "public String getType() {\r\n return type;\r\n }", "public char getType() {\n return type;\n }", "public char getType() {\n return type;\n }", "public int getType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TYPE$2);\n if (target == null)\n {\n return 0;\n }\n return target.getIntValue();\n }\n }", "public String getType()\n {\n return type;\n }", "public String getType()\n {\n return type;\n }", "public String getType()\n {\n return type;\n }", "public String getType()\n {\n return type;\n }", "public String getType()\n {\n return type;\n }", "public String getType()\n {\n return type;\n }", "public String getType()\n {\n return type;\n }", "public ch.crif_online.www.webservices.crifsoapservice.v1_00.DebtType.Enum getDebtType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEBTTYPE$10, 0);\n if (target == null)\n {\n return null;\n }\n return (ch.crif_online.www.webservices.crifsoapservice.v1_00.DebtType.Enum)target.getEnumValue();\n }\n }", "@Override\n public Class<GetexamreceiptdeptlistRecord> getRecordType() {\n return GetexamreceiptdeptlistRecord.class;\n }", "@Generated\n @Selector(\"diagnosisReportType\")\n public native int diagnosisReportType();", "public int getType() {\r\n return type;\r\n }", "public int getType() {\r\n return type;\r\n }", "public int getType() {\r\n return type;\r\n }", "public gov.weather.graphical.xml.dwmlgen.schema.dwml_xsd.FeatureTypeType.Enum getFeatureType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FEATURETYPE$4, 0);\n if (target == null)\n {\n return null;\n }\n return (gov.weather.graphical.xml.dwmlgen.schema.dwml_xsd.FeatureTypeType.Enum)target.getEnumValue();\n }\n }", "public int getType()\n {\n return type;\n }", "public int getType()\n {\n return type;\n }", "public String getType () {\n return type;\n }", "public String getType () {\n return type;\n }" ]
[ "0.6766659", "0.6415194", "0.6291429", "0.62376285", "0.62083", "0.6112842", "0.5998445", "0.5738795", "0.5722361", "0.56612396", "0.5621414", "0.5601041", "0.5589278", "0.5587965", "0.5546086", "0.5461208", "0.54545045", "0.53811383", "0.534959", "0.5310168", "0.53093773", "0.52477926", "0.52448577", "0.51880324", "0.5164748", "0.51594657", "0.5157475", "0.5147541", "0.5144151", "0.5141339", "0.51379263", "0.51172864", "0.5110265", "0.5099918", "0.50929356", "0.5087468", "0.5081351", "0.50554353", "0.5051993", "0.5051637", "0.5049513", "0.5034929", "0.50276434", "0.50180984", "0.49964857", "0.4985994", "0.4983581", "0.49667484", "0.49650398", "0.4960962", "0.49583197", "0.4952157", "0.49509984", "0.49355698", "0.49350047", "0.49346128", "0.4934106", "0.49327162", "0.49307746", "0.4923845", "0.49205846", "0.49203107", "0.4913076", "0.49109882", "0.4910409", "0.4910376", "0.49089903", "0.49045834", "0.49044973", "0.49013114", "0.4899533", "0.48892942", "0.4887078", "0.4882607", "0.48817003", "0.48817003", "0.48817003", "0.48817003", "0.48817003", "0.48798156", "0.48798156", "0.4878417", "0.4872645", "0.4872645", "0.4872645", "0.4872645", "0.4872645", "0.4872645", "0.48708674", "0.48692054", "0.48689985", "0.4868484", "0.4868431", "0.4868431", "0.4868431", "0.48681262", "0.48674467", "0.48674467", "0.48667777", "0.48667777" ]
0.6600651
1