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 |
---|---|---|---|---|---|---|
Handle navigation view item clicks here. | @SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
Intent intent = new Intent(getApplicationContext(), Grafico.class);
if (id == R.id.llamadas) {
intent.putExtra("opcion", "llamadas");
startActivity(intent);
} else if (id == R.id.salientes) {
intent.putExtra("opcion", "salientes");
startActivity(intent);
} else if (id == R.id.entrantes) {
intent.putExtra("opcion", "entrantes");
startActivity(intent);
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }",
"void onDialogNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }",
"@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }",
"@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}",
"@Override\n public void OnItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}",
"@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}",
"@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }",
"@Override\n public void onItemClick(int pos) {\n }",
"@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }",
"private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }",
"void onMenuItemClicked();",
"@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }",
"@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}",
"@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}",
"@Override\n public void onItemClick(View view, String data) {\n }",
"abstract public void onSingleItemClick(View view);",
"@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }",
"@Override\n public void itemClick(int pos) {\n }",
"@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }",
"@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}",
"@Override\n public void onItemClick(Nson parent, View view, int position) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }",
"@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }",
"@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}",
"public void onItemClick(View view, int position);",
"@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }",
"@Override\n public void onItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}",
"@Override\n public void onItemClick(View view, int position) {\n }",
"@Override\n public void onItemClick(View view, int position) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }",
"@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}",
"@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }",
"@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}",
"void onLinkClicked(@Nullable ContentId itemId);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }",
"void onItemClick(View view, int position);",
"@Override\n public void onClick(View v) {\n startNavigation();\n }",
"void onItemClick(int position);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}",
"@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }",
"void clickItem(int uid);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(View view, int position) {\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }",
"public void onItemClick(View view, int position) {\n\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}",
"@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}",
"void onClick(View item, View widget, int position, int which);",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void menuClicked(MenuItem menuItemSelected);",
"@Override\n public void onItemClick(int position) {\n }",
"@Override\n public void onItemClick(int position) {\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}"
] | [
"0.7882029",
"0.7235578",
"0.6987005",
"0.69458413",
"0.6917864",
"0.6917864",
"0.6883472",
"0.6875181",
"0.68681556",
"0.6766498",
"0.67418456",
"0.67207",
"0.6716157",
"0.6713947",
"0.6698189",
"0.66980195",
"0.66793925",
"0.66624063",
"0.66595167",
"0.6646381",
"0.6641224",
"0.66243863",
"0.6624042",
"0.66207093",
"0.6602551",
"0.6602231",
"0.6599443",
"0.65987265",
"0.65935796",
"0.6585869",
"0.658491",
"0.65811735",
"0.65765643",
"0.65751576",
"0.65694076",
"0.6561757",
"0.65582377",
"0.65581614",
"0.6552827",
"0.6552827",
"0.6549224",
"0.65389794",
"0.65345114",
"0.65337104",
"0.652419",
"0.652419",
"0.6522521",
"0.652146",
"0.6521068",
"0.6519354",
"0.65165275",
"0.65159816",
"0.65028816",
"0.6498054",
"0.6498054",
"0.64969087",
"0.64937705",
"0.6488544",
"0.64867324",
"0.64866185",
"0.64865905",
"0.6484047",
"0.6481108",
"0.6474686",
"0.64628965",
"0.64551884",
"0.6446893",
"0.64436555",
"0.64436555",
"0.64436555",
"0.64436555",
"0.64436555",
"0.64386237",
"0.643595",
"0.64356565",
"0.64329195",
"0.6432562",
"0.6429554",
"0.64255124",
"0.64255124",
"0.64121485",
"0.64102405",
"0.64095175",
"0.64095175",
"0.64094734",
"0.640727",
"0.64060104",
"0.640229",
"0.6397359",
"0.6392996",
"0.63921124",
"0.63899696",
"0.63885015",
"0.63885015",
"0.63873845",
"0.6368818",
"0.6368818",
"0.63643163",
"0.63643163",
"0.63643163",
"0.6358884"
] | 0.0 | -1 |
An injectable service that helps to create Kafka producers and consumers based on Bootique configuration and userprovided settings. | public interface KafkaClientFactory {
/**
* Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a
* {@link ConsumerConfig} argument. Uses default Kafka cluster connection information (default == single configuration
* found in Bootique; if none or more than one exists, an exception is thrown). Returned Consumer needs to be
* closed by the calling code when it is no longer in use.
*
* @param config Configuration of consumer specific to the given method call.
* @param <K> Consumed message key type.
* @param <V> Consumed message value type.
* @return a new instance of Consumer.
*/
<K, V> Consumer<K, V> createConsumer(ConsumerConfig<K, V> config);
/**
* Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a
* {@link ConsumerConfig} argument. Returned Consumer needs to be closed by the calling code when it is no longer
* in use.
*
* @param clusterName symbolic configuration name for the Kafka cluser coming from configuration.
* @param config Configuration of consumer specific to the given method call.
* @param <K> Consumed message key type.
* @param <V> Consumed message value type.
* @return a new instance of Consumer.
*/
<K, V> Consumer<K, V> createConsumer(String clusterName, ConsumerConfig<K, V> config);
<K, V> Producer<K, V> createProducer(ProducerConfig<K, V>config);
<K, V> Producer<K, V> createProducer(String clusterName, ProducerConfig<K, V>config);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Bean\r\n public ProducerFactory<String, Object> producerFactory() {\r\n return new DefaultKafkaProducerFactory<>(producerConfig());\r\n }",
"@ApplicationScoped\n @Produces\n public KafkaConsumer<MessageKey, MessageValue> createKafkaConsumer() {\n Properties props = (Properties) consumerProperties.clone();\n\n props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n props.putIfAbsent(ConsumerConfig.GROUP_ID_CONFIG, UUID.randomUUID().toString());\n props.putIfAbsent(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, \"true\");\n props.putIfAbsent(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, \"1000\");\n props.putIfAbsent(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n\n tryToConfigureSecurity(props);\n\n // Create the Kafka Consumer\n KafkaSqlKeyDeserializer keyDeserializer = new KafkaSqlKeyDeserializer();\n KafkaSqlValueDeserializer valueDeserializer = new KafkaSqlValueDeserializer();\n KafkaConsumer<MessageKey, MessageValue> consumer = new KafkaConsumer<>(props, keyDeserializer, valueDeserializer);\n return consumer;\n }",
"@ApplicationScoped\n @Produces\n public ProducerActions<MessageKey, MessageValue> createKafkaProducer() {\n Properties props = (Properties) producerProperties.clone();\n\n // Configure kafka settings\n props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n props.putIfAbsent(ProducerConfig.CLIENT_ID_CONFIG, \"Producer-\" + UUID.randomUUID().toString());\n props.putIfAbsent(ProducerConfig.ACKS_CONFIG, \"all\");\n props.putIfAbsent(ProducerConfig.LINGER_MS_CONFIG, 10);\n props.putIfAbsent(ProducerConfig.PARTITIONER_CLASS_CONFIG, KafkaSqlPartitioner.class);\n\n tryToConfigureSecurity(props);\n\n // Create the Kafka producer\n KafkaSqlKeySerializer keySerializer = new KafkaSqlKeySerializer();\n KafkaSqlValueSerializer valueSerializer = new KafkaSqlValueSerializer();\n return new AsyncProducer<MessageKey, MessageValue>(props, keySerializer, valueSerializer);\n }",
"@Bean(\"kafkaProducerService\")\n\t@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON)\n\tpublic KafkaProducerService getKafkaProducerService() {\n\t\treturn new KafkaProducerService();\n\t}",
"@Bean(name = \"kafkaConsumer\")\n public KafkaConsumer<String, String> createConsumer(\n @Value(\"${kafka.bootstrap.servers.enable}\") String bootstrapServersEnable,\n @Value(\"${kafka.bootstrap.servers}\") String bootstrapServers,\n @Value(\"${kafka.consumer.groupid}\") String groupID,\n @Value(\"${kafka.consumer.from.beginning}\") String fromBeginning,\n @Value(\"${kafka.consumer.from.beginning.groupid}\") String customGroupId)\n\n {\n String KEY_DESERIALIZER = \"key.deserializer\";\n String KEY_DESERIALIZER_CLASS = \"org.apache.kafka.common.serialization.StringDeserializer\";\n String VALUE_DESERIALIZER = \"value.deserializer\";\n String VALUE_DESERIALIZER_CLASS = \"org.apache.kafka.common.serialization.StringDeserializer\";\n String AUTO_OFFSET_RESET = \"auto.offset.reset\";\n\n Properties properties = System.getProperties();\n if (bootstrapServersEnable.equalsIgnoreCase(\"on\")) {\n properties.setProperty(\"bootstrap.servers\", bootstrapServers);\n }\n properties.setProperty(KEY_DESERIALIZER, KEY_DESERIALIZER_CLASS);\n properties.setProperty(VALUE_DESERIALIZER, VALUE_DESERIALIZER_CLASS);\n properties.setProperty(\"group.id\", Boolean.valueOf(fromBeginning) ? customGroupId : groupID);\n properties.setProperty(AUTO_OFFSET_RESET, Boolean.valueOf(fromBeginning) ? \"earliest\" : \"latest\");\n\n return new KafkaConsumer<>(properties);\n }",
"@Bean\r\n public KafkaProducer<String, String> kafkaProducer() {\r\n Properties producerProperties = new Properties();\r\n producerProperties.put(\"bootstrap.servers\", kafkaBootstrapServers);\r\n producerProperties.put(\"acks\", \"all\");\r\n producerProperties.put(\"retries\", 0);\r\n producerProperties.put(\"batch.size\", 16384);\r\n producerProperties.put(\"linger.ms\", 1);\r\n producerProperties.put(\"buffer.memory\", 33554432);\r\n producerProperties.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n producerProperties.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n /*\r\n Creating a Kafka Producer object with the configuration above.\r\n */\r\n return new KafkaProducer<>(producerProperties);\r\n }",
"@Bean\r\n public KafkaTemplate<String, Object> kafkaTemplate() {\r\n return new KafkaTemplate<>(producerFactory());\r\n }",
"private MessageProducer<Long, Long> createProducerWithConfig() {\n return kafka.registerProducer(\n ProducerRegistration.builder()\n .forTopic(kafka.getTopicConfiguration(\"example1\"))\n .withDefaultProducer()\n .withKeySerializer(new LongSerializer())\n .withValueSerializer(new LongSerializer())\n .build());\n }",
"public KafkaConfig() { }",
"@Bean\r\n public Map<String, Object> producerConfig() {\r\n \t\r\n Map<String, Object> producerProperties = new HashMap<String, Object>();\r\n producerProperties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,propertiesManager.getBootstrapServer());\r\n producerProperties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\r\n producerProperties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);\r\n \r\n return producerProperties;\r\n }",
"private static Consumer<String, JsonNode> createConsumer() {\n final Properties props = new Properties();\n props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,\n BOOTSTRAP_SERVERS);\n props.put(ConsumerConfig.CLIENT_ID_CONFIG, \"EventsMultiplexer\");\n props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,\n StringDeserializer.class.getName());\n props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,\n JsonDeserializer.class.getName());\n props.put(ConsumerConfig.GROUP_ID_CONFIG, \"MainGroup\");\n return new KafkaConsumer<>(props);\n }",
"public KafkaBacksideEnvironment() {\n\t\tConfigPullParser p = new ConfigPullParser(\"kafka-props.xml\");\n\t\tproperties = p.getProperties();\n\t\tconnectors = new HashMap<String, IPluginConnector>();\n\t\t//chatApp = new SimpleChatApp(this);\n\t\t//mainChatApp = new ChatApp(this);\n\t\t//elizaApp = new ElizaApp(this);\n\t\tbootPlugins();\n\t\t//TODO other stuff?\n\t\tSystem.out.println(\"Booted\");\n\t\t//Register a shutdown hook so ^c will properly close things\n\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t public void run() { shutDown(); }\n\t\t});\n\t}",
"@Override\n public ProducerConfig createKafkaProducerConfig()\n {\n Properties props = new Properties();\n props.setProperty(\"serializer.class\", \"kafka.serializer.StringEncoder\");\n if (useZookeeper)\n {\n props.setProperty(\"zk.connect\", \"localhost:2182\");\n }\n else {\n props.setProperty(\"broker.list\", \"1:localhost:2182\");\n props.setProperty(\"producer.type\", \"async\");\n props.setProperty(\"queue.time\", \"2000\");\n props.setProperty(\"queue.size\", \"100\");\n props.setProperty(\"batch.size\", \"10\");\n }\n\n return new ProducerConfig(props);\n }",
"private MessageProducer<Key, Value> createProducer(ObjectMapper configuredObjectMapper) {\n return kafka.registerProducer(\n ProducerRegistration.builder()\n .forTopic(kafka.getTopicConfiguration(\"example0\"))\n .withDefaultProducer()\n .withKeySerializer(new KafkaJsonSerializer<Key>(configuredObjectMapper))\n .withValueSerializer(new KafkaJsonSerializer<Value>(configuredObjectMapper))\n .build());\n }",
"@PostConstruct\n public void postConstruct() {\n Map<String, String> config = new HashMap<>();\n config.put(\"bootstrap.servers\", \"localhost:9092\");\n config.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n config.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n config.put(\"acks\", \"1\");\n producer = KafkaProducer.create(vertx, config);\n }",
"public FlinkConsumerFromKafkaUtil(){\n env = StreamExecutionEnvironment.getExecutionEnvironment();\n }",
"public void init() {\n initiateConfig();\n initiateKafkaStuffs();\n log.info(\"Kafka consumer and producer for topic [{}] started.\", topic);\n\n service.submit(() -> {\n while (true) {\n try {\n ConsumerRecords<String, byte[]> records = consumer.poll(3000);\n for (ConsumerRecord<String, byte[]> record : records) {\n log.info(\"Reveive kafka message from topic [{}] with key [{}]\", topic, record.key());\n repository.get(record.key()).offer(record.value());\n accounter.incrementAndGet();\n }\n while (accounter.get() != 0) {\n Thread.sleep(5);\n }\n consumer.commitSync();\n } catch (Exception e) {\n log.warn(\"Something wrong happened during message pulling process\", e);\n consumer.close();\n consumer = null;\n initiateConsumer();\n }\n }\n });\n }",
"public interface ProducerPropsKeys {\n\n public static String KAFKA_PRODUCER_CONFIG = \"kafka.producer.config\";\n\n public static String KAFKA_MESSAGE_SCHEMA = \"kafka.message.schema\";\n\n}",
"private void initializeProducers() {\r\n\t\tlogger.info(\"--> initializeProducers\");\r\n\t\t// actual Kafka producer used by all generic producers\r\n\t\ttry {\r\n\t\t\tsharedAvroProducer = new KafkaProducer<EDXLDistribution, IndexedRecord>(ProducerProperties.getInstance(connectModeSec));\r\n\t\t} catch (Exception cEx) {\r\n\t\t\tlogger.info(\"CISAdapter failed to create a KafkaProducer!\");\r\n\t\t\tcEx.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tlogger.info(\"Check Adpter DEV Mode\");\r\n\t\t\theartbeatProducer = new HeartbeatProducer(sharedAvroProducer, TopicConstants.HEARTBEAT_TOPIC);\t\r\n\t\t\theartbeatProducer.sendInitialHeartbeat();\r\n\t\t\taddAvroReceiver(TopicConstants.ADMIN_HEARTBEAT_TOPIC, new AdminHeartbeatConsumer(null));\r\n\t\t\tadpterMode = AdapterMode.DEV_MODE;\r\n\t\t} catch (Exception cEx) {\r\n\t\t\tlogger.info(\"CISAdapter initialized failed with non secure connection!\");\r\n\t\t\tlogger.info(\"Check Adpter SEC DEV Mode\");\r\n\t\t\tconnectModeSec = true;\r\n\t\t\tsharedAvroProducer = new KafkaProducer<EDXLDistribution, IndexedRecord>(ProducerProperties.getInstance(connectModeSec));\r\n\t\t\ttry {\r\n\t\t\t\theartbeatProducer = new HeartbeatProducer(sharedAvroProducer, TopicConstants.HEARTBEAT_TOPIC);\t\r\n\t\t\t\theartbeatProducer.sendInitialHeartbeat();\r\n\t\t\t\taddAvroReceiver(TopicConstants.ADMIN_HEARTBEAT_TOPIC, new AdminHeartbeatConsumer(null));\r\n\t\t\t\tadpterMode = AdapterMode.SEC_DEV_MODE;\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.info(\"Adapter running in TRIAL Mode, wait for AdminTool heartbeat for futur initalization!\");\r\n\t\t\t\taddAvroReceiver(TopicConstants.ADMIN_HEARTBEAT_TOPIC, new AdminHeartbeatConsumer(CISAdapter.aMe));\r\n\t\t\t\tadpterMode = AdapterMode.TRIAL_MODE;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (adpterMode != AdapterMode.TRIAL_MODE) {\r\n\t\t\tinitCoreTopics();\r\n\t\t\tadapterInitDone = true;\t\r\n\t\t} \r\n\t\tlogger.info(\"initializeProducers -->\");\r\n\t}",
"@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n props.put(\"oracle.net.tns_admin\", tnsAdmin); //eg: \"/user/home\" if ojdbc.properies file is in home \n props.put(\"security.protocol\", protocol);\n props.put(\"bootstrap.servers\", broker);\n //props.put(\"group.id\", group);\n props.put(\"enable.auto.commit\", \"true\");\n props.put(\"auto.commit.interval.ms\", \"10000\");\n props.put(\"linger.ms\", 1000);\n // Set how to serialize key/value pairs\n props.setProperty(\"key.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n props.setProperty(\"value.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n\n producer = new KafkaProducer<>(props);\n }",
"@Bean\n public ConsumerFactory<String, String> consumerFactory() {\n return new DefaultKafkaConsumerFactory<>(\n kafkaProperties.buildConsumerProperties(), new StringDeserializer(), new StringDeserializer()\n );\n }",
"public interface KafkaService {\n\n /**\n * 发消息\n * @param topic 主题\n * @param obj 发送内容\n */\n boolean sendUserInfo(String topic, Object obj);\n}",
"void configure(Map<String, ?> configs) throws KafkaException;",
"@NonNull\n <K, V> Producer<K, V> createProducer(Properties config, Serializer<K> ks, Serializer<V> vs);",
"Producer(Properties kafkaProducerConfig) {\n\n // Mandatory settings, not changeable.\n kafkaProducerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n kafkaProducerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());\n kafkaProducerConfig.put(ProducerConfig.PARTITIONER_CLASS_CONFIG, SixtPartitioner.class.getName());\n\n kafka = new org.apache.kafka.clients.producer.KafkaProducer<>(kafkaProducerConfig);\n logger.info(\"Created producer.\");\n }",
"void before(@Observes BeforeBeanDiscovery discovery) {\n // Register beans manually\n discovery.addAnnotatedType(JsonWebTokenProducer.class, \"TokenProducer\");\n }",
"public void configureAndStart(ProducerType producerType) {\n kafkaProperties = new Properties();\n kafkaProperties.put(\"metadata.broker.list\", brokerList);\n kafkaProperties.put(\"serializer.class\", \"kafka.serializer.StringEncoder\");\n kafkaProperties.put(\"request.required.acks\", \"1\");\n kafkaProperties.put(\"producer.type\", producerType.getType());\n\n producerConfig = new ProducerConfig(kafkaProperties);\n\n // Start the producer\n producer = new Producer<String, String>(producerConfig);\n }",
"public KafkaConfig(String bootstrapServer) {\n this.bootstrapServer = bootstrapServer;\n kafkaGroupName = \"group1\";\n autoOffsetReset = \"earliest\";\n autoCommit = false;\n kafkaTopics = new HashMap<>();\n }",
"public interface Consumer {\n\n public void createKafkaConsumer() throws Exception;\n\n public void subscribe(String... topic) throws Exception;\n\n\n public Object poll(long timeout);\n\n public void commitSync();\n\n public void close();\n\n}",
"@Bean\n BrokerService broker() throws Exception {\n BrokerService broker = new BrokerService();\n // configure the broker\n broker.addConnector(BROKER_URL);\n broker.start();\n return broker;\n }",
"public AppcActorServiceProvider() {\n super(NAME, BidirectionalTopicActorParams.class);\n\n addOperator(new BidirectionalTopicOperator(NAME, ModifyConfigOperation.NAME, this, AppcOperation.SELECTOR_KEYS,\n ModifyConfigOperation::new));\n }",
"private static KafkaProducer<String, String> createProducer(String a_broker) {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(\"bootstrap.servers\", a_broker);\r\n\t\tprops.put(\"compression.type\", \"none\");\r\n\t\tprops.put(\"value.serializer\", StringSerializer.class.getName());\r\n\t\tprops.put(\"key.serializer\", StringSerializer.class.getName());\r\n\t\t\r\n\t\treturn new KafkaProducer<String, String>(props);\r\n\t}",
"AbstractProducer(String env) {\n\t\t// set configs for kafka\n\t\tProperties props = new Properties();\n\t\tprops.put(\"bootstrap.servers\", PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"bootstrap.servers\"));\n\t\tprops.put(\"acks\",\n\t\t\t\tPropertyLoader.getPropertyValue(PropertyFile.kafka, \"acks\"));\n\t\tprops.put(\"retries\", Integer.parseInt(PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"retries\")));\n\t\tprops.put(\"batch.size\", Integer.parseInt(PropertyLoader\n\t\t\t\t.getPropertyValue(PropertyFile.kafka, \"batch.size\")));\n\t\tprops.put(\"linger.ms\", Integer.parseInt(PropertyLoader\n\t\t\t\t.getPropertyValue(PropertyFile.kafka, \"linger.ms\")));\n\t\tprops.put(\"buffer.memory\", Integer.parseInt(PropertyLoader\n\t\t\t\t.getPropertyValue(PropertyFile.kafka, \"buffer.memory\")));\n\t\tprops.put(\"key.serializer\", PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"key.serializer\"));\n\t\tprops.put(\"value.serializer\", PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"value.serializer\"));\n\n\t\t// Initialize the producer\n\t\tproducer = new KafkaProducer<String, String>(props);\n\n\t\t// Initialize the solr connector and the connector for the configuration\n\t\t// database\n\t\tsolr = new Solr();\n\t\tconfig = new MongoDBConnector(PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.database, \"config.name\") + \"_\" + env);\n\t}",
"private KafkaProducer<String, String> createProducer(String brokerList) {\n if (USERNAME==null) USERNAME = \"token\";\n\n Properties properties = new Properties();\n //common Kafka configs\n properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerList);\n properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SASL_SSL\");\n properties.put(SaslConfigs.SASL_MECHANISM, \"PLAIN\");\n properties.put(SaslConfigs.SASL_JAAS_CONFIG, \"org.apache.kafka.common.security.plain.PlainLoginModule required username=\\\"\" + USERNAME + \"\\\" password=\\\"\" + API_KEY + \"\\\";\");\n properties.put(SslConfigs.SSL_PROTOCOL_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"HTTPS\");\n //Kafka producer configs\n properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.CLIENT_ID_CONFIG, \"stocktrader-producer\");\n properties.put(ProducerConfig.ACKS_CONFIG, \"all\");\n properties.put(ProducerConfig.CLIENT_DNS_LOOKUP_CONFIG,\"use_all_dns_ips\");\n\n KafkaProducer<String, String> kafkaProducer = null;\n \n try {\n kafkaProducer = new KafkaProducer<>(properties);\n } catch (KafkaException kafkaError ) {\n logger.warning(\"Error while creating producer: \"+kafkaError.getMessage());\n Throwable cause = kafkaError.getCause();\n if (cause != null) logger.warning(\"Caused by: \"+cause.getMessage());\n throw kafkaError;\n }\n return kafkaProducer;\n }",
"private static Map<String, Object> getKafkaParams() {\n Map<String, Object> kafkaParams = new\n HashMap<>();\n kafkaParams.put(\"bootstrap.servers\", KAFKA_BROKER_LIST);\n kafkaParams.put(\"key.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"value.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"group.id\", \"DEFAULT_GROUP_ID\");\n kafkaParams.put(\"auto.offset.reset\", \"latest\");\n kafkaParams.put(\"enable.auto.commit\", false);\n return kafkaParams;\n }",
"protected StreamsApp() {\n this.streamsConfig = new KafkaStreamsConfig().fromConfig(config);\n this.rocksDbReporter = new RocksDbMetricsReporter(this);\n }",
"public interface ProducerService {\n}",
"@Override\n public void configure(Map<String, ?> config) {\n KafkaSpanDecorator customDecorator = \n (KafkaSpanDecorator)config.get(\"kafka.producer.decorator\");\n \n if (customDecorator != null) {\n decorators.add(customDecorator);\n }\n }",
"private void initializeProducers(ComponentContext context) {\n BrokerHost rfHost;\n Properties prop = MQUtil.getProp(context);\n if (prop == null) {\n log.error(\"RabbitMQ configuration file not found...\");\n return;\n }\n try {\n correlationId = prop.getProperty(SENDER_COR_ID);\n rfHost = new BrokerHost(MQUtil.getMqUrl(\n prop.getProperty(SERVER_PROTO),\n prop.getProperty(SERVER_UNAME),\n prop.getProperty(SERVER_PWD),\n prop.getProperty(SERVER_ADDR),\n prop.getProperty(SERVER_PORT),\n prop.getProperty(SERVER_VHOST)));\n\n manageSender = registerProducer(rfHost,\n MQUtil.rfProducerChannelConf(\n prop.getProperty(SENDER_EXCHG),\n prop.getProperty(ROUTE_KEY),\n prop.getProperty(SENDER_QUEUE)),\n msgOutQueue);\n } catch (Exception e) {\n throw new IllegalStateException(e);\n }\n manageSender.start();\n }",
"public interface MessageServiceInjector {\n public Consumer getConsumer() ;\n}",
"@Before\n public void setUp() throws Exception {\n Map<String, Object> consumerProperties =\n KafkaTestUtils.consumerProps(\"sender\", \"false\",\n embeddedKafka.getEmbeddedKafka());\n\n // create a Kafka consumer factory\n /*\n Next a DefaultKafkaConsumerFactory and ContainerProperties are created, the ContainerProperties contains runtime properties\n (in this case the topic name) for the listener container. Both are then passed to the KafkaMessageListenerContainer constructor.\n */\n DefaultKafkaConsumerFactory<String, Object> consumerFactory =\n new DefaultKafkaConsumerFactory<String, Object>(\n consumerProperties);\n\n // set the topic that needs to be consumed\n ContainerProperties containerProperties =\n new ContainerProperties(SENDER_TOPIC);\n\n // create a Kafka MessageListenerContainer\n\n container = new KafkaMessageListenerContainer<>(consumerFactory,containerProperties);\n\n // create a thread safe queue to store the received messages\n /*\n Received messages need to be stored somewhere. In this example, a thread-safe BlockingQueue is used.\n We create a new MessageListener and in the onMessage() method we add the received message to the BlockingQueue.\n */\n records = new LinkedBlockingQueue<>();\n\n // setup a Kafka message listener\n container\n .setupMessageListener(new MessageListener<String, Object>() {\n @Override\n public void onMessage(\n ConsumerRecord<String, Object> record) {\n LOGGER.debug(\"test-listener received message='{}'\",record.toString());\n records.add(record);\n }\n });\n\n // start the container and underlying message listener\n container.start();\n\n // wait until the container has the required number of assigned partitions\n ContainerTestUtils.waitForAssignment(container,\n embeddedKafka.getEmbeddedKafka().getPartitionsPerTopic());\n }",
"@Test\n public void testConfigureKafka() {\n Map<String, String> props = new HashMap<>();\n props.put(USERNAME, \"username\");\n props.put(PASSWORD, \"password\");\n\n Map<String, Object> expectedConfig = new HashMap<>();\n expectedConfig.put(SaslConfigs.SASL_MECHANISM, ScramMechanism.SCRAM_SHA_512.mechanismName());\n expectedConfig.put(\n SaslConfigs.SASL_JAAS_CONFIG,\n String.format(\n \"org.apache.kafka.common.security.scram.ScramLoginModule required \"\n + \"username=\\\"%s\\\" password=\\\"%s\\\";\",\n props.get(USERNAME), props.get(PASSWORD)));\n\n Map<String, Object> config = Utils.configureKafka(props);\n Assert.assertEquals(expectedConfig, config);\n }",
"public KafkaConfig(String bootstrapServer, String kafkaGroupName, String autoOffsetReset, Boolean autoCommit, Map<String, Integer> kafkaTopics) {\n this.bootstrapServer = bootstrapServer;\n this.kafkaGroupName = kafkaGroupName;\n this.autoOffsetReset = autoOffsetReset;\n this.autoCommit = autoCommit;\n this.kafkaTopics = kafkaTopics;\n }",
"@Override\n public void initialize(Bootstrap<KafkaExampleConfiguration> bootstrap) {\n bootstrap.addBundle(ConfigurationSubstitutionBundle.builder().build());\n bootstrap.addBundle(kafka);\n }",
"public KafkaManagedFileToProcess build() { return new KafkaManagedFileToProcess(this); }",
"public interface SftpConsumerBuilder extends ScheduledConsumerBuilder\n{\n SftpConsumerBuilder setCriticalOnStartup(boolean criticalOnStartup);\n\n SftpConsumerBuilder setConfiguredResourceId(String configuredResourceId);\n\n SftpConsumerBuilder setConfiguration(ScheduledConsumerConfiguration scheduledConsumerConfiguration);\n\n SftpConsumerBuilder setMessageProvider(MessageProvider messageProvider);\n\n SftpConsumerBuilder setManagedEventIdentifierService(ManagedEventIdentifierService managedEventIdentifierService);\n\n SftpConsumerBuilder setManagedResourceRecoveryManager(ManagedResourceRecoveryManager managedResourceRecoveryManager);\n\n SftpConsumerBuilder setEventFactory(EventFactory eventFactory);\n\n SftpConsumerBuilder setCronExpression(String cronExpression);\n\n SftpConsumerBuilder setEager(boolean eager);\n\n SftpConsumerBuilder setIgnoreMisfire(boolean ignoreMisfire);\n\n SftpConsumerBuilder setTimezone(String timezone);\n\n SftpConsumerBuilder setSourceDirectory(String sourceDirectory);\n\n SftpConsumerBuilder setFilenamePattern(String filenamePattern);\n\n SftpConsumerBuilder setSourceDirectoryURLFactory(DirectoryURLFactory sourceDirectoryURLFactory);\n\n SftpConsumerBuilder setFilterDuplicates(Boolean filterDuplicates);\n\n SftpConsumerBuilder setFilterOnFilename(Boolean filterOnFilename);\n\n SftpConsumerBuilder setFilterOnLastModifiedDate(Boolean filterOnLastModifiedDate);\n\n SftpConsumerBuilder setRenameOnSuccess(Boolean renameOnSuccess);\n\n SftpConsumerBuilder setRenameOnSuccessExtension(String renameOnSuccessExtension);\n\n SftpConsumerBuilder setMoveOnSuccess(Boolean moveOnSuccess);\n\n SftpConsumerBuilder setMoveOnSuccessNewPath(String moveOnSuccessNewPath);\n\n SftpConsumerBuilder setChronological(Boolean chronological);\n\n SftpConsumerBuilder setChunking(Boolean chunking);\n\n SftpConsumerBuilder setChunkSize(Integer chunkSize);\n\n SftpConsumerBuilder setChecksum(Boolean checksum);\n\n SftpConsumerBuilder setMinAge(Long minAge);\n\n SftpConsumerBuilder setDestructive(Boolean destructive);\n\n SftpConsumerBuilder setMaxRows(Integer maxRows);\n\n SftpConsumerBuilder setAgeOfFiles(Integer ageOfFiles);\n\n SftpConsumerBuilder setClientID(String clientID);\n\n SftpConsumerBuilder setCleanupJournalOnComplete(Boolean cleanupJournalOnComplete);\n\n SftpConsumerBuilder setRemoteHost(String remoteHost);\n\n SftpConsumerBuilder setPrivateKeyFilename(String privateKeyFilename);\n\n SftpConsumerBuilder setMaxRetryAttempts(Integer maxRetryAttempts);\n\n SftpConsumerBuilder setRemotePort(Integer remotePort);\n\n SftpConsumerBuilder setKnownHostsFilename(String knownHostsFilename);\n\n SftpConsumerBuilder setUsername(String username);\n\n SftpConsumerBuilder setPassword(String password);\n\n SftpConsumerBuilder setConnectionTimeout(Integer connectionTimeout);\n\n SftpConsumerBuilder setIsRecursive(Boolean isRecursive);\n\n SftpConsumerBuilder setPreferredKeyExchangeAlgorithm(String preferredKeyExchangeAlgorithm);\n\n SftpConsumerBuilder setScheduledJobGroupName(String scheduledJobGroupName);\n\n SftpConsumerBuilder setScheduledJobName(String scheduledJobName);\n\n \n}",
"public FabricConfigurator() {\n\n }",
"public interface ConfigService {\n\n\n /**\n * eureka配置\n *\n * @param sb\n * @param addr\n */\n void eureka(StringBuilder sb, String addr);\n\n /**\n * redis配置\n *\n * @param sb\n * @param addr\n */\n void redis(StringBuilder sb, String addr);\n\n\n /**\n * 数据源配置\n *\n * @param sb\n */\n void thymeleafAndDatasource(StringBuilder sb);\n\n\n /**\n * 关于mybatis的配置\n *\n * @param sb\n * @param packages\n */\n void mybatis(StringBuilder sb, String packages);\n\n\n /**\n * 分页插件配置\n *\n * @param sb\n */\n void pagehelper(StringBuilder sb);\n\n /**\n * 生成application.yml\n *\n * @param name\n */\n void application(String name);\n\n\n /**\n * 生成application-xxx.yml\n *\n * @param branch\n * @param packages\n */\n void applicationBranch(String branch, String packages);\n\n\n /**\n * log文件\n *\n */\n void logBack();\n}",
"public static void main(String[] args) {\n KafkaConfig kafkaConfig = KafkaUtil.getKafkaConfig();\n System.out.println(kafkaConfig.toString());\n\n // push data to kafka\n SavedState savedState = new SavedState();\n\n producers = new HashMap<Priority, KafkaProducer<String, String>>() {\n {\n put(Priority.MAX_PRIORITY, KafkaUtil.initProducer());\n put(Priority.MEDIUM_PRIORITY, KafkaUtil.initProducer());\n put(Priority.MIN_PRIORITY, KafkaUtil.initProducer());\n }\n };\n\n // create thread for consumer\n executor = Executors.newFixedThreadPool(3);\n executor.execute(new MaxPriorityThread(savedState));\n executor.execute(new MediumPriorityThread(savedState));\n executor.execute(new MinPriorityThread(savedState));\n executor.shutdown();\n\n Random random = new Random();\n for (int i = 0; i <= 10; ++i) {\n int rand = i; // random.nextInt(6);\n logger.info(\"Random number is: \" + rand);\n\n\n if (rand % 2 == 0) {\n String maxPriority = Priority.MAX_PRIORITY.getNameTopic();\n logger.info(\"Topic of max priority is: \" + maxPriority);\n ProducerRecord<String, String> record = new ProducerRecord<>(Priority.MAX_PRIORITY.getNameTopic(), String.valueOf(rand));\n logger.info(\"Data is sent to Max Priority Thread: \" + record.value());\n producers.get(Priority.MAX_PRIORITY).send(record);\n } else if (rand % 3 == 0) {\n String mediumPriority = Priority.MEDIUM_PRIORITY.getNameTopic();\n logger.info(\"Topic of medium priority is: \" + mediumPriority);\n ProducerRecord<String, String> record = new ProducerRecord<>(Priority.MEDIUM_PRIORITY.getNameTopic(), String.valueOf(rand));\n logger.info(\"Data is sent to Medium Priority Thread: \" + record.value());\n producers.get(Priority.MEDIUM_PRIORITY).send(record);\n } else if (rand % 5 == 0) {\n String minPriority = Priority.MIN_PRIORITY.getNameTopic();\n logger.info(\"Topic of min priority is: \" + minPriority);\n ProducerRecord<String, String> record = new ProducerRecord<>(Priority.MIN_PRIORITY.getNameTopic(), String.valueOf(rand));\n logger.info(\"Data is sent to Min Priority Thread: \" + record.value());\n producers.get(Priority.MIN_PRIORITY).send(record);\n }\n }\n }",
"public static void main(String[] args) throws Exception {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"bootstrap.servers\", \"127.0.0.1:9092\");\n\t\tprops.put(\"acks\", \"all\");\n\t\tprops.put(\"retries\", 0);\n\t\tprops.put(\"batch.size\", 16384);\n\t\tprops.put(\"linger.ms\", 1);\n\t\tprops.put(\"buffer.memory\", 33554432);\n\t\tprops.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t\tprops.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\n\t\t/*\n\t\t * Define new Kafka producer\n\t\t */\n\t\t@SuppressWarnings(\"resource\")\n\t\tProducer<String, String> producer = new KafkaProducer<>(props);\n\n\t\t/*\n\t\t * parallel generation of JSON messages on Transaction topic\n\t\t * \n\t\t * this could also include business logic, projection, aggregation, etc.\n\t\t */\n\t\tThread transactionThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Transaction\";\n\t\t\t\tList<JSONObject> transactions = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Transactions.json\", transactions);\n\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Transaction Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), transactions.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of customer topic messages \n\t\t */\n\t\tThread customerThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Customer\";\n\t\t\t\tList<JSONObject> customer = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Customer.json\", customer);\n\t\t\t\tfor (int i = 0; i < customer.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Customer Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), customer.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of messages (variable produceMessages)\n\t\t * \n\t\t * generated messages are based on mockaroo api\n\t\t */\n\t\tint produceMessages = 100000;\n\t\tThread accountThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Account\";\n\t\t\t\tfor (int i = 0; i < produceMessages; i++) {\n//\t\t\t\t\tSystem.out.println(\"Account procuded\");\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), getRandomTransactionJSON(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttransactionThread.start();\n\t\tcustomerThread.start();\n\t\taccountThread.start();\n\n\t}",
"public GeneralConsumer() {\n // Kafka consumer configuration settings\n Properties props = new Properties();\n\n// props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, IKafkaConstants.KAFKA_BROKERS);\n// props.put(ConsumerConfig.GROUP_ID_CONFIG, IKafkaConstants.GROUP_ID_CONFIG);\n// props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, LongDeserializer.class.getName());\n// props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());\n props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1000);\n props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, \"false\");\n props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n// Consumer<Long, String> consumer = new KafkaConsumer<>(props);\n// consumer.subscribe(Collections.singletonList(IKafkaConstants.TOPIC_NAME));\n\n// props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, \"localhost:9092\");\n\n props.put(\"bootstrap.servers\", BOOTSTRAP_SERVERS);\n// props.put(\"acks\", \"all\");\n// props.put(\"retries\", 1);\n props.put(\"group.id\", \"dd\");\n// props.put(\"enable.auto.commit\", \"true\");\n// props.put(\"auto.commit.interval.ms\", \"1000\");\n// props.put(\"session.timeout.ms\", \"30000\");\n\n props.put(\"key.deserializer\",\n \"org.apache.kafka.common.serialization.StringDeserializer\");\n// props.put(\"value.deserializer\",\n// \"org.apache.kafka.common.serialization.StringDeserializer\");\n// consumer = new KafkaConsumer\n// <String, String>(props);\n\n props.put(\"value.deserializer\",\n \"org.apache.kafka.common.serialization.ByteArrayDeserializer\");\n consumer = new KafkaConsumer<String, byte[]>(props);\n\n// adminClient = AdminClient.create(props);\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic ProducerManager(String server, int numberOfProducers) {\n\t random = new Random();\n\t\tproducers = new KafkaProducer[numberOfProducers];\n\t\tfor(int i = 0; i < numberOfProducers; i++) {\n\t\t\tProperties props = new Properties();\n\t\t\tprops.put(\"bootstrap.servers\", server);\n\t \t props.put(\"acks\", \"all\");\n\t \t props.put(\"retries\", 0);\n\t \t props.put(\"batch.size\", 16384);\n\t \t props.put(\"linger.ms\", 1);\n\t \t props.put(\"buffer.memory\", 33554432);\n\t \t props.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t \t props.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\n\t \t KafkaProducer<String, String> producer = new KafkaProducer<String, String>(props);\n\t \t producers[i] = producer;\n\t\t}\n\t}",
"@Bean\n ActiveMQConnectionFactory connectionFactory() {\n ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_URL);\n return connectionFactory;\n }",
"public interface IProducer {\n\n\n /** sends out the filled in message to kafka */\n public void dispatchMessage(KeyedMessage<byte[], byte[]> msg);\n\n public void shutdown();\n\n public void dispatchMessage(final List<KeyedMessage<byte[], byte[]>> msgBatch );\n\n\n}",
"public void createKafkaAuditProducer(String auditorPropertiesFile) throws IOException, Exception {\n\t\tpropFile = new Properties();\n\t\tfin = new FileInputStream(auditorPropertiesFile);\n\t\tpropFile.load(fin);\n\t\tfin.close();\n\n\t\t// Setting up kafka audit producer properties\n\t\tpropKafka = new Properties();\n\t\tpropKafka.put(\"bootstrap.servers\", propFile.getProperty(\"audit.producer.bootstrap.servers\"));\n\t\tpropKafka.put(\"key.serializer\", propFile.getProperty(\"audit.producer.key.serializer\"));\n\t\tpropKafka.put(\"value.serializer\", propFile.getProperty(\"audit.producer.value.serializer\"));\n\t\tpropKafka.put(\"acks\", propFile.getProperty(\"audit.producer.acks\"));\n\t\tpropKafka.put(\"retries\", propFile.getProperty(\"audit.producer.retires\"));\n\t\tpropKafka.put(\"max.block.ms\", propFile.getProperty(\"audit.producer.max.block.ms\"));\n\t\tproducer = new KafkaProducer(propKafka);\n\t\tauditTopic = propFile.getProperty(\"aduit.producer.kafka.topic\");\n\n\t}",
"@Autowired\n public NewTopicController(TopicService topicService, UserService userService) {\n this.topicService = topicService;\n this.userService = userService;\n }",
"public interface PolicyEngine extends Startable, Lockable, TopicListener {\n\n /**\n * Boot the engine.\n *\n * @param cliArgs command line arguments\n */\n void boot(String[] cliArgs);\n\n /**\n * configure the policy engine according to the given properties.\n *\n * @param properties Policy Engine properties\n * @throws IllegalArgumentException when invalid or insufficient properties are provided\n */\n void configure(Properties properties);\n\n /**\n * updates the Policy Engine with the given configuration.\n *\n * @param configuration the configuration\n * @return success or failure\n * @throws IllegalArgumentException if invalid argument provided\n * @throws IllegalStateException if the system is in an invalid state\n */\n boolean configure(PdpdConfiguration configuration);\n\n /**\n * open the Policy Engine to external configuration systems.\n *\n * @return success or failure\n */\n boolean open();\n\n\n /**\n * configure the engine's environment. General lab installation configuration is made available\n * to the Engine. Typically, custom lab installation that may be needed by arbitrary drools\n * applications are made available, for example network component and database host addresses.\n * Multiple environments can be passed in and tracked by the engine.\n *\n * @param properties an environment properties\n */\n void setEnvironment(Properties properties);\n\n /**\n * gets the engine's environment.\n *\n * @return properties object\n */\n Properties getEnvironment();\n\n /**\n * gets an environment's value, by 1) first from the engine's environment, and 2) from the OS\n * environment.\n *\n * @param key environment key\n * @return environment value or null if absent\n */\n String getEnvironmentProperty(String key);\n\n /**\n * sets an engine's environment property.\n *\n * @param key key\n * @param value value\n * @return property string\n */\n String setEnvironmentProperty(String key, String value);\n\n /**\n * Gets the hostname used by this PDP-D.\n */\n String getHostName();\n\n /**\n * Gets the cluster name as configured in $CLUSTER_NAME,\n * otherwise it will assume an UUID as the cluster name.\n */\n String getClusterName();\n\n /**\n * Gets the PDP Name from hostname and $CLUSTER_NAME,\n * otherwise if CLUSTER_NAME is not set, the PdpName\n * will be the concatenation of the hostname and a\n * UUID.\n */\n String getPdpName();\n\n /**\n * registers a new Policy Controller with the Policy Engine initialized per properties.\n *\n * @param properties properties to initialize the Policy Controller\n * @return the newly instantiated Policy Controller\n * @throws IllegalArgumentException when invalid or insufficient properties are provided\n * @throws IllegalStateException when the engine is in a state where this operation is not\n * permitted.\n */\n PolicyController createPolicyController(String name, Properties properties);\n\n /**\n * updates a set of Policy Controllers with configuration information.\n *\n * @param configuration list of configurations\n * @return list of controllers\n * @throws IllegalArgumentException exception\n * @throws IllegalStateException exception\n */\n List<PolicyController> updatePolicyControllers(List<ControllerConfiguration> configuration);\n\n /**\n * updates an already existing Policy Controller with configuration information.\n *\n * @param configuration configuration\n * @return the updated Policy Controller\n * @throws IllegalArgumentException in the configuration is invalid\n * @throws IllegalStateException if the controller is in a bad state\n */\n PolicyController updatePolicyController(ControllerConfiguration configuration);\n\n /**\n * removes the Policy Controller identified by its name from the Policy Engine.\n *\n * @param name name of the Policy Controller\n */\n void removePolicyController(String name);\n\n /**\n * removes a Policy Controller from the Policy Engine.\n *\n * @param controller the Policy Controller to remove from the Policy Engine\n */\n void removePolicyController(PolicyController controller);\n\n /**\n * returns a list of the available Policy Controllers.\n *\n * @return list of Policy Controllers\n */\n List<PolicyController> getPolicyControllers();\n\n\n /**\n * get policy controller names.\n *\n * @return list of controller names\n */\n List<String> getPolicyControllerIds();\n\n /**\n * get unmanaged sources.\n *\n * @return unmanaged sources\n */\n List<TopicSource> getSources();\n\n /**\n * get unmanaged sinks.\n *\n * @return unmanaged sinks\n */\n List<TopicSink> getSinks();\n\n /**\n * get unmmanaged http servers list.\n *\n * @return http servers\n */\n List<HttpServletServer> getHttpServers();\n\n /**\n * Gets a thread pool that can be used to execute background tasks.\n */\n ScheduledExecutorService getExecutorService();\n\n /**\n * get properties configuration.\n *\n * @return properties objects\n */\n Properties getProperties();\n\n /**\n * get features attached to the Policy Engine.\n *\n * @return list of features\n */\n List<PolicyEngineFeatureApi> getFeatureProviders();\n\n /**\n * get named feature attached to the Policy Engine.\n *\n * @return the feature\n */\n PolicyEngineFeatureApi getFeatureProvider(String featureName);\n\n /**\n * get features attached to the Policy Engine.\n *\n * @return list of features\n */\n List<String> getFeatures();\n\n /**\n * get domain maker.\n *\n * @return the domain maker\n */\n DomainMaker getDomainMaker();\n\n /**\n * get statistics for this PDP.\n *\n * @return statistics\n */\n PolicyStatsManager getStats();\n\n /**\n * Attempts the dispatching of an \"event\" object.\n *\n * @param topic topic\n * @param event the event object to send\n * @return true if successful, false if a failure has occurred.\n * @throws IllegalArgumentException when invalid or insufficient properties are provided\n * @throws IllegalStateException when the engine is in a state where this operation is not\n * permitted (ie. locked or stopped).\n */\n boolean deliver(String topic, Object event);\n\n /**\n * Attempts the dispatching of an \"event\" object over communication infrastructure \"busType\".\n *\n * @param topic topic\n * @param event the event object to send\n * @return true if successful, false if a failure has occurred.\n * @throws IllegalArgumentException when invalid or insufficient properties are provided\n * @throws IllegalStateException when the engine is in a state where this operation is not\n * permitted (ie. locked or stopped).\n * @throws UnsupportedOperationException when the engine cannot deliver due to the functionality\n * missing (ie. communication infrastructure not supported.\n */\n boolean deliver(String busType, String topic, Object event);\n\n /**\n * Attempts the dispatching of an \"event\" object over communication infrastructure \"busType\".\n *\n * @param topic topic\n * @param event the event object to send\n * @return true if successful, false if a failure has occurred.\n * @throws IllegalArgumentException when invalid or insufficient properties are provided\n * @throws IllegalStateException when the engine is in a state where this operation is not\n * permitted (ie. locked or stopped).\n * @throws UnsupportedOperationException when the engine cannot deliver due to the functionality\n * missing (ie. communication infrastructure not supported.\n */\n boolean deliver(CommInfrastructure busType, String topic, Object event);\n\n /**\n * Attempts delivering of an String over communication infrastructure \"busType\".\n *\n * @param topic topic\n * @param event the event object to send\n * @return true if successful, false if a failure has occurred.\n * @throws IllegalArgumentException when invalid or insufficient properties are provided\n * @throws IllegalStateException when the engine is in a state where this operation is not\n * permitted (ie. locked or stopped).\n * @throws UnsupportedOperationException when the engine cannot deliver due to the functionality\n * missing (ie. communication infrastructure not supported.\n */\n boolean deliver(CommInfrastructure busType, String topic, String event);\n\n /**\n * Requests a lock on a resource. Typically, the lock is not immediately granted,\n * though a \"lock\" object is always returned. Once the lock has been granted (or\n * denied), the callback will be invoked to indicate the result.\n *\n * <p/>\n * Notes:\n * <dl>\n * <li>The callback may be invoked <i>before</i> this method returns</li>\n * <li>The implementation need not honor waitForLock={@code true}</li>\n * </dl>\n *\n * @param resourceId identifier of the resource to be locked\n * @param ownerKey information identifying the owner requesting the lock\n * @param holdSec amount of time, in seconds, for which the lock should be held once\n * it has been granted, after which it will automatically be released\n * @param callback callback to be invoked once the lock is granted, or subsequently\n * lost; must not be {@code null}\n * @param waitForLock {@code true} to wait for the lock, if it is currently locked,\n * {@code false} otherwise\n * @return a new lock\n */\n Lock createLock(String resourceId, String ownerKey, int holdSec, LockCallback callback,\n boolean waitForLock);\n\n /**\n * Invoked when the host goes into the active state.\n */\n void activate();\n\n /**\n * Invoked when the host goes into the standby state.\n */\n void deactivate();\n\n /**\n * produces a default telemetry configuration.\n *\n * @return policy engine configuration\n */\n Properties defaultTelemetryConfig();\n\n /**\n * Track a policy execution metric.\n *\n * @param controllerName controller name\n * @param policyName policy name\n * @param metric metric\n */\n void metric(String controllerName, String policyName, Metric metric);\n\n /**\n * Track a policy execution transaction.\n *\n * @param controllerName controller name\n * @param policyName policy name\n * @param transaction transaction\n */\n void transaction(String controllerName, String policyName, Metric transaction);\n}",
"public void initializeConsumerProducer(int queueSize) {\n\n trainSignal = false;\n if (radioDataSet.isSelected()) {\n consumer = new DataSetConsumer(jmeVisualization);\n producer = new DataSetProducer(neuralNetAndDataSet);\n }\n if (radioWeights.isSelected()) {\n consumer = new NeuralNetworkWeightsConsumer(jmeVisualization);\n producer = new NeuralNetworkWeightsProducer(neuralNetAndDataSet);\n }\n\n /*\n Instantiate producerConsumer and start consuming(drawing)\n */\n consumerProducer = new ConsumerProducer(queueSize);\n consumerProducer.setConsumer(consumer);\n consumerProducer.setProducer(producer);\n\n consumerProducer.startConsuming();\n\n }",
"protected void initialize() {\n // Get the topology builder\n KStreamBuilder builder = getBuilder();\n // Build the app\n kafkaStreams = new KafkaStreams(builder, streamsConfig, new ClientSupplier());\n // Shutdown the entire app if an uncaught exception is encountered\n kafkaStreams.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {\n @Override\n public void uncaughtException(Thread t, Throwable e) {\n log.error(\"Stream terminated because of uncaught exception: {}. Shutting down app\", e.getMessage());\n String s = stackTraceAsString((Exception) e);\n log.error(\"Stacktrace: {}\", s);\n System.out.println(e);\n shutdownApp();\n }\n });\n topology = builder;\n addMetrics(PipelineMetricsReporter.metrics());\n }",
"private static FlinkKafkaProducer<String> getKafkaSink(Tuple2<String, String> sinkTuple) {\n\t\tProperties props = new Properties();\n\t\tprops.setProperty(\"bootstrap.servers\", sinkTuple.f0);\t\t\t\t\n\t\treturn new FlinkKafkaProducer<>(\n\t\t\t\tsinkTuple.f0,\n\t\t\t\tsinkTuple.f1,\n\t\t\t\tnew SimpleStringSchema());\t\n\t}",
"public void setupConsumers() throws Exception {\n Consumer logConsumer1 = new LogConsumer1(channel);\n String queueName1 = channel.queueDeclare().getQueue();\n channel.queueBind(queueName1, EXCHANGE_NAME, \"\");\n channel.basicConsume(queueName1, true, logConsumer1);\n\n // Consumer 1:\n Consumer logConsumer2 = new LogConsumer2(channel);\n String queueName2 = channel.queueDeclare().getQueue();\n channel.queueBind(queueName2, EXCHANGE_NAME, \"\");\n channel.basicConsume(queueName2, true, logConsumer2);\n\n }",
"public interface ProviderService\n{\n /**\n * Get all service provider.\n *\n * @return All service provider artifacts currently available or an empty\n * set if no service providers are available.\n */\n Set<ServiceProducer> getAllServiceProviders();\n\n /**\n * Get a service provider.\n *\n * @param id The id of the service provider to get.\n * @return The service artifact that represents the service provider or\n * <code>null</code> if no Service Producer was found with that id.\n */\n ServiceProducer getServiceProvider(int id);\n}",
"public static ServiceProvider createServiceProvider() {\n \t//return new ActiveMQProvider();\n \treturn new RSPServiceProvider();\n }",
"@Override\n public void configureMessageBroker(MessageBrokerRegistry registry) {\n registry.enableSimpleBroker(TOPIC);\n }",
"public static void main(String[] args) throws Exception {\n\t\tZkHosts zkHosts = new ZkHosts(\"192.168.0.111:2181\");\n\t\t//Create the KafkaSpout configuration\n\t\t//Second argument -> topic name\n\t\t//Third argument -> zk root for Kafka\n\t\t//Forth argument -> consumer group id\n\t\t\n\t\tSpoutConfig kafkaConfig = new SpoutConfig(zkHosts, \"words_topic\", \"\", \"id111\");\n\t\t//Specify kafka message type\n\t\tkafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());\n\t\t//We want to consume all the first message in the topic every time\n\t\t//方便debug,在生产环境应该设置为false not sure used to be `forceFromStart`\n\t\tkafkaConfig.useStartOffsetTimeIfOffsetOutOfRange = true;\n\t\t//create the topology\n\t\tTopologyBuilder builder = new TopologyBuilder();\n\t\t//set kafka spout class\n\t\tbuilder.setSpout(\"KafkaSpout\", new KafkaSpout(kafkaConfig), 1);\n\t\t//configure bolts ##after update not work\n//\t\tbuilder.setBolt(\"SentenceBolt\", new SentenceBolt(), 1).globalGrouping(\"KafkaSpout\");\n//\t\tbuilder.setBolt(\"PrintBolt\", new PrintBolt(), 1).globalGrouping(\"SentenceBolt\");\n\t\t\n\t\tLocalCluster cluster = new LocalCluster();\n\t\tConfig conf = new Config();\n\t\t\n\t\tcluster.submitTopology(\"KafkaTopology\", conf, builder.createTopology());\n\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting to consume from kafka\");\n\t\t\tTimeUnit.SECONDS.sleep(100);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tcluster.killTopology(\"KafkaTopology\");\n\t\tcluster.shutdown();\n\t}",
"public interface ConsumerService extends AbstractService<Consumer> {\n String sayHello(String name);\n}",
"public MPSApplicationContextFactory() {\n this.encodingManager = new EncodingManager();\n\n protocolBuilder = new NamedProtocolBuilder();\n // Register the known protocols with the builder.\n ProtocolRegistry registry = new ProtocolRegistry();\n registry.register(protocolBuilder);\n }",
"public interface ConfigProcessor {\n\n\tvoid inject2Instance(Object obj,String keyName);\n\n\tvoid storeOneFile(ConfigBaseModel configBaseModel);\n\n\tvoid inject2Conf();\n\n}",
"@Override\n\tpublic void configure() throws Exception {\n\t\t\n\t\t\n\t\tProcessor upProcessor = new UpperCaseProcessor();\n\t\t\n\t\t from(\"kafka:{{kafka.topic}}?brokers={{kafka.host}}:{{kafka.port}}\")\n .log(\"Message received from Kafka : ${body}\")\n .log(\" on the topic ${headers[kafka.TOPIC]}\")\n .log(\" on the partition ${headers[kafka.PARTITION]}\")\n .log(\" with the offset ${headers[kafka.OFFSET]}\")\n .log(\" with the key ${headers[kafka.KEY]}\")\n .process(upProcessor)\n .log(\"${body}\");\n\t\t\n\t\t\n\t}",
"public interface Partitioner {\n\n Set<String> getPartitions();\n\n String getNextObjectName(String topic, String previousObject);\n\n boolean shouldReconfigure();\n\n}",
"public static void main(String[] args) {\n\n\n final KafkaProducer<String, String> kafkaProducer = new KafkaProducer<String, String>(getKafkaProducerProperties());\n\n // kafka\n final String topic = \"test-4\";\n\n // queue manager.\n String PARAM_QUEUE_NAME = \"DEV.QUEUE.1\";\n String PARAM_USERNAME = \"app\";\n String PARAM_PASSWORD = \"passw0rd\";\n String PARAM_QMGR_CHANNEL_NAME = \"DEV.APP.SVRCONN\";\n String PARAM_QMGR_NAME = \"QM1\";\n int PARAM_QMGR_PORT = 1414;\n String PARAM_QMGR_HOST_NAME = \"localhost\";\n\n Connection conn = null;\n\n try {\n\n // Set up the connection factory to connect to the queue manager,\n // populating it with all the properties we have been provided.\n MQConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setHostName(PARAM_QMGR_HOST_NAME);\n cf.setPort(PARAM_QMGR_PORT);\n cf.setQueueManager(PARAM_QMGR_NAME);\n cf.setChannel(PARAM_QMGR_CHANNEL_NAME);\n\n // Create the connection to the queue manager\n conn = cf.createConnection(PARAM_USERNAME, PARAM_PASSWORD);\n\n // Create a session and a queue object to enable us to interact with the\n // queue manager. By creating a transactional session we can roll back\n // the message onto the queue if the processing fails.\n Session session = conn.createSession(true, 0);\n Queue q = session.createQueue(\"queue:///\"+PARAM_QUEUE_NAME);\n\n // For testing purposes we can put some messages onto the queue using this\n\n // Set up the consumer to read from the queue\n MessageConsumer consumer = session.createConsumer(q);\n\n // Don't forget to start the connection before trying to receive messages!\n conn.start();\n\n try {\n\n // Read messages from the queue and process them until there\n // are none left to read.\n while (true) {\n Message receivedMsg = consumer.receiveNoWait();\n if (receivedMsg != null) {\n // use final -> multithreading env\n final TextMessage rcvTxtMsg = (TextMessage) receivedMsg;\n final String txt = rcvTxtMsg.getText();\n final ProducerRecord<String, String> objectStringProducerRecord = new ProducerRecord<>(topic, null, txt);\n kafkaProducer.send(objectStringProducerRecord, (recordMetadata, e) -> {\n if (e!=null){\n logger.warn(\"Producer call back end up with exception\");\n try {\n session.rollback();\n logger.warn(\"Ibm mq session rollback\");\n } catch (JMSException ex) {\n logger.warn(\"Ibm mq session failed to rollback\");\n ex.printStackTrace();\n }\n } else {\n try {\n session.commit();\n logger.info(\"Transaction success: Message was committed by IBM MQ Session and was delivered by Kafka-producer to kafka topic: {}, with offset: {}\", recordMetadata.topic(), recordMetadata.offset());\n } catch (JMSException ex) {\n logger.info(\"Transaction failed: Message was not committed by IBM MQ Session\");\n throw new RuntimeException(e);\n }\n }\n });\n\n\n // Since we returned from processing the message without\n // an exception being thrown we have successfully\n // processed the message, so increment our success count\n // and commit the transaction so that the message is\n // permanently removed from the queue.\n// messagesProcessed++;\n// session.commit();\n }\n\n }\n\n } catch (JMSException jmse2)\n {\n // This block catches any JMS exceptions that are thrown during\n // the business processing of the message.\n jmse2.printStackTrace();\n\n // Roll the transaction back so that the message can be put back\n // onto the queue ready to have its proessing retried next time\n // the action is invoked.\n session.rollback();\n throw new RuntimeException(jmse2);\n\n } catch (RuntimeException e) {\n e.printStackTrace();\n\n // Roll the transaction back so that the message can be put back\n // onto the queue ready to have its proessing retried next time\n // the action is invoked.\n session.rollback();\n throw e;\n }\n\n // Indicate to the caller how many messages were successfully processed.\n\n } catch (JMSException jmse) {\n // This block catches any JMS exceptions that are thrown before the\n // message is retrieved from the queue, so we don't need to worry\n // about rolling back the transaction.\n jmse.printStackTrace();\n\n // Pass an indication about the error back to the caller.\n throw new RuntimeException(jmse);\n\n } finally {\n if (conn != null) {\n try {\n conn.close();\n } catch (JMSException jmse2) {\n // Swallow final errors.\n }\n }\n }\n\n }",
"@Override\n public void configureMessageBroker(MessageBrokerRegistry registry) {\n registry.enableSimpleBroker(\"/topic/\");\n }",
"@Bean\n Exchange topicExchange() {\n return new TopicExchange(CUSTOMER_TOPIC_EXCHANGE,\n true,\n false,\n Collections.emptyMap());\n }",
"public static Properties configProducer() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\r\n\t\tprops.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, RentalCarEventDetailsSerializer.class);\r\n\r\n\t\treturn props;\r\n\t}",
"CloudwatchFactory getCloudwatchFactory();",
"Consumer createConsumer(String consumerId, String consumerName) throws RegistrationException;",
"public interface AppEnvironment\n{\n /**\n * Registers the given OrderConsumer, such that it will be notified of order based events.\n * \n * @param orderConsumer\n */\n void registerOrderConsumer(OrderConsumer orderConsumer);\n\n /**\n * Performs a run of order processing\n */\n void run();\n\n}",
"public ComponentFactory<T, E> toConfigure(BiConsumer<Context, Annotation> consumer) {\n return new ComponentFactory<>(this.annotationType, this.classElement, consumer, this.createFunction);\n }",
"@Bean\n public JsonTemplate jsonTemplate(@Value(\"${kafka.seperator}\") String seperator) {\n return new JsonTemplate(seperator);\n }",
"public interface Consumer {\n\n @Nonnull\n String getApiKey();\n\n void setApiKey(@Nonnull String apiKey);\n\n @Nonnull\n String getLoginId();\n\n void setLoginId(@Nonnull String loginId);\n\n @Nonnull\n String getSiteKey();\n\n void setSiteKey(@Nonnull String siteKey);\n\n @Nonnull\n String getTouchPoint();\n\n void setTouchPoint(@Nonnull String touchPoint);\n\n @Nonnull\n String getTid();\n\n void setTid(@Nonnull String tid);\n\n boolean hasTid();\n\n void setSharedSecret(@Nonnull String sharedSecret);\n\n @Nonnull\n String getSharedSecret();\n}",
"@SuppressWarnings({ \"deprecation\", \"unchecked\" })\r\n\tpublic void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager manager) throws RuntimeException {\r\n\t\ttry {\r\n\t\t\tClassPool cp = ClassPool.getDefault();\r\n\t\t\tcp.insertClassPath(new LoaderClassPath(Thread.currentThread().getContextClassLoader()));\r\n\t\t\tcp.importPackage(\"org.zkoss.zul\");\r\n\t\t\tcp.importPackage(\"org.zkoss.zk.ui\");\r\n\t\t\tcp.importPackage(\"org.zkoss.cdi.util\");\r\n\t\t\t\r\n\t\t\tCtClass mainclas = cp.makeClass(\"org.zkoss.zkplus.cdi.ZKComponentProducerMethods\");\r\n\t\t\tfinal List<URL> l = getUrlsForCurrentClasspath();\r\n\t\t\t\r\n\t\t\tReflections reflections = new Reflections(\r\n\t\t\t\t\tnew ConfigurationBuilder().setUrls(l)\r\n\t\t\t\t\t.setScanners(new FieldAnnotationsScanner()));\r\n\t\t\t\r\n\t\t\tSet<Field> fields = reflections.getFieldsAnnotatedWith(ComponentId.class);\r\n\t\t\tfor (Iterator iterator2 = fields.iterator(); iterator2\r\n\t\t\t\t\t.hasNext();) {\r\n\t\t\t\tField field = (Field) iterator2.next();\r\n\t\t\t\tCtClass cls = cp.get(field.getType().getName());\r\n\t\t\t\tString pckgName = cls.getPackageName();\r\n\t\t\t\tif (Component.class.isAssignableFrom(field.getType()) || !pckgName.endsWith(\"zul.api\")) {\r\n\t\t\t\t\taddProducerMethod(field, mainclas);\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tClass c = mainclas.toClass(Thread.currentThread().getContextClassLoader(), this.getClass().getProtectionDomain());\r\n\r\n\t\t\t// This will register dynamically generated ZKComponentProducerMethods class as a bean in turn all producer methods\r\n\t\t\t// inside this class will be used for resolving injection points\r\n\t\t\tevent.addAnnotatedType(((BeanManagerImpl)manager).createAnnotatedType(c));\r\n\r\n\t\t} catch (NotFoundException e) {\r\n\t\t\tlog.debug(\"Unexpected error in ZK Extension: \" + e.getMessage());\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tlog.debug(\"Unexpected error in ZK Extension: \" + e.getMessage());\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} catch (CannotCompileException e) {\r\n\t\t\tlog.debug(\"Unexpected error in ZK Extension: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new RuntimeException(new Exception(\"Error while pre-processing ZK component injection point(s)\"));\r\n\t\t} catch (IOException e) {\r\n\t\t\tlog.debug(\"Unexpected error in ZK Extension: \" + e.getMessage());\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} catch(Exception e) {\r\n\t\t\tlog.debug(\"Unexpected error in ZK Extension: \" + e.getMessage());\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t}",
"public EventHandleThread(){\n gson = new Gson();\n producer = KafkaProducerCreator.createProducer();\n this.paymentController = new PaymentController();\n }",
"@ForApplication\n@Component(modules = {AppModule.class, NetworkModule.class})\npublic interface AppComponent {\n Context appContext();\n Resources resources();\n PreferencesHelper preferencesHelper();\n void inject(NewsPresenter newsPresenter);\n void inject(FeedStorage feedStorage);\n}",
"@Bean\n public JmsListenerContainerFactory<?> jmsListenerContainerFactory() {\n DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();\n factory.setConnectionFactory(connectionFactory());\n factory.setConcurrency(\"1-1\");\n // Potrebno je obezbediti publish/subscribe za topic. Nije neophodno za queue.\n // factory.setPubSubDomain(true);\n return factory;\n }",
"@Inject\n\tpublic ProviderBikes() { //has dependencies of its own that's why constructot\n\t\t\t\t\t\t\t\t\t\t//with @Inject annotation\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t\tSystem.out.println(\"Inside the constructor of the provide class\");\n\t}",
"public KafkaJsonSerializer() {\n\n }",
"@Override\n protected SpringApplicationBuilder configure(SpringApplicationBuilder application){\n return application.sources(StartUpApplication.class);\n }",
"@Test\n public void testConfigureKafkaNoUsername() {\n Map<String, String> props = new HashMap<>();\n props.put(PASSWORD, \"password\");\n Map<String, Object> config = Utils.configureKafka(props);\n Assert.assertEquals(new HashMap<>(), config);\n }",
"public AbstractMessageProducer() {\n }",
"public void configure() {\n\t\tfrom(\"seda:vxf.onboard?multipleConsumers=true\")\n\t\t.doTry()\n\t\t.bean(new MANOController(),\"onBoardVxFToMANOProvider\") //returns exception or nothing\n\t\t.log(\"VNFD Onboarded Successfully\")\n\t\t.doCatch(Exception.class)\n\t\t.log(\"VNFD Onboarding failed!\");\n\n\t\tfrom(\"seda:nsd.onboard?multipleConsumers=true\")\n\t\t.doTry()\n\t\t.bean(new MANOController(),\"onBoardNSDToMANOProvider\") //returns exception or nothing\n\t\t.log(\"NSD Onboarded Successfully\")\n\t\t.doCatch(Exception.class)\n\t\t.log(\"NSD Onboarding failed!\");\t\t\n\n\t\t\n\t\tfrom(\"seda:nsd.deploy?multipleConsumers=true\")\n\t\t.doTry()\n\t\t.bean(new MANOController(),\"deployNSDToMANOProvider\") //returns exception or nothing\n\t\t.log(\"NS deployed Successfully\").stop()\n\t\t.doCatch(Exception.class)\n\t\t.log(\"NS deployment failed!\").stop();\t\t\n\n\t\tfrom(\"seda:nsd.deployment.complete?multipleConsumers=true\")\n\t\t.doTry()\n\t\t.bean(new MANOController(),\"terminateNSFromMANOProvider\") //returns exception or nothing\n\t\t.log(\"NS completed Successfully\")\n\t\t.doCatch(Exception.class)\n\t\t.log(\"NS completion failed!\").stop();\n\n\t\tfrom(\"seda:nsd.deployment.delete?multipleConsumers=true\")\n\t\t.doTry()\n\t\t.bean(new MANOController(),\"deleteNSFromMANOProvider\") //returns exception or nothing\n\t\t.log(\"NS deleted Successfully\")\n\t\t.doCatch(Exception.class)\n\t\t.log(\"NS deletion failed!\").stop();\n\t\t\n\t\t//from(\"timer://checkAndDeployTimer?delay=2m&period=120000\").bean(new MANOController(),\"checkAndDeployExperimentToMANOProvider\").stop();\n\t\t//from(\"timer://checkAndTerminateTimer?delay=2m&period=120000\").bean(new MANOController(),\"checkAndTerminateExperimentToMANOProvider\").stop();\n\t\t\n\t\tfrom(\"timer://checkAndUpdateRunningDeploymentDescriptors?delay=1m&period=120000\").bean(MANOController.class,\"checkAndUpdateRunningDeploymentDescriptors\").stop();\n\t\t\n\t}",
"Builder addProducer(String value);",
"public interface ChannelBuilder {\n\n /**\n * Configure this class with the given key-value pairs\n */\n void configure(Map<String, ?> configs) throws KafkaException;\n\n\n /**\n * returns a Channel with TransportLayer and Authenticator configured.\n * @param id channel id\n * @param key SelectionKey\n */\n KafkaChannel buildChannel(String id, SelectionKey key, int maxReceiveSize) throws KafkaException;\n\n\n /**\n * Closes ChannelBuilder\n */\n void close();\n\n}",
"public void startPolling() {\n\t\tThread poller = new Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tif (consumerTopics.isEmpty()) {\n\t\t\t\t\t\tthrow new Exception(DomainLocalizer.instance().getErrorString(\"kafka.no.consumer.topics\"));\n\t\t\t\t\t}\n\n\t\t\t\t\t// subscribe to topics\n\t\t\t\t\tconsumer.subscribe(consumerTopics);\n\n\t\t\t\t\t// print the topic name\n\t\t\t\t\tconsumerTopics.forEach(topic -> logger\n\t\t\t\t\t\t\t.info(\"Subscribed to topic \" + topic + \", polling at \" + pollingInterval + \" msec\"));\n\n\t\t\t\t\t// polling loop\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t// collection of records\n\t\t\t\t\t\tConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(pollingInterval));\n\n\t\t\t\t\t\trecords.forEach(consumerRecord -> {\n\t\t\t\t\t\t\tif (listener != null) {\n\t\t\t\t\t\t\t\t// serialize to ApplicationMessage\n\t\t\t\t\t\t\t\tString json = consumerRecord.value();\n\n\t\t\t\t\t\t\t\tif (logger.isInfoEnabled()) {\n\t\t\t\t\t\t\t\t\tlogger.info(\"Received message: \\n\" + json);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tApplicationMessage appMessage = null;\n\n\t\t\t\t\t\t\t\tif (json.contains(MessageType.EQUIPMENT_EVENT.name())) {\n\t\t\t\t\t\t\t\t\t// equipment event\n\t\t\t\t\t\t\t\t\tappMessage = deserialize(MessageType.EQUIPMENT_EVENT, json);\n\t\t\t\t\t\t\t\t} else if (json.contains(MessageType.COMMAND.name())) {\n\t\t\t\t\t\t\t\t\t// command\n\t\t\t\t\t\t\t\t\tappMessage = deserialize(MessageType.COMMAND, json);\n\t\t\t\t\t\t\t\t} else if (json.contains(MessageType.STATUS.name())) {\n\t\t\t\t\t\t\t\t\t// command\n\t\t\t\t\t\t\t\t\tappMessage = deserialize(MessageType.STATUS, json);\n\t\t\t\t\t\t\t\t} else if (json.contains(MessageType.NOTIFICATION.name())) {\n\t\t\t\t\t\t\t\t\t// command\n\t\t\t\t\t\t\t\t\tappMessage = deserialize(MessageType.NOTIFICATION, json);\n\t\t\t\t\t\t\t\t} else if (json.contains(MessageType.RESOLVED_EVENT.name())) {\n\t\t\t\t\t\t\t\t\t// command\n\t\t\t\t\t\t\t\t\tappMessage = deserialize(MessageType.RESOLVED_EVENT, json);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlogger.error(\"Unable to handle message!\");\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlistener.onKafkaMessage(appMessage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// commits the records assuming that the listeners are\n\t\t\t\t\t\t// successful in handling the messages\n\t\t\t\t\t\tconsumer.commitAsync();\n\t\t\t\t\t}\n\t\t\t\t} catch (WakeupException e) {\n\t\t\t\t\t// expected\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Unexpected error\", e);\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (consumer != null) {\n\t\t\t\t\t\t\tconsumer.commitSync();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (logger.isInfoEnabled()) {\n\t\t\t\t\t\t\tlogger.info(\"Stopped polling\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tpoller.start();\n\t}",
"@Bean\n public ConnectionFactory connectionFactory(){\n ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();\n activeMQConnectionFactory.setBrokerURL(brokerUrl);\n activeMQConnectionFactory.setUserName(brokerUsername);\n activeMQConnectionFactory.setPassword(brokerPassword);\n return activeMQConnectionFactory;\n }",
"ConsumerGroups consumerGroups();",
"private static FlinkKinesisFirehoseProducer<String> createFirehoseSinkFromStaticConfig() {\n\n\t\tProperties outputProperties = new Properties();\n\t\toutputProperties.setProperty(ConsumerConfigConstants.AWS_REGION, region);\n\n\t\tFlinkKinesisFirehoseProducer<String> sink = new FlinkKinesisFirehoseProducer<>(outputStreamName, new SimpleStringSchema(), outputProperties);\n\t\tProducerConfigConstants config = new ProducerConfigConstants();\n\t\treturn sink;\n\t}",
"public ProfileServiceBootstrap()\n {\n }",
"public static void main(String [] args) {\n context = new AnnotationConfigApplicationContext(Config.class);\n // For the destroy method to work.\n context.registerShutdownHook();\n\n\n //TestService service = (TestService) context.getBean(\"test_service\");\n //PollingConsumer consumer = (PollingConsumer) context.getBean(\"test_consumer\");\n\n // Start tcp and flash servers\n Map<String, Initializer> initializers = context.getBeansOfType(Initializer.class);\n if (initializers != null) {\n for(Initializer initializer : initializers.values()) {\n initializer.initialize();\n }\n }\n\n NettyManager manager = context.getBean(NettyManager.class);\n try\n {\n manager.startServer();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"public interface Provider {\n Service newService();\n }",
"public void intiSettings()throws Exception{\r\n\r\n\t\tinputStream = new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\config.properties\");\r\n\t\tconfig.load(inputStream);\r\n\t\t\r\n\t\tprop.put(\"bootstrap.servers\", config.getProperty(\"bootstrap.servers\"));\r\n\t\tprop.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\t\tprop.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n\t\ttopicName = config.getProperty(\"TopicName\");\r\n\t\ttopicName = createTopic(topicName);\r\n\t\t\r\n\t\tmessageList = Arrays.asList(config.getProperty(\"messages\").split(\"\\\\|\"));\r\n\t}"
] | [
"0.6842741",
"0.68242806",
"0.6620153",
"0.64827174",
"0.63304234",
"0.6321935",
"0.6321279",
"0.63078755",
"0.62754047",
"0.6244242",
"0.61782074",
"0.6161908",
"0.6136226",
"0.6104257",
"0.6045802",
"0.6034322",
"0.6028503",
"0.6027876",
"0.60173434",
"0.5997477",
"0.58760077",
"0.58410037",
"0.58309907",
"0.5826537",
"0.57586753",
"0.57482797",
"0.5718155",
"0.56865215",
"0.5647283",
"0.5639743",
"0.562233",
"0.5618389",
"0.5566425",
"0.5562717",
"0.55443984",
"0.55442774",
"0.5542563",
"0.54700416",
"0.5447258",
"0.54381716",
"0.5342813",
"0.53296375",
"0.5300443",
"0.5290272",
"0.52589804",
"0.52057123",
"0.519993",
"0.51930934",
"0.5170928",
"0.5162592",
"0.5154693",
"0.5154325",
"0.51493156",
"0.5146548",
"0.51462233",
"0.51146233",
"0.50935996",
"0.50837594",
"0.50520784",
"0.50465935",
"0.5040586",
"0.5039065",
"0.50376564",
"0.503618",
"0.50328815",
"0.50314516",
"0.4983828",
"0.49673387",
"0.4962167",
"0.49578497",
"0.49433705",
"0.49408755",
"0.49366373",
"0.49288678",
"0.4891723",
"0.48911452",
"0.48820198",
"0.48741093",
"0.48669723",
"0.48663065",
"0.48623738",
"0.486083",
"0.4860362",
"0.48428488",
"0.4834072",
"0.48275393",
"0.48258764",
"0.48236626",
"0.481998",
"0.48159748",
"0.4808599",
"0.48043728",
"0.48017064",
"0.4798914",
"0.47966594",
"0.47814515",
"0.47792456",
"0.47760284",
"0.47722954",
"0.47716153"
] | 0.70728934 | 0 |
Sorts preferred before acceptable, and orders dialects by usen, usgb, then alphabetical | private void sortDialects()
{
if (dialects.size() > 1)
{
Collections.sort(dialects, new Comparator<RestDynamicSemanticVersion>()
{
@Override
public int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)
{
//This is a semantic with a single nid column, which represents preferred or acceptable.
//The assemblage concept will be something like "US English Dialect"
//If preferred / acceptable is the same, sort on the dialects...
if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())
{
if (o1.semanticChronology != null) //If one chronology is here, they both should be here
{
if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())
{
return -1;
}
else if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())
{
return 1;
}
else if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())
{
return -1;
}
else if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())
{
return 1;
}
else
{
//Some other dialect... just sort on the dialect text
return AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),
Util.readBestDescription(o2.semanticChronology.assemblage.nid), true);
}
}
else
{
//If chronology isn't populated, I can't sort here
return 0;
}
}
else if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())
{
return -1;
}
else if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())
{
return 1;
}
else
{
//should be impossible - not the same, and neither is preferred - must be invalid data.
LogManager.getLogger().warn("Unexpected sort case");
return 0;
}
}
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void DoOrderBy()\n\t{\n\t\tArrayList<Attribute> inAtts = new ArrayList<Attribute>();\n\t\tinAtts.add(new Attribute(\"Int\", \"n_n_nationkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"n_n_name\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"n_n_regionkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"n_n_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Int\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att4\"));\n\n\t\t// These could be more complicated expressions than simple input columns\n\t\tMap<String, String> exprsToCompute = new HashMap<String, String>();\n\t\texprsToCompute.put(\"att1\", \"n_n_nationkey\");\n\t\texprsToCompute.put(\"att2\", \"n_n_name\");\n\t\texprsToCompute.put(\"att3\", \"n_n_regionkey\");\n\t\texprsToCompute.put(\"att4\", \"n_n_comment\");\n\t\t\n\t\t// Order by region key descending then nation name ascending\n\t\tArrayList<SortKeyExpression> sortingKeys = new ArrayList<SortKeyExpression>();\n\t\tsortingKeys.add(new SortKeyExpression(\"Int\", \"n_n_regionkey\", false));\n\t\tsortingKeys.add(new SortKeyExpression(\"Str\", \"n_n_name\", true));\n\t\t\n\t\t// run the selection operation\n\t\ttry\n\t\t{\n\t\t\tnew Order(inAtts, outAtts, exprsToCompute, sortingKeys, \"nation.tbl\", \"out.tbl\", \"g++\", \"cppDir/\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"static String[] sortedAcceptLang(final String acceptLang) {\n \n if (acceptLang == null || acceptLang.equals(\"\")) { throw new IllegalArgumentException(\"acceptLang must be a non-empty string.\"); }\n \n final StringTokenizer tokenizer = new StringTokenizer(acceptLang, \",\");\n final HashMap weightedLangs = new HashMap();\n \n while (tokenizer.hasMoreTokens()) {\n final String token = tokenizer.nextToken();\n String lang = token;\n boolean ignore = false;\n String weight = \"1.0\";\n int index;\n \n /* Language and weighting are devided by \";\". */\n if ((index = token.indexOf(\";\")) != -1) {\n String parsedWeight;\n lang = token.substring(0, index);\n \n /* Weight data. */\n parsedWeight = token.substring(index + 1, token.length());\n parsedWeight = parsedWeight.trim();\n if (parsedWeight.startsWith(\"q=\")) {\n parsedWeight = parsedWeight.substring(2, parsedWeight.length());\n weight = parsedWeight;\n } else {\n /* Format error, flag to ignore token. */\n ignore = true;\n }\n }\n \n if (!ignore) {\n lang = lang.trim();\n \n /* Country and language is devided by \"-\" (optional). */\n if ((index = lang.indexOf(\"-\")) != -1) {\n lang = lang.substring(index + 1, lang.length());\n }\n \n weightedLangs.put(weight, lang);\n }\n }\n \n final Vector sortedLangs = new Vector();\n final String[] sortedKeys = (String[]) weightedLangs.keySet().toArray(new String[weightedLangs.size()]);\n Arrays.sort(sortedKeys, Collections.reverseOrder());\n \n for (int i = 0; i < sortedKeys.length; i++) {\n sortedLangs.add(weightedLangs.get(sortedKeys[i]));\n }\n \n return (String[]) sortedLangs.toArray(new String[sortedLangs.size()]);\n }",
"public void sortCompetitors(){\n\t\t}",
"private static void alphabetize() {\r\n Collections.sort(kwicIndex, String.CASE_INSENSITIVE_ORDER);\r\n }",
"public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }",
"java.lang.String getOrderBy();",
"@Override\n\tpublic int compare(MediaMaster em1, MediaMaster em2) {\n\t\t\tif(em2.getLanguageMaster().getLanguageName() != null && em1.getLanguageMaster().getLanguageName() != null){\n\t\t\t\tif(\"Asc\".equalsIgnoreCase(type)){\n\t\t\t\t\treturn em2.getLanguageMaster().getLanguageName().compareTo(em1.getLanguageMaster().getLanguageName());\n\t\t\t\t}else{\n\t\t\t\t\treturn em1.getLanguageMaster().getLanguageName().compareTo(em2.getLanguageMaster().getLanguageName());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}",
"@Test (priority = 1)\n public void sortAlphabetical(){\n\n for (int i = 0; i < allDepartments.getOptions().size()-1; i++) {\n String current = allDepartments.getOptions().get(i).getText();\n String next = allDepartments.getOptions().get(i+1).getText();\n\n System.out.println(\"comparing: \" + current + \" with \"+ next);\n\n Assert.assertTrue(current.compareTo(next)<=0);\n\n }\n }",
"public String sortBy();",
"private String getOrderBy( List<Integer> listSortBy )\n {\n StringBuffer strOrderBy = new StringBuffer( );\n String strReturn = SuggestUtils.EMPTY_STRING;\n int ncpt = 0;\n\n if ( ( listSortBy != null ) && ( listSortBy.size( ) != 0 ) )\n {\n strOrderBy.append( SQL_ORDER_BY );\n\n for ( Integer sort : listSortBy )\n {\n ncpt++;\n\n switch ( sort )\n {\n case SubmitFilter.SORT_BY_DATE_RESPONSE_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_DATE_RESPONSE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_DATE_RESPONSE_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_DATE_RESPONSE_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_SCORE_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_SCORE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_SCORE_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_SCORE_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_COMMENT_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_COMMENT_ENABLE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_COMMENT_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_COMMENT_ENABLE_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VIEW_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VIEW_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VIEW_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VIEW_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VOTE_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VOTE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VOTE_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VOTE_DESC );\n\n break;\n\n case SubmitFilter.SORT_MANUALLY:\n strOrderBy.append( SQL_FILTER_SORT_MANUALLY );\n\n break;\n\n default:\n break;\n }\n\n if ( ncpt < listSortBy.size( ) )\n {\n strOrderBy.append( \",\" );\n }\n }\n\n strReturn = strOrderBy.toString( );\n\n if ( strReturn.endsWith( \",\" ) )\n {\n strReturn = strReturn.substring( 0, strReturn.length( ) - 1 );\n }\n }\n\n return strReturn;\n }",
"@Override\r\n public int compare(T o1, T o2) {\n if (o1 == o2) {\r\n return 0;\r\n }\r\n\r\n // Different locales are ordered by their display names in the user's\r\n // current locale\r\n Locale locale1 = o1.getLocale();\r\n Locale locale2 = o2.getLocale();\r\n if (!locale1.equals(locale2)) {\r\n String language1 = provider.getLanguage(locale1.getLanguage(), userLocale);\r\n String language2 = provider.getLanguage(locale2.getLanguage(), userLocale);\r\n return language1.compareTo(language2);\r\n }\r\n\r\n // Within the same locale, simply compare the names of the objects\r\n String name1 = o1.getName();\r\n String name2 = o2.getName();\r\n return name1.compareTo(name2);\r\n }",
"@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}",
"public static String getPreferredSortingCriterion(Context context){\n\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);\n String keyForSortingCriterion = context.getString(R.string.pref_sort_criterion_key);\n\n return sp.getString(keyForSortingCriterion,getDefaultSortingCriterion(context));\n }",
"private Comparator<SourceVo> sourceNameComparator(String lang) {\n return (s1, s2) -> {\n String n1 = s1.getDesc(lang) != null ? s1.getDesc(lang).getName() : null;\n String n2 = s2.getDesc(lang) != null ? s2.getDesc(lang).getName() : null;\n return TextUtils.compareIgnoreCase(n1, n2);\n };\n }",
"@Override\n\tpublic String getOrder() {\n\t\treturn \"zjlxdm,asc\";\n\t}",
"public static void projectInventory() {\n\n String ProductBrandunsorted = \"dca\";\n\n char[] ProductBrandsorted = ProductBrandunsorted.toCharArray();\n\n Arrays.sort(ProductBrandsorted);\n System.out.println(ProductBrandsorted);\n\n\n String[] proBrandsSorted = {\"bi\", \"apple\", \"free\"};\n\n\n Arrays.sort(proBrandsSorted);\n //loop\n for (String name : proBrandsSorted) {\n System.out.println(name);\n\n }\n }",
"private void sortChannelsName(List<Channel> channels) {\n Collections.sort(channels, new Comparator<Channel>() {\n public int compare(Channel c1, Channel c2) {\n return c1.getName().compareToIgnoreCase(c2.getName());\n }\n });\n }",
"public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\n }",
"public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"protected void generateOrderBy( SQLQueryModel query, LogicalModel model, List<Order> orderBy,\n DatabaseMeta databaseMeta, String locale, Map<LogicalTable, String> tableAliases, Map<String, String> columnsMap,\n Map<String, Object> parameters, boolean genAsPreparedStatement ) {\n if ( orderBy != null ) {\n for ( Order orderItem : orderBy ) {\n LogicalColumn businessColumn = orderItem.getSelection().getLogicalColumn();\n String alias = null;\n if ( columnsMap != null ) {\n // The column map is a unique mapping of Column alias to the column ID\n // Here we have the column ID and we need the alias.\n // We need to do the order by on the alias, not the column name itself.\n // For most databases, it can be both, but the alias is more standard.\n //\n // Using the column name and not the alias caused an issue on Apache Derby.\n //\n for ( String key : columnsMap.keySet() ) {\n String value = columnsMap.get( key );\n if ( value.equals( businessColumn.getId() ) ) {\n // Found it: the alias is the key\n alias = key;\n break;\n }\n }\n }\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, orderItem.getSelection(), tableAliases, parameters, genAsPreparedStatement,\n databaseMeta, locale );\n query.addOrderBy( sqlAndTables.getSql(), databaseMeta.quoteField( alias ), orderItem.getType() != Type.ASC\n ? OrderType.DESCENDING : null );\n }\n }\n }",
"public static void main(String[] args) {\n String[] orgs={\"birlasoft\",\"ZOHO\",\"Cognizant\",\"infosys\",\"amazon\"};\n Selection.sort(orgs);\n for(String yet:orgs)\n {\n \t System.out.println(yet);\n }\n \t\t \n \n\t}",
"Map<String, org.springframework.batch.item.database.Order> genBatchOrderByFromSort(TableFields tableFields, Sort sort);",
"private static String getDefaultSortingCriterion(Context context){\n return context.getString(R.string.pref_sort_criterion_default);\n }",
"void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }",
"public void sortProposals() {\n\n\t}",
"private static void sortHelperMSD(String[] asciis, int start, int end, int index) {\n // Optional MSD helper method for optional MSD radix sort\n return;\n }",
"protected void prepareOrderBy(String query, QueryConfig config) {\n }",
"public String sortOrder();",
"public void sortScoresDescendently(){\n this.langsScores.sort((LangScoreBankUnit o1, LangScoreBankUnit o2) -> {\n return Double.compare(o2.getScore(),o1.getScore());\n });\n }",
"public String alienOrder(String[] words) {\n if (words == null) return null;\n\n\n Map<Character, Set<Character>> graph_hm = new HashMap<>();\n\n // build the graph\n for (int i = 0; i < words.length; i++) {\n for (int j = 0; j < words[i].length(); j++) {\n char c = words[i].charAt(j);\n if (!graph_hm.containsKey(c)) {\n // create a new Set for each vertex\n graph_hm.put(c, new HashSet<>());\n }\n }\n if (i > 0) {\n // order every two words, they must follow lexi order\n // DAG dependencies are built here\n getOrder(words[i - 1], words[i], graph_hm);\n }\n }\n\n // shellSort the graph\n return topSort(graph_hm);\n\n }",
"public void sort()\n {\n RecordComparator comp = new RecordComparator(Context.getCurrent().getApplicationLocale());\n if (comp.hasSort)\n sort(comp);\n }",
"private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }",
"private void sortChannelsType(List<Channel> channels) {\n Collections.sort(channels, new Comparator<Channel>() {\n public int compare(Channel c1, Channel c2) {\n int res = c1.getType().compareTo(c2.getType());\n if (res != 0) {\n return res;\n }\n return c1.getName().compareToIgnoreCase(c2.getName());\n }\n });\n }",
"@Override\n public int compare(Student o1, Student o2) {\n Collator col = Collator.getInstance(new Locale(\"cs\",\"CZ\"));\n return col.compare(o1.getLastName(), o2.getLastName());\n }",
"public void ordenarHabitantesAsc() {\r\n Collections.sort(ciudades, new HabitantesComparator());\r\n }",
"@Override\n public LinkedList<String> orderAlphabetically(){\n LinkedList<String> stringLL = super.orderAlphabetically();\n stringLL.add(\"Years Until Tenure: \" + m_yearsUntilTenure);\n Collections.sort(stringLL);\n return stringLL;\n }",
"public static void sortByPopular(){\n SORT_ORDER = POPULAR_PATH;\n }",
"@java.lang.Deprecated\n java.lang.String getOrderBy();",
"protected void sortCode() {\n for (int i = 1; i < codeCount; i++) {\n int who = i;\n for (int j = i + 1; j < codeCount; j++) {\n if (code[j].getFileName().compareTo(code[who].getFileName()) < 0) {\n who = j; // this guy is earlier in the alphabet\n }\n }\n if (who != i) { // swap with someone if changes made\n SketchCode temp = code[who];\n code[who] = code[i];\n code[i] = temp;\n }\n }\n }",
"public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }",
"public static JwComparator<AcPost> getUpuShortNameComparator()\n {\n return AcPostTools.instance.getUpuShortNameComparator();\n }",
"public static void main(String[] args) {\n\t\tList<Developer> listDevs = getDevelopers();\r\n\r\n\t\tSystem.out.println(\"Before Sort\");\r\n\t\tfor (Developer developer : listDevs) {\r\n\t\t\tSystem.out.println(developer.getName());\r\n\t\t}\r\n\t\t\r\n\t\tlistDevs.sort( new Comparator<Developer>(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Developer o1, Developer o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn o2.getAge()-o1.getAge();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tlistDevs.sort((Developer o1, Developer o2) -> o1.getName().compareTo(o2.getName()));\r\n\t\t\r\n\t\tSystem.out.println(\"Aftrer Sort\");\r\n\t\tfor (Developer developer : listDevs) {\r\n\t\t\tSystem.out.println(developer.getName());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\tList<String> lines = Arrays.asList(\"spring\", \"node\", \"mkyong\",\"spring\",\"spring\");\r\n\t\t\r\n\t\tlines.stream().filter(line -> line.equals(\"spring\")).forEach(line -> System.out.println(\"line::\"+line));\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\tMap<String, Long> result = lines.stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting()));\r\n\t\t\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\t//System.out.println(result.entrySet().stream().sorted(Map.Entry.<String,Integer>comparingByKey().reversed()).);\r\n\t\t\r\n\t\tStream<String> language = Stream.of(\"java\", \"python\", \"node\", null, \"ruby\", null, \"php\");\r\n\t\tList langList = language.collect(Collectors.toList());\r\n\t\tlangList.forEach(new Consumer<String>()\r\n\t\t{\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void accept(String t) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tif(t!=null)\r\n\t\t\t\tSystem.out.println(\"length::\"+t.length());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tlangList.forEach(x -> System.out.println(\"value of x::\"+x));\r\n\t\t\r\n\t}",
"@Override\n\tprotected String getDefaultOrderBy() {\n\t\treturn \"date asc\";\n\t}",
"public int compare(Object o1, Object o2) {\n/* 25 */ Alphabet a1 = (Alphabet)o1;\n/* 26 */ Alphabet a2 = (Alphabet)o2;\n/* */ \n/* 28 */ return a2.order - a1.order;\n/* */ }",
"public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }",
"public String getSortOrder();",
"public interface OrderResolver {\n String resolve(String lang, String alias, String property, Criteria.OrderMode mode);\n}",
"public void sortAlphabetically()\r\n {\r\n PrintWriter output;\r\n int i, x, t1;\r\n String t0;\r\n \r\n //insertion sort\r\n for (x = 1; x < countries.length; x++) //iterates through\r\n {\r\n t0 = countries[x]; //stores the temps\r\n t1 = population[x];\r\n i = x - 1; //sets i to the previous element\r\n while (i >= 0) {\r\n if (t0.compareTo(countries[i]) > 0) //if previous is already sorted(greater means it is higher on the alphabet(e.g. t0 could be 'c', countries[i] 'e'))\r\n break;\r\n countries[i + 1] = countries[i]; //if not, swap the positions\r\n population[i + 1] = population[i];\r\n i--;\r\n }\r\n countries[i + 1] = t0; //sets it back to temp\r\n population[i + 1] = t1;\r\n }\r\n try\r\n {\r\n output = new PrintWriter (new FileWriter (\"sortedByCountry.txt\")); //saves\r\n \r\n //prints to the file\r\n for (int a = 0 ; a < countries.length ; a++)\r\n output.printf(\"%-1s \\t\\t\\t\\t %,d %n\", countries[a], population[a]);\r\n output.close (); //closes stream\r\n }\r\n catch (IOException e)\r\n {\r\n JOptionPane.showMessageDialog (null, \"Something went wrong with the input or output operations!\"); //error message\r\n }\r\n }",
"private void sortCoreTypes() {\n\t\tArrays.sort(coreBuiltin, (o1, o2) -> Long.compare(o1.id, o2.id));\n\t}",
"private void sortTravelContactsByCitizenship() {\n Collections.sort(this.contacts, new Comparator<User>(){\n public int compare(User obj1, User obj2) {\n // ## Ascending order\n return obj1.getSortingStringName().compareToIgnoreCase(obj2.getSortingStringName());\n }\n });\n }",
"public static void sortCompilationProposal(List<ICompletionProposal> prop){\r\n\t\tCollections.sort(prop,new Comparator<ICompletionProposal>(){\r\n\t\t\tpublic int compare(ICompletionProposal o1, ICompletionProposal o2){\r\n\t\t\t\treturn o1.getDisplayString().compareTo(o2.getDisplayString());\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Test\n public void Test4179216() throws Exception {\n RuleBasedCollator coll = (RuleBasedCollator)Collator.getInstance(Locale.US);\n coll = new RuleBasedCollator(coll.getRules()\n + \" & C < ch , cH , Ch , CH < cat < crunchy\");\n String testText = \"church church catcatcher runcrunchynchy\";\n CollationElementIterator iter = coll.getCollationElementIterator(\n testText);\n\n // test that the \"ch\" combination works properly\n iter.setOffset(4);\n int elt4 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.reset();\n int elt0 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(5);\n int elt5 = CollationElementIterator.primaryOrder(iter.next());\n\n // Compares and prints only 16-bit primary weights.\n if (elt4 != elt0 || elt5 != elt0) {\n errln(String.format(\"The collation elements at positions 0 (0x%04x), \" +\n \"4 (0x%04x), and 5 (0x%04x) don't match.\",\n elt0, elt4, elt5));\n }\n\n // test that the \"cat\" combination works properly\n iter.setOffset(14);\n int elt14 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(15);\n int elt15 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(16);\n int elt16 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(17);\n int elt17 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(18);\n int elt18 = CollationElementIterator.primaryOrder(iter.next());\n\n iter.setOffset(19);\n int elt19 = CollationElementIterator.primaryOrder(iter.next());\n\n // Compares and prints only 16-bit primary weights.\n if (elt14 != elt15 || elt14 != elt16 || elt14 != elt17\n || elt14 != elt18 || elt14 != elt19) {\n errln(String.format(\"\\\"cat\\\" elements don't match: elt14 = 0x%04x, \" +\n \"elt15 = 0x%04x, elt16 = 0x%04x, elt17 = 0x%04x, \" +\n \"elt18 = 0x%04x, elt19 = 0x%04x\",\n elt14, elt15, elt16, elt17, elt18, elt19));\n }\n\n // now generate a complete list of the collation elements,\n // first using next() and then using setOffset(), and\n // make sure both interfaces return the same set of elements\n iter.reset();\n\n int elt = iter.next();\n int count = 0;\n while (elt != CollationElementIterator.NULLORDER) {\n ++count;\n elt = iter.next();\n }\n\n String[] nextElements = new String[count];\n String[] setOffsetElements = new String[count];\n int lastPos = 0;\n\n iter.reset();\n elt = iter.next();\n count = 0;\n while (elt != CollationElementIterator.NULLORDER) {\n nextElements[count++] = testText.substring(lastPos, iter.getOffset());\n lastPos = iter.getOffset();\n elt = iter.next();\n }\n count = 0;\n for (int i = 0; i < testText.length(); ) {\n iter.setOffset(i);\n lastPos = iter.getOffset();\n elt = iter.next();\n setOffsetElements[count++] = testText.substring(lastPos, iter.getOffset());\n i = iter.getOffset();\n }\n for (int i = 0; i < nextElements.length; i++) {\n if (nextElements[i].equals(setOffsetElements[i])) {\n logln(nextElements[i]);\n } else {\n errln(\"Error: next() yielded \" + nextElements[i] + \", but setOffset() yielded \"\n + setOffsetElements[i]);\n }\n }\n }",
"private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }",
"public void sortMatches();",
"public String doSort();",
"@Override\n public int compare(String o1, String o2) {\n int res = String.CASE_INSENSITIVE_ORDER.compare(o1, o2);\n if (res == 0) {\n res = o1.compareTo(o2);\n }\n return res;\n }",
"public void sortChannels(List<Channel> channels) {\n if (channels != null) {\n // Check settings for preferred channel order.\n Settings settings = new SettingsDatabaseManager(context).getSettings();\n switch (settings.getChannelSettings()) {\n case ALPHABETICAL:\n sortChannelsName(channels);\n break;\n case TYPE:\n sortChannelsType(channels);\n break;\n case TYPE_AND_FACULTY:\n sortChannelsTypeFaculty(channels);\n break;\n }\n }\n }",
"@Test\n public void testSortVariantConsequenceDict() {\n final Map<String, Set<String>> before = new HashMap<>();\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"NOC2L\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"KLHL17\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"PLEKHN1\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"PERM1\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.DUP_PARTIAL, \"SAMD11\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"HES4\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.TSS_DUP, \"ISG15\");\n\n final Map<String, Object> expectedAfter = new HashMap<>();\n expectedAfter.put(GATKSVVCFConstants.DUP_PARTIAL, Arrays.asList(\"SAMD11\"));\n expectedAfter.put(GATKSVVCFConstants.TSS_DUP, Arrays.asList(\"ISG15\"));\n expectedAfter.put(GATKSVVCFConstants.LOF, Arrays.asList(\"HES4\", \"KLHL17\", \"NOC2L\", \"PERM1\", \"PLEKHN1\"));\n\n Assert.assertEquals(SVAnnotateEngine.sortVariantConsequenceDict(before), expectedAfter);\n }",
"private List<PricingRule> orderPricingRules(Set<PricingRule> pricingRules) {\n \tList<PricingRule> pricingRulesList = pricingRules.stream().collect(Collectors.toList());\n \tCollections.sort(pricingRulesList, new Comparator<PricingRule>() {\n\t\t\tpublic int compare(PricingRule o1, PricingRule o2) {\n\t\t\t\treturn ((o2.getClass().getAnnotation(PricingRuleOrder.class).value()) - (o1.getClass().getAnnotation(PricingRuleOrder.class).value()));\n\t\t\t}\n\t\t});\n\t\treturn pricingRulesList;\n }",
"public static List<Concept> sortAntiretrovirals(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals());\r\n }",
"public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }",
"private void sort() {\n\t\tCollections.sort(this.entities, comparator);\n\t}",
"private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }",
"public IDataBrowserSortStrategy newGuiSortStrategy(Locale sortLocale)\n {\n this.lastSortStrategy = new SortStrategy(this, null, sortLocale);\n return this.lastSortStrategy;\n }",
"public static void dimension_sort() { // sort the dimensions according to their effect to GCP\n\t\tfor (int i = 0;i < dims-1;i++) {\n\t\t\tdimension[i] = (byte) i;\n\t\t}\n\t\tboolean swapped = true;\n\t\tint i=0;\n\t\tbyte temp;\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\ti++;\n\t\t\tfor (int j = 0; j < dimension.length-i;j++) { // smaller range, put it the front\n\t\t\t\tif (cardinalities[dimension[j]] > cardinalities[dimension[j+1]]) {\n\t\t\t\t\ttemp = dimension[j];\n\t\t\t\t\tdimension[j] = dimension[j+1];\n\t\t\t\t\tdimension[j+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void completeOrderByDirective_Ascending(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {\n\t\t// subclasses may override\n\t}",
"public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }",
"@Override\n\tpublic int getOrder() {\n\t\treturn Ordered.HIGHEST_PRECEDENCE + 10000;\n\t}",
"public static JwComparator<AcPost> getUpuCompliantComparator()\n {\n return AcPostTools.instance.getUpuCompliantComparator();\n }",
"private List<AccessTypeInjector> getAccessTypeOrderByPriority(boolean ascending) {\n List<AccessTypeInjector> list = new ArrayList<AccessTypeInjector>();\n for (AccessTypeInjector injector : accessTypeInjectors) {\n list.add(injector);\n }\n Collections.sort(list);\n if (!ascending) {\n Collections.reverse(list);\n }\n return list;\n }",
"public void sortByWordLengthAsc() {\r\n\t\tcomparator = new WordLengthAsc();\r\n\t}",
"@Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }",
"public String alienOrder(String[] words) {\n int[] indegree = new int[26];\n //adj list--hashmap\n HashMap<Character, Set<Character>> adjList = new HashMap();\n // 2 major steps\n buildGraph(words,indegree,adjList );\n return topologicalSortDfs(indegree,adjList );\n \n }",
"private void sortResults(List<String> results) {\r\n\t\tif (comparator == null) {\r\n\t\t\tCollections.sort(results);\r\n\t\t} else {\r\n\t\t\tCollections.sort(results, comparator);\r\n\t\t}\r\n\t}",
"private void sortChannelsTypeFaculty(List<Channel> channels) {\n Collections.sort(channels, new Comparator<Channel>() {\n public int compare(Channel c1, Channel c2) {\n int res = c1.getType().compareTo(c2.getType());\n if (res != 0) {\n return res;\n }\n if (c1.getType().equals(ChannelType.LECTURE)) {\n res = ((Lecture) c1).getFaculty().compareTo(((Lecture) c2).getFaculty());\n if (res != 0) {\n return res;\n }\n }\n return c1.getName().compareToIgnoreCase(c2.getName());\n }\n });\n }",
"public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tList<Product> prodList = new ArrayList<>();\n\t\tprodList.add(new Product(12, \"Refrigerator\", \"Whirlpool\", 43000.00f));\n\t\tprodList.add(new Product(16, \"Mobile\", \"Samsung\", 18000.00f));\n\t\tprodList.add(new Product(11, \"Laptop\", \"Lenovo\", 28300.00f));\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before Sorting\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList);\n\t\t\n\t\tSystem.out.println(\"After Sorting\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tProductNameComparator pnc = new ProductNameComparator();\n\t\tCollections.sort(prodList, pnc);\n\t\t\n\t\tSystem.out.println(\"After Sorting as per name\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList,Collections.reverseOrder());\n\t\t\n\t\tSystem.out.println(\"After Sorting as per desc id\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList,Collections.reverseOrder(pnc));\n\t\t\n\t\tSystem.out.println(\"After Sorting as per desc name\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\t\n\t\tCollections.sort(prodList, (p1,p2)-> p1.getPrice()>p2.getPrice()?1:-1 );\n\t\tSystem.out.println(\"After Sorting as per price\");\n\t\tprodList.forEach(p->System.out.println(p));\n\t\t\n\t\tCollections.sort(prodList, (p1,p2)-> p1.getPrice()<p2.getPrice()?1:-1 );\n\t\tSystem.out.println(\"After Sorting as per desc price\");\n\t\tprodList.forEach(System.out::println);\n\t\t\n\t}",
"@VTID(28)\n boolean getSortUsingCustomLists();",
"@Override\n\tpublic String sort(String content) {\n\t\treturn null;\n\t}",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"@Test\n\tpublic void testSortCapitalSpecialChars() throws SortException {\n\t\tString[] input = new String[] { \"F**\", \"!F*\", \")JD\", \"$GA\", \"*DE\" };\n\t\tList<String> arrayList = sortApplication.sortCapitalSpecialChars(input);\n\t\tassertEquals(\"!F*\", arrayList.get(0));\n\t\tassertEquals(\"$GA\", arrayList.get(1));\n\t\tassertEquals(\")JD\", arrayList.get(2));\n\t\tassertEquals(\"*DE\", arrayList.get(3));\n\t\tassertEquals(\"F**\", arrayList.get(4));\n\t}",
"public static JwComparator<AcUspsInternationalClaim> getIncorrectKilogramsComparator()\n {\n return AcUspsInternationalClaimTools.instance.getIncorrectKilogramsComparator();\n }",
"public String getSortText() {\n if (language.getMimeType().equals(CSS_MIMETYPE)) {\n return CSS_SORT_TEXT;\n } else if (language.getMimeType().equals(JAVASCRIPT_MIMETYPE)) {\n return JAVASCRIPT_SORT_TEXT;\n } else if (language.getMimeType().equals(HTML_MIMETYPE)) {\n return HTML_SORT_TEXT;\n } else if (language.getMimeType().equals(YAML_MIMETYPE)) {\n return YAML_SORT_TEXT;\n } else if (language.getMimeType().equals(RUBY_MIMETYPE)) {\n return RUBY_SORT_TEXT;\n } else if (language.getMimeType().equals(PHP_MIME_TYPE)) {\n return PHP_SORT_TEXT;\n } else {\n return OTHER_SORT_TEXT + getName();\n }\n\n }",
"@Override\n\tpublic List<HqProvinceOrder> listAllInfo(String orderEng) {\n\t\tSort sort = Sort.by(Sort.Direction.DESC, \"orderNo\");//降序排列\n\t\tif(orderEng.isEmpty() || orderEng.equalsIgnoreCase(\"asc\")) {\n\t\t\tsort = Sort.by(Sort.Direction.ASC, \"orderNo\");//升序排列\n\t\t}\n\t\treturn hpDao.findAll(sort);\n\t}",
"JDKSort() {\n }",
"protected List<Order> getOrdering(Path<?> t, CriteriaBuilder cb) {\r\n if (sortPropertyIds == null || sortPropertyIds.length == 0) {\r\n sortPropertyIds = nativeSortPropertyIds;\r\n sortPropertyAscendingStates = nativeSortPropertyAscendingStates;\r\n }\r\n \r\n ArrayList<Order> ordering = new ArrayList<Order>();\r\n \tif (sortPropertyIds == null || sortPropertyIds.length == 0) return ordering;\r\n \t\r\n\t\tfor (int curItem = 0; curItem < sortPropertyIds.length; curItem++ ) {\r\n\t \tfinal String id = (String)sortPropertyIds[curItem];\r\n\t\t\tif (sortPropertyAscendingStates[curItem]) {\r\n\t\t\t\tordering.add(cb.asc(t.get(id)));\r\n\t\t\t} else {\r\n\t\t\t\tordering.add(cb.desc(t.get(id)));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ordering;\r\n\t}",
"public static JwComparator<AcPost> getUpuCodeComparator()\n {\n return AcPostTools.instance.getUpuCodeComparator();\n }",
"public Map findAvailableSorters(INavigatorContentDescriptor theSource);",
"public static Comparator<Term> byLexicographicOrder()\n\t{\n\t\tComparator<Term> comp = new byLexicographicOrder();\n\t\treturn comp;\n\t}",
"@Override\n\t\tpublic int compare(String o1, String o2) {\n\t\t\treturn sort(o1).compareTo(sort(o2));\n\t\t}",
"public static void changeOrder(String order){\n switch (order) {\n case \"delais\":\n ordered = \"delais DESC\";\n break;\n case \"date\":\n ordered = \"date_creation DESC\";\n break;\n case \"nom\":\n ordered = \"nom_annonce\";\n break;\n }\n }",
"@Override\n public void sortList() {\n if (null != entityList) {\n Collections.sort(entityList, new Comparator<Country>() {\n @Override\n public int compare(Country c1, Country c2) {\n return c1.getCountryName().compareTo(c2.getCountryName());\n }\n });\n }\n }",
"private String doSortOrder(SlingHttpServletRequest request) {\n RequestParameter sortOnParam = request.getRequestParameter(\"sortOn\");\n RequestParameter sortOrderParam = request.getRequestParameter(\"sortOrder\");\n String sortOn = \"sakai:filename\";\n String sortOrder = \"ascending\";\n if (sortOrderParam != null\n && (sortOrderParam.getString().equals(\"ascending\") || sortOrderParam.getString()\n .equals(\"descending\"))) {\n sortOrder = sortOrderParam.getString();\n }\n if (sortOnParam != null) {\n sortOn = sortOnParam.getString();\n }\n return \" order by @\" + sortOn + \" \" + sortOrder;\n }",
"public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }",
"public String getIdxSearchSort() {\n Preferences prefs = getPreferences();\n return prefs.get(PROP_SEARCH_SORT, \"A\"); // NOI18N\n }",
"public static JwComparator<AcCustodySummaryVo> getApplicableKilogramsComparator()\n {\n return AcCustodySummaryVoTools.instance.getApplicableKilogramsComparator();\n }",
"static public java.lang.String genComparisons (org.apache.spark.sql.catalyst.expressions.codegen.CodegenContext ctx, scala.collection.Seq<org.apache.spark.sql.catalyst.expressions.SortOrder> ordering) { throw new RuntimeException(); }",
"public String sortOriginOrReturn();",
"public static void resetPreferredSortingCriterion(Context context){\n\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sp.edit();\n\n String keyForSortingCriterion = context.getString(R.string.pref_sort_criterion_key);\n\n editor.remove(keyForSortingCriterion);\n editor.apply();\n\n }",
"public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs());\r\n }"
] | [
"0.66486806",
"0.6075295",
"0.5989003",
"0.5873064",
"0.5786792",
"0.575877",
"0.5576743",
"0.5552388",
"0.5547131",
"0.54627603",
"0.5449284",
"0.5407427",
"0.53682923",
"0.53494596",
"0.53442425",
"0.5331625",
"0.5329707",
"0.5319091",
"0.52993613",
"0.5294628",
"0.52631587",
"0.52312315",
"0.5230748",
"0.5223689",
"0.5213756",
"0.5208632",
"0.5198478",
"0.51927894",
"0.51903564",
"0.51870203",
"0.5175325",
"0.51606023",
"0.51554954",
"0.5154426",
"0.5152199",
"0.5151637",
"0.51271915",
"0.5118387",
"0.5115337",
"0.50998217",
"0.5097524",
"0.50721425",
"0.5063909",
"0.50539243",
"0.5048192",
"0.50447106",
"0.5044025",
"0.503089",
"0.5024367",
"0.5020422",
"0.50203055",
"0.5014238",
"0.5012111",
"0.50117767",
"0.5009696",
"0.50077724",
"0.50016016",
"0.49947304",
"0.49770004",
"0.49699256",
"0.49680552",
"0.4963351",
"0.4957832",
"0.49564368",
"0.49484146",
"0.4936448",
"0.4932162",
"0.49306437",
"0.49305588",
"0.49295735",
"0.49229577",
"0.49039182",
"0.48984534",
"0.4898202",
"0.4894879",
"0.4893508",
"0.48920438",
"0.48912844",
"0.48876202",
"0.48861915",
"0.48742253",
"0.48707402",
"0.48691562",
"0.48660535",
"0.48620164",
"0.4861376",
"0.48591787",
"0.48579112",
"0.48574802",
"0.48560524",
"0.48523986",
"0.48503083",
"0.4841452",
"0.4837525",
"0.48330948",
"0.4820363",
"0.4819454",
"0.48165888",
"0.48094854",
"0.480514"
] | 0.71702 | 0 |
This is a semantic with a single nid column, which represents preferred or acceptable. The assemblage concept will be something like "US English Dialect" If preferred / acceptable is the same, sort on the dialects... | @Override
public int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)
{
if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())
{
if (o1.semanticChronology != null) //If one chronology is here, they both should be here
{
if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())
{
return -1;
}
else if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())
{
return 1;
}
else if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())
{
return -1;
}
else if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())
{
return 1;
}
else
{
//Some other dialect... just sort on the dialect text
return AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),
Util.readBestDescription(o2.semanticChronology.assemblage.nid), true);
}
}
else
{
//If chronology isn't populated, I can't sort here
return 0;
}
}
else if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())
{
return -1;
}
else if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())
{
return 1;
}
else
{
//should be impossible - not the same, and neither is preferred - must be invalid data.
LogManager.getLogger().warn("Unexpected sort case");
return 0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sortDialects()\n\t{\n\t\tif (dialects.size() > 1)\n\t\t{\n\t\t\tCollections.sort(dialects, new Comparator<RestDynamicSemanticVersion>()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\t//This is a semantic with a single nid column, which represents preferred or acceptable. \n\t\t\t\t\t//The assemblage concept will be something like \"US English Dialect\"\n\t\t\t\t\t\n\t\t\t\t\t//If preferred / acceptable is the same, sort on the dialects...\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"public interface LdCDef extends Classification {\n\n /** The empty array for no sisters. */\n String[] EMPTY_SISTERS = new String[]{};\n\n /** The empty map for no sub-items. */\n @SuppressWarnings(\"unchecked\")\n Map<String, Object> EMPTY_SUB_ITEM_MAP = (Map<String, Object>)Collections.EMPTY_MAP;\n\n /**\n * はいいいえを示す\n */\n public enum YesNo implements LdCDef {\n /** y */\n y(\"y\", \"y\", EMPTY_SISTERS)\n ,\n /** n */\n n(\"n\", \"n\", EMPTY_SISTERS)\n ;\n private static final Map<String, YesNo> _codeValueMap = new HashMap<String, YesNo>();\n static {\n for (YesNo value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private YesNo(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.YesNo; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static YesNo codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof YesNo) { return (YesNo)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static YesNo nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<YesNo> listAll() {\n return new ArrayList<YesNo>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<YesNo> groupOf(String groupName) {\n return new ArrayList<YesNo>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 蔵書の状態を示す\n */\n public enum CollectionStatus implements LdCDef {\n /** NOR: 通常状態を示す */\n NOR(\"NOR\", \"NOR\", EMPTY_SISTERS)\n ,\n /** WAT: 待ち状態を示す */\n WAT(\"WAT\", \"WAT\", EMPTY_SISTERS)\n ,\n /** OUT: 貸し出し中を示す */\n OUT(\"OUT\", \"OUT\", EMPTY_SISTERS)\n ;\n private static final Map<String, CollectionStatus> _codeValueMap = new HashMap<String, CollectionStatus>();\n static {\n for (CollectionStatus value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private CollectionStatus(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.CollectionStatus; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static CollectionStatus codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof CollectionStatus) { return (CollectionStatus)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static CollectionStatus nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<CollectionStatus> listAll() {\n return new ArrayList<CollectionStatus>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<CollectionStatus> groupOf(String groupName) {\n return new ArrayList<CollectionStatus>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 登録モジュールタイプ\n */\n public enum RegisterModuleType implements LdCDef {\n /** Online: Online Module */\n Online(\"OLN\", \"Online\", EMPTY_SISTERS)\n ,\n /** Batch: Batch Module */\n Batch(\"BTC\", \"Batch\", EMPTY_SISTERS)\n ;\n private static final Map<String, RegisterModuleType> _codeValueMap = new HashMap<String, RegisterModuleType>();\n static {\n for (RegisterModuleType value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private RegisterModuleType(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.RegisterModuleType; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static RegisterModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof RegisterModuleType) { return (RegisterModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static RegisterModuleType nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<RegisterModuleType> listAll() {\n return new ArrayList<RegisterModuleType>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<RegisterModuleType> groupOf(String groupName) {\n return new ArrayList<RegisterModuleType>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 更新モジュールタイプ\n */\n public enum UpdateModuleType implements LdCDef {\n /** Online: Online Module */\n Online(\"OLN\", \"Online\", EMPTY_SISTERS)\n ,\n /** Batch: Batch Module */\n Batch(\"BTC\", \"Batch\", EMPTY_SISTERS)\n ;\n private static final Map<String, UpdateModuleType> _codeValueMap = new HashMap<String, UpdateModuleType>();\n static {\n for (UpdateModuleType value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private UpdateModuleType(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.UpdateModuleType; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static UpdateModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof UpdateModuleType) { return (UpdateModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static UpdateModuleType nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<UpdateModuleType> listAll() {\n return new ArrayList<UpdateModuleType>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<UpdateModuleType> groupOf(String groupName) {\n return new ArrayList<UpdateModuleType>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n public enum DefMeta implements ClassificationMeta {\n /** はいいいえを示す */\n YesNo\n ,\n /** 蔵書の状態を示す */\n CollectionStatus\n ,\n /** 登録モジュールタイプ */\n RegisterModuleType\n ,\n /** 更新モジュールタイプ */\n UpdateModuleType\n ;\n public String classificationName() {\n return name(); // same as definition name\n }\n\n public Classification codeOf(Object code) {\n if (\"YesNo\".equals(name())) { return LdCDef.YesNo.codeOf(code); }\n if (\"CollectionStatus\".equals(name())) { return LdCDef.CollectionStatus.codeOf(code); }\n if (\"RegisterModuleType\".equals(name())) { return LdCDef.RegisterModuleType.codeOf(code); }\n if (\"UpdateModuleType\".equals(name())) { return LdCDef.UpdateModuleType.codeOf(code); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public Classification nameOf(String name) {\n if (\"YesNo\".equals(name())) { return LdCDef.YesNo.valueOf(name); }\n if (\"CollectionStatus\".equals(name())) { return LdCDef.CollectionStatus.valueOf(name); }\n if (\"RegisterModuleType\".equals(name())) { return LdCDef.RegisterModuleType.valueOf(name); }\n if (\"UpdateModuleType\".equals(name())) { return LdCDef.UpdateModuleType.valueOf(name); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> listAll() {\n if (\"YesNo\".equals(name())) { return toClassificationList(LdCDef.YesNo.listAll()); }\n if (\"CollectionStatus\".equals(name())) { return toClassificationList(LdCDef.CollectionStatus.listAll()); }\n if (\"RegisterModuleType\".equals(name())) { return toClassificationList(LdCDef.RegisterModuleType.listAll()); }\n if (\"UpdateModuleType\".equals(name())) { return toClassificationList(LdCDef.UpdateModuleType.listAll()); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> groupOf(String groupName) {\n if (\"YesNo\".equals(name())) { return toClassificationList(LdCDef.YesNo.groupOf(groupName)); }\n if (\"CollectionStatus\".equals(name())) { return toClassificationList(LdCDef.CollectionStatus.groupOf(groupName)); }\n if (\"RegisterModuleType\".equals(name())) { return toClassificationList(LdCDef.RegisterModuleType.groupOf(groupName)); }\n if (\"UpdateModuleType\".equals(name())) { return toClassificationList(LdCDef.UpdateModuleType.groupOf(groupName)); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n @SuppressWarnings(\"unchecked\")\n private List<Classification> toClassificationList(List<?> clsList) {\n return (List<Classification>)clsList;\n }\n\n public ClassificationCodeType codeType() {\n if (\"YesNo\".equals(name())) { return ClassificationCodeType.String; }\n if (\"CollectionStatus\".equals(name())) { return ClassificationCodeType.String; }\n if (\"RegisterModuleType\".equals(name())) { return ClassificationCodeType.String; }\n if (\"UpdateModuleType\".equals(name())) { return ClassificationCodeType.String; }\n return ClassificationCodeType.String; // as default\n }\n\n public ClassificationUndefinedHandlingType undefinedHandlingType() {\n if (\"YesNo\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"CollectionStatus\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"RegisterModuleType\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"UpdateModuleType\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n return ClassificationUndefinedHandlingType.LOGGING; // as default\n }\n }\n}",
"private Nation determineNation(final String nation) {\n return Nation.valueOf(nation.replace(\" \", \"_\").toUpperCase());\n }",
"public String getKind(State finalState, String lexeme) {\r\n switch (finalState) {\r\n case ST_ZERO:\r\n kind=\"IntegerLiteral\";\r\n break;\r\n case ST_NUM:\r\n kind=\"IntegerLiteral\";\r\n //check range for the special case\r\n if(_isLastTokenMinus){\r\n try {\r\n long val=Long.parseLong(lexeme);\r\n if(val <= 2147483648l){\r\n kind=\"IntegerLiteral\";\r\n } else {\r\n kind=\"ERROR\";\r\n System.err.println(\"Number out of range.\");\r\n } // else\r\n } catch (NumberFormatException e){\r\n kind=\"ERROR\";\r\n } // catch\r\n } else {\r\n try {\r\n Integer.parseInt(lexeme);\r\n } catch (NumberFormatException e){ \r\n // out of range\r\n kind=\"ERROR\";\r\n System.err.println(\"Number out of range.\");\r\n } // catch\r\n } // else\r\n break;\r\n case ST_BOF:\r\n kind=\"BOF\";\r\n break;\r\n case ST_EOF:\r\n kind=\"EOF\";\r\n break;\r\n case ST_COMMA:\r\n kind=\"COMMA\";\r\n break;\r\n case ST_SEMICOLON:\r\n kind=\"SEMICOLON\";\r\n break;\r\n case ST_COLON:\r\n kind=\"COLON\";\r\n break;\r\n case ST_LPAREN:\r\n kind=\"LPAREN\";\r\n break;\r\n case ST_RPAREN:\r\n kind=\"RPAREN\";\r\n break;\r\n case ST_LBRACK:\r\n kind=\"LBRACK\";\r\n break;\r\n case ST_RBRACK:\r\n kind=\"RBRACK\";\r\n break;\r\n case ST_LBRACE:\r\n kind=\"LBRACE\";\r\n break;\r\n case ST_RBRACE:\r\n kind=\"RBRACE\";\r\n break;\r\n case ST_DOT:\r\n kind=\"DOT\";\r\n break;\r\n case ST_MINUS:\r\n kind=\"MINUS\";\r\n break;\r\n case ST_PLUS:\r\n kind=\"PLUS\";\r\n break;\r\n case ST_STAR:\r\n kind=\"STAR\";\r\n break;\r\n case ST_PCT:\r\n kind=\"PCT\";\r\n break;\r\n case ST_SLASH:\r\n kind=\"SLASH\";\r\n break;\r\n case ST_EXCLAM:\r\n kind=\"EXCLAM\";\r\n break;\r\n case ST_NE:\r\n kind=\"NE\";\r\n break;\r\n case ST_BECOMES:\r\n kind=\"BECOMES\";\r\n break;\r\n case ST_EQUALS:\r\n kind=\"EQUALS\";\r\n break;\r\n case ST_LT:\r\n kind=\"LT\";\r\n break;\r\n case ST_LE:\r\n kind=\"LE\";\r\n break;\r\n case ST_GT:\r\n kind=\"GT\";\r\n break;\r\n case ST_GE:\r\n kind=\"GE\";\r\n break;\r\n case ST_AMP:\r\n kind=\"AMP\";\r\n break;\r\n case ST_AMPAMP:\r\n kind=\"AMPAMP\";\r\n break;\r\n case ST_OR:\r\n kind=\"OR\";\r\n break;\r\n case ST_OROR:\r\n kind=\"OROR\";\r\n break;\r\n case ST_CHARLIT:\r\n kind=\"CharacterLiteral\";\r\n break;\r\n case ST_STRINGLIT:\r\n kind=\"StringLiteral\";\r\n break;\r\n default:\r\n break;\r\n } // switch\r\n if(finalState == State.ST_ID) {\r\n if (lexeme.equals(\"extends\")){\r\n kind=\"EXTENDS\";\r\n } else if (lexeme.equals(\"implements\")){\r\n kind=\"IMPLEMENTS\";\r\n } else if (lexeme.equals(\"static\")){\r\n kind=\"STATIC\";\r\n } else if(lexeme.equals(\"import\")){\r\n kind=\"IMPORT\";\r\n } else if(lexeme.equals(\"package\")){\r\n kind=\"PACKAGE\";\r\n } else if(lexeme.equals(\"public\")){\r\n kind=\"PUBLIC\";\r\n } else if(lexeme.equals(\"interface\")){\r\n kind=\"INTERFACE\";\r\n } else if(lexeme.equals(\"protected\")){\r\n kind=\"PROTECTED\";\r\n } else if(lexeme.equals(\"abstract\")){\r\n kind=\"ABSTRACT\";\r\n } else if(lexeme.equals(\"native\")){\r\n kind=\"NATIVE\";\r\n } else if(lexeme.equals(\"while\")){\r\n kind=\"WHILE\";\r\n } else if(lexeme.equals(\"for\")){\r\n kind=\"FOR\";\r\n } else if(lexeme.equals(\"boolean\")){\r\n kind=\"BOOLEAN\";\r\n } else if(lexeme.equals(\"int\")){\r\n kind=\"INT\";\r\n } else if(lexeme.equals(\"char\")){\r\n kind=\"CHAR\";\r\n } else if(lexeme.equals(\"byte\")){\r\n kind=\"BYTE\";\r\n } else if(lexeme.equals(\"short\")){\r\n kind=\"SHORT\";\r\n } else if(lexeme.equals(\"null\")){\r\n kind=\"NULL\";\r\n } else if(lexeme.equals(\"this\")){\r\n kind=\"THIS\";\r\n } else if(lexeme.equals(\"true\") || lexeme.equals(\"false\")){\r\n kind=\"BooleanLiteral\";\r\n } else if(lexeme.equals(\"instanceof\")){\r\n kind=\"INSTANCEOF\";\r\n } else if(lexeme.equals(\"class\")){\r\n kind=\"CLASS\";\r\n } else if(lexeme.equals(\"if\")){\r\n kind=\"IF\";\r\n } else if(lexeme.equals(\"else\")){\r\n kind=\"ELSE\";\r\n } else if(lexeme.equals(\"final\")){\r\n kind=\"FINAL\";\r\n } else if(lexeme.equals(\"new\")){\r\n kind=\"NEW\";\r\n } else if(lexeme.equals(\"return\")){\r\n kind=\"RETURN\";\r\n } else if(lexeme.equals(\"void\")){\r\n kind=\"VOID\";\r\n } else if(!Arrays.asList(_RESERVED_KEYWORDS).contains(lexeme)){\r\n kind=\"ID\";\r\n } // else\r\n } // if\r\n if(kind.equals(\"ERROR\")){\r\n printErrToken();\r\n } // if\r\n\r\n setLastTokenMinus(kind.equals(\"MINUS\"));\r\n return kind;\r\n }",
"@Override\n\tpublic XNode<V> canonization() {\n\t\tTypeExpr type = this.type; // possibly, this initial value of type will be modified during canonization\n\t\tXNode<V>[] sons = this.sons.clone();\n\t\tIntStream.range(0, sons.length).forEach(i -> sons[i] = sons[i].canonization()); // sons are made canonical\n\t\tif (type.isSymmetricOperator())\n\t\t\tArrays.sort(sons); // Sons are sorted if the type of the node is symmetric\n\t\t// Now, sons are potentially sorted if the type corresponds to a non-symmetric binary relational operator (in that case, we swap sons and\n\t\t// arithmetically inverse the operator provided that the ordinal value of the reverse operator is smaller)\n\t\tif (sons.length == 2 && type.isUnsymmetricRelationalOperator() && (type.arithmeticInversion().ordinal() < type.ordinal()\n\t\t\t\t|| (type.arithmeticInversion().ordinal() == type.ordinal() && sons[0].compareTo(sons[1]) > 0))) {\n\t\t\ttype = type.arithmeticInversion();\n\t\t\tUtilities.swap(sons, 0, 1);\n\t\t}\n\t\tif (sons.length == 1 && type.isIdentityWhenOneOperand()) // add(x) becomes x, min(x) becomes x, ...\n\t\t\treturn sons[0]; // certainly can happen during the canonization process\n\t\tXNodeParent<V> node = node(type, sons);\n\t\tEntry<Matcher, Function<XNodeParent<V>, XNode<V>>> rule = canonizer().rules.entrySet().stream().filter(e -> e.getKey().matches(node)).findFirst()\n\t\t\t\t.orElse(null);\n\t\treturn rule != null ? rule.getValue().apply(node).canonization() : node;\n\t}",
"public static Boolean getAppositivePrs(PairInstance inst) {\n if (inst.getAnaphor().getSentId()!=inst.getAntecedent().getSentId()) \n return false;\n\n// exclude pairs where anaphor is an NE -- this might be a bad idea though..\n if (inst.getAnaphor().isEnamex()) \n return false;\n\n\n if (inst.getAntecedent().isEnamex() &&\n inst.getAnaphor().isEnamex()) {\n\n// exclude pairs of NE that have different type\n\n if (!(inst.getAntecedent().getEnamexType().equals(\n inst.getAnaphor().getEnamexType())))\n return false;\n\n// exclude pairs of LOC-ne\n if (inst.getAntecedent().getEnamexType().toLowerCase().startsWith(\"gpe\"))\n return false;\n if (inst.getAntecedent().getEnamexType().toLowerCase().startsWith(\"loc\"))\n return false;\n }\n\n// should have not-null maxnp-trees (otherwise -- problematic mentions)\n\nTree sentenceTree=inst.getAnaphor().getSentenceTree();\nTree AnaTree=inst.getAnaphor().getMaxNPParseTree();\nTree AnteTree=inst.getAntecedent().getMaxNPParseTree();\nif (sentenceTree==null) return false;\nif (AnaTree==null) return false;\nif (AnteTree==null) return false;\n\n\n// the structure should be ( * (,) (ANA)) or ( * (,) (ANTE)) -- depends on the ordering, annotation, mention extraction etc\n\n if (AnteTree.parent(sentenceTree)==AnaTree) {\n Tree[] chlds=AnaTree.children();\n Boolean lastcomma=false;\n for (int i=0; i<chlds.length && chlds[i]!=AnteTree; i++) {\n lastcomma=false;\n if (chlds[i].value().equalsIgnoreCase(\",\")) lastcomma=true;\n }\n return lastcomma;\n }\n if (AnaTree.parent(sentenceTree)==AnteTree) {\n\n Tree[] chlds=AnteTree.children();\n Boolean lastcomma=false;\n for (int i=0; i<chlds.length && chlds[i]!=AnaTree; i++) {\n lastcomma=false;\n if (chlds[i].value().equalsIgnoreCase(\",\")) lastcomma=true;\n }\n return lastcomma;\n\n }\n\n return false;\n\n }",
"protected void createSemanticAnnotations() {\n\t\tString source = \"http://www.polarsys.org/capella/semantic\";\t\n\t\taddAnnotation\n\t\t (this, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedRequirementPkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedStateMachines(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatedComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"feature\", \"ownedFeatures\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"feature\", \"ownedFeatures\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"feature\", \"ownedFeatures\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalLinkCategories(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_DeployedParts(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_DeployingParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_OwnedAbstractType(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfacePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfacePkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_Mechanism(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ImplementorComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_UserComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ExchangeItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_OwnedExchangeItemAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RequiringComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RequiringComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvidingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvidingComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizingLogicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizedContextInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizingPhysicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizedLogicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (exchangeItemAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_SendProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_ReceiveProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatedItem(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_DeployedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_Location(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalArtifact_AllocatorConfigurationItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalLinkEnd_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_LinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_Categories(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_SourcePhysicalPort(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_TargetPhysicalPort(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_RealizedPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_RealizingPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkCategoryEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkCategory_Links(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Port(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Part(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_OwnedPhysicalPathInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_FirstPhysicalPathInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_RealizedPhysicalPaths(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_RealizingPhysicalPaths(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_NextInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_PreviousInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_InvolvedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathReferenceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathReference_ReferencedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortEClass, \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_AllocatedComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_RealizedPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_RealizingPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"excludefrom\", \"xmlpivot\"\n\t\t });\n\t}",
"@Override\n\tpublic int compareTo(RestSemanticDescriptionVersion o)\n\t{\n\t\t//This will handle native types, and the grouping of external types.\n\t\tint coreTypeLeft = Frills.getDescriptionType(this.descriptionTypeConcept.nid.intValue(), null);\n\t\tint coreTypeRight = Frills.getDescriptionType(o.descriptionTypeConcept.nid.intValue(), null);\n\t\t\n\t\t//handle cases where 1 of the 2 is a core type\n\t\tif (coreTypeLeft == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t|| coreTypeRight == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t{\n\t\t\tif (coreTypeLeft == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t\t&& coreTypeRight != MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse if (coreTypeLeft != MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t\t&& coreTypeRight == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if (coreTypeLeft == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t|| coreTypeRight == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t{\n\t\t\tif (coreTypeLeft == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t\t&& coreTypeRight != MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse if (coreTypeLeft != MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t\t&& coreTypeRight == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if (coreTypeLeft == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t|| coreTypeRight == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t{\n\t\t\tif (coreTypeLeft == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t\t&& coreTypeRight != MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse if (coreTypeLeft != MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid() \n\t\t\t\t\t&& coreTypeRight == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//the core types are identical. If there is an external type - check that.\n\t\tif (this.descriptionExtendedTypeConcept == null || o.descriptionExtendedTypeConcept == null)\n\t\t{\n\t\t\t//external (not extended) type which is different\n\t\t\tif (this.descriptionTypeConcept.nid.intValue() != o.descriptionTypeConcept.nid.intValue())\n\t\t\t{\n\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(this.descriptionTypeConcept.nid.intValue()), \n\t\t\t\t\t\tUtil.readBestDescription(o.descriptionTypeConcept.nid.intValue()), true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//extended type, where the types are different\n\t\t\tif (this.descriptionExtendedTypeConcept.nid.intValue() != o.descriptionExtendedTypeConcept.nid.intValue())\n\t\t\t{\n\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(this.descriptionExtendedTypeConcept.nid.intValue()), \n\t\t\t\t\t\tUtil.readBestDescription(o.descriptionExtendedTypeConcept.nid.intValue()), true);\n\t\t\t}\n\t\t}\n\t\t//Still tied on type, move to level 2\n\t\treturn sortLanguage(o);\n\t}",
"private Nation determineNation() {\n String selectedNation = view.getNationsTabPane()\n .getSelectionModel()\n .getSelectedItem()\n .getText()\n .toUpperCase()\n .replace(\" \", \"_\");\n\n return Nation.valueOf(selectedNation);\n }",
"private void createNodeLabel(NodeAppearanceCalculator nac) {\r\n\t PassThroughMapping passThroughMapping = new PassThroughMapping(\"\",\r\n\t ObjectMapping.NODE_MAPPING);\r\n\t \r\n\t // change canonicalName to Label\r\n//\t passThroughMapping.setControllingAttributeName\r\n//\t (\"canonicalName\", null, false);\r\n\t passThroughMapping.setControllingAttributeName\r\n// (Semantics.LABEL, null, false);\r\n\t (Semantics.CANONICAL_NAME, null, false);\r\n\t\r\n\t GenericNodeLabelCalculator nodeLabelCalculator =\r\n\t new GenericNodeLabelCalculator(\"SimpleBioMoleculeEditor ID Label\"\r\n\t , passThroughMapping);\r\n\t nac.setNodeLabelCalculator(nodeLabelCalculator);\r\n\t }",
"org.landxml.schema.landXML11.ClassificationDocument.Classification addNewClassification();",
"Generalization createGeneralization();",
"private String parseDescrName(String line) {\n\t\t// d1f74a_ 201-209;3-11 DGAIGSTFN LKGIFSALL #7\n\t\t// d1nvra_ 226-253;184-204 IDSAPLALL GIVLTAMLA 0_0:-5_-8 0.477587\n\t\t// GroupName is created as name of domain (remove proceeding 'd') + pdb\n\t\t// number of the first residue\n\t\t// in the second segment (3-11 in the example) increased by 10000 + '_'\n\t\t// + number of cluster (7 in the case)\n\t\t// the residue with fasta number 3 is translated into address A4_ - so\n\t\t// the pdb number is 4\n\t\t// finally the group name will be 1f74a_#10004_7\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tString dom = tokens[0].substring(1);\n\t\tString noClust = \"\";\n\t\t@SuppressWarnings(\"unused\")\n\t\tint shift1 = 0; // segment1 shift\n\t\tint shift2 = 0; // segment2 shift\n\t\ttry {\n\t\t\tif (tokens[4].startsWith(\"#\")) {\n\t\t\t\tnoClust = \"_\" + tokens[4].substring(1);\n\t\t\t} else {\n\t\t\t\tnoClust = \"\";\n\t\t\t}\n\t\t\tif (tokens[4].startsWith(\"0_0\")) {\n\t\t\t\ttokens[4] = tokens[4].replaceFirst(\"0_0:\", \"\");\n\t\t\t\tString[] shifts = tokens[4].split(\"_\");\n\t\t\t\tshift1 = Integer.valueOf(shifts[0]);\n\t\t\t\tshift2 = Integer.valueOf(shifts[1]);\n\t\t\t}\n\t\t} catch (ArrayIndexOutOfBoundsException e) {\n\t\t\t// do nothing keep default values\n\t\t}\n\t\t// get the first number of second segment : e.g. 3 from 201-209;3-11\n\t\tString[] tokensA = tokens[1].split(\";\");\n\t\tString[] tokensB = tokensA[1].split(\"-\");\n\t\tInteger fastaNo = (Integer.valueOf(tokensB[0]) - shift2 >= 0 ? Integer\n\t\t\t\t.valueOf(tokensB[0]) - shift2 : Integer.valueOf(tokensB[0]));\n\n\t\t// get pdb address\n\t\tString pdbResAddr = hashResMapInt2Str.get(dom).get(fastaNo);\n\t\tpdbResAddr = pdbResAddr.substring(1, pdbResAddr.length() - 1);\n\t\tint pdbResNo = Integer.valueOf(pdbResAddr);\n\n\t\treturn (dom + \"#\" + (10000 + pdbResNo) + noClust);\n\t}",
"public abstract String getNaturalIdentity();",
"static TreeSet<Noun> parseNouns(Scanner data, int declension){\n\t\tassert(declension != Values.INDEX_ENDINGS_DECLENSION_THIRD && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N); //there's a separate function for these guys.\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(NumberFormatException e){ //can happen if a chapter isn't specified. Read the noun from a null chapter.\n\t\t\t\tchapter = Values.CHAPTER_VOID;\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}",
"Integer classify(LogicGraph pce);",
"abstract String classify(Instance inst);",
"String kind();",
"String kind();",
"@Override\n public String toString() {\n return bestCommunity + \"\";\n }",
"public interface NodeTypeMatcher {\n /**\n * Determines whether two Nodes are eligible for comparison\n * based on their node type.\n */\n boolean canBeCompared(short controlType, short testType);\n }",
"String productKind();",
"String getConcept();",
"@XmlElement\n private String getConceptPreferredName() {\n return concept != null ? concept.getDefaultPreferredName() : \"\";\n }",
"public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}",
"public String guessSequenceType(final String seq) {\n\n\t int canonicalNucStates = 0;\n\t int undeterminedStates = 0;\n\t // true length, excluding any gaps\n\t int sequenceLength = seq.length();\n\t final int seqLen = sequenceLength;\n\n\t boolean onlyValidNucleotides = true;\n\t boolean onlyValidAminoAcids = true;\n\n\t // do not use toCharArray: it allocates an array size of sequence\n\t for(int k = 0; (k < seqLen) && (onlyValidNucleotides || onlyValidAminoAcids); ++k) {\n\t final char c = seq.charAt(k);\n\t final boolean isNucState = (\"ACGTUXNacgtuxn?_-\".indexOf(c) > -1);\n\t final boolean isAminoState = true;\n\n\t onlyValidNucleotides &= isNucState;\n\t onlyValidAminoAcids &= isAminoState;\n\n\t if (onlyValidNucleotides) {\n\t assert(isNucState);\n\t if ((\"ACGTacgt\".indexOf(c) > -1)) {\n\t ++canonicalNucStates;\n\t } else {\n\t if ((\"?_-\".indexOf(c) > -1)) {\n\t --sequenceLength;\n\t } else if( (\"UXNuxn\".indexOf(c) > -1)) {\n\t ++undeterminedStates;\n\t }\n\t }\n\t }\n\t }\n\n\t String result = \"aminoacid\";\n\t if (onlyValidNucleotides) { // only nucleotide states\n\t // All sites are nucleotides (actual or ambigoues). If longer than 100 sites, declare it a nuc\n\t if( sequenceLength >= 100 ) {\n\t result = \"nucleotide\";\n\t } else {\n\t // if short, ask for 70% of ACGT or N\n\t final double threshold = 0.7;\n\t final int nucStates = canonicalNucStates + undeterminedStates;\n\t // note: This implicitely assumes that every valid nucleotide\n\t // symbol is also a valid amino acid. This is true since we\n\t // added support for the 21st amino acid, U (Selenocysteine)\n\t // in AminoAcids.java.\n\t result = nucStates >= sequenceLength * threshold ? \"nucleotide\" : \"aminoacid\";\n\t }\n\t } else if (onlyValidAminoAcids) {\n\t result = \"aminoacid\";\n\t } else {\n\t result = null;\n\t }\n\t return result;\n\t }",
"private void handleNLSNegotiation(CharSetandLanguageNegotiation_type neg)\n {\n LOGGER.finer(\"Handle Character Set and Language Negotiation\");\n \n if ( neg.which == CharSetandLanguageNegotiation_type.proposal_CID )\n {\n OriginProposal_type op = (OriginProposal_type)(neg.o);\n \n // Deal with any proposed character sets.\n if ( op.proposedCharSets != null )\n {\n for ( Enumeration prop_charsets = op.proposedCharSets.elements(); \n \t prop_charsets.hasMoreElements();)\n {\n proposedCharSets_inline0_choice1_type c = \n \t (proposedCharSets_inline0_choice1_type)\n \t (prop_charsets.nextElement());\n switch ( c.which )\n {\n case proposedCharSets_inline0_choice1_type.iso10646_CID:\n // The client proposes an iso 10646 id for a character set\n Iso10646_type iso_type = (Iso10646_type)(c.o);\n OIDRegisterEntry ent = reg.lookupByOID(iso_type.encodingLevel);\n LOGGER.finer(\"Client proposes iso10646 charset: \"+ent.getName());\n break;\n default:\n LOGGER.warning(\"Unhandled character set encoding\");\n break;\n }\n }\n }\n }\n }",
"public static Annotation ruleResolvePronoun(Annotation[] basenps, int num, Document doc)\r\n{\n Annotation np2 = basenps[num];\r\n // Get some properties of the np\r\n FeatureUtils.PRTypeEnum type2 = Pronoun.getValue(np2, doc);\r\n String str2 = doc.getAnnotString(np2);\r\n boolean reflexive = FeatureUtils.isReflexive(str2);\r\n // Get the possible antecedents\r\n ArrayList<Annotation> antes = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums = new ArrayList<Integer>();\r\n if (DEBUG) {\r\n System.err.println(\"Pronoun: \" + doc.getAnnotText(np2));\r\n }\r\n if (FeatureUtils.getPronounPerson(str2) == PersonPronounTypeEnum.FIRST) {\r\n if (NumberEnum.SINGLE.equals(Number.getValue(np2, doc)))\r\n return ruleResolvePronounI(np2, basenps, num, doc);\r\n else\r\n return ruleResolvePronounWe(np2, basenps, num, doc);\r\n }\r\n if (FeatureUtils.getPronounPerson(str2) == PersonPronounTypeEnum.SECOND)\r\n return ruleResolvePronounYou(np2, basenps, num, doc);\r\n else {\r\n int sentnum = 0;\r\n for (int i = num - 1; i >= 0 && sentnum <= 3; i--) {\r\n Annotation np1 = basenps[i];\r\n sentnum = sentNum(np1, np2, doc);\r\n if (DEBUG) {\r\n System.err.println(\"Possible antecedent: \" + i + \" :\" + doc.getAnnotText(np1));\r\n }\r\n if (!isNumberIncompatible(np1, np2, doc) && !isGenderIncompatible(np1, np2, doc)\r\n && !isAnimacyIncompatible(np1, np2, doc) && isWNClassComp(np1, np2, doc) && isProComp(np1, np2, doc)\r\n && !Embedded.getValue(np1, doc) && isSyntax(np1, np2, doc)) {\r\n if (DEBUG) {\r\n System.err.println(\"Candidate antecedent: \" + i + \" :\" + doc.getAnnotText(np1));\r\n }\r\n antes.add(0, np1);\r\n nums.add(0, i);\r\n }\r\n }\r\n }\r\n if (antes.size() == 0) return null;\r\n // Check for reflexsives\r\n if (FeatureUtils.isReflexive(doc.getAnnotText(np2))) {\r\n union(nums.get(nums.size() - 1).intValue(), num);\r\n return antes.get(antes.size() - 1);\r\n }\r\n if (antes.size() == 1) {\r\n // Rule 1: Unique in discourse\r\n if (DEBUG) {\r\n System.err.println(\"Rule 1 match!!!\");\r\n }\r\n union(nums.get(0).intValue(), num);\r\n return antes.get(0);\r\n }\r\n // Rule 2: Reflexive -- the last possible antecedent\r\n if (reflexive) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 2 match!!!\");\r\n }\r\n union(nums.get(nums.size() - 1).intValue(), num);\r\n return antes.get(antes.size() - 1);\r\n }\r\n // Rule 3: Unique current + Prior\r\n ArrayList<Annotation> antes1 = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums1 = new ArrayList<Integer>();\r\n int counter = 0;\r\n for (Annotation np1 : antes) {\r\n if (sentNum(np1, np2, doc) < 2) {\r\n antes1.add(np1);\r\n nums1.add(nums.get(counter));\r\n }\r\n counter++;\r\n }\r\n if (antes1.size() == 1) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 3 match!!!\");\r\n }\r\n union(nums1.get(0).intValue(), num);\r\n return antes1.get(0);\r\n }\r\n // Rule 4: Possesive Pro\r\n\r\n if (FeatureUtils.isPossesive(str2) && antes1.size() > 0) {\r\n Integer found = null;\r\n Annotation ant = null;\r\n boolean multiple = false;\r\n for (int i = 0; i < antes1.size() && !multiple; i++) {\r\n Annotation np1 = antes1.get(i);\r\n if (doc.getAnnotText(np1).equalsIgnoreCase(str2) && sentNum(np1, np2, doc) == 1) {\r\n if (found == null) {\r\n found = nums1.get(i);\r\n ant = antes1.get(i);\r\n }\r\n else {\r\n multiple = true;\r\n }\r\n }\r\n }\r\n if (!multiple && found != null) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 4 match!!!\");\r\n }\r\n union(found.intValue(), num);\r\n return ant;\r\n }\r\n }\r\n // Rule #5: Unique in the current sentence\r\n ArrayList<Annotation> antes2 = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums2 = new ArrayList<Integer>();\r\n counter = 0;\r\n for (Annotation np1 : antes1) {\r\n if (sentNum(np1, np2, doc) < 1) {\r\n antes2.add(np1);\r\n nums2.add(nums1.get(counter));\r\n }\r\n counter++;\r\n }\r\n if (antes2.size() == 1) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 5 match!!!\");\r\n }\r\n union(nums2.get(0).intValue(), num);\r\n return antes2.get(0);\r\n }\r\n // Extra Rule: Unique in the current clause (or parent clauses\r\n AnnotationSet parse = doc.getAnnotationSet(Constants.PARSE);\r\n Annotation clause = SyntaxUtils.getClause(np2, parse);\r\n while (clause != null) {\r\n ArrayList<Annotation> antes3 = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums3 = new ArrayList<Integer>();\r\n counter = 0;\r\n for (Annotation np1 : antes2) {\r\n if (clause.covers(np1)) {\r\n antes3.add(np1);\r\n nums3.add(nums2.get(counter));\r\n }\r\n counter++;\r\n }\r\n if (DEBUG) {\r\n System.err.println(antes3.size() + \" antecedents in the clause\");\r\n }\r\n if (antes3.size() == 1) {\r\n if (DEBUG) {\r\n System.err.println(\"Clause rule match!!!\");\r\n }\r\n union(nums3.get(0).intValue(), num);\r\n return antes3.get(0);\r\n }\r\n clause = SyntaxUtils.getParentClause(clause, parse);\r\n }\r\n\r\n // Rule #6: Unique Subject\r\n\r\n // //Look for the subject in the current sentence\r\n // boolean unique = true;\r\n // Annotation subject = null;\r\n // Integer subjectNum = null;\r\n // for(int i=antes.size()-1; i>=0; i--){\r\n // Annotation np1 = antes.get(i);\r\n // if(sentNum(np1, np2, annotations, text)==0){\r\n // if(FeatureUtils.getGramRole(np1, annotations, text).equals(\"SUBJECT\")){\r\n // //&&SyntaxUtils.isMainClause(np1, parse)){\r\n // if(DEBUG)\r\n // System.err.println(\"Rule 6 match!!!\");\r\n // if(subjectNum!=null)\r\n // unique=false;\r\n // subjectNum = nums.get(i);\r\n // subject = antes.get(i);\r\n // }\r\n // }\r\n // }\r\n\r\n // if(subject!=null&&unique){\r\n // union(subjectNum.intValue(), num);\r\n // return subject;\r\n // }\r\n\r\n // Look for the subject in the previous sentence\r\n boolean unique = true;\r\n Annotation subject = null;\r\n Integer subjectNum = null;\r\n if (GramRole.getValue(np2, doc).equals(\"SUBJECT\")) {\r\n // &&SyntaxUtils.isMainClause(np2, parse)){\r\n for (int i = antes.size() - 1; i >= 0; i--) {\r\n Annotation np1 = antes.get(i);\r\n if (sentNum(np1, np2, doc) == 1) {\r\n if (GramRole.getValue(np1, doc).equals(\"SUBJECT\")) {\r\n // &&SyntaxUtils.isMainClause(np1, parse)){\r\n if (DEBUG) {\r\n System.err.println(\"Rule 6 match!!!\");\r\n }\r\n if (subjectNum != null) {\r\n unique = false;\r\n }\r\n subjectNum = nums.get(i);\r\n subject = antes.get(i);\r\n }\r\n }\r\n }\r\n }\r\n if (subject != null && unique) {\r\n union(subjectNum.intValue(), num);\r\n return subject;\r\n }\r\n subjectNum = null;\r\n subject = null;\r\n\r\n // One more Rule -- assign possessive pronouns to the last subject\r\n if (type2.equals(FeatureUtils.PRTypeEnum.POSSESSIVE)) {\r\n for (int i = antes.size() - 1; i >= 0; i--) {\r\n Annotation np1 = antes.get(i);\r\n if (sentNum(np1, np2, doc) == 0) {\r\n if (GramRole.getValue(np1, doc).equals(\"SUBJECT\")) {\r\n // &&SyntaxUtils.isMainClause(np1, parse)){\r\n if (DEBUG) {\r\n System.err.println(\"Rule 6a match!!!\");\r\n }\r\n if (subject == null) {\r\n subjectNum = nums.get(i);\r\n subject = antes.get(i);\r\n }\r\n }\r\n }\r\n }\r\n if (subject != null) {\r\n union(subjectNum.intValue(), num);\r\n return subject;\r\n }\r\n }\r\n\r\n return null;\r\n}",
"private String notationorlabel(Resource indiv) {\n\t\t\n\t\tString sNotation = concept2notation.get(indiv);\n\t\tif(sNotation != null && !sNotation.isEmpty()) {\n\t\t\treturn sNotation;\n\t\t}\n\t\t\t\n\t\tLiteral label = null;\n\t\t//1. Try to get a notation\n\t\tStatement notstmt = indiv.getProperty(notation); //TODO There might be more than one notation\n\t\tif(notstmt != null) {\n\t\t\tsNotation = ((Literal) notstmt.getObject().as(Literal.class)).getString();\n\t\t}\n\t\t//2. Try to get a skos-label in the preferred Language\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tlabel = null;\n\t\t\tStmtIterator iter = indiv.listProperties(preflabel);\n\t\t\twhile(iter.hasNext()) {\n\t\t\t\tRDFNode n = iter.nextStatement().getObject();\n\t\t\t\tlabel = (Literal) n.as(Literal.class);\t\t\n\t\t\t\tif(label.getLanguage().equalsIgnoreCase(loc.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t\tbreak;\n\t\t\t\t} else if(\"en\".equalsIgnoreCase(label.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} else if(sNotation == null || sNotation.isEmpty()) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//3 Try to get a rdfs-label in the preferred Language\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tlabel = null;\n\t\t\tStmtIterator iter = indiv.listProperties(rdfslabel);\n\t\t\twhile(iter.hasNext()) {\n\t\t\t\tRDFNode n = iter.nextStatement().getObject();\n\t\t\t\tlabel = (Literal) n.as(Literal.class);\t\t\n\t\t\t\tif(label.getLanguage().equalsIgnoreCase(loc.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t\tbreak;\n\t\t\t\t} else if(\"en\".equalsIgnoreCase(label.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} else if(sNotation == null || sNotation.isEmpty()) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tsNotation = indiv.getLocalName();\n\t\t}\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tsNotation = indiv.getURI();\n\t\t}\n\t\n\t\tconcept2notation.put(indiv, sNotation);\n\t\t\t\n\t\treturn sNotation;\n\t}",
"static TreeSet<Noun> parse3rdNouns(Scanner data){\n\n\t\tint declension = 3;\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\t\t\ttry{\n\t\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD;\n\t\t\t\t\t//System.out.println(\"No i-stem\");\n\t\t\t\t} catch(NumberFormatException e){ //I-Stem.\n\t\t\t\t\tchapter = Integer.parseInt(current[0].substring(0, 2));\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD_I;\n\t\t\t\t\t//System.out.println(\"i-stem\");\n\t\t\t\t}\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}",
"@Override\n\t/** Return the node kind\n\t * @return kind of node.\n\t */\n\tpublic final short getKind() {return _kind;}",
"Kind kind();",
"String category();",
"@Override\n\tpublic String getHandledString() {\n\t\treturn \"netcl\";\n\t}",
"public static void parseNatAsgn() {\n if (currToken.tokenType != Token.ID) {\n handleError(\"ID\");\n }\n else if( symbols.get(currToken.tokenString) != \"NAT\"){\n throw new Error(\"NAT type expected\");\n }\n else{\n sb.append(currToken.tokenString);\n getNextToken();\n if (currToken.tokenType != Token.ASSIGN) {\n handleError(\"ASSIGN\");\n }\n else{\n sb.append(\" = \");\n getNextToken();\n parseNatExp();\n }\n }\n }",
"public static void Pubmed() throws IOException \n\t{\n\t\t\n\t\tMap<String,Map<String,List<String>>> trainset = null ; \n\t\t//Map<String, List<String>> titles = ReadXMLFile.ReadCDR_TestSet_BioC() ;\n\t File fFile = new File(\"F:\\\\TempDB\\\\PMCxxxx\\\\articals.txt\");\n\t List<String> sents = readfiles.readLinesbylines(fFile.toURL()); \n\t\t\n\t\tSentinfo sentInfo = new Sentinfo() ; \n\t\t\n\t\ttrainset = ReadXMLFile.DeserializeT(\"F:\\\\eclipse64\\\\eclipse\\\\TrainsetTest\") ;\n\t\tLinkedHashMap<String, Integer> TripleDict = new LinkedHashMap<String, Integer>();\n\t\tMap<String,List<Integer>> Labeling= new HashMap<String,List<Integer>>() ;\n\t\t\n\t\tMetaMapApi api = new MetaMapApiImpl();\n\t\tList<String> theOptions = new ArrayList<String>();\n\t theOptions.add(\"-y\"); // turn on Word Sense Disambiguation\n\t theOptions.add(\"-u\"); // unique abrevation \n\t theOptions.add(\"--negex\"); \n\t theOptions.add(\"-v\");\n\t theOptions.add(\"-c\"); // use relaxed model that containing internal syntactic structure, such as conjunction.\n\t if (theOptions.size() > 0) {\n\t api.setOptions(theOptions);\n\t }\n\t \n\t\t\n\t\tif (trainset == null )\n\t\t{\n\t\t\ttrainset = new HashMap<String, Map<String,List<String>>>();\n\t\t}\n\t\t\n\t\t\n\t\t/************************************************************************************************/\n\t\t//Map<String, Integer> bagofwords = semantic.getbagofwords(titles) ; \n\t\t//trainxmllabeling(trainset,bagofwords); \n\t\t/************************************************************************************************/\n\t\t\n\t\t\n\t\tint count = 0 ;\n\t\tint count1 = 0 ;\n\t\tModel candidategraph = ModelFactory.createDefaultModel(); \n\t\tMap<String,List<String>> TripleCandidates = new HashMap<String, List<String>>();\n\t\tfor(String title : sents)\n\t\t{\n\t\t\t\n\t\t\tModel Sentgraph = sentInfo.graph;\n\t\t\tif (trainset.containsKey(title))\n\t\t\t\tcontinue ; \n\t\t\t//8538\n\t\t\tcount++ ; \n\n\t\t\tMap<String, List<String>> triples = null ;\n\t\t\t// get the goldstandard concepts for current title \n\t\t\tList<String> GoldSndconcepts = new ArrayList<String> () ;\n\t\t\tMap<String, Integer> allconcepts = null ; \n\t\t\t\n\t\t\t// this is optional and not needed here , it used to measure the concepts recall \n\t\t\tMap<String, List<String>> temptitles = new HashMap<String, List<String>>(); \n\t\t\ttemptitles.put(title,GoldSndconcepts) ;\n\t\t\t\t\t\t\n\t\t\t// get the concepts \n\t\t\tallconcepts = ConceptsDiscovery.getconcepts(temptitles,api);\n\t\t\t\n\t\t\tArrayList<String> RelInstances1 = SyntaticPattern.getSyntaticPattern(title,allconcepts,FILE_NAME_Patterns) ;\n\t\t\t//Methylated-CpG island recovery assay: a new technique for the rapid detection of methylated-CpG islands in cancer\n\t\t\tif (RelInstances1 != null && RelInstances1.size() > 0 )\n\t\t\t{\n\t\t\t\tcount1++ ;\n\t\t\t\tTripleCandidates.put(title, RelInstances1) ;\n\t\t\t\t\n\t\t\t\tif (count1 == 30)\n\t\t\t\t{\n\t\t\t\t\tReadXMLFile.Serialized(TripleCandidates,\"F:\\\\eclipse64\\\\eclipse\\\\Relationdisc1\") ;\n\t\t\t\t\tcount1 = 0 ;\n\t\t\t\t}\n\t\t\t}\n \n\t\t}\n\t\t\n\t\tint i = 0 ;\n\t\ti++ ; \n\t}",
"private DefaultMutableTreeNode buildTaxonNode() {\n LoggerFactory.LogInfo(\"buildTaxaNode\");\n SortableTreeNode taxonomyNode = new SortableTreeNode(\"TAXONOMY\");\n TaxaLookup.getInstance().populate(\"taxons.bin\");\n for (TaxonEntity taxa : TaxaLookup.getInstance().getList()) {\n addFirstTaxa(taxonomyNode, taxa);\n }\n\n TaxaLookup.getInstance().populate(\"echinodermata.bin\");\n SortableTreeNode animaliaNode = null;\n animaliaNode = findChild(taxonomyNode, \"Animalia(Animals)\");\n for (TaxonEntity taxa : TaxaLookup.getInstance().getList()) {\n addTaxa(animaliaNode, taxa);\n }\n\n TaxaLookup.getInstance().populate(\"decapoda.bin\");\n if (animaliaNode == null) {\n animaliaNode = taxonomyNode;\n }\n for (TaxonEntity taxa : TaxaLookup.getInstance().getList()) {\n addTaxa(animaliaNode, taxa);\n }\n\n TaxaLookup.getInstance().populate(\"test.bin\");\n for (TaxonEntity taxa : TaxaLookup.getInstance().getList()) {\n addTaxa(animaliaNode, taxa);\n }\n\n\n //TaxaLookup.getInstance().writeToXML();\n return taxonomyNode;\n }",
"private static String getCorrespondingNEPosSegment(String textConcept, CustomXMLRepresentation nePosText, boolean isConcept) {\n\n\t\tString output = \"\";\n\n\t\t//textConcept = textConcept.replaceAll(\"\\\\p{Punct} \",\" $0 \");\n\t\t/*textConcept = textConcept.replaceAll(\"[.]\",\". \").replaceAll(\"[,]\",\", \").replaceAll(\"[']\",\"' \")\n\t\t\t\t.replaceAll(\"[\\\\[]\",\" [ \" ).replaceAll(\"[\\\\]]\",\" ] \").replaceAll(\"[(]\", \" ( \").replaceAll(\"[)]\",\" ) \")\n\t\t\t\t.replaceAll(\"[<]\", \" < \").replaceAll(\"[>]\", \" > \");*/\n\t\t//textConcept = textConcept.replaceAll(\"[\\\\.,']\",\"$0 \").replaceAll(\"[\\\\[\\\\](){}!@#$%^&*+=]\",\" $0 \");\n\t\ttextConcept = textConcept.replaceAll(\"[']\",\"$0 \").replaceAll(\"[\\\\[\\\\](){}!@#$%^&*+=]\",\" $0 \");\n\t\tString[] lemmas = textConcept.split(\" \");\n\t\tArrayList<String> wordList = new ArrayList(Arrays.asList(lemmas));\n\n\t\tnePosText.escapeXMLCharacters();\n\n\t\tboolean goOn = true;\n\t\t//while wordList is not empty, repeat\n\t\twhile(wordList.size()>0 && goOn){\n\n\t\t\tDocument docNePos = null;\n\t\t\ttry {\n\t\t\t\tDocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();\n\t\t\t\tDocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();\n\t\t\t\tInputStream streamNePos = new ByteArrayInputStream(nePosText.getXml().getBytes(StandardCharsets.UTF_8));\n\t\t\t\tdocNePos = docBuilder.parse(streamNePos);\n\t\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\t\tSystem.err.print(\"KIndex :: Pipeline.getCorrespondingNEPosSegment() Could not create a document text.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tNodeList npSegments = docNePos.getElementsByTagName(\"content\").item(0).getChildNodes(); // concept or text segments (children of content)\n\n\t\t\tfor (int i = 0; i < npSegments.getLength(); i++) {\n\t\t\t\tNode n = npSegments.item(i);\n\t\t\t\tif (n.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tElement segment = (Element) n;\n\t\t\t\t\tString tag = segment.getNodeName();\n\t\t\t\t\tString stLemma = (segment.hasAttribute(\"lemma\")) ? segment.getAttribute(\"lemma\") : \"\";\n\t\t\t\t\tString lemma = segment.getTextContent();\n\n\t\t\t\t\t//Debug\n\t\t\t\t\t//if (wordList.get(0).equals(\"take\")){\n\t\t\t\t\t//\tSystem.out.println(\"take!\");\n\t\t\t\t\t//}\n\n\t\t\t\t\tif ((wordList.size() == 0) && (tag.equals(\"Punctuation\"))){\n\t\t\t\t\t\toutput += lemma + \" \" ;\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tint initSize = wordList.size();\n\t\t\t\t\tint initXMLSize = nePosText.getXml().length();\n\t\t\t\t\tif (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").equals(\"\")){\n\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (tag.equals(\"ne\")){\n\t\t\t\t\t\tString NEtype = segment.getAttribute(\"type\");\n\t\t\t\t\t\tNodeList NEchildren = segment.getChildNodes();\n\t\t\t\t\t\t//if this text segment is concept, do not add the NamedEntity tag.\n\t\t\t\t\t\tString NEstring = (isConcept) ? \"\" : \"<ne type=\\\"\" + NEtype + \"\\\">\";\n\t\t\t\t\t\tfor (int c = 0; c < NEchildren.getLength(); c++) {\n\t\t\t\t\t\t\tNode child = NEchildren.item(c);\n\t\t\t\t\t\t\tif (child.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tElement Echild = (Element) child;\n\t\t\t\t\t\t\t\tString Ctag = Echild.getNodeName();\n\t\t\t\t\t\t\t\tString OrigLemma = Echild.getAttribute(\"lemma\");\n\t\t\t\t\t\t\t\tString Clemma = Echild.getTextContent();\n\t\t\t\t\t\t\t\tif (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().equals(Clemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").replaceAll(\" \",\"\").toLowerCase())) {\n\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\"+OrigLemma+\"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (!Clemma.equals(\"\")){\n\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\"+OrigLemma+\"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\tif (wordList.get(0).contains(Clemma)){\n\t\t\t\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replace(Clemma,\"\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (Clemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\t\t\t\tString ClemmaRemaining = Clemma.replaceAll(\"[^\\\\x00-\\\\x7F]\", \"\"); //replace all non-ascii characters\n\t\t\t\t\t\t\t\t\t\twhile (Clemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\t\t\t\t\tClemmaRemaining = ClemmaRemaining.replace(wordList.get(0),\" \");\n\t\t\t\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\t\t\t\tif (Clemma.endsWith(wordList.get(0))){\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tClemmaRemaining = (ClemmaRemaining.startsWith(\" \")) ? ClemmaRemaining.replace(\" \",\"\") : ClemmaRemaining;\n\t\t\t\t\t\t\t\t\t\tif ((!ClemmaRemaining.equals(\"\")) && wordList.get(0).startsWith(ClemmaRemaining)){\n\t\t\t\t\t\t\t\t\t\t\twordList.set(0, wordList.get(0).replace(ClemmaRemaining,\"\"));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/*else if (Clemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\t\tif (Clemma.endsWith(wordList.get(0))) {\n\t\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\" + OrigLemma + \"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t/*else if ((!Clemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").replaceAll(\" \",\"\").toLowerCase().equals(\"\")) &&\n\t\t\t\t\t\t\t\t\t\twordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().contains(Clemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").replaceAll(\" \",\"\").toLowerCase())){\n\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\"+OrigLemma+\"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replace(OrigLemma,\"\"));\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\tNEstring += (isConcept) ? \"\" : \"</ne>\";\n\t\t\t\t\t\toutput += NEstring;\n\t\t\t\t\t\tNEstring = (isConcept) ? \"<ne type=\\\"\" + NEtype + \"\\\">\" + NEstring + \"</ne>\" : NEstring;\n\t\t\t\t\t\tnePosText.removeElement(NEstring);\n\n\t\t\t\t\t\t//avoid infinite loop\n\t\t\t\t\t\tif (wordList.size() == initSize && NEstring.length() == initXMLSize){\n\t\t\t\t\t\t\treturn \"--ERROR-- \\r\\n Error: 1200 \\r\\n In word:\" + wordList.get(0) + \", lemma:\"+lemma;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse if(tag.equals(\"NoPOS\") || tag.equals(\"Punctuation\")){\n\t\t\t\t\t\t//output += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\toutput += lemma + \" \" ;\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tif (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().equals(lemma.toLowerCase())){\n\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//avoid infinite loop\n\t\t\t\t\t\telse if (nePosText.getXml().length() == initXMLSize){\n\t\t\t\t\t\t\treturn \"--ERROR-- \\r\\n Error: 1201 \\r\\n In word:\" + wordList.get(0) + \", lemma:\"+lemma +\"\\r\\n nePosText: \"+ nePosText.getXml();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().equals(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())) {\n\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//we have the example of \"Cannot\" -> <MD>Can</MD><RB>not</RB>\n\t\t\t\t\t//in that case, in the first loop the first lemma will be added\n\t\t\t\t\t//in second loop the lemma will be added and wordList.get(0) will be removed\n\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().contains(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())){\n\t\t\t\t\t\tif (wordList.get(0).startsWith(lemma)){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replaceFirst(Pattern.quote(lemma),\"\"));\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().startsWith(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replaceFirst(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\"),\"\"));\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (wordList.get(0).endsWith(lemma)){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().endsWith(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\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\telse if (lemma.contains(wordList.get(0))){\n\t\t\t\t\t\twhile(lemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\tif (lemma.endsWith(wordList.get(0))) {\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tif (wordList.size() == 0){\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\telse if (lemma.contains(wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\"))){\n\t\t\t\t\t\twhile(lemma.contains(wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\"))){\n\t\t\t\t\t\t\tif (lemma.endsWith(wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\"))) {\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tif (wordList.size() == 0){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//avoid infinite loop\n\t\t\t\t\tif (wordList.size() == initSize){\n\t\t\t\t\t\treturn \"--ERROR-- \\r\\n Error: 1202 \\r\\n In word:\" + wordList.get(0) + \", lemma:\"+lemma;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{ //if n.getNodeType() != Node.ELEMENT_NODE\n\t\t\t\t\tif (npSegments.getLength() == 1){\n\t\t\t\t\t\tgoOn = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wordList.size()>0 && wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").equals(\"\")){\n\t\t\t\twordList.remove(0);\n\t\t\t}\n\n\t\t\tif(npSegments.getLength() == 0 && wordList.size() == 1){\n\t\t\t\twordList.remove(0);\n\t\t\t}\n\t\t}\n\n\t\t//in case wordList is empty but the next element in nePosText is punctuation, this element has to be added in output\n\t\tDocument docNePos = null;\n\t\ttry {\n\t\t\tDocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();\n\t\t\tInputStream streamNePos = new ByteArrayInputStream(nePosText.getXml().getBytes(StandardCharsets.UTF_8));\n\t\t\tdocNePos = docBuilder.parse(streamNePos);\n\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\tSystem.err.print(\"KIndex :: Pipeline.getCorrespondingNEPosSegment() Could not create a document text.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tNodeList npSegments = docNePos.getElementsByTagName(\"content\").item(0).getChildNodes(); // concept or text segments (children of content)\n\t\tfor (int i = 0; i < npSegments.getLength(); i++) {\n\t\t\tNode n = npSegments.item(i);\n\t\t\tif (n.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\tElement segment = (Element) n;\n\t\t\t\tString tag = segment.getNodeName();\n\t\t\t\tString lemma = segment.getTextContent();\n\t\t\t\tif (tag.equals(\"Punctuation\")){\n\t\t\t\t\toutput += lemma + \" \";\n\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+lemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t}\n\t\t\t\tbreak; // it will break after the first time an element will be checked\n\t\t\t}\n\t\t}\n\n\n\n\t\treturn output;\n\t}",
"protected Text getKind() {\n return null;\n }",
"private void updateTree(String st, int lineno, double bl, PrintWriter missing){\n\t\t String[] str = st.split(\"\\\\s+\");\n\t\t String specName = str[0];\n\t\t if(str[0].indexOf(\"GRCh38\")>=0){\n\t\t\t specName= \"Homo_sapiens\";\n\t\t\t str[0] = specName;\n\t\t }\n\t\t String alias1 = collapse(str, 2, str.length, \" \");\n\t\t Node n = getSlug(specName, alias1);\n\t\t if(n==null) n = this.unclassified;\n\t\t Node newnode = this.createFromSpeciesFile(str,alias1, n, lineno, bl);\n\t\t this.putSlug(newnode);\n\t\t\t \n\t\t\n\t\t \n\t }",
"protected void createMappingAnnotations() {\n\t\tString source = \"http://www.polarsys.org/capella/MNoE/CapellaLike/Mapping\";\t\n\t\taddAnnotation\n\t\t (blockArchitecturePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockArchitectureEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Package\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedRequirementPkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which RequirementsPkg stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which AbstractCapabilityPkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which InterfacePkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which DataPkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_ProvisionedArchitectureAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_ProvisioningArchitectureAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_AllocatedArchitectures(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_AllocatingArchitectures(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::BehavioredClassifier\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"Descendants are mapped to SysML::Blocks::Block, which cannot contain a Package.\\r\\nTherefore, store these AbstractCapabilityPackages in the nearest available package.\",\n\t\t\t \"constraints\", \"Multiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which InterfacePkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which DataPkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedStateMachines(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::BehavioredClassifier::ownedBehavior\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::BehavioredClassifier::ownedBehavior elements on which StateMachine stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentArchitectureEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Class\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::NamedElement::clientDependency elements on which InterfaceUse stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::BehavioredClassifier::interfaceRealization\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Order must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvisionedComponentAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvisioningComponentAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatedComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"SysML::Blocks::Block cannot contain PhysicalPath\\'s equivalent, hence we find the nearest available package to store them.\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::StructuredClassifier::ownedConnector\",\n\t\t\t \"explanation\", \"since PhysicalLink is mapped to uml::Connector\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractActorEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"SysML::Blocks::Block\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"should be mapped to uml::Property, but one of its concrete ancestors already is (Property), so avoid redefining it\\r\\nat this level to avoid profile generation issue\",\n\t\t\t \"constraints\", \"information::Property must have as base metaclass uml::Property\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_OwnedDeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_DeployedParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_DeployingParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (architectureAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Realization\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getArchitectureAllocation_AllocatedArchitecture(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getArchitectureAllocation_AllocatingArchitecture(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::ComponentRealization or uml::InterfaceRealization regarding the baseMetaClass of the realized element\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponentAllocation_AllocatedComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponentAllocation_AllocatingComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataType(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_ParticipationsInCapabilityRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfacePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Package\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which Interface stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfacePkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which InterfacePkg stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Interface\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_Mechanism(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ImplementorComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_UserComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Opposite reference of uml::InterfaceRealization::contract\",\n\t\t\t \"constraints\", \"uml::Element::ownedElement elements on which InterfaceImplementation stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Opposite reference of uml::Dependency::supplier\",\n\t\t\t \"constraints\", \"uml::Element::ownedElement elements on which InterfaceUse stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvisioningInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_AllocatingInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ExchangeItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_OwnedExchangeItemAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RequiringComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RequiringComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvidingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvidingComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizingLogicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizedContextInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizingPhysicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizedLogicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceImplementationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::InterfaceRealization\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_InterfaceImplementor(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_ImplementedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::InterfaceRealization::contract\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceUseEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Usage\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_InterfaceUser(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::client\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_UsedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::supplier\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Multiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (providedInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::InterfaceRealization\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getProvidedInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::InterfaceRealization::contract\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (requiredInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Usage\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getRequiredInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::supplier\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Dependency::supplier elements on which Interface stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocation_AllocatedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocation_AllocatingInterfaceAllocator(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocatorEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Classifier\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_OwnedInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Some elements on which InterfaceAllocation stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_ProvisionedInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_AllocatedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (actorCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Dependency\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Dependency\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentContextEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (exchangeItemAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Realization\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_SendProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_ReceiveProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatedItem(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatingInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (deployableElementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::NamedElement\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeployableElement_DeployingLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Opposite reference of uml::Dependency::supplier\",\n\t\t\t \"constraints\", \"Order must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (deploymentTargetEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::DeploymentTarget\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeploymentTarget_DeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::NamedElement::clientDependency\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::DeploymentTarget::deployment elements on which AbstractDeployment stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractDeploymentLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Dependency,could be mapped on uml::Deployment, but dependencies diagram allows to \\\"deploy\\\" more capella element types.\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_DeployedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::supplier\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Multiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_Location(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::client\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Dependency::client elements on which DeploymentTarget stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPathInvolvedElementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalArtifactEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalArtifact_AllocatorConfigurationItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalLinkEnd_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalPathLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Connector\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_LinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::specific\",\n\t\t\t \"explanation\", \"first need to create ConnectorEnds pointing to the Ports, and then reference them in uml::Connector::end\",\n\t\t\t \"constraints\", \"cardinality must be [2..2]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedComponentExchangeFunctionalExchangeAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"Elements are contained in the nearest possible parent container.\",\n\t\t\t \"constraints\", \"some elements on which ComponentFunctionalExchangeAllocation stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Connector::end\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_SourcePhysicalPort(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_TargetPhysicalPort(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::ConnectorEnd\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Port(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::ConnectorEnd::role\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::ConnectorEnd::role elements on which PhysicalPort stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Part(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::ConnectorEnd::partWithPort\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Class\",\n\t\t\t \"explanation\", \"_todo_\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_OwnedPhysicalPathInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_FirstPhysicalPathInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_OwnedPhysicalPathRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_NextInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_PreviousInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_InvolvedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_InvolvedComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathReferenceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathReference_ReferencedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"SysML::PortAndFlows::FlowPort\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_OwnedPhysicalPortRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_AllocatedComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\n\t}",
"@Override\r\npublic String getCelestialClassification() {\n\treturn \"DwarfPlanets\";\r\n}",
"Relations getGroupOfRelations();",
"public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) {\n throw new IllegalArgumentException(\"synsets and hypernyms can't be empty\");\n }\n int lineCount = 0;\n In inputFile = new In(synsets);\n while (inputFile.hasNextLine()) {\n String aLine = inputFile.readLine();\n String[] splitArr = aLine.split(\",\");\n int synID = Integer.parseInt(splitArr[0]);\n String[] nounSyn = splitArr[1].split(\" \");\n nouns.put(synID, nounSyn);\n for (String word : nounSyn) {\n LinkedList<Integer> nounList = synsetList.get(word);\n if (nounList == null) {\n nounList = new LinkedList<Integer>();\n }\n nounList.add(synID);\n synsetList.put(word, nounList);\n\n }\n lineCount += 1;\n\n }\n inputFile.close();\n aDigraph = new Digraph(lineCount);\n In hyperInput = new In(hypernyms);\n while (hyperInput.hasNextLine()) {\n String aLine = hyperInput.readLine();\n String[] splitArr = aLine.split(\",\");\n int synID = Integer.parseInt(splitArr[0]);\n for (int i = 1; i < splitArr.length; i++) {\n aDigraph.addEdge(synID, Integer.parseInt(splitArr[i]));\n }\n }\n hyperInput.close();\n shortestCA = new ShortestCommonAncestor(aDigraph);\n\n\n }",
"private static String getAncesterPatternSQL(Connection con, long spt_source_usr_ent_id) throws SQLException {\n long[] grp_ent_ids = ViewSuperviseTargetEntity.getActiveSupervisedGroupEntId(con, spt_source_usr_ent_id);\n StringBuffer SQLBuf = new StringBuffer();\n if(grp_ent_ids == null || grp_ent_ids.length == 0) {\n //to ensure no result will be returned as the user does not have any supervised group\n SQLBuf.append(\" and 1=2 \");\n } else {\n SQLBuf.append(\" and (\");\n for(int i=0 ;i<grp_ent_ids.length; i++) {\n if(i > 0) {\n SQLBuf.append(\" or \");\n }\n SQLBuf.append(\" enr1.ern_ancestor_ent_id = \").append(grp_ent_ids[i]);\n }\n SQLBuf.append(\" )\");\n }\n return SQLBuf.toString();\n }",
"TypeAssociation getAssocieCommeSujetEvenementNRBC();",
"ConceptsType createConceptsType();",
"java.lang.String getSemanticLangidModelName();",
"public String sca(String noun1, String noun2) {\n if (!isNoun(noun1) || !isNoun(noun2)) {\n throw new IllegalArgumentException(\"Either noun1 or noun2 is not a wordnet noun\");\n }\n LinkedList<Integer> x = synsetList.get(noun1);\n LinkedList<Integer> y = synsetList.get(noun2);\n int synID = shortestCA.ancestorSubset(x, y);\n String[] data = nouns.get(synID);\n StringBuilder output = new StringBuilder();\n for (int i = 0; i < data.length; i++) {\n output.append(data[i]);\n if (i < data.length - 1) {\n output.append(\" \");\n }\n }\n return output.toString();\n }",
"UMLDomainConcept createUMLDomainConcept();",
"public void GetNom(Verbum w){\r\n\t\tDSElement<Terminus> ending = inflects.first;\r\n\t\tint variant = w.variant;\r\n\t\tint variant2 = -2;\r\n\t\tint cd = w.cd;\r\n\t\tString gender = w.gender;\r\n\t\tString form = \"\";\r\n\t\tint count = inflects.size(); // failsafe counter\r\n\t\twhile(count > 0){\r\n\t\t\tTerminus end = ending.getItem();\r\n\t\t\tif(w.pos.equals(\"V\")) { //VERB\r\n\t\t\t\tif(w.cd==2){\r\n\t\t\t\t\tif(w.type.equals(\"DEP\")){\r\n\t\t\t\t\t\tw.nom = w.form1 + \"eor\";\r\n\t\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tw.nom = w.form1 + \"eo\";\r\n\t\t\t\t\t\tw.nomFormLengh = 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(w.type.equals(\"DEP\")){\r\n\t\t\t\t\t\tw.nom = w.form1 + \"or\";\r\n\t\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tw.nom = w.form1 + \"o\";\r\n\t\t\t\t\t\tw.nomFormLengh = 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t} else if(w.pos.equals(\"N\") && end.pos.equals(\"N\")) { //NOUN\r\n\t\t\t\t/* Some special cases */\r\n\t\t\t\tif(cd == 3 && variant == 1){ //Common lots of cases\r\n\t\t\t\t\tvariant = 0;\r\n\t\t\t\t\tvariant2 = 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 2 && variant == 1){ //Common lots of cases\r\n\t\t\t\t\tvariant = 0;\r\n\t\t\t\t\tvariant2 = 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 3) {\r\n\t\t\t\t\tw.nom = w.form1;\r\n\t\t\t\t\tw.nomFormLengh = 0;\r\n\t\t\t\t\treturn; //return nom. s. 3rd decl.\r\n\t\t\t\t}\r\n\t\t\t\t/* END */\r\n\t\t\t\tif (end.wordcase != null && end.number != null){\r\n\t\t\t\t\tif(end.cd == cd && (end.variant == variant || end.variant == variant2) && \r\n\t\t\t\t\t\t\tend.wordcase.equals(\"NOM\") && end.number.equals(\"S\") && \r\n\t\t\t\t\t\t\tend.gender.equals(gender)) {\r\n\t\t\t\t\t\tform = w.form1;\r\n\t\t\t\t\t\tw.nom = form + end.ending;\r\n\t\t\t\t\t\tw.nomFormLengh = end.ending.length()+1;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(end.cd == cd && (end.variant == variant || end.variant == variant2) && \r\n\t\t\t\t\t\t\tend.wordcase.equals(\"NOM\") && end.number.equals(\"S\") &&\r\n\t\t\t\t\t\t\tend.gender.equals(\"X\")) {\r\n\t\t\t\t\t\tform = w.form1;\r\n\t\t\t\t\t\tw.nom = form + end.ending;\r\n\t\t\t\t\t\tw.nomFormLengh = end.ending.length()+1;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(end.cd == cd && (end.variant == variant || end.variant == variant2) && \r\n\t\t\t\t\t\t\tend.wordcase.equals(\"NOM\") && end.number.equals(\"S\") && \r\n\t\t\t\t\t\t\tend.gender.equals(\"C\")) {\r\n\t\t\t\t\t\tform = w.form1;\r\n\t\t\t\t\t\tw.nom = form + end.ending;\r\n\t\t\t\t\t\tw.nomFormLengh = end.ending.length()+1;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(w.pos.equals(\"ADJ\") && end.pos.equals(\"ADJ\")) {\r\n\t\t\t\t/* The different declensions and variations */\r\n\t\t\t\tif(cd == 1 && (variant == 1 || variant == 3 || variant == 5)) {\r\n\t\t\t\t\tw.nom = w.form1 + \"us\";\r\n\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 1 && (variant == 2 || variant == 4)){\r\n\t\t\t\t\tw.nom = w.form1;\r\n\t\t\t\t\tw.nomFormLengh = 0;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 0 && variant == 0 && w.type.equals(\"COMP\")) {\r\n\t\t\t\t\tw.nom = w.form1 + \"or\";\r\n\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 0 && variant == 0 && w.type.equals(\"SUPER\")) {\r\n\t\t\t\t\tw.nom = w.form1 + \"mus\";\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 2 && variant == 1) {\r\n\t\t\t\t\tw.nom = w.form1 + \"e\";\r\n\t\t\t\t\tw.nomFormLengh = 2;\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 2 && variant == 2) {\r\n\t\t\t\t\tw.nom = w.form1 + \"a\";\r\n\t\t\t\t\tw.nomFormLengh = 2;\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 2 && variant == 3) {\r\n\t\t\t\t\tw.nom = w.form1 + \"es\";\r\n\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 2 && (variant == 6 || variant == 7)) {\r\n\t\t\t\t\tw.nom = w.form1 + \"os\";\r\n\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 2 && variant == 8) {\r\n\t\t\t\t\tw.nom = w.form1 + \"on\";\r\n\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 3 && (variant == 1 || variant == 3 || variant == 6)) {\r\n\t\t\t\t\tw.nom = w.form1;\r\n\t\t\t\t\tw.nomFormLengh = 0;\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\t\t\t\tif(cd == 3 && variant == 2) {\r\n\t\t\t\t\tw.nom = w.form1 + \"is\";\r\n\t\t\t\t\tw.nomFormLengh = 3;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t/* END */\t\t\t\t\r\n\t\t\t} else if(w.pos.equals(\"ADV\") && end.pos.equals(\"ADV\")) {\r\n\t\t\t\tw.nom = w.form1;\r\n\t\t\t\tw.nomFormLengh = 0;\r\n\t\t\t\treturn; \r\n\t\t\t}\r\n\t\t\tending = ending.getNext();\r\n\t\t\tif(ending == null)\r\n\t\t\t\tending = inflects.first;\r\n\t\t\tcount--;\r\n\t\t}\r\n\t\tw.nom = w.form1;\r\n\t\tw.nomFormLengh = 0;\r\n\t\treturn;\r\n\t}",
"private String createDistrictName(String districtLine){\n if(districtLine.contains(\"Representative\")) {\n return \"State House District \" + districtLine.split(\" \")[districtLine.split(\" \").length-1];\n }\n else if(districtLine.contains(\"Senator\")){\n return \"State Senate District \" + districtLine.split(\" \")[districtLine.split(\" \").length-1];\n }\n else{\n return null;\n }\n }",
"public static void main(String[] args) {\n In in = new In(\"/Users/kliner/Downloads/wordnet/digraph3.txt\");\n Digraph digraph = new Digraph(in);\n SAP sap = new SAP(digraph);\n System.out.println(sap.ancestor(0, 4));\n System.out.println(sap.ancestor(10, 13));\n System.out.println(sap.length(10, 13));\n// System.out.println(sap.ancestor(7, 3));\n// System.out.println(sap.length(7, 3));\n// System.out.println(sap.ancestor(3, 7));\n// System.out.println(sap.length(3, 7));\n// System.out.println(sap.ancestor(7, 1));\n// System.out.println(sap.length(7, 1));\n// System.out.println(sap.ancestor(7, 0));\n// System.out.println(sap.length(7, 0));\n// System.out.println(sap.ancestor(10, 11));\n// System.out.println(sap.length(10, 11));\n// System.out.println(sap.ancestor(10, 12));\n// System.out.println(sap.length(10, 12));\n// System.out.println(sap.ancestor(5, 12));\n// System.out.println(sap.length(5, 12));\n// System.out.println(sap.ancestor(0, 12));\n// System.out.println(sap.length(0, 12));\n }",
"public WordNet(String synsets, String hypernyms) throws IOException {\n\n this.synsetsMap = new HashMap<Integer, ArrayList<String>>();\n this.nounsMap = new HashMap<String, ArrayList<Integer>>();\n this.edgesMap = new HashMap<Integer, ArrayList<Integer>>();\n int graphNodes = 0; \n \n // Process synsets.txt\n BufferedReader br = new BufferedReader(new FileReader(synsets));\n String line;\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int synsetID = Integer.parseInt(items[0]);\n String[] nouns = items[1].split(\" \");\n \n for (String noun : nouns) {\n if (!nounsMap.containsKey(noun)) {\n nounsMap.put(noun, new ArrayList<Integer>());\n }\n nounsMap.get(noun).add(synsetID);\n }\n \n if (!synsetsMap.containsKey(synsetID)) {\n synsetsMap.put(synsetID, new ArrayList<String>());\n }\n \n for (String noun : nouns) {\n synsetsMap.get(synsetID).add(noun);\n }\n graphNodes++; \n }\n br.close();\n\n // Process hypernyms.txt\n br = new BufferedReader(new FileReader(hypernyms));\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int hypernymID = Integer.parseInt(items[0]);\n \n if (!edgesMap.containsKey(hypernymID)) {\n edgesMap.put(hypernymID, new ArrayList<Integer>());\n }\n \n for (int i = 1; i < items.length; i++) {\n edgesMap.get(hypernymID).add(Integer.parseInt(items[i]));\n }\n }\n br.close();\n \n // Construct Graph\n this.G = new Digraph(graphNodes);\n for (Map.Entry<Integer, ArrayList<Integer>> entry : edgesMap.entrySet()) {\n for (int edge : entry.getValue()) {\n this.G.addEdge(entry.getKey(), edge);\n }\n }\n \n // Check if there's a cycle\n DirectedCycle cycle = new DirectedCycle(this.G);\n if (cycle.hasCycle()) {\n throw new java.lang.IllegalArgumentException();\n }\n \n // Construct SAP \n this.sap = new SAP(this.G);\n }",
"public void decideNature()\n {\n String nature = new String(\"\");\n Random rand = new Random();\n int i = rand.nextInt(100);\n if(i <= 25)\n {\n nature = \"Very mischievous. Enjoys hiding objects in plain sight\";\n }//ends the if\n else if(i > 25 && i <= 50)\n {\n nature = \"Loves to spend time sleeping on the clouds\";\n }//ends the else if\n else if(i > 50 && i <= 75)\n {\n nature = \"Is very playful\";\n }//ends the else if\n else\n {\n nature = \"Loves to perform dances in the air\";\n }\n \n setNature(nature);\n }",
"public java.lang.String getKind_ant() throws java.rmi.RemoteException;",
"public interface ContinuousStateDatum extends org.cdao.jastor.CharacterStateDatum, com.ibm.adtech.jastor.Thing {\n\t\n\t/**\n\t * The rdf:type for this ontology class\n */\n\tpublic static final Resource TYPE = ResourceFactory.createResource(\"http://localhost/~vivek/cdao.owl#ContinuousStateDatum\");\n\t\n\n\t/**\n\t * The Jena Property for has__Continuous__State \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Continuous_State)</p>\n\t * <br>\n\t * Dublin Core Standard Properties <br>\n\t * \tdescription : This property associates a character-state instance with a state value on a continuous numeric scale.^^http://www.w3.org/2001/XMLSchema#string <br>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__Continuous__StateProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Continuous_State\");\n\n\n\t/**\n\t * The Jena Property for belongs__to__Continuous__Character \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#belongs_to_Continuous_Character)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property belongs__to__Continuous__CharacterProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#belongs_to_Continuous_Character\");\n\n\n\t/**\n\t * The Jena Property for has__Annotation \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Annotation)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__AnnotationProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Annotation\");\n\n\n\t/**\n\t * The Jena Property for belongs__to \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#belongs_to)</p>\n\t * <br>\n\t * Dublin Core Standard Properties <br>\n\t * \tdescription : Generic property that links a concept to another concept it is a constituent of. The property is a synonym of part_of. <br>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property belongs__toProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#belongs_to\");\n\n\n\t/**\n\t * The Jena Property for has__Value \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Value)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__ValueProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Value\");\n\n\n\t/**\n\t * The Jena Property for has__Support__Value \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Support_Value)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__Support__ValueProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Support_Value\");\n\n\n\t/**\n\t * The Jena Property for has__Float__Value \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Float_Value)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__Float__ValueProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Float_Value\");\n\n\n\t/**\n\t * The Jena Property for has__Int__Value \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Int_Value)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__Int__ValueProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Int_Value\");\n\n\n\t/**\n\t * The Jena Property for has__Uncertainty__Factor \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Uncertainty_Factor)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__Uncertainty__FactorProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Uncertainty_Factor\");\n\n\n\t/**\n\t * The Jena Property for has__Precision \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_Precision)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__PrecisionProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_Precision\");\n\n\n\t/**\n\t * The Jena Property for has__External__Reference \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has_External_Reference)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property has__External__ReferenceProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has_External_Reference\");\n\n\n\t/**\n\t * The Jena Property for connects__to \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#connects_to)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property connects__toProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#connects_to\");\n\n\n\t/**\n\t * The Jena Property for has \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#has)</p>\n\t * <br>\n\t * Dublin Core Standard Properties <br>\n\t * \tdescription : Generic 'has' property. <br>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property hasProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#has\");\n\n\n\t/**\n\t * The Jena Property for part__of \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#part_of)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property part__ofProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#part_of\");\n\n\n\t/**\n\t * The Jena Property for precedes \n\t * <p>(URI: http://localhost/~vivek/cdao.owl#precedes)</p>\n\t * <br> \n\t */\n\tpublic static com.hp.hpl.jena.rdf.model.Property precedesProperty = ResourceFactory.createProperty(\"http://localhost/~vivek/cdao.owl#precedes\");\n\n\n\n\n\t/**\n\t * Get an Iterator the 'has__Continuous__State' property values. This Iteartor\n\t * may be used to remove all such values.\n\t * @return\t\t{@link java.util.Iterator} of {@link org.cdao.jastor.Continuous}\n\t * @see\t\t\t#has__Continuous__StateProperty\n\t */\n\tpublic java.util.Iterator getHas__Continuous__State() throws com.ibm.adtech.jastor.JastorException;\n\n\t/**\n\t * Adds a value for the 'has__Continuous__State' property\n\t * @param\t\tThe {@link org.cdao.jastor.Continuous} to add\n\t * @see\t\t\t#has__Continuous__StateProperty\n\t */\n\tpublic void addHas__Continuous__State(org.cdao.jastor.Continuous has__Continuous__State) throws com.ibm.adtech.jastor.JastorException;\n\t\n\t/**\n\t * Adds an anonymous value for the 'has__Continuous__State' property\n\t * @return\t\tThe anoymous {@link org.cdao.jastor.Continuous} created\n\t * @see\t\t\t#has__Continuous__StateProperty\n\t */\n\tpublic org.cdao.jastor.Continuous addHas__Continuous__State() throws com.ibm.adtech.jastor.JastorException;\n\t\n\t/**\n\t * \n\t * The resource argument have rdf:type http://localhost/~vivek/cdao.owl#Continuous. That is, this method\n\t * should not be used as a shortcut for creating new objects in the model.\n\t * @param\t\tThe {@link om.hp.hpl.jena.rdf.model.Resource} to add\n\t * @see\t\t\t#has__Continuous__StateProperty\n\t */\n\tpublic org.cdao.jastor.Continuous addHas__Continuous__State(com.hp.hpl.jena.rdf.model.Resource resource) throws com.ibm.adtech.jastor.JastorException;\n\t\n\t/**\n\t * Removes a value for the 'has__Continuous__State' property. This method should not\n\t * be invoked while iterator through values. In that case, the remove() method of the Iterator\n\t * itself should be used.\n\t * @param\t\tThe {@link org.cdao.jastor.Continuous} to remove\n\t * @see\t\t\t#has__Continuous__StateProperty\n\t */\n\tpublic void removeHas__Continuous__State(org.cdao.jastor.Continuous has__Continuous__State) throws com.ibm.adtech.jastor.JastorException;\n\t\t\n\t/**\n\t * Gets the 'belongs__to__Continuous__Character' property value\n\t * @return\t\t{@link org.cdao.jastor.ContinuousCharacter}\n\t * @see\t\t\t#belongs__to__Continuous__CharacterProperty\n\t */\n\tpublic org.cdao.jastor.ContinuousCharacter getBelongs__to__Continuous__Character() throws com.ibm.adtech.jastor.JastorException;\n\t\n\t/**\n\t * Sets the 'belongs__to__Continuous__Character' property value\n\t * @param\t\t{@link org.cdao.jastor.ContinuousCharacter}\n\t * @see\t\t\t#belongs__to__Continuous__CharacterProperty\n\t */\n\tpublic void setBelongs__to__Continuous__Character(org.cdao.jastor.ContinuousCharacter belongs__to__Continuous__Character) throws com.ibm.adtech.jastor.JastorException;\n\t\n\t/**\n\t * Sets the 'belongs__to__Continuous__Character' property value to an anonymous node\n\t * @return\t\t{@link org.cdao.jastor.ContinuousCharacter}, the created value\n\t * @see\t\t\t#belongs__to__Continuous__CharacterProperty\n\t */\t\n\tpublic org.cdao.jastor.ContinuousCharacter setBelongs__to__Continuous__Character() throws com.ibm.adtech.jastor.JastorException;\n\t\n\t/**\n\t * Sets the 'belongs__to__Continuous__Character' property value to the given resource\n\t * The resource argument should have rdf:type http://localhost/~vivek/cdao.owl#ContinuousCharacter. That is, this method\n\t * should not be used as a shortcut for creating new objects in the model.\n\t * @param\t\t{@link com.hp.hpl.jena.rdf.model.Resource} must not be be null.\n\t * @return\t\t{@link org.cdao.jastor.ContinuousCharacter}, the newly created value\n\t * @see\t\t\t#belongs__to__Continuous__CharacterProperty\n\t */\n\tpublic org.cdao.jastor.ContinuousCharacter setBelongs__to__Continuous__Character(com.hp.hpl.jena.rdf.model.Resource resource) throws com.ibm.adtech.jastor.JastorException;\n\t\n}",
"@Contract\npublic interface LogicGraphClassifier {\n\n /**\n * Get the native identifier\n * @param sctid SNOMED clinical terms identifier\n * @return the native identifier (for all objects)\n */\n int getNidFromSNOMED(String sctid);\n\n /**\n *\n * @param sctid SNOMED clinical terms identifier\n * @return the UUID\n */\n UUID getUUIDFromSNOMED(String sctid);\n\n /**\n * Find a chronicle based on the sctId\n * @param sctid SNOMED clinical terms identifier\n * @return native identifier\n */\n ConceptChronicleBI findChronicle(String sctid);\n\n /**\n * Find the native id for the indexed LogicGraph. If one does not exist,\n * it will create one and return the native id.\n *\n * @param pce Post Coordinated Expression\n * @return the native identifier\n */\n Integer classify(LogicGraph pce);\n\n}",
"private void normalizeLHS(OWLDescription super_class, OWLClass cls) {\n\t\t\n\t}",
"protected abstract RuleExplanationSet transformGenotypes(EvolutionResult<BitGene, Double> evolutionResult);",
"public Snippet visit(DistType n, Snippet argu) {\n\t\t Snippet _ret=new Snippet(\"\",\"\", null ,false);\n\t\t\t_ret.expType = new X10Distribution(1);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t Snippet f3 = n.rankEquation.accept(this, argu);\n\t _ret.returnTemp = \"int\";\n\t n.nodeToken3.accept(this, argu);\n\t return _ret;\n\t }",
"public Image getNatural();",
"public WordNet(String synsets, String hypernyms)\n {\n In text = new In(synsets);\n synsetList = new ArrayList<String>();\n synsetHash = new HashMap<String, ArrayList<Integer>>();\n // parse words into array synsetList\n synsetNum = 0;\n while (!text.isEmpty())\n {\n String temp = text.readLine().split(\",\")[1];\n synsetList.add(temp);\n synsetNum++;\n }\n //initialize synsetHash with word:list of integers\n for (int i = 0; i < synsetNum; i++)\n {\n String[] stringArray = synsetList.get(i).split(\" \");\n for (String s : stringArray)\n {\n if (synsetHash.containsKey(s))\n {\n ArrayList<Integer> temp = synsetHash.get(s);\n temp.add(i);\n }\n else\n {\n ArrayList<Integer> temp = new ArrayList<Integer>();\n temp.add(i);\n synsetHash.put(s, temp);\n }\n }\n }\n\n wordGraph = new Digraph(synsetNum);\n text = new In(hypernyms);\n while (!text.isEmpty())\n {\n String[] edges = text.readLine().split(\",\");\n int mainEdge = Integer.parseInt(edges[0]);\n for (int i = 1; i < edges.length; i++)\n {\n wordGraph.addEdge(mainEdge, Integer.parseInt(edges[i]));\n }\n }\n // check if input is a rooted DAG\n int count = 0;\n for (int v = 0; v < synsetNum; v++)\n {\n if (wordGraph.outdegree(v) == 0) count++;\n if (count > 1) throw new IllegalArgumentException();\n }\n // may be redundant check, but wanna make sure\n if (count != 1) throw new IllegalArgumentException();\n\n DirectedCycle cycle = new DirectedCycle(wordGraph);\n if (cycle.hasCycle()) throw new IllegalArgumentException();\n\n shortestPath = new SAP(wordGraph);\n \n }",
"@Override\n\tpublic String getType() {\n\t\treturn \"nominal\";\n\t}",
"public String getAuthoritativeSource(){\r\n\t\treturn \"pubmed\";\r\n\t}",
"public static Optional<SememeChronology<? extends SememeVersion<?>>> getAnnotationSememe(int componentNid, int assemblageConceptId) \n\t{\n\t\tSet<Integer> allowedAssemblages = new HashSet<>();\n\t\tallowedAssemblages.add(assemblageConceptId);\n\t\tSet<SememeChronology<? extends SememeVersion<?>>> sememeSet= Get.sememeService()\n\t\t\t\t.getSememesForComponentFromAssemblages(componentNid, allowedAssemblages).collect(Collectors.toSet());\n\t\tswitch(sememeSet.size()) \n\t\t{\n\t\t\tcase 0:\n\t\t\t\treturn Optional.empty();\n\t\t\tcase 1:\n\t\t\t\treturn Optional.of(sememeSet.iterator().next());\n\t\t\t\tdefault:\n\t\t\t\t\tlog.fatal(\"Component \" + componentNid + \" has \" + sememeSet.size() + \" annotations of type \" + \n\t\t\t\t\t\t\tGet.conceptDescriptionText(assemblageConceptId) + \" (should only have zero or 1) - returning arbitrary result!\");\n\t\t\t\t\treturn Optional.of(sememeSet.iterator().next());\n\t\t}\n\t}",
"public static boolean refersToSameCategery(String field){\n if (field.equalsIgnoreCase(HAS_SUBSITE_LABEL)){\n return true;\n }\n if (field.equalsIgnoreCase(IS_SIMILAR_TO_LABEL)){\n return true;\n }\n if (field.equalsIgnoreCase(IS_SUBSITE_OF_LABEL)){\n return true;\n }\n if (field.equalsIgnoreCase(HAS_SUBTAXON_LABEL)){\n return true;\n }\n if (field.equalsIgnoreCase(IS_SUBTAXON_OF_LABEL)){\n return true;\n }\n return false;\n }",
"@SuppressWarnings(\"unchecked\")\r\npublic static void ruleResolvePronouns(AnnotationSet basenp, Document doc)\r\n{\n Annotation[] basenpArray = basenp.toArray();\r\n\r\n // Initialize coreference clusters\r\n int maxID = basenpArray.length;\r\n\r\n // Create an array of pointers\r\n // clust = new UnionFind(maxID);\r\n fvm = new RuleResolvers.FeatureVectorMap();\r\n ptrs = new int[maxID];\r\n clusters = new HashSet[maxID];\r\n for (int i = 0; i < clusters.length; i++) {\r\n ptrs[i] = i;\r\n HashSet<Annotation> cluster = new HashSet<Annotation>();\r\n cluster.add(basenpArray[i]);\r\n clusters[i] = cluster;\r\n }\r\n Annotation zero = new Annotation(-1, -1, -1, \"zero\");\r\n\r\n for (int i = 1; i < basenpArray.length; i++) {\r\n Annotation np2 = basenpArray[i];\r\n if (FeatureUtils.isPronoun(np2, doc)) {\r\n Annotation ant = ruleResolvePronoun(basenpArray, i, doc);\r\n if (ant != null) {\r\n np2.setProperty(Property.PRO_ANTES, ant);\r\n }\r\n else {\r\n np2.setProperty(Property.PRO_ANTES, zero);\r\n }\r\n }\r\n }\r\n}",
"ImmutableList<SchemaOrgType> getAlternativeHeadlineList();",
"static Set<NLMeaning> extractMeanings(NLText nlText) {\n\t\tSet<NLMeaning> meanings = new HashSet();\n\t\t\n\t\tList<NLSentence> sentences = nlText.getSentences();\n\t\tNLSentence firstSentence = sentences.iterator().next();\n\t\tList<NLToken> tokens = firstSentence.getTokens();\n\t\tList<NLMultiWord> multiWords = firstSentence.getMultiWords();\n\t\tList<NLNamedEntity> namedEntities = firstSentence.getNamedEntities();\n\t\t\n\t\t// Add meanings of all tokens that are not part of multiwords or NEs\n\t\tIterator<NLToken> itToken = tokens.iterator();\n\t\twhile (itToken.hasNext()) {\n\t\t\tSet<NLMeaning> tokenMeanings = getTokenMeanings(itToken.next());\n\t\t\tif (tokenMeanings != null) {\n\t\t\t\tmeanings.addAll(tokenMeanings);\t\t\t\n\t\t\t}\n//\t\t\tNLToken token = itToken.next();\n//\t\t\tboolean hasMultiWords = token.getMultiWords() != null && !token.getMultiWords().isEmpty();\n//\t\t\tboolean hasNamedEntities = token.getNamedEntities() != null && !token.getNamedEntities().isEmpty();\n//\t\t\tif (!hasMultiWords && !hasNamedEntities) {\n//\t\t\t\tif (token.getMeanings() == null || token.getMeanings().isEmpty()) {\n//\t\t\t\t\t// This is a hack to handle a bug where the set of meanings\n//\t\t\t\t\t// is empty but there is a selected meaning.\n//\t\t\t\t\t\n//\t\t\t\t\tNLMeaning selectedMeaning = token.getSelectedMeaning();\n//\t\t\t\t\tif (selectedMeaning != null) {\n//\t\t\t\t\t\tmeanings.add(selectedMeaning);\n//\t\t\t\t\t}\n//\t\t\t\t} else {\n//\t\t\t\t\tmeanings.addAll(token.getMeanings());\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t\t\n\t\t// Add meanings of multiwords and NEs\n\t\tIterator<NLMultiWord> itMultiWord = multiWords.iterator();\n\t\twhile (itMultiWord.hasNext()) {\n\t\t\tNLMultiWord multiWord = itMultiWord.next();\n\t\t\tmeanings.addAll(multiWord.getMeanings());\n\t\t}\n\t\tIterator<NLNamedEntity> itNamedEntity = namedEntities.iterator();\n\t\twhile (itNamedEntity.hasNext()) {\n\t\t\tNLNamedEntity namedEntity = itNamedEntity.next();\n\t\t\tmeanings.addAll(namedEntity.getMeanings());\n\t\t}\n\t\t\n\t\treturn meanings;\n\t}",
"public static Node bygg(String[] ordliste){\n \treturn new Node();\r\n }",
"public interface AppCDef extends Classification {\n\n public enum DefMeta implements ClassificationMeta {\n ;\n public String classificationName() {\n return name(); // same as definition name\n }\n\n public OptionalThing<? extends Classification> of(Object code) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public OptionalThing<? extends Classification> byName(String name) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public Classification codeOf(Object code) { // null if not found, old style so use of(code)\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public Classification nameOf(String name) { // null if not found, old style so use byName(name)\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> listAll() {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> listByGroup(String groupName) { // exception if not found\n throw new IllegalStateException(\"Unknown groupName: \" + groupName + \", \" + this); // basically unreachable\n }\n\n public List<Classification> listOf(Collection<String> codeList) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> groupOf(String groupName) { // old style\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public ClassificationCodeType codeType() {\n return ClassificationCodeType.String; // as default\n }\n\n public ClassificationUndefinedHandlingType undefinedHandlingType() {\n return ClassificationUndefinedHandlingType.LOGGING; // as default\n }\n\n public static OptionalThing<AppCDef.DefMeta> find(String classificationName) { // instead of valueOf()\n if (classificationName == null) { throw new IllegalArgumentException(\"The argument 'classificationName' should not be null.\"); }\n return OptionalThing.ofNullable(null, () -> {\n throw new ClassificationNotFoundException(\"Unknown classification: \" + classificationName);\n });\n }\n\n public static AppCDef.DefMeta meta(String classificationName) { // old style so use find(name)\n if (classificationName == null) { throw new IllegalArgumentException(\"The argument 'classificationName' should not be null.\"); }\n throw new IllegalStateException(\"Unknown classification: \" + classificationName);\n }\n\n @SuppressWarnings(\"unused\")\n private String[] xinternalEmptyString() {\n return emptyStrings(); // to suppress 'unused' warning of import statement\n }\n }\n}",
"static TreeSet<Verb> parseVerbs(Scanner data, int conjugation){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Verb> output = new TreeSet<Verb>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.VERB_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString PP1 = null;\n\t\t\tString PP2 = null;\n\t\t\tString PP3 = null;\n\t\t\tString PP4 = null;\n\n\t\t\tString[] PPs = current[1].split(\", \");\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0].trim());\n\t\t\t\tPP1 = PPs[0];\n\t\t\t\tPP2 = PPs[1];\n\t\t\t\tPP3 = PPs[2];\n\t\t\t\ttry{\n\t\t\t\t\tPP4 = PPs[3];\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e){\n\t\t\t\t\t//deponent verb.\n\t\t\t\t}\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\"));\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tVerb currentVerb = new Verb(PP1, PP2, PP3, PP4, conjugation, chapter, definitions);\n\n\t\t\tSystem.out.println(\"Added: \" + currentVerb);\n\t\t\toutput.add(currentVerb);\n\t\t}\n\n\t\treturn output;\n\t}",
"private boolean compatibleNodeTypes(AxiomTreeNode t1, AxiomTreeNode t2) {\n if (!t1.getNodeType().equals(t2.getNodeType())) {\n return false;\n }\n \n switch (t1.getNodeType()) {\n case CARD:\n int label1 = (Integer) t1.getLabel();\n int label2 = (Integer) t2.getLabel();\n return (label1 == label2);\n \t\n case OWLOBJECT:\n OWLObject o1 = (OWLObject) t1.getLabel();\n OWLObject o2 = (OWLObject) t2.getLabel();\n //System.out.println(o1.getClass());\n //System.out.println(o2.getClass());\n //Check for datatypes - then check datatype to see match. Else, return true if compatible.\n if(o1.getClass() == o2.getClass())\n {\n \tif(!o1.getDatatypesInSignature().isEmpty())\n \t{\n \t\t//Need to check if built in first. First check is convenience, datatypes should match\n \t\t//If one is built in, so should other. If neither is built in, this is also a viable match\n \t\t//If not equal and at least one is built in, its not a match.\n \t\tOWLDatatype dt1 = (OWLDatatype) o1.getDatatypesInSignature().toArray()[0];\n \t\t\tOWLDatatype dt2 = (OWLDatatype) o2.getDatatypesInSignature().toArray()[0];\n \t\t\t//System.out.println(\"DT1: \" + dt1);\n \t\t\t//System.out.println(\"DT2: \" + dt2);\n \t\tif(dt1.equals(dt2) && dt1.isBuiltIn())\n \t\t{\t\n \t\t\t//System.out.println(\"Standard state\");\n \t\t\t//System.out.println(o1.equals(o2));\n \t\t\treturn o1.equals(o2);\n \t\t}\n \t\telse if(!dt1.isBuiltIn() && !dt2.isBuiltIn())\n \t\t{\n \t\t\t//System.out.println(\"Unique state\");\n \t\t\treturn true;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t//System.out.println(\"Rejection state\");\n \t\t\treturn false;\n \t\t}\n \n \t}\n \telse\n \t{\n \t\treturn true;\n \t}\n }\n else\n {\n \treturn false;\n }\n }\n return false;\n }",
"@Override\n public String displayUponMatchingResult() {\n\n if (brand == null || brand.equals(\"N/A\")) {\n return String.format(\"%s (%s)\", foodLabel, category);\n } else {\n return String.format(\"%s (%s by %s)\", foodLabel, category, brand);\n }\n\n }",
"public interface QuotedL1Node {\n\n}",
"public WordNet(String synsets, String hypernyms) {\n boolean RootedDAG = false;\n String[] sets = synsets.split(\"\\n\");\n SynSets= new String[sets.length][2];\n Wordnet = new Digraph(sets.length);\n for (int i =0; i< sets.length; i++){\n String[] Delimiter = sets[i].split(\",\");\n SynSets[i][0] = Delimiter[1];\n SynSets[i][1] = Delimiter[2];\n }\n sets = hypernyms.split(\"\\n\");\n for(int i = 0; i < sets.length; i++){\n String[] Delimiter = sets[i].split(\",\");\n int Above = Integer.parseInt(Delimiter[0]);\n if(Delimiter.length==1) {\n if(!RootedDAG) RootedDAG = true;\n else throw new IllegalArgumentException();\n }\n for(int j = 1; j< Delimiter.length; j++){\n Wordnet.addEdge(Above, Integer.parseInt(Delimiter[j]));\n }\n }\n //if(!RootedDAG) throw new IllegalArgumentException();\n }",
"DsmlNonUML createDsmlNonUML();",
"String getNegotiationXML();",
"static TreeSet<Adjective> parseAdjective3(Scanner data){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Adjective> output = new TreeSet<Adjective>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.ADJECTIVE_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\t\t\tAdjective currentAdjective = null;\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\n\t\t\t\tchapter = Integer.parseInt(current[0].trim());\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\ttrimAll(definitions);\n\t\t\t\t\n\t\t\t\tif(current[1].split(\", \").length == 1){\n\t\t\t\t\tcurrentAdjective = new OneTerminationAdjective(current[1].split(\", \")[0].split(\":\")[0], current[1].split(\", \")[0].split(\":\")[1], chapter, definitions);\n\t\t\t\t} else if(current[1].split(\", \").length == 2){\n\t\t\t\t\tString mascFem = current[1].split(\", \")[0];\n\t\t\t\t\tString neuter = current[1].split(\", \")[1];\n\t\t\t\t\tcurrentAdjective = new TwoTerminationAdjective(mascFem, neuter, chapter, definitions);\n\t\t\t\t} else if(current[1].split(\", \").length == 3){\n\t\t\t\t\tString masculine = current[1].split(\", \")[0];\n\t\t\t\t\tString feminine = current[1].split(\", \")[1];\n\t\t\t\t\tString neuter = current[1].split(\", \")[2];\n\t\t\t\t\tcurrentAdjective = new ThreeTerminationAdjective(masculine, feminine, neuter, chapter, definitions);\n\t\t\t\t}\n\n\t\t\t} catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\t//Adjective currentAdjective = new Adjective(masculine, feminine, neuter, chapter, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentAdjective);\n\t\t\toutput.add(currentAdjective);\n\t\t}\n\n\t\treturn output;\n\t}",
"@Override\n public String getArticleNode() {\n return ebsco_book_node;\n }",
"interface GAAllele {\r\n interface Type {\r\n int ENUMERATED = 1;\r\n int BOUNDED = 2;\r\n int DISCRETIZED = 3;\r\n }\r\n\r\n interface BoundType {\r\n int NONE = 0;\r\n int INCLUSIVE = 1;\r\n int EXCLUSIVE = 2;\r\n }\r\n}",
"org.landxml.schema.landXML11.ClassificationDocument.Classification insertNewClassification(int i);",
"ConceptualSchemeType createConceptualSchemeType();",
"public String kind() { return kind; }",
"Kind getKind();",
"public interface Node {\n Oper oper();\n CNFOrdinal toCNF();\n}",
"public boolean map(String newLine) {\n\t\t\n\t\tboolean success = false;\n\t\tString label = _extractor.extractLabel(newLine);\n\t\t\n\t\tif( label != null ) {\n\t\t\tString content = extractOntology(newLine, DBPEDIA_ONTOLOGY_MARKER);\t\t\t\n\t\t\t\n\t\t\tif( content != null ) {\n\t\t\t\t\t/*\n\t\t\t\t\t * If this is not a new content then add to the Ontology column.\n\t\t\t\t\t */\n\t\t\t\tif( _prevLabel.compareTo(label) == 0) {\n\t\t\t\t\t_ontoBuffer.append(FIELD_DELIM);\n\t\t\t\t\t_ontoBuffer.append(content);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * If this is a new label entry, then process the previous set of\n\t\t\t\t\t * ontologies categories..\n\t\t\t\t\t */\n\t\t\t\telse {\n\t\t\t\t\n\t\t\t\t\tif( _ontoBuffer != null ) {\n\t\t\t\t\t\tList<String> categories = CStringUtil.split(_ontoBuffer.toString(), FIELD_DELIM);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(categories != null) {\n\t\t\t\t\t\t\tString subtype = null;\n\t\t\t\t\t\t\tif( categories.size() > 0) {\n\t\t\t\t\t\t\t\tint lastOntology = categories.size()-1;\n\t\t\t\t\t\t\t\tStringBuilder typeBuf = new StringBuilder();\n\t\t\t\t\t\t\t\tfor( int j = lastOntology; j >= 0; j--) {\n\t\t\t\t\t\t\t\t\tsubtype = categories.get(j);\n\t\t\t\t\t\t\t\t\tsubtype = CDatasetExtractor.AResConverter.convertCompound(subtype);\n\t\t\t\t\t\t\t\t\ttypeBuf.append(subtype);\n\t\t\t\t\t\t\t\t\tif( j > 0) {\n\t\t\t\t\t\t\t\t\t\ttypeBuf.append(\"/\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( typeBuf.length() > 2) {\n\t\t\t\t\t\t\t\t\t_dbpediaOntologyMap.put(typeBuf.toString(), null);\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\tStringBuilder sqlUpdate = new StringBuilder(\"UPDATE 24x7c.dbpedia SET ontology=\\'\");\n\t\t\t\t\t\t\t\tsqlUpdate.append(CStringUtil.encodeLatin1(typeBuf.toString()));\n\t\t\t\t\t\t\t\tsqlUpdate.append(\"\\' WHERE label=\\'\");\n\t\t\t\t\t\t\t\tsqlUpdate.append(CStringUtil.encodeLatin1(_prevLabel));\n\t\t\t\t\t\t\t\tsqlUpdate.append(\"\\';\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tsuccess = stmt.execute(sqlUpdate.toString());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch( SQLException e) { \n\t\t\t\t\t\t\t\t\tCLogger.error(e.toString());\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_prevLabel = label;\n\t\t\t\t\t_ontoBuffer = new StringBuilder(content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn success;\n\t}",
"static Content getLigandContent (List<Ligand> ligands) throws Exception {\n if (true || ligands.size() == 1) {\n Ligand ligand = ligands.iterator().next();\n \n List<Keyword> breadcrumb = new ArrayList<Keyword>();\n for (Keyword kw : ligand.synonyms) {\n if (kw.label.equals(WHO_ATC)\n // don't include the leaf node\n && kw.term.length() < 7) {\n breadcrumb.add(kw);\n }\n }\n \n if (!breadcrumb.isEmpty()) {\n Collections.sort(breadcrumb, new Comparator<Keyword>() {\n public int compare (Keyword kw1, Keyword kw2) {\n return kw1.term.compareTo(kw2.term);\n }\n });\n for (Keyword kw : breadcrumb) {\n try {\n Keyword atc = getATC (kw);\n if (atc != null) {\n kw.term = atc.term;\n kw.href = atc.href;\n }\n }\n catch (Exception ex) {\n Logger.error(\"Can't retreive ATC \"+kw.term, ex);\n ex.printStackTrace();\n }\n }\n }\n \n List<LigandActivity> acts = new ArrayList<LigandActivity>();\n for (XRef ref : ligand.getLinks()) {\n if (ref.kind.equals(Target.class.getName())) {\n acts.add(new LigandActivity (ref));\n }\n }\n \n return ix.idg.views.html\n .liganddetails.render(ligand, acts, breadcrumb);\n }\n else {\n TextIndexer indexer = _textIndexer.createEmptyInstance();\n for (Ligand lig : ligands)\n indexer.add(lig);\n \n TextIndexer.SearchResult result = SearchFactory.search\n (indexer, Ligand.class, null, indexer.size(), 0, FACET_DIM,\n request().queryString());\n if (result.count() < ligands.size()) {\n ligands.clear();\n for (int i = 0; i < result.count(); ++i) {\n ligands.add((Ligand)result.getMatches().get(i));\n }\n }\n TextIndexer.Facet[] facets = filter\n (result.getFacets(), LIGAND_FACETS);\n indexer.shutdown();\n \n return ix.idg.views.html.ligands.render\n (1, result.count(), result.count(),\n new int[0], decorate (facets), ligands);\n }\n }",
"NgtPackage getNgtPackage();",
"private RouterKind getRouterKind(String bssid) {\n if (bssid.matches(\"(64:68:0C:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(00:1D:20:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(00:1B:20:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(38:72:C0:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(00:23:F8:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(30:39:F2:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(8C:0C:A3:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(5C:33:8E:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(C8:6C:87:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(D0:AE:EC:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(00:19:15:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND;\n } else if (bssid.matches(\"(00:1A:2B:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.COM_KIND_1A2B;\n } else if (bssid.matches(\"(00:1F:A4:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.ZYX_KIND;\n } else if (bssid.matches(\"(F4:3E:61:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.ZYX_KIND;\n } else if (bssid.matches(\"(40:4A:03:[0-9A-Fa-f:]{8})\")) {\n return RouterKind.ZYX_KIND;\n }\n return RouterKind.UNK_KIND;\n }",
"default List<String> assignedConcepts(Source code){\n return assignedConcepts(code, ImmutableSet.of());\n }",
"private void setDefaultNode() {\n\t\tint[] classes = new int[classifierNames.size()];\n\t\tfor (Instance i : instances) {\n\t\t\tclasses[i.getCategory()]++;\n\t\t}\n\t\tint mostCommonClassIdx = 0;\n\t\tfor (int i = 0; i < classes.length; i++) {\n\t\t\tif (classes[i] > classes[mostCommonClassIdx]) {\n\t\t\t\tmostCommonClassIdx = i;\n\t\t\t} else if (classes[i] == classes[mostCommonClassIdx]) {\n\t\t\t\tmostCommonClassIdx = (Math.random() > 0.5?mostCommonClassIdx:i); // I hope this is an OK implementation of the randomness\n\t\t\t}\n\t\t}\n\t\tbaselineNode = new LeafNode((double)classes[mostCommonClassIdx]/(double)instances.size(), classifierNames.get(mostCommonClassIdx));\n\t}",
"public String sap(String nounA, String nounB) {\n if (!isNoun(nounA) || !isNoun(nounB)) throw new IllegalArgumentException();\n // read_hypernyms(hypernyms);\n int a = data.get(nounA);\n int b = data.get(nounB);\n int ans = sap.ancestor(a, b);\n return (id2noun.get(ans));\n // return (sap.ancestor(data.get(nounA), data.get(nounB)));\n }",
"private BranchGroup createSceneGraph() {\n\n\t\t// create the main BranchGroup\n\t\tBranchGroup objRoot = new BranchGroup();\n\n\t\tobjRoot.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n\t\tobjRoot.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n\n\t\t// reckon the size of the graph\n\t\tint nbRules = rules.length;\n\n\t\tfloat[] maxC = new float[criteres.length];\n\t\tfloat[] minC = new float[criteres.length];\n\n\t\tint nRule, nCrit;\n\t\tAttribute attr;\n\t\tfloat val;\n\t\tHashtable htAttrs = new Hashtable();\n\n\t\tfor (nRule = 0; nRule < nbRules; nRule++) {\n\t\t\t//make a list of all attributes\n\t\t\tIterator it = (rules[nRule].getCondition()).listIterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tattr = (Attribute) it.next();\n\t\t\t\thtAttrs.put(attr.toString(), attr);\n\t\t\t}\n\n\t\t\tattr = rules[nRule].getConclusion();\n\t\t\thtAttrs.put(attr.toString(), attr);\n\n\t\t\t//find min & max of each criteres\n\t\t\tfor (nCrit = 0; nCrit < criteres.length; nCrit++) {\n\t\t\t\tval = (rules[nRule].getCritere(criteres[nCrit]).getValue());\n\n\t\t\t\tif (nRule == 0) {\n\t\t\t\t\tmaxC[nCrit] = val;\n\t\t\t\t\tminC[nCrit] = val;\n\t\t\t\t} else {\n\t\t\t\t\tif (maxC[nCrit] < val)\n\t\t\t\t\t\tmaxC[nCrit] = val;\n\t\t\t\t\tif (minC[nCrit] > val)\n\t\t\t\t\t\tminC[nCrit] = val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tLinkedList lAttrs = new LinkedList(htAttrs.values());\n\t\tint nbAttrs = lAttrs.size();\n\n\t\tfloat size = .040f;\t\t\n//\t\tfloat size = 0.85f/(nbAttrs+10);\n//\t\tfloat size = 0.05f - (0.0006f * nbRules);\n\n\t\t// create a new BranchGroup to turn the scene\n\t\tTransform3D tRotateX = new Transform3D();\n\t\ttRotateX.rotX(Math.PI / 6.0d);\n\t\tTransform3D tRotateY = new Transform3D();\n\t\ttRotateY.rotY(-Math.PI / 6.0d);\n\t\ttRotateX.mul(tRotateY);\n\t\tfloat minSize = Math.min(0.75f/(nbAttrs+10), 0.05f - (0.0006f * nbRules));\n\n\n\n\t\tTransform3D tScale = new Transform3D();\n\t\ttScale.setScale(minSize/size);\n\t\ttRotateX.mul(tScale);\n\t\tTransformGroup tgRotate = new TransformGroup(tRotateX);\n\n\t\tobjRoot.addChild(tgRotate);\n\n\t\t// create a new BranchGroup \n\t\tBranchGroup bgObjGraph = new BranchGroup();\n\n\t\ttgRotate.addChild(bgObjGraph);\n\n\t\t// Draw the graph\n\t\tint nAtt;\n\t\tboolean drawn;\n\t\tRule currentRule;\n\t\tLinkedList ruleLHS;\n\t\tIterator idxRulesLHS;\n\t\tfor (nRule = 0; nRule < nbRules; nRule++) {\n\t\t\tcurrentRule = rules[nRule];\n\t\t\tfor (nAtt = 0; nAtt < nbAttrs; nAtt++) {\n\t\t\t\tidxRulesLHS = (currentRule.getCondition()).listIterator();\n\t\t\t\tdrawn = false;\n\t\t\t\tif (currentRule\n\t\t\t\t\t.getConclusion()\n\t\t\t\t\t.equals(((Attribute) lAttrs.get(nAtt)))) {\n\t\t\t\t\t//draw as a conclusion\t\n\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\tcreateBox(\n\t\t\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\t\t\tnAtt * size,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\tnew Color3f(Color.RED)));\n\t\t\t\t\tdrawn = true;\n\t\t\t\t}\n\t\t\t\tif (!drawn) {\n\t\t\t\t\twhile (idxRulesLHS.hasNext()) {\n\t\t\t\t\t\tif (((Attribute) idxRulesLHS.next())\n\t\t\t\t\t\t\t.equals((Attribute) lAttrs.get(nAtt))) {\n\t\t\t\t\t\t\t//draw as an attribute\t\n\t\t\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\t\t\tcreateBox(\n\t\t\t\t\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\t\t\t\t\tnAtt * size,\n\t\t\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t\t\tnew Color3f(Color.green)));\n\t\t\t\t\t\t\tdrawn = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!drawn) {\n\t\t\t\t\t//draw as nothing\t\n\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\tcreateBox(\n\t\t\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\t\t\tnAtt * size,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\tsize / 10,\n\t\t\t\t\t\t\tnew Color3f(Color.BLACK)));\n\t\t\t\t}\n\n\t\t\t\t// draw criteres values\n\t\t\t\tfor (nCrit = 0; nCrit < criteres.length; nCrit++) {\n\t\t\t\t\tval = (rules[nRule].getCritere(criteres[nCrit]).getValue());\n\t\t\t\t\tbgObjGraph.addChild(\n\t\t\t\t\t\tcreateBox((nRule*size)-(nbRules/2*size),\n\t\t\t\t\t\t\t-(nCrit+1)*size,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t5*size*nCrit+(val-minC[nCrit])*4*size/(maxC[nCrit]-minC[nCrit]),\n\t\t\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//draw rule ID\t\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextY(\n\t\t\t\t\t(nRule * size) - (nbRules / 2 * size),\n\t\t\t\t\tnAtt * size,\n\t\t\t\t\tsize,\n\t\t\t\t\tcurrentRule.getId(),\n\t\t\t\t\tnew Color3f(Color.WHITE)));\n\n\t\t}\n\n\t\t// draw ladder\n\t\tint i;\n\t\tLineArray axis;\n\t\tfor (i = 0; i < 10; i++) {\n\t\t\taxis = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3);\n\t\t\taxis.setCoordinate(\n\t\t\t\t0,\n\t\t\t\tnew Point3f(- (nbRules + 4) * size / 2, i * size, -size));\n\t\t\taxis.setCoordinate(\n\t\t\t\t1,\n\t\t\t\tnew Point3f((nbRules + 4) * size / 2, i * size, -size));\n\t\t\taxis.setColor(0, new Color3f(1f, 0f, 1f));\n\t\t\taxis.setColor(1, new Color3f(1f, 0f, 1f));\n\n\t\t\tbgObjGraph.addChild(new Shape3D(axis));\n\t\t}\n\n\t\t//draw min/max\n\t\tfor (nCrit = 0; nCrit < criteres.length; nCrit++) {\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextScale(\n\t\t\t\t\t(nbRules + 5) * size / 2,\n\t\t\t\t\tnCrit * 5 * size - size / 2,\n\t\t\t\t\tsize,\n\t\t\t\t\t(new Float(minC[nCrit])).toString(),\n\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextScale(\n\t\t\t\t\t(nbRules + 5) * size / 2,\n\t\t\t\t\tnCrit * 5 * size + 4 * size - size / 2,\n\t\t\t\t\tsize,\n\t\t\t\t\t(new Float(maxC[nCrit])).toString(),\n\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextScale(\n\t\t\t\t\t(nbRules + 8) * size / 2,\n\t\t\t\t\tnCrit * 5 * size + 2 * size - size / 2,\n\t\t\t\t\tsize,\n\t\t\t\t\tcriteres[nCrit],\n\t\t\t\t\tnew Color3f(ColorArray.colorArray[nCrit + 3])));\n\n\t\t}\n\n\t\t// write attributes\n\t\tfor (nAtt = 0; nAtt < nbAttrs; nAtt++) {\n\t\t\tbgObjGraph.addChild(\n\t\t\t\tcreateTextX(\n\t\t\t\t\t(nRule * size) + size - (nbRules / 2 * size),\n\t\t\t\t\tnAtt * size + size / 3,\n\t\t\t\t\tsize,\n\t\t\t\t\t((Attribute) lAttrs.get(nAtt)).toString(),\n\t\t\t\t\tnew Color3f(Color.WHITE)));\n\t\t}\n\n\n\t\t// draw legend\n\t\tbgObjGraph.addChild(createBox(- (nbRules / 2 * size),(nbAttrs+5) * size,size,size,new Color3f(Color.green)));\n\t\tbgObjGraph.addChild(createTextX( size - (nbRules / 2 * size),(nbAttrs+5) * size + size / 3,size,\"ANTECEDENT\",new Color3f(Color.WHITE)));\n\t\tbgObjGraph.addChild(createBox(- (nbRules / 2 * size),(nbAttrs+7) * size,size,size,new Color3f(Color.red)));\n\t\tbgObjGraph.addChild(createTextX( size - (nbRules / 2 * size),(nbAttrs+7) * size + size / 3,size,\"CONSEQUENT\",new Color3f(Color.WHITE)));\n\t\t\t\n\n\t\treturn objRoot;\n\t}",
"public String createAgent(String agName, String agSource, String agClass, Collection<String> archClasses, ClassParameters bbPars, Settings stts, Agent father) throws Exception;",
"public WordNet(String synsetFilename, String hyponymFilename) {\n In synsets = new In(synsetFilename);\n In hyponyms = new In(hyponymFilename);\n int count = 0;\n while (synsets.hasNextLine()) {\n String line = synsets.readLine();\n String[] linesplit = line.split(\",\");\n String[] wordsplit = linesplit[1].split(\" \");\n Set<String> synset = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n for (int i = 0; i < wordsplit.length; i += 1) {\n synset.add(wordsplit[i]);\n if (wnetsi.containsKey(wordsplit[i])) {\n wordIndexes = wnetsi.get(wordsplit[i]);\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n } else {\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n }\n }\n wnetis.put(Integer.parseInt(linesplit[0]), synset);\n count += 1;\n }\n \n \n \n String[] allVerts = hyponyms.readAllLines();\n g = new Digraph(count);\n for (int i = 0; i < allVerts.length; i += 1) {\n String[] linesplit = allVerts[i].split(\",\");\n for (int j = 0; j < linesplit.length; j += 1) {\n g.addEdge(Integer.parseInt(linesplit[0]), Integer.parseInt(linesplit[j]));\n }\n }\n \n }",
"@Override\r\n\tpublic String toCanonicalID() \r\n\t{\r\n\t\treturn (display != null) ? display : name() ;\r\n\t}",
"public static String alienOrder(String[] words) {\n if(words.length==0){\n return \"\";\n }\n else if(words.length==1){\n return words[0];\n }\n else{\n HashMap<Character,HashSet<Character>> graph = new HashMap<Character,HashSet<Character>>();\n //Use this array to denote each node's indegree\n int[] indegree = new int[26];\n Arrays.fill(indegree,-1);\n //****Initialize indegree array, '0' means exits****\n for(String x : words){\n for(char c : x.toCharArray()){\n indegree[c-'a'] = 0;\n }\n }\n int first = 0;\n int second = 1;\n //****Build the graph****\n while(second<words.length){\n int minLen = Math.min(words[first].length(),words[second].length());\n for(int i = 0; i<minLen; i++){\n char f = words[first].charAt(i);\n char s = words[second].charAt(i);\n if(f!=s){\n if(graph.containsKey(s)==true){\n HashSet<Character> hs = graph.get(s);\n if(hs.contains(f)==false){\n indegree[f-'a']++;\n hs.add(f);\n graph.replace(s,hs);\n }\n }\n else{\n HashSet<Character> hs = new HashSet<Character>();\n hs.add(f);\n graph.put(s,hs);\n indegree[f-'a']++;\n }\n break;\n }\n }\n first++;\n second++;\n }\n StringBuilder result = new StringBuilder();\n Queue<Character> topo = new LinkedList<Character>();\n int numOfChar = 0;\n for(int i = 0; i<26; i++){\n if(indegree[i]>=0){\n numOfChar++;\n if(indegree[i]==0){\n topo.offer((char)('a'+i));\n } \n }\n }\n if(topo.size()==0){\n return \"\";\n //Means circle exits\n }\n while(topo.size()>0){\n char c = topo.poll();\n result.append(c);\n if(graph.containsKey(c)==false){\n \tcontinue;\n }\n HashSet<Character> hs = graph.get(c);\n for(char x : hs){\n indegree[x-'a']--;\n if(indegree[x-'a']<0){\n return \"\";\n }\n else if(indegree[x-'a']==0){\n topo.offer(x);\n }\n }\n }\n return result.reverse().toString();\n //return result.length()==numOfChar?result.reverse().toString():\"HAHA\";\n }\n }",
"@Override\n\tpublic Annotation build() {\n\n\t\tif (!transcript.isCoding())\n\t\t\treturn buildNonCodingAnnotation();\n\n\t\t// We have the base left and/or right of the insertion to determine the cases.\n\t\tfinal GenomePosition pos = change.getGenomePos();\n\t\tfinal GenomePosition lPos = change.getGenomePos().shifted(-1);\n\t\tif ((so.liesInCDSExon(lPos) && so.liesInCDSExon(pos)) && so.liesInCDS(lPos) && so.liesInCDS(pos))\n\t\t\treturn buildCDSExonicAnnotation(); // can affect amino acids\n\t\telse if ((so.liesInCDSIntron(lPos) || so.liesInCDSIntron(pos)) && so.liesInCDS(lPos) && so.liesInCDS(pos))\n\t\t\treturn buildIntronicAnnotation(); // intron but no exon => intronic variant\n\t\telse if (so.liesInFivePrimeUTR(lPos) || so.liesInThreePrimeUTR(pos))\n\t\t\treturn buildUTRAnnotation();\n\t\telse if (so.liesInUpstreamRegion(lPos) || so.liesInDownstreamRegion(pos))\n\t\t\treturn buildUpOrDownstreamAnnotation();\n\t\telse\n\t\t\treturn buildIntergenicAnnotation();\n\t}"
] | [
"0.606678",
"0.5069716",
"0.48273158",
"0.48257756",
"0.47079918",
"0.47042522",
"0.46904588",
"0.46869257",
"0.46553138",
"0.46537745",
"0.46433982",
"0.4630099",
"0.4627438",
"0.46242198",
"0.46040392",
"0.4558841",
"0.45331177",
"0.4521931",
"0.4521931",
"0.4521878",
"0.44966447",
"0.44824898",
"0.44824407",
"0.4469225",
"0.4464734",
"0.44305816",
"0.4428034",
"0.44211426",
"0.44198766",
"0.4417437",
"0.44166264",
"0.44034973",
"0.43923727",
"0.43833187",
"0.43740106",
"0.43726355",
"0.4372229",
"0.4364156",
"0.43580082",
"0.4357715",
"0.43573645",
"0.4355355",
"0.4352453",
"0.4350013",
"0.43352738",
"0.43283185",
"0.43275088",
"0.43259814",
"0.4324688",
"0.4318641",
"0.43128362",
"0.4302117",
"0.43015462",
"0.4298177",
"0.42958984",
"0.4295723",
"0.42860138",
"0.42826897",
"0.42793572",
"0.4264229",
"0.4250757",
"0.4248749",
"0.42403665",
"0.42344204",
"0.42255875",
"0.42228344",
"0.42190054",
"0.4217268",
"0.42126706",
"0.42085516",
"0.42078915",
"0.42070067",
"0.4202984",
"0.42018214",
"0.41970205",
"0.4193118",
"0.4181462",
"0.4176452",
"0.41761717",
"0.41685387",
"0.4167219",
"0.41592678",
"0.41566402",
"0.41529804",
"0.41489276",
"0.4148768",
"0.41400447",
"0.4133912",
"0.41263163",
"0.41246006",
"0.41237244",
"0.41235602",
"0.41191366",
"0.41182327",
"0.41181412",
"0.41174138",
"0.41149092",
"0.41144907",
"0.41128883",
"0.41127148"
] | 0.54774964 | 1 |
Sort descriptions associated with the concept, sorted via many levels: level 1 by core types first (FSN, Regular Name, Definition) or if not a core type, grouped by associated core type, and then alphabetical by the description type within the group (fsn, regular name, definition). level 2 by language EN first, and then alphabetical by the language after this level 3 If it has a dialect marking preferred, this comes before any descriptions with only acceptable dialect markings level 4 alphabetical by the text of the description | @Override
public int compareTo(RestSemanticDescriptionVersion o)
{
//This will handle native types, and the grouping of external types.
int coreTypeLeft = Frills.getDescriptionType(this.descriptionTypeConcept.nid.intValue(), null);
int coreTypeRight = Frills.getDescriptionType(o.descriptionTypeConcept.nid.intValue(), null);
//handle cases where 1 of the 2 is a core type
if (coreTypeLeft == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid()
|| coreTypeRight == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid())
{
if (coreTypeLeft == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid()
&& coreTypeRight != MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid())
{
return -1;
}
else if (coreTypeLeft != MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid()
&& coreTypeRight == MetaData.FULLY_QUALIFIED_NAME_DESCRIPTION_TYPE____SOLOR.getNid())
{
return 1;
}
}
else if (coreTypeLeft == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid()
|| coreTypeRight == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid())
{
if (coreTypeLeft == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid()
&& coreTypeRight != MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid())
{
return -1;
}
else if (coreTypeLeft != MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid()
&& coreTypeRight == MetaData.REGULAR_NAME_DESCRIPTION_TYPE____SOLOR.getNid())
{
return 1;
}
}
else if (coreTypeLeft == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid()
|| coreTypeRight == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid())
{
if (coreTypeLeft == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid()
&& coreTypeRight != MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid())
{
return -1;
}
else if (coreTypeLeft != MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid()
&& coreTypeRight == MetaData.DEFINITION_DESCRIPTION_TYPE____SOLOR.getNid())
{
return 1;
}
}
//the core types are identical. If there is an external type - check that.
if (this.descriptionExtendedTypeConcept == null || o.descriptionExtendedTypeConcept == null)
{
//external (not extended) type which is different
if (this.descriptionTypeConcept.nid.intValue() != o.descriptionTypeConcept.nid.intValue())
{
return AlphanumComparator.compare(Util.readBestDescription(this.descriptionTypeConcept.nid.intValue()),
Util.readBestDescription(o.descriptionTypeConcept.nid.intValue()), true);
}
}
else
{
//extended type, where the types are different
if (this.descriptionExtendedTypeConcept.nid.intValue() != o.descriptionExtendedTypeConcept.nid.intValue())
{
return AlphanumComparator.compare(Util.readBestDescription(this.descriptionExtendedTypeConcept.nid.intValue()),
Util.readBestDescription(o.descriptionExtendedTypeConcept.nid.intValue()), true);
}
}
//Still tied on type, move to level 2
return sortLanguage(o);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sortDialects()\n\t{\n\t\tif (dialects.size() > 1)\n\t\t{\n\t\t\tCollections.sort(dialects, new Comparator<RestDynamicSemanticVersion>()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\t//This is a semantic with a single nid column, which represents preferred or acceptable. \n\t\t\t\t\t//The assemblage concept will be something like \"US English Dialect\"\n\t\t\t\t\t\n\t\t\t\t\t//If preferred / acceptable is the same, sort on the dialects...\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}",
"public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }",
"@Override\n\t\t\tpublic int compare(Articulo o1, Articulo o2) {\n\t\t\t\tString desc1 = o1.getDescripcion();\n\t\t\t\tString desc2 = o2.getDescripcion();\n\t\t\t\t\n\t\t\t\treturn desc1.compareTo(desc2);\n\t\t\t}",
"public void sortDescriptors() {\n\n XMLFieldDescriptor fieldDesc = null;\n NodeType nodeType = null;\n\n List remove = new List(3);\n for (int i = 0; i < attributeDescriptors.size(); i++) {\n fieldDesc = (XMLFieldDescriptor)attributeDescriptors.get(i);\n switch (fieldDesc.getNodeType().getType()) {\n case NodeType.ELEMENT:\n elementDescriptors.add(fieldDesc);\n remove.add(fieldDesc);\n break;\n case NodeType.TEXT:\n remove.add(fieldDesc);\n break;\n default:\n break;\n }\n }\n for (int i = 0; i < remove.size(); i++)\n attributeDescriptors.remove(remove.get(i));\n\n remove.clear();\n for (int i = 0; i < elementDescriptors.size(); i++) {\n fieldDesc = (XMLFieldDescriptor)elementDescriptors.get(i);\n switch (fieldDesc.getNodeType().getType()) {\n case NodeType.ATTRIBUTE:\n attributeDescriptors.add(fieldDesc);\n remove.add(fieldDesc);\n break;\n case NodeType.TEXT:\n remove.add(fieldDesc);\n break;\n default:\n break;\n }\n }\n for (int i = 0; i < remove.size(); i++)\n elementDescriptors.remove(remove.get(i));\n\n }",
"public int compare(Description o1, Description o2) {\n\t\t\tif (isNew(o1))\n\t\t\t\treturn -1;\n\t\t\tif (isNew(o2))\n\t\t\t\treturn 1;\n\t\t\t// Then most recently failed first\n\t\t\tint result= getFailure(o2).compareTo(getFailure(o1)); \n\t\t\treturn result != 0\n\t\t\t\t? result\n\t\t\t\t// Then shorter tests first\n\t\t\t\t: fDurations.get(o1).compareTo(fDurations.get(o2));\n\t\t}",
"private void sortCoreTypes() {\n\t\tArrays.sort(coreBuiltin, (o1, o2) -> Long.compare(o1.id, o2.id));\n\t}",
"public String getSortText() {\n if (language.getMimeType().equals(CSS_MIMETYPE)) {\n return CSS_SORT_TEXT;\n } else if (language.getMimeType().equals(JAVASCRIPT_MIMETYPE)) {\n return JAVASCRIPT_SORT_TEXT;\n } else if (language.getMimeType().equals(HTML_MIMETYPE)) {\n return HTML_SORT_TEXT;\n } else if (language.getMimeType().equals(YAML_MIMETYPE)) {\n return YAML_SORT_TEXT;\n } else if (language.getMimeType().equals(RUBY_MIMETYPE)) {\n return RUBY_SORT_TEXT;\n } else if (language.getMimeType().equals(PHP_MIME_TYPE)) {\n return PHP_SORT_TEXT;\n } else {\n return OTHER_SORT_TEXT + getName();\n }\n\n }",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"@Override\n\tpublic int compare(MediaMaster em1, MediaMaster em2) {\n\t\t\tif(em2.getLanguageMaster().getLanguageName() != null && em1.getLanguageMaster().getLanguageName() != null){\n\t\t\t\tif(\"Asc\".equalsIgnoreCase(type)){\n\t\t\t\t\treturn em2.getLanguageMaster().getLanguageName().compareTo(em1.getLanguageMaster().getLanguageName());\n\t\t\t\t}else{\n\t\t\t\t\treturn em1.getLanguageMaster().getLanguageName().compareTo(em2.getLanguageMaster().getLanguageName());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}",
"public static void main(String[] args) {\n\t\tList<Developer> listDevs = getDevelopers();\r\n\r\n\t\tSystem.out.println(\"Before Sort\");\r\n\t\tfor (Developer developer : listDevs) {\r\n\t\t\tSystem.out.println(developer.getName());\r\n\t\t}\r\n\t\t\r\n\t\tlistDevs.sort( new Comparator<Developer>(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Developer o1, Developer o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn o2.getAge()-o1.getAge();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tlistDevs.sort((Developer o1, Developer o2) -> o1.getName().compareTo(o2.getName()));\r\n\t\t\r\n\t\tSystem.out.println(\"Aftrer Sort\");\r\n\t\tfor (Developer developer : listDevs) {\r\n\t\t\tSystem.out.println(developer.getName());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\tList<String> lines = Arrays.asList(\"spring\", \"node\", \"mkyong\",\"spring\",\"spring\");\r\n\t\t\r\n\t\tlines.stream().filter(line -> line.equals(\"spring\")).forEach(line -> System.out.println(\"line::\"+line));\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\tMap<String, Long> result = lines.stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting()));\r\n\t\t\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\t//System.out.println(result.entrySet().stream().sorted(Map.Entry.<String,Integer>comparingByKey().reversed()).);\r\n\t\t\r\n\t\tStream<String> language = Stream.of(\"java\", \"python\", \"node\", null, \"ruby\", null, \"php\");\r\n\t\tList langList = language.collect(Collectors.toList());\r\n\t\tlangList.forEach(new Consumer<String>()\r\n\t\t{\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void accept(String t) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tif(t!=null)\r\n\t\t\t\tSystem.out.println(\"length::\"+t.length());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tlangList.forEach(x -> System.out.println(\"value of x::\"+x));\r\n\t\t\r\n\t}",
"private void sortAndSetExplanations(IExplanationSet explanationSet){\n\t\t\tList<IBasicExplanation> explanationList = explanationSet.getExplanations();\n\t\t\t\n\t\t\tCollections.sort(explanationList,\n\t\t\t\t\tRankerFactory.getScoreTotalOrderComparator(scoringFunction));\n\t\t\t\n\t\t\tfor (IBasicExplanation explanation : explanationList)\n\t\t\t\tput(explanation);\n\t\t\t\n\t\t\tsetMinMax(explanationList);\n\t\t}",
"private static void DoOrderBy()\n\t{\n\t\tArrayList<Attribute> inAtts = new ArrayList<Attribute>();\n\t\tinAtts.add(new Attribute(\"Int\", \"n_n_nationkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"n_n_name\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"n_n_regionkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"n_n_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Int\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att4\"));\n\n\t\t// These could be more complicated expressions than simple input columns\n\t\tMap<String, String> exprsToCompute = new HashMap<String, String>();\n\t\texprsToCompute.put(\"att1\", \"n_n_nationkey\");\n\t\texprsToCompute.put(\"att2\", \"n_n_name\");\n\t\texprsToCompute.put(\"att3\", \"n_n_regionkey\");\n\t\texprsToCompute.put(\"att4\", \"n_n_comment\");\n\t\t\n\t\t// Order by region key descending then nation name ascending\n\t\tArrayList<SortKeyExpression> sortingKeys = new ArrayList<SortKeyExpression>();\n\t\tsortingKeys.add(new SortKeyExpression(\"Int\", \"n_n_regionkey\", false));\n\t\tsortingKeys.add(new SortKeyExpression(\"Str\", \"n_n_name\", true));\n\t\t\n\t\t// run the selection operation\n\t\ttry\n\t\t{\n\t\t\tnew Order(inAtts, outAtts, exprsToCompute, sortingKeys, \"nation.tbl\", \"out.tbl\", \"g++\", \"cppDir/\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"Sort(String description) {\n this.description = description;\n matcher = new MethodSortMatcher<MethodDescription>(this);\n }",
"@Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }",
"@Override\r\n \t\t\t\t\tpublic int compare(Token t1, Token t2) {\n \t\t\t\t\t\tif (t1.type == TokenType.SEG_END && t2.type == TokenType.TP) {\r\n \t\t\t\t\t\t\treturn -1;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t// If a text part (from trailing plain text) appears after seg start, move it backwards before seg start\r\n \t\t\t\t\t\telse if (t1.type == TokenType.SEG_START && t2.type == TokenType.TP) {\r\n \t\t\t\t\t\t\treturn 1;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t// Otherwise text parts and other type combinations are sorted by start position\r\n \t\t\t\t\t\telse {\r\n \t\t\t\t\t\t\tif (t1.textRange.start < t2.textRange.start) \r\n \t\t\t\t\t\t\t\treturn -1;\r\n \t\t\t\t\t\t\telse if (t1.textRange.start > t2.textRange.start) \r\n \t\t\t\t\t\t\t\treturn 1;\r\n \t\t\t\t\t\t\telse\r\n \t\t\t\t\t\t\t\treturn 0;\r\n \t\t\t\t\t\t}\t\t\t\t\r\n \t\t\t\t\t}",
"private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}",
"private Tree<Token> tree(String description) {\n Tree<String> treeOfStrings = Tree.parse(description);\n return convertToTreeOfTokens(treeOfStrings);\n }",
"protected String sortToSql(QuestionService.FindQuestionsSort sort)\n\t{\n\t\tswitch (sort)\n\t\t{\n\t\t\tcase type_a:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"Q.TYPE ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase type_d:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"Q.TYPE DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase title_a:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"QT.TITLE ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase title_d:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"QT.TITLE DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase description_a:\n\t\t\t{\n\t\t\t\treturn \"Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase description_d:\n\t\t\t{\n\t\t\t\treturn \"Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase pool_difficulty_a:\n\t\t\t{\n\t\t\t\treturn \"P.DIFFICULTY ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase pool_difficulty_d:\n\t\t\t{\n\t\t\t\treturn \"P.DIFFICULTY DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase pool_points_a:\n\t\t\t{\n\t\t\t\treturn \"P.POINTS ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase pool_points_d:\n\t\t\t{\n\t\t\t\treturn \"P.POINTS DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase pool_title_a:\n\t\t\t{\n\t\t\t\treturn \"P.TITLE ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase pool_title_d:\n\t\t\t{\n\t\t\t\treturn \"P.TITLE DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase cdate_a:\n\t\t\t{\n\t\t\t\treturn \"Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase cdate_d:\n\t\t\t{\n\t\t\t\treturn \"Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"public void orderParts(Integer order, List<Part> parts) throws Exception {\n switch (order){\n case 1:\n parts.sort(Comparator.comparing(Part::getDescription));\n break;\n case 2:\n parts.sort(Comparator.comparing(Part::getDescription).reversed());\n break;\n case 3:\n parts.sort(Comparator.comparing(Part::getLastModification));\n break;\n }\n }",
"@Override\n\tpublic String sort(String content) {\n\t\treturn null;\n\t}",
"public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}",
"@Override\r\n public int compare(T o1, T o2) {\n if (o1 == o2) {\r\n return 0;\r\n }\r\n\r\n // Different locales are ordered by their display names in the user's\r\n // current locale\r\n Locale locale1 = o1.getLocale();\r\n Locale locale2 = o2.getLocale();\r\n if (!locale1.equals(locale2)) {\r\n String language1 = provider.getLanguage(locale1.getLanguage(), userLocale);\r\n String language2 = provider.getLanguage(locale2.getLanguage(), userLocale);\r\n return language1.compareTo(language2);\r\n }\r\n\r\n // Within the same locale, simply compare the names of the objects\r\n String name1 = o1.getName();\r\n String name2 = o2.getName();\r\n return name1.compareTo(name2);\r\n }",
"private void sortChannelsTypeFaculty(List<Channel> channels) {\n Collections.sort(channels, new Comparator<Channel>() {\n public int compare(Channel c1, Channel c2) {\n int res = c1.getType().compareTo(c2.getType());\n if (res != 0) {\n return res;\n }\n if (c1.getType().equals(ChannelType.LECTURE)) {\n res = ((Lecture) c1).getFaculty().compareTo(((Lecture) c2).getFaculty());\n if (res != 0) {\n return res;\n }\n }\n return c1.getName().compareToIgnoreCase(c2.getName());\n }\n });\n }",
"@Override\n\tpublic int compare(Concepto o1, Concepto o2) {\n\t\treturn o1.getFecha_Fin().compareTo(o2.getFecha_Fin());\n\t}",
"@Override\n public int compare(Map<String, Object> o1, Map<String, Object> o2) {\n if(!descflag){\n return String.valueOf(o2.get(orderField)).compareTo(String.valueOf(o1.get(orderField)));\n }else {\n return String.valueOf(o1.get(orderField)).compareTo(String.valueOf(o2.get(orderField)));\n }\n // return 0;//加一个默认返回\n }",
"@Override\n public int compareTo(Object o) {\n Degree otherDegree = (Degree) o;\n if (degreeName_.compareTo(otherDegree.getDegreeName_()) != 0) {\n return degreeName_.compareTo(otherDegree.getDegreeName_());\n }\n else {\n return catalogYear_.compareTo(otherDegree.catalogYear_);\n }\n }",
"@Override\r\n\t public int compareTo(Geltokia o) {\r\n if (disTerm < o.disTerm) {\r\n return -1;\r\n }\r\n if (disTerm > o.disTerm) {\r\n return 1;\r\n }\r\n return 0;\r\n }",
"public void createSummary(){\n\n for(int j=0;j<=noOfParagraphs;j++){\n int primary_set = paragraphs.get(j).sentences.size()/5;\n\n //Sort based on score (importance)\n Collections.sort(paragraphs.get(j).sentences,new SentenceComparator());\n for(int i=0;i<=primary_set;i++){\n contentSummary.add(paragraphs.get(j).sentences.get(i));\n }\n }\n\n //To ensure proper ordering\n Collections.sort(contentSummary,new SentenceComparatorForSummary());\n printSummary();\n }",
"public interface SortDepartment {\n public void buildDataStructureForSort(String [] codes);\n public LinkedList <String> sortUp();\n public LinkedList <String> sortDown();\n\n}",
"@Override\r\n\t\t\tpublic int compare(T o1, T o2) {\n\t\t\t\tString s1 = ((OWLProperty)o1).getIRI().getShortForm();\r\n\t\t\t\tString s2 = ((OWLProperty)o2).getIRI().getShortForm();\r\n\t\t\t\tif (s1.startsWith(\"'\")) {\r\n\t\t\t\t\ts1 = s1.substring(1, s1.length() - 1);\r\n\t\t\t\t}\r\n\t\t\t\tif (s2.startsWith(\"'\")) {\r\n\t\t\t\t\ts2 = s2.substring(1, s2.length() - 1);\r\n\t\t\t\t}\r\n\t\t\t\treturn s1.compareTo(s2);\r\n\t\t\t}",
"@Override\r\n\tpublic int compare(Object o1, Object o2) \r\n\t{\n\t\tProblems s1=(Problems)o1; \r\n\t\tProblems s2=(Problems)o2; \r\n\t\treturn s1.name.compareTo(s2.name); \r\n\t}",
"Ordering<Part> getOrdering();",
"public void sortCompetitors(){\n\t\t}",
"public interface SortingSentence {\n\n SentenceElement whoIsWho (String applicant, boolean isStartSent);\n}",
"public void sortByWordLengthDesc() {\r\n\t\tcomparator = new WordLengthDesc();\r\n\t}",
"private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }",
"@VTID(28)\n boolean getSortUsingCustomLists();",
"private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }",
"@Override\n public int compare(StoryInformation o1, StoryInformation o2) {\n if (o1.getOrder() > o2.getOrder())\n return 1;\n else\n return -1;\n }",
"public void sort() {\n Operation t = this, lowest = this, prev = this, parent = this;\n // find lowest precedenced operation\n while (t.termRight instanceof Operation) {\n t = (Operation) t.termRight;\n if (t.operator.precedence.level < lowest.operator.precedence.level\n || (t.operator.precedence.parseDirection == ParseDirection.RIGHT_TO_LEFT\n && t.operator.precedence.level == lowest.operator.precedence.level)) {\n lowest = t;\n parent = prev;\n }\n prev = t;\n }\n\n if (lowest != this) {\n // swap the lowest precendence operator to treehead\n Operation newLeft = new Operation(operator, termLeft, termRight);\n\n // parent.termRight = lowest.termLeft;\n Operation pt = newLeft;\n while (pt.termRight != lowest) {\n pt = (Operation) pt.termRight;\n }\n pt.termRight = ((Operation) pt.termRight).termLeft;\n\n this.operator = lowest.operator;\n this.termLeft = newLeft;\n this.termRight = lowest.termRight;\n }\n this.termLeft.sort();\n this.termRight.sort();\n }",
"public static void extractGroups(CoNLLPart part) {\n\t\tHashMap<String, Integer> chainMap = EMUtil.formChainMap(part\n\t\t\t\t.getChains());\n\t\tArrayList<Mention> allMentions = EMUtil.extractMention(part);\n\t\tCollections.sort(allMentions);\n\t\tEMUtil.assignNE(allMentions, part.getNameEntities());\n\t\tfor (int i = 0; i < allMentions.size(); i++) {\n\t\t\tMention m = allMentions.get(i);\n\n\t\t\tif (m.gram == EMUtil.Grammatic.subject && m.start == m.end\n\t\t\t\t\t&& part.getWord(m.end).posTag.equals(\"PN\")) {\n\t\t\t}\n\n\t\t\tif (m.gram == EMUtil.Grammatic.subject\n\t\t\t\t\t&& EMUtil.pronouns.contains(m.extent)\n\t\t\t// && chainMap.containsKey(m.toName())\n\t\t\t) {\n\t\t\t\tArrayList<Mention> ants = new ArrayList<Mention>();\n\t\t\t\tint corefCount = 0;\n\t\t\t\tfor (int j = i - 1; j >= 0; j--) {\n\t\t\t\t\tMention ant = allMentions.get(j);\n\t\t\t\t\tants.add(ant);\n\t\t\t\t\tant.MI = Context.calMI(ant, m);\n\t\t\t\t\tboolean coref = isCoref(chainMap, m, ant);\n\t\t\t\t\tif (coref) {\n\t\t\t\t\t\tcorefCount++;\n\t\t\t\t\t}\n\t\t\t\t\tif (m.s.getSentenceIdx() - ant.s.getSentenceIdx() > 2) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tCollections.sort(ants);\n\t\t\t\tCollections.reverse(ants);\n\n\t\t\t\tif (corefCount == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (Mention ant : ants) {\n\t\t\t\t\tant.isBest = false;\n\t\t\t\t}\n\n\t\t\t\tApplyEM.findBest(m, ants);\n\n\t\t\t\tif (ants.size() > maxAnts) {\n\t\t\t\t\tmaxAnts = ants.size();\n\t\t\t\t}\n\t\t\t\tString origPro = m.extent;\n\n\t\t\t\tString ext = m.extent;\n\t\t\t\tif (map.containsKey(ext)) {\n\t\t\t\t\tmap.put(ext, map.get(ext) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tmap.put(ext, 1);\n\t\t\t\t}\n\t\t\t\tStringBuilder ysb = new StringBuilder();\n\t\t\t\tfor (int h = 0; h < EMUtil.pronounList.size(); h++) {\n\t\t\t\t\tm.extent = EMUtil.pronounList.get(h);\n\t\t\t\t\tgenerateInstance(part, chainMap, m, ants,\n\t\t\t\t\t\t\tcorefCount, origPro, h, ysb);\n\t\t\t\t}\n\t\t\t\tfor (int k = ants.size() * EMUtil.pronounList.size(); k < 840; k++) {\n\t\t\t\t\tysb.append(\"@ 0 NOCLASS 1 # \");\n\t\t\t\t}\n\t\t\t\tyasmet10.add(ysb.toString());\n\t\t\t\tm.extent = origPro;\n\t\t\t}\n\t\t}\n\t}",
"public void sort(){\n\t\tCollections.sort(_ligacoes, (new Comparator<Ligacao>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Ligacao l1, Ligacao l2){\n\t\t\t\tint resultado = Integer.compare(l1.getCusto(), l2.getCusto());\n\t\t\t\tif (resultado == 0)\n\t\t\t\t\tresultado = Boolean.compare(l1.isAerea(), l2.isAerea());\n\t\t\t\treturn resultado;\n\t\t\t}\n\t\t}));\n\t}",
"public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\n }",
"public List<Idea> allIdeasLikersDesc() {\n\n List<Idea> ideas = ideaRepo.findAll();\n\n ideas.sort(new Comparator<Idea>() {\n @Override\n public int compare(Idea i1, Idea i2) {\n if(i1.getLikers().size() == i2.getLikers().size()){\n return 0;\n }\n return i1.getLikers().size() > i2.getLikers().size() ? -1 : 1;\n }\n });\n\n return ideas;\n }",
"public T caseSortDefinition(SortDefinition object)\n {\n return null;\n }",
"public void sortByTopic() {\r\n\t\tfor (int i = 1; i < displayingList.size(); i++) {\r\n\t\t\tQuestion temp = displayingList.get(i);\r\n\t\t\tfor (int j = i - 1; j >= 0; j--) {\r\n\t\t\t\tif (String.CASE_INSENSITIVE_ORDER.compare(temp.getTopic(), displayingList.get(j).getTopic()) < 0) {\r\n\t\t\t\t\tdisplayingList.set(j + 1, displayingList.get(j));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdisplayingList.set(j + 1, temp);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdisplayingList.set(j, temp);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected void parseDescription(XMPMetadata metadata)\n\t\t\tthrows XmpParsingException, XMLStreamException, XmpSchemaException,\n\t\t\tXmpUnknownValueTypeException, XmpExpectedRdfAboutAttribute,\n\t\t\tBadFieldValueException {\n\t\tnsMap.resetComplexBasicTypesDeclarationInSchemaLevel();\n\t\tint cptNS = reader.get().getNamespaceCount();\n\t\tHashMap<String, String> namespaces = new HashMap<String, String>();\n\t\tfor (int i = 0; i < cptNS; i++) {\n\t\t\tnamespaces.put(reader.get().getNamespacePrefix(i), reader.get()\n\t\t\t\t\t.getNamespaceURI(i));\n\t\t\tif (nsMap.isComplexBasicTypes(reader.get().getNamespaceURI(i))) {\n\t\t\t\t// System.out.println(\"in parseDesc method: prefix:\"+reader.get().getNamespacePrefix(i)+\", nsURI:\"+reader.get().getNamespaceURI(i));\n\t\t\t\tnsMap.setComplexBasicTypesDeclarationForLevelSchema(reader\n\t\t\t\t\t\t.get().getNamespaceURI(i), reader.get()\n\t\t\t\t\t\t.getNamespacePrefix(i));\n\t\t\t}\n\t\t}\n\t\t// Different treatment for PDF/A Extension schema\n\t\t// System.out.println(PDFAExtensionSchema.PDFAEXTENSION+\";\"+PDFAExtensionSchema.PDFAPROPERTY+\";\"+PDFAExtensionSchema.PDFASCHEMA);\n\t\tif (namespaces.containsKey(PDFAExtensionSchema.PDFAEXTENSION)) {\n\t\t\tif (namespaces.containsKey(PDFAExtensionSchema.PDFAPROPERTY)\n\t\t\t\t\t&& namespaces.containsKey(PDFAExtensionSchema.PDFASCHEMA)) {\n\t\t\t\tif (namespaces\n\t\t\t\t\t\t.containsValue(PDFAExtensionSchema.PDFAEXTENSIONURI)\n\t\t\t\t\t\t&& namespaces\n\t\t\t\t\t\t.containsValue(PDFAExtensionSchema.PDFAPROPERTYURI)\n\t\t\t\t\t\t&& namespaces\n\t\t\t\t\t\t.containsValue(PDFAExtensionSchema.PDFASCHEMAURI)) {\n\t\t\t\t\tPDFAExtensionSchema schema = metadata\n\t\t\t\t\t\t\t.createAndAddPDFAExtensionSchemaWithNS(namespaces);\n\t\t\t\t\ttreatDescriptionAttributes(metadata, schema);\n\t\t\t\t\tparseExtensionSchema(schema, metadata);\n\n\t\t\t\t} else {\n\t\t\t\t\tthrow new XmpUnexpectedNamespaceURIException(\n\t\t\t\t\t\t\t\"Unexpected namespaceURI in PDFA Extension Schema encountered\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new XmpUnexpectedNamespacePrefixException(\n\t\t\t\t\t\t\"Unexpected namespace Prefix in PDFA Extension Schema\");\n\t\t\t}\n\n\t\t} else {\n\t\t\t// TODO Considering first namespace is that corresponding to the\n\t\t\t// schema (see if it must be changed)\n\t\t\tString namespaceUri = reader.get().getNamespaceURI(0);\n\t\t\tString namespacePrefix = reader.get().getNamespacePrefix(0);\n\t\t\tXMPSchema schema = nsMap.getAssociatedSchemaObject(metadata, namespaceUri, namespacePrefix);\n\t\t\tif (schema != null) {\n\t\t\t\tnamespaces.remove(namespacePrefix);\n\t\t\t} else {\n\t\t\t\tschema = metadata.createAndAddDefaultSchema(namespacePrefix,namespaceUri);\n\t\t\t}\n\t\t\tfor (int i = 1; i < cptNS; i++) {\n\t\t\t\tschema.setAttribute(new Attribute(XMPSchema.NS_NAMESPACE,\n\t\t\t\t\t\t\"xmlns\", reader.get().getNamespacePrefix(i), reader.get().getNamespaceURI(i)));\n\t\t\t}\n\t\t\ttreatDescriptionAttributes(metadata, schema);\n\t\t\twhile (reader.get().nextTag() == XMLStreamReader.START_ELEMENT) {\n\t\t\t\tparseProperty(schema, metadata);\n\t\t\t}\n\t\t}\n\n\t}",
"@Override\n\tpublic int compare(MediaMaster em1, MediaMaster em2) {\n\t\tif(em2.getOcassion() != null && em1.getOcassion() != null){\n\t\t\tif(\"Asc\".equalsIgnoreCase(type)){\n\t\t\treturn em2.getOcassion().compareTo(em1.getOcassion());\n\t\t}\n\t\telse{\n\t\t\treturn em1.getOcassion().compareTo(em2.getOcassion());\n\t\t}\n\t}\n\t\treturn 0;\n\t}",
"@Override\r\n public int compare(Element e1, Element e2) {\r\n\t\t//FIXME !!!!\r\n\t\treturn -1;\r\n//\t\t// first try to compare by type:\r\n//\t\tint result = compareType(e1, e2);\r\n//\t\tif(result != 0)\r\n//\t\t\treturn result;\r\n//\t\t\r\n//\t\t// results with matching case before results with different case then searched word\r\n//\t\tresult = compareCase(e1, e2);\r\n//\t\tif(result != 0) {\r\n//\t\t\treturn result;\r\n//\t\t}\r\n//\t\t// when they both do/don't match case, compare by label:\r\n//\t\tresult = compareLabel(e1, e2);\r\n//\t\tif(result != 0) {\r\n//\t\t\treturn result;\r\n//\t\t}\r\n//\r\n//\t\t// if the same label as well, compare by hashcode\r\n//\t\tresult = e1.compareTo(e2);\r\n//\t\treturn result;\r\n\r\n\t}",
"public int compareTo(PropertyGroup o2) {\n \tCollator collator = Collator.getInstance();\n if (o2 == null) {\n log.error(\"object NULL in DisplayComparator()\");\n return 0;\n }\n int diff = (this.getDisplayRank() - o2.getDisplayRank());\n if (diff == 0 ) {\n return collator.compare(this.getName(),o2.getName());\n }\n return diff;\n }",
"public tudresden.ocl20.core.jmi.uml15.datatypes.OrderingKind getOrdering()\n {\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n \tif (instance != null && \n \t\tinstance.isRepresentative(this.refMofId())&&\n \t\tinstance.hasRefObject(this.refMofId()))\n \t{ \t\t\n \t\treturn instance.getOrdering(this.refMofId());\n \t} \n \t\n \treturn super_getOrdering();\n \t\n\t}",
"private void createListFormat(Composite section2)\n {\n // Create Label\n Label label = toolkit.createLabel(section2, \"Attributes identification:\"); //$NON-NLS-1$\n label.setData(new GridData(SWT.FILL, SWT.LEFT, false, false, 2, 1));\n\n // Create treeViewer\n listFormat = new TreeViewer(section2, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);\n GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 6);\n listFormat.getTree().setLayoutData(data);\n\n // Set the label provider\n listFormat.setLabelProvider(new LabelProvider()\n {\n public String getText(Object element)\n {\n // Return the label.\n if (element instanceof String)\n {\n return (String) element;\n }\n else if (element instanceof RecognizedElement)\n {\n return ((RecognizedElement) element).getText();\n }\n else if (element instanceof RecognizedTree)\n {\n return \"root\"; //$NON-NLS-1$\n }\n return null;\n }\n });\n // Set the content provider\n listFormat.setContentProvider(new IStructuredContentProviderTree());\n\n \n // Add inputs\n listFormat.setInput(tree);\n\n listFormat.addSelectionChangedListener(new ISelectionChangedListener()\n {\n private ISelection selection;\n\n public void selectionChanged(SelectionChangedEvent event)\n {\n selection = listFormat.getSelection();\n if (selection instanceof IStructuredSelection)\n {\n IStructuredSelection stru = (IStructuredSelection) selection;\n\n // enable button delete\n buttonDelete.setEnabled(true);\n\n // Get the selection\n if (stru.getFirstElement() instanceof RecognizedElement)\n selectedRule = (RecognizedElement) stru.getFirstElement();\n }\n }\n });\n\n }",
"public int compareTo(Document o2) {\n return this.format.getClass().getSimpleName().compareTo(o2.getFormat().getClass().getSimpleName());\n }",
"public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public T caseDefSort(DefSort object)\n {\n return null;\n }",
"public void ordenaCatalogoJogos(TiposOrdenacao tipoOrdenacao) {\r\n\r\n\t\tif (tipoOrdenacao.equals(TiposOrdenacao.DEFAULT)) {\r\n\t\t\tCollections.sort(listaDeJogosComprados);\r\n\t\t}\r\n\t\tif (tipoOrdenacao.equals(TiposOrdenacao.DESEMPENHO)) {\r\n\t\t\tOrdenaPorDesempenho comparator = new OrdenaPorDesempenho();\r\n\t\t\tCollections.sort(listaDeJogosComprados, comparator);\r\n\t\t}\r\n\t\tif (tipoOrdenacao.equals(TiposOrdenacao.EXPERIENCIA)) {\r\n\t\t\tOrdenaPorExperiencia comparator = new OrdenaPorExperiencia();\r\n\t\t\tCollections.sort(listaDeJogosComprados, comparator);\r\n\t\t}\r\n\t\tif (tipoOrdenacao.equals(TiposOrdenacao.VICIO)) {\r\n\t\t\tOrdenaPorVicio comparator = new OrdenaPorVicio();\r\n\t\t\tCollections.sort(listaDeJogosComprados, comparator);\r\n\t\t}\r\n\t}",
"public String describe(int depth) {\n StringBuffer buff = new StringBuffer(depth + 40);\n buff.append(SchemaUtils.getIndentation(depth));\n if (isOptional()) {\n buff.append(\"optional \");\n }\n if (isIgnored()) {\n buff.append(\"ignored \");\n }\n if (isCollection()) {\n buff.append(\"collection \");\n }\n buff.append(\"leaf \");\n buff.append(getItem().getName());\n if (getFieldName() != null) {\n buff.append(\" field \");\n buff.append(getFieldName());\n buff.append(\" of type \");\n buff.append(getType());\n }\n buff.append(\" for schema component \");\n buff.append(SchemaUtils.describeComponent(getItem().getSchemaComponent()));\n appendSelectConstText(buff);\n appendDocText(buff);\n return buff.toString();\n }",
"public static void sortCompilationProposal(List<ICompletionProposal> prop){\r\n\t\tCollections.sort(prop,new Comparator<ICompletionProposal>(){\r\n\t\t\tpublic int compare(ICompletionProposal o1, ICompletionProposal o2){\r\n\t\t\t\treturn o1.getDisplayString().compareTo(o2.getDisplayString());\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"static TreeSet<Noun> parse3rdNouns(Scanner data){\n\n\t\tint declension = 3;\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\t\t\ttry{\n\t\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD;\n\t\t\t\t\t//System.out.println(\"No i-stem\");\n\t\t\t\t} catch(NumberFormatException e){ //I-Stem.\n\t\t\t\t\tchapter = Integer.parseInt(current[0].substring(0, 2));\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD_I;\n\t\t\t\t\t//System.out.println(\"i-stem\");\n\t\t\t\t}\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}",
"private Comparator<SourceVo> sourceNameComparator(String lang) {\n return (s1, s2) -> {\n String n1 = s1.getDesc(lang) != null ? s1.getDesc(lang).getName() : null;\n String n2 = s2.getDesc(lang) != null ? s2.getDesc(lang).getName() : null;\n return TextUtils.compareIgnoreCase(n1, n2);\n };\n }",
"private List<Criterion> _sortCriterionList()\n {\n Collections.sort(_criterionList, _groupNameComparator);\n Collections.sort(_criterionList, _fieldOrderComparator);\n for(int count = 0 ; count < _criterionList.size() ; count++)\n {\n ((DemoAttributeCriterion)_criterionList.get(count)).setOrderDirty(false);\n }\n return _criterionList;\n }",
"private TypeOrder getTypeOrder() {\n\t\tif (JjsUtils.closureStyleLiteralsNeeded(this.options)) {\n\t\t\treturn TypeOrder.ALPHABETICAL;\n\t\t}\n\t\tif (this.options.useDetailedTypeIds()) {\n\t\t\treturn TypeOrder.NONE;\n\t\t}\n\t\treturn this.options.isIncrementalCompileEnabled()\n\t\t\t\t? TypeOrder.ALPHABETICAL\n\t\t\t\t: TypeOrder.FREQUENCY;\n\t}",
"public String getDescription(String lang) {\n/* 188 */ return getLangAlt(lang, \"description\");\n/* */ }",
"public void sortProposals() {\n\n\t}",
"@Override\n public int compare(Suggestion sugg1, Suggestion sugg2) {\n int alteredGrammarWordsDifference = sugg1.getAlteredGrammarWordsCount()\n - sugg2.getAlteredGrammarWordsCount();\n\n if (alteredGrammarWordsDifference != 0) {\n return alteredGrammarWordsDifference;\n }\n\n //if tied: less added info first\n int additionalNamesDifference = sugg1.getAdditionalNamesCount() + sugg1.getAdditionalGrammarWords()\n - (sugg2.getAdditionalNamesCount() + sugg2.getAdditionalGrammarWords());\n\n if (additionalNamesDifference != 0) {\n return additionalNamesDifference;\n }\n\n //if tied: less words first\n int wordCountDifference = sugg1.getWordsCount() - sugg2.getWordsCount();\n\n if (wordCountDifference == 0) {\n return wordCountDifference;\n }\n\n //if tied: shortest text first\n return sugg1.getText().length() - sugg2.getText().length();\n }",
"java.lang.String getDesc();",
"@Override\n public String getDescription(){\n return \"Spanning tree algorithm using LCO.\\n\" +\n \"Rule 1 : N(1) --- N(x) ---> F(0) --- N(x-1) \\n\" +\n \"Rule 2 : N(1) --- N(1) ---> E(0) --- F(0) \\n\";\n }",
"public void sortScoresDescendently(){\n this.langsScores.sort((LangScoreBankUnit o1, LangScoreBankUnit o2) -> {\n return Double.compare(o2.getScore(),o1.getScore());\n });\n }",
"public SoilTypeComparator() {\n\t\tthis.descending = true;\n\t}",
"public final void insertConcept(final String name,\r\n final String generalization) {\r\n int c, l, i, hc;\r\n Concept[] d, dx;\r\n Concept c1, c2;\r\n\r\n d = this.m_data;\r\n l = d.length;\r\n hc = name.hashCode();\r\n\r\n dummy: {\r\n // look if we found a \"dummy concept\"\r\n i = (l - 1);\r\n for (c2 = d[hc & i]; c2 != null; c2 = c2.m_next) {\r\n if (c2.m_name.equals(name)) {\r\n l--;\r\n break dummy;\r\n }\r\n }\r\n\r\n c = this.m_count;\r\n // we need to insert at least one new concept -> update hash\r\n this.m_count = c + 1;\r\n\r\n if ((3 * c) >= (l << 1)) {\r\n i = l - 1;\r\n l <<= 1;\r\n dx = new Concept[l];\r\n\r\n for (--l; i >= 0; i--) {\r\n for (c1 = d[i]; c1 != null; c1 = c2) {\r\n c2 = c1.m_next;\r\n c = (c1.m_name.hashCode() & l);\r\n\r\n c1.m_next = dx[c];\r\n dx[c] = c1;\r\n }\r\n }\r\n\r\n this.m_data = d = dx;\r\n } else\r\n l--;\r\n\r\n // insert new concept.\r\n c = (hc & l);\r\n d[c] = c2 = new Concept(name, d[c], hc);\r\n }\r\n\r\n if (generalization == null)\r\n return;\r\n\r\n hc = generalization.hashCode();\r\n\r\n // search generalization\r\n for (c1 = d[hc & l]; c1 != null; c1 = c1.m_next) {\r\n if (c1.m_name.equals(generalization)) {\r\n c2.m_generalization = c1;\r\n c1.addConcept(c2);\r\n return;\r\n }\r\n }\r\n\r\n // generalization not found! -> insert dummy concept.\r\n\r\n c = (hc & l);\r\n d[c] = c2.m_generalization = new Concept(generalization, d[c], hc);\r\n c2.m_generalization.addConcept(c2);\r\n this.m_count++;\r\n }",
"private void init(String description, String[][] localizations)\n/* */ {\n/* 1480 */ initLocalizations(localizations);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1487 */ StringBuilder descBuf = stripWhitespace(description);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1494 */ this.lenientParseRules = extractSpecial(descBuf, \"%%lenient-parse:\");\n/* 1495 */ this.postProcessRules = extractSpecial(descBuf, \"%%post-process:\");\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1500 */ int numRuleSets = 0;\n/* 1501 */ for (int p = descBuf.indexOf(\";%\"); p != -1; p = descBuf.indexOf(\";%\", p)) {\n/* 1502 */ numRuleSets++;\n/* 1503 */ p++;\n/* */ }\n/* 1505 */ numRuleSets++;\n/* */ \n/* */ \n/* 1508 */ this.ruleSets = new NFRuleSet[numRuleSets];\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1517 */ String[] ruleSetDescriptions = new String[numRuleSets];\n/* */ \n/* 1519 */ int curRuleSet = 0;\n/* 1520 */ int start = 0;\n/* 1521 */ for (int p = descBuf.indexOf(\";%\"); p != -1; p = descBuf.indexOf(\";%\", start)) {\n/* 1522 */ ruleSetDescriptions[curRuleSet] = descBuf.substring(start, p + 1);\n/* 1523 */ this.ruleSets[curRuleSet] = new NFRuleSet(ruleSetDescriptions, curRuleSet);\n/* 1524 */ curRuleSet++;\n/* 1525 */ start = p + 1;\n/* */ }\n/* 1527 */ ruleSetDescriptions[curRuleSet] = descBuf.substring(start);\n/* 1528 */ this.ruleSets[curRuleSet] = new NFRuleSet(ruleSetDescriptions, curRuleSet);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1543 */ boolean defaultNameFound = false;\n/* 1544 */ int n = this.ruleSets.length;\n/* 1545 */ this.defaultRuleSet = this.ruleSets[(this.ruleSets.length - 1)];\n/* */ for (;;) {\n/* 1547 */ n--; if (n < 0) break;\n/* 1548 */ String currentName = this.ruleSets[n].getName();\n/* 1549 */ if ((currentName.equals(\"%spellout-numbering\")) || (currentName.equals(\"%digits-ordinal\")) || (currentName.equals(\"%duration\"))) {\n/* 1550 */ this.defaultRuleSet = this.ruleSets[n];\n/* 1551 */ defaultNameFound = true;\n/* 1552 */ break;\n/* */ }\n/* */ }\n/* */ \n/* 1556 */ if (!defaultNameFound) {\n/* 1557 */ for (int i = this.ruleSets.length - 1; i >= 0; i--) {\n/* 1558 */ if (!this.ruleSets[i].getName().startsWith(\"%%\")) {\n/* 1559 */ this.defaultRuleSet = this.ruleSets[i];\n/* 1560 */ break;\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1568 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 1569 */ this.ruleSets[i].parseRules(ruleSetDescriptions[i], this);\n/* 1570 */ ruleSetDescriptions[i] = null;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1578 */ int publicRuleSetCount = 0;\n/* 1579 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 1580 */ if (!this.ruleSets[i].getName().startsWith(\"%%\")) {\n/* 1581 */ publicRuleSetCount++;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1586 */ String[] publicRuleSetTemp = new String[publicRuleSetCount];\n/* 1587 */ publicRuleSetCount = 0;\n/* 1588 */ for (int i = this.ruleSets.length - 1; i >= 0; i--) {\n/* 1589 */ if (!this.ruleSets[i].getName().startsWith(\"%%\")) {\n/* 1590 */ publicRuleSetTemp[(publicRuleSetCount++)] = this.ruleSets[i].getName();\n/* */ }\n/* */ }\n/* */ \n/* 1594 */ if (this.publicRuleSetNames != null)\n/* */ {\n/* */ label585:\n/* 1597 */ for (int i = 0; i < this.publicRuleSetNames.length; i++) {\n/* 1598 */ String name = this.publicRuleSetNames[i];\n/* 1599 */ for (int j = 0; j < publicRuleSetTemp.length; j++) {\n/* 1600 */ if (name.equals(publicRuleSetTemp[j])) {\n/* */ break label585;\n/* */ }\n/* */ }\n/* 1604 */ throw new IllegalArgumentException(\"did not find public rule set: \" + name);\n/* */ }\n/* */ \n/* 1607 */ this.defaultRuleSet = findRuleSet(this.publicRuleSetNames[0]);\n/* */ } else {\n/* 1609 */ this.publicRuleSetNames = publicRuleSetTemp;\n/* */ }\n/* */ }",
"public String alienOrder(String[] words) {\n HashMap<Character, Integer> degrees = new HashMap<Character, Integer>();\n //in BFS, we will create result forward, so we need use \"decides\" relation\n //To avoid add same relationship multiple times, we use HashSet to store nodes\n //Ex: za zb ca cb, both shows relationship a decides b, we don't want have 2 b after a in relations\n HashMap<Character, Set<Character>> hs = new HashMap<Character, Set<Character>>();\n \n String prev = \"\";//prev word\n //fill prerequisites table and degree table\n for(String word : words){\n //we put degree table here to include each char in dict\n for(char c : word.toCharArray()){\n if(!degrees.containsKey(c)) degrees.put(c, 0);\n } \n //then search for the the first char after common part\n for(int i = 0; i < Math.min(prev.length(), word.length()); i++){\n char a = prev.charAt(i), b = word.charAt(i);\n if(a != b){\n //we use \"decides\" relation, so a is key while b is a value in related value set\n //we may not necessary to have prerequisites for each char, so we put it here and \n //no need to include all chars in dict, if some words do not have dependency\n if(!hs.containsKey(a)) hs.put(a, new HashSet<Character>());\n hs.get(a).add(b);\n //then we update incoming edge table (degrees table)\n degrees.put(b, degrees.get(b) + 1);\n \n break;//we only care about first char, so break now\n }\n }\n prev = word;//update prev word\n }\n \n //**second part, use BFS to topologically visit the graph **\n Queue<Character> que = new LinkedList<Character>();\n \n for(Character c : degrees.keySet()){\n //add first series of nodes that do not have incoming edges\n if(degrees.get(c) == 0){\n que.offer(c);\n }\n }\n \n StringBuilder sb = new StringBuilder();\n \n while(!que.isEmpty()){\n Character curr = que.poll();\n sb.append(curr);\n \n //since we may not necessary include all nodes in prerequisites table, we need do boundary check first\n if(!hs.containsKey(curr)) continue;\n //remove outgoing edges from c, add new nodes if all their incoming edges have been removed\n for(Character c : hs.get(curr)){\n degrees.put(c, degrees.get(c) - 1);\n if(degrees.get(c) == 0){\n que.offer(c);\n }\n }\n }\n \n //check the result length with supposed length from keySize()\n //if not same, then there must be some nodes in cycle and did not included to our queue\n return sb.length() == degrees.size()? sb.toString() : \"\";\n }",
"static TreeSet<Noun> parseNouns(Scanner data, int declension){\n\t\tassert(declension != Values.INDEX_ENDINGS_DECLENSION_THIRD && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N); //there's a separate function for these guys.\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(NumberFormatException e){ //can happen if a chapter isn't specified. Read the noun from a null chapter.\n\t\t\t\tchapter = Values.CHAPTER_VOID;\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}",
"public static List<Sentence> parseDesc(String desc){\n\t\ttry{\n\t\t\tif(sentenceDetector == null)\n\t\t\t\tsentenceDetector = new SentenceDetectorME(new SentenceModel(new FileInputStream(\"en-sent.bin\")));\n\t\t\tif(tokenizer == null)\n\t\t\t\ttokenizer = new TokenizerME(new TokenizerModel(new FileInputStream(\"en-token.bin\")));\n\t\t\tif(tagger == null)\n\t\t\t\ttagger = new POSTaggerME(new POSModel(new FileInputStream(\"en-pos-maxent.bin\")));\n\t\t\tif(chunker == null)\n\t\t\t\tchunker = new ChunkerME(new ChunkerModel(new FileInputStream(\"en-chunker.bin\")));\n\t\t} catch(InvalidFormatException ex) {\n\t\t\tex.printStackTrace();\n\t\t} catch(FileNotFoundException ex){\n\t\t\tex.printStackTrace();\n\t\t} catch(IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\tList<Sentence> sentenceList = new LinkedList();\n\t\tString[] sentences = sentenceDetector.sentDetect(desc);\t\t\n\t\tfor(String s : sentences) {\n\t\t\tString[] tokens = tokenizer.tokenize(s);\n\t\t\tString[] posTags = tagger.tag(tokens);\n\t\t\tString[] chunks = chunker.chunk(tokens, posTags);\n\t\t\tList<String> ner = new LinkedList();\n\t\t\tList<String> lemma = new ArrayList();\n\t\t\tfor(String str : tokens) {\n\t\t\t\tlemma.add(str.toLowerCase());\n\t\t\t\tner.add(\"O\"); //assume everything is an object\n\t\t\t}\n\t\t\t\n\t\t\tSentence sentence = new Sentence (Arrays.asList(tokens), lemma, Arrays.asList(posTags), Arrays.asList(chunks), ner, s);\n\t\t\tsentenceList.add(sentence);\n\t\t}\n\t\t\n\t\treturn sentenceList;\n\t}",
"private void createListStereotypes(Composite section2)\n {\n listStereotypes = new ListViewer(section2, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);\n GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);\n listStereotypes.getList().setLayoutData(data);\n\n // Set the label provider\n listStereotypes.setLabelProvider(new LabelProvider()\n {\n public String getText(Object element)\n {\n // Return the resolution's label.\n if (element instanceof Stereotype)\n {\n Stereotype stereotype = (Stereotype) element;\n return stereotype.getName();\n }\n return null;\n }\n });\n\n // Set the content provider\n listStereotypes.setContentProvider(new IStructuredContentProvider()\n {\n\n public Object[] getElements(Object inputElement)\n {\n if (inputElement instanceof Collection)\n {\n int countStereo = 0;\n Collection<Stereotype> result = new LinkedList<Stereotype>();\n Collection< ? > collec = (Collection< ? >) inputElement;\n // for all stereotypes\n for (Object o : collec)\n {\n if (o instanceof Stereotype)\n {\n Stereotype stereo = (Stereotype) o;\n // for all association to the current stereotype\n for (Association a : stereo.getAssociations())\n {\n if (a instanceof Extension)\n {\n Extension e = (Extension) a;\n // get the MetaClass\n EClassifier metaClass = CustomUMLUtil.getEClass(e.getMetaclass());\n // if the MetaClass is in the requirement hierarchie\n if (requirementInheritance.contains(metaClass))\n {\n result.add(stereo);\n countStereo++;\n }\n }\n }\n }\n }\n // Display error if there 0 stereotype\n if (countStereo == 0)\n {\n section.setDescription(\"No stereotype applicable on requirement element in the selected profile\"); //$NON-NLS-1$\n section.layout(true);\n }\n else\n {\n section.setDescription(\"\"); //$NON-NLS-1$\n section.layout(true);\n }\n return result.toArray();\n }\n return null;\n }\n\n public void dispose()\n {\n }\n\n public void inputChanged(Viewer viewer, Object oldInput, Object newInput)\n {\n }\n\n });\n listStereotypes.addSelectionChangedListener(new ISelectionChangedListener()\n {\n private ISelection selection;\n\n public void selectionChanged(SelectionChangedEvent event)\n {\n selection = listStereotypes.getSelection();\n if (selection instanceof IStructuredSelection)\n {\n IStructuredSelection stru = (IStructuredSelection) selection;\n if (stru.getFirstElement() instanceof Stereotype)\n {\n selectedStereotype = (Stereotype) stru.getFirstElement();\n }\n }\n\n }\n });\n }",
"@Override\n\tpublic int compareTo(EachContentWritable arg0) {\n\t\tint tmp = word .compareTo(arg0. word);\n if ( tmp != 0) return tmp;\n return title.compareTo(arg0.title);\n\t}",
"public void listSort() {\n\t\tCollections.sort(cd);\n\t}",
"public int compare(IComparableContribution c1, IComparableContribution c2) {\n int cat1 = category(c1);\n int cat2 = category(c2);\n if (cat1 != cat2) {\n return cat1 - cat2;\n }\n String name1 = c1.getLabel();\n String name2 = c2.getLabel();\n if (name1 == null) {\n //$NON-NLS-1$\n name1 = \"\";\n }\n if (name2 == null) {\n //$NON-NLS-1$\n name2 = \"\";\n }\n // use the comparator to compare the strings\n return Policy.getComparator().compare(name1, name2);\n }",
"public abstract String describe(int depth);",
"private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}",
"@Override\n public LinkedList<String> orderAlphabetically(){\n LinkedList<String> stringLL = super.orderAlphabetically();\n stringLL.add(\"Years Until Tenure: \" + m_yearsUntilTenure);\n Collections.sort(stringLL);\n return stringLL;\n }",
"public SortSpecification getSortSpecification(String s, boolean flag) {\n return null;\r\n }",
"protected abstract Comparator<UsageInfo> makeUsageInfoComparator();",
"public void sortStringArray() {\n\t\tSystem.out.println(\"PROPERY BELONGS TO ONLY CHILD CLASS!!\");\n\t}",
"public int compare(Viewer viewer, Object o1, Object o2) {\n\n // Sort according to the locale-specific collation order.\n return collator.compare(labelProvider.getText(o1),\n labelProvider.getText(o2));\n }",
"public int compare(SpeciesContextSpecParameter parm1, SpeciesContextSpecParameter parm2){\t\r\n\t\t\t\r\n\t\t\tswitch (index){\r\n\t\t\t\tcase COLUMN_NAME:{\r\n\t\t\t\t\tif (ascending){\r\n\t\t\t\t\t\treturn parm1.getName().compareToIgnoreCase(parm2.getName());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn parm2.getName().compareToIgnoreCase(parm1.getName());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcase COLUMN_VALUE:{\r\n\t\t\t\t\tString expression1 = parm1.getExpression() != null ? parm1.getExpression().infix() : \"\";\r\n\t\t\t\t\tString expression2 = parm2.getExpression() != null ? parm2.getExpression().infix() : \"\";\r\n\t\t\t\t\tif (ascending){\r\n\t\t\t\t\t\treturn expression1.compareToIgnoreCase(expression2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn expression2.compareToIgnoreCase(expression1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcase COLUMN_DESCRIPTION:{\r\n\t\t\t\t\tif (ascending){\r\n\t\t\t\t\t\treturn parm1.getDescription().compareToIgnoreCase(parm2.getDescription());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn parm2.getDescription().compareToIgnoreCase(parm1.getDescription());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcase COLUMN_UNIT:{\r\n\t\t\t\t\tString unit1 = (parm1.getUnitDefinition()!=null)?(parm1.getUnitDefinition().getSymbol()):\"null\";\r\n\t\t\t\t\tString unit2 = (parm2.getUnitDefinition()!=null)?(parm2.getUnitDefinition().getSymbol()):\"null\";\r\n\t\t\t\t\tif (ascending){\r\n\t\t\t\t\t\treturn unit1.compareToIgnoreCase(unit2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn unit2.compareToIgnoreCase(unit1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t}",
"public void orderPartsRecords(Integer order, List<PartRecord> parts) throws Exception {\n switch (order){\n case 1:\n parts.sort((p1, p2) -> p1.getPart().getDescription().compareTo(p2.getPart().getDescription()));\n break;\n case 2:\n parts.sort((p1, p2) -> p2.getPart().getDescription().compareTo(p1.getPart().getDescription()));\n break;\n case 3:\n parts.sort(Comparator.comparing(PartRecord::getLastModification));\n }\n }",
"@Override\n\tpublic int compare(Subject o1, Subject o2) {\n\t\tString s1 = o1.getSubtitle();\n\t\tString s2 = o2.getSubtitle();\n\t\treturn s1.compareTo(s2);\n\t}",
"@Override\n\tpublic int compare(MediaMaster em1, MediaMaster em2) {\n\t\tif(em2.getArtist() != null && em1.getArtist() != null){\n\t\t\tif(\"Asc\".equalsIgnoreCase(type)){\n\t\t\t\treturn em2.getArtist().compareTo(em1.getArtist());\n\t\t\t}else{\n\t\t\t\treturn em1.getArtist().compareTo(em2.getArtist());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public interface LayeredPartFinder extends OrderedPartFinder {\n\n /**\n * Gets a collection of all parts (buttons, fields) that are searchable.\n *\n * @param context The execution context.\n * @return The collection of parts in this container.\n */\n Collection<PartModel> getPartModels(ExecutionContext context);\n\n /**\n * Gets the list of parts returned by {@link #getPartModels(ExecutionContext) , sorted by their z-order (the order in which one is\n * drawn atop another). If {@link #getPartModels(ExecutionContext) } returns {@link com.defano.wyldcard.part.card.CardModel}\n * objects, they will be appended to the end of the list, after any button or field models.\n *\n * @param context The execution context.\n * @return The z-ordered list of parts on this card.\n */\n default List<PartModel> getPartsInDisplayOrder(ExecutionContext context) {\n ArrayList<PartModel> allParts = new ArrayList<>();\n\n ArrayList<PartModel> bkgndParts = new ArrayList<>(getPartsInDisplayOrder(context, Owner.BACKGROUND));\n bkgndParts.sort(new ZOrderComparator(context));\n\n ArrayList<PartModel> cardParts = new ArrayList<>(getPartsInDisplayOrder(context, Owner.CARD));\n cardParts.sort(new ZOrderComparator(context));\n\n allParts.addAll(bkgndParts);\n allParts.addAll(cardParts);\n\n allParts.addAll(getCardPartsInDisplayOrder(context));\n\n return allParts;\n }\n\n /**\n * Gets the list of cards present in {@link #getPartModels(ExecutionContext)} returned in the provided order.\n *\n * @param context The execution context.\n * @return The list of cards present in {@link #getPartModels(ExecutionContext)}.\n */\n default List<PartModel> getCardPartsInDisplayOrder(ExecutionContext context) {\n return getPartModels(context).stream()\n .filter(p -> p.getType() == PartType.CARD)\n .collect(Collectors.toList());\n }\n\n /**\n * Gets a list of buttons and field in the list returned by {@link #getPartModels(ExecutionContext)} that appear on a given layer,\n * listed in their z-order (that is, the order in which one is drawn atop another).\n *\n * @param context The execution context.\n * @param layer The layer of parts to be returned\n * @return The z-ordered list of parts in the given layer of this card.\n */\n default List<PartModel> getPartsInDisplayOrder(ExecutionContext context, Owner layer) {\n return getPartModels(context)\n .stream()\n .filter(p -> layer == null || p.getOwner() == layer)\n .filter(p -> p.getType() == PartType.BUTTON || p.getType() == PartType.FIELD)\n .sorted(new ZOrderComparator(context))\n .collect(Collectors.toList());\n }\n\n /**\n * Gets the number of parts of the given type that exist on the specified layer.\n *\n * @param context The execution context.\n * @param type Type of part to count or null to count all parts\n * @return The number of parts of the given type displayed on this card.\n */\n default long getPartCount(ExecutionContext context, PartType type, Owner layer) {\n return getPartsInDisplayOrder(context, layer)\n .stream()\n .filter(p -> type == null || p.getType() == type)\n .count();\n }\n}",
"private List<Article> sortTopics(Article queryTopic, List<Article>relatedTopics) throws Exception {\n for (Article art:relatedTopics) \n art.setWeight(_comparer.getRelatedness(art, queryTopic)) ;\n\n //Now that the weight attribute is set, sorting will be in descending order of weight.\n //If weight was not set, it would be in ascending order of id. \n Collections.sort(relatedTopics) ;\n return relatedTopics ;\n }",
"private static void sortHelperMSD(String[] asciis, int start, int end, int index) {\n // Optional MSD helper method for optional MSD radix sort\n return;\n }",
"protected void createDocumentationAnnotations() {\n\t\tString source = \"http://www.polarsys.org/kitalpha/ecore/documentation\";\t\n\t\taddAnnotation\n\t\t (this, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"CompositeStructure aims at defining the common component approach composite structure pattern language (close to the UML Composite structure).\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"none\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"none\",\n\t\t\t \"constraints\", \"This package depends on the model FunctionalAnalysis.ecore\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockArchitecturePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Container package for BlockArchitecture elements\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockArchitectureEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Parent class for deriving specific architectures for each design phase\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"n/a\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedRequirementPkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain requirements\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain capabilities\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain interfaces\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain data\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_ProvisionedArchitectureAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) list of allocation links to other architectures\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_ProvisioningArchitectureAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) list of allocation links from other architectures to this one\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_AllocatedArchitectures(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the BlockArchitectures that are allocated from this one\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_AllocatingArchitectures(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to BlockArchitectures that allocate to this architecture\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"A modular unit that describes the structure of a system or element.\\r\\n[source: SysML specification v1.1]\",\n\t\t\t \"usage guideline\", \"n/a (abstract)\",\n\t\t\t \"used in levels\", \"n/a (abstract)\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain capabilities\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain interfaces\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to packages that contain data\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedStateMachines(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Link to related state machines\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentArchitectureEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"A specialized kind of BlockArchitecture, serving as a parent class for the various architecture levels, from System analysis down to EPBS architecture\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"N/A (abstract)\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"An entity, with discrete structure within the system, that interacts with other Components of the system, thereby contributing at its lowest level to the system properties and characteristics.\\r\\n[source: Sys EM , ISO/IEC CD 15288]\",\n\t\t\t \"arcadia_description\", \"A component is a constituent part of the system, contributing to its behaviour, by interacting with other components and external actors, thereby contributing at its lowest level to the system properties and characteristics. Example: radio receiver, graphical user interface...\\r\\nDifferent kinds of components exist: see below (logical component, physical component...).\",\n\t\t\t \"usage guideline\", \"none\",\n\t\t\t \"used in levels\", \"n/a (abstract)\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"InterfaceUse relationships that are stored/owned under this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) interfaceUse relationships that involve this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the Interfaces being used by this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Interface implementation relationships that are stored/owned under this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) list of InterfaceImplementation links that involve this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the Interfaces being implemented by this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvisionedComponentAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) list of allocation links made from this component to other components\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvisioningComponentAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) list of allocation links from other components, to this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatedComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the components being allocated from this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the components allocating this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the Interfaces being provided by this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the Interfaces being required by this component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the PhysicalPaths that are stored/owned by this physical component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Physical links contained in / owned by this Physical component\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalLinkCategories(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractActorEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"An Actor models a type of role played by an entity that interacts with the subject (e.g., by exchanging signals and data),\\r\\nbut which is external to the subject (i.e., in the sense that an instance of an actor is not a part of the instance of its corresponding subject). \\r\\n\\r\\nActors may represent roles played by human users, external hardware, or other subjects.\\r\\nNote that an actor does not necessarily represent a specific physical entity but merely a particular facet (i.e., \\'role\\') of some entity\\r\\nthat is relevant to the specification of its associated use cases. Thus, a single physical instance may play the role of\\r\\nseveral different actors and, conversely, a given actor may be played by multiple different instances.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"usage guideline\", \"none\",\n\t\t\t \"used in levels\", \"n/a (abstract)\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"In SysML, a Part is an owned property of a Block\\r\\n[source: SysML glossary for SysML v1.0]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(computed) the provided interfaces associated to the classifier that this part represents\\r\\n[source: Capella study]\\r\\n\\r\\nThe interfaces that the component exposes to its environment.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(computed) the required interfaces associated to the classifier that this part represents\\r\\n[source: Capella study]\\r\\n\\r\\nThe interfaces that the component requires from other components in its environment in order to be able to offer\\r\\nits full set of provided functionality\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_OwnedDeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Deployment relationships that are stored/owned under this part\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (architectureAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Mediator class between BlockArchitecture elements, to represent an allocation link\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"n/a\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getArchitectureAllocation_AllocatedArchitecture(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the allocated architecture\\r\\n[source: Capella study]\\r\\n\\r\\nSpecifies the targets of the DirectedRelationship.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getArchitectureAllocation_AllocatingArchitecture(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the allocating architecture\\r\\n[source: Capella study]\\r\\n\\r\\nSpecifies the sources of the DirectedRelationship.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Mediator class between Component elements, representing the allocation link between these elements\\r\\n[source: Capella light-light study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"n/a\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponentAllocation_AllocatedComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the allocated component\\r\\n[source: Capella study]\\r\\n\\r\\nSpecifies the targets of the DirectedRelationship.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponentAllocation_AllocatingComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the allocating component\\r\\n[source: Capella study]\\r\\n\\r\\nSpecifies the targets of the DirectedRelationship.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"An entity, with discrete structure within the system, that interacts with other Components of the system, thereby contributing at its lowest level to the system properties and characteristics.\\r\\n[source: Sys EM , ISO/IEC CD 15288]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"n/a (abstract)\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"specifies whether or not this is a data component\\r\\n[source: Capella light-light study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataType(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"data type(s) associated to this component\\r\\n[source: Capella light-light study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_ParticipationsInCapabilityRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) the involvement relationships between this SystemComponent and CapabilityRealization elements\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfacePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"A container for Interface elements\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the interfaces that are owned by this Package\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfacePkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the packages of interfaces that are owned by this Package\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"An interface is a kind of classifier that represents a declaration of a set of coherent public features and obligations. An\\r\\ninterface specifies a contract; any instance of a classifier that realizes the interface must fulfill that contract.\\r\\n[source: UML superstructure v2.2]\\r\\n\\r\\nInterfaces are defined by functional and physical characteristics that exist at a common boundary with co-functioning items and allow systems, equipment, software, and system data to be compatible.\\r\\n[source: not precised]\\r\\n\\r\\nThat design feature of one piece of equipment that affects a design feature of another piece of equipment. \\r\\nAn interface can extend beyond the physical boundary between two items. (For example, the weight and center of gravity of one item can affect the interfacing item; however, the center of gravity is rarely located at the physical boundary.\\r\\nAn electrical interface generally extends to the first isolating element rather than terminating at a series of connector pins.)\",\n\t\t\t \"usage guideline\", \"In Capella, Interfaces are created to declare the nature of interactions between the System and external actors.\",\n\t\t\t \"used in levels\", \"system/logical/physical\",\n\t\t\t \"usage examples\", \"../img/usage_examples/external_interface_example.png\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_Mechanism(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"_todo_reviewed : cannot find the meaning of this attribute ? How to fill it ?\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"type\", \"_todo_reviewed : to be precised\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_Structural(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"type\", \"n/a\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ImplementorComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"references to the components that implement this interface\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_UserComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"references to the components that use this interface\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"references to the InterfaceImplementation elements, that act as mediators between this interface and its implementers\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"references to the InterfaceUse elements, that act as mediator classes between this interface and its users\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvisioningInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References to the InterfaceAllocation elements, acting as mediator classes between the interface and the elements to which/from which it is allocated\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_AllocatingInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References to the Interfaces that declare an allocation link to this Interface\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References to the components that declare an allocation link to this Interface\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ExchangeItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References to all exchange items allocated by the interface\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_OwnedExchangeItemAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References to allocations of exchange items\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceImplementationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Mediator class between an Interface and its implementor (typically a Component)\\r\\n[source: Capella study]\\r\\n\\r\\nAn InterfaceRealization is a specialized Realization relationship between a Classifier and an Interface. This relationship\\r\\nsignifies that the realizing classifier conforms to the contract specified by the Interface.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_InterfaceImplementor(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References the Component that owns this Interface implementation.\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_ImplementedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References the Interface specifying the conformance contract\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceUseEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Mediator class between an interface and its user (typically a Component)\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_InterfaceUser(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Component that uses the interface\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_UsedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Supplied interface\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (providedInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(not used)\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"n/a\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"n/a\",\n\t\t\t \"comment/notes\", \"not used/implemented as of Capella 1.0.3\",\n\t\t\t \"reference documentation\", \"n/a\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getProvidedInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"References the Interface specifying the conformance contract\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (requiredInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(not used)\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"n/a\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"n/a\",\n\t\t\t \"comment/notes\", \"not used/implemented as of Capella\",\n\t\t\t \"reference documentation\", \"n/a\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getRequiredInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"The element(s) independent of the client element(s), in the same respect and the same dependency relationship\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Mediator class between an Interface and an element that allocates to/from it.\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocation_AllocatedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the allocated interface\\r\\n[source: Capella study]\\r\\n\\r\\nSpecifies the targets of the DirectedRelationship.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocation_AllocatingInterfaceAllocator(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Specifies the allocating interface\\r\\n[source: Capella study]\\r\\n\\r\\nSpecifies the sources of the DirectedRelationship.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocatorEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Base class for elements that need to be involved in an allocation link to/from an Interface\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical,epbs\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_OwnedInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the interface allocation links that are stored/owned under this interface allocator\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_ProvisionedInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) the interface allocation links involving this interface allocator\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_AllocatedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"(automatically computed) direct references to the Interfaces being allocated by this interface allocator\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (actorCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"support class to implement the link between an Actor and a CapabilityRealization\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"system, logical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Support class for implementation of the link between a CapabilityRealization and a SystemComponent\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"logical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentContextEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Base class for specific SystemContext, LogicalContext, PhysicalContext\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a (abstract)\",\n\t\t\t \"used in levels\", \"system,logical,physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (exchangeItemAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Allocation link between exchange items and interface that support them\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_SendProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"describes the default protocol used by the sender of the exchange item. It could be overrided by the protocol used by the given communication exchanger\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"type\", \"refer to CommunicationLinkProtocol definition\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_ReceiveProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"describes the default protocol used by the receiver of the exchange item. It could be overrided by the protocol used by the given communication exchanger\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"type\", \"refer to CommunicationLinkProtocol definition\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatedItem(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the exchange item that is being allocated by the interface\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatingInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the interface that allocated the given exchange item\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (deployableElementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"characterizes a physical model element that is intended to be deployed on a given (physical) target\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeployableElement_DeployingLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the list of deployment specifications associated to this element, e.g. associations between this element and a physical location to which it is to be deployed\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (deploymentTargetEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the physical target that will host a deployable element\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeploymentTarget_DeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the list of deployment specifications involving this physical target as the destination of the deployment\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractDeploymentLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the link between a physical element, and the physical target onto which it is deployed\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_DeployedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the physical element involved in this relationship, that is to be deployed on the target\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_Location(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the host where the source element involved in this relationship will be deployed\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPathInvolvedElementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"An involved element is a capella element that is, at least, involved in an involvement relationship with the role of the element that is involved\\r\\n[source:Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalArtifactEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"A physical artifact is any physical element in the physical architecture (component, port, link,...).\\r\\nThese artifacts will be part allocated to configuration items in the EPBS.\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"End of a physical link\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalLinkEnd_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"Physical links that come in or out of this physical port\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalPathLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the base element for building a physical path : a link between two physical interfaces\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the representation of the physical medium connecting two physical interfaces\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_LinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the source(s) and destination(s) of this physical link\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedComponentExchangeFunctionalExchangeAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the allocations between component exchanges and functional exchanges, that are owned by this physical link\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the physical link endpoints involved in this link\\r\\n\\r\\nA connector consists of at least two connector ends, each representing the participation of instances of the classifiers\\r\\ntyping the connectable elements attached to this end. The set of connector ends is ordered.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_RealizedPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_RealizingPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"an endpoint of a physical link\\r\\n\\r\\nA connector end is an endpoint of a connector, which attaches the connector to a connectable element. Each connector\\r\\nend is part of one connector.\\r\\n[source: UML superstructure v2.2]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"operational,system,logical,physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Port(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the port to which this communication endpoint is attached\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Part(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the part to which this connect endpoint is attached\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"n/a\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the specification of a given path of informations flowing across physical links and interfaces.\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"this is the equivalent for the physical architecture, of a functional chain defined at system level\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"the list of steps of this physical path\\r\\n[source: Capella study]\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_OwnedPhysicalPathRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_RealizedPhysicalPaths(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_RealizingPhysicalPaths(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"n/a\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"A port on a physical component\\r\\n[source: Capella study]\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_OwnedPhysicalPortRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_RealizedPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_RealizingPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"none\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"description\", \"n/a\",\n\t\t\t \"usage guideline\", \"n/a\",\n\t\t\t \"used in levels\", \"physical\",\n\t\t\t \"usage examples\", \"n/a\",\n\t\t\t \"constraints\", \"none\",\n\t\t\t \"comment/notes\", \"none\",\n\t\t\t \"reference documentation\", \"none\"\n\t\t });\n\t}",
"public void compareLang (List<Doctor> dl, Doctor d)\n\t{\n\t\tfor(Doctor ld: dl)\n\t\t{\n\t\t\tHashSet<String> exisDocLang=new HashSet(ld.getLang());\n\t\t\tHashSet<String> docLang=new HashSet(d.getLang());\n\t\t\tdocLang.retainAll(exisDocLang);\n\t\t\tif((docLang!=null && docLang.size()>0)) \n\t\t\t\trnkMap.put(ld,rnkMap.get(ld)+docLang.size());\n\t\t}\n\t\t\n\t}",
"public interface SortingAlgorithm<E extends Comparable<E>> {\n\n /**\n * Ordina una lista di elementi in accordo all'ordinamento totale naturale\n * definito nella classe degli elementi.\n * \n * @param l\n * la lista da ordinare (dovrebbe essere una ArrayList)\n * @return un oggetto contentente la lista ordinata e il numero di\n * operazioni di comparazione effettuate dall'algoritmo.\n */\n public SortingAlgorithmResult<E> sort(List<E> l);\n\n /**\n * Restituisce il nome dell'algoritmo di ordinamento.\n * \n * @return il nome dell'algoritmo\n */\n public String getName();\n\n}",
"public static Comparator<Term> byLexicographicOrder()\n\t{\n\t\tComparator<Term> comp = new byLexicographicOrder();\n\t\treturn comp;\n\t}",
"@Override\n\t\tpublic int compare(ModCandidate a, ModCandidate b) {\n\n\t\t\tif (a.isRoot()) {\n\t\t\t\tif (!b.isRoot()) {\n\t\t\t\t\treturn -1; // only a is root\n\t\t\t\t}\n\t\t\t} else if (b.isRoot()) {\n\t\t\t\treturn 1; // only b is root\n\t\t\t}\n\n\t\t\t// sort id desc\n\t\t\tint idCmp = a.getId().compareTo(b.getId());\n\t\t\tif (idCmp != 0) return idCmp;\n\n\t\t\t// sort version desc (lower version later)\n\t\t\tint versionCmp = b.getVersion().compareTo(a.getVersion());\n\t\t\tif (versionCmp != 0) return versionCmp;\n\n\t\t\t// sort nestLevel asc\n\t\t\tint nestCmp = a.getMinNestLevel() - b.getMinNestLevel(); // >0 if nest(a) > nest(b)\n\t\t\tif (nestCmp != 0) return nestCmp;\n\n\t\t\tif (a.isRoot()) return 0; // both root\n\n\t\t\tList<ModCandidate> parents = new ArrayList<>(a.getParentMods().size() + b.getParentMods().size());\n\t\t\tparents.addAll(a.getParentMods());\n\t\t\tparents.addAll(b.getParentMods());\n\t\t\tparents.sort(this);\n\n\t\t\tif (a.getParentMods().contains(parents.get(0))) {\n\t\t\t\tif (b.getParentMods().contains(parents.get(0))) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}",
"public static <T extends DescriptiveData, A extends WithAdmin> Map<String, Object> basicTransformation(WithResource<T, A> rr) {\n\n\t\tJsonNode rr_json = Json.toJson(rr);\n\t\tObjectNode idx_doc = Json.newObject();\n\n\t\tMap<String, List<String>>lang_accumulators = new HashMap<String, List<String>>();\n\n\t\t/*\n\t\t * Label\n\t\t */\n\t\tJsonNode label = rr_json.get(\"descriptiveData\").get(\"label\");\n\t\tidx_doc.put(\"label\", label);\n\n\t\tif(label != null) {\n\t\t\tIterator<Entry<String, JsonNode>> labels_it = label.fields();\n\t\t\tArrayNode all_labels = Json.newObject().arrayNode();\n\t\t\twhile(labels_it.hasNext()) {\n\t\t\t\tEntry<String, JsonNode> e = labels_it.next();\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\tall_labels.add(v);\n\t\t\t\t}\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\taddToLangAll(lang_accumulators, e.getKey(), v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tidx_doc.put(\"label_all\", all_labels);\n\n\n\t\t}\n\n\t\t/*\n\t\t * Description\n\t\t */\n\t\tJsonNode description = rr_json.get(\"descriptiveData\").get(\"description\");\n\t\tidx_doc.put(\"description\", description);\n\t\tif(description != null) {\n\t\t\tIterator<Entry<String, JsonNode>> descs_it = description.fields();\n\t\t\tArrayNode all_descs = Json.newObject().arrayNode();\n\t\t\twhile(descs_it.hasNext()) {\n\t\t\t\tEntry<String, JsonNode> e = descs_it.next();\n\t\t\t\t// ignore \"def\" and \"unknown\" language\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\tall_descs.add(v);\n\t\t\t\t}\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\taddToLangAll(lang_accumulators, e.getKey(), v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tidx_doc.put(\"description_all\", all_descs);\n\t\t}\n\n\t\t/*\n\t\t * Keywords\n\t\t */\n\t\tJsonNode keywords = rr_json.get(\"descriptiveData\").get(\"keywords\");\n\t\tidx_doc.put(\"keywords\", keywords);\n\t\tif(keywords != null) {\n\t\t\tIterator<Entry<String, JsonNode>> keywords_it = keywords.fields();\n\t\t\tArrayNode all_keywords = Json.newObject().arrayNode();\n\t\t\twhile(keywords_it.hasNext()) {\n\t\t\t\tEntry<String, JsonNode> e = keywords_it.next();\n\t\t\t\t// ignore \"def\" and \"unknown\" language\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\tall_keywords.add(v);\n\t\t\t\t}\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\taddToLangAll(lang_accumulators, e.getKey(), v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tidx_doc.put(\"keywords_all\", all_keywords);\n\t\t}\n\n\t\t/*\n\t\t * AltLabels\n\t\t */\n\t\tJsonNode altLabels = rr_json.get(\"descriptiveData\").get(\"altLabels\");\n\t\tidx_doc.put(\"altLabels\", altLabels);\n\t\tif(altLabels != null) {\n\t\t\tIterator<Entry<String, JsonNode>> altLabels_it = altLabels.fields();\n\t\t\tArrayNode all_altLabels = Json.newObject().arrayNode();\n\t\t\twhile(altLabels_it.hasNext()) {\n\t\t\t\tEntry<String, JsonNode> e = altLabels_it.next();\n\t\t\t\t// ignore \"def\" and \"unknown\" language\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\tall_altLabels.add(v);\n\t\t\t\t}\n\t\t\t\tfor(String v: (List<String>)Json.fromJson(e.getValue(), List.class)) {\n\t\t\t\t\taddToLangAll(lang_accumulators, e.getKey(), v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tidx_doc.put(\"altLabels_all\", all_altLabels);\n\t\t}\n\n\t\tList<String> unknownValues = null;\n\t\tfor(Entry<String, List<String>> e: lang_accumulators.entrySet()) {\n\t\t\tif(e.getKey().toLowerCase().matches(\"un(.*)\")) {\n\t\t\t\tunknownValues = e.getValue();\n\t\t\t}\n\t\t}\n\t\tfor(Entry<String, List<String>> e: lang_accumulators.entrySet()) {\n\t\t\tif(e.getKey().toLowerCase().matches(\"un(.*)\"))\n\t\t\t\tcontinue;\n\n\t\t\tif(unknownValues != null)\n\t\t\t\te.getValue().addAll(unknownValues);\n\t\t\tJsonNode langs = Json.toJson(e.getValue());\n\t\t\tidx_doc.put(\"_all_\" + e.getKey(), langs);\n\t\t}\n\n\t\tArrayNode dates = Json.newObject().arrayNode();\n\t\tif(rr.getDescriptiveData().getDates() != null) {\n\t\t\tfor(WithDate d: rr.getDescriptiveData().getDates()) {\n\t\t\t\tdates.add(d.getYear());\n\t\t\t}\n\t\t\tidx_doc.put(\"dates\", dates);\n\t\t}\n\n\t\t/*\n\t\t * User Rights structure in the document\n\t\t */\n\t\tidx_doc.put(\"isPublic\", rr.getAdministrative().getAccess().getIsPublic());\n\t\tObjectMapper aclMapper = new ObjectMapper();\n\t\tSimpleModule module = new SimpleModule();\n\t\tmodule.addSerializer(AccessEntry.class, new Serializer.AccessEntrySerializer());\n\t\taclMapper.registerModule(module);\n\t\tString aclString;\n\t\ttry {\n\t\t\taclString = aclMapper.writeValueAsString(rr.getAdministrative().getAccess().getAcl());\n\t\t\tidx_doc.put(\"access\", aclMapper.readTree(aclString));\n\t\t} catch (JsonProcessingException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlog.error(\"\",e1);\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlog.error(\"\",e1);\n\t\t}\n\n\n\n\t\t/*\n\t\t * CollectedIn field\n\t\t */\n\t\t//idx_doc.put(\"collectedIn\", Json.toJson(rr.getCollectedIn()));\n\n\t\t/*\n\t\t * Add the username and email of the creator\n\t\t * NOT the dbId\n\t\t */\n\t\tif(rr.getWithCreator() != null ) {\n\t\t\tidx_doc.put(\"creatorUsername\", rr.getWithCreator().getUsername());\n\t\t\tidx_doc.put(\"creatorEmail\", rr.getWithCreator().getEmail());\n\t\t}\n\n\n\t\t/*\n\t\t * Add more fields to the Json\n\t\t */\n\t\tidx_doc.put(\"metadataRights\", Json.toJson(rr.getDescriptiveData().getMetadataRights()));\n\t\t//idx_doc.put(\"isExhibition\", Json.toJson(rr.getAdministrative().));\n\t\tidx_doc.put(\"tags\", Json.toJson(rr.getUsage().getTags()));\n\t\tidx_doc.put(\"isShownAt\", Json.toJson(rr.getDescriptiveData().getIsShownAt()));\n\t\tif((rr.getProvenance() != null) && (rr.getProvenance().size() == 1)) {\n\t\t\tidx_doc.put(\"dataProvider\", Json.toJson(rr.getProvenance().get(0).getProvider()));\n\t\t}\n\t\tif((rr.getProvenance() != null) && (rr.getProvenance().size() > 1)) {\n\t\t\tidx_doc.put(\"dataProvider\", Json.toJson(rr.getProvenance().get(0).getProvider()));\n\t\t\tidx_doc.put(\"provider\", Json.toJson(rr.getProvenance().get(1).getProvider()));\n\t\t}\n\t\tidx_doc.put(\"resourceType\", rr_json.get(\"resourceType\"));\n\n\n\n\t\t/*\n\t\t * Format and add Media structure\n\t\t * TODO Add all Media Objects!!\n\t\t */\n\t\tArrayNode media_objects = Json.newObject().arrayNode();\n\t\tif( (rr.getMedia() != null) && !rr.getMedia().isEmpty()\n\t\t\t\t&& (rr.getMedia().get(0)!=null) && (!rr.getMedia().get(0).isEmpty()) ) {\n\t\t\t// take care about all EmbeddedMediaObjects\n\t\t\tObjectNode media = Json.newObject();\n\t\t\tfor(HashMap<MediaVersion, EmbeddedMediaObject> mediaobj: rr.getMedia()) {\n\t\t\t\tfor(EmbeddedMediaObject emo: mediaobj.values()) {\n\t\t\t\t\tmedia.put(\"withRights\", Json.toJson(emo.getWithRights()));\n\t\t\t\t\t//TODO: why withMediaType and not type, like in EmbeddedMedia? media.type\n\t\t\t\t\tmedia.put(\"type\", Json.toJson(emo.getType()));\n\t\t\t\t\tmedia.put(\"originalRights\", Json.toJson(emo.getOriginalRights()));\n\t\t\t\t\t//media.put(\"mimeType\", Json.toJson(emo.getMimeType()));\n\t\t\t\t\tmedia.put(\"url\", Json.toJson(emo.getUrl()));\n\t\t\t\t\tmedia.put(\"quality\", Json.toJson(emo.getQuality()));\n\t\t\t\t\tmedia.put(\"width\", emo.getWidth());\n\t\t\t\t\tmedia.put(\"height\", emo.getHeight());\n\t\t\t\t\t/*\n\t\t\t\t\t * Eliminate null values from Media json structures\n\t\t\t\t\t */\n\t\t\t\t\tObjectNode media_copy = media.deepCopy();\n\t\t\t\t\tIterator<String> fieldNames = media_copy.fieldNames();\n\t\t\t\t\twhile(fieldNames.hasNext()) {\n\t\t\t\t\t\tString fName = fieldNames.next();\n\t\t\t\t\t\tif(media_copy.get(fName).isNull() ) {\n\t\t\t\t\t\t\tmedia.remove(fName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmedia_objects.add(media);\n\t\t\t\t}\n\t\t\t}\n\t\t\tidx_doc.put(\"media\", media_objects);\n\t\t}\n\n\t\t/*\n\t\t * Eliminate null values from the root document\n\t\t */\n\t\tObjectNode idx_copy = idx_doc.deepCopy();\n\t\tIterator<String> fieldNames = idx_copy.fieldNames();\n\t\twhile(fieldNames.hasNext()) {\n\t\t\tString fName = fieldNames.next();\n\t\t\tif(idx_copy.get(fName).isNull() ) {\n\t\t\t\tidx_doc.remove(fName);\n\t\t\t}\n\t\t}\n\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.setSerializationInclusion(Include.NON_NULL);\n\t\tMap<String, Object> idx_map = mapper.convertValue(idx_doc, Map.class);\n\n\t\treturn idx_map;\n\t}",
"public void sortIntermediateNodes() {\n\t\tfor (FTNonLeafNode intermediateNode : intermediateNodes.values()) {\n\t\t\tdeclareBeforeUse(intermediateNode);\n\t\t}\n\t}"
] | [
"0.6283583",
"0.58150834",
"0.57715344",
"0.5588122",
"0.5393522",
"0.52002364",
"0.50423336",
"0.4968877",
"0.49512535",
"0.48574957",
"0.48520705",
"0.47867352",
"0.4774076",
"0.47691527",
"0.474272",
"0.47364464",
"0.4734602",
"0.47049162",
"0.4700175",
"0.46916983",
"0.46843702",
"0.4679639",
"0.46311936",
"0.46195006",
"0.46059224",
"0.4602311",
"0.45731464",
"0.4569128",
"0.4552798",
"0.45527568",
"0.45498687",
"0.45440942",
"0.45399955",
"0.45393714",
"0.45381963",
"0.45300692",
"0.45100325",
"0.4507522",
"0.45043468",
"0.44962883",
"0.4480486",
"0.44760668",
"0.4472641",
"0.44641167",
"0.4462936",
"0.44617912",
"0.44610363",
"0.4458713",
"0.4446919",
"0.44447276",
"0.44301552",
"0.44267738",
"0.44256687",
"0.442476",
"0.44186738",
"0.4418064",
"0.4417401",
"0.4414139",
"0.44040892",
"0.44007617",
"0.43946582",
"0.43863115",
"0.43844038",
"0.4382948",
"0.43817624",
"0.43804368",
"0.43802896",
"0.4379721",
"0.4378775",
"0.43709856",
"0.43626088",
"0.4358665",
"0.4357514",
"0.43463993",
"0.43457356",
"0.43283984",
"0.43278775",
"0.4324426",
"0.43219393",
"0.43164787",
"0.43085364",
"0.43080446",
"0.43026617",
"0.42912376",
"0.42893797",
"0.4285188",
"0.42802224",
"0.42774352",
"0.42676973",
"0.4267174",
"0.4264341",
"0.4256788",
"0.42533708",
"0.42486235",
"0.4247682",
"0.42456093",
"0.4239948",
"0.42353117",
"0.42344308",
"0.42338526"
] | 0.601743 | 1 |
Register a listener for database DataChange events | synchronized public void addClientListener(ClientListener l)
{
if (listeners == null)
listeners = new ArrayList<ClientListener>();
listeners.add(l);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface DatabaseListener {\n\n void databaseChanged(DatabaseEvent databaseEvent);\n\n}",
"public interface OnDatabaseChangedListener {\n void onNewSJEntryAdded(String serviceNum);\n void onSJEntryRenamed(String fileName);\n void onSJEntryDeleted();\n }",
"public void dataChanged(DataChangeEvent e) {\n\t\t\t}",
"public void onDataChanged();",
"public void onDataChanged(){}",
"public interface OnDatabaseChangedListener{\n void onNewDatabaseEntryAdded();\n void onDatabaseEntryRenamed();\n}",
"void onDataChanged();",
"@Override\n\tpublic void onDataChanged()\n\t{\n\t\tfor (DataChangedCallbacks listener : this.dataChangedListeners)\n\t\t{\n\t\t\tlistener.onDataChanged();\n\t\t}\n\t}",
"public interface DatabaseListener {\n void onBeforeDatabaseCreate(ApplicationDB db);\n void onAfterDatabaseCreate(ApplicationDB db);\n\n void onBeforeDatabaseUpgrade(ApplicationDB db, int oldVersion, int newVersion);\n void onAfterDatabaseUpgrade(ApplicationDB db, int oldVersion, int newVersion);\n\n void onDatabaseOpened(ApplicationDB db);\n void onDatabaseClosed(ApplicationDB db);\n}",
"private EventListener listenChanges() {\n Set<String> storeEvents = ImmutableSet.of(Events.STORE_INITED);\n EventListener eventListener = event -> {\n // Ensure task schema create after system info initialized\n if (storeEvents.contains(event.name())) {\n this.call(() -> this.tx().initSchema());\n return true;\n }\n return false;\n };\n this.graph.loadSystemStore().provider().listen(eventListener);\n return eventListener;\n }",
"public void addOnDataChangedListener(OnDataChangedListener listener) {\n dataChangedListeners.add(listener);\n }",
"public static interface DataChangeObserver {\n /**\n * Called when data has been changed.\n */\n void onDataChanged();\n /**\n * Called when data has been cleared.\n */\n void onDataCleared();\n /**\n * Called when usage reports can be reported to local indexing service.\n */\n void startReportingTask();\n /**\n * Called when usage reports can't be reported to local indexing service any more.\n */\n void stopReportingTask();\n }",
"public interface DbSubscriber extends Subscriber {\n void onDbDataUpdated(@Db.DbEvent int tableId, Object dbObject);\n\n void onDbErrorError(@Db.DbEvent int tableId, Object error);\n}",
"@Override\n public void datasetChanged(DatasetChangeEvent event) {\n this.lastEvent = event;\n }",
"void addDataCollectionListener(DataCollectionListener l);",
"@Override\n public void onDataChanged() {\n }",
"@Override\n public void onDataChanged() {\n }",
"private void dbListeners() {\n // Set if image+text is being worked on currently\n //================================================\n mBeingWorkedOnListener = new ValueEventListener() {\n @Override\n public void onDataChange(final DataSnapshot dataSnapshot) {\n new AsyncTask<Void, Void, String>() {\n @Override\n protected String doInBackground(Void... voids) {\n return dataSnapshot.getValue(String.class);\n }\n\n @Override\n protected void onPostExecute(String s) {\n beingWorkedOn = s;\n }\n }.execute();\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n };\n\n dGlobalRef.child(\"beingWorkedOn\").addValueEventListener(mBeingWorkedOnListener);\n }",
"@Override\n public void onDataChanged() {\n\n }",
"public void addListener( DatabaseUpdaterListener listener ) {\n\t\tsynchronized( listeners_ ) {\n\t\t\tif( ! listeners_.contains(listener) ) { \n\t\t\t\tlisteners_.add(listener);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void onDbStarted() {\n }",
"public void dataChanged() {\n\t\tif (wijzigInfo)\n\t\t\twijzigInfo();\n\n\t\tsetChanged();\n\t\tnotifyObservers(\"dataChanged\");\n\t}",
"private static void registerEventListener() {\r\n\r\n log.info(\"Registering event listener for Listeners\"); //$NON-NLS-1$\r\n\r\n try {\r\n ObservationManager observationManager = ContentRepository\r\n .getHierarchyManager(ContentRepository.CONFIG)\r\n .getWorkspace()\r\n .getObservationManager();\r\n\r\n observationManager.addEventListener(new EventListener() {\r\n\r\n public void onEvent(EventIterator iterator) {\r\n // reload everything\r\n reload();\r\n }\r\n }, Event.NODE_ADDED\r\n | Event.NODE_REMOVED\r\n | Event.PROPERTY_ADDED\r\n | Event.PROPERTY_CHANGED\r\n | Event.PROPERTY_REMOVED, \"/\" + CONFIG_PAGE + \"/\" + \"IPConfig\", true, null, null, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n }\r\n catch (RepositoryException e) {\r\n log.error(\"Unable to add event listeners for Listeners\", e); //$NON-NLS-1$\r\n }\r\n }",
"public void dataUpdateEvent();",
"interface DataListener\n{\n\tpublic void DataChanged(MDSplus.Data data);\n}",
"@Override\n\t\t\t\t\t\t\tpublic void onDataSetInserted(long newRowId) {\n\t\t\t\t\t\t\t\tgetOrInsertServerId(context, listener);\n\t\t\t\t\t\t\t}",
"@Override\n public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {\n final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction();\n LOG.debug(\"Received data change to ApplicationRib {}\", changes);\n for (final DataTreeCandidate tc : changes) {\n LOG.debug(\"Modification Type {}\", tc.getRootNode().getModificationType());\n final YangInstanceIdentifier path = tc.getRootPath();\n final PathArgument lastArg = path.getLastPathArgument();\n Verify.verify(lastArg instanceof NodeIdentifierWithPredicates, \"Unexpected type %s in path %s\", lastArg.getClass(), path);\n final NodeIdentifierWithPredicates tableKey = (NodeIdentifierWithPredicates) lastArg;\n for (final DataTreeCandidateNode child : tc.getRootNode().getChildNodes()) {\n final YangInstanceIdentifier tableId = this.adjRibsInId.node(tableKey).node(child.getIdentifier());\n if (child.getDataAfter().isPresent()) {\n LOG.trace(\"App peer -> AdjRibsIn path : {}\", tableId);\n LOG.trace(\"App peer -> AdjRibsIn data : {}\", child.getDataAfter().get());\n tx.put(LogicalDatastoreType.OPERATIONAL, tableId, child.getDataAfter().get());\n }\n }\n }\n tx.submit();\n }",
"@Override\n protected void setupDataListeners() {\n stopAllListeners();\n DocumentReference docRef = db.collection(\"units\").document(unitId);\n unitListener = new EventListener<DocumentSnapshot>() {\n @Override\n public void onEvent(@Nullable DocumentSnapshot documentSnapshot, @Nullable FirebaseFirestoreException e) {\n if (e != null) {\n Toast.makeText(TenantUnitDetailsActivity.this, \"Snapshot exception in Tenant Unit Details\", Toast.LENGTH_SHORT).show();\n return;\n }\n if (documentSnapshot != null && documentSnapshot.exists()) {\n Unit newUnit = documentSnapshot.toObject(Unit.class);\n dm.setUnit(newUnit);\n unit = newUnit;\n displayTenantUnit();\n }\n }\n };\n unitReg = docRef.addSnapshotListener(unitListener);\n }",
"private void initDatabase(){\n\n mChildEventListener=new ChildEventListener() {\n @Override\n public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {\n\n }\n\n @Override\n public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {\n\n }\n\n @Override\n public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {\n\n }\n\n @Override\n public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n };\n androidDatabase.addChildEventListener(mChildEventListener);\n }",
"public void onDataChanged(IData data) {\r\n setData(data);\r\n }",
"@Override\n protected void onDataChanged() {\n }",
"@Override\n public void onDataChanged(DataEventBuffer dataEvents) {\n // Not used\n }",
"@DISPID(-2147412072)\n @PropGet\n java.lang.Object ondatasetchanged();",
"public HandlerRegistration addDataChangeHandler(ValueChangeHandler<Class<E>> handler);",
"@Override\n public void onDataChanged(DataEventBuffer dataEventBuffer) {\n for (DataEvent event : dataEventBuffer) {\n if (event.getType() == DataEvent.TYPE_CHANGED) {\n // DataItem changed\n DataItem item = event.getDataItem();\n if (item.getUri().getPath().compareTo(\"/latlnglist\") == 0) {\n\n DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();\n\n Log.d(\"hudwear\", \"new data, sending message to handler\");\n\n Message m = new Message();\n Bundle b = new Bundle();\n b.putDouble(\"latitude\", dataMap.getDouble(\"latitude\"));\n b.putDouble(\"longitude\", dataMap.getDouble(\"longitude\"));\n m.setData(b);\n handler.sendMessage(m);\n }\n\n } else if (event.getType() == DataEvent.TYPE_DELETED) {\n // DataItem deleted\n }\n }\n }",
"@Override\n\tpublic void onDataConnectionStateChanged(int state) {\n\t\tLog.v(\"FMT\", \"Connection Listener appelé. State : \"+state);\n\t\tsuper.onDataConnectionStateChanged(state);\n\t}",
"private void notifyListeners(boolean dataChanged) {\n for (OnDataChangedListener listener : dataChangedListeners) {\n listener.onDataChanged(dataChanged);\n }\n }",
"public void attachDatabaseListener() {\n dRef.addChildEventListener(new ChildEventListener() {\n\n @Override\n public void onChildAdded(DataSnapshot dataSnapshot, String s) {\n Trail addedTrail = dataSnapshot.getValue(Trail.class);\n if(checkTrailUser(addedTrail.getuserId(), user.getUid())) {\n trails.add(addedTrail);\n keys.add(dataSnapshot.getKey());\n trailAdapter.notifyDataSetChanged();\n App.trainer.addTrail(addedTrail);\n }\n }\n\n @Override\n public void onChildChanged(DataSnapshot dataSnapshot, String s) {\n Trail changedTrail = dataSnapshot.getValue(Trail.class);\n if(checkTrailUser(changedTrail.getuserId(), user.getUid())) {\n String key = dataSnapshot.getKey();\n trails.set(keys.indexOf(key), changedTrail);\n App.trainer.setTrail(keys.indexOf(key), changedTrail);\n trailAdapter.notifyDataSetChanged();\n }\n }\n\n @Override\n public void onChildRemoved(DataSnapshot dataSnapshot) {\n Trail removedTrail = dataSnapshot.getValue(Trail.class);\n if(checkTrailUser(removedTrail.getuserId(), user.getUid())) {\n keys.remove(dataSnapshot.getKey());\n removeTrail(removedTrail);\n App.trainer.removeTrail(removedTrail.getTrailID());\n trailAdapter.notifyDataSetChanged();\n }\n }\n public void onChildMoved(DataSnapshot dataSnapshot, String s) {}\n public void onCancelled(DatabaseError databaseError) {}\n });\n }",
"@Override\n public void startNotificationListener(DBMSSynchronizer dbmsSynchronizer) {\n Logger.getLogger(ThreadedHousekeeper.class.getName()).setLevel(Level.SEVERE);\n\n this.listener = new PostgresSQLNotificationListener(dbmsSynchronizer);\n\n PGDataSource dataSource = new PGDataSource();\n dataSource.setHost(connectionProperties.getHost());\n dataSource.setPort(connectionProperties.getPort());\n dataSource.setDatabase(connectionProperties.getDatabase());\n dataSource.setUser(connectionProperties.getUser());\n dataSource.setPassword(connectionProperties.getPassword());\n\n try {\n pgConnection = (PGConnection) dataSource.getConnection();\n pgConnection.createStatement().execute(\"LISTEN jabrefLiveUpdate\");\n // Do not use `new PostgresSQLNotificationListener(...)` as the object has to exist continuously!\n // Otherwise the listener is going to be deleted by GC.\n pgConnection.addNotificationListener(listener);\n } catch (SQLException e) {\n LOGGER.error(\"SQL Error: \", e);\n }\n }",
"@Override\n\tpublic synchronized void registerEventListeners() {\n\t\tif (eventListeners != null) // already called\n\t\t\treturn;\n\t\teventListeners = EventListenerManagers.wrap(this);\n\t\tSelectionUpdateListener selectionUpdateListener = new SelectionUpdateListener();\n\t\tselectionUpdateListener.setHandler(this);\n\t\teventListeners.register(SelectionUpdateEvent.class, selectionUpdateListener);\n\n\t\tSelectionCommandListener selectionCommandListener = new SelectionCommandListener();\n\t\tselectionCommandListener.setHandler(this);\n\t\t// selectionCommandListener.setDataDomainID(dataDomain.getDataDomainID());\n\t\teventListeners.register(SelectionCommandEvent.class, selectionCommandListener);\n\n\t\tsuper.registerEventListeners();\n\n\n\t}",
"@Override\n public void onCreate(final ODatabaseInternal iDatabase) {\n if (iDatabase.getName().equalsIgnoreCase(OSystemDatabase.SYSTEM_DB_NAME)) return;\n\n final OAuditingHook hook = defaultHook(iDatabase);\n hooks.put(iDatabase.getName(), hook);\n iDatabase.registerHook(hook);\n iDatabase.registerListener(hook);\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n }",
"@Override\n public void addChangeListener(ChangeListener l) {}",
"public interface OnDataChangedListener {\n public void onDataChanged(boolean dataChanged);\n\n public void onDataError(VolleyError error);\n }",
"public ReplicationEventListener() {\n // connect to both the process and storage cluster\n this.hzClient = HazelcastClientFactory.getStorageClient();\n // get references to the system metadata map and events queue\n this.systemMetadata = this.hzClient.getMap(systemMetadataMap);\n // listen for changes on system metadata\n this.systemMetadata.addEntryListener(this, true);\n log.info(\"Added a listener to the \" + this.systemMetadata.getName() + \" map.\");\n this.replicationTaskRepository = ReplicationFactory.getReplicationTaskRepository();\n // start replication manager\n ReplicationFactory.getReplicationManager();\n }",
"public interface DatabaseRequestCompletedListener {\n\n\t/**\n\t * Called upon completion of a database request.\n\t */\n\tvoid databaseRequestCompleted();\n}",
"public void update() {\n Log.d(TAG, \"Updating database\");\n databaseRef.child(TAG).setValue(events);\n Log.d(TAG, \"Database update complete\");\n }",
"public void setRecordListener(DBRecordListener<gDBR> rcdListener)\n {\n this.recordListener = rcdListener;\n }",
"public void onListeningDataChange() {\n try {\n final FirebaseDatabase database = FirebaseDatabase.getInstance();\n final DatabaseReference reference = database.getReference(\"CSO\").child(\"TBT_Notifications\");\n reference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue() != null) {\n String tableName = dataSnapshot.child(\"TableName\").getValue().toString();\n playBeep();\n onMessageAlertInfo(tableName);\n reference.child(\"TableName\").removeValue();\n\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"void addChangeListener(ChangeListener listener);",
"@Override\n public void addChangeListener(ChangeListener l) {\n }",
"@Override\n public void addChangeListener(ChangeListener l) {\n }",
"void addChangeListener( RegistryListener listener );",
"void addListDataListener(ListDataListener listener);",
"public void addUpdateListener(StoreUpdateListener listener);",
"@Override\n public void handleDataChange(String dataPath, Object data) throws Exception\n {\n System.out.println(\"TestZKPropertyStore.testZKPropertyStore().new IZkDataListener() {...}.handleDataChange()\");\n }",
"@Override\n\tpublic void DataAcquisitionObjectEvent(Interface.DataAcquisitionObjectEvent e,String data) {\n\t\t\n\t}",
"boolean init(DataChangeObserver observer);",
"@DISPID(-2147412072)\n @PropPut\n void ondatasetchanged(\n java.lang.Object rhs);",
"@Override\n public void onEventRaised(Event evt) {\n if (evt.equals(EventType.SLAVE_STATE_CHANGED)) {\n refreshSlaveTable();\n }\n }",
"@Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n }",
"@Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n }",
"private void setupListeners()\n\t{\n\t\tfinal String query = \"INSERT INTO\" + \"`\" + table + \"` \" + getFields() + \"VALUES\" + getValues();\n\t\t\n\t\tqueryButton.addActionListener(new ActionListener()\n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent click)\n\t\t\t{\n\t\t\t\tbaseController.getDataController().submitUpdateQuery(query);\n\t\t\t}\n\t\t});\n\t}",
"public interface OnGetDataListener {\n void onSuccess(DataSnapshot dataSnapshot);\n void onStart();\n void onFailure();\n}",
"void addChangeListener(ChangeListener cl);",
"public void onDataChanged(IData data) {\r\n\tthis.canvas.onDataChanged(data);\r\n }",
"public void addListDataListener(ListDataListener l) {}",
"protected void onDataChanged(V item) {\n\n }",
"public void addChangeListener(ChangeListener l) {\n }",
"public void addChangeListener(ChangeListener l) {\n }",
"public interface EventListener\n{\n\n /**\n * This method is called when data is received from the DMM.\n *\n * <p>\n * More specifically, the received packet must be valid, then decoded, then the Data Object is updated, *then* this method is called.\n */\n public void dataUpdateEvent();\n\n}",
"@Override\n public void onDataChanged(DataEventBuffer dataEvents) {\n\n Log.i(TAG, \"onDataChanged()\");\n\n for (DataEvent dataEvent : dataEvents) {\n if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {\n DataItem dataItem = dataEvent.getDataItem();\n Uri uri = dataItem.getUri();\n String path = uri.getPath();\n\n if (path.startsWith(\"/sensors/\")) {\n if (SmartWatch.getInstance() != null) {\n SmartWatch.getInstance().unpackSensorData(DataMapItem.fromDataItem(dataItem).getDataMap());\n }\n }\n }\n }\n }",
"private void dettachDatabaseListener() {\n if (mChildEventListener != null) {\n mSancionadosReference.removeEventListener(mChildEventListener);\n mChildEventListener = null;\n }\n\n if (mEmptyCheckListener != null) {\n mSancionadosReference.removeEventListener(mEmptyCheckListener);\n mEmptyCheckListener = null;\n }\n }",
"@Override\n public void onOpen(ODatabaseInternal iDatabase) {\n if (iDatabase.getName().equalsIgnoreCase(OSystemDatabase.SYSTEM_DB_NAME)) return;\n\n // If the database has been opened by the auditing importer, do not hook it.\n if (iDatabase.getProperty(IMPORTER_FLAG) != null) return;\n\n OAuditingHook oAuditingHook = hooks.get(iDatabase.getName());\n if (oAuditingHook == null) {\n oAuditingHook = defaultHook(iDatabase);\n hooks.put(iDatabase.getName(), oAuditingHook);\n }\n iDatabase.registerHook(oAuditingHook);\n iDatabase.registerListener(oAuditingHook);\n }",
"public void registerListener(DataManagerEventListener listener) throws InvalidParameterException,\n ConnectionCheckedException,\n ConnectorCheckedException,\n PropertyServerException,\n UserNotAuthorizedException\n {\n eventClient.registerListener(userId, listener);\n }",
"public void addChangeListener(ChangeListener cl)\n {\n if (!fdl.listeners.add(cl)) throw new RuntimeException(\"Error whilst adding change listener.\");\n }",
"public interface DatabaseLifecycleHandler {\n\n\t/**\n\t * <p>\n\t * Method for DDL or DML\n\t * \n\t * @param db\n\t * database\n\t * @param oldVersion\n\t * current version of database\n\t * @param newVersion\n\t * new version of database\n\t * @param upgrade\n\t * if true is an upgrade operation, otherwise it's a\n\t * downgrade operation.\n\t */\n\tvoid onUpdate(SQLiteDatabase db, int oldVersion, int newVersion, boolean upgrade);\n\n\t/**\n\t * Invoked after execution of DDL necessary to create database.\n\t * \n\t * @param database\n\t */\n\tvoid onCreate(SQLiteDatabase database);\n\n\t/**\n\t * Invoked during database configuration.\n\t * \n\t * @param database\n\t */\n\tvoid onConfigure(SQLiteDatabase database);\n}",
"@Override\n public void onDatabaseLoaded() {}",
"public interface InsertNewGameRowListener {\n\n public void onNewRowInsertedInDb();\n}",
"private void addListeners() {\n \t\tfHistoryListener= new HistoryListener();\n \t\tfHistory.addOperationHistoryListener(fHistoryListener);\n \t\tlistenToTextChanges(true);\n \t}",
"public void addChangeListener(ChangeListener listener) { _changeListeners.add(listener); }",
"public void addTableChangedListener(TableChangedListener fel) {\n listeners.addElement(fel);\n }",
"public interface DatabaseLifecycleHandler {\n\n\t/**\n\t * <p>\n\t * Method for DDL or DML.\n\t *\n\t * @param database database\n\t * @param oldVersion current version of database\n\t * @param newVersion new version of database\n\t * @param upgrade if true is an upgrade operation, otherwise it's a\n\t * downgrade operation.\n\t */\n\tvoid onUpdate(SQLiteDatabase database, int oldVersion, int newVersion, boolean upgrade);\n\n\t/**\n\t * Invoked after execution of DDL necessary to create database.\n\t *\n\t * @param database the database\n\t */\n\tvoid onCreate(SQLiteDatabase database);\n\n\t/**\n\t * Invoked during database configuration.\n\t *\n\t * @param database the database\n\t */\n\tvoid onConfigure(SQLiteDatabase database);\n}",
"@Override\n public void registerDataSetObserver(final DataSetObserver observer) {\n mCursorAdapter.registerDataSetObserver(observer);\n mArrayAdapter .registerDataSetObserver(observer);\n }",
"@Override\n public void DataIsInserted() {\n }",
"public interface OnUpDataListener {\n}",
"public void onDataChanged(IData data) {\r\n\t this.data = data;\r\n\t repaint();\r\n\t}",
"@Override\n public void onDataChange(DataSnapshot snapshot) {\n }",
"public interface DataStructureListener<I extends Data> {\n public void itemAdded(I item);\n public void itemChanged(I original, I changed);\n}",
"public interface ConnectionEventListener {\n /** \n * Called on all listeners when a connection is made or broken. \n */\n void connectionActivity(ConnectionEvent ce);\n}",
"@Override\n protected void registerCustomListeners(@NotNull MessageBusConnection connection) {\n connection.subscribe(EncodingManagerListener.ENCODING_MANAGER_CHANGES, (document, propertyName, oldValue, newValue) -> {\n if (propertyName.equals(EncodingManagerImpl.PROP_CACHED_ENCODING_CHANGED)) {\n updateForDocument(document);\n }\n });\n\n connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(new VirtualFileListener() {\n @Override\n public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {\n if (VirtualFile.PROP_ENCODING.equals(event.getPropertyName())) {\n updateForFile(event.getFile());\n }\n }\n }));\n }",
"public PersistentLogEventListener() {\n\t\tthis(new EventDAO());\n\t}",
"public static void setOnSqliteCreateListener(OnSqliteCreateListener listener) {\n SqliteSession.instance().setOnSqliteCreateListener(listener);\n }",
"public void notify (DomainData domainData, int eventType)\n\t\t{\n\t\t\tList domainDataList = null;\n\t\t\t\n\t\t\tSystem.out.println(\"got change: change type = \"\n\t\t\t\t\t+ (eventType == IDomainChangeObserver.ADD ? \"ADD\"\n\t\t\t\t\t\t\t: (eventType == IDomainChangeObserver.CHANGE ? \"CHANGE\" : \"DELETE\"))\n\t\t\t\t\t+ \" domain id = \" + domainData.getDomainVO().getId());\n\t\t\t\n\t\t\tif ((domainDataList = (List) this.changeMap.get(new Integer(eventType)))\n\t\t\t\t\t== null) {\n\t\t\t\tdomainDataList = new ArrayList();\n\t\t\t\tdomainDataList.add(domainData);\n\t\t\t\tthis.changeMap.put(new Integer(eventType), domainDataList);\n\t\t\t} else {\n\t\t\t\tdomainDataList.add(domainData);\n\t\t\t}\n\t\t\t \n\t\t}",
"@Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\n }",
"@Override\n public void addListener(ChangeListener<? super String> listener) {\n }",
"public void addListDataListener(ListDataListener l) {\n }",
"void run()\n throws SQLException\n {\n Properties prop = new Properties();\n\n // Ask the server to send the ROWIDs as part of the DCN events (small performance\n // cost):\n prop.setProperty(OracleConnection.DCN_NOTIFY_ROWIDS, \"true\");\n //Set the DCN_QUERY_CHANGE_NOTIFICATION option for query registration with finer granularity.\n prop.setProperty(OracleConnection.DCN_QUERY_CHANGE_NOTIFICATION, \"true\");\n\n // The following operation does a roundtrip to the database to create a new\n // registration for DCN. It sends the client address (ip address and port) that\n // the server will use to connect to the client and send the notification\n // when necessary. Note that for now the registration is empty (we haven't registered\n // any table). This also opens a new thread in the drivers. This thread will be\n // dedicated to DCN (accept connection to the server and dispatch the events to\n // the listeners).\n dcr = conn.registerDatabaseChangeNotification(prop);\n\n try\n {\n // add the listenerr:\n DCNDemoListener list = new DCNDemoListener(this);\n dcr.addListener(list);\n System.out.println(\"registration.\");\n // second step: add objects in the registration:\n Statement stmt = conn.createStatement();\n // associate the statement with the registration:\n ((OracleStatement) stmt).setDatabaseChangeRegistration(dcr); \n ResultSet rs = stmt.executeQuery(\"select employee_id, salary from EMPLOYEES where department_id > 10\");\n while (rs.next())\n {\n }\n String[] tableNames = dcr.getTables();\n for (int i = 0; i < tableNames.length; i++)\n System.out.println(tableNames[i] + \" is part of the registration.\");\n rs.close();\n stmt.close();\n \n FacesContext ctx = FacesContext.getCurrentInstance();\n ExpressionFactory ef = ctx.getApplication().getExpressionFactory();\n ValueExpression ve =\n ef.createValueExpression(ctx.getELContext(), \"#{DepartmentBackend}\", DepartmentBackend.class);\n departmentBackend = (DepartmentBackend) ve.getValue(ctx.getELContext());\n \n }\n catch (SQLException ex)\n {\n // if an exception occurs, we need to close the registration in order\n // to interrupt the thread otherwise it will be hanging around.\n if (conn != null)\n conn.unregisterDatabaseChangeNotification(dcr);\n throw ex;\n }\n finally\n {\n try\n {\n // Note that we close the connection!\n conn.close();\n }\n catch (Exception innerex)\n {\n innerex.printStackTrace();\n }\n }\n\n }",
"@Override\n public void addChangeListener(ChangeListener listener, Event[] events) {\n boolean addEvent[] = selectEventsToModify(events);\n if (addEvent[Event.LOAD.ordinal()]) {\n loadListeners.addChangeListener(listener);\n }\n if (addEvent[Event.STORE.ordinal()]) {\n storeListeners.addChangeListener(listener);\n }\n if (addEvent[Event.REMOVE.ordinal()]) {\n removeListeners.addChangeListener(listener);\n }\n }",
"void watchListenerData(int port, ListenerWatcher watcher) {\n }",
"public interface DbResponseListener {\r\n //returns data on success\r\n void response( JSONArray data );\r\n\r\n //returns error message on error\r\n void errorResponse( String error );\r\n }"
] | [
"0.72413474",
"0.67053705",
"0.65601736",
"0.65558594",
"0.65233517",
"0.65057385",
"0.6458408",
"0.64223385",
"0.635724",
"0.62102777",
"0.6141264",
"0.6102984",
"0.6082341",
"0.59443927",
"0.5935123",
"0.588144",
"0.588144",
"0.5871354",
"0.58295965",
"0.5824578",
"0.5822961",
"0.5781088",
"0.5771505",
"0.57393175",
"0.5734314",
"0.5711918",
"0.5698719",
"0.56943643",
"0.5642879",
"0.5624809",
"0.56201565",
"0.5614107",
"0.5607485",
"0.5606346",
"0.5598164",
"0.55743986",
"0.5528252",
"0.5497582",
"0.5465324",
"0.54644835",
"0.5462777",
"0.5459291",
"0.54426056",
"0.54303765",
"0.5425698",
"0.54214466",
"0.53964984",
"0.5392718",
"0.5387758",
"0.53845155",
"0.5351564",
"0.5351564",
"0.53492445",
"0.5337377",
"0.5329333",
"0.5320994",
"0.53171694",
"0.5315722",
"0.531154",
"0.53093106",
"0.53006464",
"0.53006464",
"0.5287264",
"0.5286483",
"0.52813673",
"0.52726614",
"0.52707684",
"0.52706385",
"0.5262714",
"0.5262714",
"0.5262032",
"0.52471465",
"0.52341527",
"0.52304596",
"0.5222938",
"0.52218443",
"0.5211922",
"0.5210367",
"0.5203167",
"0.51968837",
"0.5189556",
"0.51812595",
"0.51765096",
"0.51738626",
"0.51663715",
"0.51539946",
"0.5146446",
"0.5143957",
"0.5125301",
"0.51179624",
"0.5115351",
"0.51073366",
"0.50969654",
"0.509439",
"0.5092997",
"0.50911164",
"0.5088941",
"0.5087592",
"0.5087221",
"0.5084125",
"0.50836056"
] | 0.0 | -1 |
Remove a listener for server DataChange | synchronized public void removeClientListener(ClientListener l)
{
if (listeners == null)
listeners = new ArrayList<ClientListener>();
listeners.remove(l);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeOnDataChangedListener(OnDataChangedListener listener) {\n dataChangedListeners.remove(listener);\n }",
"public void removeAnalysisServerListener(AnalysisServerListener listener);",
"void removeDataCollectionListener(DataCollectionListener l);",
"@Override\n\tpublic void unregisterDataRequest() {\n\t\tLog.i(TAG, \"Unregistering data requests.\");\n\t\tmBoundFunfManager.unrequestAllData2(listener);\n\n\t\tLog.i(TAG, \"After Unregistering data requests.\");\n\t\t\n\t}",
"void removeServerStoredGroupChangeListener(ServerStoredGroupListener listener);",
"@Override\n public void removeServerStoredGroupChangeListener(ServerStoredGroupListener\n listener)\n {\n ssContactList.removeGroupListener(listener);\n }",
"@Override\r\n\tpublic void removeListener(INotifyChangedListener notifyChangedListener) {\r\n\t\tchangeNotifier.removeListener(notifyChangedListener);\r\n\t}",
"public void removeDisconnectedCallback(OctaveReference listener) {\n\t\tlistenerDisconnected.remove(listener);\n\t}",
"@Override\n\tpublic void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"@Override\n\tpublic void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListDataListener(ListDataListener l) {}",
"void removeDataSourceListener(@Nonnull IDataSourceListener listener);",
"@Subscribe\n\tpublic void onStop(ServerStoppingEvent event)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdataManager.stop();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tlogger.error(\"Error while shutting down data services. Some values may not have been saved. Details: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// TODO server stop\n\t}",
"private void removeListeners() {\n \t\tlistenToTextChanges(false);\n \t\tfHistory.removeOperationHistoryListener(fHistoryListener);\n \t\tfHistoryListener= null;\n \t}",
"void removeListDataListener(ListDataListener listener);",
"@Override\n public void removeListener(ChangeListener<? super String> listener) {\n }",
"void onDataCleared();",
"public void removeConnectionListener(ConnectionListener listener);",
"public void unregisterListeners(){\n listeners.clear();\n }",
"@Override\n public void removeListener() {\n this.mListener = null;\n }",
"public void removeListDataListener(ListDataListener l) {\n }",
"public synchronized void removeConnectionEventListener(ConnectionEventListener connectioneventlistener) {\n/* 146 */ if (this.connectionEventListeners != null) {\n/* 147 */ this.connectionEventListeners.remove(connectioneventlistener);\n/* */ }\n/* */ }",
"public void removeEventListener(EventListener listener){\n try {\n listenerList.remove(EventListener.class, listener);\n } catch (Exception e) {\n System.out.println(\"[analizadorClient.removeEventListener]\" + e.getMessage());\n }\n \n \n }",
"private void dettachDatabaseListener() {\n if (mChildEventListener != null) {\n mSancionadosReference.removeEventListener(mChildEventListener);\n mChildEventListener = null;\n }\n\n if (mEmptyCheckListener != null) {\n mSancionadosReference.removeEventListener(mEmptyCheckListener);\n mEmptyCheckListener = null;\n }\n }",
"public ConnectionListener remove(String listenerID);",
"@Override\n\tpublic void unregistListener(IListener listener) throws RemoteException {\n\t\tremoteCallbackList.unregister(listener);\n\t}",
"public void unregisterListener() {\n\t\tthis.listener = null;\n\t}",
"public void removeListDataListener(ListDataListener l) {\n\t}",
"@Override\n public void removeListener(ResourceListener listener) {\n }",
"public void removeUpdateListener(StoreUpdateListener listener);",
"@Override\n public void removeListener(StreamListener listener) {\n streamListeners.remove(listener);\n }",
"protected void uninstallListeners() {\n }",
"protected void uninstallListeners() {\n }",
"public void removeDataDirectorListener(DataDirectorListener l) \n {\n if (l != null)\n {\n m_dataDirectorListeners.removeElement(l);\n }\n }",
"public void removeChangeListener(ChangeListener l) {\n\t\t//do nothing\n\t}",
"public synchronized void removeListener(IIpcEventListener listener) {\n\t\tlisteners.remove(listener);\n\t}",
"public void removeConnectionEventListener(ConnectionEventListener listener) {\n eventListener.removeConnectorListener(listener);\n }",
"public void cleanUp() { listener = null; }",
"void removeClientMetadataModificationListener(MetadataModificationListener modListener, WonderlandClientID wlCid) {\n if(!clientModificationListeners.containsKey(modListener)){\n logger.log(Level.SEVERE, \"trying to remove non-registered listener type for client id \" + wlCid);\n return;\n }\n\n ArrayList<WonderlandClientID> attachedClients = clientModificationListeners.get(modListener);\n int idx = attachedClients.lastIndexOf(wlCid);\n if(idx < 0){\n // this listner type exists/is registered for some client, but not this one\n logger.log(Level.SEVERE, \"trying to remove extant but unconnected listener type for client id \" + wlCid);\n return;\n }\n\n // remove this client id\n attachedClients.remove(idx);\n clientModificationListeners.put(modListener, attachedClients);\n }",
"public void removeListener(INotifyChangedListener notifyChangedListener)\n {\n changeNotifier.removeListener(notifyChangedListener);\n }",
"public void stopListening(){\n\t\tcv.getConfigurer().getControlFieldProvider().removeChangeListener(this);\n\t}",
"public void removeChangeListener(ChangeListener<BufferedImage> listener) {\n observer.remove(listener);\n }",
"@SubscribeEvent\n public static void onServerStopped(ServerStoppedEvent event) {\n // mainly used to reload data while changing single-player saves, unnecessary on dedicated server\n FluxNetworkData.release();\n }",
"void removeListener(ChangeListener<? super T> listener);",
"protected void uninstallListeners() {\n\t}",
"public void removeListener(T listener);",
"void removeListener(RosZeroconfListener listener);",
"public void unregisterListener() {\n mPhone.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);\n /* SPRD: Bug 697839 add For VOLTE and VoWiFi icon. @{ */\n try {\n if (mIsImsListenerRegistered) {\n mIsImsListenerRegistered = false;\n if (mIImsServiceEx != null) {\n mIImsServiceEx.unregisterforImsRegisterStateChanged(mImsUtListenerExBinder);\n }\n }\n /* SPRD: modify for bug723743 @{ */\n if (mIsImsReceiverRegistered) {\n mContext.unregisterReceiver(mImsIntentReceiver);\n mIsImsReceiverRegistered = false;\n }\n if (mIsModemReciverRegistered) {\n mContext.unregisterReceiver(mModemStateChangeReciver);\n mIsModemReciverRegistered = false;\n }\n /* @} */\n } catch (RemoteException e) {\n Log.e(mTag, \"RemoteException: \" + e);\n }\n /* @} */\n mContext.getContentResolver().unregisterContentObserver(mObserver);\n /* SPRD: Dual volte signalStrength display for bug 666045. @{ */\n if (mDualVoLTEListener != null) {\n mPhone.listen(mDualVoLTEListener, PhoneStateListener.LISTEN_NONE);\n }\n mContext.unregisterReceiver(mReceiver);\n /* @} */\n }",
"private void removeEventListener(IEventListener<T> listener) {\n\t\t\tevent.removeEventListener(listener);\n\t\t}",
"private void unregisterListener() {\n mSensorManager.unregisterListener(this);\n }",
"public void removeChangeListener(ChangeListener stackEngineListener);",
"void removeListener(IEventChannelListener<K, V> listener);",
"protected void removeListeners() {\n }",
"void unregisterListeners();",
"public void removeConnectedCallback(OctaveReference listener) {\n\t\tlistenerConnected.remove(listener);\n\t}",
"void removeListener(BotListener l);",
"public void removeListener(ICdtVariableChangeListener listener){\n\t\tfListeners.remove(listener);\n\t}",
"@Override\n public void unpin(IObserver observer) {\n listeners.remove(observer);\n }",
"public void removeListener(ValueChangedListener listener) {\n\t\t_listenerManager.removeListener(listener);\n\t}",
"@Override\n public void removeHandlerListener(IHandlerListener handlerListener) {\n\n }",
"void removeListener( AvailabilityListener listener );",
"public abstract void unregisterListeners();",
"public void removeChangeListener(ChangeListener listener) { _changeListeners.remove(listener); }",
"void removeListener(@Nonnull final ServletRequestAttributeListenerInfo info)\n {\n final ServletRequestAttributeListener service = this.requestAttributeListeners\n .remove(info.getServiceReference());\n if (service != null)\n {\n info.ungetService(bundle, service);\n }\n }",
"public void removeNPTListener(NPTListener l) {}",
"public void removeChatListener(ChatListener listener){\r\n super.removeChatListener(listener);\r\n\r\n if (listenerList.getListenerCount(ChatListener.class) == 0){\r\n setDGState(Datagram.DG_PERSONAL_TELL, false);\r\n setDGState(Datagram.DG_PERSONAL_QTELL, false);\r\n setDGState(Datagram.DG_SHOUT, false);\r\n setDGState(Datagram.DG_CHANNEL_TELL, false);\r\n setDGState(Datagram.DG_CHANNEL_QTELL, true);\r\n setDGState(Datagram.DG_KIBITZ, false);\r\n }\r\n }",
"boolean removeConnectionListener(LWSConnectionListener lis);",
"@Override\n public void removeNotify()\n {\n unregisterListeners();\n super.removeNotify();\n }",
"@Override\n\tpublic void removeAllListener() {\n\t\tLog.d(\"HFModuleManager\", \"removeAllListener\");\n\t\tthis.eventListenerList.clear();\n\t}",
"void removeListener( ConfigurationListener listener );",
"public void removeSocketNodeEventListener(\n final SocketNodeEventListener l) {\n listenerList.remove(l);\n }",
"public synchronized void removeValueChangedListener(ValueChangedListener listener) {\n\t\tif (listeners != null && listeners.length > 0) {\n\t\t\tValueChangedListener[] tmp = new ValueChangedListener[listeners.length - 1];\n\t\t\tint idx = 0;\n\t\t\tfor (int i = 0; i < listeners.length; i++) {\n\t\t\t\tif (listeners[i] != listener) {\n\t\t\t\t\tif (idx == tmp.length) {\n\t\t\t\t\t\t// the listener was not registerd\n\t\t\t\t\t\treturn; // early exit\n\t\t\t\t\t}\n\t\t\t\t\ttmp[idx++] = listeners[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tlisteners = tmp;\n\t\t}\n\t}",
"@Override\n\tpublic void removeStateListener(MemcachedClientStateListener arg0) {\n\n\t}",
"public void removeEventListener(OneToOneChatListener listener) throws RcsServiceException {\n\t\tif (api != null) {\n\t\t\ttry {\n\t\t\t\tapi.removeEventListener2(listener);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RcsServiceException(e.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new RcsServiceNotAvailableException();\n\t\t}\n\t}",
"@Override\n public void onDataChange(DataSnapshot snapshot) {\n Log.d(\"readChatRoomsOnce\" , \"before onDataChange \");\n RoomsSnapshot = snapshot;\n Log.d(\"readChatRoomsOnce\" , \"after onDataChange \");\n ref.removeEventListener(this);\n }",
"public void detachListener()\n {\n m_localInstance.detachListener();\n }",
"@Override\n\tpublic void removeValueChangeListener(final ValueChangeListener<T> listener) {\n\t\t\n\t}",
"@Override\n\tpublic void removeListDataListener(ListDataListener arg0) {\n\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}",
"public synchronized void removePermanentHandler(Listener listener) {\n permanentEventMethodCache.remove(listener);\n }",
"@Override\r\n\tpublic void removeHandlerListener(IHandlerListener handlerListener) {\n\r\n\t}",
"void removeListener(MapDelegateEventListener<K, V> listener);",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\r\n\t\tchangeNotifier.removeListener(notifyChangedListener);\r\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\r\n\t\tchangeNotifier.removeListener(notifyChangedListener);\r\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\r\n\t\tchangeNotifier.removeListener(notifyChangedListener);\r\n\t}",
"public void removeListener(INotifyChangedListener notifyChangedListener) {\r\n\t\tchangeNotifier.removeListener(notifyChangedListener);\r\n\t}",
"@Override\r\n public void unregister(L listener) {\r\n synchronized (listeners) {\r\n listeners.remove(listener);\r\n weak.remove(listener);\r\n }\r\n }",
"public void removeListener(LineListener listener) {\n\t\tplayer.removeListeners(listener);\n\t}",
"public synchronized void clearNetworkListener() {\r\n\t\tlistener.clear();\r\n\t}"
] | [
"0.7465077",
"0.70285386",
"0.6948892",
"0.68024737",
"0.67392427",
"0.6635504",
"0.65044373",
"0.64583814",
"0.64374906",
"0.64374906",
"0.6433578",
"0.6419172",
"0.64183813",
"0.63803643",
"0.6377473",
"0.6372672",
"0.6344345",
"0.63418436",
"0.6338402",
"0.63346493",
"0.6314464",
"0.6296234",
"0.62873834",
"0.6287018",
"0.62848777",
"0.62481934",
"0.62404054",
"0.62339175",
"0.62040275",
"0.6191702",
"0.6190633",
"0.6185076",
"0.6185076",
"0.618178",
"0.6176023",
"0.6140352",
"0.61375225",
"0.6126888",
"0.61206335",
"0.61177754",
"0.61170167",
"0.6116026",
"0.6113903",
"0.6107127",
"0.61053807",
"0.6104363",
"0.6097619",
"0.6092549",
"0.6081462",
"0.60738814",
"0.6071951",
"0.6071287",
"0.60703343",
"0.60636497",
"0.6047872",
"0.6047205",
"0.60382766",
"0.6034113",
"0.60195094",
"0.60162354",
"0.6015545",
"0.6006468",
"0.5996519",
"0.5995683",
"0.59806705",
"0.5974086",
"0.5969736",
"0.59682685",
"0.5966373",
"0.5964476",
"0.5963556",
"0.59545165",
"0.59496814",
"0.59491813",
"0.5946741",
"0.5942309",
"0.5936701",
"0.59346694",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5932657",
"0.5930265",
"0.5930106",
"0.59252864",
"0.5921975",
"0.5921975",
"0.5921975",
"0.5921975",
"0.59160626",
"0.5912982",
"0.59043026"
] | 0.0 | -1 |
Fire a Data ChangedEvent to all registered listeners | @SuppressWarnings("unchecked")
protected void fireClientChanged(Object source, ClientType type, ClientEventType eventType, Object eventObject)
{
// if we have no listeners, do nothing...
if (listeners != null && !listeners.isEmpty())
{
// create the event object to send
ClientEvent event = new ClientEvent(source, type, eventType, eventObject);
// make a copy of the listener list in case anyone adds/removes listeners
ArrayList<ClientListener> targets;
synchronized (this) { targets = (ArrayList<ClientListener>) listeners.clone(); }
// walk through the cloned listener list and call the dataChanged method in each
for(ClientListener l:targets)
l.clientChanged(event);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onDataChanged()\n\t{\n\t\tfor (DataChangedCallbacks listener : this.dataChangedListeners)\n\t\t{\n\t\t\tlistener.onDataChanged();\n\t\t}\n\t}",
"private void notifyListeners(boolean dataChanged) {\n for (OnDataChangedListener listener : dataChangedListeners) {\n listener.onDataChanged(dataChanged);\n }\n }",
"public void dataChanged(DataChangeEvent e) {\n\t\t\t}",
"public void dataChanged() {\n\t\tif (wijzigInfo)\n\t\t\twijzigInfo();\n\n\t\tsetChanged();\n\t\tnotifyObservers(\"dataChanged\");\n\t}",
"public void onDataChanged(){}",
"public void onDataChanged();",
"void onDataChanged();",
"public void dataUpdateEvent();",
"public void onDataChanged(IData data) {\r\n\t this.data = data;\r\n\t repaint();\r\n\t}",
"public void onDataChanged(IData data) {\r\n setData(data);\r\n }",
"protected void fireContentsChanged() {\r\n\t// Guaranteed to return a non-null array\r\n\tObject[] listeners = listenerList.getListenerList();\r\n\tListDataEvent e = null;\r\n\t// Process the listeners last to first, notifying\r\n\t// those that are interested in this event\r\n\tfor (int i = listeners.length-2; i>=0; i-=2) {\r\n\t if (listeners[i]==ListDataListener.class) {\r\n\t\t// Lazily create the event:\r\n\t\tif (e == null) {\r\n\t\t e = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED,\r\n\t\t\t\t\t 0, getSize()-1);\r\n\t\t}\r\n\t\t((ListDataListener)listeners[i+1]).contentsChanged(e);\r\n\t }\r\n\t}\r\n }",
"public void notifyListeners() {\n Logger logger = LogX;\n logger.d(\"notifyListeners: \" + this.mListeners.size(), false);\n List<IWalletCardBaseInfo> tmpCardInfo = getCardInfo();\n Iterator<OnDataReadyListener> it = this.mListeners.iterator();\n while (it.hasNext()) {\n it.next().refreshData(tmpCardInfo);\n }\n }",
"public void onDataChanged(IData data) {\r\n\tthis.canvas.onDataChanged(data);\r\n }",
"@Override\n public void onDataChanged() {\n\n }",
"protected void fireDateChanged() {\n\t\tfor(ReadingPointListener l : listeners) l.dateChanged(this);\n\t}",
"@Override\n public void onDataChanged() {\n }",
"@Override\n public void onDataChanged() {\n }",
"protected void notifyChangeListeners() { \n Utilities.invokeLater(new Runnable() {\n public void run() { for(ChangeListener l: _changeListeners) l.apply(this); }\n });\n }",
"private void notifyEventListListeners() {\n this.eventListListeners.forEach(listener -> listener.onEventListChange(this.getEventList()));\n }",
"@Override\n public void onDataChanged(DataEventBuffer dataEvents) {\n // Not used\n }",
"private void notifyListeners() {\n\t\tfor(ModelListener l:listeners) {\n\t\t\tl.update();\t// Tell the listener that something changed\n\t\t}\n\t}",
"@Override\n protected void onDataChanged() {\n }",
"protected void fireNameChanged() {\n\t\tfor(ReadingPointListener l : listeners) l.nameChanged(this);\n\t}",
"public void dataChanged() {\n // get latest data\n runs = getLatestRuns();\n wickets = getLatestWickets();\n overs = getLatestOvers();\n\n currentScoreDisplay.update(runs, wickets, overs);\n averageScoreDisplay.update(runs, wickets, overs);\n }",
"interface DataListener\n{\n\tpublic void DataChanged(MDSplus.Data data);\n}",
"protected void fireValueChangedEvent(ValueChangedEvent event) {\n\t\tif (listeners != null) {\n\t\t\tfor (int i = 0; i < listeners.length; i++) { \n\t\t\t\tlisteners[i].valueChanged(event);\n\t\t\t}\n\t\t}\n\t}",
"@DISPID(-2147412072)\n @PropGet\n java.lang.Object ondatasetchanged();",
"protected final void fireChangeEvent() {\n\t\tIterator<ChangeListener> it;\n\t\tsynchronized (listeners) {\n\t\t\tit = new HashSet<ChangeListener>(listeners).iterator();\n\t\t}\n\t\tChangeEvent ev = new ChangeEvent(this);\n\t\twhile (it.hasNext()) {\n\t\t\tit.next().changed(ev);\n\t\t}\n\t}",
"private void notifyListeners() \n\t{\n\t\tSystem.out.println(\"Event Source: Notifying all listeners\");\n\n\t\tfor(IListener listener : listeners)\n\t\t{\n\t\t\tlistener.eventOccured(new Event(this));//passing and object of source\n\t\t}\n\n\t}",
"@Override\n public void onDataChanged(DataEventBuffer dataEventBuffer) {\n for (DataEvent event : dataEventBuffer) {\n if (event.getType() == DataEvent.TYPE_CHANGED) {\n // DataItem changed\n DataItem item = event.getDataItem();\n if (item.getUri().getPath().compareTo(\"/latlnglist\") == 0) {\n\n DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();\n\n Log.d(\"hudwear\", \"new data, sending message to handler\");\n\n Message m = new Message();\n Bundle b = new Bundle();\n b.putDouble(\"latitude\", dataMap.getDouble(\"latitude\"));\n b.putDouble(\"longitude\", dataMap.getDouble(\"longitude\"));\n m.setData(b);\n handler.sendMessage(m);\n }\n\n } else if (event.getType() == DataEvent.TYPE_DELETED) {\n // DataItem deleted\n }\n }\n }",
"public void notifyState() {\n\t\tList<T> alldata = new ArrayList<T>(this.dataMap.values());\t\r\n\t\t// call them with the current data\r\n\t\t// for each observer call them\r\n\t\tfor( ModelEvents<T> observer : this.ObserverList){\r\n\t\t\tobserver.dataState(alldata);\r\n\t\t}\r\n\r\n\t}",
"public void addOnDataChangedListener(OnDataChangedListener listener) {\n dataChangedListeners.add(listener);\n }",
"@Override\n public void eventsChanged() {\n }",
"@DISPID(-2147412072)\n @PropPut\n void ondatasetchanged(\n java.lang.Object rhs);",
"public void update() {\r\n\t\tif (firstRow > maxRows) {\r\n\t\t\tfirstRow = maxRows;\r\n\t\t\tfromRowField.setText(firstRow + \"\");\r\n\t\t}\r\n\t\tif (lastRow > maxRows) {\r\n\t\t\tlastRow = maxRows;\r\n\t\t\ttoRowField.setText(lastRow + \"\");\r\n\t\t}\r\n\t\tif (firstColumn > maxColumns) {\r\n\t\t\tfirstColumn = maxColumns;\r\n\t\t\tfromColumnField.setText(firstColumn + \"\");\r\n\t\t}\r\n\t\tif (lastColumn > maxColumns) {\r\n\t\t\tlastColumn = maxColumns;\r\n\t\t\ttoColumnField.setText(lastColumn + \"\");\r\n\t\t}\r\n\r\n\t\tIterator i = listeners.iterator();\r\n\t\twhile (i.hasNext()) {\r\n\t\t\t((DataControlListener) i.next()).update(firstRow, lastRow, firstColumn, lastColumn, fractionDigits);\r\n\t\t}\r\n\t}",
"@Override\n public void onDataChanged(DataEventBuffer dataEvents) {\n\n Log.i(TAG, \"onDataChanged()\");\n\n for (DataEvent dataEvent : dataEvents) {\n if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {\n DataItem dataItem = dataEvent.getDataItem();\n Uri uri = dataItem.getUri();\n String path = uri.getPath();\n\n if (path.startsWith(\"/sensors/\")) {\n if (SmartWatch.getInstance() != null) {\n SmartWatch.getInstance().unpackSensorData(DataMapItem.fromDataItem(dataItem).getDataMap());\n }\n }\n }\n }\n }",
"private void notifyListeners() {\n IDisplayPaneContainer container = (IDisplayPaneContainer) activeEditorMap\n .get(currentWindow);\n for (IVizEditorChangedListener listener : changeListeners) {\n listener.editorChanged(container);\n }\n }",
"public static interface DataChangeObserver {\n /**\n * Called when data has been changed.\n */\n void onDataChanged();\n /**\n * Called when data has been cleared.\n */\n void onDataCleared();\n /**\n * Called when usage reports can be reported to local indexing service.\n */\n void startReportingTask();\n /**\n * Called when usage reports can't be reported to local indexing service any more.\n */\n void stopReportingTask();\n }",
"public static void fire() {\n\t\tILocalizationListener[] array = listeners.toArray(new ILocalizationListener[listeners.size()]);\n\t\tfor(ILocalizationListener l : array) {\n\t\t\tl.localizationChanged();\n\t\t}\n\t}",
"@Override\n public void datasetChanged(DatasetChangeEvent event) {\n this.lastEvent = event;\n }",
"protected void onDataChanged(V item) {\n\n }",
"public void dataSetChanged() {\n\n\t\tif (!isPackValid())\n\t\t\treturn;\n\n\t\t// update charts:\n\t\tupdateCharts();\n\n\t}",
"private static void fireMazeChanged() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.mazeChanged(currentMaze);\r\n\t\t}\r\n\t}",
"private void fireChangeInternal(ChangeEvent event) {\n assert event != null;\n for (ChangeListener listener : listeners) {\n try {\n listener.stateChanged(event);\n } catch (RuntimeException x) {\n Exceptions.printStackTrace(x);\n }\n }\n }",
"void firePropertyChange() {\n java.util.Vector targets;\n synchronized (this) {\n if (listeners == null) {\n return;\n }\n targets = (java.util.Vector) listeners.clone();\n }\n\n PropertyChangeEvent evt = new PropertyChangeEvent(this, null, null, null);\n\n for (int i = 0; i < targets.size(); i++) {\n PropertyChangeListener target = (PropertyChangeListener)targets.elementAt(i);\n target.propertyChange(evt);\n }\n }",
"protected final void notifyContentChanged() {\n // notify all listeners (including parents)\n for (DialogModuleChangeListener listener : listeners) {\n listener.onContentChanged();\n }\n }",
"@Override\r\n\tpublic void valuesChanged() {\r\n\t}",
"@Override\n public void notifyObservers() {\n for (Observer observer : observers){\n // observers will pull the data from the observer when notified\n observer.update(this, null);\n }\n }",
"public void notifyListeners() {\n Handler handler = new Handler(Looper.getMainLooper()); // TODO reuse\n // handler\n Runnable runnable = new Runnable() {\n\n @Override\n public void run() {\n synchronized (listeners) {\n for (IContentRequester requester : listeners) {\n requester.contentChanged(Content.this);\n }\n }\n }\n };\n boolean success = handler.post(runnable);\n if (success) {\n // Log.d(TAG,\n // \"Posted notification for all listeners from \"+this.toString()+\" to \"+listeners.size()+\" listeners.\");\n Log.d(TAG, \"Posted notification for all listeners from content id \"\n + id + \" to \" + listeners.size() + \" listeners.\");\n } else {\n Log.e(TAG, \"Failed to post notification for all listeners\");\n }\n }",
"@Override\n\tpublic void notifyObserver() {\n\t\tEnumeration<ObserverListener> enumd = vector.elements();\n\t\twhile (enumd.hasMoreElements()) {\n\t\t\tObserverListener observerListener = enumd\n\t\t\t\t\t.nextElement();\n\t\t\tobserverListener.observer();\n\t\t\tobserverListener.obsupdata();\n\t\t}\n\t}",
"protected boolean isDataChanged() {\n\n\t\treturn true;\n\t}",
"protected void fireStateChanged(){\n Object[] listeners=listenerList.getListenerList();\n // Process the listeners last to first, notifying\n // those that are interested in this event\n for(int i=listeners.length-2;i>=0;i-=2){\n if(listeners[i]==ChangeListener.class){\n // Lazily create the event:\n if(changeEvent==null)\n changeEvent=new ChangeEvent(this);\n ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);\n }\n }\n }",
"public interface OnDataChangedListener<T> {\n\tvoid onDataChanged(List<T> list);\n}",
"private static void informListeners() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.classListChanged( );\r\n\t\t}\r\n\t}",
"final void fireListeners(){\n /// Fire target edited listeners\n if (editedTarget){\n fire(spanEditedListeners);\n editedTarget = false;\n }\n\n /// Fire child edited listeners\n if (editedChild){\n fire(childEditedListeners);\n editedChild = false;\n }\n\n /// Fire doc edited listeners\n fire(docEditedListeners);\n\n /// Recusive call\n for (Span span: this){\n if (span instanceof SpanNode){\n ((SpanNode<?>)span).fireListeners();\n }\n }\n }",
"@Override\n\t\t\t\tpublic void allRowsChanged() {\n\n\t\t\t\t}",
"protected void fireChange() {\n\t\tActionListener[] actionListenerArray = actionListeners.toArray(new ActionListener[0]);\n\t\tfor (int i = 0; i < actionListenerArray.length; i++) {\n\t\t\tActionListener listener = actionListenerArray[i];\n\t\t\tlistener.onActionChanged(this);\n\t\t}\n\t}",
"public void fireModelChanged() {\n if (enabled)\n for (IInifileChangeListener listener : getListeners())\n listener.modelChanged();\n }",
"@Override\n public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {\n final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction();\n LOG.debug(\"Received data change to ApplicationRib {}\", changes);\n for (final DataTreeCandidate tc : changes) {\n LOG.debug(\"Modification Type {}\", tc.getRootNode().getModificationType());\n final YangInstanceIdentifier path = tc.getRootPath();\n final PathArgument lastArg = path.getLastPathArgument();\n Verify.verify(lastArg instanceof NodeIdentifierWithPredicates, \"Unexpected type %s in path %s\", lastArg.getClass(), path);\n final NodeIdentifierWithPredicates tableKey = (NodeIdentifierWithPredicates) lastArg;\n for (final DataTreeCandidateNode child : tc.getRootNode().getChildNodes()) {\n final YangInstanceIdentifier tableId = this.adjRibsInId.node(tableKey).node(child.getIdentifier());\n if (child.getDataAfter().isPresent()) {\n LOG.trace(\"App peer -> AdjRibsIn path : {}\", tableId);\n LOG.trace(\"App peer -> AdjRibsIn data : {}\", child.getDataAfter().get());\n tx.put(LogicalDatastoreType.OPERATIONAL, tableId, child.getDataAfter().get());\n }\n }\n }\n tx.submit();\n }",
"protected void notifyModificationListeners() {\r\n\t\tfor (ElementModificationListener l : modificationListeners) {\r\n\t\t\tl.elementModified(current);\r\n\t\t}\r\n\t}",
"private static void fireListChanged(Object tag)\n {\n // if (DEBUG.Enabled) Log.info(\"fireListChanged: \" + Util.tags(tag));\n \n // if (disableEvents)\n // return;\n // for (MetadataListListener mdl : listeners) {\n // try {\n // mdl.listChanged();\n // } catch (Throwable t) {\n // Log.warn(\"listener update: \" + Util.tags(mdl), t);\n // }\n // }\n }",
"public void fireStateChanged() {\r\n Object[] listeners = listenerList.getListenerList();\r\n for (int i = listeners.length - 2; i >= 0; i -= 2) {\r\n if (listeners[i] == ChangeListener.class) {\r\n if (changeEvent == null) {\r\n return;\r\n }\r\n ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);\r\n }\r\n }\r\n }",
"public void updateDate() {\n for (ChangeListener l : listeners) {\n l.stateChanged(new ChangeEvent(this));\n }\n }",
"public void fireTableChanged(TableModelEvent e) {\n\t\t\tObject[] listeners = listenerList.getListenerList();\r\n\t\t\t// Process the listeners last to first, notifying\r\n\t\t\t// those that are interested in this event\r\n\t\t\tfor (int i = listeners.length-2; i>=0; i-=2) {\r\n\t\t\t\tif (listeners[i]==TableModelListener.class) {\r\n\t\t\t\t\t((TableModelListener)listeners[i+1]).tableChanged(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public void fireTableChanged(TableModelEvent e) {\n\t\t\tObject[] listeners = listenerList.getListenerList();\r\n\t\t\t// Process the listeners last to first, notifying\r\n\t\t\t// those that are interested in this event\r\n\t\t\tfor (int i = listeners.length-2; i>=0; i-=2) {\r\n\t\t\t\tif (listeners[i]==TableModelListener.class) {\r\n\t\t\t\t\t((TableModelListener)listeners[i+1]).tableChanged(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"private void notifyListenerError(VolleyError error) {\n for (OnDataChangedListener listener : dataChangedListeners) {\n listener.onDataError(error);\n }\n }",
"protected void fireStateChanged() {\r\n Object[] listeners = listenerList.getListenerList();\r\n for (int i = listeners.length - 2; i >= 0; i -= 2) {\r\n if (listeners[i] == ChangeListener.class) {\r\n if (changeEvent == null) {\r\n changeEvent = new ChangeEvent(this);\r\n }\r\n ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);\r\n }\r\n }\r\n }",
"protected void fireStateChanged ()\n {\n Object[] listeners = listenerList.getListenerList();\n ChangeEvent event = null;\n for (int ii = listeners.length - 2; ii >= 0; ii -= 2) {\n if (listeners[ii] == ChangeListener.class) {\n if (event == null) {\n event = new ChangeEvent(this);\n }\n ((ChangeListener)listeners[ii + 1]).stateChanged(event);\n }\n }\n }",
"private void fireNodeChangedNow( EventListenerList list, ChangeEvent e )\n {\n Object[] listeners = list.getListenerList();\n\n // Process the listeners last to first,\n // notifying those that are interested in this event\n for( int i = listeners.length - 2; i >= 0; i -= 2 )\n {\n if( listeners[i] == ChangeListener.class )\n {\n ((ChangeListener)listeners[i + 1]).stateChanged( e );\n }\n }\n }",
"protected void fireStateChanged() \r\n {\r\n Object[] listeners = listenerList.getListenerList();\r\n for (int i = listeners.length - 2; i >= 0; i -=2 ) {\r\n if (listeners[i] == ChangeListener.class) {\r\n if (changeEvent == null) {\r\n changeEvent = new ChangeEvent(this);\r\n }\r\n ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);\r\n } \r\n }\r\n }",
"public synchronized void fireStateChanged() {\n Object[] listeners = listenerList.getListenerList();\n for (int i = listeners.length - 2; i >= 0; i -= 2)\n if (listeners[i] == ChangeListener.class) {\n if (changeEvent == null)\n return;\n ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);\n }\n }",
"public void notifyDataSetChanged() {\n viewState.setShouldRefreshEvents(true);\n invalidate();\n }",
"public interface OnDataChangedListener {\n public void onDataChanged(boolean dataChanged);\n\n public void onDataError(VolleyError error);\n }",
"private void fireContentModelModified(final String id, final String xmlData) throws SystemException {\r\n for (final ResourceListener contentModelListener : this.contentModelListeners) {\r\n contentModelListener.resourceModified(id, xmlData);\r\n }\r\n }",
"private void dataFilterChanged() {\n\n\t\t// save prefs:\n\t\tappPrefes.SaveData(\"power_show_power\", mShowPower ? \"on\" : \"off\");\n\t\tappPrefes.SaveData(\"power_show_energy\", mShowEnergy ? \"on\" : \"off\");\n\n\t\t// check data status:\n\t\tif (!isPackValid())\n\t\t\treturn;\n\n\t\t// update charts:\n\t\tupdateCharts();\n\n\t\t// sync viewports:\n\t\tchartCoupler.syncCharts();\n\t}",
"private void notifyComboBoxModelChange(int index0, int index1)\n {\n for(ListDataListener l : comboBoxModelListDataListeners)\n l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, index0, index1));\n }",
"protected void fireStateChanged() {\n Object[] listeners = changeListeners.getListenerList();\n // Process teh listeners last to first, notifying those that are\n // interested in this event.\n for (int i = listeners.length - 2; i >= 0; i -= 2) {\n if (listeners[i] == ChangeListener.class) {\n if (changeEvent == null) {\n changeEvent = new ChangeEvent(this);\n ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);\n }\n }\n }\n }",
"public abstract void allRowsChanged();",
"protected void notifyDirty() {\n Event evt = new Event();\n evt.item = this;\n evt.widget = this;\n SelectionEvent event = new SelectionEvent(evt);\n for (SelectionListener listener : dirtyListener) {\n listener.widgetSelected(event);\n }\n }",
"protected void fireZoomChanged() {\n\tIterator iter = listeners.iterator();\n\twhile (iter.hasNext())\n\t\t((ZoomListener)iter.next()).zoomChanged(zoom);\n}",
"private void fireGameBoardChanged() {\n\t\tfor (int i = 0; i < gameBoardListeners.size(); i++) {\n\t\t\tGameBoardListener listener = (GameBoardListener) gameBoardListeners.get(i);\n\t\t\tlistener.gameBoardChanged(this);\n\t\t}\n\t}",
"protected void fireStateChanged() {\n if (listenerList != null) {\n // Guaranteed to return a non-null array\n Object[] listeners = listenerList.getListenerList();\n // Process the listeners last to first, notifying\n // those that are interested in this event\n for (int i = listeners.length - 2; i >= 0; i -= 2) {\n if (listeners[i] == ChangeListener.class) {\n // Lazily create the event:\n if (changeEvent == null) {\n changeEvent = new ChangeEvent(this);\n }\n ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);\n }\n }\n }\n }",
"private void notifyObservors() {\n this.obervors.forEach(Obervor::modelChanged);\n }",
"@Override\n public void handleDataChange(String dataPath, Object data) throws Exception\n {\n System.out.println(\"TestZKPropertyStore.testZKPropertyStore().new IZkDataListener() {...}.handleDataChange()\");\n }",
"public void alert(){\n\t\tfor (ChangeListener l : listeners) {\n\t\t\tl.stateChanged(new ChangeEvent(this));\n\t\t}\n\t}",
"private void firePageChangedEvent() {\r\n\t\tfor (PaginatorListener listener : listeners) {\r\n\t\t\tlistener.pageChanged(new PageChangedEvent(this, page, getStartIndex(), getTotalPages(), pageSize));\r\n\t\t}\r\n\t}",
"void addDataCollectionListener(DataCollectionListener l);",
"@Override\n\t\tpublic void onChange(boolean selfChange) {\n\t\t\tmHandler.sendEmptyMessage(1);\n\t\t\tLog.i(\"message\", \"dataChange\");\n\t\t\tsuper.onChange(selfChange);\n\t\t}",
"protected void updateAll() {\n for (String key : listenerMap.keySet()) {\n updateValueForKey(key, true);\n }\n }",
"private void firePlotListChanged() {\n firePlotListChanged(this, null);\n }",
"public void notifyDataSetChanged() {\n generateDataList();\n mSectionedExpandableGridAdapter.notifyDataSetChanged();\n }",
"void changed(DiscoveryEvent e);",
"protected void fireStateChanged(ChangeEvent e) {\n if (changeListeners != null) {\n Vector listeners = changeListeners;\n int count = listeners.size();\n for (int i = 0; i < count; i++) {\n ((ChangeListener) listeners.elementAt(i)).stateChanged(e);\n }\n }\n }",
"private void ObserveAnyChange(){\n movieListViewModel.getMovies().observe(getViewLifecycleOwner(), new Observer<List<MovieModel>>() {\n @Override\n public void onChanged(List<MovieModel> movieModels) {\n\n if (movieModels != null){\n for (MovieModel movieModel: movieModels){\n // get data in Log\n Log.v(TAG, \" onChanged: \"+ movieModel.getTitle());\n movieRecyclerAdapter.setmMovieModels(movieModels);\n }\n }\n\n }\n });\n }",
"@Override\n\tpublic synchronized void registerEventListeners() {\n\t\tif (eventListeners != null) // already called\n\t\t\treturn;\n\t\teventListeners = EventListenerManagers.wrap(this);\n\t\tSelectionUpdateListener selectionUpdateListener = new SelectionUpdateListener();\n\t\tselectionUpdateListener.setHandler(this);\n\t\teventListeners.register(SelectionUpdateEvent.class, selectionUpdateListener);\n\n\t\tSelectionCommandListener selectionCommandListener = new SelectionCommandListener();\n\t\tselectionCommandListener.setHandler(this);\n\t\t// selectionCommandListener.setDataDomainID(dataDomain.getDataDomainID());\n\t\teventListeners.register(SelectionCommandEvent.class, selectionCommandListener);\n\n\t\tsuper.registerEventListeners();\n\n\n\t}",
"protected void fireChangeEvent() {\n\t\tfireEvent(new DebugEvent(this, DebugEvent.CHANGE));\n\t}",
"@Override\n\t\t\tpublic void changedUpdate(DocumentEvent arg0) {\n\t\t\t}",
"protected void notifyListeners(int weekDay, int segment) {\r\n\t\tfor(ScheduleChangeListener listener : listeners)\r\n\t\t\tlistener.scheduleChanged(weekDay, segment);\r\n\t}",
"public void setData(List<Event> data) {\n this.data = data;\n }",
"private void notifyListeners(RestState state) {\n\t\tfor (RestStateChangeListener l : listener) {\n\t\t\tl.onStateChangedEvent(state);\n\t\t}\n\t}",
"private void initListeners() {\n comboBox.comboBoxListener(this::showProgramData);\n view.refreshListener(actionEvent -> scheduledUpdate());\n\n }"
] | [
"0.8675861",
"0.7897095",
"0.7539681",
"0.74556226",
"0.743743",
"0.73405516",
"0.7271131",
"0.7008677",
"0.7001084",
"0.70006996",
"0.68570274",
"0.6847702",
"0.6833005",
"0.6810228",
"0.6802605",
"0.67710334",
"0.67710334",
"0.67303324",
"0.66985244",
"0.6686289",
"0.6683937",
"0.65730065",
"0.645979",
"0.6424606",
"0.6410722",
"0.64010197",
"0.6399758",
"0.6389129",
"0.63815206",
"0.63472086",
"0.63258237",
"0.6295872",
"0.6288122",
"0.62800837",
"0.62586355",
"0.6254834",
"0.62290215",
"0.6226107",
"0.62107545",
"0.61979306",
"0.61948735",
"0.61865914",
"0.6177563",
"0.61623365",
"0.6155197",
"0.6131627",
"0.6113733",
"0.609439",
"0.6076669",
"0.6074576",
"0.6067586",
"0.6050844",
"0.60358983",
"0.6018853",
"0.6018782",
"0.60139555",
"0.60009396",
"0.59900254",
"0.59713805",
"0.5970233",
"0.59567326",
"0.59565216",
"0.59518117",
"0.594387",
"0.594387",
"0.5942185",
"0.594097",
"0.59344083",
"0.5925205",
"0.592361",
"0.591678",
"0.5913574",
"0.5911479",
"0.58906007",
"0.58723426",
"0.58621144",
"0.5861129",
"0.58516955",
"0.58299243",
"0.582332",
"0.5821946",
"0.580469",
"0.57985103",
"0.57939893",
"0.5790799",
"0.57822853",
"0.5776383",
"0.5772273",
"0.57685673",
"0.5764682",
"0.5762993",
"0.57594144",
"0.57538474",
"0.5752028",
"0.57515824",
"0.57441974",
"0.573416",
"0.5730201",
"0.57209766",
"0.5717054",
"0.5712115"
] | 0.0 | -1 |
May need to convert trailer to trailer DTO | public List<Trailer> getAllTrailers(){
return trailerDAO.getAllTrailers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public IRecord procTrailer(IRecord r) {\n return r;\n }",
"@Override\n public IRecord procTrailer(IRecord r)\n {\n return r;\n }",
"protected HeaderGroup getResponseTrailerHeaderGroup() {\n return responseTrailerHeaders;\n }",
"private void parseTrailer()\n throws IOException {\n\n // make sure we have enough room to read the two trailer lines\n System.arraycopy(encoded, current, encoded, 0, nEncoded - current);\n nEncoded -= current;\n\n // read the two trailer lines\n int eol1Index = -1, eol2Index = -1;\n while (eol2Index < 0) {\n for (int i = eol1Index + 1; (eol2Index < 0) && (i < nEncoded); ++i) {\n if (encoded[i] == '\\n') {\n if (eol1Index < 0) {\n eol1Index = i;\n } else {\n eol2Index = i;\n }\n }\n }\n\n if (eol2Index < 0) {\n // we need more characters\n if (readEncodedBytes() < 0) {\n throw new IOException(\"missing uuencode trailer\");\n }\n }\n\n }\n\n // check the trailer\n current = 1;\n while ((current < eol1Index)\n && Character.isWhitespace((char) encoded[current])) {\n ++current;\n }\n if (current++ == eol1Index) {\n while ((current < eol2Index)\n && Character.isWhitespace((char) encoded[current])) {\n ++current;\n }\n if (((current + 2) < eol2Index) && (encoded[current] == 'e')\n && (encoded[current + 1] == 'n') && (encoded[current + 2] == 'd')) {\n current += 3; \n while ((current < eol2Index)\n && Character.isWhitespace((char) encoded[current])) {\n ++current;\n }\n if (current == eol2Index) {\n // the trailer is correct\n endReached = true;\n return;\n }\n }\n }\n\n throw new IOException(\"malformed uuencode trailer\");\n\n }",
"public void trailerRecord(RecordInput recordInput) {\n }",
"@SuppressWarnings(\"unchecked\")\n\t@Cacheable(value=API_TRAILERS, key=\"{#type, #id}\")\n public List<ApiTrailerDTO> getTrailersForMetadata(MetaDataType type, Long id) {\n return currentSession().getNamedQuery(\"metadata.trailer.\"+type.name().toLowerCase()).setParameter(LITERAL_ID, id).list();\n }",
"@Override\n\tpublic TrailerData read()\n\t\t\tthrows Exception, UnexpectedInputException, ParseException, NonTransientResourceException {\n\t\tif(trailerData.isFinished())\n\t\t\treturn null;\n\t\ttrailerData.setFinished(Boolean.TRUE);\n\t\treturn trailerData;\n\t}",
"private LegResponse convertLegDTOtoLegResponse(LegDTO legDTO, SkyScannerDTO skyscannerDTO)\n {\n if (legDTO == null) {\n return null;\n }\n LegResponse legResponse = new LegResponse();\n // Origin and Destination are Ids in the response,\n //so get all places, find the wanted by id and get only the name.\n legResponse.setOrigin(\n skyscannerDTO.getPlaces().stream().filter(x -> x.getPlaceId().equals(legDTO.getOriginId())).findFirst().orElse(new PlacesDTO()).getName());\n\n legResponse.setDestination(\n skyscannerDTO.getPlaces().stream().filter(x -> x.getPlaceId().equals(legDTO.getDestinationId())).findFirst().orElse(new PlacesDTO()).getName());\n\n legResponse.setDepartureDate(legDTO.getDepartureDate());\n //Carriers are Ids in the response,\n //so get all carriers, find by ids and add them to list.\n legResponse.setCarriers(getCarrierNames(skyscannerDTO.getCarriers(), legDTO));\n\n return legResponse;\n }",
"public Trailer(JSONObject jsonTrailer) throws JSONException {\n\n if(jsonTrailer.has(ID_KEY)) {\n id = jsonTrailer.getString(ID_KEY);\n }\n\n if(jsonTrailer.has(KEY_KEY)) {\n key = jsonTrailer.getString(KEY_KEY);\n }\n\n if(jsonTrailer.has(NAME_KEY)) {\n name = jsonTrailer.getString(NAME_KEY);\n }\n\n if(jsonTrailer.has(SITE_KEY)) {\n site = jsonTrailer.getString(SITE_KEY);\n }\n\n if(jsonTrailer.has(TYPE_KEY)) {\n type = jsonTrailer.getString(TYPE_KEY);\n }\n }",
"protected abstract void processDTO();",
"private static HotelResponseDTO makeHotelResponseDTO(Hotel hotel) {\n HotelResponseDTO hotelResponse = new HotelResponseDTO();\n hotelResponse.setHotelId(hotel.getHotelId());\n hotelResponse.setName(hotel.getName());\n hotelResponse.setDescription(hotel.getDescription());\n hotelResponse.setLocation(hotel.getLocation());\n hotelResponse.setDefaultCheckInTime(hotel.getDefaultCheckInTime());\n hotelResponse.setDefaultCheckOutTime(hotel.getDefaultCheckOutTime());\n if (hotel.getFacilities() != null) {\n hotelResponse.setFacilities(Arrays.asList(hotel.getFacilities().split(\",\")));\n }\n if (hotel.getRooms() != null && hotel.getRooms().size() > 0) {\n List<RoomResponseDTO> roomResponses = hotel.getRooms().stream()\n .filter(room -> !room.isDeleted())\n .map(room -> {\n RoomResponseDTO roomResponse = new RoomResponseDTO();\n roomResponse.setRoomId(room.getRoomId());\n roomResponse.setRoomType(room.getRoomType().getCode());\n roomResponse.setBedType(room.getBedType().getCode());\n roomResponse.setNumberOfAdults(room.getNumberOfAdults());\n roomResponse.setNumberOfChildren(room.getNumberOfChildren());\n roomResponse.setNumberOfRooms(room.getNumberOfRooms());\n roomResponse.setBasicFare(room.getBasicFare());\n roomResponse.setTaxPercentage(room.getTaxPercentage());\n if (room.getFacilities() != null) {\n roomResponse.setFacilities(Arrays.asList(room.getFacilities().split(\",\")));\n }\n return roomResponse;\n }).collect(Collectors.toList());\n hotelResponse.setRooms(roomResponses);\n }\n List<Review> reviews = hotel.getReviews();\n if (reviews != null && reviews.size() > 0) {\n List<ReviewResponseDTO> reviewResponses = reviews.stream()\n .filter(review -> !review.isDeleted())\n .map(review -> {\n ReviewResponseDTO reviewResponse = new ReviewResponseDTO();\n reviewResponse.setReviewId(review.getReviewId());\n reviewResponse.setComment(review.getComment());\n reviewResponse.setRatingValue(review.getRatingValue());\n if (review.getReviewedBy() != null) {\n reviewResponse.setReviewedBy(review.getReviewedBy().getFullName());\n }\n reviewResponse.setReviewedDate(review.getReviewedDate());\n return reviewResponse;\n }).collect(Collectors.toList());\n hotelResponse.setReviews(reviewResponses);\n long ratingCount = reviews.stream().filter(review -> !review.isDeleted()).count();\n double averageRating = reviews.stream()\n .filter(review -> !review.isDeleted())\n .collect(Collectors.summarizingDouble(Review::getRatingValue))\n .getAverage();\n hotelResponse.setRatingCount(ratingCount);\n hotelResponse.setAverageRating(averageRating);\n }\n return hotelResponse;\n }",
"@Override\r\n\tpublic String searchTrailer(String searchTrailer) throws Exception {\n\t\treturn null;\r\n\t}",
"public TransportDTO makeDTO(ResultSet RS) {\n TransportDTO output = null;\n Connection conn = Repository.getInstance().connect();\n OrderDAO OrderDAO = new OrderDAO();\n try {\n String date = RS.getString(2);\n int weight = RS.getInt(1);\n String driverID = RS.getString(5);\n String Truckplate = RS.getString(4);\n int transportID = RS.getInt(3);\n List<OrderDTO> Orders = new ArrayList<OrderDTO>();\n boolean wasDel = RS.getString(6).equals(\"true\");\n ResultSet contractsRS = getWithInt(\"TransportsOrders\", \"TransportID\", transportID,conn);\n while (contractsRS.next()) {\n int OrderID = contractsRS.getInt(1);\n Orders.add(OrderDAO.get(OrderID));\n }\n output = new TransportDTO(date, weight, driverID, Truckplate, Orders, wasDel, transportID);\n } catch (Exception e) {\n output = null;\n }\n finally{\n Repository.getInstance().closeConnection(conn);\n }\n return output;\n }",
"public static Record transform(Record record) {\n String id = record.getId();\n Record target = new Record(MetadataFormat.DC, id);\n target.addField(new DCField(DCTerm.IDENTIFIER, id));\n for (Field field : record.getFields()) {\n String tag = field.getTag();\n if (field.getType() == FieldType.MARC_DATAFIELD) {\n MARCDataField mfield = (MARCDataField) field;\n if (tag.equals(\"100\") || tag.equals(\"110\") || tag.equals(\"111\")) {\n String content = getTextContent(mfield, \"-$0\");\n String dates = getTextContent(mfield, \"$d\").trim()\n .replaceAll(\"[()]\", \"\"); // TODO make test\n String name = getTextContent(mfield, \"$a $b $c\");\n\n if (dates.length() > 0) {\n target.addField(new DCField(DCTerm.CREATOR_DATE, dates));\n target.addField(new DCField(DCTerm.CREATOR, content\n .replace(dates, \"(\" + dates + \")\")));\n } else {\n target.addField(new DCField(DCTerm.CREATOR, content));\n }\n target.addField(new DCField(DCTerm.CREATOR_NAME, name));\n } else if (tag.equals(\"700\") || tag.equals(\"710\")\n || tag.equals(\"711\")) {\n DCTerm dctag = hasSubfield(mfield, \"$e:coaut\") ? DCTerm.CREATOR\n : DCTerm.CONTRIBUTOR;\n String content = getTextContent(mfield, \"-$0\");\n String dates = getTextContent(mfield, \"$d\");\n String name = getTextContent(mfield, \"$a $b $c\");\n if (dates.length() > 0) {\n target.addField(new DCField(DCTerm.CONTRIBUTOR_DATE,\n dates));\n target.addField(new DCField(dctag, content.replace(\n dates, \"(\" + dates + \")\")));\n } else {\n target.addField(new DCField(dctag, content));\n }\n target.addField(new DCField(DCTerm.CONTRIBUTOR_NAME, name));\n } else if (tag.equals(\"511\")) {\n target.addField(new DCField(DCTerm.CONTRIBUTOR,\n getTextContent(mfield, \"$a\")));\n } else if (tag.equals(\"130\") || tag.equals(\"240\")\n || tag.equals(\"245\")) {\n target.addField(new DCField(DCTerm.TITLE, getTextContent(\n mfield, \"$a $b $n $p\")));\n if (tag.equals(\"245\")) { // grabación sonora, manuscrito...\n target.addField(new DCField(DCTerm.TYPE,\n getTextContent(mfield, \"$h\")));\n }\n } else if (tag.equals(\"246\")) {\n target.addField(new DCField(DCTerm.ALTERNATIVE,\n getTextContent(mfield, \"$a $b $n $p\")));\n } else if (tag.equals(\"080\")) {\n target.addField(new DCField(DCTerm.SUBJECT_UDC,\n getTextContent(mfield, \"$a\")));\n } else if (tag.equals(\"600\") || tag.equals(\"650\")\n || tag.equals(\"651\")) {\n target.addField(new DCField(DCTerm.SUBJECT_LCSH,\n getTextContent(mfield, \"$a $x $y $t\", \" - \")));\n target.addField(new DCField(DCTerm.SUBJECT, getTextContent(\n mfield, \"$a $x $y $t\", \" - \")));\n } else if (tag.equals(\"596\")) {\n target.addField(new DCField(DCTerm.DESCRIPTION,\n getTextContent(mfield, \"$a\")));\n } else if (tag.equals(\"260\")) {\n target.addField(new DCField(DCTerm.PUBLISHER,\n getTextContent(mfield, \"$a $b $c\")));\n String publicationDate = getTextContent(mfield, \"$c\");\n if (publicationDate.length() > 0) {\n target.addField(new DCField(DCTerm.ISSUED,\n publicationDate));\n }\n } else if (tag.equals(\"534\")) { // source edition statement\n List<MARCSubfield> subfields = mfield.getSubfields();\n StringBuilder source = new StringBuilder();\n StringBuilder altsource = new StringBuilder(); // alternative\n // source\n boolean alt = false;\n for (MARCSubfield subfield : subfields) {\n if (subfield.getCode() == 'c') {\n Matcher matcher = ypattern.matcher(subfield\n .getValue());\n if (matcher.matches()) {\n String year = matcher.group(3);\n target.addField(new DCField(DCTerm.CREATED,\n year));\n target.addField(new DCField(DCTerm.DATE, year));\n }\n } else if (subfield.getCode() == 'p') {\n if (subfield.getValue().contains(\"otra ed\")) {\n alt = true;\n } else {\n alt = false;\n }\n }\n if (alt) {\n if (altsource.length() > 0) {\n altsource.append(' ');\n }\n altsource.append(subfield.getValue());\n } else {\n if (source.length() > 0) {\n source.append(' ');\n }\n source.append(subfield.getValue());\n }\n }\n if (source.length() > 0) {\n target.addField(new DCField(DCTerm.SOURCE, source\n .toString()));\n }\n if (altsource.length() > 0) {\n target.addField(new DCField(DCTerm.RELATION, altsource\n .toString()));\n }\n } else if (tag.equals(\"901\")\n && hasSubfield((MARCDataField) field,\n \"$a=sourceTypeOriginal_L\")) {\n target.addField(new DCField(DCTerm.FORMAT, getTextContent(\n mfield, \"$b\")));\n } else if (tag.equals(\"020\")) {\n target.addField(new DCField(DCTerm.SOURCE, \"ISBN:\"\n + getTextContent(mfield)));\n } else if (tag.equals(\"022\")) {\n target.addField(new DCField(DCTerm.SOURCE, \"ISSN:\"\n + getTextContent(mfield)));\n } else if (tag.equals(\"041\")) {\n target.addField(new DCField(DCTerm.LANGUAGE,\n getTextContent(mfield)));\n } else if (tag.equals(\"017\")) {\n target.addField(new DCField(DCTerm.RIGHTS,\n getTextContent(mfield)));\n } else if (tag.equals(\"440\") || tag.equals(\"490\")) {\n target.addField(new DCField(DCTerm.IS_PART_OF,\n getTextContent(mfield, \"$a\")));\n } else if (tag.equals(\"655\")) {\n target.addField(new DCField(DCTerm.TYPE,\n getTextContent(mfield)));\n } else if (tag.equals(\"773\")) {\n target.addField(new DCField(DCTerm.RELATION,\n getTextContent(mfield, \"$t\")));\n }\n }\n }\n if (target.getFields(DCTerm.DATE.toString()).isEmpty()) {\n for (Field field : target.getFields(DCTerm.ISSUED.toString())) {\n target.addField(new DCField(DCTerm.DATE, field.getValue()));\n }\n }\n return target;\n }",
"@Override\n\tpublic BaseFWDTOImpl toDTO() {\n\t\treturn null;\n\t}",
"public final PythonParser.trailer_return trailer(Token begin, PythonTree tree) throws RecognitionException {\n PythonParser.trailer_return retval = new PythonParser.trailer_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token LPAREN243=null;\n Token RPAREN245=null;\n Token LBRACK246=null;\n Token RBRACK248=null;\n Token DOT249=null;\n PythonParser.arglist_return arglist244 = null;\n\n PythonParser.subscriptlist_return subscriptlist247 = null;\n\n PythonParser.attr_return attr250 = null;\n\n\n PythonTree LPAREN243_tree=null;\n PythonTree RPAREN245_tree=null;\n PythonTree LBRACK246_tree=null;\n PythonTree RBRACK248_tree=null;\n PythonTree DOT249_tree=null;\n RewriteRuleTokenStream stream_RBRACK=new RewriteRuleTokenStream(adaptor,\"token RBRACK\");\n RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,\"token RPAREN\");\n RewriteRuleTokenStream stream_LBRACK=new RewriteRuleTokenStream(adaptor,\"token LBRACK\");\n RewriteRuleTokenStream stream_DOT=new RewriteRuleTokenStream(adaptor,\"token DOT\");\n RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,\"token LPAREN\");\n RewriteRuleSubtreeStream stream_arglist=new RewriteRuleSubtreeStream(adaptor,\"rule arglist\");\n RewriteRuleSubtreeStream stream_subscriptlist=new RewriteRuleSubtreeStream(adaptor,\"rule subscriptlist\");\n RewriteRuleSubtreeStream stream_attr=new RewriteRuleSubtreeStream(adaptor,\"rule attr\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1452:5: ( LPAREN ( arglist -> ^( LPAREN[$begin, actions.castExpr($tree), actions.castExprs($arglist.args),\\n actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs] ) | -> ^( LPAREN[$begin, actions.castExpr($tree), new ArrayList<expr>(), new ArrayList<keyword>(), null, null] ) ) RPAREN | LBRACK subscriptlist[$begin] RBRACK -> ^( LBRACK[$begin, actions.castExpr($tree), actions.castSlice($subscriptlist.tree), $expr::ctype] ) | DOT attr -> ^( DOT[$begin, actions.castExpr($tree), $attr.text, $expr::ctype] ) )\n int alt119=3;\n switch ( input.LA(1) ) {\n case LPAREN:\n {\n alt119=1;\n }\n break;\n case LBRACK:\n {\n alt119=2;\n }\n break;\n case DOT:\n {\n alt119=3;\n }\n break;\n default:\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 119, 0, input);\n\n throw nvae;\n }\n\n switch (alt119) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1452:7: LPAREN ( arglist -> ^( LPAREN[$begin, actions.castExpr($tree), actions.castExprs($arglist.args),\\n actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs] ) | -> ^( LPAREN[$begin, actions.castExpr($tree), new ArrayList<expr>(), new ArrayList<keyword>(), null, null] ) ) RPAREN\n {\n LPAREN243=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_trailer6578); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN243);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1453:9: ( arglist -> ^( LPAREN[$begin, actions.castExpr($tree), actions.castExprs($arglist.args),\\n actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs] ) | -> ^( LPAREN[$begin, actions.castExpr($tree), new ArrayList<expr>(), new ArrayList<keyword>(), null, null] ) )\n int alt118=2;\n int LA118_0 = input.LA(1);\n\n if ( (LA118_0==NAME||(LA118_0>=LAMBDA && LA118_0<=NOT)||LA118_0==LPAREN||(LA118_0>=STAR && LA118_0<=DOUBLESTAR)||(LA118_0>=PLUS && LA118_0<=MINUS)||(LA118_0>=TILDE && LA118_0<=LBRACK)||LA118_0==LCURLY||(LA118_0>=BACKQUOTE && LA118_0<=STRING)) ) {\n alt118=1;\n }\n else if ( (LA118_0==RPAREN) ) {\n alt118=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 118, 0, input);\n\n throw nvae;\n }\n switch (alt118) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1453:10: arglist\n {\n pushFollow(FOLLOW_arglist_in_trailer6589);\n arglist244=arglist();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_arglist.add(arglist244.getTree());\n\n\n // AST REWRITE\n // elements: LPAREN\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1454:8: -> ^( LPAREN[$begin, actions.castExpr($tree), actions.castExprs($arglist.args),\\n actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1454:11: ^( LPAREN[$begin, actions.castExpr($tree), actions.castExprs($arglist.args),\\n actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Call(LPAREN, begin, actions.castExpr(tree), actions.castExprs((arglist244!=null?arglist244.args:null)), actions.makeKeywords((arglist244!=null?arglist244.keywords:null)), (arglist244!=null?arglist244.starargs:null), (arglist244!=null?arglist244.kwargs:null)), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1457:8: \n {\n\n // AST REWRITE\n // elements: LPAREN\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1457:8: -> ^( LPAREN[$begin, actions.castExpr($tree), new ArrayList<expr>(), new ArrayList<keyword>(), null, null] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1457:11: ^( LPAREN[$begin, actions.castExpr($tree), new ArrayList<expr>(), new ArrayList<keyword>(), null, null] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Call(LPAREN, begin, actions.castExpr(tree), new ArrayList<expr>(), new ArrayList<keyword>(), null, null), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n RPAREN245=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_trailer6651); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN245);\n\n\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1460:7: LBRACK subscriptlist[$begin] RBRACK\n {\n LBRACK246=(Token)match(input,LBRACK,FOLLOW_LBRACK_in_trailer6659); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_LBRACK.add(LBRACK246);\n\n pushFollow(FOLLOW_subscriptlist_in_trailer6661);\n subscriptlist247=subscriptlist(begin);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_subscriptlist.add(subscriptlist247.getTree());\n RBRACK248=(Token)match(input,RBRACK,FOLLOW_RBRACK_in_trailer6664); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_RBRACK.add(RBRACK248);\n\n\n\n // AST REWRITE\n // elements: LBRACK\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1461:4: -> ^( LBRACK[$begin, actions.castExpr($tree), actions.castSlice($subscriptlist.tree), $expr::ctype] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1461:7: ^( LBRACK[$begin, actions.castExpr($tree), actions.castSlice($subscriptlist.tree), $expr::ctype] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Subscript(LBRACK, begin, actions.castExpr(tree), actions.castSlice((subscriptlist247!=null?((PythonTree)subscriptlist247.tree):null)), ((expr_scope)expr_stack.peek()).ctype), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 3 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1462:7: DOT attr\n {\n DOT249=(Token)match(input,DOT,FOLLOW_DOT_in_trailer6685); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_DOT.add(DOT249);\n\n pushFollow(FOLLOW_attr_in_trailer6687);\n attr250=attr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_attr.add(attr250.getTree());\n\n\n // AST REWRITE\n // elements: DOT\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1463:4: -> ^( DOT[$begin, actions.castExpr($tree), $attr.text, $expr::ctype] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1463:7: ^( DOT[$begin, actions.castExpr($tree), $attr.text, $expr::ctype] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Attribute(DOT, begin, actions.castExpr(tree), (attr250!=null?input.toString(attr250.start,attr250.stop):null), ((expr_scope)expr_stack.peek()).ctype), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }",
"List<TicketDTO> ticketToTicketDTO(List<Ticket> all);",
"private static void readTrailers(HttpHeaders trailers, ContextMap ctx) {\n ctx.put(SERVER_FILTER_IN_TRAILER_CTX, trailers.get(header(SERVER_FILTER_IN_TRAILER_CTX)));\n ctx.put(SERVER_TRAILER_CTX, trailers.get(header(SERVER_TRAILER_CTX)));\n ctx.put(SERVER_FILTER_OUT_TRAILER_CTX, trailers.get(header(SERVER_FILTER_OUT_TRAILER_CTX)));\n // Set the last value explicitly:\n ctx.put(CLIENT_FILTER_IN_TRAILER_CTX, value(CLIENT_FILTER_IN_TRAILER_CTX));\n }",
"public interface IVideoUtilDTO {\n\n\t/**\n\t * Gets the videos list.\n\t *\n\t * @param videos the videos\n\t * @return the videos list\n\t * @throws TransferObjectException the transfer object exception\n\t */\n\tList<VideoDTO> getVideosList(List<Video> videos) throws TransferObjectException;\n\n\t/**\n\t * To business.\n\t *\n\t * @param videoDTO the video dto\n\t * @return the video\n\t * @throws TransferObjectException the transfer object exception\n\t */\n\tVideo toBusiness(VideoDTO videoDTO) throws TransferObjectException;\n\n\t/**\n\t * To rest.\n\t *\n\t * @param video the video\n\t * @return the video dto\n\t * @throws TransferObjectException the transfer object exception\n\t */\n\tVideoDTO toRest(Video video) throws TransferObjectException;\n}",
"protected abstract ByteBuffer toMedia(Object object) throws BeanConversionException;",
"private ReservationDTO parseReservation(Reservation reservation) {\n ReservationDTO dto = new ReservationDTO();\n dto.buildFromEntity(reservation);\n return dto;\n }",
"public abstract DTO toDTO(M model);",
"TicketDTO ticketToTicketDTO(Ticket ticket);",
"private List<Trailer> keepOnlyTrailers(List<Trailer> videos) {\n List<Trailer> allTrailers = new ArrayList<>();\n for (Trailer video : videos) {\n if (video.getType().equals(\"Trailer\")) {\n allTrailers.add(video);\n }\n }\n return allTrailers;\n }",
"@Override\n public void readBody(DataInputStreamWrapper l) throws IOException {\n\n ByteBuffer buffer = ByteBuffer.allocate((int)bytesAfterHeader - IDField.getSize());\n\n id = l.readId();\n\n for (int i = 0; i < bytesAfterHeader - IDField.getSize(); i++) {\n buffer.put(l.readByte());\n }\n buffer.position(0);\n content = String.valueOf(StandardCharsets.UTF_8.decode(buffer));\n }",
"AccountDTO toDTO(Account account);",
"public EstructuraContratosTrailersDTO nuevoTrailers() {\n\t\treturn consultaProsperaService.nuevosTrailersProspera();\n\t}",
"private Response buildFinalResponse(PortalResponse portalResponse)\n throws IOException {\n ResponseBuilder finalResponse =\n Response.status(portalResponse.getStatusCode());\n for (Header header : portalResponse.getHeaders()) {\n //TODO: probably want to white list headers instead\n if (!header.getName().equals(HttpHeaders.TRANSFER_ENCODING) &&\n !header.getName().equals(HttpHeaders.VARY)) {\n finalResponse.header(header.getName(), header.getValue());\n }\n }\n finalResponse.entity(portalResponse.getEntity());\n return finalResponse.build();\n }",
"public static Uri buildTrailerWithId(long movieId)\n {\n return ContentUris.withAppendedId(CONTENT_URI, movieId);\n }",
"public ArVideoDto arVideoEntityToDto (ArVideoEntity arvideoEntity) {\n\t\tArVideoDto arvideoDto = mapper.map(arvideoEntity, ArVideoDto.class);\n\t\treturn arvideoDto;\n\t}",
"@SuppressWarnings(\"PMD.CloseResource\") // PMD does not understand Closer.\n private static void serializeToLz4Data(Serializable object, OutputStream out) {\n try (Closer closer = Closer.create()) {\n OutputStream los = closer.register(new LZ4FrameOutputStream(out));\n ObjectOutputStream oos = closer.register(new ObjectOutputStream(los));\n oos.writeObject(object);\n } catch (Throwable e) {\n throw new BatfishException(\"Failed to convert object to LZ4 data\", e);\n }\n }",
"public Object convListToDTO(List list) {\r\n\r\n\t\tObject retDTO = null;\r\n\t\ttry {\r\n\r\n\t\t\tListIterator iterator = list.listIterator();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\r\n\t\t\t\tretDTO = iterator.next();\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t}\r\n\r\n\t\treturn retDTO;\r\n\r\n\t}",
"public RaceDTO mapTo(Race race) {\n\t\tRaceDTO dto = new RaceDTO();\n\t\tdto.setId(race.getId());\n\t\tdto.setName(race.getName());\n\t\tdto.setDate(race.getDate());\n\t\tdto.setTime(race.getTime());\n\t\tList<DriverDTO> drivers = new ArrayList<>();\n\t\t\n\t\tfor(Driver driver : race.getDrivers()) {\n\t\t\tdrivers.add(this.driverMapper.mapTo(driver));\n\t\t}\n\t\tdto.setDrivers(drivers);\n\t\treturn dto;\n\t\t\n\t}",
"ExerciseDTO convertToExerciseDTO(Exercise exercise);",
"FS2ObjectHeaders getHeaders();",
"public com.fasterxml.jackson.databind.ser.BeanPropertyWriter buildWriter(com.fasterxml.jackson.databind.SerializerProvider r15, com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition r16, com.fasterxml.jackson.databind.JavaType r17, com.fasterxml.jackson.databind.JsonSerializer<?> r18, com.fasterxml.jackson.databind.jsontype.TypeSerializer r19, com.fasterxml.jackson.databind.jsontype.TypeSerializer r20, com.fasterxml.jackson.databind.introspect.AnnotatedMember r21, boolean r22) throws com.fasterxml.jackson.databind.JsonMappingException {\n /*\n r14 = this;\n r1 = r14\n r2 = r15\n r4 = r16\n r0 = r20\n r13 = r21\n r3 = 0\n r7 = r17\n r5 = r22\n com.fasterxml.jackson.databind.JavaType r5 = r14.findSerializationType(r13, r5, r7) // Catch:{ JsonMappingException -> 0x0118 }\n if (r0 == 0) goto L_0x0042\n if (r5 != 0) goto L_0x0016\n r5 = r7\n L_0x0016:\n com.fasterxml.jackson.databind.JavaType r6 = r5.getContentType()\n if (r6 != 0) goto L_0x0039\n com.fasterxml.jackson.databind.BeanDescription r6 = r1._beanDesc\n java.lang.StringBuilder r8 = new java.lang.StringBuilder\n r8.<init>()\n java.lang.String r9 = \"serialization type \"\n r8.append(r9)\n r8.append(r5)\n java.lang.String r9 = \" has no content\"\n r8.append(r9)\n java.lang.String r8 = r8.toString()\n java.lang.Object[] r9 = new java.lang.Object[r3]\n r15.reportBadPropertyDefinition(r6, r4, r8, r9)\n L_0x0039:\n com.fasterxml.jackson.databind.JavaType r0 = r5.withContentTypeHandler(r0)\n r0.getContentType()\n r10 = r0\n goto L_0x0043\n L_0x0042:\n r10 = r5\n L_0x0043:\n r5 = 0\n if (r10 != 0) goto L_0x0048\n r0 = r7\n goto L_0x0049\n L_0x0048:\n r0 = r10\n L_0x0049:\n com.fasterxml.jackson.databind.SerializationConfig r6 = r1._config\n java.lang.Class r8 = r0.getRawClass()\n com.fasterxml.jackson.annotation.JsonInclude$Value r9 = r1._defaultInclusion\n com.fasterxml.jackson.annotation.JsonInclude$Value r6 = r6.getDefaultPropertyInclusion(r8, r9)\n com.fasterxml.jackson.annotation.JsonInclude$Value r8 = r16.findInclusion()\n com.fasterxml.jackson.annotation.JsonInclude$Value r6 = r6.withOverrides(r8)\n com.fasterxml.jackson.annotation.JsonInclude$Include r6 = r6.getValueInclusion()\n com.fasterxml.jackson.annotation.JsonInclude$Include r8 = com.fasterxml.jackson.annotation.JsonInclude.Include.USE_DEFAULTS\n if (r6 != r8) goto L_0x0067\n com.fasterxml.jackson.annotation.JsonInclude$Include r6 = com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS\n L_0x0067:\n int[] r8 = com.fasterxml.jackson.databind.ser.PropertyBuilder.C19781.$SwitchMap$com$fasterxml$jackson$annotation$JsonInclude$Include\n int r6 = r6.ordinal()\n r6 = r8[r6]\n r8 = 1\n switch(r6) {\n case 1: goto L_0x0087;\n case 2: goto L_0x007a;\n case 3: goto L_0x0076;\n case 4: goto L_0x00d0;\n default: goto L_0x0073;\n }\n L_0x0073:\n r8 = 0\n goto L_0x00d0\n L_0x0076:\n java.lang.Object r0 = com.fasterxml.jackson.databind.ser.BeanPropertyWriter.MARKER_FOR_EMPTY\n L_0x0078:\n r12 = r0\n goto L_0x0084\n L_0x007a:\n boolean r0 = r0.isReferenceType()\n if (r0 == 0) goto L_0x0083\n java.lang.Object r0 = com.fasterxml.jackson.databind.ser.BeanPropertyWriter.MARKER_FOR_EMPTY\n goto L_0x0078\n L_0x0083:\n r12 = r5\n L_0x0084:\n r11 = 1\n goto L_0x00e6\n L_0x0087:\n boolean r6 = r1._useRealPropertyDefaults\n if (r6 == 0) goto L_0x00b4\n java.lang.Object r6 = r14.getDefaultBean()\n if (r6 == 0) goto L_0x00b4\n com.fasterxml.jackson.databind.MapperFeature r0 = com.fasterxml.jackson.databind.MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS\n boolean r0 = r15.isEnabled(r0)\n if (r0 == 0) goto L_0x00a4\n com.fasterxml.jackson.databind.SerializationConfig r0 = r1._config\n com.fasterxml.jackson.databind.MapperFeature r9 = com.fasterxml.jackson.databind.MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS\n boolean r0 = r0.isEnabled(r9)\n r13.fixAccess(r0)\n L_0x00a4:\n java.lang.Object r0 = r13.getValue(r6) // Catch:{ Exception -> 0x00aa }\n r5 = r0\n goto L_0x00b9\n L_0x00aa:\n r0 = move-exception\n r9 = r0\n java.lang.String r0 = r16.getName()\n r14._throwWrapped(r9, r0, r6)\n goto L_0x00b9\n L_0x00b4:\n java.lang.Object r5 = r14.getDefaultValue(r0)\n r3 = 1\n L_0x00b9:\n if (r5 != 0) goto L_0x00bc\n goto L_0x0083\n L_0x00bc:\n java.lang.Class r0 = r5.getClass()\n boolean r0 = r0.isArray()\n if (r0 == 0) goto L_0x00cd\n java.lang.Object r0 = com.fasterxml.jackson.databind.util.ArrayBuilders.getArrayComparator(r5)\n r12 = r0\n r11 = r3\n goto L_0x00e6\n L_0x00cd:\n r11 = r3\n r12 = r5\n goto L_0x00e6\n L_0x00d0:\n boolean r0 = r0.isContainerType()\n if (r0 == 0) goto L_0x00e4\n com.fasterxml.jackson.databind.SerializationConfig r0 = r1._config\n com.fasterxml.jackson.databind.SerializationFeature r3 = com.fasterxml.jackson.databind.SerializationFeature.WRITE_EMPTY_JSON_ARRAYS\n boolean r0 = r0.isEnabled(r3)\n if (r0 != 0) goto L_0x00e4\n java.lang.Object r0 = com.fasterxml.jackson.databind.ser.BeanPropertyWriter.MARKER_FOR_EMPTY\n r12 = r0\n goto L_0x00e5\n L_0x00e4:\n r12 = r5\n L_0x00e5:\n r11 = r8\n L_0x00e6:\n com.fasterxml.jackson.databind.ser.BeanPropertyWriter r0 = new com.fasterxml.jackson.databind.ser.BeanPropertyWriter\n com.fasterxml.jackson.databind.BeanDescription r3 = r1._beanDesc\n com.fasterxml.jackson.databind.util.Annotations r6 = r3.getClassAnnotations()\n r3 = r0\n r4 = r16\n r5 = r21\n r7 = r17\n r8 = r18\n r9 = r19\n r3.<init>(r4, r5, r6, r7, r8, r9, r10, r11, r12)\n com.fasterxml.jackson.databind.AnnotationIntrospector r3 = r1._annotationIntrospector\n java.lang.Object r3 = r3.findNullSerializer(r13)\n if (r3 == 0) goto L_0x010b\n com.fasterxml.jackson.databind.JsonSerializer r2 = r15.serializerInstance(r13, r3)\n r0.assignNullSerializer(r2)\n L_0x010b:\n com.fasterxml.jackson.databind.AnnotationIntrospector r2 = r1._annotationIntrospector\n com.fasterxml.jackson.databind.util.NameTransformer r2 = r2.findUnwrappingNameTransformer(r13)\n if (r2 == 0) goto L_0x0117\n com.fasterxml.jackson.databind.ser.BeanPropertyWriter r0 = r0.unwrappingWriter(r2)\n L_0x0117:\n return r0\n L_0x0118:\n r0 = move-exception\n r5 = r0\n com.fasterxml.jackson.databind.BeanDescription r0 = r1._beanDesc\n java.lang.String r5 = r5.getMessage()\n java.lang.Object[] r3 = new java.lang.Object[r3]\n java.lang.Object r0 = r15.reportBadPropertyDefinition(r0, r4, r5, r3)\n com.fasterxml.jackson.databind.ser.BeanPropertyWriter r0 = (com.fasterxml.jackson.databind.ser.BeanPropertyWriter) r0\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.fasterxml.jackson.databind.ser.PropertyBuilder.buildWriter(com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition, com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.JsonSerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.introspect.AnnotatedMember, boolean):com.fasterxml.jackson.databind.ser.BeanPropertyWriter\");\n }",
"Book toModeL(BookDTO booKDTO);",
"private HistoryDTO convertEntityToDTO(History history) {\n\t\tHistoryDTO historyDto = modelMapper.map(history, HistoryDTO.class);\n\t\treturn historyDto;\n\t}",
"private CustomerResponseDto convertToCustomerDetailsDto(Customer customer) {\n\t\treturn modelMapper.map(customer, CustomerResponseDto.class);\n\t}",
"@Override\r\n\tpublic MainDTO toDTO() {\n\t\tFamiliaresDTO familiaresDTO = new FamiliaresDTO();\r\n\t\tDomicilioDTO domicilioDTO = null;\r\n\t\tfamiliaresDTO.setIdfamiliar(this.getIdFamiliar());\r\n\t\tfamiliaresDTO.setNombre(this.getNombre());\r\n\t\tfamiliaresDTO.setApellidoPaterno(this.getApellidoPaterno());\r\n\t\tfamiliaresDTO.setApellidoMaterno(this.getAppelidoMaterno());\r\n\t\tfamiliaresDTO.setDireccion(this.getDireccion());\r\n\t\tfamiliaresDTO.setIdpaciente(this.getIdpaciente());\r\n\t\tfamiliaresDTO.setDependencia(this.getDependencia());\r\n\t\tdomicilioDTO = (DomicilioDTO) this.getDomicilio().toDTO();\r\n\t\tfamiliaresDTO.setDomicilio(domicilioDTO);\r\n\t\treturn familiaresDTO;\r\n\t}",
"void decode2(DataBuffer buffer, T object);",
"public AtendimentoJuridicoDTO toDTO(AtendimentoJuridicoEntity entity){\n\t\tAtendimentoJuridicoDTO dto = new AtendimentoJuridicoDTO();\n\t\tBeanUtils.copyProperties(entity, dto); \n\t\treturn dto ;\n\t}",
"Object defaultReplaceObject(Object obj) throws IOException {\n\t logger.log(Level.FINEST, \"Object in stream instance of: {0}\", obj.getClass());\n\t try {\n\t\tif (obj instanceof DynamicProxyCodebaseAccessor ){\n\t\t logger.log(Level.FINEST, \"Object in stream instance of DynamicProxyCodebaseAccessor\");\n\t\t obj = \n\t\t ProxySerializer.create(\n\t\t\t (DynamicProxyCodebaseAccessor) obj,\n\t\t\t aout.defaultLoader,\n\t\t\t aout.getObjectStreamContext()\n\t\t );\n\t\t} else if (obj instanceof ProxyAccessor ) {\n\t\t logger.log(Level.FINEST, \"Object in stream instance of ProxyAccessor\");\n\t\t obj = \n\t\t ProxySerializer.create(\n\t\t\t (ProxyAccessor) obj,\n\t\t\t aout.defaultLoader,\n\t\t\t aout.getObjectStreamContext()\n\t\t );\n\t\t}\n\t } catch (IOException e) {\n\t\tlogger.log(Level.FINE, \"Unable to create ProxyAccessorSerializer\", e);\n\t\tthrow e;\n\t }\n\t Class c = obj.getClass();\n\t Class s = serializers.get(c);\n\t if (c.isAnnotationPresent(AtomicSerial.class)){} // Ignore\n\t else if (c.isAnnotationPresent(AtomicExternal.class)){} // Ignore\n\t // REMIND: stateless objects, eg EmptySet?\n\t else if (s != null){\n\t\ttry {\n\t\t Constructor constructor = s.getDeclaredConstructor(c);\n\t\t obj = constructor.newInstance(obj);\n\t\t} catch (NoSuchMethodException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (SecurityException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (InstantiationException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (IllegalAccessException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (IllegalArgumentException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (InvocationTargetException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t}\n\t }\n\t else if (obj instanceof Map) obj = new MapSerializer((Map) obj);\n\t else if (obj instanceof Set) obj = new SetSerializer((Set) obj);\n\t else if (obj instanceof Collection) obj = new ListSerializer((Collection) obj);\n\t else if (obj instanceof Permission) obj = new PermissionSerializer((Permission) obj);\n\t else if (obj instanceof Throwable) obj = new ThrowableSerializer((Throwable) obj);\n\t logger.log(Level.FINEST, \"Returning object in stream instance of: {0}\", obj.getClass());\n\t return obj;\n\t}",
"public void addAsFirstExtraField(final ZipExtraField ze) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"4c28d4a6-8986-40c6-b210-d044aab8251a\");\n if (ze instanceof UnparseableExtraFieldData) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"3d9f9c08-e83a-436a-a8e6-86f86bd970af\");\n unparseableExtra = (UnparseableExtraFieldData) ze;\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"c35acbb6-3608-4438-9a3b-2e13d04a75a3\");\n if (getExtraField(ze.getHeaderId()) != null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"11874c15-028a-440f-8a51-54f6de7d8834\");\n removeExtraField(ze.getHeaderId());\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"1eda37ab-9698-47a7-98da-b090770a9fd5\");\n final ZipExtraField[] copy = extraFields;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"52861454-df58-45a4-a4ea-fadccf33506e\");\n final int newLen = extraFields != null ? extraFields.length + 1 : 1;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"bd7052b3-7eb3-4bec-8203-290549716189\");\n extraFields = new ZipExtraField[newLen];\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"f4f61f84-b9ec-4ec0-b697-37d032a7a8fb\");\n extraFields[0] = ze;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"86004d7e-add5-4495-b688-e71892b6f3ee\");\n if (copy != null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"4e30f42c-8c61-4810-b892-2d8b24ce71f8\");\n System.arraycopy(copy, 0, extraFields, 1, extraFields.length - 1);\n }\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"74b18f9f-5af2-497f-a1b9-1aaa00af7a4f\");\n setExtra();\n }",
"private ItemDTO convertIntoItemDTO(Item item) {\n if (null == item) {\n return null;\n }\n ItemDTO itemDTO = new ItemDTO();\n itemDTO.setObjectID(item.getObjectID());\n itemDTO.setTitle(item.getTitle());\n itemDTO.setDescription(item.getDescription());\n itemDTO.setType(item.getType());\n itemDTO.setPicture(item.getPicture().toString());\n itemDTO.setPicture(\"\");\n itemDTO.setStock(item.getStock());\n return itemDTO;\n }",
"private TimeEntryDto convertTimeEntryToDto(final TimeEntry timeEntry) {\n\t\tfinal TimeEntryDto timeEntryDto = new TimeEntryDto();\n\t\ttimeEntryDto.setId(Optional.of(timeEntry.getId()));\n\t\ttimeEntryDto.setDate(this.dateFormat.format(timeEntry.getDate()));\n\t\ttimeEntryDto.setType(timeEntry.getType().toString());\n\t\ttimeEntryDto.setDescription(timeEntry.getDescription());\n\t\ttimeEntryDto.setLocation(timeEntry.getLocation());\n\t\ttimeEntryDto.setEmployeeId(timeEntry.getEmployee().getId());\n\n\t\treturn timeEntryDto;\n\t}",
"protected abstract GenericOutputBean convertSpecificOutputStructureToGenericOutputBean(T fileParsed);",
"AccountDTO coverAccountToEmpDTO(Account account);",
"protected abstract Object toObject(ByteBuffer content, Type targetType) throws BeanConversionException;",
"List<TicketDto> toDtoList(List<TicketEntity> ticketEntityList);",
"@Override\n public void writeTo(ArrayList<Object> t, Class<?> type,\n Type type1, Annotation[] antns, MediaType mt, MultivaluedMap<String, \n Object> mm, OutputStream out) throws IOException, \n WebApplicationException {\n \n if (mt.getType().equals(\"application\") && mt.getSubtype().equals(\"json\")) {\n StringBuffer buffer = new StringBuffer();\n if(type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstacionAparcamiento>\")) {\n buffer = buffer.append(\" {\\\"Aparcamientos\\\":[\");\n for (int i = 0; i < t.size(); i++) {\n\n EstacionAparcamiento apar = (EstacionAparcamiento) t.get(i);\n buffer = buffer.append(\"{\");\n buffer = buffer.append(\"\\\"nombre\\\":\\\"\");\n if (apar.getNombre() != null) {\n buffer = buffer.append(apar.getNombre()); \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"descripcion\\\":\\\"\");\n \n if (apar.getDescripcion() != null) {\n buffer = buffer.append(apar.getDescripcion());\n \n }\n \n if (apar.getGeo() != null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\").append(apar.getGeo().getLatitud());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\").append(apar.getGeo().getLongitud());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\");\n }\n if (apar.getDireccion()!= null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\").append(apar.getDireccion().getPais());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\").append(apar.getDireccion().getLocalidad());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\").append(apar.getDireccion().getDireccion());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\");\n \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"telefono\\\":\\\"\");\n if(apar.getTelefono() != null) {\n \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"accesibilidad\\\":\\\"\");\n if (apar.getAccesibilidad() == 0 || apar.getAccesibilidad() == 1) {\n buffer = buffer.append(apar.getAccesibilidad());\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"plazasLibres\\\":\\\"\");\n if (apar.getPlazasLibres() >= 0) {\n buffer = buffer.append(apar.getPlazasLibres());\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"plazasTotales\\\":\\\"\");\n if (apar.getPlazasTotales() >= 0) {\n buffer = buffer.append(apar.getPlazasTotales());\n }\n buffer = buffer.append(\"\\\"}\");\n\n if(i < t.size()-1) buffer = buffer.append(\",\");\n }\n buffer = buffer.append(\"]}\");\n }\n else if(type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstacionAlquilerBicicletas>\")) {\n buffer = buffer.append(\" {\\\"Bicicletas\\\":[\");\n for (int i = 0; i < t.size(); i++) {\n\n EstacionAlquilerBicicletas apar = (EstacionAlquilerBicicletas) t.get(i);\n buffer = buffer.append(\"{\");\n buffer = buffer.append(\"\\\"nombre\\\":\\\"\");\n if (apar.getNombre() != null) {\n buffer = buffer.append(apar.getNombre()); \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"descripcion\\\":\\\"\");\n \n if (apar.getDescripcion() != null) {\n buffer = buffer.append(apar.getDescripcion());\n \n }\n \n if (apar.getGeo() != null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\").append(apar.getGeo().getLatitud());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\").append(apar.getGeo().getLongitud());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\");\n }\n if (apar.getDireccion()!= null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\").append(apar.getDireccion().getPais());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\").append(apar.getDireccion().getLocalidad());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\").append(apar.getDireccion().getDireccion());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\");\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"telefono\\\":\\\"\");\n if(apar.getTelefono() != null) {\n \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"anclajes\\\":\\\"\");\n if (apar.getAnclajes() >= 0) {\n buffer = buffer.append(apar.getAnclajes());\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"biciLibres\\\":\\\"\");\n if (apar.getBiciLibres() >= 0) {\n buffer = buffer.append(apar.getBiciLibres());\n }\n \n buffer = buffer.append(\"\\\"}\");\n\n if(i < t.size()-1) buffer = buffer.append(\",\");\n }\n buffer = buffer.append(\"]}\");\n }\n else if(type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstacionCivica>\") ||\n type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstructurasPublicas>\")) {\n buffer = buffer.append(\" {\\\"Estaciones\\\":[\");\n int ultimo = 0;\n for (int i = 0; i < t.size(); i++) {\n EstructurasPublicas apar = new EstructurasPublicas();\n EstacionCivica apar1 = new EstacionCivica();\n if (type1.getTypeName().contains(\"EstacionCivica\")) \n apar = (EstacionCivica) t.get(i);\n else apar = (EstructurasPublicas) t.get(i);\n if(apar != null) { \n boolean pintar =false; \n if (ultimo != 0) buffer = buffer.append(\",\");\n ultimo++;\n buffer = buffer.append(\"{\");\n \n if( type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstructurasPublicas>\")){\n buffer = buffer.append(\"\\\"transporte\\\":\\\"\").append(apar.transporte);\n buffer = buffer.append(\"\\\",\");\n }\n buffer = buffer.append(\"\\\"nombre\\\":\\\"\");\n if (apar.getNombre() != null) {\n buffer = buffer.append(apar.getNombre()); \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"descripcion\\\":\\\"\");\n \n if (apar.getDescripcion() != null) {\n buffer = buffer.append(apar.getDescripcion());\n \n }\n \n if (apar.getGeo() != null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\").append(apar.getGeo().getLatitud());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\").append(apar.getGeo().getLongitud());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\");\n }\n if (apar.getDireccion()!= null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\").append(apar.getDireccion().getPais());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\").append(apar.getDireccion().getLocalidad());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\").append(apar.getDireccion().getDireccion());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\");\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"telefono\\\":\\\"\");\n if(apar.getTelefono() != null) {\n buffer = buffer.append(apar.getTelefono());\n }\n \n \n if( type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstructurasPublicas>\")){\n \n if (apar.transporte.equals(\"Aparcamiento\")) {\n buffer = buffer.append(\"\\\",\");\n System.out.println(apar.toString());\n EstacionAparcamiento a = apar.getEa();\n buffer = buffer.append(\"\\\"accesibilidad\\\":\\\"\");\n if((a != null)) {\n if (a.getAccesibilidad() == 0 || a.getAccesibilidad() == 1) {\n buffer = buffer.append(a.getAccesibilidad());\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"plazasLibres\\\":\\\"\");\n if (a.getPlazasLibres() >= 0) {\n buffer = buffer.append(a.getPlazasLibres());\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"plazasTotales\\\":\\\"\");\n if (a.getPlazasTotales() >= 0) {\n buffer = buffer.append(a.getPlazasTotales());\n }\n }\n }\n else if (apar.transporte.equals(\"Bicicleta\")) {\n buffer = buffer.append(\"\\\",\");\n EstacionAlquilerBicicletas b = apar.getEab();\n buffer = buffer.append(\"\\\"anclajes\\\":\\\"\");\n if (b.getAnclajes() >= 0) {\n buffer = buffer.append(b.getAnclajes());\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"biciLibres\\\":\\\"\");\n if (b.getBiciLibres() >= 0) {\n buffer = buffer.append(b.getBiciLibres());\n }\n }\n else if (!apar.transporte.equals(\"Taxi\")){\n buffer = buffer.append(\"\\\", \");\n buffer = buffer.append(\"\\\"lineas\\\":\");\n if(apar.getEc() != null) {\n if(apar.getEc().getLineas() != null) {\n if(apar.getEc().getLineas()!= null) {\n buffer = buffer.append(\"[\\\"\");\n for (int j = 0; j < apar.getEc().getLineas().size(); j++) {\n if (j != 0) buffer = buffer.append(\", \\\"\");\n buffer = buffer.append(apar.getEc().getLineas().get(j).getNumLinea());\n buffer = buffer.append(\"\\\"\");\n }\n buffer = buffer.append(\"]\");\n pintar = true;\n }\n }\n }\n }\n }\n else if (!apar.transporte.equals(\"Taxi\")){\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"lineas\\\":\");\n apar1 = (EstacionCivica) t.get(i);\n \n if (apar1 != null) {\n if(apar1.getLineas()!= null) {\n buffer = buffer.append(\"[\\\"\");\n for (int j = 0; j < apar1.getLineas().size(); j++) {\n if (j != 0) buffer = buffer.append(\", \\\"\");\n buffer = buffer.append(apar1.getLineas().get(j).getNumLinea());\n buffer = buffer.append(\"\\\"\");\n }\n buffer = buffer.append(\"]\");\n pintar = true;\n }\n }\n// \n }\n \n if(!pintar) buffer = buffer.append(\"\\\"}\");\n else buffer = buffer.append(\"}\");\n \n }\n }\n buffer = buffer.append(\"]}\");\n }\n \n else if(type1.getTypeName().contains(\"ArrayList<Transportes.Ficheros.EstacionTaxi>\")) {\n buffer = buffer.append(\" {\\\"Taxi\\\":[\");\n for (int i = 0; i < t.size(); i++) {\n\n EstacionTaxi apar = (EstacionTaxi) t.get(i);\n buffer = buffer.append(\"{\");\n buffer = buffer.append(\"\\\"nombre\\\":\\\"\");\n if (apar.getNombre() != null) {\n buffer = buffer.append(apar.getNombre()); \n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"descripcion\\\":\\\"\");\n \n if (apar.getDescripcion() != null) {\n buffer = buffer.append(apar.getDescripcion());\n \n }\n \n if (apar.getGeo() != null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\").append(apar.getGeo().getLatitud());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\").append(apar.getGeo().getLongitud());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"latitud\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"longitud\\\":\\\"\");\n }\n if (apar.getDireccion()!= null) {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\").append(apar.getDireccion().getPais());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\").append(apar.getDireccion().getLocalidad());\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\").append(apar.getDireccion().getDireccion());\n }\n else {\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"pais\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"localidad\\\":\\\"\");\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"direccion\\\":\\\"\");\n }\n buffer = buffer.append(\"\\\",\");\n buffer = buffer.append(\"\\\"telefono\\\":\\\"\");\n if(apar.getTelefono() != null) {\n \n }\n \n \n buffer = buffer.append(\"\\\"}\");\n\n if(i < t.size()-1) buffer = buffer.append(\",\");\n }\n buffer = buffer.append(\"]}\");\n }\n \n else if (type1.getTypeName().contains(\"ArrayList<java.lang.String>\")) {\n buffer = buffer.append(\"{\\\"nombres\\\":[\");\n for (int i = 0; i < t.size(); i++) {\n buffer = buffer.append(\"{\");\n buffer = buffer.append(\"\\\"nombre\\\":\\\"\").append(String.valueOf(t.get(i)));\n buffer = buffer.append(\"\\\"}\");\n if(i < t.size()-1) buffer = buffer.append(\",\");\n }\n buffer = buffer.append(\"]}\");\n }\n try (PrintStream printStream = new PrintStream(out,true, \"UTF-8\")) {\n printStream.print(buffer.toString());\n }\n return;\n } \n throw new UnsupportedOperationException(\"Not supported MediaType: \" + mt);\n }",
"public static List<TrailerVideo> extractTrailerVideoData(String stringUrl, int movieId) {\n String jsonResponse = fetchResponse(stringUrl);\n if (jsonResponse == null) {\n return null;\n }\n List<TrailerVideo> trailerVideos = new ArrayList<>();\n try {\n JSONObject baseJsonResponse = new JSONObject(jsonResponse);\n JSONArray resultsJSONArray = baseJsonResponse.getJSONArray(RESULTS_KEY);\n for (int i = 0; i < resultsJSONArray.length(); i++) {\n JSONObject currentTrailerVideo = resultsJSONArray.getJSONObject(i);\n String trailerVideoId = currentTrailerVideo.optString(TRAILER_VIDEO_ID_KEY);\n String key = currentTrailerVideo.optString(TRAILER_VIDEO_KEY_KEY);\n String name = currentTrailerVideo.optString(TRAILER_VIDEO_NAME_KEY);\n String site = currentTrailerVideo.optString(TRAILER_VIDEO_SITE_KEY);\n TrailerVideo trailerVideo = new TrailerVideo(movieId, trailerVideoId, key, name, site);\n trailerVideos.add(trailerVideo);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return trailerVideos;\n }",
"List<Ticket> ticketDTOToTicket(List<TicketDTO> all);",
"@Test\n public void serverWritesTrailersWithData() throws Exception {\n peer.setClient(true);\n // Write the mocking script.\n peer.sendFrame().settings(new Settings());\n peer.sendFrame().headers(true, 3, TestUtil.headerEntries(\"client\", \"abc\"));\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// HEADERS STREAM 3\n\n peer.acceptFrame();// DATA STREAM 3 \"abcde\"\n\n peer.acceptFrame();// HEADERS STREAM 3\n\n peer.play();\n // Play it back.\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"a\", \"android\"), true);\n stream.enqueueTrailers(Headers.of(\"foo\", \"bar\"));\n BufferedSink sink = Okio.buffer(stream.getSink());\n sink.writeUtf8(\"abcdefghi\");\n sink.close();\n // Verify the peer received what was expected.\n MockHttp2Peer.InFrame headers1 = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, headers1.type);\n MockHttp2Peer.InFrame data1 = peer.takeFrame();\n Assert.assertEquals(TYPE_DATA, data1.type);\n Assert.assertEquals(3, data1.streamId);\n Assert.assertArrayEquals(\"abcdefghi\".getBytes(StandardCharsets.UTF_8), data1.data);\n Assert.assertFalse(data1.inFinished);\n MockHttp2Peer.InFrame headers2 = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, headers2.type);\n Assert.assertTrue(headers2.inFinished);\n }",
"public FilmTypeDto convertEntityToDto(FilmType entity){\n\t\tFilmTypeDto dto = new FilmTypeDto();\n\t\tif(entity!=null){\n\t\t\tdto.setId(entity.getId());\n\t\t\tdto.setVersion(entity.getVersion());\n\t\t\tdto.setDescription(entity.getDescription());\n\t\t}\n\t\treturn dto;\n\t}",
"private List<ArancelDTO> arancelesToDto(List<Arancel> aranceles) {\n\t\t// Lista a devolver\n\t\tList<ArancelDTO> arancelesDto = new ArrayList<ArancelDTO>();\n\t\tArancelDTO arancelDto;\n\t\t\n\t\t// Recorro cada uno de los aranceles\n\t\tfor (Arancel arancel : aranceles) {\n\t\t\t// Cargo los datos en el dto\n\t\t\tarancelDto = new ArancelDTO();\n\t\t\tarancelDto.setId(arancel.getId());\n\t\t\tarancelDto.setCodigo(arancel.getCodigo());\n\t\t\tarancelDto.setPrecioNoSocio(Formateador.formatNumero(arancel.getPrecioNoSocio()));\n\t\t\tarancelDto.setPrecioSocio(Formateador.formatNumero(arancel.getPrecioSocio()));\n\n\t\t\t// Cargo el objeto en la lista \n\t\t\tarancelesDto.add(arancelDto);\n\t\t}\n\n\t\treturn arancelesDto;\n\t}",
"public interface IReglaUtilDTO {\n\n\t/**\n\t * To business.\n\t * \n\t * @param reglaDTO\n\t * the regla dto\n\t * @return the regla\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tRegla toBusiness(ReglaDTO reglaDTO) throws TransferObjectException;\n\n\t/**\n\t * To rest.\n\t * \n\t * @param regla\n\t * the regla\n\t * @return the regla dto\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tReglaDTO toRest(Regla regla) throws TransferObjectException;\n\n\t/**\n\t * To rest info.\n\t * \n\t * @param regla\n\t * the regla\n\t * @return the regla dto\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tReglaDTO toRestInfo(Regla regla) throws TransferObjectException;\n}",
"@Override\r\n\tpublic AbstractDto mapToDto() {\n\t\treturn null;\r\n\t}",
"Persona PersonaDTOToPersona(PersonaDTO personaDTO);",
"public MovieObject(final SWFDecoder coder) throws IOException {\r\n type = coder.scanUnsignedShort() >>> Coder.LENGTH_FIELD_SIZE;\r\n length = coder.readUnsignedShort() & Coder.LENGTH_FIELD;\r\n if (length == Coder.IS_EXTENDED) {\r\n length = coder.readInt();\r\n }\r\n data = coder.readBytes(new byte[length]);\r\n }",
"public ReportDTO convertToDTO() {\n return new ReportDTO()\n .id(id)\n .email(email)\n .type(type)\n .content(content)\n .status(status)\n .reporter((reporter != null) ? reporter.convertToDTO() : null)\n .announcement(announcement.convertToDTO())\n .createdAt(createdAt);\n }",
"@Override\n public EndPointResponseDTO getEndPointLog() {\n\n //getting all called apis\n List<Logger> loggers = loggerRepository.findAll();\n List<EndPointLoggerDTO> endPointLoggerDTOs;\n ModelMapper modelMapper = new ModelMapper();\n\n //decoding header and bodies, mapping o dto class\n endPointLoggerDTOs = loggers.stream().map(n -> {\n n.setHeader(getDecod(n.getHeader()));\n n.setBody(getDecod(n.getBody()));\n return modelMapper.map(n, EndPointLoggerDTO.class);\n }).collect(Collectors.toList());\n\n //wrapping dto to response object\n EndPointResponseDTO endPointResponseDTO = new EndPointResponseDTO();\n endPointResponseDTO.setCount(endPointLoggerDTOs.size()/2);\n endPointResponseDTO.setEndPointLoggerDTOList(endPointLoggerDTOs);\n\n return endPointResponseDTO;\n }",
"@Override\n public String toFileEntry() {\n return \"T\" + \"/next\" + super.isDone + \"/next\" + super.description;\n }",
"TarEntry CreateEntry(byte[] headerBuffer);",
"Object deserialize(Writable blob) throws SerDeException;",
"public interface Deserializer extends SerDe {\n\n /**\n * Deserialize an object out of a Writable blob. In most cases, the return\n * value of this function will be constant since the function will reuse the\n * returned object. If the client wants to keep a copy of the object, the\n * client needs to clone the returned deserialized value by calling\n * ObjectInspectorUtils.getStandardObject().\n *\n * @param blob\n * The Writable object containing a serialized object\n * @return A Java object representing the contents in the blob.\n */\n Object deserialize(Writable blob) throws SerDeException;\n\n /**\n * Get the object inspector that can be used to navigate through the internal\n * structure of the Object returned from deserialize(...).\n */\n ObjectInspector getObjectInspector() throws SerDeException;\n\n}",
"public \n PipedObjectReader() \n {}",
"@Override\n public Optional<ApiResponse> filterResponse(ApiResponse response, Operation operation, ApiDescription api, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) {\n // fix spec for object media types, e.g. json\n config.getObjectMediaTypes().stream()\n .map(mts -> response.getContent().get(mts))\n .filter(mt -> mt != null && mt.getSchema() == null)\n .forEach(mt -> {\n Schema schema = new Schema();\n schema.setType(\"object\");\n mt.setSchema(schema);\n });\n\n // fix spec for binary media types\n config.getBinaryMediaTypes().stream()\n .map(mts -> response.getContent().get(mts))\n .filter(mt -> mt != null && mt.getSchema() == null)\n .forEach(mt -> {\n final Schema schema = new Schema();\n schema.setType(\"string\");\n schema.setFormat(\"binary\");\n mt.setSchema(schema);\n });\n\n return Optional.of(response);\n }",
"public static XContentBuilder toRiverMapping(String type, String analyzer) {\r\n\t\tXContentBuilder xbMapping = null;\r\n\t\ttry {\r\n xbMapping = jsonBuilder().prettyPrint().startObject();\r\n\r\n // Type\r\n xbMapping.startObject(type);\r\n\r\n // Manage _source\r\n // We store binary source as a stored field so we don't need it in _source\r\n xbMapping.startObject(\"_source\").array(\"excludes\", FsRiverUtil.Doc.ATTACHMENT).endObject();\r\n\r\n xbMapping.startObject(\"properties\");\r\n\r\n // Doc content\r\n addAnalyzedString(xbMapping, FsRiverUtil.Doc.CONTENT, analyzer);\r\n\r\n // Doc source\r\n addBinary(xbMapping, FsRiverUtil.Doc.ATTACHMENT);\r\n\r\n // Meta\r\n xbMapping.startObject(FsRiverUtil.Doc.META).startObject(\"properties\");\r\n addAnalyzedString(xbMapping, FsRiverUtil.Doc.Meta.AUTHOR);\r\n addAnalyzedString(xbMapping, FsRiverUtil.Doc.Meta.TITLE);\r\n addDate(xbMapping, FsRiverUtil.Doc.Meta.DATE);\r\n addAnalyzedString(xbMapping, FsRiverUtil.Doc.Meta.KEYWORDS);\r\n xbMapping.endObject().endObject(); // End Meta\r\n\r\n // File\r\n xbMapping.startObject(FsRiverUtil.Doc.FILE).startObject(\"properties\");\r\n addNotAnalyzedString(xbMapping, FsRiverUtil.Doc.File.CONTENT_TYPE);\r\n addDate(xbMapping, FsRiverUtil.Doc.File.LAST_MODIFIED);\r\n addDate(xbMapping, FsRiverUtil.Doc.File.INDEXING_DATE);\r\n addLong(xbMapping, FsRiverUtil.Doc.File.FILESIZE);\r\n addLong(xbMapping, FsRiverUtil.Doc.File.INDEXED_CHARS);\r\n addNotAnalyzedString(xbMapping, FsRiverUtil.Doc.File.FILENAME);\r\n addNotIndexedString(xbMapping, FsRiverUtil.Doc.File.URL);\r\n xbMapping.endObject().endObject(); // End File\r\n\r\n // Path\r\n xbMapping.startObject(FsRiverUtil.Doc.PATH).startObject(\"properties\");\r\n addNotAnalyzedString(xbMapping, FsRiverUtil.Doc.Path.ENCODED);\r\n addNotAnalyzedString(xbMapping, FsRiverUtil.Doc.Path.VIRTUAL);\r\n addNotAnalyzedString(xbMapping, FsRiverUtil.Doc.Path.ROOT);\r\n addNotAnalyzedString(xbMapping, FsRiverUtil.Doc.Path.REAL);\r\n xbMapping.endObject().endObject(); // End Path\r\n\r\n xbMapping.endObject().endObject().endObject(); // End Type\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Log when error\r\n\t\t}\r\n\t\treturn xbMapping;\r\n\t}",
"public void addExtraField(final ZipExtraField ze) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"04a0a86a-8034-4044-aeed-cebe7016e2d1\");\n if (ze instanceof UnparseableExtraFieldData) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6b9a9172-8ea2-4aed-8433-17b19d1a9891\");\n unparseableExtra = (UnparseableExtraFieldData) ze;\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"c4c62a77-912a-4047-b4bc-d8a05e95bc86\");\n if (extraFields == null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"450fc98b-d668-4300-b141-2c5907baab75\");\n extraFields = new ZipExtraField[] { ze };\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"5d8f1c11-1f27-4f98-923b-c42685d35e95\");\n if (getExtraField(ze.getHeaderId()) != null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"7cc8a651-6175-4ec7-ab56-688a497910a8\");\n removeExtraField(ze.getHeaderId());\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"aa062502-071a-4ff6-8692-1c1202b14fec\");\n final ZipExtraField[] zipExtraFields = copyOf(extraFields, extraFields.length + 1);\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"e30c5825-289a-4c05-a5ec-8c2d6bec09e8\");\n zipExtraFields[zipExtraFields.length - 1] = ze;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"3f326300-d61d-4afa-ae59-fe45855b45a6\");\n extraFields = zipExtraFields;\n }\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"944dff45-ab9b-4e44-b913-045a4e38da7a\");\n setExtra();\n }",
"PersonaDTO PersonaToPersonaDTO(Persona persona);",
"private BookDetailResponse convertBookDetail(Book book) {\n BookDetailResponse response = new BookDetailResponse();\n BeanUtils.copyProperties(book, response);\n BookCategory thirdCategory = book.getCategory();\n if (thirdCategory != null) {\n response.setThirdCategoryId(thirdCategory.getId());\n BookCategory secondCategory = thirdCategory.getParent();\n if (secondCategory != null) {\n response.setSecondCategoryId(secondCategory.getId());\n BookCategory firstCategory = secondCategory.getParent();\n if (firstCategory != null) {\n response.setFirstCategoryId(firstCategory.getId());\n }\n }\n }\n if (StringUtils.isBlank(book.getFileName()) && book.getSource() != null) {\n response.setFileName(FilenameUtils.getName(book.getSource()));\n }\n return response;\n }",
"RealtorProductDTO getrealtorProductDTO(int sr_no);",
"public TicketDto convertTicketDto(Ticket ticket) {\r\n\t\tTicketDto ticketDto = new TicketDto(ticket.getTicketId(),ticket.getNoOfSeats(),ticket.getSeatIds(),ticket.getScreenName());\r\n\t\treturn ticketDto;\r\n\t}",
"@Test\n public void testDeSerialize() throws Exception {\n Writable w = new Text(\"{ \\\"ts\\\":\\\"2014-08-25T00:24:27.41103928Z\\\", \\\"t\\\":36529, \\\"Request\\\":{ \\\"path\\\":\\\"/foo/bar\\\", \\\"query\\\":{\\\"baz\\\": [\\\"ban\\\"]}, \\\"headers\\\":{ \\\"Accept\\\":[\\\"image/webp,*/*;q=0.8\\\"], \\\"Accept-Encoding\\\":[\\\"identity\\\"], \\\"Accept-Language\\\":[\\\"en-US,en;q=0.8\\\"], \\\"Connection\\\":[\\\"keep-alive\\\"], \\\"Referer\\\":[\\\"http://foo.com/bar\\\"], \\\"User-Agent\\\":[\\\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\\\"] }, \\\"ip\\\":\\\"10.0.0.1\\\" } }\");\n\n JSONObject result = (JSONObject) instance.deserialize(w);\n \n StructObjectInspector soi = (StructObjectInspector) instance.getObjectInspector();\n \n StructField tSF = soi.getStructFieldRef(\"t\");\n assertEquals(36529, ((JavaStringIntObjectInspector)tSF.getFieldObjectInspector()).get(soi.getStructFieldData(result, tSF )));\n assertEquals(\"2014-08-25T00:24:27.41103928Z\"\n , soi.getStructFieldData(result, soi.getStructFieldRef(\"ts\")));\n \n StructField requestSF = soi.getStructFieldRef(\"request\");\n \n Object request = soi.getStructFieldData(result, requestSF);\n \n StructObjectInspector requestOI = (StructObjectInspector) requestSF.getFieldObjectInspector();\n \n assertEquals(3, requestOI.getAllStructFieldRefs().size());\n \n\n StructField headersSF = requestOI.getStructFieldRef(\"headers\");\n Object headers = requestOI.getStructFieldData(request, headersSF);\n \n assertTrue(headersSF.getFieldObjectInspector().getCategory() == Category.STRUCT);\n StructObjectInspector headersOI = (StructObjectInspector) headersSF.getFieldObjectInspector();\n \n // now get the user agent with the mapping\n StructField useragentSF = headersOI.getStructFieldRef(\"useragent\");\n Object useragent = requestOI.getStructFieldData(headers, useragentSF);\n ListObjectInspector useragentOI = (ListObjectInspector) useragentSF.getFieldObjectInspector();\n assertEquals(useragentOI.getCategory(), Category.LIST);\n \n // get value\n List d = useragentOI.getList(useragent);\n assertEquals(d.size(),1);\n }",
"List<PersonaDTO> PersonaListToPersonaDTOList(List<Persona> personaList);",
"public static DataHeader readDataHeader(ArchiveFileBuffer buffer, CtrlInfoReader info) throws Exception\n {\n final File file = buffer.getFile();\n final long offset = buffer.offset();\n\n // first part of data file header:\n // 4 bytes directory_offset (skipped)\n // \" next_offset (offset of next entry in its file)\n // \" prev_offset (offset of previous entry in its file)\n // \" cur_offset (used by FileAllocator writing file)\n // \" num_samples (number of samples in the buffer)\n // \" ctrl_info_offset (offset in this file of control info header (units, limits, etc.))\n // \" buff_size (bytes allocated for this entry, including header)\n // \" buff_free (number of un-used, allocated bytes for this header)\n // 2 bytes DbrType (type of data stored in buffer)\n // 2 bytes DbrCount (count of values for each buffer element, i.e. 1 for scalar types, >1 for array types)\n // 4 bytes padding (used to align the period)\n // 8 bytes (double) period\n // 8 bytes (epicsTimeStamp) begin_time\n // \" next_file_time\n // \" end_time\n // char [40] prev_file\n // char [40] next_file\n // --> Total of 152 bytes in data header\n buffer.skip(4);\n final long nextOffset = buffer.getUnsignedInt();\n buffer.skip(4);\n buffer.skip(4);\n final long numSamples = buffer.getUnsignedInt();\n final long ctrlInfoOffset = buffer.getUnsignedInt();\n final long buff_size = buffer.getUnsignedInt();\n final long buff_free = buffer.getUnsignedInt();\n final short dbrTypeCode = buffer.getShort();\n final short dbrCount = buffer.getShort();\n buffer.skip(4);\n buffer.skip(8);\n final Instant beginTime = buffer.getEpicsTime();\n final Instant nextTime = buffer.getEpicsTime();\n final Instant endTime = buffer.getEpicsTime();\n\n buffer.skip(40);\n final byte nameBytes [] = new byte [40];\n buffer.get(nameBytes);\n\n if (!info.isOffset(ctrlInfoOffset))\n info = new CtrlInfoReader(ctrlInfoOffset);\n final DbrType dbrType = DbrType.forValue(dbrTypeCode);\n\n // compute amount of data in this data file entry: (bytes allocated) - (bytes free) - (bytes in header)\n final long buffDataSize = buff_size - buff_free - 152;\n System.out.println(buffDataSize);\n\n // Size of samples:\n // 12 bytes for status/severity/timestamp,\n // padding, value, padding\n final long dbr_size = 12 + dbrType.padding + dbrCount * dbrType.valueSize + dbrType.getValuePad(dbrCount);\n final long expected = dbr_size * numSamples;\n System.out.println(dbr_size);\n System.out.println(expected);\n\n if (expected != buffDataSize)\n throw new Exception(\"Expected \" + expected + \" byte buffer, got \" + buffDataSize);\n\n String nextFilename = nextOffset != 0 ? new String(nameBytes).split(\"\\0\", 2)[0] : \"*\";\n File nextFile = new File(buffer.getFile().getParentFile(), nextFilename);\n\n logger.log(Level.FINE, \"Datablock\\n\" +\n \"Buffer : '\" + file + \"' @ 0x\" + Long.toHexString(offset) + \"\\n\" +\n \"Time : \" + beginTime + \"\\n\" +\n \"... : \" + endTime);\n\n return new DataHeader(file, offset, nextFile, nextOffset, nextTime, info, dbrType, dbrCount, numSamples);\n }",
"@Override\n\tpublic ReaderDTO findReaderDTObyId(long id) {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic TableDTO getDTO(Table entity) {\n\t\treturn null;\r\n\t}",
"void decodeObject();",
"@Override\n public RequestReadDTO wrapDTO(Request request, Collection<DtoOption> options) throws Exception {\n RequestReadDTO dto = mapper.map(request, RequestReadDTO.class);\n\n /* Add dependency */\n /* TODO:\n if (options != null && !options.isEmpty()) {\n if (options.contains(DtoOption.FK)) {\n FkReadDTO fkDTO = fkService.getDTOById(request.getFkId());\n dto.setFk(fkDTO);\n }\n\n if (options.contains(DtoOption.FK_LIST)) {\n List<FkReadDTO> fkDTOList = fkService.getAllDTOById(request.getFkId());\n dto.setFkList(fkDTOList);\n }\n }\n */\n\n return dto;\n }",
"@Override\n public ResponseReflectingOption adjustResponseReflecting() {\n return responseReflectingOption;\n }",
"private void trappingResponse(ComputingResponse resp, long sourceIF, long destIF){\n\n\t\tlog.info(\"First ERO SubObject type \"+resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getFirst().getClass());\n\t\tlog.info(\"Second ERO SubObject type \"+resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().get(1).getClass());\n\t\tlog.info(\"Last ERO SubObject type \"+resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getLast().getClass());\n\t\tInet4Address firstIP=((UnnumberIfIDEROSubobject)resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getFirst()).getRouterID();\n\n\t\tEROSubobject label= resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().get(1);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(0, label);\n\n\t\tUnnumberIfIDEROSubobject firsteroso= new UnnumberIfIDEROSubobject();\n\t\tfirsteroso.setRouterID(firstIP);\n\t\tfirsteroso.setInterfaceID(sourceIF);\n\t\tfirsteroso.setLoosehop(false);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(0, firsteroso);\n\n\n\t\tint size=resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().size();\n\t\tInet4Address lastIP=((IPv4prefixEROSubobject)resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getLast()).getIpv4address();\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().removeLast();\n\t\tUnnumberIfIDEROSubobject lasteroso= new UnnumberIfIDEROSubobject();\n\t\tlasteroso.setRouterID(lastIP);\n\t\tlasteroso.setInterfaceID(destIF);\n\t\tlasteroso.setLoosehop(false);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(lasteroso);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(label);\n\t}",
"Ticket ticketDTOToTicket(TicketDTO ticketDTO);",
"public interface TdtResponse extends Serializable {\r\n}",
"@Override\n\tpublic void Decompress() {\n\t\t\n\t}",
"List<VideoDTO> getVideosList(List<Video> videos) throws TransferObjectException;",
"public EmployeeResponse convertToDto(Employee employee) {\n return new EmployeeResponse(employee.getId(), employee.getName(), employee.getSalary().getValue());\n }",
"@Override\n\tpublic void unpackBody(IoBuffer buffer) {\n\n\t}",
"private String marshallDVD(DVD dvdEntry){\n String dvdAsText = dvdEntry.getTitle() + DELIMITER;\n\n // add the rest of the properties in the correct order:\n\n // Release Date\n dvdAsText += dvdEntry.getReleaseDate() + DELIMITER;\n\n // MPAA Rating\n dvdAsText += dvdEntry.getMpaaRating() + DELIMITER;\n \n // Director's Name\n dvdAsText += dvdEntry.getDirectorsName() + DELIMITER;\n \n // Studio\n dvdAsText += dvdEntry.getStudio() + DELIMITER;\n \n // User Rating - don't forget to skip the DELIMITER here.\n dvdAsText += dvdEntry.getUserRating();\n\n // We have now turned a DVD to text! Return it!\n return dvdAsText;\n }",
"public abstract T convertToEntity(D dto);",
"public String getBody() throws Exception {\n\t\tCustomVCardWriter writer = new CustomVCardWriter();\n\t\twriter.startCard();\n\t\twriter.appendProperty(\"UID\", getUid());\n\t\t// common name\n\t\twriter.appendProperty(\"FN\", get(\"cn\"));\n\t\t// RFC 2426: Family Name, Given Name, Additional Names, Honorific Prefixes, and Honorific Suffixes\n\t\twriter.appendProperty(\"N\", get(\"sn\"), get(\"givenName\"), get(\"middlename\"), get(\"personaltitle\"), get(\"namesuffix\"));\n\n\t\twriter.appendProperty(\"TEL;TYPE=cell\", get(\"mobile\"));\n\t\twriter.appendProperty(\"TEL;TYPE=work\", get(\"telephoneNumber\"));\n\t\twriter.appendProperty(\"TEL;TYPE=home\", get(\"homePhone\"));\n\t\twriter.appendProperty(\"TEL;TYPE=fax\", get(\"facsimiletelephonenumber\"));\n\t\twriter.appendProperty(\"TEL;TYPE=pager\", get(\"pager\"));\n\t\twriter.appendProperty(\"TEL;TYPE=car\", get(\"othermobile\"));\n\t\twriter.appendProperty(\"TEL;TYPE=home,fax\", get(\"homefax\"));\n\t\twriter.appendProperty(\"TEL;TYPE=isdn\", get(\"internationalisdnnumber\"));\n\t\twriter.appendProperty(\"TEL;TYPE=msg\", get(\"otherTelephone\"));\n\n\t\t// The structured type value corresponds, in sequence, to the post office box; the extended address;\n\t\t// the street address; the locality (e.g., city); the region (e.g., state or province);\n\t\t// the postal code; the country name\n\t\twriter.appendProperty(\"ADR;TYPE=home\",\n\t\t\t\tget(\"homepostofficebox\"), null, get(\"homeStreet\"), get(\"homeCity\"), get(\"homeState\"), get(\"homePostalCode\"), get(\"homeCountry\"));\n\t\twriter.appendProperty(\"ADR;TYPE=work\",\n\t\t\t\tget(\"postofficebox\"), get(\"roomnumber\"), get(\"street\"), get(\"l\"), get(\"st\"), get(\"postalcode\"), get(\"co\"));\n\t\twriter.appendProperty(\"ADR;TYPE=other\",\n\t\t\t\tget(\"otherpostofficebox\"), null, get(\"otherstreet\"), get(\"othercity\"), get(\"otherstate\"), get(\"otherpostalcode\"), get(\"othercountry\"));\n\n\t\twriter.appendProperty(\"EMAIL;TYPE=work\", get(\"smtpemail1\"));\n\t\twriter.appendProperty(\"EMAIL;TYPE=home\", get(\"smtpemail2\"));\n\t\twriter.appendProperty(\"EMAIL;TYPE=other\", get(\"smtpemail3\"));\n\n\t\tString[] org = StringUtils.split(get(\"o\"), '\\n');\n\t\tString orgLine1 = null;\n\t\tString orgLine2 = null;\n\t\tif (org.length > 0) {\n\t\t\torgLine1 = org[0];\n\t\t}\n\t\tif (org.length > 1) {\n\t\t\torgLine2 = org[1];\n\t\t}\n\t\twriter.appendProperty(\"ORG\", orgLine1, orgLine2);\n\t\twriter.appendProperty(\"URL;TYPE=work\", get(\"businesshomepage\"));\n\t\twriter.appendProperty(\"URL;TYPE=home\", get(\"personalHomePage\"));\n\t\twriter.appendProperty(\"TITLE\", get(\"title\"));\n\t\twriter.appendProperty(\"NOTE\", get(\"description\"));\n\n\t\twriter.appendProperty(\"CUSTOM1\", get(\"extensionattribute1\"));\n\t\twriter.appendProperty(\"CUSTOM2\", get(\"extensionattribute2\"));\n\t\twriter.appendProperty(\"CUSTOM3\", get(\"extensionattribute3\"));\n\t\twriter.appendProperty(\"CUSTOM4\", get(\"extensionattribute4\"));\n\n\t\twriter.appendProperty(\"ROLE\", get(\"profession\"));\n\t\twriter.appendProperty(\"NICKNAME\", get(\"nickname\"));\n\t\twriter.appendProperty(\"X-AIM\", get(\"im\"));\n\n\t\twriter.appendProperty(\"BDAY\", convertZuluDateToBday(get(\"bday\")));\n\t\twriter.appendProperty(\"ANNIVERSARY\", convertZuluDateToBday(get(\"anniversary\")));\n\n\t\tString gender = get(\"gender\");\n\t\tif (\"1\".equals(gender)) {\n\t\t\twriter.appendProperty(\"SEX\", \"2\");\n\t\t} else if (\"2\".equals(gender)) {\n\t\t\twriter.appendProperty(\"SEX\", \"1\");\n\t\t}\n\n\t\twriter.appendProperty(\"CATEGORIES\", get(\"keywords\"));\n\n\t\twriter.appendProperty(\"FBURL\", get(\"fburl\"));\n\n\t\tif (\"1\".equals(get(\"private\"))) {\n\t\t\twriter.appendProperty(\"CLASS\", \"PRIVATE\");\n\t\t}\n\n\t\twriter.appendProperty(\"X-ASSISTANT\", get(\"secretarycn\"));\n\t\twriter.appendProperty(\"X-MANAGER\", get(\"manager\"));\n\t\tString spouse = StringUtils.defaultIfBlank(get(\"spousecnLastname\"), \"\");\n\t\tString spousecnFirstname = StringUtils.defaultIfBlank(get(\"spousecnFirstname\"), \"\");\n\t\tif (StringUtils.isNotBlank(spousecnFirstname)) {\n\t\t\tspouse += \", \" + spousecnFirstname;\n\t\t}\n\t\twriter.appendProperty(\"X-SPOUSE\", spouse);\n\n\t\twriter.appendProperty(\"REV\", get(\"lastmodified\"));\n\n\t\twriter.endCard();\n\t\treturn writer.toString();\n\t}",
"@Override\r\n\tpublic SqlRowSet queryTrailer(Object[] parameter) {\n\t\treturn null;\r\n\t}",
"@Override\n public void readFields(DataInput in) throws IOException {\n super.readFields(in);\n\n byte flags = in.readByte();\n hasFooter = (FOOTER_FLAG & flags) != 0;\n isOriginal = (ORIGINAL_FLAG & flags) != 0;\n hasBase = (BASE_FLAG & flags) != 0;\n boolean hasLongFileId = (HAS_LONG_FILEID_FLAG & flags) != 0,\n hasWritableFileId = (HAS_SYNTHETIC_FILEID_FLAG & flags) != 0,\n hasSyntheticProps = (HAS_SYNTHETIC_ACID_PROPS_FLAG & flags) != 0;\n if (hasLongFileId && hasWritableFileId) {\n throw new IOException(\"Invalid split - both file ID types present\");\n }\n\n deltas.clear();\n int numDeltas = in.readInt();\n for(int i=0; i < numDeltas; i++) {\n AcidInputFormat.DeltaMetaData dmd = new AcidInputFormat.DeltaMetaData();\n dmd.readFields(in);\n deltas.add(dmd);\n }\n if (hasFooter) {\n int tailLen = WritableUtils.readVInt(in);\n byte[] tailBuffer = new byte[tailLen];\n in.readFully(tailBuffer);\n OrcProto.FileTail fileTail = OrcProto.FileTail.parseFrom(tailBuffer);\n orcTail = new OrcTail(fileTail, null);\n }\n if (hasLongFileId) {\n fileKey = in.readLong();\n } else if (hasWritableFileId) {\n SyntheticFileId fileId = new SyntheticFileId();\n fileId.readFields(in);\n this.fileKey = fileId;\n }\n fileLen = in.readLong();\n rootDir = new Path(in.readUTF());\n\n if (hasSyntheticProps) {\n long rowId = in.readLong();\n int bucket = in.readInt();\n long writeId = in.readLong();\n\n syntheticAcidProps = new OffsetAndBucketProperty(rowId, bucket, writeId);\n }\n }",
"public ArrayList<Trailer> getTrailers() {\n return trailers;\n }",
"T addAtTail(T t) {\n return header.addAtTail(t);\n }",
"@GET(\"/3/movie/{id}/videos\")\n Call<MovieResponse<Trailers>> getMovieTrailers(@Path(\"id\") String id, @Query(\"api_key\") String apiKey);",
"private static ReadableWaveletData buildWaveletFromDeltaReader(WaveletDeltaRecordReader reader)\n throws PersistenceException {\n try {\n // TODO(soren): better error handling of IllegalStateExceptions and\n // OperationExceptions thrown from here\n ReadableWaveletData wavelet =\n WaveletDataUtil.buildWaveletFromDeltas(reader.getWaveletName(),\n new TransformedWaveletDeltaIterator(reader));\n Preconditions.checkState(wavelet.getHashedVersion().equals(reader.getEndVersion()));\n return wavelet;\n } catch (OperationException e) {\n throw new PersistenceException(e);\n } catch (RuntimeIOException e) {\n throw new PersistenceException(e.getIOException());\n }\n }",
"DBody getBody();",
"public CambioComplementariosDTO() { }"
] | [
"0.64614385",
"0.6437639",
"0.56448686",
"0.5605034",
"0.5456261",
"0.5407685",
"0.5364071",
"0.5328699",
"0.5140405",
"0.5113734",
"0.5103364",
"0.50675726",
"0.4964559",
"0.49209002",
"0.49178302",
"0.49127492",
"0.48701513",
"0.48531088",
"0.48438236",
"0.48092481",
"0.48067135",
"0.47932845",
"0.47766426",
"0.47670907",
"0.47412243",
"0.47318304",
"0.47262853",
"0.47258824",
"0.46951818",
"0.46905422",
"0.46668103",
"0.46614182",
"0.4658549",
"0.46535137",
"0.4647095",
"0.46243295",
"0.46019557",
"0.46002948",
"0.45936805",
"0.45803344",
"0.45801133",
"0.45799956",
"0.45760953",
"0.45739794",
"0.45711818",
"0.45628825",
"0.4561937",
"0.45530972",
"0.45394182",
"0.45323035",
"0.4521356",
"0.4511915",
"0.45110634",
"0.45049554",
"0.45046028",
"0.44998205",
"0.44886836",
"0.44871944",
"0.44801107",
"0.44744876",
"0.44556594",
"0.4453589",
"0.44531536",
"0.44505098",
"0.44430313",
"0.44424",
"0.44329852",
"0.44255057",
"0.44243553",
"0.4423987",
"0.44195312",
"0.44190398",
"0.44121352",
"0.4406822",
"0.44048712",
"0.4403969",
"0.44024402",
"0.4399003",
"0.43962306",
"0.43945912",
"0.43915898",
"0.43912944",
"0.43829143",
"0.4380785",
"0.43742844",
"0.43694392",
"0.43670174",
"0.43582743",
"0.4356474",
"0.43560252",
"0.4348839",
"0.43378693",
"0.43371654",
"0.4331457",
"0.4330741",
"0.43289676",
"0.43285966",
"0.43279868",
"0.43251646",
"0.43210506"
] | 0.47724453 | 23 |
Intent popupIntent = new Intent(getBaseContext(), PopupActivity.class) .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); MainActivity.this.startActivity(popupIntent); setSamsungBadgeCount(onTunePushDefines.sTempCount); | public void onClick(View V){
onTunePushDefines.sTempCount++;
final LinearLayout linear = (LinearLayout)View.inflate(MainActivity.this, R.layout.phonenum, null);
EditText edPhoneNumber = (EditText)linear.findViewById(R.id.edPhoneNumber);
edPhoneNumber.setText(getPhoneNumber());
new AlertDialog.Builder(MainActivity.this)
.setTitle("전화번호를 입력해 주십시요")
.setView(linear)
.setCancelable(false)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
EditText edPhoneNumber = (EditText)linear.findViewById(R.id.edPhoneNumber);
String phoneNumber = edPhoneNumber.getText().toString();
if (phoneNumber == "")
return;
storePhoneNumber(phoneNumber);
// 1. Device Token 등록
// google play service가 사용가능한가
if (checkPlayServices())
{
mGcm = GoogleCloudMessaging.getInstance(MainActivity.this);
mRegId = getRegistrationId();
if (TextUtils.isEmpty(mRegId))
registerInBackground();
}
else
{
Log.i("MainActivity.java | onCreate", "|No valid Google Play Services APK found.|");
mTextStatus.append("\n No valid Google Play Services APK found.\n");
}
// display received msg
String msg = getIntent().getStringExtra("msg");
if (!TextUtils.isEmpty(msg))
mTextStatus.append("\n" + msg + "\n");
// 2. Web View
webview = (WebView)findViewById(R.id.webView1);
webview.setWebViewClient(new WebClient()); //
WebSettings set = webview.getSettings();
set.setJavaScriptEnabled(true);
set.setBuiltInZoomControls(true);
//webview.loadUrl("http://www.google.com");
}
})
.setNegativeButton("취소", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
//mtvPhoneNumber.setText("bbb");
}
})
.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sendNotificationSample() {\n Intent notificationIntent = new Intent(GCMIntentService.this, AlertActivity.class);\n\n // Get a PendingIntent containing the entire back stack.\n int i = new Random().nextInt(100);\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(GCMIntentService.this, i, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(GCMIntentService.this);\n\n // Define the notification settings.\n builder.setSmallIcon(R.drawable.icon_v2)\n // In a real app, you may want to use a library like Volley\n // to decode the Bitmap.\n //.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_launcher)).\n .setContentTitle(\"Shang\").setContentText(i + \". This is test mesage from notification\").setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n builder.setSound(alarmSound);\n\n builder.setVibrate(new long[]{0, 2000});\n\n builder.setContentIntent(notificationPendingIntent);\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager = (NotificationManager) GCMIntentService.this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(i, builder.build());\n }",
"private void startPopup(Context context, Long id) {\n\n //Intent emaIntent = new Intent(context, VoiceRecognitionActivity.class); //The activity you want to start.\n //Intent emaIntent = new Intent(context, PopupActivity.class); //The activity you want to start.\n //Log.d(\"Alarm receiver\", \"received intent\");\n Random random = new Random();\n int value = random.nextInt(1);\n Intent emaIntent = new Intent(context, PopupActivity.class);\n emaIntent.putExtra(\"pos\", id);\n\n\n\n// if (value == 1) {\n// emaIntent = new Intent(context, PopupActivity.class); //The activity you want to start.\n// } else {\n// emaIntent = new Intent(context, VoiceRecognitionActivity.class);\n// }\n\n\n\n emaIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(emaIntent);\n }",
"@Override\n protected void onPushOpen(Context context, Intent intent) {\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);\n\n\t\tString title, msg;\n\t\tBundle bun = getIntent().getExtras();\n\t\ttitle = bun.getString(\"title\");\n\t\tmsg = bun.getString(\"msg\");\n\t\tgetURL = bun.getString(\"url\");\n\n\t\tAlertDialog.Builder alertDialog = new AlertDialog.Builder(PushNotification.this);\n\n\t\talertDialog.setPositiveButton(\"닫기\", new AlertDialog.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t//PushWakeLock.releaseCpuLock();\n\t\t\t\tPushNotification.this.finish();\n\t\t\t}\n\t\t});\n\n\t\talertDialog.setNegativeButton(\"보기\", new AlertDialog.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t//KeyguardManager km = (KeyguardManager)getSystemService(KEYGUARD_SERVICE);\n\t\t\t\t//KeyguardManager.KeyguardLock keyLock = km.newKeyguardLock(KEYGUARD_SERVICE);\n\t\t\t\t//keyLock.disableKeyguard(); //순정 락스크린 해제\n\n\t\t\t\t//Intent loadintent = new Intent(PushNotification.this.getApplicationContext(), RuntimeStandAlone.class);\n\t\t\t\tIntent loadintent = new Intent(\"skt.cornerstone.runtime.push\");\n\t\t\t\tif(getURL != null) loadintent.putExtra(UriReceiver.FLAG_DATA, parseUriArgs(getURL));\n\t\t\t\t//loadintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n\t\t\t\tstartActivity(loadintent);\n\t\t\t\tPushNotification.this.finish();\n\t\t\t}\n\t\t});\n\n\t\talertDialog.setIcon(R.drawable.pushicon);\n\t\talertDialog.setTitle(title);\n\t\talertDialog.setMessage(msg);\n\t\t//alertDialog.setView(getLayoutInflater().inflate(R.layout.customdialoglayout, null));\n\t\talertDialog.show();\n\n\t\t//chisu test \n\t\t//\t\tAlertDialog dialog = alertDialog.create();\n\t\t//\t\tdialog.getWindow().getAttributes().windowAnimations = R.style.dialog_animation;\n\t\t//\t\tdialog.getWindow().setGravity(Gravity.BOTTOM);\n\t\t//\t\tdialog.show();\n\n\n\n\t\t//\t\tDialog dialog = new Dialog(this);\n\t\t//\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t//\t\tdialog.setContentView(R.layout.customdialoglayout);\n\t\t//\t\tdialog.getWindow().setGravity(Gravity.TOP);\n\t\t//\t\tdialog.getWindow().getAttributes().windowAnimations = R.style.dialog_animation;\n\t\t//\t\t//dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n\t\t//\t\tdialog.getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.filled_box));\n\t\t//\t\tdialog.setOnDismissListener(new OnDismissListener() {\n\t\t//\t\t\tpublic void onDismiss(DialogInterface dialog) {\n\t\t//\t\t\t\t// TODO Auto-generated method stub\n\t\t//\t\t\t\tPushNotification.this.finish();\n\t\t//\t\t\t}\n\t\t//\t\t});\n\t\t//\t\tdialog.getWindow().findViewById(R.id.cmd_submit).setOnClickListener(this);\n\t\t//\t\tdialog.show();\n\t\t//\n\t\t//\t\timageAnim = (ImageView) dialog.getWindow().findViewById(R.id.image);\n\n\t\t//\t\tanimation = new AnimationDrawable();\n\t\t//\t\tanimation.addFrame(getResources().getDrawable(R.drawable.pushicon), 500);\n\t\t//\t\tanimation.addFrame(getResources().getDrawable(R.drawable.map), 500);\n\t\t//\t\tanimation.addFrame(getResources().getDrawable(R.drawable.default_video_poster), 500);\n\t\t//\t\tanimation.setOneShot(false);\n\t\t//\t\timageAnim.setBackgroundDrawable(animation);\n\t\t//\t\tanimation.start();\n\n\n\n\n\t\t//\t\tAnimationSet rootSet= new AnimationSet(true);\n\t\t//\t\trootSet.setInterpolator(new AccelerateInterpolator(10.0f));\n\t\t//\t\t\n\t\t//\t\tTranslateAnimation trans = new TranslateAnimation(300.0f, 0.0f, 0.0f, 0.0f);\n\t\t//\t\ttrans.setDuration(1500L);\n\t\t//\t\ttrans.setStartOffset(0L);\n\t\t//\t\t\n\t\t//\t\tRotateAnimation rotate = new RotateAnimation(0f, 360f, 0.5f, 0.5f);\n\t\t//\t\trotate.setStartOffset(0L);\n\t\t//\t\trotate.setDuration(2000L);\n\t\t//\t\trotate.setRepeatCount(1);\n\t\t//\t\t\n\t\t//\t\tScaleAnimation scale = new ScaleAnimation(0f, 1f, 0f, 1f, 0.5f, 0.5f);\n\t\t//\t\tscale.setStartOffset(0L);\n\t\t//\t\tscale.setDuration(2000L);\n\t\t//\t\tscale.setFillBefore(true);\n\t\t//\t\t\n\t\t//\t\tAlphaAnimation alpha = new AlphaAnimation(0f, 1f);\n\t\t//\t\talpha.setDuration(1500L);\n\t\t//\t\t\n\t\t//\t\trootSet.addAnimation(trans);\n\t\t//\t\t//rootSet.addAnimation(rotate);\n\t\t//\t\t//rootSet.addAnimation(scale);\n\t\t//\t\trootSet.addAnimation(alpha);\n\t\t//\t\t\n\t\t//\t\trootSet.setStartOffset(1000);\n\t\t//\t\t\n\t\t//\t\timageAnim.startAnimation(rootSet);\n\t\t//\n\n\n\n\t\t//vibration operate\n\t\tVibrator vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);\n\t\tvibrator.vibrate(500);\n\n\t\t//\n\t\tUri ringtoneUri = RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(),RingtoneManager.TYPE_NOTIFICATION);\n\t\tRingtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), ringtoneUri);\n\t\tringtone.play();\n\n\t\t// 폰 설정의 조명시간을 가져와서 해당 시간만큼만 화면을 켠다.\n\t\tint defTimeOut = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 15000);\n\t\tTimerTask task = new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\treleaseCpuLock();\n\t\t\t}\n\t\t};\n\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(task, defTimeOut);\n\n\t}",
"private void showNotification() {\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.food_icon2)\n .setContentTitle(\"Let's eat\")\n .setContentText(\"Good morning, It's time to take your Breakfast :)\");\n\n int mNotificationId = 001;\n\n\n Intent contentIntent = new Intent(this, RecommendationActivity.class);\n contentIntent.putExtra(\"dePagi\", \"pagigan\");\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(RecommendationActivity.class);\n stackBuilder.addNextIntent(contentIntent);\n\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n\n mBuilder.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 });\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n\n mBuilder.setAutoCancel(true);\n\n mNM =(NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n mNM.notify(mNotificationId, mBuilder.build());\n\n stopSelf();\n\n }",
"private void showNotification(int count) {\n\t\tLog.i(\"zlt\", \"showNotification\");\n\t\tNotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tNotificationCompat.Builder builder = new NotificationCompat.Builder(\n\t\t\t\tgetApplicationContext());\n\n\t\tbuilder.setContentTitle(\"通知\")\n\t\t\t\t.setContentText(String.format(\"你有%1$d条新的应急任务\", count))\n\t\t\t\t.setContentIntent(\n\t\t\t\t\t\tgetDefalutIntent(Notification.FLAG_AUTO_CANCEL))\n\t\t\t\t// .setNumber(number)//显示数量\n\t\t\t\t.setTicker(\"新的消息\")// 通知首次出现在通知栏,带上升动画效果的\n\t\t\t\t.setWhen(System.currentTimeMillis())// 通知产生的时间,会在通知信息里显示\n\t\t\t\t.setPriority(Notification.PRIORITY_DEFAULT)// 设置该通知优先级\n\t\t\t\t// .setAutoCancel(true)//设置这个标志当用户单击面板就可以让通知将自动取消\n\t\t\t\t.setOngoing(false)// ture,设置他为一个正在进行的通知。他们通常是用来表示一个后台任务,用户积极参与(如播放音乐)或以某种方式正在等待,因此占用设备(如一个文件下载,同步操作,主动网络连接)\n\t\t\t\t.setDefaults(Notification.DEFAULT_VIBRATE)//\n\t\t\t\t// 向通知添加声音、闪灯和振动效果的最简单、最一致的方式是使用当前的用户默认设置,使用defaults属性,可以组合:\n\t\t\t\t// Notification.DEFAULT_ALL Notification.DEFAULT_SOUND 添加声音 //\n\t\t\t\t// requires VIBRATE permission\n\t\t\t\t.setSmallIcon(R.drawable.app_icon).setAutoCancel(true);\n\t\t// 点击的意图ACTION是跳转到Intent\n\n\t\tIntent resultIntent = new Intent(getApplicationContext(),\n\t\t\t\tActivityInspection.class);\n\t\tresultIntent.putExtra(\"taskType\", 2);\n\t\tresultIntent.putExtra(\"fromService\", true);\n\t\tresultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t// resultIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(\n\t\t\t\tgetApplicationContext(), 0, resultIntent,\n\t\t\t\tPendingIntent.FLAG_UPDATE_CURRENT);\n\t\tbuilder.setContentIntent(pendingIntent);\n\t\tmanager.notify(100, builder.build());\n\n\t}",
"@Override\n public void onClick(View v) {\n Intent intent=new Intent(Intent.ACTION_CALL_BUTTON);\n //intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }",
"private void ShowNotification()\n {\n Notification n = new Notification.Builder(this)\n .setContentTitle(\"Message from Himanshu\")\n .setContentText(\"Thank you Sir. Enjoyed Your Class!\")\n .setSmallIcon(R.drawable.cloud)\n //.setContentIntent(pIntent)\n .setAutoCancel(true)\n //.addAction(R.drawable.icon, \"Call\", pIntent)\n //.addAction(R.drawable.icon, \"More\", pIntent)\n //.addAction(R.drawable.icon, \"And more\", pIntent)\n .getNotification();\n\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n try {\n notificationManager.notify(0, n);\n }catch (Exception ex) {\n Log.d(\"MyApp\", \"Exception Occured!\");\n }\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n // TODO Auto-generated method stub\n //Get notification message from intent, set icon, title, and message\n String message = intent.getStringExtra(\"Message\");\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)\n .setSmallIcon(R.drawable.notification)\n .setContentTitle(\"It's that time of the day!\")\n .setContentText(message);\n\n //Set parent stack so notification goes to Pet menu of app when notification is clicked on\n\n Intent resultIntent = new Intent(context, FeedingActivity.class);\n\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);\n stackBuilder.addParentStack(PetActivity.class);\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n //Set vibration and color of lights (if device supports it)\n\n mBuilder.setVibrate(new long[]{1000, 1000});\n mBuilder.setLights(Color.GREEN, 3000, 3000);\n\n mNotificationManager.notify(1, mBuilder.build());\n\n\n }",
"private void preferences() {\n\tstartActivity (new Intent(getApplicationContext(), PushPreferencesActivity.class));\n}",
"public void showNormalViewNotification(){\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ActivityA.this);\n builder.setContentTitle(\"Normal Regular Notification\");\n builder.setContentText(contentText);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setTicker(\"Hey, This is a ticker!!!!!!\");\n builder.setAutoCancel(true);\n\n\n\n //Provide explicit intents for notification\n Intent i = new Intent(ActivityA.this,ActivityB.class);\n //Add a back stack using task using stack builder and set the intent to pending intent\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(ActivityB.class);\n stackBuilder.addNextIntent(i);\n PendingIntent pi_main =stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for settings\n Intent j = new Intent(ActivityA.this,Settings.class);\n TaskStackBuilder stackBuilder_settings = TaskStackBuilder.create(this);\n stackBuilder_settings.addParentStack(Settings.class);\n stackBuilder_settings.addNextIntent(j);\n PendingIntent pi_settings =stackBuilder_settings.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for help\n Intent k = new Intent(ActivityA.this,Help.class);\n TaskStackBuilder stackBuilder_help = TaskStackBuilder.create(this);\n stackBuilder_help.addParentStack(Help.class);\n stackBuilder_help.addNextIntent(k);\n PendingIntent pi_help =stackBuilder_help.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi_main);\n builder.addAction(R.drawable.settings,\"Settings\",pi_settings);\n builder.addAction(R.drawable.help,\"Help\",pi_help);\n\n\n\n\n\n //Notifications through notification manager\n Notification notification = builder.build();\n NotificationManager manager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);\n manager.notify(1234,notification);\n }",
"void showNotification() {\n Intent notificationIntent = new Intent(mContext, MainActivity.class);\n\n // Construct a task stack.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(mContext);\n\n // Add the main Activity to the task stack as the parent.\n stackBuilder.addParentStack(MainActivity.class);\n\n // Push the content Intent onto the stack.\n stackBuilder.addNextIntent(notificationIntent);\n\n // Get a PendingIntent containing the entire back stack.\n PendingIntent notificationPendingIntent =\n stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n Notification.Builder notificationBuilder = new Notification.Builder(mContext)\n .setContentTitle(getLocationResultTitle())\n .setContentText(getLocationResultText())\n .setSmallIcon(R.mipmap.ic_launcher)\n .setAutoCancel(true)\n .setContentIntent(notificationPendingIntent);\n\n getNotificationManager().notify(0, notificationBuilder.build());\n }",
"private void showBigPictureNotification() {\n Bitmap bmp = BitmapFactory.decodeResource(this.getResources(),R.drawable.food);\n NotificationCompat.BigPictureStyle style = new NotificationCompat.BigPictureStyle();\n style.setBigContentTitle(\"Big pictures regular notification\");\n style.bigPicture(bmp);\n\n\n\n //Build the content of the notification\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ActivityA.this);\n builder.setContentTitle(\"Big Picture Regular Notification\");\n builder.setContentText(contentText);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setTicker(\"Hey, This is a ticker!!!!!!\");\n builder.setAutoCancel(true);\n builder.setStyle(style);\n\n\n //Provide explicit intents for notification\n Intent i = new Intent(ActivityA.this,ActivityB.class);\n //Add a back stack using task using stack builder and set the intent to pending intent\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(ActivityB.class);\n stackBuilder.addNextIntent(i);\n PendingIntent pi_main =stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for settings\n Intent j = new Intent(ActivityA.this,Settings.class);\n TaskStackBuilder stackBuilder_settings = TaskStackBuilder.create(this);\n stackBuilder_settings.addParentStack(Settings.class);\n stackBuilder_settings.addNextIntent(j);\n PendingIntent pi_settings =stackBuilder_settings.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for help\n Intent k = new Intent(ActivityA.this,Help.class);\n TaskStackBuilder stackBuilder_help = TaskStackBuilder.create(this);\n stackBuilder_help.addParentStack(Help.class);\n stackBuilder_help.addNextIntent(k);\n PendingIntent pi_help =stackBuilder_help.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi_main);\n builder.addAction(R.drawable.settings,\"Settings\",pi_settings);\n builder.addAction(R.drawable.help,\"Help\",pi_help);\n\n //Notifications through notification manager\n Notification notification = builder.build();\n NotificationManager manager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);\n manager.notify(9127,notification);\n }",
"public void setNotification( String action, int icon){\n\n PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,\n new Intent(getApplicationContext(),MainActivity.class), 0);\n Notification.Builder notificationBuilder=new Notification.Builder(getApplicationContext()).setTicker(\n \"Momkey \"+ action).setSmallIcon(icon).setAutoCancel(true)\n .setContentText(action).setContentInfo(\"\"+1)\n .setContentTitle(\"MOMKEY\")\n .setContentIntent(contentIntent);\n\n NotificationManager notificationManager =\n (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n\n Notification n = notificationBuilder.build();\n\n n.defaults = Notification.FLAG_AUTO_CANCEL;\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n notificationManager.notify(1111,notificationBuilder.build());\n }\n }",
"@Override\n\t\t public void launchApp(Context context, UMessage msg) {\n\t\t\t\t Toast.makeText(context, \"launchApp:\"+msg.custom, Toast.LENGTH_LONG).show();\n\t\t \t Intent it=new Intent(getApplicationContext(),MainActivity.class);//MenuActivity_VC\n\t\t \t\t it.putExtra(\"notify\", msg.custom);\n\t\t \t\t startActivity(it);\n\t\t\t }",
"public static void createNotification(MainActivity a, CustomFBProfile profile, IMessagingMetaData meta, HashMap<String, String> loc) {\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(a)\n .setSmallIcon(R.drawable.acba)\n .setContentTitle(\"New Message\")\n .setContentText(meta.getName().toUpperCase()).setTicker(\"New Message!!\");\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n mBuilder.setStyle(inboxStyle);\n mBuilder.setVibrate(new long[]{2000, 2000, 1000});\n mBuilder.setLights(Color.RED, 3000, 3000);\n mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));\n mBuilder.setAutoCancel(true);\n\n// Creates an explicit intent for an Activity in your app\n Intent resultIntent = a.startMessagingActivityFromAnywhereInApp(profile, meta, loc);\n\n// The stack builder object will contain an artificial back stack for the\n// started Activity.\n// This ensures that navigating backward from the Activity leads out of\n// your application to the Home screen.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(a);\n// Adds the back stack for the Intent (but not the Intent itself)\n stackBuilder.addParentStack(MainActivity.class);\n// Adds the Intent that starts the Activity to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) a.getSystemService(Context.NOTIFICATION_SERVICE);\n// mId allows you to update the notification later on.\n mNotificationManager.notify(1, mBuilder.build());\n }",
"public void sendTestNotification() {\n\n Log.d(TAG, \"version: \" + Build.VERSION.SDK_INT);\n // Create an explicit intent for an Activity in your app\n Intent intent = new Intent(context, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);\n\n final int NOTIFICATION_ID = 1;\n final String NOTIFICATION_CHANNEL_ID = \"my_notification_channel\";\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, channelId)\n .setSmallIcon(R.drawable.alarm_sound_icon) // icon must be right size for all supported APIs. Icon is changeable\n .setContentTitle(\"IDO\") // changeable\n .setContentText(\"Become A Better Spouse Today!\") // changeable\n .setPriority(NotificationCompat.PRIORITY_DEFAULT) // changeable\n .setContentIntent(pendingIntent)\n .setVisibility(Notification.VISIBILITY_PUBLIC) // changeable\n .setAutoCancel(true);\n\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);\n\n // notificationId is a unique int for each notification that you must define\n notificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent =new Intent();\r\n\t\t\t\tintent.setAction(\"tijiaodingdan\");\r\n\t\t\t\tintent.putExtra(\"yisheng\", name);\r\n\t\t\t\tintent.putExtra(\"keshi\", keshitxt);\r\n\t\t\t\tintent.putExtra(\"yishengtype\", yisheng_type);\r\n//\t\t\t\tintent.putExtra(\"time\", shijian);\r\n\t\t\t\tintent.putExtra(\"free\", free);\r\n\t\t\t\tintent.putExtra(\"data\", data);\r\n\t\t\t\tintent.putExtra(\"postion\", postion);\r\n\t\t\t\t startActivity(intent);\r\n\t\t\t\t popuWindow.dismiss();\r\n\t\t\t\t WindowManager.LayoutParams params=context.getWindow().getAttributes(); \r\n\t\t\t params.alpha=1f; \r\n\t\t\t context.getWindow().setAttributes(params); \r\n\t\t\t}",
"public NotificationCompat.Builder getChannel1Notification(String message){\n\n Intent confirmIntent = new Intent(this, Alarm2Activity.class); //can create an activity here that simply says \"Take med\"\n confirmIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n confirmIntent.setAction(YES_ACTION);\n\n Intent openAppIntent = new Intent(this, MedicineActivity.class); //can create an activity here that simply says \"Take med\"\n openAppIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\n //processIntentAction(getIntent()); //where to put this???\n\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), Channel1_ID)\n .setContentTitle(getString(R.string.med_notif_title))\n .setContentText(message)\n .setContentIntent(PendingIntent.getActivity(this, REQUEST_CODE, openAppIntent, PendingIntent.FLAG_UPDATE_CURRENT))\n .setSmallIcon(R.drawable.ic_blur_circular_black_24dp) //setLargeIcon as a picture of a pill\n .addAction(new NotificationCompat.Action(\n R.drawable.ic_blur_circular_black_24dp,\n getString(R.string.confirm_med_taken),\n PendingIntent.getActivity(this, REQUEST_CODE, confirmIntent, PendingIntent.FLAG_UPDATE_CURRENT)))\n .setCategory(NotificationCompat.CATEGORY_REMINDER)\n .setAutoCancel(true);\n //.setTimeOutAfter()\n //.setStyle(new NotificationCompat.BigTextStyle().bigText(context.getString(message)))\n //.setColor(ContextCompat.getColor(context, R.color.colorPrimary))\n //.setTimeOutAfter();\n\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && Build.VERSION.SDK_INT < Build.VERSION_CODES.O){\n notificationBuilder.setPriority(NotificationCompat.PRIORITY_HIGH);\n }\n\n return notificationBuilder;\n }",
"public void btnpress(View view) {\n NewMessageNotification newMessageNotification = new NewMessageNotification();\n newMessageNotification.notify(MainActivity.this,\"Danger\",1);\n }",
"public void onClick2(View v) {\n\n\n PackageManager pm = getPackageManager();\n Intent intent = pm.getLaunchIntentForPackage(\"com.lee.test\");\n\n if (intent != null) {\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }else {\n Toast.makeText(MainActivity.this,\"空intent\",Toast.LENGTH_SHORT).show();\n }\n\n\n }",
"private void goforeground() {\n //CREATES NOTIFICATION\n Intent openappintent = new Intent(this, MainActivity.class);\n PendingIntent openapppendingIntent = PendingIntent.getActivity(this, 0, openappintent, 0);\n\n Intent resettrackingserviceintent = new Intent(this, PostureService.class);\n resettrackingserviceintent.putExtra(PACKAGE_NAME + \".myaction\", intentresetid);\n PendingIntent resettrackingpendingIntent = PendingIntent.getService(this, 56, resettrackingserviceintent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n Intent pauseserviceintent = new Intent(this, PostureService.class);\n pauseserviceintent.putExtra(PACKAGE_NAME + \".myaction\", intentpauseid);\n PendingIntent pausependingpendingIntent = PendingIntent.getService(this, 43, pauseserviceintent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n Intent exitserviceintent = new Intent(this, PostureService.class);\n exitserviceintent.putExtra(PACKAGE_NAME + \".myaction\", intentexitid);\n PendingIntent exitpendingpendingIntent = PendingIntent.getService(this, 54, exitserviceintent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this.getBaseContext());\n\n if (!pausetracking) {\n builder.setContentTitle(getString(R.string.slouchierunning));\n pauseaction = new NotificationCompat.Action(R.drawable.ic_pause_circle_outline_black_24dp, getString(R.string.pause), pausependingpendingIntent);\n } else {\n pauseaction = new NotificationCompat.Action(R.drawable.ic_pause_circle_filled_black_24dp, getString(R.string.paused), pausependingpendingIntent);\n builder.setContentTitle(getString(R.string.slouchiepaused));\n\n }\n\n builder\n .setColor(Color.rgb(43, 169, 224))\n .setSmallIcon(R.drawable.notification_icon)\n .setContentIntent(openapppendingIntent);\n if (countdown == 0) {\n builder.setPriority(Notification.PRIORITY_DEFAULT);\n\n builder\n .addAction(R.drawable.ic_refresh_black_24dp, getString(R.string.reset), resettrackingpendingIntent)\n .addAction(pauseaction)\n .addAction(R.drawable.ic_highlight_off_black_24dp, getString(R.string.exit), exitpendingpendingIntent);\n }\n\n if (countdown > 0 && !pausetracking) {\n builder.setPriority(Notification.PRIORITY_HIGH)\n .setVibrate(new long[50]);\n builder.setContentText(getString(R.string.situpright) + \" \" + String.valueOf(countdown) + \" \" + getString(R.string.seconds))\n .setProgress(resettime / resetsteptime, resettime / resetsteptime - countdown, false)\n .setContentTitle(getString(R.string.slouchiestarting));\n }\n\n\n posturenotification = builder.build();\n startForeground(55, posturenotification);\n }",
"@Override\n public void onClick(View view) {\n // Create a new intent\n Intent new_release_intent = new Intent(VietPopActivity.this, MainActivity.class);\n new_release_intent.putExtra(\"uniqueid\",\"from_viet\");\n // Start the new activity\n startActivity(new_release_intent);\n }",
"private void showBigTextNotification() {\n NotificationCompat.BigTextStyle style = new NotificationCompat.BigTextStyle();\n style.setBigContentTitle(\"BigText Regular Notification\");\n style.bigText(contentText);\n\n //Build the content of the notification\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ActivityA.this);\n builder.setContentTitle(\"Big Text Regular Notification\");\n builder.setContentText(contentText);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setTicker(\"Hey, This is a ticker!!!!!!\");\n builder.setAutoCancel(true);\n\n\n //Provide explicit intents for notification\n Intent i = new Intent(ActivityA.this,ActivityB.class);\n //Add a back stack using task using stack builder and set the intent to pending intent\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(ActivityB.class);\n stackBuilder.addNextIntent(i);\n PendingIntent pi_main =stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for settings\n Intent j = new Intent(ActivityA.this,Settings.class);\n TaskStackBuilder stackBuilder_settings = TaskStackBuilder.create(this);\n stackBuilder_settings.addParentStack(Settings.class);\n stackBuilder_settings.addNextIntent(j);\n PendingIntent pi_settings =stackBuilder_settings.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for help\n Intent k = new Intent(ActivityA.this,Help.class);\n TaskStackBuilder stackBuilder_help = TaskStackBuilder.create(this);\n stackBuilder_help.addParentStack(Help.class);\n stackBuilder_help.addNextIntent(k);\n PendingIntent pi_help =stackBuilder_help.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi_main);\n builder.addAction(R.drawable.settings,\"Settings\",pi_settings);\n builder.addAction(R.drawable.help,\"Help\",pi_help);\n\n builder.setStyle(style);\n //Notifications through notification manager\n Notification notification = builder.build();\n NotificationManager manager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);\n manager.notify(987,notification);\n }",
"public void onClick(DialogInterface dialog, int id) {\n Constants.APP_UPDATE_FLAG = true;\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\"market://details?id=in.org.klp.ilpkonnect\"));\n startActivity(intent);\n }",
"private void sendNotification() {\n int mNotificationId = 001;\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_action_camera)\n .setContentTitle(\"Daily Selfie\")\n .setContentText(\"Time for another selfie\");\n Intent resultIntent = new Intent(this, MainActivity.class);\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n // Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n // Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_settings);\n\n String text = \"lol\";\n\n NotificationCompat.Builder mBuilder =\n (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(\"Hello World!\");\n\n\n Intent resultIntent = new Intent(this, MainActivity.class);\n\n // Because clicking the notification opens a new (\"special\") activity, there's\n // no need to create an artificial back stack.\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n\n\n mBuilder.setContentIntent(resultPendingIntent);\n\n\n // NotificationCompat.Builder mBuilder;\n // Sets an ID for the notification\n // Use the notify() method to issue the notification. When you call notify(), specify a notification ID. You can use\n // this ID to update the notification later on. This is described in more detail in Managing Notifications.\n // http://developer.android.com/training/notify-user/managing.html\n int mNotificationId = 001;\n// Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n// Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n\n }",
"private void showPriorityPopUp() {\n PopupMenu popup = new PopupMenu(rootView.getContext(), rootView.findViewById(R.id.img_overflow));\n //Inflating the Popup using xml file\n popup.getMenuInflater().inflate(R.menu.post_priority_menu, popup.getMenu());\n\n //registering popup with OnMenuItemClickListener\n popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {\n public boolean onMenuItemClick(MenuItem item) {\n Toast.makeText(rootView.getContext(), \"You Clicked : \" + item.getTitle(), Toast.LENGTH_SHORT).show();\n return true;\n }\n });\n\n popup.show();//showing popup menu\n }",
"private void showNotification() {\n Intent intent = new Intent(this, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n Notification notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(PendingIntent.getActivity(this, 0, intent, 0))\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentText(getText(R.string.local_service_running))\n .setContentTitle(getText(R.string.local_service_notification)).build();\n notificationManager.notify(NOTIFICATION, notification);\n }",
"void makeNotification(){\n\n\n ++count;\n Toast.makeText(this, \"Congrats! MyService Notify \"+count, Toast.LENGTH_SHORT).show();\n NotificationCompat.Builder builder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"My Notification Title \"+count)\n .setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE)\n .setContentText(\"Something interesting happened \"+count);\n int NOTIFICATION_ID = 12345;\n\n //Add sound in notification here.\n Intent targetIntent = new Intent(this, MainActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0, targetIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setContentIntent(contentIntent);\n NotificationManager nManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n nManager.notify(NOTIFICATION_ID, builder.build());\n }",
"private void showNotificationCourse(Bundle data) {\n\n/* try {\n int unreadNotificationCount = Integer.valueOf(data.getString(\"total_unread_notification\"));\n NotificationCountEventBus.Event event = new NotificationCountEventBus.Event(unreadNotificationCount);\n NotificationCountEventBus.getInstance().post(event);\n } catch (Exception ignored) {\n\n }*/\n\n // check the type_push from data and navigate to activity\n Intent intent = navigateNotification(data);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, notificationId, intent,\n PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\n\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(getNotificationIcon())\n .setContentTitle(data.getString(\"title\"))\n .setContentText(data.getString(\"body\"))\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(notificationId++, notificationBuilder.build());\n }",
"private void launchActivity(String title, String url){\n // package intent\n // start activity\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext, \"default\");\n\n String content = \"The instruction for \" + title + \" can be found here!\";\n\n //set icons\n builder.setSmallIcon(android.R.drawable.btn_star);\n builder.setStyle(new NotificationCompat.BigTextStyle(builder).bigText(content));\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n\n // create a pending intent for the notification with the intent I created\n PendingIntent pendingIntent = PendingIntent.getActivity(mContext,0, intent, 0);\n builder.setContentIntent(pendingIntent);\n\n //set the title and content of the notification\n builder.setContentTitle(\"Cooking Instruction\");\n builder.setContentText(content);\n\n // get the system service to display this notification\n NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(NOTIFICATION_SERVICE);\n\n //notify\n notificationManager.notify(1, builder.build());\n\n\n }",
"private void showIfPendingPushNotification() {\n if (mIsActivityResumedFromSleep) {\n PushNotificationMessageHandler.getInstance(this).showPendingPushNotification();\n PushNotificationMessageHandler.getInstance(this).clearPushNotificationFromBar();\n }\n }",
"public void showNotification(String title,String message)\n {\n\n Bitmap icon = BitmapFactory.decodeResource(this.getResources(),\n R.drawable.girl);\n// NotificationCompat.Builder builder = new NotificationCompat.Builder(this,\"Notify\")\n// .setContentTitle(title).setSmallIcon(R.drawable.common_google_signin_btn_icon_dark)\n\n// // .addAction(R.drawable.user,\"Pay\",payInent)\n// //.addAction(R.drawable.user,\"Pay Later\",payLaterInent)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setPriority(NotificationManager.IMPORTANCE_HIGH)\n// .setAutoCancel(true).setContentText(message).setLargeIcon(icon)\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).bigLargeIcon(null));\n\n// NotificationCompat.Builder builder;\n// builder = new NotificationCompat.Builder(this, \"Notify\");\n// builder.setContentTitle(title) // required\n// .setSmallIcon(R.drawable.user) // required\n// .setContentText(message) // required\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).setSummaryText(\"\"))\n// .setAutoCancel(true)\n// .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})\n// .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)\n// .setPriority(NotificationCompat.PRIORITY_HIGH)\n// ;\n\n Notification notification = null;\n if( message.charAt(0) == 'C' )\n {\n// Intent intent = new Intent(this, PayLater.class);\n Intent intent = new Intent(this, PayLaterTest.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Pay\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'G' )\n {\n //start activity go in\n Intent intent = new Intent(this, PayActivity.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Verify\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'I' )\n {\n //start activity invalid slot\n// Intent intent = new Intent(this, PayActivity.class);\n\n// PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setAutoCancel(true)\n .setVibrate(new long[0])// heads-up\n // .addAction(R.drawable.user,\"Verify\",payInent)\n .build();\n }\n\n m = (NotificationManager) getSystemService(getApplicationContext().NOTIFICATION_SERVICE);;\n m.notify(999,notification);\n // m.cancel(999);\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n\n long when = System.currentTimeMillis();\n NotificationManager notificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n\n Intent notificationIntent = new Intent(context, MainActivity.class);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,\n notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(\n context).setSmallIcon(R.drawable.ic_file_download)\n .setContentTitle(\"App of the Day\")\n .setContentText(\"Get today's App of the Day...\").setSound(alarmSound)\n .setAutoCancel(true).setWhen(when)\n .setContentIntent(pendingIntent)\n .setVibrate(new long[]{1000, 1000, 1000, 1000, 1000});\n notificationManager.notify(MID, mNotifyBuilder.build());\n MID++;\n\n }",
"private void setUpNotification() {\n if (getIntent().getExtras() != null) {\n for (String key : getIntent().getExtras().keySet()) {\n Object value = getIntent().getExtras().get(key);\n Logger.e(\"Key: \" + key + \" Value: \" + value);\n\n if(key.equals(\"Key\")) {\n try {\n String idStr = String.valueOf(value);\n int id = Integer.parseInt(idStr);\n onOpenJobItem(id);\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n\n }\n }\n // [END handle_data_extras]\n }",
"@Override\n protected void onNewIntent(Intent intent) {\n\n Bundle bundle=intent.getExtras();\n int uniqueFlagID=1;\n if(bundle!=null && (bundle.getInt(\"uniqueAppId\") > 0)) {\n DBAdapter adapter = new DBAdapter(getApplicationContext());\n adapter.getUpdatePresFlag(bundle.getString(\"type\"), bundle.getInt(\"uniqueAppId\"), \"1\");\n String AppointmentMessage1 = bundle.getString(AlarmReceiver.APPOINTMENT_MESSAGE);\n ApplicationBackgroundCheck.showNotificationDialog(\"Appointment Alert\", AppointmentMessage1, \"App\",uniqueFlagID,getApplicationContext(),getFragmentManager());\n }\n if(bundle!=null && (bundle.getInt(\"presUniqueId\") > 0)) {\n DBAdapter adapter = new DBAdapter(getApplicationContext());\n adapter.getUpdatePresFlag(bundle.getString(\"type\"),bundle.getInt(\"presUniqueId\"),\"1\");\n String RenewalMessage = bundle.getString(AlarmReceiver.PRESCRIPTION_RENEWAL_MESSAGE);\n ApplicationBackgroundCheck.showNotificationDialog(\"Prescription Renewal Alert\", RenewalMessage, \"PRES\",uniqueFlagID,getApplicationContext(),getFragmentManager());\n }\n if(bundle!=null && (bundle.getString(\"type\").equals(\"MED_TIT\"))) {\n String TitrationMessage = bundle.getString(AlarmReceiver.MEICATION_TITRATION_MESSAGE);\n ApplicationBackgroundCheck.showNotificationDialog(\"Medication Titration Alert\", TitrationMessage, \"MED_TIT\", uniqueFlagID,getApplicationContext(),getFragmentManager());\n }\n if(bundle!=null && (bundle.getString(\"type\").equals(\"EME\"))) {\n DBAdapter adapter= new DBAdapter(getApplicationContext());\n adapter.getUpdateReminderFlag(bundle.getString(\"type\"), bundle.getInt(\"id\"),\"1\");\n String EmergencyMedicationMessage = bundle.getString(AlarmReceiver.EMERGENCY_MEDICATION_MESSAGE);\n ApplicationBackgroundCheck.showNotificationDialog(\"Emergency Medication Alert\", EmergencyMedicationMessage, \"EME\",uniqueFlagID,getApplicationContext(),getFragmentManager());\n\n }\n\n\n }",
"private void sendNotification(PanicIncidentDTO simpleMessage) {\n// Intent intent = new Intent(this, SimpleMessagingActivity.class);\n// intent.putExtra(\"simpleMessage\",simpleMessage);\n// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n// PendingIntent pendingIntent = PendingIntent.getActivity(this,\n// LOCATION_REQUEST_CODE, intent,\n// PendingIntent.FLAG_ONE_SHOT);\n\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_favorite)\n .setContentTitle(\"Message received\")\n .setContentText(simpleMessage.getPanicType().getName())\n .setAutoCancel(true)\n .setSound(defaultSoundUri);\n// .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n TextView packagename = (TextView) view.findViewById(R.id.app_package);\n pname = (String) packagename.getText();\n\n TextView appname = (TextView) view.findViewById(R.id.app_name);\n aname = (String) appname.getText();\n\n try {\n //To start the selected application on selecting from the list\n Intent intent = packageManager.getLaunchIntentForPackage(pname);\n Intent sendStuff = new Intent(context.getApplicationContext(), MyAlert.class);\n PakageName = pname;\n AppName = aname;\n if (intent != null) {\n\n //startActivity(intent);\n //Toast.makeText(getApplicationContext(),PakageName,Toast.LENGTH_LONG).show();\n\n DialogUp();\n }\n\n } catch (ActivityNotFoundException nf) {\n } catch (Exception e) {\n }\n\n // Get instance of Vibrator from current Context\n Vibrator mVibrator = (Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE);\n mVibrator.vibrate(80);\n }",
"private void setupAddPotLaunch() {\n Button startAddPot = (Button) findViewById(R.id.btn_add_pot);\n startAddPot.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent AddPotintent = AddPot.makeIntent(MainActivity.this);\n startActivityForResult(AddPotintent, REQUEST_CODE_NEWPOT);\n }\n });\n }",
"private void sendNotification(String title, String messageBody,int count,int chatcount,int id) {\n Intent intent = new Intent(this, Home.class);\n intent.putExtra(\"title\",title);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n String message;\n if(count<=1){\n message = messageBody;\n }\n else{\n if(chatcount==1)\n message = count +\" new messages \";\n else {\n\n\n message = count + \" new messages from \" + chatcount + \" chats.\";\n title=\"Icebreaker\";\n }\n\n }\n\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(title)\n .setContentText(message)\n .setAutoCancel(true)\n .setGroupSummary(true)\n .setGroup(GROUP_KEY_EMAILS)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(id, notificationBuilder.build());\n }",
"public void onClickDeclineSignal(View view) {\n\n NotificationManager myNotMng = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // prepare intent which is triggered if the\n // notification is selected\n\n Intent myNotiIntent = new Intent(this,NotificationActivity.class);\n\n /* A pending intent is a token that you give to another application,\n which allows this other application to use the permissions of your application to execute a predefined piece of code.*/\n\n PendingIntent myPenNotiIntent = PendingIntent.getActivity(this, 0, myNotiIntent, 0);\n\n // build notification\n\n NotificationCompat.Builder notiSmartHome = new NotificationCompat.Builder(this)\n .setContentTitle(\"SmartHome-Alert\")\n .setContentText(\"Pending SmartHome protocol\")\n .setSmallIcon(R.drawable.notiiconalert2) //smallIcon = icon showed in status bar\n .setContentIntent(myPenNotiIntent);\n\n\n notiSmartHome.setContentIntent(myPenNotiIntent);\n notiSmartHome.setAutoCancel(true);\n notiSmartHome.setLights(Color.GREEN, 500, 500); // set device LEDs when pending notification\n long[] pattern = {500,500,500,500,500,500,500,500,500}; //vibrate pattern\n notiSmartHome.setVibrate(pattern); //vibrate with defined pattern when notification is pending\n\n Uri myNotifSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n notiSmartHome.setSound(myNotifSound);\n\n myNotMng.notify(1,notiSmartHome.build());\n\n finish();\n\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, TriggerActivity.class);\n startActivity(intent);\n }",
"@Override\n\n public void onCreate() {\n\n\n Intent notificationIntent = new Intent(this, MainActivity.class);\n\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\n contentIntent = PendingIntent.getActivity(\n\n this, 0, notificationIntent, 0);//gets this activity with permissions and code\n\n\n updateNotification(false);\n\n\n mLocationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n //handle the return handle to a system level service\n\n mLocationManager.addGpsStatusListener(this);\n //after handling the system level service then get the gps status\n\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 500, 0, this);\n //request location with specific criteria equals to zero, and the provider and this intent\n //and min time\n\n }",
"private void sendNotification(String notificationDetails)\r\n {\n NotificationManager notificationManager =\r\n (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\r\n\r\n // 2. Create a PendingIntent for AllGeofencesActivity\r\n Intent intent = new Intent(this, MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n PendingIntent pendingNotificationIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n // 3. Create and send a notification\r\n Notification notification = new NotificationCompat.Builder(this)\r\n .setSmallIcon(R.mipmap.ic_launcher)\r\n .setContentTitle(\"notification,\")\r\n .setContentText(notificationDetails)\r\n .setContentIntent(pendingNotificationIntent)\r\n .setStyle(new NotificationCompat.BigTextStyle().bigText(notificationDetails))\r\n .setPriority(NotificationCompat.PRIORITY_HIGH)\r\n .setAutoCancel(true)\r\n .build();\r\n notificationManager.notify(0, notification);\r\n\r\n\r\n\r\n\r\n }",
"@Override\n public void run() {\n Intent intent=new Intent(getApplicationContext(),WhatsApp.class);\n startActivity(intent);\n Toast.makeText(MainActivity.this, \"success\", Toast.LENGTH_SHORT).show();\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\r\n\t\t\t\t popuWindow.dismiss();\r\n\t\t\t\t WindowManager.LayoutParams params=context.getWindow().getAttributes(); \r\n\t\t\t params.alpha=1f; \r\n\t\t\t context.getWindow().setAttributes(params); \r\n\t\t\t}",
"public void onClick(View v) {\n Toast toast = Toast.makeText(getApplicationContext(), \"This button will launch my Build It Bigger app!\", Toast.LENGTH_SHORT);\n toast.show();\n }",
"private void sendNotificationLocalToUser() {\n\n Intent notificationIntent = new Intent(this, GameScreenActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);\n Notification.Builder builder = new Notification.Builder(this);\n builder.setAutoCancel(false);\n\n if ((currentPlay + 1)<= Utility.game.getLength()) {\n// notification.setLatestEventInfo(GameScreenActivity.this, \"Game in progress\", \"Play \" + (currentPlay + 1) + \" started get your guess in.\", pendingIntent);\n\n// builder.setTicker(\"this is ticker text\");\n builder.setContentTitle(\"Game in progress\");\n builder.setContentText(\"Play \" + (currentPlay + 1) + \" started get your guess in.\");\n builder.setSmallIcon(R.drawable.ic_launcher);\n builder.setContentIntent(pendingIntent);\n builder.setOngoing(true);\n// builder.setSubText(\"This is subtext...\"); //API level 16\n builder.setNumber(100);\n builder.build();\n\n }else{\n notificationIntent = new Intent(this,FinalLeaderBoardActivity.class);\n pendingIntent = PendingIntent.getActivity(this,0,notificationIntent,0);\n// notification.setLatestEventInfo(GameScreenActivity.this, \"Game completed\", \"Your game is complete. Check the final leaderboard.\", pendingIntent);\n\n// builder.setTicker(\"this is ticker text\");\n builder.setContentTitle(\"Game completed\");\n builder.setContentText(\"Your game is complete. Check the final leaderboard.\");\n builder.setSmallIcon(R.drawable.ic_launcher);\n builder.setContentIntent(pendingIntent);\n builder.setOngoing(true);\n// builder.setSubText(\"This is subtext...\"); //API level 16\n builder.setNumber(100);\n builder.build();\n\n }\n\n notification = builder.getNotification();\n notification.defaults = Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND;\n\n notificationManager.notify(9999, notification);\n }",
"private void sendMyNotification(String title, String message, String type, String Branch_Id) {\n\n\n Intent intent = new Intent(this, ActivityWithNavigationMenuPatient.class);\n intent.putExtra(\"push\", \"1\");\n intent.putExtra(\"Branch_Id\", Branch_Id);\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\n\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(title)\n .setContentText(message)\n .setAutoCancel(true)\n .setSound(soundUri)\n .setChannelId(\"my_channel_id_00011\") // set channel id\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(1224, notificationBuilder.build());\n }",
"public void oreo(String t, String d){\n String id = \"messange\";\n\n NotificationManager nm = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(),id);\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);\n Intent intent = new Intent(getApplicationContext(), Menu_principla_Activity.class);\n\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n NotificationChannel nc = new NotificationChannel(id,\"nuevo\",NotificationManager.IMPORTANCE_HIGH);\n nc.setDescription(\"Notification FCM\");\n nc.setShowBadge(true);\n assert nm != null;\n System.out.println(\"Bandera 1\");\n nm.createNotificationChannel(nc);\n }\n/*\n\n\n // intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),1,intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setAutoCancel(true)\n .setWhen(System.currentTimeMillis())\n .setContentTitle(t).setCategory(Notification.CATEGORY_SERVICE)\n .setDefaults(Notification.DEFAULT_ALL)\n .setSound(soundUri)\n .setTicker(\"Nueva notification\")\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentText(d)\n .setContentIntent(pendingIntent)\n .setContentInfo(\"nuevo\")\n .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});\n\n Random random = new Random();\n int idNotify = random.nextInt(8000);\n\n assert nm != null;\n nm.notify(idNotify,builder.build());\n\n */\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),1,intent, PendingIntent.FLAG_UPDATE_CURRENT);\n notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(pendingIntent)\n .setSmallIcon(R.drawable.ic_medical_services_black_24dp)\n .setSound(soundUri)\n .setAutoCancel(true)\n .setContentTitle(t).setCategory(Notification.CATEGORY_SERVICE)\n .setContentText(d).build();\n nm.notify(1,notification);\n\n System.out.println(\"Bandera 2\");\n }",
"public void sendNotification(View view) {\n\n NotificationManager nm= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){\n\n //We have to create a notification channel\n NotificationChannel nc = new NotificationChannel(\"srminterns\",\"SRM NOTIFICATIONS\",NotificationManager.IMPORTANCE_HIGH);\n nm.createNotificationChannel(nc);\n\n }\n\n // we have to normally write notification code.\n\n NotificationCompat.Builder builder=new NotificationCompat.Builder(this,\"srminterns\");\n builder.setSmallIcon(R.drawable.umbrella);\n builder.setContentTitle(\"Sample Notification\");\n builder.setContentText(\"This is the description of the notification\");\n builder.setAutoCancel(true);\n\n /* Pending Intent\n * - It is the description of the operation to be performed\n * - can be created using the following methods\n * -getActivity() - if you want to open an activity with pending Intent\n * -getService() - if you want to strat a service with Pending Intent\n * -getBroadcast() - if you want to send a broadcast with Pending Intent\n *\n * Requires 4 Arguments\n * -context\n * -Pending Intent ID (Can be any Integer)\n * -Intent(Action that you want to perform)\n * - FLAG (This flag will tell the existing pending Intent about what to do if there\n * is a new Pending Intent (Arrival) */\n\n PendingIntent pi = PendingIntent.getActivity(this,12,new Intent(this, MainActivity.class)\n ,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi);\n\n /*\n * Step1: is to convert any image format that you want to display into a Bitmap image format\n * Step2: is to create bigPicture style before you issue the notification.\n *\n *\n *\n *\n * */\n\n Bitmap bitmap= BitmapFactory.decodeResource(getResources(),R.drawable.kathmandu);\n builder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmap));\n nm.notify(42,builder.build());\n }",
"private void handleNow(RemoteMessage remoteMessage) {\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n String CHANNEL_ID_CHAT = \"myapp-01\";\n String CHANNEL_ID_GENERAL = \"myapp-02\";\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n // Channel 1\n CharSequence chatChannel = \"Chat\";\n String chatChannelDesc = \"Notifications from chat app\";\n int chatImportance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel mChatChannel = new NotificationChannel(CHANNEL_ID_CHAT, chatChannel, chatImportance);\n mChatChannel.setDescription(chatChannelDesc);\n mChatChannel.enableLights(true);\n mChatChannel.setLightColor(Color.BLUE);\n notificationManager.createNotificationChannel(mChatChannel);\n\n // Channel 2\n CharSequence generalChannel = \"General\";\n String generalChannelDesc = \"General notifications\";\n int generalImportance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel mGeneralChannel = new NotificationChannel(CHANNEL_ID_GENERAL, generalChannel, generalImportance);\n mGeneralChannel.setDescription(generalChannelDesc);\n mGeneralChannel.enableLights(true);\n mGeneralChannel.setLightColor(Color.BLUE);\n notificationManager.createNotificationChannel(mGeneralChannel);\n\n }\n\n // Sending push notification to spesific channel\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n Intent intent1 = new Intent(getApplicationContext(), MainActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 123, intent1, PendingIntent.FLAG_UPDATE_CURRENT);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID_CHAT)\n .setSmallIcon(R.drawable.xmen)\n .setBadgeIconType(R.drawable.xmen)\n .setChannelId(CHANNEL_ID_CHAT)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent)\n .setNumber(1)\n .setSound(defaultSoundUri)\n .setColor(ContextCompat.getColor(this, R.color.white))\n .setWhen(System.currentTimeMillis());\n\n if (remoteMessage.getData().size() > 0) {\n notificationBuilder.setContentTitle(remoteMessage.getData().get(\"title\"));\n notificationBuilder.setContentText(remoteMessage.getData().get(\"message\"));\n }\n\n notificationManager.notify(getID(), notificationBuilder.build());\n }",
"public static void showNewNotification(Context context, Intent intent, String title, String msg, Bitmap bitmap) {\n\n Uri notificationSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n Intent notificationIntent;\n\n if (intent != null) {\n notificationIntent = intent;\n }\n else {\n notificationIntent = new Intent(context.getApplicationContext(), WalletHomeActivity.class);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\n }\n\n PendingIntent pendingIntent = PendingIntent.getActivity((context), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT| PendingIntent.FLAG_ONE_SHOT);\n\n\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);\n\n\n Notification.Builder builder = new Notification.Builder(context);\n if (bitmap != null)\n builder.setStyle(new Notification.BigPictureStyle().bigPicture(bitmap));\n\n\n // Create Notification\n Notification notification = builder\n .setContentTitle(title)\n .setContentText(msg)\n .setTicker(context.getString(R.string.app_name))\n .setSmallIcon(R.drawable.logo_vector)\n .setSound(notificationSound)\n .setLights(Color.RED, 3000, 3000)\n .setVibrate(new long[] { 1000, 1000 })\n .setWhen(System.currentTimeMillis())\n .setDefaults(Notification.DEFAULT_SOUND)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent)\n .build();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)\n {\n String channelId = \"121\";\n NotificationChannel channel = new NotificationChannel(\n channelId,\n \"Channel eMaisha Pay\",\n NotificationManager.IMPORTANCE_HIGH);\n notificationManager.createNotificationChannel(channel);\n builder.setChannelId(channelId);\n }\n\n notificationManager.notify(NOTIFICATION_REQUEST_CODE, notification);\n\n }",
"@Override\nprotected void onResume() {\n\tsuper.onResume();\n\t//Toast.makeText(getApplicationContext(), \"onResume\", 1).show();\n}",
"@Override\n public void onClick(View view) {\n PopupMenu popup = new PopupMenu(Settings.this, view);\n //Inflating the Popup using xml file\n popup.getMenuInflater().inflate(R.menu.langmenu, popup.getMenu());\n\n //registering popup with OnMenuItemClickListener\n popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {\n public boolean onMenuItemClick(MenuItem item) {\n if (item.getItemId()==R.id.one)\n {\n Constants.ChangeLang( \"ar\", Settings.this);\n Intent intent = new Intent(getApplicationContext(), SplachScreen.class);\n //In API level 11 or greater, use FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_NEW_TASK flag on Intent to clear all the activity stack.\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }else if (item.getItemId()==R.id.two)\n {\n Constants.ChangeLang( \"en\", Settings.this);\n Intent intent = new Intent(getApplicationContext(), SplachScreen.class);\n //In API level 11 or greater, use FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_NEW_TASK flag on Intent to clear all the activity stack.\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }\n return true;\n }\n });\n\n popup.show();//showing popup menu\n }",
"private static void createNotification(Activity a, CustomFBProfile prof) {\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(a)\n .setSmallIcon(R.drawable.acba)\n .setContentTitle(\"New Message\")\n .setTicker(\"New Message!!\");\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n mBuilder.setStyle(inboxStyle);\n mBuilder.setVibrate(new long[]{2000, 500, 500, 250});\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));\n mBuilder.setAutoCancel(true);\n\n// Creates an explicit intent for an Activity in your app\n Intent resultIntent = new Intent(a, LoginActivity.class);\n\n// The stack builder object will contain an artificial back stack for the\n// started Activity.\n// This ensures that navigating backward from the Activity leads out of\n// your application to the Home screen.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(a);\n// Adds the back stack for the Intent (but not the Intent itself)\n stackBuilder.addParentStack(LoginActivity.class);\n// Adds the Intent that starts the Activity to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) a.getSystemService(Context.NOTIFICATION_SERVICE);\n// mId allows you to update the notification later on.\n mNotificationManager.notify(1, mBuilder.build());\n }",
"@Override\n public void displayRatificationActivity() {\n Intent i = new Intent(MainActivity.this, LoginActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n startActivityForResult(i, RC_RATIFY_CONSTITUTION);\n }",
"public void present(Tag tag) {\n\n Log.i(TAG, \"dispatching notification\");\n String message = tag.userId + \": \" + tag.text;\n Intent intent = new Intent(mContext, MainActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0);\n Notification notification = new NotificationCompat.Builder(mContext).\n setSmallIcon(R.drawable.ic_launcher).\n setContentTitle(message).\n setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)).\n setContentText(\"PopHello\").\n setAutoCancel(true).\n setContentIntent(pendingIntent).\n setTicker(message).\n build();\n\n mNotificationManager.cancelAll();\n mNotificationManager.notify(tag.id, NOTIFICATION_ID, notification);\n }",
"@Override\n public void onClick(View v) {\n Intent returnToPressHelp = new Intent(getApplicationContext(), PressHelp.class);\n startActivity(returnToPressHelp);\n\n\n //Tell the phone that the medication was taken.\n\n }",
"private PendingIntent openActivityPendingIntent(Context context) {\n Intent intent = new Intent(context, MainActivity.class);\n return PendingIntent.getActivity(context, 0, intent, 0);\n }",
"@Override\r\nprotected void onNewIntent(Intent intent) {\n\tsuper.onNewIntent(intent);\r\nSystem.out.println(\"onNewIntent\");\r\n}",
"@Override\n public void onNewIntent(Intent intent) {\n }",
"public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.sport_module_notification_main);\n setTitleText(R.string.device_module_activity_msg_push);\n setLeftBackTo();\n getTitleBar().setBackgroundColor(RunActivitySkin.Sport_Home_Bg_Color_Bottom);\n boolean isOpen = Util.isMsgNotificationEnabled(this);\n this.setBtn = (Button) findViewById(R.id.notification_btn);\n if (AppConfigUtil.isRussia(this) || AppConfigUtil.isIwownFitPro() || AppConfigUtil.isZeronerHealthPro() || AppConfigUtil.isHealthy(this)) {\n this.setBtn.setVisibility(0);\n } else {\n this.setBtn.setVisibility(8);\n }\n this.setBtn.setOnClickListener(new OnClickListener() {\n public void onClick(View v) {\n String url;\n if (AppConfigUtil.isRussia(NotificationHintActivity.this)) {\n url = \"https://search.iwown.com/guide/bracelet/bracelet.html#/\";\n } else if (AppConfigUtil.isIwownFitPro()) {\n url = \"https://api4.iwown.com/setting/dist/index.html#/\";\n } else if (AppConfigUtil.isZeronerHealthPro()) {\n url = \"https://api4.iwown.com/setting/dist/index.html#/zhp/app\";\n } else if (AppConfigUtil.isHealthy()) {\n url = \"https://api2.iwown.com/setting/zhushou/index.html#/china/app\";\n } else {\n url = \"\";\n }\n ARouter.getInstance().build(RouteUtils.Activity_my_app_background_Activity).withString(\"url\", url).withString(\"title\", \"Guide\").navigation();\n }\n });\n if (!isOpen) {\n showConfirmDialog();\n }\n }",
"@Override\n protected void onNewIntent(Intent intent) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"BASH\", \"Notification sent\");\n\n Log.i(\"BASH\", \"RECIEVED\");\n\n createNotification(context, \"Times up\", \"5 sec\", \"as\");\n\n }",
"@Override \n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent); \n \n initData();\n }",
"@Override\n public void onClick(View v) {\n PopupMenu popup = new PopupMenu(DogAddInfoActivity.this, button1);\n //Inflating the Popup using xml file\n popup.getMenuInflater()\n .inflate(R.menu.popup_menu, popup.getMenu());\n\n //registering popup with OnMenuItemClickListener\n popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {\n public boolean onMenuItemClick(MenuItem item) {\n Toast.makeText(\n DogAddInfoActivity.this,\n \"You Clicked : \" + item.getTitle(),\n Toast.LENGTH_SHORT\n ).show();\n breedtext.setText(item.toString());\n return true;\n }\n });\n popup.show();\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n finish();\n Intent intent = new Intent(Intent.ACTION_MAIN);\n intent.putExtra(\"userMail\", \"\");\n intent.addCategory(Intent.CATEGORY_HOME);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n /*int pid = android.os.Process.myPid();=====> use this if you want to kill your activity. But its not a good one to do.\n android.os.Process.killProcess(pid);*/ //(black magic :) )\n }",
"public void showNotification() {\n // You only need to create the channel on API 26+ devices\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n createChannel();\n }\n android.support.v4.app.NotificationCompat.Builder builder =\n new android.support.v4.app.NotificationCompat.Builder(this, CHANNEL_ID);\n builder.addAction(R.drawable.ic_action_playback_prev, Constants.ACTION_PREV,\n MediaButtonReceiver.buildMediaButtonPendingIntent\n (this, PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS));\n if (state == PlaybackStateCompat.STATE_PLAYING) {\n builder.addAction(\n R.drawable.ic_pause, Constants.ACTION_PAUSE,\n MediaButtonReceiver.buildMediaButtonPendingIntent(this,\n PlaybackStateCompat.ACTION_PAUSE));\n } else {\n builder.addAction(\n R.drawable.ic_play_arrow, Constants.ACTION_PLAY,\n MediaButtonReceiver.buildMediaButtonPendingIntent(this,\n PlaybackStateCompat.ACTION_PLAY));\n }\n builder.addAction(R.drawable.ic_action_playback_next, Constants.ACTION_NEXT,\n MediaButtonReceiver.buildMediaButtonPendingIntent\n (this, PlaybackStateCompat.ACTION_SKIP_TO_NEXT));\n\n builder.addAction(R.drawable.ic_action_cancel, Constants.ACTION_STOP,\n MediaButtonReceiver.buildMediaButtonPendingIntent\n (this, PlaybackStateCompat.ACTION_STOP));\n\n Intent intent = new Intent(getApplicationContext(), SongsActivity.class);\n intent.addCategory(Intent.ACTION_MAIN);\n intent.addCategory(Intent.CATEGORY_LAUNCHER);\n intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n intent.setClass(this, SongsActivity.class);\n PendingIntent contentPendingIntent = PendingIntent.getActivity\n (this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentTitle(getString(R.string.app_name))\n .setContentText(getSongTitle())\n .setContentIntent(contentPendingIntent)\n .setSmallIcon(R.drawable.ic_music_note)\n .setLargeIcon(Constants.getDefaultAlbumArt(this))\n .setVisibility(android.support.v4.app.NotificationCompat.VISIBILITY_PUBLIC)\n .setStyle(new android.support.v4.media.app.NotificationCompat.MediaStyle()\n .setMediaSession(sessionToken)\n .setShowActionsInCompactView(0, 1));\n Notification notification = builder.build();\n startForeground(Constants.NOTIFICATION_ID.FOREGROUND_SERVICE,\n notification);\n }",
"public void openPromotion() {\n myActivity.setContentView(R.layout.promotion);\n Button promotionButtonToGame = myActivity.findViewById(R.id.button6);\n\n promotionButtonToGame.setOnClickListener(\n new View.OnClickListener() {\n\n public void onClick(View v) {\n ShogiHumanPlayer.this.setAsGui(myActivity);\n usingRulesScreen = false;\n if (state != null) {\n receiveInfo(state);\n }\n }\n }\n\n\n );\n\n\n }",
"@Override\n public void onNewIntent(Activity activity, Intent data) {\n }",
"public void onClick(View v) \n\t\t\t{\n\t\t\t\tlong sec = 0,min,hr,ts;\n\t\t\t\tString st;\n\t\t\t\tCalendar cal=Calendar.getInstance();\n\t\t\t\thr=cal.get(cal.HOUR);\n\t\t\t\tmin=cal.get(cal.MINUTE);\n\t\t\t\tsec=cal.get(cal.SECOND);\n\t\t\t\tts=cal.get(cal.AM_PM);\n\t\t\t\tst=ts>0?\"pm\":\"am\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\twhile(sec!=40)\n\t\t\t\t{Log.d(\"Toast\",\"\"+sec);\n\t\t\t\t cal=Calendar.getInstance();\n\t\t\t\thr=cal.get(cal.HOUR);\n\t\t\t\tmin=cal.get(cal.MINUTE);\n\t\t\t\tsec=cal.get(cal.SECOND);\n\t\t\t\tts=cal.get(cal.AM_PM);\n\t\t\t\tst=ts>0?\"pm\":\"am\";\n\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t{\tNotificationManager nm=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n\t\t\t\tNotification notify=new Notification(android.R.drawable.stat_notify_chat,\"This isimportant\",System.currentTimeMillis());\n\t\t\t\tIntent in=new Intent(getApplicationContext(),Notifn.class);\n\t\t\t\tPendingIntent pi=PendingIntent.getActivity(getApplicationContext(),0,in,0);\n\t\t\t\tnotify.setLatestEventInfo(getApplicationContext(),\"You have been notified\",\"Continue if you needsbccdcb\",pi);\n\t\t\t\tnotify.sound=Uri.parse(\"android.resource://example.pr1/\"+raw.beep);\n\t\t\t\t\tnm.notify(0,notify);\n\t\t\t\tLog.d(\"Toast\",\"\"+sec+\" Success\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tspeakout(\"Hai hoW ARE YOU\");\n\t\t\t}",
"@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Intent intent = new Intent(ProfileActivity.this, InviteRoom.class);\n intent.putExtra(\"USERNAME\", userName);\n intent.putExtra(\"MULTI\", \"1\");\n// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n dialogInterface.dismiss();\n\n }",
"private void showSimpleNotification() {\n Notification notification = new NotificationCompat.Builder(getActivity())\n //Title of the notification\n .setContentTitle(getString(R.string.nf_simple_title))\n //Content of the notification once opened\n .setContentText(getString(R.string.nf_simple_message))\n //This bit will show up in the notification area in devices that support that\n .setTicker(getString(R.string.nf_simple_ticker))\n //Icon that shows up in the notification area\n .setSmallIcon(R.drawable.ic_notify)\n //Icon that shows up in the drawer\n .setLargeIcon(BitmapFactory.decodeResource(getActivity().getResources(), R.drawable.ic_launcher))\n //Set the intent\n .setContentIntent(pendingIntentForNotification())\n //Build the notification with all the stuff you've just set.\n .build();\n\n //Add the auto-cancel flag to make it dismiss when clicked on\n //This is a bitmask value so you have to pipe-equals it.\n notification.flags |= Notification.FLAG_AUTO_CANCEL;\n\n //Grab the NotificationManager and post the notification\n NotificationManager notificationManager = (NotificationManager)\n getActivity().getSystemService(Context.NOTIFICATION_SERVICE);\n\n //Set a tag so that the same notification doesn't get reposted over and over again and\n //you can grab it again later if you need to.\n notificationManager.notify(TAG_SIMPLE_NOTIFICATION, notification);\n }",
"private void handleActionFoo() {\n NewMessageNotification.notify(this, getImage());\n\n SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);\n long duration = pref.getLong( \"bennettscash.pics.duration\", 0 );\n\n Notifier.setupTimer(this, duration);\n// Intent intent = new Intent(this, TimerService.class);\n// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n// startActivity(intent);\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(MakeSaleActivity.this,LocPopActivity.class);\n startActivityForResult(intent, REQUEST_CODE_POP_LOC);\n }",
"private void sendNotification(String msg) {\n Uri hejsound = Uri.parse(\"android.resource://\" + getApplicationContext().getPackageName() + \"/\" + R.raw.hejsound);\n long[] notifyVibrate = {0, 200, 100, 200};\n Intent hejIntent = new Intent(this, MyActivity.class);\n hejIntent.putExtra(\"sender\", msg);\n Intent respondIntent = new Intent(this, respondHejService.class); //An intent to be used by the ReplyTo button\n respondIntent.putExtra(\"sender\", msg);\n respondIntent.putExtra(\"respondTo\", msg);\n PendingIntent respondToIntent = PendingIntent.getService(this, msg.hashCode(), respondIntent, PendingIntent.FLAG_CANCEL_CURRENT);\n PendingIntent contentIntent = PendingIntent.getActivity(this, msg.hashCode(), hejIntent, PendingIntent.FLAG_CANCEL_CURRENT);\n\n NOTIFICATION_ID = msg.hashCode();\n\n if (SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {\n\n NotificationManager mNotificationManager = (NotificationManager)\n this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .addAction(R.drawable.arrow, \"Send Hej Back\", respondToIntent)\n .setAutoCancel(true)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"Hej\")\n .setTicker(\"Hej from \" + msg + \"!\")\n .setVibrate(notifyVibrate)\n .setSound(hejsound)\n .setPriority(Notification.PRIORITY_MAX)\n .setLights(0xFFFF8B00, 200, 200)\n .setContentText(\"Hej from \" + msg + \"!\");\n\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n\n\n } else { //Sander Edition\n NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n System.out.println(\"what the fuck\");\n int icon = R.drawable.ic_launcher;\n CharSequence text = \"Hej from \" + msg + \"!\";\n CharSequence contentTitle = \"Hej\";\n CharSequence contentText = \"Hej from \" + msg + \"!\";\n long when = System.currentTimeMillis();\n\n Notification notification = new Notification(icon,text,when);\n\n notification.vibrate = notifyVibrate;\n notification.sound = hejsound;\n notification.ledARGB = 0xFFFF8B00;\n notification.ledOffMS = 200;\n notification.ledOnMS = 200;\n\n notification.setLatestEventInfo(this, contentTitle, contentText, contentIntent);\n\n notificationManager.notify(NOTIFICATION_ID, notification);\n\n\n }\n }",
"private void handleActionNotification() {\n String result = getQuote(stringsArray);\n// Notification myNotification = new Notification.Builder(this)\n// .setAutoCancel(true)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setWhen(System.currentTimeMillis())\n// .setSmallIcon(R.mipmap.ic_launcher)\n// .setContentText(result)\n// .build();\n//\n// NotificationManagerCompat manager = NotificationManagerCompat.from(this);\n// manager.notify(0, myNotification);\n\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(result);\n\n NotificationManager notificationManager = (NotificationManager)this\n .getSystemService(Context.NOTIFICATION_SERVICE);\n int id = 1;\n notificationManager.notify(id, builder.build());\n }",
"@Override\n\t\t public void onClick(View v) {\n\t\t \t\n\t \tList<PackageInfo> packages = getPackageManager().getInstalledPackages(0);\n\t \t\tImageView imageView = new ImageView(GoodMorningActivity.this);\n\t \t\timageView.setImageDrawable(packages.get(0).applicationInfo.loadIcon(getPackageManager()));\n\t \t\t\n\t \t\tRelativeLayout rl = (RelativeLayout) findViewById(R.id.relativeLayout2);\n\t \t\tRelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(\n\t \t\t RelativeLayout.LayoutParams.WRAP_CONTENT,\n\t \t\t RelativeLayout.LayoutParams.WRAP_CONTENT);\n\t \t\tlp.addRule(RelativeLayout.BELOW, R.id.analogClock1);\n\t \t\tlp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n\t \t\trl.addView(imageView, lp);\n\t \t\t\n\t \t\timageView.setOnClickListener(new ImageView.OnClickListener() {\n\t \t\t\t@Override\n\t \t\t\tpublic void onClick(View arg0) {\n\t \t\t\t\t// TODO Auto-generated method stub\n\t \t\t\t\tList<PackageInfo> packages = getPackageManager().getInstalledPackages(0);\n\t \t\t\t\tstartActivity(getPackageManager().getLaunchIntentForPackage(packages.get(0).applicationInfo.packageName)); \n\t \t\t\t}\n\t \t\t});\n\t\t \t\n\t\t popupWindow.dismiss();\n\t\t }",
"@Override\n public void onReceive(Context context, Intent intent) {\n\n Uri alarmsound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);\n\n Intent intent1 = new Intent(context, Reminderku.class);\n intent1.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(context);\n taskStackBuilder.addParentStack(Reminderku.class);\n taskStackBuilder.addNextIntent(intent1);\n\n PendingIntent intent2 = taskStackBuilder.getPendingIntent(1,PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context);\n\n NotificationChannel channel = null;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n channel = new NotificationChannel(\"my_channel_01\",\"hello\", NotificationManager.IMPORTANCE_HIGH);\n }\n\n Notification notification = builder.setContentTitle(\"KitaFit\")\n .setContentText(intent.getStringExtra(\"Message\")).setAutoCancel(true)\n .setSound(alarmsound).setSmallIcon(R.mipmap.ic_launcher_round)\n .setContentIntent(intent2)\n .setChannelId(\"my_channel_01\")\n .build();\n\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n notificationManager.createNotificationChannel(channel);\n }\n notificationManager.notify(1, notification);\n\n }",
"private void showInboxStyleNotification() {\n NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();\n style.setBigContentTitle(\"Inbox Style Regular Notification\");\n style.addLine(\"Line 1\");\n style.addLine(\"Line 2\");\n style.addLine(\"Line 3\");\n style.addLine(\"Line 4\");\n\n //Build the content of the notification\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ActivityA.this);\n builder.setContentTitle(\"Inbox Style Regular Notification\");\n builder.setContentText(contentText);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setTicker(\"Hey, This is a ticker!!!!!!\");\n builder.setAutoCancel(true);\n builder.setStyle(style);\n\n\n //Provide explicit intents for notification\n Intent i = new Intent(ActivityA.this,ActivityB.class);\n //Add a back stack using task using stack builder and set the intent to pending intent\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(ActivityB.class);\n stackBuilder.addNextIntent(i);\n PendingIntent pi_main =stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for settings\n Intent j = new Intent(ActivityA.this,Settings.class);\n TaskStackBuilder stackBuilder_settings = TaskStackBuilder.create(this);\n stackBuilder_settings.addParentStack(Settings.class);\n stackBuilder_settings.addNextIntent(j);\n PendingIntent pi_settings =stackBuilder_settings.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for help\n Intent k = new Intent(ActivityA.this,Help.class);\n TaskStackBuilder stackBuilder_help = TaskStackBuilder.create(this);\n stackBuilder_help.addParentStack(Help.class);\n stackBuilder_help.addNextIntent(k);\n PendingIntent pi_help =stackBuilder_help.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi_main);\n builder.addAction(R.drawable.settings,\"Settings\",pi_settings);\n builder.addAction(R.drawable.help,\"Help\",pi_help);\n\n //Notifications through notification manager\n Notification notification = builder.build();\n NotificationManager manager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);\n manager.notify(29,notification);\n }",
"private void showNotification() {\n // In this sample, we'll use the same text for the ticker and the expanded notification\n // Set the icon, scrolling text and timestamp\n Notification notification = new Notification(R.drawable.icon, \"Longitude is active\", System.currentTimeMillis());\n\n // The PendingIntent to launch our activity if the user selects this notification\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n new Intent(this, LongitudeActivity.class), 0);\n\n // Set the info for the views that show in the notification panel.\n notification.setLatestEventInfo(this, \"Longitude\", \"Tracking your location\", contentIntent);\n\n // Send the notification.\n notificationManager.notify(NOTIFICATION, notification);\n }",
"@Override\n public void onIconClick(View icon, float iconXPose, float iconYPose) {\n Intent intent = new Intent(context, MainActivity.class);\n intent.putExtra(Constants.FEED_ME, true);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\n context.startActivity(intent);\n mMagnet.destroy();\n }",
"@Override \t \t\n \t \tpublic void onItemClick(AdapterView<?> myAdapter, View myView, int myItemInt, long mylng) {\n \t Toast.makeText(getApplicationContext(), \"hello\", \n \t \t\t Toast.LENGTH_LONG).show();\n \t popupWindow.dismiss();\n \t \n \t /*\n\t\t\t List<PackageInfo> packages = getPackageManager().getInstalledPackages(0);\n\t\t\t for (PackageInfo pi : packages){\n\t\t\t \t\tif (getPackageManager().getApplicationLabel(p.applicationInfo).toString().equalsIgnoreCase(selectedFromList){\n\t\t\t \t\n\t\t\t\t\t\t\tImageView imageView = new ImageView(this);\n\t\t\t\t\t\t\timageView.setImageDrawable(pi.applicationInfo.loadIcon(getPackageManager()));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRelativeLayout rl = (RelativeLayout) findViewById(R.id.relativeLayout2);\n\t\t\t\t\t\t\tRelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(\n\t\t\t\t\t\t\t RelativeLayout.LayoutParams.WRAP_CONTENT,\n\t\t\t\t\t\t\t RelativeLayout.LayoutParams.WRAP_CONTENT);\n\t\t\t\t\t\t\tlp.addRule(RelativeLayout.BELOW, R.id.analogClock1);\n\t\t\t\t\t\t\tlp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n\t\t\t\t\t\t\trl.addView(imageView, lp);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\timageView.setOnClickListener(new ImageView.OnClickListener() {\n\t\t\t \t\t\t@Override\n\t\t\t \t\t\tpublic void onClick(View arg0) {\n\t\t\t \t\t\t\t// TODO Auto-generated method stub\n\t\t\t \t\t\t\tList<PackageInfo> packages = getPackageManager().getInstalledPackages(0);\n\t\t\t \t\t\t\tstartActivity(getPackageManager().getLaunchIntentForPackage(packages.get(0).applicationInfo.packageName)); \n\t\t\t \t\t\t}\n\t\t\t \t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \t */\n \t \n \t \n \t }",
"public void launchPhone(){\n\t\tIntent sendIntent = new Intent(Intent.ACTION_DIAL);\n \tsendIntent.setData(Uri.parse(\"tel:\"));\n \t\n \tfinal ResolveInfo mInfo = pacman.resolveActivity(sendIntent, 0);\n \tString s = pacman.getApplicationLabel(mInfo.activityInfo.applicationInfo).toString();\n \t\n \tif (s != null && s.length() > 2) {\n startActivity(sendIntent);\n return;\n } else {\n \tToast.makeText(context, \"No Phone Call App Availible\", Toast.LENGTH_SHORT).show();\n \treturn;\n }\n\t}",
"@Override\n protected void onHandleIntent(Intent intent) {\n\t Log.i(TAG,\"Alarm Service has started.\");\n Context context = this.getApplicationContext();\n notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);\n Intent mIntent = new Intent(this, MainActivity.class);\n Bundle bundle = new Bundle(); \n bundle.putString(\"test\", \"test\");\n mIntent.putExtras(bundle);\n\t\tpendingIntent = PendingIntent.getActivity(context, 0, mIntent, PendingIntent.FLAG_UPDATE_CURRENT); \n\t\t\n\t\tResources res = this.getResources();\n\t\tNotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n\t\tbuilder.setContentIntent(pendingIntent)\n\t\t .setSmallIcon(R.drawable.ic_launcher)\n\t\t .setLargeIcon(BitmapFactory.decodeResource(res, R.drawable.ic_launcher))\n\t\t .setTicker(res.getString(R.string.notification_title))\n\t\t .setAutoCancel(true)\n\t\t .setContentTitle(res.getString(R.string.notification_title))\n\t\t .setContentText(res.getString(R.string.notification_subject));\n\n\t\tnotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);\n\t\tnotificationManager.notify(NOTIFICATION_ID, builder.build());\n\t\tLog.i(TAG,\"Notifications sent.\");\n\t\tMyAlarm app = (MyAlarm)getApplicationContext();\n\t\tapp.incrementCount();\n\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context, \"channel\")\n .setSmallIcon(R.drawable.ic_baseline_message_24)\n .setContentTitle(\"You have an upcoming event!!\")\n .setContentText(\"Click on the message to view more\")\n .setPriority(NotificationCompat.PRIORITY_HIGH);\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from( context);\n notificationManager.notify(200,builder.build());\n }",
"private void showNotification(RemoteMessage remoteMessage) {\n\n String postType = remoteMessage.getData().get(\"postType\");\n Intent intent = new Intent(this, MyFeedActivity.class);\n\n String postId = remoteMessage.getData().get(\"postId\");\n String userId = remoteMessage.getData().get(\"userId\");\n String senderId = remoteMessage.getData().get(\"senderId\");\n\n if (postType != null) {\n\n switch (postType) {\n case \"snack\":\n intent = new Intent(this, SnackPostActivity.class);\n intent.putExtra(\"userId\", userId);\n intent.putExtra(\"postId\", postId);\n break;\n case \"follow\":\n intent = new Intent(this, PublicProfileActivity.class);\n intent.putExtra(\"userId\", senderId);\n break;\n case \"commentPanel\":\n case \"likePanel\":\n intent = new Intent(this, PanelPostActivity.class);\n intent.putExtra(\"userId\", userId);\n intent.putExtra(\"postId\", postId);\n break;\n case \"commentSwap\":\n case \"likeSwap\":\n intent = new Intent(this, SwapPostActivity.class);\n intent.putExtra(\"userId\", userId);\n intent.putExtra(\"postId\", postId);\n break;\n default:\n break;\n }\n }\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n Notification notification;\n NotificationCompat.Builder builder;\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O)\n {\n NotificationChannel notificationChannel = new NotificationChannel(Channel_Id,Channel_Name,NotificationManager.IMPORTANCE_HIGH);\n\n // Set up the notification channel\n notificationChannel.setDescription(Channel_Description);\n notificationManager.createNotificationChannel(notificationChannel);\n builder = new NotificationCompat.Builder(this,Channel_Id);\n\n }\n else {\n builder = new NotificationCompat.Builder(this);\n }\n\n // Get image bitmap for the notification.\n // Adapted from: https://stackoverflow.com/questions/24840282/load-image-from-url-in-notification-android\n Bitmap bitmap = null;\n try {\n InputStream in = new\n URL(remoteMessage.getData().get(\"image\"))\n .openStream();\n bitmap = BitmapFactory.decodeStream(in);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n notification = builder.setContentTitle(remoteMessage.getNotification().getTitle())\n .setContentText(remoteMessage.getNotification().getBody())\n .setSmallIcon(R.drawable.mouse_icon)\n .setLargeIcon(bitmap)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent)\n .build();\n\n notificationManager.notify(0,notification);\n\n }",
"private void makePhoneCall(){\n if(ContextCompat.checkSelfPermission(NotificationHelper.this, android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED){\n\n Toast.makeText(this, \"Phone call permission not given\", Toast.LENGTH_SHORT).show();\n // ActivityCompat.requestPermissions(Alarm2Activity.this, new String[] {android.Manifest.permission.CALL_PHONE}, REQUEST_CALL);\n }\n else{\n String number = \"+213658305662\";\n String phoneNum = \"tel:\" + number;\n startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(phoneNum)));\n }\n }",
"@OnClick({R.id.phone_img, R.id.phone})\n void OnClickPhone() {\n Intent intent=new Intent(Intent.ACTION_DIAL);\n intent.setData(Uri.parse(\"tel:\" + getString(R.string.here_comes_phone_no)));\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }",
"private void alertDialogeForAskingPermissions() {\n builder.setMessage(getResources().getString(R.string.app_name) + \" needs access to \" + permissions[0] + \", \" + permissions[1]).setTitle(R.string.permissions_required);\n\n //Setting message manually and performing action on button click\n //builder.setMessage(\"Do you want to close this application ?\")\n builder.setCancelable(false)\n .setPositiveButton(R.string.later, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n // Action for 'Later'\n //Saving later boolean value as true, also saving time of pressed later\n Date dateObj = new Date();\n long timeNow = dateObj.getTime();\n editor.putLong(getResources().getString(R.string.later_pressed_time), timeNow);\n editor.putBoolean(getResources().getString(R.string.later), true);\n editor.commit();\n dialog.cancel();\n }\n })\n .setNegativeButton(R.string.give_permissions, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n requestPermission();\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n alert.show();\n }",
"@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.SupportActivity, android.support.v4.app.FragmentActivity\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n setFlag(getIntent());\n final TextView flagWidget = (TextView) findViewById(R.id.flag);\n ((Button) findViewById(R.id.getflag)).setOnClickListener(new View.OnClickListener() {\n /* class com.mobisec.nojumpstarts.MainActivity.AnonymousClass1 */\n\n public void onClick(View v) {\n flagWidget.setText(\"Getting flag....\");\n flagWidget.setTextColor(ViewCompat.MEASURED_STATE_MASK);\n try {\n MainActivity.this.getFlag();\n } catch (Exception e) {\n Log.e(\"MOBISEC\", \"Exception while getting the flag:\" + Log.getStackTraceString(e));\n flagWidget.setText(\"An error occurred when getting flag\");\n }\n }\n });\n }",
"public void onClick(View v) {\n Toast toast = Toast.makeText(getApplicationContext(), \"This button will launch my XYZ Reader app!\", Toast.LENGTH_SHORT);\n toast.show();\n }",
"private void showSmallNotification_channel(NotificationCompat.Builder mBuilder, int icon, String title, String message, String timeStamp, PendingIntent resultPendingIntent, Uri alarmSound, String channel) {\n\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n inboxStyle.addLine(message);\n String channelId = mContext.getString(R.string.default_notification_channel_id);\n String channelName = mContext.getString(R.string.default_notification_channel_name);\n\n //This is the intent of PendingIntent\n Intent intentAction = new Intent(mContext,ActionReceiverNotification.class);\n //This is optional if you have more than one buttons and want to differentiate between two\n intentAction.putExtra(\"notify\",\"getReplay\");\n PendingIntent pIntentAction = PendingIntent.getBroadcast(mContext,NotificationID.getID(),intentAction,PendingIntent.FLAG_ONE_SHOT);\n\n // Add Replay Action to Notification\n\n String KEY_TEXT_REPLY = \"key_text_reply\";\n\n RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY)\n .setLabel(\"Replay\")\n .build();\n\n //Notification Action with RemoteInput instance added.\n NotificationCompat.Action replyAction = new NotificationCompat.Action.Builder(\n android.R.drawable.sym_action_chat, \"REPLY\", pIntentAction)\n .addRemoteInput(remoteInput)\n .setAllowGeneratedReplies(true)\n .build();\n\n\n\n\n NotificationCompat.Builder notificationBuilder =\n new NotificationCompat.Builder(mContext, get_Channel_ID(channel))\n .setSmallIcon(icon)\n .setTicker(title)\n .addAction(replyAction)\n .setOngoing(true)\n .setAutoCancel(true)\n .setContentTitle(title)\n .setContentIntent(resultPendingIntent)\n .setSound(alarmSound)\n .setStyle(inboxStyle)\n .setWhen(getTimeMilliSec(timeStamp));\n // .setSmallIcon(R.mipmap.ic_launcher)\n // .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), icon));\n // .setStyle(new NotificationCompat.BigTextStyle().bigText(message));\n\n\n\n NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);\n // Since android Oreo notification channel is needed.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channelNotification = new NotificationChannel(get_Channel_ID(channel),\n channel,\n NotificationManager.IMPORTANCE_DEFAULT);\n notificationManager.createNotificationChannel(channelNotification);\n }\n\n notificationManager.notify(NotificationID.getID() /* ID of notification */, notificationBuilder.build());\n }",
"@Override\n public void onClick(View v) {\n dismiss();\n int pushType = 0;\n if (v == pushTxt) {\n pushType = HXConstant.PUSH_TXT;\n } else if (v == pushActivity) {\n pushType = HXConstant.PUSH_CAMPAIGN;\n\n } else if (v == pushProduce) {\n pushType = HXConstant.PUSH_SHOP_INFO;\n\n } else if (v == pushArticle) {\n pushType = HXConstant.PUSH_ARTICLE;\n\n }\n dismiss();\n if (EaseConstant.shopID < 0) { //已登录\n EaseConstant.startEaseMultiPushActivity((Activity) context, pushType, multiPushOrSend, commission, isRegistMembers, registerTime);\n }\n }",
"private void sendNotification(Map<String, String> serverData) {\n Intent intent = new Intent(serverData.get(\"click_action\"));\n String title = serverData.get(\"title\");\n String body = serverData.get(\"body\");\n intent.putExtra(\"title\",title);\n intent.putExtra(\"body\",body);\n intent.putExtra(\"order\" , serverData.get(\"order\"));\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ok)\n .setContentTitle(serverData.get(\"title\"))\n .setContentText(serverData.get(\"body\"))\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE,1,1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0 , notificationBuilder.build());\n }",
"public PendingIntent getLaunchPendingIntent() {\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setAction(\n Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n Uri uri = Uri.fromParts(\"package\",\n BuildConfig.APPLICATION_ID, null);\n intent.setData(uri);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setAction(\n Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n Uri uri = Uri.fromParts(\"package\",\n BuildConfig.APPLICATION_ID, null);\n intent.setData(uri);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }"
] | [
"0.6971571",
"0.67585033",
"0.643622",
"0.640647",
"0.64015627",
"0.63968027",
"0.6308265",
"0.62977856",
"0.62790805",
"0.6211151",
"0.6192086",
"0.6128182",
"0.6123902",
"0.6068244",
"0.60599196",
"0.60560393",
"0.6043977",
"0.6021583",
"0.6016069",
"0.59938306",
"0.5989732",
"0.5983792",
"0.59823",
"0.5974615",
"0.5972743",
"0.59543586",
"0.5949574",
"0.5943271",
"0.5911184",
"0.59049124",
"0.58828515",
"0.5862737",
"0.5846374",
"0.5839887",
"0.5835608",
"0.5821354",
"0.58212894",
"0.581405",
"0.5810077",
"0.58017135",
"0.5787127",
"0.57659554",
"0.5752983",
"0.57465315",
"0.5727195",
"0.5725304",
"0.5724551",
"0.5720259",
"0.57103914",
"0.5699271",
"0.5696592",
"0.56899333",
"0.56788576",
"0.5677655",
"0.566454",
"0.5659049",
"0.56570494",
"0.5654892",
"0.5642273",
"0.56400496",
"0.5636504",
"0.56353337",
"0.56294036",
"0.5628087",
"0.5619163",
"0.5617352",
"0.5614597",
"0.560996",
"0.56057626",
"0.56038153",
"0.5601227",
"0.55969113",
"0.559367",
"0.55918056",
"0.55908865",
"0.5588255",
"0.5584256",
"0.5571361",
"0.55708265",
"0.55688035",
"0.5568613",
"0.5567456",
"0.5566005",
"0.55583245",
"0.55580056",
"0.5555477",
"0.5555273",
"0.5554986",
"0.5554187",
"0.5538031",
"0.55303353",
"0.5529306",
"0.55279833",
"0.55232584",
"0.5523253",
"0.5522922",
"0.5520957",
"0.55202603",
"0.5519848",
"0.5519848"
] | 0.5909345 | 29 |
TODO Autogenerated method stub | @Override
public void onClick(DialogInterface dialog, int which) {
EditText edPhoneNumber = (EditText)linear.findViewById(R.id.edPhoneNumber);
String phoneNumber = edPhoneNumber.getText().toString();
if (phoneNumber == "")
return;
storePhoneNumber(phoneNumber);
// 1. Device Token 등록
// google play service가 사용가능한가
if (checkPlayServices())
{
mGcm = GoogleCloudMessaging.getInstance(MainActivity.this);
mRegId = getRegistrationId();
if (TextUtils.isEmpty(mRegId))
registerInBackground();
}
else
{
Log.i("MainActivity.java | onCreate", "|No valid Google Play Services APK found.|");
mTextStatus.append("\n No valid Google Play Services APK found.\n");
}
// display received msg
String msg = getIntent().getStringExtra("msg");
if (!TextUtils.isEmpty(msg))
mTextStatus.append("\n" + msg + "\n");
// 2. Web View
webview = (WebView)findViewById(R.id.webView1);
webview.setWebViewClient(new WebClient()); //
WebSettings set = webview.getSettings();
set.setJavaScriptEnabled(true);
set.setBuiltInZoomControls(true);
//webview.loadUrl("http://www.google.com");
} | {
"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 mtvPhoneNumber.setText("bbb"); | @Override
public void onClick(DialogInterface dialog, int which) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPhoneNumber(java.lang.CharSequence value) {\n this.phone_number = value;\n }",
"public void setText(int str) { this.editText.setText(str); }",
"public void setText(String str) { this.editText.setText(str); }",
"public void setPhone(String phone) {\r\n // Bouml preserved body begin 00041002\r\n\t this.phoneNumber = phone;\r\n // Bouml preserved body end 00041002\r\n }",
"public com.politrons.avro.AvroPerson.Builder setPhoneNumber(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.phone_number = value;\n fieldSetFlags()[3] = true;\n return this; \n }",
"private void setText(View view, String text) {\n\t\t((TextView) view.findViewById(android.R.id.text1)).setText(text);\n\t}",
"public void setPhoneNumber(String phone_number){\n this.phone_number = phone_number;\n }",
"public Builder setPhoneNumber(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n phoneNumber_ = value;\n onChanged();\n return this;\n }",
"public abstract void setPhone3(String sValue);",
"public abstract void setPhone2(String sValue);",
"public void setPhone(String phone);",
"public void setText(String text) {\n\t\t\n\t}",
"public void setText(String text) {\r\n\r\n\t}",
"@Override\n\t\t\t\tpublic void setTextView(String str) {\n\t\t\t\t\ttextView_setpsd_info.setText(str);\n\t\t\t\t}",
"public abstract void setPhone1(String sValue);",
"public void setText( String text );",
"public void setText(String text) {\n mText = text;\n }",
"@Override\n public void onClick(View view) {\n test.setContent(\"234444500.36\");\n }",
"public void setPhoneNumber(String phoneNumber) {\n\t\tthis.phoneNumber=phoneNumber;\r\n\t}",
"public void setText(String text);",
"private void setText(Text text) {\n \t\tthis.text = text;\n \t}",
"public void updateViews() {\n textView.setText(contactName);\n\n }",
"public void setText(String text) {\n\t\ttextField.setText(text);\n\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(phoneet.getText().toString().length()==11){\r\n\t\t\t\t\tphonell.setVisibility(View.GONE);\r\n\t\t\t\t\tyanzhengmall.setVisibility(View.VISIBLE);\r\n\t\t\t\t\tphonetv.setTextColor(getResources().getColor(R.color.bg_Black));\r\n\t\t\t\t\tyanzhengmatv.setTextColor(getResources().getColor(R.color.top_background));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToastUtil.showToast(RegisterActivity.this, \"手机号格式不正确\");\r\n\t\t\t\t}\r\n\t\t\t}",
"public void setNameTextView(String text) {\n nameTextView.setText(text);\n }",
"public void setText(String value) {\r\n\t\tPlatform.runLater(() -> this.textfield.setText(value));\r\n\r\n\t}",
"public void setPhone(String phone)\r\n/* 46: */ {\r\n/* 47:58 */ this.phone = phone;\r\n/* 48: */ }",
"public Builder setPhoneNumber(com.google.protobuf.StringValue value) {\n if (phoneNumberBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n phoneNumber_ = value;\n onChanged();\n } else {\n phoneNumberBuilder_.setMessage(value);\n }\n\n return this;\n }",
"public void setText(String t) {\n\t\ttext = t;\n\t\tb.setText(t);\n\t}",
"public void setText(String text) {\n\t\tthis.text = text;\n\t\tupdateView();\n\t}",
"@Override\n public void onClick(View view) {\n phoneNumberEditText.setText(phoneNumberEditText.getText().toString() + ((Button)view).getText().toString());\n }",
"public void setPhoneNumber(String phoneNumber)\n\t{\n\t\tthis._phoneNumber=phoneNumber;\n\t}",
"public void setView4Text(String text){\n view4Text.set(text);\n }",
"void setText(String text);",
"public void setPhoneNumber() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setter method initialized\r\n System.out.println(\"Phone Number : \"+phoneNumber);}",
"private void m50368G() {\n this.f30729a0.setText(C10527a.f28546g);\n this.f30736g0.setText(\"01/21\");\n this.f30737h0.setText(\"111\");\n this.f30738i0.setText(\"Test User\");\n }",
"void setPhone(int phone);",
"public Builder setPhoneNumber(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n phoneNumber_ = value;\n onChanged();\n return this;\n }",
"public void setText(String text)\n {\n this.text = text;\n }",
"public void setText(String text) {\n this.text.setText(text);\n }",
"@Override\n\t\t\tpublic void setTextView(String str) {\n\t\t\t\t\n\t\t\t}",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setText(String text) {\r\n this.text = text;\r\n }",
"public void setText(String text) {\r\n\t\tthis.text= text;\r\n\t}",
"public void setPhone(String mPhone) {\n this.mPhone = mPhone;\n }",
"public void set_phone(String Phone)\n {\n phone =Phone;\n }",
"public void setText(String text)\n {\n field.setText(text);\n }",
"public PhoneTextField()\r\n {\r\n super();\r\n setText(\"000-000-0000\");\r\n\r\n phoneNumber = Pattern.compile(\"^\\\\d{3}-\\\\d{3}-\\\\d{4}$\");\r\n\r\n //Adds listener to check when focus lost\r\n focusedProperty().addListener((o, oldV, newV) -> OnChanged(newV));\r\n }",
"void setText (String text);",
"public void setText(final String value) {\r\n\r\n this.field.setText(value);\r\n\r\n }",
"public void setText(String text) {\n this.text = text;\n }",
"public void setText(String text) {\n this.text = text;\n }",
"public void setText(String text) {\n this.text = text;\n }",
"public void setText(String text) {\n this.text = text;\n }",
"public void setText(String text) {\n this.text = text;\n }",
"public void setText(String text) {\n this.text = text;\n }",
"public void setText(String text) {\n this.text = text;\n }",
"private void setText(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n text_ = value;\n }",
"@Override\n\tpublic void setValue(View view, String value) {\n\t\t((TextView) view).setText(value);\n\n\t}",
"public void setValue(String value)\r\n\t\t{ textField.setText(value); }",
"public void setText(String text){\n this.roomText = text;\n this.hasText = true;\n }",
"public void setPhone(String phone) {\n this.mPhone = phone;\n }",
"public void updatePhoneNumber(String newPhoneNum)\r\n {\r\n phoneNum = newPhoneNum;\r\n }",
"@Override\n\tpublic void setText(String arg0) {\n\t\t\n\t}",
"@Override\n public void onClick(View view) {\n String phoneNumber = phoneNumberEditText.getText().toString();\n // atata timp cat exista caractere in EditText => ele pot fi sterse\n if (phoneNumber.length() > 0) {\n // se sterge mereu ultima cifra / ultimul caracter\n phoneNumber = phoneNumber.substring(0, phoneNumber.length() - 1);\n phoneNumberEditText.setText(phoneNumber);\n }\n }",
"public void setText(String text) {\r\n\t\tthis.text = text;\r\n\t}",
"public void setText(String text)\n\t{\n\t\tthis.text = text;\n\t}",
"public void setText(String text)\n\t{\n\t\tthis.text = text;\n\t}",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setPhoneNumber(String phoneNumber) {\n this.phoneNumber = phoneNumber;\n }",
"public void setTextValue(String textValue) {\r\n this._textValue = textValue;\r\n }",
"public void setText(String t) {\n\t\t\ttext.set(t);\n\t\t}",
"public void setText(CharSequence text) {\n\t\tif (View.VISIBLE == textView.getVisibility()) {\n\t\t\ttextView.setText(text);\n\t\t}\n\t}",
"public Builder setPhone(int index, com.demo.springprotobuff.Demoproto.Student.PhoneNumber value) {\n\t\t\t\tif (phoneBuilder_ == null) {\n\t\t\t\t\tif (value == null) {\n\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t}\n\t\t\t\t\tensurePhoneIsMutable();\n\t\t\t\t\tphone_.set(index, value);\n\t\t\t\t\tonChanged();\n\t\t\t\t} else {\n\t\t\t\t\tphoneBuilder_.setMessage(index, value);\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}",
"private void setInfo(String info) {\n// TextView textView = (TextView) findViewById(R.id.info);\n// textView.setText(info);\n }",
"public void b0 (View v) {\n Addtxt(\"0\");\n }",
"void setText(String text) throws XmlBuilderException;",
"public void setText(String text) {\n\t\tthis.text = text;\n\t}",
"public void setText(String text) {\n\t\tthis.text = text;\n\t}",
"public void setText(String text) {\n\t\tthis.text = text;\n\t}",
"public Builder setUserPhone(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n userPhone_ = value;\n onChanged();\n return this;\n }",
"public void setUserPhone( String userPhone )\n {\n this.userPhone = userPhone;\n }",
"void setPhone(String phone) throws IllegalArgumentException;",
"public Builder setPhone(\n int index, cb.Careerbuilder.Company.PhoneNumber value) {\n if (phoneBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePhoneIsMutable();\n phone_.set(index, value);\n onChanged();\n } else {\n phoneBuilder_.setMessage(index, value);\n }\n return this;\n }",
"public void setText(String text) {\n this.text = text;\n setChanged();\n notifyObservers();\n }",
"public void setText(String s) {\n text = s;\n }",
"@Override\r\n\tpublic void setText() {\n\t\t\r\n\t}",
"public void setText(String name) {\n\t\tmetroText.setText( name );\n\t}",
"private void display() {\n TextView textview = (TextView) findViewById(R.id.textView);\n EditText editText = (EditText) findViewById(R.id.editNumber) ;\n textview.setText(\"TEXT\");\n editText.setText(\"\");\n\n }",
"public void setPhoneNumber(String phoneNumber) {\n if (this.phoneNumber != null) {\n return;\n }\n this.phoneNumber = phoneNumber;\n }",
"public void setText(String text) {\n this.textData = text;\n }",
"public abstract void setSelectedPhoneType3(String sValue);",
"public void xsetContactPhoneNumber(org.erdc.cobie.cobielite.core.CobieTextSimpleType contactPhoneNumber)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.erdc.cobie.cobielite.core.CobieTextSimpleType target = null;\r\n target = (org.erdc.cobie.cobielite.core.CobieTextSimpleType)get_store().find_element_user(CONTACTPHONENUMBER$0, 0);\r\n if (target == null)\r\n {\r\n target = (org.erdc.cobie.cobielite.core.CobieTextSimpleType)get_store().add_element_user(CONTACTPHONENUMBER$0);\r\n }\r\n target.set(contactPhoneNumber);\r\n }\r\n }",
"public void setTelphone(String telphone) {\n this.telphone = telphone;\n }",
"public void setTelphone(String telphone) {\n this.telphone = telphone;\n }",
"public void setTxtbusqueda(String txtbusqueda) {\n this.txtBusqueda.setText(txtbusqueda);\n }",
"@Override\n public void showCurrentNumber(String number) {\n Platform.runLater(() -> currentNumberTextView.setText(number));\n\n }",
"private void displayquintity(int numberOFCoffee){\n TextView quintityText= findViewById(R.id.quantity_text_view);\n quintityText.setText(\"\"+numberOFCoffee);\n\n }"
] | [
"0.68093944",
"0.65506303",
"0.65419954",
"0.63858724",
"0.63093185",
"0.6275385",
"0.6268945",
"0.6268064",
"0.6183844",
"0.6174651",
"0.617092",
"0.6148985",
"0.6148284",
"0.61396307",
"0.6130374",
"0.6129174",
"0.6115786",
"0.60832804",
"0.60823447",
"0.6070705",
"0.60669416",
"0.6066644",
"0.6058889",
"0.60359997",
"0.60272735",
"0.60146177",
"0.60091776",
"0.6003642",
"0.59967345",
"0.59914356",
"0.5984528",
"0.5983504",
"0.59770966",
"0.5975863",
"0.59745395",
"0.59685755",
"0.5965766",
"0.59597737",
"0.5957406",
"0.59513646",
"0.5940136",
"0.59356",
"0.59335357",
"0.5926536",
"0.59149665",
"0.5914881",
"0.5910407",
"0.59033775",
"0.59025",
"0.58865553",
"0.58853966",
"0.58853966",
"0.58853966",
"0.58853966",
"0.58853966",
"0.58853966",
"0.58853966",
"0.5879741",
"0.58774436",
"0.5876378",
"0.5876118",
"0.58630884",
"0.58545804",
"0.5841959",
"0.58362484",
"0.5835535",
"0.58352196",
"0.58352196",
"0.5830358",
"0.5830358",
"0.5830358",
"0.5830358",
"0.5830358",
"0.5824201",
"0.5809734",
"0.57991564",
"0.5797958",
"0.57970726",
"0.57930523",
"0.5785685",
"0.57783705",
"0.57783705",
"0.57783705",
"0.5774915",
"0.5755323",
"0.5753726",
"0.5745595",
"0.5735882",
"0.57336736",
"0.5719617",
"0.5719592",
"0.5718269",
"0.57162297",
"0.5711736",
"0.5700096",
"0.56946295",
"0.5691964",
"0.5691964",
"0.56792873",
"0.5676293",
"0.5675764"
] | 0.0 | -1 |
int appVersion = getAppVersion(); Log.i("MainActivity.java | storeRegistrationId", "|" + "Saving regId on app version " + appVersion + "|"); | private void storeBadgeCount(String ABadgeCountStr)
{
PreferenceUtil.instance(getApplicationContext()).putBadgeCount(ABadgeCountStr);
//PreferenceUtil.instance(getApplicationContext()).putAppVersion(appVersion);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getAppVersion() { return appVersion; }",
"private void setAppVersion() {\n try {\n String appVer = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;\n ServerSettingHelper.getInstance().setApplicationVersion(appVer);\n } catch (NameNotFoundException e) {\n if (Config.GD_ERROR_LOGS_ENABLED)\n Log.e(\"NameNotFoundException\", \"Error of getting package information!\");\n }\n }",
"private static String getAppVersionNumber(Context c) {\n String version = \"N/A\";\n try {\n final PackageManager packageManager = c.getPackageManager();\n if (packageManager == null) {\n return version;\n }\n\n PackageInfo packageInfo = packageManager.getPackageInfo(c.getPackageName(), 0);\n version = packageInfo.versionName;\n }\n catch (Exception e) {\n FLog.e(TAG, \"Unable to read the app version!\", e);\n }\n\n return version;\n }",
"public String getAppVersion() {\n return appVersion;\n }",
"public static String getAppVersionName(Context ctx) {\n String mAppVer = \"1.0\";\n /*try {\n PackageManager pm = ctx.getPackageManager();\n PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), 0);\n mAppVer = pi.versionName != null ? pi.versionName : mAppVer ;\n } catch (Exception e) {\n }*/\n return mAppVer;\n }",
"private String getRegistrationId(Context context) {\n final SharedPreferences prefs = getGCMPreferences(context);\n String registrationId = prefs.getString(PROPERTY_REG_ID, \"\");\n if (registrationId.isEmpty()) {\n Log.i(TAG, \"Registration not found.\");\n return \"\";\n }\n // Check if app was updated; if so, it must clear the registration ID\n // since the existing regID is not guaranteed to work with the new\n // app version.\n int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION,\n Integer.MIN_VALUE);\n int currentVersion = getAppVersion(context);\n if (registeredVersion != currentVersion) {\n Log.i(TAG, \"App version changed.\");\n return \"\";\n }\n return registrationId;\n }",
"public static String obtenerversionApp(Context context){\n String respuesta=\"\";\n try {\n PackageInfo packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);\n respuesta=packageInfo.versionName;\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n return respuesta;\n }",
"public static int getAppVersionCode(){\n PackageManager pm = getContext().getPackageManager();\n if(pm != null) {\n PackageInfo pi;\n try {\n pi = pm.getPackageInfo(getContext().getPackageName(), 0);\n if(pi != null) {\n return pi.versionCode;\n }\n }catch(NameNotFoundException e) {\n e.printStackTrace();\n }\n }\n return -1;\n }",
"public static String getAppVersionNumber(Context context) {\n\n\t\tString version = \"1.0\";\n\t\ttry {\n\t\t\tversion = context.getPackageManager().getPackageInfo(\n\t\t\t\t\tcontext.getPackageName(), 0).versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn \"app-\" + version;\n\t}",
"public static String getAppVersion(){\r\n return getProperty(\"version\");\r\n }",
"java.lang.String getApplicationVersion();",
"public static void m5806a(Context context) {\n f4669a = FirebaseAnalytics.getInstance(context);\n f4669a.m12579a(\"app_version\", String.valueOf(C1570t.m5994b(context)));\n }",
"@Key(\"application.version\")\n\tString applicationVersion();",
"private String getRegistrationId(Context context)\n {\n\t\tfinal SharedPreferences prefs = getGcmPreferences(context);\n\t\t\n\t\tString registrationId = prefs.getString(Globals.PREFS_PROPERTY_REG_ID, \"\");\n\t\t\n\t\tif (registrationId == null || registrationId.equals(\"\"))\n\t\t{\n\t\t Log.i(Globals.TAG, \"Registration not found.\");\n\t\t return \"\";\n\t\t}\n\t\t// Check if app was updated; if so, it must clear the registration ID\n\t\t// since the existing regID is not guaranteed to work with the new\n\t\t// app version.\n\t\tint registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);\n\t\tint currentVersion = getAppVersion(context);\n\t\tif (registeredVersion != currentVersion)\n\t\t{\n\t\t Log.i(Globals.TAG, \"App version changed.\");\n\t\t return \"\";\n\t\t}\n\t\treturn registrationId;\n }",
"private String getVersionName() {\n\n\t\tString versionName = \"\";\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager\n\t\t\t\t\t.getPackageInfo(getPackageName(), 0);// 获取包的内容\n\t\t\t// int versionCode = packageInfo.versionCode;\n\t\t\tversionName = packageInfo.versionName;\n\t\t\tSystem.out.println(\"versionName = \" + versionName);\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn versionName;\n\t}",
"private void getVersionName(String packageName) {\n String versionName = \"\";\n //Get the current App Version\n try {\n PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);\n versionName = packageInfo.versionName;\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n\n\n final String finalVersionName = versionName;\n Observable<String> versionObserver = VersionInfo.getInstance().isUpdateAvailable(packageName, this);\n if (versionObserver == null) {\n Toast.makeText(this, \"Package => \" + packageName + \" not found on Play Store\", Toast.LENGTH_SHORT).show();\n return;\n }\n versionObserver.subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<String>() {\n @Override public void onCompleted() {\n\n }\n\n @Override public void onError(Throwable e) {\n e.printStackTrace();\n }\n\n @Override public void onNext(String s) {\n if (s != null && !s.isEmpty()) {\n mTextViewVersionInfo.setText(s);\n //Version class will help us to compare two different versions\n Version currentVersion = new Version(finalVersionName);\n Version playStoreVersion = new Version(s);\n\n\n\n if (currentVersion.compareTo(playStoreVersion) == -1) {\n //A new Version is available\n //TODO SHOW UPDATE DIALOG\n } else {\n //No Update Available\n //TODO No Dialog Required\n }\n }\n }\n });\n }",
"public static String getAppVersion() {\n \t\tif (props.containsKey(\"app.version\")) {\n \t\t\treturn props.getProperty(\"app.version\");\n \t\t} else {\n \t\t\treturn \"unspecified\";\n \t\t}\n \t}",
"long getVersionNumber();",
"public static String getVersionName(Context context) {\n String versionName = \"unknown\";\n try {\n versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES).versionName;\n } catch (PackageManager.NameNotFoundException ignore) {\n QUFactory.QLog.debug(ignore.getMessage());\n }\n return versionName;\n }",
"public static int getVersionCode(Context context) {\n int versionName = -1;\n try {\n versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES).versionCode;\n } catch (PackageManager.NameNotFoundException ignore) {\n QUFactory.QLog.debug(ignore.getMessage());\n }\n return versionName;\n }",
"public String getVersion(){\r\n return version;\r\n }",
"@Nullable\n\tprivate static String getStoredRegistrationId() {\n\t\tfinal String registrationId = readGcmRegistrationId();\n\t\tif (registrationId == null) {\n\t\t\tAppLog.i(TAG, \"Registration not found.\");\n\t\t\treturn null;\n\t\t}\n\n\t\t// Check if app was updated; if so, it must clear the registration ID\n\t\t// since the existing regID is not guaranteed to work with the new\n\t\t// app version.\n\t\tfinal int registeredVersionCode = Preferences.getInt(Prefkey.gcm_last_app_version_code, Integer.MIN_VALUE);\n\t\tfinal int currentVersionCode = App.getVersionCode();\n\t\tif (registeredVersionCode != currentVersionCode) {\n\t\t\tAppLog.i(TAG, \"App version changed from \" + registeredVersionCode + \" to \" + currentVersionCode);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn registrationId;\n\t}",
"@Override\n public void onNewVersionDetected(int newVersion) {\n Log.e(\"\", \"new version \" + newVersion);\n\n }",
"private String m5297b() {\n String str = \"\";\n try {\n return getPackageManager().getPackageInfo(getPackageName(), 0).versionName;\n } catch (NameNotFoundException e) {\n e.printStackTrace();\n return str;\n }\n }",
"private static String getVerName(Context context) {\r\n String verName = \"unKnow\";\r\n try {\r\n verName = context.getPackageManager().\r\n getPackageInfo(context.getPackageName(), 0).versionName;\r\n } catch (PackageManager.NameNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n return verName;\r\n }",
"String getSdkVersion() {\n return sdkVersion;\n }",
"public static String getApplicationVersion() {\n String appVersion = Settings.getAppVersion();\n return appVersion != null ? appVersion : \"?\";\n }",
"public static String getVersion() {\n\t\treturn version;\r\n\t}",
"public static String getAppVersionNameOld(Context context) {\n String versionName = \"\";\n try {\n // ---get the package info---\n PackageManager pm = context.getPackageManager();\n PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);\n versionName = pi.versionName;\n if (TextUtils.isEmpty(versionName)) {\n return \"\";\n }\n } catch (NameNotFoundException e) {\n e.printStackTrace();\n }\n return versionName;\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tLog.i(\"-------->localVersion\", localVersion + \"\");\n\t\t\ttry {\n\t\t\t\t// String str = share.getString(getApplicationContext(),\n\t\t\t\t// \"version_code\", null);\n\t\t\t\t// localVersion = Double.parseDouble(str);\n\t\t\t\tlocalVersion = getPackageManager().getPackageInfo(\n\t\t\t\t\t\tgetPackageName(), 0).versionCode;\n\t\t\t\tHttptool http = new Httptool();\n\t\t\t\tList<NameValuePair> params = new ArrayList<NameValuePair>();\n\t\t\t\tJSONObject obj = new JSONObject(http.httppost(\n\t\t\t\t\t\tUrllist.sender_check_version, params));\n\t\t\t\tif (obj.getString(\"success\").equals(\"true\")) {\n\t\t\t\t\tJSONObject jsonObject = obj.getJSONObject(\"obj\");\n\t\t\t\t\tserverVersion = jsonObject.getDouble(\"version_num\");\n\t\t\t\t\tString version_code = jsonObject.getString(\"version_code\");\n\t\t\t\t\t// Log.i(\"--------->app_version\", version_code + \"\");\n\t\t\t\t\tshare.saveString(getApplicationContext(), \"version_code\",\n\t\t\t\t\t\t\tversion_code);\n\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t\tLog.i(\"-------->localVersion\", localVersion + \"\");\n\t\t\t\tLog.i(\"-------->serverVersion\", serverVersion + \"\");\n\t\t\t\tif (localVersion == serverVersion) {\n\t\t\t\t\tLog.i(\"--------->\", \"版本号相同无需升级\");\n\t\t\t\t\t// LoginMain();\n\t\t\t\t} else {\n\t\t\t\t\t// Log.i(TAG,\"版本号不同 ,提示用户升级 \");\n\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\tmsg.what = UPDATA_CLIENT;\n\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\t// 待处理\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = GET_UNDATAINFO_ERROR;\n\t\t\t\thandler.sendMessage(msg);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}",
"public static String getVersion() {\n\t\treturn version;\n\t}",
"int getCurrentVersion();",
"public String getVersion() {\n\t\tString version = \"0.0.0\";\n\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager.getPackageInfo(\n\t\t\t\t\tgetPackageName(), 0);\n\t\t\tversion = packageInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn version;\n\t}",
"public String getVersion() {\n\t\tString version = \"0.0.0\";\n\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager.getPackageInfo(\n\t\t\t\t\tgetPackageName(), 0);\n\t\t\tversion = packageInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn version;\n\t}",
"@Override\r\n public void onCreate() {\r\n super.onCreate();\r\n\r\n //GPSTracker object involked\r\n\r\n TelephonManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\r\n\r\n sessionManager = new SessionManager(CaptureService.this);\r\n permit_id = sessionManager.GET_EMP_ID();\r\n\r\n //Broadcast receiver involked\r\n this.registerReceiver(this.mBatInfoReceiver,\r\n new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\r\n\r\n\r\n try {\r\n pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);\r\n } catch (PackageManager.NameNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n// String version = pInfo.versionName;\r\n\r\n }",
"long getVersion();",
"long getVersion();",
"long getVersion();",
"long getVersion();",
"public static String getappno(){\n\t\t String result = \"123456\";\r\n\t\treturn result;\r\n\t}",
"public String getProductVersion();",
"public static String getVersion() {\r\n\t\treturn VERSION;\r\n\t}",
"public static int getAppVersionCode(Context mContext) {\n PackageInfo pInfo = null;\n try {\n pInfo = mContext.getPackageManager().getPackageInfo(\n mContext.getPackageName(), 0);\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n return pInfo.versionCode;\n }",
"public long getVersion(){\n return localVersion;\n }",
"public static int getAppVersionCode(Context context) {\n try {\n PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);\n return packageInfo.versionCode;\n } catch (PackageManager.NameNotFoundException e) {\n // should never happen\n throw new RuntimeException(\"Could not get package name: \" + e);\n }\n }",
"@Test\n public void appVersionTest() {\n // TODO: test appVersion\n }",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String getVersion();",
"String offerVersion();",
"public static String getVersion() {\n return version;\n }",
"public static String getVersion() {\n return version;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tVersionManager.Instace(mContext).checkNewVersion(RuntimeManager.getAppInfo().versionCode, \n\t\t\t\t\t\tnew AppUpdateCallBack() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void appUpdateSave(String version_code, String newAppNetworkUrl) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\tSettingActivity.this.version_code=version_code;\n\t\t\t\t\t\t\t\tappUpdateUrl=newAppNetworkUrl;\n\t\t\t\t\t\t\t\thandler.sendEmptyMessage(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void appUpdateFaild() {\n\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\thandler.sendEmptyMessage(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void appUpdateBegin(String newAppNetworkUrl) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\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}",
"public String getSdkVersion() {\n return sdkVersion;\n }",
"String buildVersion();",
"Long getVersion();",
"int getPaymentDetailsVersion();",
"public String getStrappver() {\n return strappver;\n }",
"Integer getVersion();",
"@Override\n\t\t\t\t\t\t\tpublic void appUpdateSave(String version_code, String newAppNetworkUrl) {\n\t\t\t\t\t\t\t\tSettingActivity.this.version_code=version_code;\n\t\t\t\t\t\t\t\tappUpdateUrl=newAppNetworkUrl;\n\t\t\t\t\t\t\t\thandler.sendEmptyMessage(0);\n\t\t\t\t\t\t\t}",
"void setApplicationVersion(java.lang.String applicationVersion);",
"public String getVersion()\n {\n return ver;\n }",
"public String getVersionNum();",
"public static String getAppVersion(Context c) {\n\t\ttry {\n\t\t\tPackageInfo pInfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);\n\t\t\treturn pInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"public static final String getVersion() { return version; }",
"public static final String getVersion() { return version; }",
"default String getVersion()\n {\n return getString( \"version\", \"Unknown Version\");\n }",
"public String getVersionNumber ();",
"public int getSaveVersion()\n {\n return saveVersion;\n }",
"@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }",
"@Override\n\tpublic java.lang.String getVersion() {\n\t\treturn _scienceApp.getVersion();\n\t}",
"public String getVersion () {\r\n return version;\r\n }",
"private boolean checkFirstRun(Context context) {\n\n final String PREFS_NAME = \"com.zgsoft.prefs\";\n final String PREF_VERSION_CODE_KEY = \"version_code\";\n final int DOESNT_EXIST = -1;\n // String packageName=null;\n\n\n // Get current version code\n int currentVersionCode = 0;\n try {\n PackageInfo packageInfo =context.getPackageManager().getPackageInfo(context.getPackageName(), 0);\n currentVersionCode =packageInfo.versionCode;\n //packageName = packageInfo.packageName;\n\n } catch (android.content.pm.PackageManager.NameNotFoundException e) {\n // handle exception\n e.printStackTrace();\n return false;\n }\n\n\n // Get saved version code\n SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, android.content.Context.MODE_PRIVATE);\n int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\n\n // Check for first run or upgrade\n if (currentVersionCode == savedVersionCode) {\n\n // This is just a normal run\n return false;\n\n } else {\n // Update the shared preferences with the current version code\n prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\n return true;\n }\n\n }",
"public int getVersion()\n {\n return info.getVersion().intValueExact();\n }",
"private int getVersionCode() {\n\t\tPackageManager manager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo info = manager.getPackageInfo(getPackageName(), 0);\n\t\t\treturn info.versionCode;\n\t\t} catch (NameNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn -1;\n\t}",
"public String getVersion()\n {\n return version;\n }",
"public String GetVersion() {\n\t\tString adapter_version = \"version: \" + adapter_version_;\n\t\treturn adapter_version;\n\t}",
"private void getGCM_ID() {\n if (regIDValue.length() <= 0)\n regIDValue = DriverApplication.getGCMRegistrationId(ctx);\n Log.d(\"GCM_REG_ID \", regIDValue);\n }",
"public static String getAppVersionName(Context context) {\n try {\n PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);\n return packageInfo.versionName;\n } catch (PackageManager.NameNotFoundException e) {\n // should never happen\n throw new RuntimeException(\"Could not get package name: \" + e);\n }\n }",
"public String getBuildVersion() {\n return Build.VERSION.RELEASE;\n }",
"public int getVersion() { return 1; }",
"public void setManifestVersion() {\n\t\tSharedPreferences.Editor editor = sp.edit();\n\t\teditor.putString(VERSION_KEY, thisVersion);\n\t\teditor.commit();\n\t}",
"private String CheckGcmID() {\n\n\t\tLocalData data = new LocalData(this);\n\t\ttry {\n\n\t\t\tif (data.GetS(\"gcmId\").length() == 0) {\n\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\tint currentversion = getAppVersion(SplashActivity.this);\n\n\t\t\tif (currentversion != data.GetI(\"app_version\")) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t} catch (Exception exp) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn data.GetS(\"gcmId\");\n\t}",
"public String getVersion() {\r\n return version;\r\n }",
"public int getVersion() {\n return version;\n }",
"public int getVersion() {\n return version;\n }",
"public int getVersion() {\n return version;\n }",
"public int getVersion() {\n return version;\n }",
"public int getVersion() {\n return version;\n }",
"private static String m35239a(Context context) {\n try {\n return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;\n } catch (NameNotFoundException unused) {\n return null;\n }\n }",
"public String getVersion() {\n return version;\n }",
"public String getVersion() {\n return version;\n }",
"public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}"
] | [
"0.7117062",
"0.68637925",
"0.6844116",
"0.67778456",
"0.66612786",
"0.66600245",
"0.65212107",
"0.6512629",
"0.64977515",
"0.6497597",
"0.6473947",
"0.64180875",
"0.6361934",
"0.6360457",
"0.6335637",
"0.6264424",
"0.6219474",
"0.61807305",
"0.6159331",
"0.6136041",
"0.6122311",
"0.6117198",
"0.60951823",
"0.6087961",
"0.608078",
"0.6076675",
"0.60628253",
"0.605824",
"0.6056551",
"0.6044571",
"0.60361713",
"0.60167617",
"0.60163677",
"0.60163677",
"0.6010195",
"0.60101897",
"0.60101897",
"0.60101897",
"0.60101897",
"0.5998182",
"0.5997755",
"0.59751767",
"0.5968422",
"0.5944682",
"0.5941975",
"0.5930203",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.5889949",
"0.58871263",
"0.58862007",
"0.58862007",
"0.5879676",
"0.5872772",
"0.587253",
"0.5870441",
"0.58448005",
"0.58385897",
"0.5833982",
"0.58199215",
"0.5818156",
"0.5811002",
"0.5803022",
"0.5797361",
"0.5793736",
"0.5793736",
"0.57900923",
"0.5779479",
"0.5779423",
"0.577149",
"0.5769626",
"0.5767404",
"0.5756656",
"0.5747901",
"0.57397145",
"0.5738417",
"0.5736681",
"0.5728702",
"0.5722663",
"0.5717453",
"0.5715626",
"0.5710481",
"0.56834096",
"0.5675649",
"0.5671132",
"0.5671132",
"0.5671132",
"0.5671132",
"0.5671132",
"0.5647673",
"0.56391406",
"0.56391406",
"0.5637746"
] | 0.0 | -1 |
Returns true if this is connected. | boolean isConnected(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isConnected() {\n if (mState == STATE_CONNECTED) {\n return true;\n }\n return false;\n }",
"public boolean isConnected(){\r\n\t\treturn connected;\r\n\t}",
"public boolean isConnected() {\n\t\tif (m == null) return false;\n\t\telse return true;\n\t}",
"public boolean isConnected() {\n \t\treturn connected;\n \t}",
"public boolean isConnected() {\n\t\treturn connected;\n\t}",
"public boolean isConnected() {\n\t\treturn connected;\n\t}",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected() {\n return this.connected;\n }",
"public boolean isConnected() {\n return this.connected;\n }",
"public boolean isConnected()\n {\n return connected;\n }",
"public boolean isConnected() {\n\t\treturn this.isConnected;\n\t}",
"public boolean isConnected() {\n return connected;\n }",
"public boolean isConnected() {\n return connected;\n }",
"public boolean isConnected() {\n return connected;\n }",
"public boolean isConnected() {\n return connected;\n }",
"public boolean isConnected() {\n return connected;\n }",
"public boolean isConnected() {\r\n return connected;\r\n }",
"public boolean isConnected() {\r\n\treturn connected;\r\n }",
"public boolean isConnected() {\n return isConnected;\n }",
"public boolean isConnected()\n {\n return isConnected;\n }",
"public boolean isConnected() {\n return (this.session != null && this.session.isConnected());\n }",
"public boolean isConnected() {\n\t\treturn conn != null;\n\t}",
"public boolean isConnected() {\n\t\treturn sock != null;\n\t}",
"public static boolean isConnected() {\n return (getCon() != null);\n }",
"@Override\n public boolean isConnected() {\n boolean result = false;\n synchronized (CONN_SYNC) {\n result = ((system != null) && system.isConnected());\n }\n return result;\n }",
"public boolean isConnected() {\n return mConnected;\n }",
"public static boolean isConnected() { return irc != null && irc.isConnected(); }",
"public boolean isConnected() {\n return mConnectionSocket.isConnected() && !mConnectionSocket.isClosed();\n }",
"public boolean isConnected() {\n return connectionSocket.isConnected();\n }",
"public boolean isConnected() {\n PublishSubscriber<T> c = state.current;\n return c.connected && !c.done && !c.isDisposed();\n }",
"public boolean isConnected() {\n if (client == null) {\n return false;\n }\n return client.isConnected();\n }",
"@Override\n public boolean isConnected()\n {\n return connected;\n }",
"public boolean isConnected(){\n return connected;\n }",
"public boolean isConnected()\n {\n return connectionId != GatewayProcess.NO_CONNECTION_ID;\n }",
"@Override\n public boolean isConnected() {\n return connected;\n }",
"public boolean isConnected() {\n HiLog.info(LOG_LABEL, \"isConnected: %{public}b\", new Object[]{Boolean.valueOf(this.mIsConnected)});\n return this.mIsConnected;\n }",
"boolean isConnected() {\n \t\tif (fConnected == null)\n \t\t\treturn false;\n \t\treturn !fConnected.isEmpty();\n \t}",
"public boolean isConnected() {\n\t\t\treturn (m_soundManager instanceof RemoteSoundManager);\n\t\t}",
"public static boolean isConnected()\r\n\t{\r\n\t\t return Globals.connected ;\r\n\t}",
"public boolean isConnecting() {\n PublishSubscriber<T> c = state.current;\n return c.connecting && !c.connected && !c.done && !c.isDisposed();\n }",
"public boolean isConnected(){\n return isConnected;\n }",
"public boolean isConnected() {\n return (this.bluetoothSocket != null);\n }",
"public final boolean isConnected() {\n\t\t// retornamos si existe una conexion\n\t\treturn this.getConnection() != null;\n\t}",
"public boolean isConnected() {\r\n\t\treturn backend != null;\r\n\t}",
"public boolean isConnecting ()\r\n\t{\r\n\t\tsynchronized (this)\r\n\t\t{\r\n\t\t\treturn _roboCOM!=null;\r\n\t\t}\r\n\t}",
"protected boolean isConnected() {\n\t\tif (channel == null) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn channel.isOpen();\n\t\t}\n\t}",
"private boolean isConnected() {\n if (skylinkConnection != null) {\n return skylinkConnection.isConnected();\n }\n return false;\n }",
"public static boolean isConnected() {\r\n\t\treturn dfl != null;\r\n\t}",
"public boolean isConnecting() {\n if (mState == STATE_CONNECTING) {\n return true;\n }\n return false;\n }",
"protected abstract boolean isConnected();",
"public static boolean hasConnected() {\n return sHasConnected;\n }",
"public boolean getIsConnected() {\n return isConnected;\n }",
"public boolean isConnectedToRemoteDevice() {\n return mConnectionManager.isConnected();\n }",
"public boolean isConnected() {\n return (chord != null);\n }",
"public boolean isConnected() {\n\t\treturn isCreated() && mqttClient.isConnected();\n\t}",
"public boolean isConnected() {\n return dataChannel != null && dataChannel.isConnected();\n }",
"private boolean isConnected() {\n\t\treturn (this.serverConnection!=null); \n }",
"public boolean connectionActive() {\n\t\tif (socketConnection == null) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn socketConnection.isConnected();\n\t\t}\n\t}",
"public boolean isConnected() {\n\t\tfinal String METHOD = \"isConnected\";\n\t\tboolean connected = false;\n\t\tif (mqttAsyncClient != null) {\n\t\t\tconnected = mqttAsyncClient.isConnected();\n\t\t} else if (mqttClient != null) {\n\t\t\tconnected = mqttClient.isConnected();\n\t\t}\n\t\tLoggerUtility.log(Level.FINEST, CLASS_NAME, METHOD, \"Connected(\" + connected + \")\");\n\t\treturn connected;\n\t}",
"public Boolean connected() {\n return this.connected;\n }",
"public boolean isConnected() {\n\t\treturn juraMqttClient != null && juraMqttClient.isConnected();\n\t}",
"@Override\r\n\tpublic boolean isConnected() {\n\t\treturn false;\r\n\t}",
"public boolean isConnected() {\n \tContext context = this.getApplicationContext();\n \t/** Create, if not exists, the preference GraviolaMOB. */\n SharedPreferences settings = context.getSharedPreferences(\"GraviolaMOB\", MODE_PRIVATE);\n /** Check the preference connectivity and return false if is not set. */\n return settings.getBoolean(\"connectivity\", false);\n }",
"private boolean isConnected() {\n if (mStarted && mClient != null && !mClient.isConnected()) {\n Log.e(LOG_TAG, \"MQTT Client not connected.\");\n if (DEBUG) {\n\tLog.e(LOG_TAG, \"isConnected[mStarted:\" + mStarted + \", mClient:\" + mClient + \"]\");\n }\n }\n\n return mClient != null && (mStarted && mClient.isConnected());\n }",
"public boolean isConnected() {\n return metricDB.isConnected();\n }",
"public boolean isConnected() {\n ConnectivityManager manager = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);\n NetworkInfo info = manager.getActiveNetworkInfo();\n if (info != null && info.isConnected()) {\n return true;\n } else {\n return false;\n }\n }",
"@Override\n\tpublic boolean isConnected() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isConnected() {\n\t\treturn false;\n\t}",
"public boolean isNetworkConnected() {\n NetworkInfo networkInfo = this.mNetInfo;\n return networkInfo != null && networkInfo.isConnectedOrConnecting();\n }",
"public boolean isConnected() {\n boolean status = false;\n try {\n status = connection != null && !connection.isClosed();\n } catch (SQLException ex) {\n LOGGER.log(Level.SEVERE, \"Unable to check connection status: {0}\", ex);\n }\n\n return status;\n }",
"private Boolean isConnected() {\r\n ConnectivityManager cm = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);\r\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\r\n Boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();\r\n return isConnected;\r\n }",
"@Override\n public boolean isOnline() {\n if(mSocket != null && mSocket.isConnected())\n return true;\n return false;\n }",
"public boolean CheckConnected() {\n return (tcp.Status() == TCP._CONNECTED);\n }",
"public Boolean getConnected() { return this.connected; }",
"public boolean isOnline()\n\t{\t\t\n\t\treturn chatConnection.isConnected();\n\t}",
"protected boolean isConnected() {\n/* 160 */ return this.delegate.isConnected();\n/* */ }",
"private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }",
"private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }",
"private boolean isNetworkConnected() {\n NetworkHelper networkHelper = new NetworkHelper(mContext);\n if (networkHelper != null) {\n return networkHelper.isNetworkConnected();\n }\n return false;\n }",
"public boolean isConnectedToGame() {\n return this.isConnectedToGame;\n }",
"private boolean isConnected() {\n try {\n return (conn != null) && conn.isValid(0);\n } catch (SQLException ex) {\n Logger.getLogger(DB.class.getName()).log(Level.SEVERE, null, ex);\n }\n return false;\n }",
"public boolean isConnectable(){\n\t\tif((System.currentTimeMillis() - this.lastTry) > retryBackoff){\n\t\t\tthis.lastTry = System.currentTimeMillis();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isStartConnected() {\r\n return startConnected;\r\n }",
"boolean supportsConnects();",
"protected synchronized boolean checkConnectivity() {\n return this.connect();\n }",
"boolean hasDisconnect();",
"public boolean allConnected()\n {\n if(isDestroyed) throw new RuntimeException(\"pvaClientMultiChannel was destroyed\");\n return (numConnected==numChannel) ? true : false;\n }",
"private boolean ifNet() {\n \t\t\n \t\tConnectivityManager connectivity = (ConnectivityManager) this\n \t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n \t\tif (connectivity != null) {\n \t\t\tNetworkInfo[] info = connectivity.getAllNetworkInfo();\n \t\t\tif (info != null)\n \t\t\t\tfor (int i = 0; i < info.length; i++)\n \t\t\t\t\tif (info[i].getState() == NetworkInfo.State.CONNECTED) {\n \t\t\t\t\t\treturn true;\n \t\t\t\t\t}\n\n \t\t}\n \t\treturn false;\n \t}",
"public static boolean isConnected(Context context){\n NetworkInfo info = Connectivity.getNetworkInfo(context);\n return (info != null && info.isConnected());\n }"
] | [
"0.87278366",
"0.863024",
"0.8602664",
"0.86015975",
"0.8570297",
"0.8570297",
"0.85588217",
"0.85588217",
"0.85588217",
"0.85588217",
"0.85588217",
"0.85576785",
"0.85576785",
"0.85054135",
"0.84970874",
"0.8495917",
"0.8495917",
"0.8495917",
"0.8495917",
"0.8495917",
"0.8491944",
"0.84637845",
"0.84619975",
"0.84596723",
"0.8453226",
"0.8451201",
"0.84141946",
"0.84107685",
"0.8408866",
"0.839328",
"0.8369701",
"0.83595854",
"0.834984",
"0.8343042",
"0.8334171",
"0.83292156",
"0.8328789",
"0.8318694",
"0.82981527",
"0.8282283",
"0.8268302",
"0.82482857",
"0.82469076",
"0.8244879",
"0.8244838",
"0.8240058",
"0.8216461",
"0.8210247",
"0.8210225",
"0.8208868",
"0.82046133",
"0.81622994",
"0.8149823",
"0.81229955",
"0.811079",
"0.80172974",
"0.8007692",
"0.79981667",
"0.79849774",
"0.79481035",
"0.7935812",
"0.7918307",
"0.7895123",
"0.7875224",
"0.78291446",
"0.7816883",
"0.78068125",
"0.77870494",
"0.77605283",
"0.77452546",
"0.77314854",
"0.77314854",
"0.76698095",
"0.7665588",
"0.7640932",
"0.7632112",
"0.76289886",
"0.76227826",
"0.758187",
"0.754668",
"0.75253767",
"0.75253767",
"0.7522721",
"0.744959",
"0.74418145",
"0.74059814",
"0.73603773",
"0.7338093",
"0.733809",
"0.73376304",
"0.73107034",
"0.72594696",
"0.7225017"
] | 0.8292769 | 46 |
Returns true if lis was added as a listener, false otherwise. | boolean addConnectionListener(LWSConnectionListener lis); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasListeners() {\n return !listeners.isEmpty();\n }",
"public boolean hasListeners() {\n return !listeners.isEmpty();\n }",
"protected boolean hasListeners()\n {\n // m_listenerSupport defaults to null, and it is reset to null when\n // the last listener unregisters\n return m_listenerSupport != null;\n }",
"protected boolean hasListeners()\n {\n // m_listenerSupport defaults to null, and it is reset to null when\n // the last listener unregisters\n return m_listenerSupport != null;\n }",
"public boolean isListenerAvailable() {\n return mListener != null;\n }",
"public boolean isListenerAvailable() {\n return mListener != null;\n }",
"boolean add(IListaLoopListener lp) {\r\n\t\treturn super.add((Object) lp);\r\n\t}",
"protected boolean isBound(){\n\t\treturn !listeners.isEmpty();\n\t}",
"protected boolean isBound(){\n\t\treturn !listeners.isEmpty();\n\t}",
"public boolean hasListener(TransferListener listener) {\n return listeners.contains(listener);\n }",
"public boolean isListenerRunning(){\n\t\tsynchronized (httpServerMutex) {\n\t\t\tif( webServer == null )\n\t\t\t\treturn false;\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public boolean hasListener(int type) {\n assert type > 0 : \"Invalid event type: \" + type;\n\n Listeners listeners = lsnrs.get(type);\n\n return (listeners != null) && (!F.isEmpty(listeners.highPriorityLsnrs) || !F.isEmpty(listeners.lsnrs));\n }",
"public synchronized boolean isEnabled() {\n \t\t\treturn listenerEnabled;\n \t\t}",
"public boolean addEventListener(USBEventListener listener) {\n if (listeners.contains(listener)) {\n return false;\n }\n\n synchronized (listeners) {\n listeners.add(listener);\n return true;\n }\n }",
"public boolean contains(L listener) {\r\n synchronized (this) {\r\n return listeners.containsKey(listener) || weak.containsKey(listener);\r\n }\r\n }",
"@Override\n\tpublic boolean addInstanceListener(final NodeStore.Listener<I> listener) {\n\t\treturn true;\n\t}",
"boolean hasActionListener() {\n // Guaranteed to return a non-null array\n Object[] listeners = listenerList.getListenerList();\n // Process the listeners last to first, notifying\n // those that are interested in this event\n for (int i = listeners.length-2; i>=0; i-=2) {\n if (listeners[i]==ActionListener.class) {\n return true;\n } \n }\n return false;\n }",
"public synchronized boolean hasSubscribers ()\n {\n return !this.listeners.isEmpty ();\n }",
"public boolean process(ElementListener listener) {\n try {\n for (Iterator i = iterator(); i.hasNext(); ) {\n listener.add((Element) i.next());\n }\n return true;\n }\n catch(DocumentException de) {\n return false;\n }\n }",
"public static boolean isListener(final Class<?> type) {\n return implementsInterface(type, Listener.class);\n }",
"public boolean hasRequestListeners(TransportAddress localAddr) {\n if (!messageListeners.isEmpty()) {\n // there is a generic listener\n return true;\n }\n if (!children.isEmpty()) {\n EventDispatcher child = children.get(localAddr);\n if (child != null) {\n return !child.messageListeners.isEmpty();\n }\n }\n return false;\n }",
"public static boolean GetClientListenerStatus (){\n return ClientListenerAlive;\n }",
"private boolean setListeners() {\n if (skylinkConnection != null) {\n skylinkConnection.setLifeCycleListener(this);\n skylinkConnection.setMediaListener(this);\n skylinkConnection.setRemotePeerListener(this);\n skylinkConnection.setRecordingListener(this);\n return true;\n } else {\n return false;\n }\n }",
"public boolean isListenerForSource(Object source) {\n return true;\n }",
"public boolean addDetectorStateEventListener(Consumer<DetectorState> listener) {\n if (detectorStateListeners.contains(listener)) {\n return false;\n }\n\n synchronized (detectorStateListeners) {\n \tdetectorStateListeners.add(listener);\n return true;\n }\n }",
"@Override\n\tpublic boolean IsListening() {\n\t\treturn listening;\n\t}",
"public void addGameListListener(GameListListener listener){\r\n super.addGameListListener(listener);\r\n\r\n if (listenerList.getListenerCount(GameListListener.class)==1){\r\n setDGState(Datagram.DG_GAMELIST_BEGIN, true);\r\n setDGState(Datagram.DG_GAMELIST_ITEM, true);\r\n }\r\n }",
"@Override\n\tpublic boolean addInstanceListener(\n\t\t\tfinal InstanceTaxonomy.Listener<T, I> listener) {\n\t\treturn true;\n\t}",
"public synchronized boolean isListening() {\n\t\treturn isListening;\n\t}",
"public boolean removeListener(ChipListener l) {\n return listeners.remove(l);\n }",
"public static boolean isAdded() {\n return true;\n }",
"public final boolean isListening() {\n return mIsListening;\n }",
"@Override\n\tpublic boolean listen(ArrayList<Track> tracks, int begin, int end) {\n\t\treturn false;\n\t}",
"public void addListDataListener(ListDataListener l) {\n }",
"@Override\n public boolean offer(E e) {\n if (delegate.offer(e)) {\n listeners.forEach(listener -> listener.onElementAdded(e));\n return true;\n } else {\n return false;\n }\n }",
"public void addListDataListener(ListDataListener l) {\r\n\t\tint index = this.listDataListeners.indexOf(l);\r\n\t\tif (index==-1) {\r\n\t\t\tthis.listDataListeners.add(l);\t\t\t\r\n\t\t} else {\r\n\t\t\tthis.listDataListeners.set(index,l);\t\t\t\t\t\t\r\n\t\t}\r\n\t}",
"public void addListDataListener(ListDataListener l) {}",
"public boolean addActionListener(ActionListener listener) {\r\n if (actionListeners.contains(listener))\r\n return false;\r\n actionListeners.add(listener);\r\n return true;\r\n }",
"public boolean hasTraceListeners()\r\n {\r\n return (null != m_traceListeners);\r\n }",
"public boolean addListener(final Object object) {\n boolean added = false;\n for (final Class<?> listenerType : listenerTypes) {\n if (listenerType.isInstance(object)) {\n try {\n addMethods.get(listenerType).invoke(scene.getComponent(), object);\n added = true;\n } catch (final IllegalAccessException | InvocationTargetException | RuntimeException ex) {\n if (scene.getExtended().getSceneBuilder().isVerbose()) {\n logger.log(Level.WARNING, MessageFormat.format(\"{0}: Exception while adding object [{1}] as a listener type [{2}].\",\n scene, object.getClass(), listenerType), ex);\n }\n }\n }\n }\n return added;\n }",
"@Override\n\t\t\t\t\t\tpublic boolean isEnabled()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(requiresListeners\n\t\t\t\t\t\t\t\t&& !prisms.util.PrismsUtils.hasEventListeners(theSession,\n\t\t\t\t\t\t\t\t\ttoFire.name))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}",
"boolean hasEvent();",
"Move listen(IListener ll);",
"public boolean hasActionListeners() {\n return true;\n }",
"public void addItemListener(ItemListener l) {\r\n\t\tint index = this.itemListeners.indexOf(l);\r\n\t\tif (index==-1) {\r\n\t\t\tthis.itemListeners.add(l);\r\n\t\t} else {\r\n\t\t\tthis.itemListeners.set(index,l);\t\t\t\r\n\t\t}\r\n\t}",
"boolean isAcceptingLifecycleEvents() {\n return adapter.isStarted();\n }",
"public boolean getUpdatesListenersOnDownload() \n {\n return true; \n }",
"@Override\n\tpublic boolean listen(ArrayList<Track> tracks, DrumPoint drum, int begin, int end) {\n\t\treturn false;\n\t}",
"public void addListener(Listener l) {\n if (!listeners.contains(l)) {\n listeners.add(l);\n }\n }",
"public boolean removeListener(\n IListener listener\n )\n {return listeners.remove(listener);}",
"public boolean isAdded(String element_id, String list_id) throws Exception{\n boolean isAdded = false;\n try {\n this.openConnection();\n PreparedStatement st = this.getConnection().prepareStatement(\"SELECT COUNT(entry_id) FROM VideogameEntries WHERE videogame_id=? AND videogameList_id=?\");\n st.setString(1, element_id);\n st.setString(2,list_id);\n ResultSet rs = st.executeQuery();\n rs.next();\n isAdded = rs.getBoolean(1);\n } catch (Exception e) {\n throw new Exception(\"Method isAdded VideogameList \" + e.getMessage());\n } finally {\n try {\n this.closeConnection();\n } catch (Exception e) {\n throw new Exception(\"Method isAdded VideogameList \" + e.getMessage());\n }\n }\n return isAdded;\n }",
"public synchronized boolean hasListeners(java.lang.String propertyName) {\r\n\treturn getPropertyChange().hasListeners(propertyName);\r\n}",
"public synchronized boolean hasListeners(java.lang.String propertyName) {\n\t\treturn getPropertyChange().hasListeners(propertyName);\n\t}",
"static //@Override\n\tpublic void addListener(final Listener listener) {\n\t\tif (null == stListeners) {\n\t\t\tstListeners = new LinkedList<>();\n\t\t}\n\t\tstListeners.add(listener);\n\t}",
"@Override\n\t\t\t\tpublic void onAddSuccess() {\n\t\t\t\t\tif (addListener != null) {\n\t\t\t\t\t\taddListener.onAddSuccess();\n\t\t\t\t\t}\n\t\t\t\t}",
"boolean isRegistrateChangeListener();",
"@Override\n\tpublic boolean listen(Track tracks, int begin, int end) {\n\t\treturn false;\n\t}",
"protected boolean shouldAddControlListener() {\n return true;\n }",
"public static boolean removeListener(HeadingListener hl) {\n return _listeners.remove(hl);\n }",
"public interface EnqueteListListener {\n}",
"public boolean hasNextEvent() {\n \treturn next != null;\n }",
"public void addNPTListener(NPTListener l){}",
"protected boolean shouldAddDisplayListener() {\n return true;\n }",
"public List<String> listeners();",
"public void addChatListener(ChatListener listener){\r\n super.addChatListener(listener);\r\n\r\n if (listenerList.getListenerCount(ChatListener.class) == 1){\r\n setDGState(Datagram.DG_PERSONAL_TELL, true);\r\n setDGState(Datagram.DG_PERSONAL_QTELL, true);\r\n setDGState(Datagram.DG_SHOUT, true);\r\n setDGState(Datagram.DG_CHANNEL_TELL, true);\r\n setDGState(Datagram.DG_CHANNEL_QTELL, true);\r\n setDGState(Datagram.DG_KIBITZ, true);\r\n }\r\n }",
"public interface ListListener {\n\t/*\n\t * Called by soundfun.ui when a different element\n\t * has been selected. This also is called if no\n\t * element was previously selected and is now selected.\n\t */\n\tpublic void selected(String action);\n}",
"public boolean removeListener(ModifiedEventListener listener) {\n\t\treturn listeners.remove(listener);\n\t}",
"void addListDataListener(ListDataListener listener);",
"public static void addListener(MetadataListListener listener) {\n if (DEBUG.Enabled) Log.debug(\"listeners no longer allowed, will not report to: \" + Util.tags(listener));\n // listeners.add(listener);\n }",
"public void addListener(\n IListener listener\n )\n {listeners.add(listener);}",
"@Override\n public void addIterationListener(LoopIterationListener lis) {\n iterationListeners.addFirst(lis);\n }",
"public boolean hasSubscribers() {\n return state.current.psm.array().length > 0;\n }",
"public void addListener(TypeAeronefListener aListener) {\n\t mListListener.add(aListener);\n\t}",
"boolean hasChangeEvent();",
"@Override\n public boolean isEnabled() {\n synchronized (mLocationListeners) {\n return mEnabledProviders.contains(getName());\n }\n }",
"public boolean hasLanded ();",
"public void addListener(Listener l) {\n\t\tmListenerSet.add(l);\n\t}",
"protected EventListenerList getEventListenerList() {\r\n return listenerList;\r\n }",
"public boolean isSetExtLst()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(EXTLST$28) != 0;\n }\n }",
"public interface Listener {}",
"public synchronized void addChangeListener(ChangeListener l) {\n Vector v = changeListeners == null ? new Vector(2) : (Vector) changeListeners.clone();\n if (!v.contains(l)) {\n v.addElement(l);\n changeListeners = v;\n }\n }",
"public int addListener(Value listener) {\n\n IApplication adapter = new IApplication() {\n private boolean execute(Value jsObject, String memberName, Object... args) {\n if (jsObject == null)\n return true;\n Value member = jsObject.getMember(memberName);\n if (member == null) {\n return true;\n }\n Value result = plugin.executeInContext(member, app);\n return result != null && result.isBoolean() ? result.asBoolean() : true;\n }\n\n @Override\n public boolean appStart(IScope app) {\n return execute(listener, \"appStart\", app);\n }\n\n @Override\n public boolean appConnect(IConnection conn, Object[] params) {\n return execute(listener, \"appConnect\", conn, params);\n }\n\n @Override\n public boolean appJoin(IClient client, IScope app) {\n return execute(listener, \"appJoin\", client, app);\n }\n\n @Override\n public void appDisconnect(IConnection conn) {\n execute(listener, \"appDisconnect\", conn);\n }\n\n @Override\n public void appLeave(IClient client, IScope app) {\n execute(listener, \"appLeave\", client, app);\n }\n\n @Override\n public void appStop(IScope app) {\n execute(listener, \"appStop\", app);\n }\n\n @Override\n public boolean roomStart(IScope room) {\n return execute(listener, \"roomStart\", room);\n }\n\n @Override\n public boolean roomConnect(IConnection conn, Object[] params) {\n return execute(listener, \"roomConnect\", conn, params);\n }\n\n @Override\n public boolean roomJoin(IClient client, IScope room) {\n return execute(listener, \"roomJoin\", client, room);\n }\n\n @Override\n public void roomDisconnect(IConnection conn) {\n execute(listener, \"roomDisconnect\", conn);\n }\n\n @Override\n public void roomLeave(IClient client, IScope room) {\n execute(listener, \"roomLeave\", client, room);\n }\n\n @Override\n public void roomStop(IScope room) {\n execute(listener, \"roomStop\", room);\n }\n };\n this.app.addListener(adapter);\n this.listeners.add(adapter);\n return this.listeners.indexOf(adapter);\n }",
"@Test\r\n\tpublic void testAddListener() {\r\n\t\t// workspace listener\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\r\n\t\t// cue listener\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addListener(cueListener);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}",
"boolean hasFeedItemTarget();",
"public void addMinesButtonListener(MinesButtonListener l) {\r\n\t\tif (!listeners.contains(l))\r\n\t\t\tlisteners.add(l);\r\n\t}",
"public boolean addChannelDisconnectListener(FinEventListener listener) {\n\t\treturn this.channelDisconnectListeners.add(listener);\n\t}",
"@Override\n\tpublic boolean listen(DrumPoint drum, int begin, int end) {\n\t\treturn false;\n\t}",
"public boolean addVenue(Venue newVenue) // --> Legger til et nytt lokale i listen.\n\t{\n\t\treturn list.add(newVenue);\n\t}",
"boolean hasServiceList();",
"abstract public void addListener(Listener listener);",
"public boolean isSetExtLst()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(EXTLST$14) != 0;\n }\n }",
"public boolean isTextListFocused() {\n\t\treturn jpIntroduceNameList.isRequestFocusEnabled();\n\t}",
"@Override\n\tpublic void addListener() {\n\t\t\n\t}",
"public boolean isAddedFromInvisibleEvent(int newIndex) {\r\n return isVisibilityChange;\r\n }",
"void addDataCollectionListener(DataCollectionListener l);",
"@SuppressWarnings(\"WeakerAccess\")\n public boolean hasObservers() {\n return mObservers.size() > 0;\n }",
"public boolean contains(List l) {\n if (lists.contains(l.obtainTitle())) return true;\n else return false;\n }",
"@Override\n\tpublic boolean isAlive() {\n\t\tif(unitList.size()==0) {\n\t\t\tlogger.close();\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}",
"boolean removeConnectionListener(LWSConnectionListener lis);",
"boolean hasList();"
] | [
"0.70871407",
"0.70871407",
"0.6906439",
"0.6906439",
"0.68899035",
"0.68899035",
"0.6700943",
"0.6625737",
"0.6625737",
"0.66173905",
"0.65493333",
"0.6545577",
"0.6528238",
"0.6510604",
"0.6429086",
"0.6409654",
"0.6377985",
"0.6346649",
"0.63113236",
"0.62403774",
"0.61902785",
"0.61714107",
"0.61636573",
"0.60882837",
"0.60860586",
"0.60192364",
"0.60112923",
"0.59475005",
"0.59053224",
"0.584482",
"0.582731",
"0.57985777",
"0.5729458",
"0.57186586",
"0.5707523",
"0.5704028",
"0.56920105",
"0.5684425",
"0.5666463",
"0.5651185",
"0.56368494",
"0.5618338",
"0.5605521",
"0.55908924",
"0.5574073",
"0.55621356",
"0.55599153",
"0.55179644",
"0.5513149",
"0.54759693",
"0.54716",
"0.5453014",
"0.54499996",
"0.5447623",
"0.5434192",
"0.5425771",
"0.5420113",
"0.54158795",
"0.5415721",
"0.5414329",
"0.5409567",
"0.54056674",
"0.53853506",
"0.5370527",
"0.536959",
"0.5360987",
"0.5358198",
"0.5355134",
"0.53462464",
"0.5340924",
"0.5335992",
"0.5333558",
"0.5329626",
"0.53166336",
"0.5306317",
"0.5299105",
"0.52840525",
"0.5281742",
"0.52742624",
"0.52622765",
"0.5246102",
"0.52433765",
"0.5235302",
"0.52303714",
"0.5223269",
"0.5218925",
"0.5216174",
"0.51873034",
"0.518188",
"0.51673466",
"0.5166979",
"0.516164",
"0.51594925",
"0.5155967",
"0.5154275",
"0.5149823",
"0.5149269",
"0.5146878",
"0.514496",
"0.51419187"
] | 0.64738137 | 14 |
Returns true if lis was removed as a listener, false otherwise. | boolean removeConnectionListener(LWSConnectionListener lis); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean removeListener(ChipListener l) {\n return listeners.remove(l);\n }",
"public boolean removeListener(\n IListener listener\n )\n {return listeners.remove(listener);}",
"public boolean removeListener(ModifiedEventListener listener) {\n\t\treturn listeners.remove(listener);\n\t}",
"public static boolean removeListener(HeadingListener hl) {\n return _listeners.remove(hl);\n }",
"@Override\n\tpublic boolean removeInstanceListener(\n\t\t\tfinal NodeStore.Listener<I> listener) {\n\t\treturn true;\n\t}",
"private boolean isRemoved() {\r\n\t\t\treturn removed;\r\n\t\t}",
"public boolean hasListeners() {\n return !listeners.isEmpty();\n }",
"public boolean hasListeners() {\n return !listeners.isEmpty();\n }",
"public final boolean removeListener(Resizable r) {\n return this.listeners.remove(r);\n }",
"public boolean hasListener(TransferListener listener) {\n return listeners.contains(listener);\n }",
"public boolean contains(L listener) {\r\n synchronized (this) {\r\n return listeners.containsKey(listener) || weak.containsKey(listener);\r\n }\r\n }",
"public void removeGameListListener(GameListListener listener){\r\n super.removeGameListListener(listener);\r\n\r\n if (listenerList.getListenerCount(GameListListener.class)==0){\r\n setDGState(Datagram.DG_GAMELIST_BEGIN, false);\r\n setDGState(Datagram.DG_GAMELIST_ITEM, false);\r\n }\r\n }",
"public boolean isRemoved() {\n return removed;\n }",
"protected boolean hasListeners()\n {\n // m_listenerSupport defaults to null, and it is reset to null when\n // the last listener unregisters\n return m_listenerSupport != null;\n }",
"protected boolean hasListeners()\n {\n // m_listenerSupport defaults to null, and it is reset to null when\n // the last listener unregisters\n return m_listenerSupport != null;\n }",
"@Override\n\tpublic boolean removeInstanceListener(\n\t\t\tfinal InstanceTaxonomy.Listener<T, I> listener) {\n\t\treturn true;\n\t}",
"boolean isRemove();",
"boolean hasActionListener() {\n // Guaranteed to return a non-null array\n Object[] listeners = listenerList.getListenerList();\n // Process the listeners last to first, notifying\n // those that are interested in this event\n for (int i = listeners.length-2; i>=0; i-=2) {\n if (listeners[i]==ActionListener.class) {\n return true;\n } \n }\n return false;\n }",
"boolean toBeRemoved(){\n\t\tif(isCancelled() || getStatus() == 0){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public void removeListDataListener(ListDataListener l) {\n }",
"protected boolean isBound(){\n\t\treturn !listeners.isEmpty();\n\t}",
"protected boolean isBound(){\n\t\treturn !listeners.isEmpty();\n\t}",
"public boolean isRemoved() {\n return REMOVED.equals(message);\n }",
"public void removeListDataListener(ListDataListener l) {}",
"public boolean removeListener(Listener listener) {\r\n\t\treturn LeapJNI.Controller_removeListener(this.swigCPtr, this, Listener.getCPtr(listener), listener);\r\n\t}",
"public void removeListDataListener(ListDataListener l) {\n\t}",
"boolean canRemove();",
"public boolean isListenerAvailable() {\n return mListener != null;\n }",
"public boolean isListenerAvailable() {\n return mListener != null;\n }",
"public boolean removed()\n {\n return this.removed;\n }",
"public boolean removeChannelDisconnectListener(FinEventListener listener) {\n\t\treturn this.channelDisconnectListeners.remove(listener);\n\t}",
"public boolean removeListener(final Object object) {\n boolean removed = false;\n for (final Class<?> listenerType : listenerTypes) {\n if (listenerType.isInstance(object)) {\n try {\n removeMethods.get(listenerType).invoke(scene.getComponent(), object);\n removed = true;\n } catch (final IllegalAccessException | InvocationTargetException | RuntimeException ex) {\n if (scene.getExtended().getSceneBuilder().isVerbose()) {\n logger.log(Level.WARNING, MessageFormat.format(\"{0}: Exception while removing object [{1}] as a listener type [{2}].\",\n scene, object.getClass(), listenerType), ex);\n }\n }\n }\n }\n return removed;\n }",
"public boolean isListenerRunning(){\n\t\tsynchronized (httpServerMutex) {\n\t\t\tif( webServer == null )\n\t\t\t\treturn false;\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public boolean removeActionListener(ActionListener listener) {\r\n return actionListeners.remove(listener);\r\n }",
"public boolean hasListener(int type) {\n assert type > 0 : \"Invalid event type: \" + type;\n\n Listeners listeners = lsnrs.get(type);\n\n return (listeners != null) && (!F.isEmpty(listeners.highPriorityLsnrs) || !F.isEmpty(listeners.lsnrs));\n }",
"public synchronized boolean hasSubscribers ()\n {\n return !this.listeners.isEmpty ();\n }",
"void removeListDataListener(ListDataListener listener);",
"public boolean remove()\n {\n return false;\n }",
"public void removeFlickListener(FlickListener l) {\r\n\t\tif (listeners.contains(l)) {\r\n\t\t\tlisteners.remove(l);\r\n\t\t}\r\n\t}",
"void removeListener(BotListener l);",
"public void removeNPTListener(NPTListener l) {}",
"public boolean isTaggedAsRemoved() {\n\t return levelOfRemoval > 0;\n\t}",
"void removeListener(\n ReaderSettingsListenerType l);",
"private boolean remove() {\r\n\t\t\treturn removed = true;\r\n\t\t}",
"public void removeChessEventListener(ChessEventListener listener){\r\n listenerList.remove(ChessEventListener.class, listener);\r\n\r\n if (listenerList.getListenerCount(ChessEventListener.class)==0){\r\n setDGState(Datagram.DG_TOURNEY, false);\r\n setDGState(Datagram.DG_REMOVE_TOURNEY, false);\r\n }\r\n }",
"void removeDataCollectionListener(DataCollectionListener l);",
"public synchronized boolean isEnabled() {\n \t\t\treturn listenerEnabled;\n \t\t}",
"public static boolean isListener(final Class<?> type) {\n return implementsInterface(type, Listener.class);\n }",
"public static boolean GetClientListenerStatus (){\n return ClientListenerAlive;\n }",
"public void removeListener(Listener l) {\n\t\tmListenerSet.remove(l);\n\t}",
"public void removeChatListener(ChatListener listener){\r\n super.removeChatListener(listener);\r\n\r\n if (listenerList.getListenerCount(ChatListener.class) == 0){\r\n setDGState(Datagram.DG_PERSONAL_TELL, false);\r\n setDGState(Datagram.DG_PERSONAL_QTELL, false);\r\n setDGState(Datagram.DG_SHOUT, false);\r\n setDGState(Datagram.DG_CHANNEL_TELL, false);\r\n setDGState(Datagram.DG_CHANNEL_QTELL, true);\r\n setDGState(Datagram.DG_KIBITZ, false);\r\n }\r\n }",
"public boolean removeListener(Animator.AnimatorListener listener) {\n return mCircularBar.removeListener(listener);\n }",
"public boolean hasRequestListeners(TransportAddress localAddr) {\n if (!messageListeners.isEmpty()) {\n // there is a generic listener\n return true;\n }\n if (!children.isEmpty()) {\n EventDispatcher child = children.get(localAddr);\n if (child != null) {\n return !child.messageListeners.isEmpty();\n }\n }\n return false;\n }",
"@Override\n\tpublic void removeListDataListener(ListDataListener arg0) {\n\n\t}",
"public void removeSkyModelUpdateListener(SkyModelUpdateListener l) throws RemoteException {\n\t\tif (!listeners.contains(l))\n\t\t\treturn;\n\n\t\t// add to kill list\n\t\tslogger.create().info().level(2).msg(\"Received request to remove listener: \" + l).send();\n\t\tdeleteListeners.add(l);\n\t}",
"public boolean process(ElementListener listener) {\n try {\n for (Iterator i = iterator(); i.hasNext(); ) {\n listener.add((Element) i.next());\n }\n return true;\n }\n catch(DocumentException de) {\n return false;\n }\n }",
"@Override\r\n\tpublic void removeListDataListener(ListDataListener arg0) {\n\r\n\t}",
"public synchronized <T extends EventListener> void remove(Class<T> t, T l) {\n \tif (l == null || !t.isInstance(l)) return;\n \t\n \twhile (listeners.remove(l)) {};\n }",
"public synchronized void removeButtonListener(ButtonListener l) {\r\n listeners.removeElement(l);\r\n }",
"public void removeDataDirectorListener(DataDirectorListener l) \n {\n if (l != null)\n {\n m_dataDirectorListeners.removeElement(l);\n }\n }",
"private static CatalogListener removeInternal(CatalogListener l,\r\n CatalogListener oldl) {\r\n if (l == oldl || l == null) {\r\n return null;\r\n } else if (l instanceof CatalogListenerMulticaster) {\r\n return ((CatalogListenerMulticaster)l).remove(oldl);\r\n } else {\r\n return l; // it's not here\r\n }\r\n }",
"public boolean deleteLast() \n {\n \t\n \tDLLNode delete = tail;\n \tdelete = tail.prev;\n \tdelete.next = null;\n \ttail = delete;\n \treturn true;\n }",
"public boolean shouldRemove() {\r\n\t\treturn death;\r\n\t}",
"private boolean hasServerRemovedAllElements() {\n return getNumElementsRemoved() >= getNumElementsToRemove();\n }",
"public boolean isStopped(){\n return downloaders.stream().allMatch(downloader -> downloader.isStopped());\n }",
"public synchronized void removeCompletionListener(ActionListener l) {\n completionListeners.removeElement(l); //remove listeners\n }",
"public boolean removeLiterature(Entry l) {\n boolean wasRemoved = false;\n try {\n wasRemoved = litRegister.remove(l);\n } catch (java.time.DateTimeException dte) {\n //TODO: Handle the exception\n } catch (NullPointerException npe) {\n //TODO: Handle the exception\n }\n return wasRemoved;\n }",
"public void removeListener(IEpzillaEventListner listener)\n\t\t\tthrows RemoteException;",
"protected abstract void checkRemoved();",
"public boolean remove(T item) {\n\t\treturn list.remove(item);\n\t}",
"public boolean removeTouchListeners() {\n Set<ShadowCircle> keys = activeFieldCircles.keySet();\n if (keys.size() < 5)\n return false;\n for (ShadowCircle key : keys) {\n key.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n return true;\n }\n });\n }\n activeFieldCircles.clear();\n return true;\n }",
"@Override\n\tpublic boolean afterRemove(Class<?> clz, String beanName, String scope, DefaultListableBeanFactory dlbf) {\n\t\treturn false;\n\t}",
"public void removeONDEXListener(ONDEXListener l) {\n listeners.remove(l);\n }",
"public static widgets.regres.RegresComponentListener remove(\r\n\t\t\twidgets.regres.RegresComponentListener l,\r\n\t\t\twidgets.regres.RegresComponentListener oldl) {\r\n\t\tif (l == oldl || l == null)\r\n\t\t\treturn null;\r\n\t\tif (l instanceof RegresComponentListenerEventMulticaster)\r\n\t\t\treturn (widgets.regres.RegresComponentListener) ((widgets.regres.RegresComponentListenerEventMulticaster) l)\r\n\t\t\t\t\t.remove(oldl);\r\n\t\treturn l;\r\n\t}",
"@Override\n public void removeListener() {\n this.mListener = null;\n }",
"@Override\r\n public void removeValidListener(ValidListener l) {\n\r\n }",
"public void unregisterListener(BluetoothCommListener lis)\n {\n if (mEnable) {\n mBS.unregisterListener(this);\n if (mListener == lis) { // Must be same mListener of course\n mListener = null;\n mContext.unregisterReceiver(receiver); // TODO: Not working? get all devices found twice in LOG?\n }\n }\n }",
"Boolean isCurrentListDoneList();",
"boolean isDeletable() {\n return life == 0;\n }",
"public boolean addEventListener(USBEventListener listener) {\n if (listeners.contains(listener)) {\n return false;\n }\n\n synchronized (listeners) {\n listeners.add(listener);\n return true;\n }\n }",
"default void removeListener(Runnable listener) {\n\t\tthis.getItemListeners().remove(listener);\n\t}",
"public boolean isRemoveEnabled() {\n return mRemoveEnabled;\n }",
"public boolean isListenerForSource(Object source) {\n return true;\n }",
"public boolean isDestroyed( NodeKey key );",
"public boolean delete() {\n boolean result = true;\n try {\n iterator.remove();\n } catch(IllegalStateException ex) {\n result = false;\n }\n return result;\n }",
"public void detachListener()\n {\n m_localInstance.detachListener();\n }",
"public boolean isRemovedToInvisibleEvent(int oldIndex) {\r\n return isVisibilityChange;\r\n }",
"public boolean addChannelDisconnectListener(FinEventListener listener) {\n\t\treturn this.channelDisconnectListeners.add(listener);\n\t}",
"@Override\n\tpublic boolean remove(Widget w) {\n\t\treturn false;\n\t}",
"boolean add(IListaLoopListener lp) {\r\n\t\treturn super.add((Object) lp);\r\n\t}",
"final boolean m20377a() {\n if (this.e != null) {\n this.e.removeCallbacks(this.f23493i);\n }\n return super.a();\n }",
"public boolean removeItem(Item toRemove) {\n\t\tboolean success = this.items\n\t\t\t\t.remove(toRemove);\n\n\t\treturn success;\n\t}",
"public void removeListener(T listener);",
"public void removeSocketNodeEventListener(\n final SocketNodeEventListener l) {\n listenerList.remove(l);\n }",
"public boolean remove(E item){\n\t\treturn (delete(item) != null) ? true : false;\n\t}",
"public void itemRemoved(boolean wasSelected);",
"@Override\n public boolean remove(Object o) {\n onAccess.accept(o);\n return delegate.remove(o);\n }",
"public boolean isRemovalDeferred() {\n return this.mDeferredRemoval;\n }",
"public synchronized boolean removeReceiver( IReceiveMessage receiver, \n Object name )\n {\n if ( receiver == null )\n {\n System.out.println(\"Warning: null receiver in \"\n + center_name + \" MessageCenter.removeReceiver()\");\n return false;\n }\n\n if ( name == null )\n {\n System.out.println(\"Warning: null message name in \"\n + center_name + \" MessageCenter.removeReceiver()\");\n return false;\n }\n\n synchronized( lists_lock )\n {\n Vector<IReceiveMessage> list = receiver_table.get( name );\n if ( list == null )\n return true;\n\n list.removeElement( receiver );\n }\n\n return true;\n }",
"public void removeListener(final T listener) {\n if (listener == null)\n throw new IllegalArgumentException(\"Parameter 'listener' must not be null!\");\n for (Iterator<T> it = _elements.iterator(); it.hasNext(); ) {\n if (it.next().equals(listener)) {\n it.remove();\n break;\n }\n }\n }"
] | [
"0.7426876",
"0.70169777",
"0.6946427",
"0.67211854",
"0.6675006",
"0.64755934",
"0.6306618",
"0.6306618",
"0.6294109",
"0.62708706",
"0.62316376",
"0.6219399",
"0.6212859",
"0.6198328",
"0.6198328",
"0.6136915",
"0.60669595",
"0.6006117",
"0.59978616",
"0.59488535",
"0.59358984",
"0.59358984",
"0.5934245",
"0.5931769",
"0.5923542",
"0.5902087",
"0.58863163",
"0.5878339",
"0.5878339",
"0.5863807",
"0.58597887",
"0.58194",
"0.57784414",
"0.5749099",
"0.5737146",
"0.57221687",
"0.5625422",
"0.5616917",
"0.5602077",
"0.5576261",
"0.5574302",
"0.5552808",
"0.5527229",
"0.5518037",
"0.55133206",
"0.549707",
"0.5483831",
"0.547657",
"0.54765666",
"0.54597634",
"0.5445843",
"0.5426046",
"0.54236674",
"0.54213643",
"0.54170686",
"0.54010713",
"0.53631157",
"0.5361004",
"0.5351747",
"0.5345977",
"0.5344617",
"0.5343465",
"0.5337737",
"0.53343886",
"0.532154",
"0.5301207",
"0.52961725",
"0.5294488",
"0.5283127",
"0.52721095",
"0.526105",
"0.5259411",
"0.5248686",
"0.5240312",
"0.52344495",
"0.52303404",
"0.522648",
"0.52244127",
"0.5215378",
"0.521255",
"0.521042",
"0.52088845",
"0.5201468",
"0.5190595",
"0.5186269",
"0.5183141",
"0.51793814",
"0.5176994",
"0.5169867",
"0.51640314",
"0.5158977",
"0.5157011",
"0.51487535",
"0.51479733",
"0.51452243",
"0.51364577",
"0.5126387",
"0.51174617",
"0.5116846",
"0.5110653"
] | 0.6361404 | 6 |
Clears all the handlers. This is used mainly for testing. | void clearHandlers(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void clearEventHandlers() {\n\t\t\r\n\t}",
"@Override\n\tpublic void ClearHandler() {\n\t\teventHandlers.clear();\n\t\t\n\t}",
"public void resetHandlers() {\r\n atRoot = true;\r\n path = \"/\";\r\n pathStack.clear();\r\n handlerStack.clear();\r\n handlers.clear();\r\n defaultHandler = null;\r\n }",
"@Override\r\n\tpublic void clearStepHandlers() {\n\t\t\r\n\t}",
"public void removeAllLogHandlers() {\n if ( _logger == null ) {\n return ;\n }\n Log.log(this, \"removeAllLogHandlers\");\n synchronized ( _logger ) {\n Handler[] handlers = _logger.getHandlers();\n for ( int i = 0; i < handlers.length; i++ ) {\n _logger.removeHandler( handlers[ i ] );\n }\n }\n }",
"public void shutdown(){\n for(MessageHandler h : handlerMap.values()){\n h.shutdown();\n }\n }",
"public static void releaseAllHandlers(){\n throw new RuntimeException(\"Not implemented yet\");\n }",
"private void clearHandler() {\n fileNames = null;\n fileName = null;\n image = null;\n displaySaveSupplier = false;\n displayUpdateSupplier = false;\n OcrHandler.getInstance().setInvoice(new Invoice());\n }",
"@Override\n public void clearAll() {\n serviceProcessor.process(ClearAllSoapEventInput.builder().build());\n }",
"@SuppressWarnings(\"unused\")\n public void removeAllListeners() {\n eventHandlerList.clear();\n }",
"@Override\n\tpublic void clearAll() {\n\t\t\n\t}",
"@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}",
"public Builder clearImagesByHandler() {\n if (imagesByHandlerBuilder_ == null) {\n imagesByHandler_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00008000);\n onChanged();\n } else {\n imagesByHandlerBuilder_.clear();\n }\n return this;\n }",
"public void clearAll();",
"public void clearAll();",
"public void clearAll() {\n infectionsQueue.clear();\n populationQueue.clear();\n deathsQueue.clear();\n healsQueue.clear();\n }",
"protected void clear() {\n if(callbacks != null) {\n callbacks.clear();\n }\n }",
"public void reset() {\n events.clear();\n }",
"protected synchronized void clearScriptHandler() {\r\n currentScriptHandler = null;\r\n handlerLock.unlock();\r\n }",
"public void clear(){\n\t\tMap<?, ?> bindings = m_bindings.getBindings();\n\t\tif (bindings == null) {\n\t\t\tif(log.isInfoEnabled()){\n\t\t\t\tlog.info(\"clear: no bindings!\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tbindings.clear();\t\n\t\tm_bindings.remove();\t\t\n\t}",
"public void clear() {\n synchronized (mMxEventDispatcher) {\n mIsAlive = false;\n // remove any listener\n mMxEventDispatcher.clearListeners();\n }\n\n // clear the store\n mStore.close();\n mStore.clear();\n\n if (null != mSyncHandlerThread) {\n mSyncHandlerThread.quit();\n mSyncHandlerThread = null;\n }\n }",
"public void clearAll() {\r\n msgMapping.clear();\r\n }",
"void clearAll();",
"void clearAll();",
"public void clear() {\n this.responseHeaders.clear();\n this.markupHeaders.clear();\n this.cookies.clear();\n }",
"public void clearCallbacks() {\n callbacks.clear();\n }",
"public void clear()\r\n {\r\n // Create the tables stack and add the top level\r\n tables.clear();\r\n tables.add( new HashMap<String,T>() );\r\n \r\n // Ditto with the counts\r\n counts.clear();\r\n counts.add( 0 ); \r\n }",
"public void clearEvents()\n {\n ClientListener.INSTANCE.clear();\n BackingMapListener.INSTANCE.clear();\n }",
"public void clear() {\r\n items.clear();\r\n keys.clear();\r\n }",
"public void clearReceivedEvents() {\n this.receivedEvents.clear();\n }",
"public void clear()\n {\n keys.clear();\n comments.clear();\n data.clear();\n }",
"protected abstract void clearAll();",
"public void clear() {\n doClear();\n }",
"void clearEventsDetectors();",
"@Override\n\t\tpublic void closeAll() {\n\t\t\tfor (ClientHandler clientHandler : new ArrayList<ClientHandler>(this.running)) {\n\t\t\t\tclientHandler.close();\n\t\t\t}\n\t\t}",
"public void clear() {\n streams.clear();\n }",
"public void clearAllWatchers() {\n\t\tif (registeredWatchers.size() > 0) {\n\t\t\tboolean isRemoved = false;\n\t\t\tLOG.info(\"About to unregister all watchers.\");\n\t\t\tfor (WatchKey watchKey : registeredWatchers.keySet()) {\n\t\t\t\ttry {\n\t\t\t\t\tisRemoved = notifier.removeWatcher(watchKey);\n\t\t\t\t\tif (isRemoved) {\n\t\t\t\t\t\tregisteredWatchers.remove(watchKey);\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// Let other watchers be cleared off\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (registeredWatchers.size() > 0) {\n\t\t\t\tLOG.info(\"Failed to clear all the watchers. Some watchers couldn't be unregistered.\");\n\t\t\t}\n\t\t} else {\n\t\t\tLOG.warn(\"Failed to clear all the watchers as no watchers registered.\");\n\t\t}\n\t}",
"public static void destroy() {\n handler = null;\n initialized = false;\n }",
"public void clear()\n {\n pages.stream().forEach((page) -> {\n page.clearCache();\n });\n\n pages.clear();\n listeners.clear();\n occupiedEntries.clear();\n }",
"public static synchronized void resetAllTimers() {\r\n _count = 0;\r\n _time = 0;\r\n _serverStarted = -1;\r\n _timers.clear();\r\n }",
"protected void clearEvents() {\n\t\tsCInterface.clearEvents();\n\n\t}",
"public void clearAll() {\n\t\tuserMap.clear();\n\t}",
"public void clear() {\n table = new Handle[defaultSize];\n logicalSize = 0;\n }",
"public final void resetAll() {\r\n this._queue = null;\r\n this._delayed = null;\r\n }",
"public void clear() {\r\n init();\r\n }",
"@Override\n public List<MHandler> getHandlers()\n {\n return null;\n }",
"public synchronized void removeAll() {\r\n\t\tif (trackedResources == null)\r\n\t\t\treturn;\r\n\t\tPair<IPath, IResourceChangeHandler>[] entries = (Pair<IPath, IResourceChangeHandler>[]) trackedResources.toArray(new Pair[trackedResources.size()]);\r\n\t\tfor (Pair<IPath, IResourceChangeHandler> entry : entries) {\r\n\t\t\tremoveResource(entry.first, entry.second);\r\n\t\t}\r\n\t}",
"public static void clear() {\r\n for (ConfigurationOption<?> opt : OPTIONS.values()) {\r\n opt.clear();\r\n }\r\n }",
"public void clearHops() {\n hops.clear();\n }",
"public void clearAllConnections() {\r\n clearAllConnections(false);\r\n }",
"@Override\n public void clear() {\n lock.lock();\n try {\n runtime.clear();\n } finally {\n lock.unlock();\n }\n }",
"public void clear() {\n doClear( false );\n }",
"@CallSuper\n protected void clear() {\n EventListener eventListener = mUseCaseConfig.getUseCaseEventListener(null);\n if (eventListener != null) {\n eventListener.onUnbind();\n }\n\n mListeners.clear();\n }",
"public void clear()\n\t{\n\t if (logger.isTraceEnabled())\n\t logger.trace(\"clear() called for browser \" + this);\n\n\t // clear all internal members\n\t clearInternal();\n\t \n\t // and increment change counter\n\t incrementChangeCounter();\n\t}",
"public static void clearPipeline(ChannelPipeline pipeline)\n\t{\n\t\ttry\n\t\t{\n\t\t\tint counter = 0;\n\t\t\t\n\t\t\twhile (pipeline.getFirst() != null)\n\t\t\t{\n\t\t\t\tpipeline.removeFirst();\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tLOG.trace(\"Removed {} handlers from pipeline\",counter);\n\t\t}\n\t\tcatch (NoSuchElementException e)\n\t\t{\n\t\t\t// all elements removed.\n\t\t}\n\t}",
"private void clear() {\n }",
"public void clear() {\n counters.clear();\n }",
"public final void clear() {\n clear(true);\n }",
"public void resetAll() {\n triggered = false;\n classBlacklist.clear();\n policies.clear();\n protectedFiles.clear();\n System.setSecurityManager(defaultSecurityManager);\n }",
"public void clear() throws RemoteException, Error;",
"public void clear () {\n\t\treset();\n\t}",
"public void unbindAll() {\n\t\tmGlobalCallbacks.clear();\n\t\t/* remove all local callback lists, that is removes all local callbacks */\n\t\tmLocalCallbacks.clear();\n\t}",
"public static synchronized void clear() {\n\t\tClassRegistry.dictionary.clear();\n\t}",
"public void clearAll()\n {\n textureMap.clear();\n componentMap.clear();\n }",
"public void clear()\n {\n normalImports.clear();\n wildcardImports.clear();\n }",
"public void clear(){\n\t\tclear(0);\n\t}",
"private void clear() {\n\t\t\tkeySet.clear();\n\t\t\tvalueSet.clear();\n\t\t\tsize = 0;\n\t\t}",
"private void clear() {\n\t\tSystem.out.println(\"Calling clear\");\n\t}",
"public void clear() {\n helpers.clear();\n islandKeysCache.clear();\n setDirty();\n }",
"public void clearResponses() {\n this.responses.clear();\n }",
"public void clearFramework() {\r\n\t\tList<Configuration> tests = testCache.getAllTests();\r\n\t\tlog.info(\"Clearing all tests.\\n\");\r\n\t\tfor (Configuration test : tests) {\r\n\t\t\tkillTest(test.getUniqueId());\r\n\t\t}\r\n\t\tworkQueue.clear();\r\n\t\ttestCache.clear();\r\n\t}",
"public void clear()\n {\n }",
"public static void stopEverything(){\r\n\t\tfor(final ExecutionHandler<?> execHandler:allThreads){\r\n\t\t\t//interrupt the stack execution, so that it wont be further executed \r\n\t\t\tstopExecutionHandler(execHandler);\r\n\t\t}\r\n\t\t//Now when all ExecutionHandlers should already be empty, but for sure - clear all global lists explicitly\r\n\t\tallThreads.clear(); \r\n\t\tallExecutablesInProcess.clear();\r\n\t\trootBlockToThread.clear();\r\n\t}",
"@Override\n public void clearAllRegistrations()\n {\n writeRegistryStoreProperties(null);\n }",
"@Override\n\tpublic void clear() {\n\t\tmap.clear();\n\t\tkeys.clear();\n\t}",
"public void clear() {\n\t\tsynchronized (queue) {\n\t\t\tthis.queue.clear();\n\t\t\tthis.totalEvents = 0;\n\t\t}\n\t}",
"void clearActions();",
"public void clearAllResponseData() {\n myExpData.clear();\n }",
"@Override\n public void clear() {\n elements.clear();\n indexByElement.clear();\n }",
"@Override\n public void clear() {\n \n }",
"public void clear() throws Exception;",
"public void clear() {\n }",
"public void clear() {\n this.mRatios.clear();\n }",
"public void clear() {\n }",
"public void clear() {\n }",
"public void clear() {\r\n messageMap.clear();\r\n }",
"public void clear() {\n\t\t// Do nothing\n\t}",
"public void clear() {\n\t\tthis.classMap.clear();\n\t}",
"public void clearAll() {\n\n realm.beginTransaction();\n realm.clear(PhotoGalleryModel.class);\n realm.commitTransaction();\n }",
"public void clearFns() {\n genClient.clear(CacheKey.fns);\n }",
"public void clear() {\n\t\tentries.clear();\n\t}",
"public void clear()\r\n/* 416: */ {\r\n/* 417:580 */ this.headers.clear();\r\n/* 418: */ }",
"public synchronized void clear() {\n ServerDescEntry tab[] = table;\n for (int index = tab.length; --index >= 0; )\n tab[index] = null;\n count = 0;\n }",
"@Override\n public void clear() {\n initialize();\n }",
"public void clearActions() {\n internalGroup.clearActions();\n }",
"public void clear() {\n\n\t}",
"public void clear() {\n synchronized (unchecked) {\n unchecked.clear();\n }\n }",
"@Override\n public void clear()\n {\n }",
"public synchronized void clear() {\n collected.clear();\n }"
] | [
"0.77290666",
"0.77266705",
"0.7628785",
"0.71370757",
"0.7034398",
"0.6934313",
"0.6888638",
"0.68825567",
"0.66342676",
"0.66099286",
"0.660778",
"0.6604793",
"0.6604793",
"0.65225345",
"0.63741493",
"0.63741493",
"0.6370881",
"0.6361821",
"0.6306459",
"0.62669224",
"0.62497705",
"0.6246057",
"0.6189764",
"0.6187487",
"0.6187487",
"0.6169175",
"0.61204183",
"0.6113138",
"0.6097287",
"0.6094939",
"0.6057547",
"0.6054425",
"0.60340124",
"0.60326415",
"0.60270876",
"0.60198194",
"0.5999952",
"0.59932137",
"0.59858865",
"0.59720594",
"0.596777",
"0.5947592",
"0.59466016",
"0.5937482",
"0.59374243",
"0.5937343",
"0.59234434",
"0.5913347",
"0.5907984",
"0.590483",
"0.59022385",
"0.5887693",
"0.5883605",
"0.58801705",
"0.5877887",
"0.5875286",
"0.58752084",
"0.58693266",
"0.5858878",
"0.5852047",
"0.5849423",
"0.5847002",
"0.58433384",
"0.58432204",
"0.58378255",
"0.58329016",
"0.58297056",
"0.58276457",
"0.58255374",
"0.58219975",
"0.58218205",
"0.5821038",
"0.5817415",
"0.58067685",
"0.5803741",
"0.58013856",
"0.5799775",
"0.57996655",
"0.57981443",
"0.5797587",
"0.57930994",
"0.57841855",
"0.5778694",
"0.577753",
"0.5773167",
"0.5773167",
"0.5772995",
"0.5771807",
"0.5771278",
"0.57697207",
"0.57619303",
"0.5759407",
"0.5757284",
"0.5757103",
"0.5755763",
"0.57529134",
"0.57527465",
"0.57518613",
"0.5750089",
"0.57439774"
] | 0.8681931 | 0 |
TODO Autogenerated method stub | public String[] readNext() {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
ConsultarProdutos metodo utilizado para a consulta de produtos "cervejas" vigentes na base de dados o metodo recebe como parametro valores responsaveis por filtrar a consulta assim podendo retorna diferentes listas de produtos "cervejas" | public List<Produto> consultarProdutos(int consulta, String valor) {
ConexaoBDJavaDB conexaoBD = new ConexaoBDJavaDB("routeexpress");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
List<Produto> produtos = new ArrayList<>();
try {
conn = conexaoBD.obterConexao();
stmt = conn.createStatement();
//Se a consulta for igual a zero(0) uma lista de todos os produtos "cervejas" e recuperada
if (consulta == 0) {
rs = stmt.executeQuery(consultas[consulta]);
//Se a consulta for igual a tres(3) uma lista de todos os produtos "cervejas" e recuperada a parti do preco
} else {
rs = stmt.executeQuery(consultas[consulta] + "'" + valor + "'");
}
Produto produto;
while (rs.next()) {
produto = new Produto();
produto.setIdCervejaria(rs.getInt("ID_CERVEJARIA"));
produto.setCervejaria(rs.getString("CERVEJARIA"));
produto.setPais(rs.getString("PAIS"));
produto.setIdCerveja(rs.getInt("ID_CERVEJA"));
produto.setIdFkCervajaria(rs.getInt("FK_CERVEJARIA"));
produto.setRotulo(rs.getString("ROTULO"));
produto.setPreco(rs.getString("PRECO"));
produto.setVolume(rs.getString("VOLUME"));
produto.setTeor(rs.getString("TEOR"));
produto.setCor(rs.getString("COR"));
produto.setTemperatura(rs.getString("TEMPERATURA"));
produto.setFamiliaEEstilo(rs.getString("FAMILIA_E_ESTILO"));
produto.setDescricao(rs.getString("DESCRICAO"));
produto.setSabor(rs.getString("SABOR"));
produto.setImagem1(rs.getString("IMAGEM_1"));
produto.setImagem2(rs.getString("IMAGEM_2"));
produto.setImagem3(rs.getString("IMAGEM_3"));
produtos.add(produto);
}
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
if (rs != null) {
try {
rs.close();
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
return produtos;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void consultaProduto() throws Exception {\r\n boolean erro;\r\n int id;\r\n Produto p;\r\n Categoria c;\r\n System.out.println(\"\\t** Consultar produto **\\n\");\r\n do {\r\n erro = false;\r\n System.out.print(\"ID do produto a ser consultado: \");\r\n id = read.nextInt();\r\n if (id <= 0) {\r\n erro = true;\r\n System.out.println(\"ID Inválida! \");\r\n }\r\n System.out.println();\r\n } while (erro);\r\n p = arqProdutos.pesquisar(id - 1);\r\n if (p != null && p.getID() != -1) {\r\n c = arqCategorias.pesquisar(p.idCategoria - 1);\r\n System.out.println(\r\n \"Id: \" + p.getID()\r\n + \"\\nNome: \" + p.nomeProduto\r\n + \"\\nDescricao: \" + p.descricao\r\n + \"\\nPreco: \" + tf.format(p.preco)\r\n + \"\\nMarca: \" + p.marca\r\n + \"\\nOrigem: \" + p.origem\r\n );\r\n if (c != null) {\r\n System.out.println(\"Categoria: \" + c.nome);\r\n } else {\r\n System.out.println(\"Categoria: \" + p.idCategoria);\r\n }\r\n } else {\r\n System.out.println(\"Produto não encontrado!\");\r\n }\r\n }",
"public Produto consultarProduto(Produto produto) {\r\n ConexaoBDJavaDB conexaoBD = new ConexaoBDJavaDB(\"routeexpress\");\r\n Connection conn = null;\r\n PreparedStatement stmt = null;\r\n ResultSet rs = null;\r\n Produto cerveja = null;\r\n String sql = \"SELECT TBL_CERVEJARIA.ID_CERVEJARIA, TBL_CERVEJARIA.CERVEJARIA, TBL_CERVEJARIA.PAIS, \"\r\n + \"TBL_CERVEJA.ID_CERVEJA, TBL_CERVEJA.ID_CERVEJARIA AS \\\"FK_CERVEJARIA\\\", \"\r\n + \"TBL_CERVEJA.ROTULO, TBL_CERVEJA.PRECO, TBL_CERVEJA.VOLUME, TBL_CERVEJA.TEOR, TBL_CERVEJA.COR, TBL_CERVEJA.TEMPERATURA, \"\r\n + \"TBL_CERVEJA.FAMILIA_E_ESTILO, TBL_CERVEJA.DESCRICAO, TBL_CERVEJA.SABOR, TBL_CERVEJA.IMAGEM_1, TBL_CERVEJA.IMAGEM_2, TBL_CERVEJA.IMAGEM_3 \"\r\n + \"FROM TBL_CERVEJARIA \"\r\n + \"INNER JOIN TBL_CERVEJA \"\r\n + \"ON TBL_CERVEJARIA.ID_CERVEJARIA = TBL_CERVEJA.ID_CERVEJARIA \"\r\n + \"WHERE ID_CERVEJA = ?\";\r\n try {\r\n conn = conexaoBD.obterConexao();\r\n stmt = conn.prepareStatement(sql);\r\n stmt.setInt(1, produto.getIdCerveja());\r\n rs = stmt.executeQuery();\r\n if (rs.next()) {\r\n cerveja = new Produto();\r\n cerveja.setIdCervejaria(rs.getInt(\"ID_CERVEJARIA\"));\r\n cerveja.setCervejaria(rs.getString(\"CERVEJARIA\"));\r\n cerveja.setPais(rs.getString(\"PAIS\"));\r\n cerveja.setIdCerveja(rs.getInt(\"ID_CERVEJA\"));\r\n cerveja.setIdFkCervajaria(rs.getInt(\"FK_CERVEJARIA\"));\r\n cerveja.setRotulo(rs.getString(\"ROTULO\"));\r\n cerveja.setPreco(rs.getString(\"PRECO\"));\r\n cerveja.setVolume(rs.getString(\"VOLUME\"));\r\n cerveja.setTeor(rs.getString(\"TEOR\"));\r\n cerveja.setCor(rs.getString(\"COR\"));\r\n cerveja.setTemperatura(rs.getString(\"TEMPERATURA\"));\r\n cerveja.setFamiliaEEstilo(rs.getString(\"FAMILIA_E_ESTILO\"));\r\n cerveja.setDescricao(rs.getString(\"DESCRICAO\"));\r\n cerveja.setSabor(rs.getString(\"SABOR\"));\r\n cerveja.setImagem1(rs.getString(\"IMAGEM_1\"));\r\n cerveja.setImagem2(rs.getString(\"IMAGEM_2\"));\r\n cerveja.setImagem3(rs.getString(\"IMAGEM_3\"));\r\n } else {\r\n return cerveja;\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (ClassNotFoundException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n if (conn != null) {\r\n try {\r\n conn.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (stmt != null) {\r\n try {\r\n stmt.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (rs != null) {\r\n try {\r\n rs.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n return cerveja;\r\n }",
"public Response getProdutos_e_suas_receitas() {\n\t\tList<Produto> lista = ((ProdutoDao) getDao()).buscarProdutos_e_suas_receitas();\n\t\tif (lista != null) {\n\t\t\tList<Produto> produtos = new ArrayList<>();\n\t\t\t// percorrer a lista retornado do BD.\n\t\t\tfor (Produto produto : lista) {\n\t\t\t\tList<ItemReceita> componentes = new ArrayList<>();\n\t\t\t\t// pega os componentes da receita de cada produto.\n\t\t\t\tfor (ItemReceita item : produto.getReceita().getComponentes()) {\n\t\t\t\t\tcomponentes.add(new ItemReceita(item.getComponente(), item.getQtdUtilizada()));\n\t\t\t\t}\n\t\t\t\t// add um novo produto com os dados da lista percorrida.\n\t\t\t\tprodutos.add(new Produto(produto.getCodigo(), produto.getDescricao(), produto.getCategoria(),\n\t\t\t\t\t\tproduto.getSimbolo(), produto.getPreco(),\n\t\t\t\t\t\tnew Receita(produto.getReceita().getCodigo(), produto.getReceita().getRendimento(),\n\t\t\t\t\t\t\t\tproduto.getReceita().getTempoPreparo(), componentes)));\n\t\t\t}\n\t\t\t// converte a lista com os novos produtos para uma string em JSON.\n\t\t\tString listaEmJson = converterParaArrayJSON(produtos);\n\t\t\t// retorna um response com o lista de produtos em JSON.\n\t\t\tsetResposta(mensagemSucesso(listaEmJson));\n\t\t} else {\n\t\t\t// retorna um response informando que não possui cadastro.\n\t\t\tsetResposta(mensagemNaoEncontrado());\n\t\t}\n\t\treturn getResposta();\n\n\t}",
"public static List<Produto> consultaProduto(int codigo, String nome, String tipo, String fornecedor) throws Exception {\n List<Produto> produto = ProdutoDAO.procurarProduto(codigo, nome, tipo, fornecedor);\r\n for (int i = 0; i < produto.size(); i++) {\r\n if (!produto.isEmpty()) {\r\n return produto;\r\n }\r\n }\r\n return null;\r\n }",
"List<CarritoProductoResponseDTO> consultarCarritoCompras(String userName,TipoMoneda tipoMoneda);",
"@Override\r\n public List<Prova> consultarTodosProva() throws Exception {\n return rnProva.consultarTodos();\r\n }",
"public ProductoDTO buscarproducto(ProductoDTO c) {\r\n PreparedStatement ps;\r\n ResultSet res;\r\n ProductoDTO arrpdto = null;\r\n\r\n try {\r\n ps = conn.getConn().prepareStatement(SQL_READ);\r\n ps.setInt(1, c.getId());\r\n res = ps.executeQuery();\r\n while (res.next()) {\r\n\r\n arrpdto = new ProductoDTO(res.getInt(1), res.getString(2), res.getString(3), res.getInt(4), res.getInt(5), res.getString(6), res.getString(7), res.getString(8), res.getString(9));\r\n\r\n }\r\n return arrpdto;\r\n\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProductoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n conn.cerrarconexion();\r\n }\r\n\r\n return null;\r\n }",
"List<CatalogoAprobadorDTO> buscarAprobador(int cveADM, String numEmpleado, Integer claveNivel, Integer centroCostoOP) throws SIATException;",
"private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}",
"public List<Tb_Prod_Painel_PromoBeans> getProdPainel(Integer terminal, Integer painel) throws SQLException {\r\n try (Connection conexao = new ConexaoLocalDBMySql().getConnect()) {\r\n String sql = \"SELECT tb_prod_painel_promo.* FROM tb_prod_painel_promo \"\r\n + \" INNER JOIN tb_prod ON(tb_prod_painel_promo.codigo=tb_prod.codigo) where terminal=? and painel=? order by tb_prod_painel_promo.idtb_painel_promo\"; \r\n PreparedStatement pstm = conexao.prepareStatement(sql);\r\n pstm.setInt(1, terminal);\r\n pstm.setInt(2, painel);\r\n ResultSet rs = pstm.executeQuery();\r\n List<Tb_Prod_Painel_PromoBeans> lpb = new ArrayList<>();\r\n while (rs.next()) {\r\n Tb_Prod_Painel_PromoBeans pb = new Tb_Prod_Painel_PromoBeans();\r\n pb.setCodigo(rs.getString(\"codigo\"));\r\n pb.setDescricao(rs.getString(\"descricao\"));\r\n pb.setUnid(rs.getString(\"unid\"));\r\n pb.setValor1(rs.getFloat(\"valor1\"));\r\n pb.setValor2(rs.getFloat(\"valor2\"));\r\n pb.setOferta(rs.getBoolean(\"oferta\"));\r\n pb.setReceita(rs.getString(\"receita\")); \r\n pb.setTerminal(rs.getInt(\"terminal\"));\r\n pb.setPainel(rs.getInt(\"painel\"));\r\n lpb.add(pb);\r\n }\r\n rs.close();\r\n pstm.close();\r\n conexao.close();\r\n return lpb;\r\n }\r\n }",
"@POST\r\n @GET\r\n @Path(\"/v1.0/produtos\")\r\n @Consumes({ WILDCARD })\r\n @Produces({ APPLICATION_ATOM_XML, APPLICATION_JSON + \"; charset=UTF-8\" })\r\n public Response listarProdutos() {\r\n\r\n log.debug(\"listarProdutos: {}\");\r\n\r\n try {\r\n\r\n List<Produto> produtos = produtoSC.listar();\r\n\r\n return respostaHTTP.construirResposta(produtos);\r\n\r\n } catch (Exception e) {\r\n\r\n return respostaHTTP.construirRespostaErro(e);\r\n }\r\n }",
"@Override\n public List<Produto> filtrarProdutos() {\n\n Query query = em.createQuery(\"SELECT p FROM Produto p ORDER BY p.id DESC\");\n\n// query.setFirstResult(pageRequest.getPageNumber() * pageRequest.getPageSize());\n// query.setMaxResults(pageRequest.getPageSize());\n return query.getResultList();\n }",
"public List<Produto> consultarProdutoPorParteNome(String nome) {\n\t\t\tQuery q = manager.query();\n\t\t\tq.constrain(Produto.class);\n\t\t\tq.descend(\"nome\").constrain(nome).like();\n\t\t\tList<Produto> result = q.execute(); \n\t\t\treturn result;\n\t\t}",
"public ArrayList<Proposta> buscarPropostasSemFiltro() {\n\n ArrayList<Proposta> listaDePropostas = new ArrayList<>();\n\n conectarnoBanco();\n\n String sql = \"SELECT * FROM proposta\";\n\n try {\n\n st = con.createStatement();\n\n rs = st.executeQuery(sql);\n\n System.out.println(\"Lista de propostas: \");\n\n while (rs.next()) {\n\n Proposta propostaTemp = new Proposta(rs.getString(\"propostaRealizada\"), rs.getFloat(\"valorProposta\"), rs.getInt(\"id_usuario\"), rs.getInt(\"id_projeto\"),rs.getInt(\"id_client\"));\n\n System.out.println(\"Proposta = \" + propostaTemp.getPropostaRealizada());\n System.out.println(\"Valor da Proposta = \" + propostaTemp.getValorProposta());\n\n System.out.println(\"---------------------------------\");\n\n listaDePropostas.add(propostaTemp);\n\n sucesso = true;\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro ao buscar propostas = \" + ex.getMessage());\n sucesso = false;\n } finally {\n try {\n\n if (con != null && pst != null) {\n con.close();\n pst.close();\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro ao fechar o bd = \" + ex.getMessage());\n }\n\n }\n\n return listaDePropostas;\n }",
"public List<TdCxlc> consultaTdCxlcProcesoTerceros(Integer cxlcCiclo, List<Integer> cxlcQnaPago, String idTipoNomina, List<Integer> secGuiaContableEjer) {\n String queryDefinition = \"\";\n \n if (idTipoNomina.equals(\"FO\")) {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_FONAC\";\n } else if (idTipoNomina.equals(\"SD\")) {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_SINDICATO\";\n } else if (idTipoNomina.equals(\"AH\")) {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_CAJA_DE_AHORRO_SINDICAL\";\n } else if (idTipoNomina.equals(\"FS\")) {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_FSTSE\";\n } else if (idTipoNomina.equals(\"PA\")) {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_PENSION_ALIMENTICIA\";\n } else if (idTipoNomina.equals(\"RI\")) {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_IMPUESTOS\";\n } else {\n queryDefinition = \"consultaTdCxlcProcesoTerceros_OTROS\";\n }\n \n String consultaTdCxlcProcesoTerceros = super.getQueryDefinition(queryDefinition);\n \n Map<String, Object> mapValues = new HashMap<String, Object>();\n mapValues.put(\"cxlcCiclo\", cxlcCiclo);\n mapValues.put(\"cxlcQnaPago\", cxlcQnaPago);\n mapValues.put(\"secGuiaContableEjer\", secGuiaContableEjer);\n \n SqlParameterSource namedParameters = new MapSqlParameterSource(mapValues);\n DataSource ds = super.getJdbcTemplate().getDataSource();\n NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(ds);\n \n super.getJdbcTemplate().setFetchSize(100);\n return namedTemplate.query(consultaTdCxlcProcesoTerceros, namedParameters, new TdCxlcProcesaTercerosAux());\n }",
"public SgfensPedidoProducto[] findWhereComentariosEquals(String comentarios) throws SgfensPedidoProductoDaoException;",
"public List<Tb_Prod_Painel_PromoBeans> getProdPainelTabelas(Integer terminal, String painel) throws SQLException {\r\n try (Connection conexao = new ConexaoLocalDBMySql().getConnect()) {\r\n String sql = \"SELECT tb_prod_painel_promo.* FROM tb_prod_painel_promo \"\r\n + \" INNER JOIN tb_prod ON(tb_prod_painel_promo.codigo=tb_prod.codigo) where terminal=? and painel in(\" + painel + \") order by tb_prod_painel_promo.idtb_painel_promo\"; \r\n PreparedStatement pstm = conexao.prepareStatement(sql);\r\n pstm.setInt(1, terminal); \r\n ResultSet rs = pstm.executeQuery();\r\n List<Tb_Prod_Painel_PromoBeans> lpb = new ArrayList<>(); \r\n while (rs.next()) {\r\n Tb_Prod_Painel_PromoBeans pb = new Tb_Prod_Painel_PromoBeans();\r\n pb.setCodigo(rs.getString(\"codigo\"));\r\n pb.setDescricao(rs.getString(\"descricao\"));\r\n pb.setUnid(rs.getString(\"unid\"));\r\n pb.setValor1(rs.getFloat(\"valor1\"));\r\n pb.setValor2(rs.getFloat(\"valor2\"));\r\n pb.setOferta(rs.getBoolean(\"oferta\"));\r\n pb.setReceita(rs.getString(\"receita\")); \r\n pb.setTerminal(rs.getInt(\"terminal\"));\r\n pb.setPainel(rs.getInt(\"painel\"));\r\n lpb.add(pb);\r\n }\r\n rs.close();\r\n pstm.close();\r\n conexao.close();\r\n return lpb;\r\n }\r\n }",
"Collection<GestionPrecioDTO> findCampaniasFiltros (GestionPrecioDTO gestionPrecio,String estadoCobro);",
"public List<Tb_Prod_Painel_PromoBeans> getProdPainelConfig(Integer terminal, Integer painel) throws SQLException {\r\n try (Connection conexao = new ConexaoLocalDBMySql().getConnect()) {\r\n String sql = \"SELECT tb_prod_painel_promo.* FROM tb_prod_painel_promo \"\r\n + \"where terminal=? and painel=? order by tb_prod_painel_promo.idtb_painel_promo\"; \r\n PreparedStatement pstm = conexao.prepareStatement(sql);\r\n pstm.setInt(1, terminal);\r\n pstm.setInt(2, painel);\r\n ResultSet rs = pstm.executeQuery();\r\n List<Tb_Prod_Painel_PromoBeans> lpb = new ArrayList<>();\r\n while (rs.next()) {\r\n Tb_Prod_Painel_PromoBeans pb = new Tb_Prod_Painel_PromoBeans();\r\n pb.setCodigo(rs.getString(\"codigo\"));\r\n pb.setDescricao(rs.getString(\"descricao\"));\r\n pb.setUnid(rs.getString(\"unid\"));\r\n pb.setValor1(rs.getFloat(\"valor1\"));\r\n pb.setValor2(rs.getFloat(\"valor2\"));\r\n pb.setOferta(rs.getBoolean(\"oferta\"));\r\n pb.setReceita(rs.getString(\"receita\")); \r\n pb.setTerminal(rs.getInt(\"terminal\"));\r\n pb.setPainel(rs.getInt(\"painel\"));\r\n lpb.add(pb);\r\n }\r\n rs.close();\r\n pstm.close();\r\n conexao.close();\r\n return lpb;\r\n }\r\n }",
"private static void cadastroProduto() {\n\n\t\tString nome = Entrada(\"PRODUTO\");\n\t\tdouble PrecoComprado = Double.parseDouble(Entrada(\"VALOR COMPRA\"));\n\t\tdouble precoVenda = Double.parseDouble(Entrada(\"VALOR VENDA\"));\n String informacaoProduto = Entrada(\"INFORMAÇÃO DO PRODUTO\");\n String informacaoTecnicas = Entrada(\"INFORMAÇÕES TÉCNICAS\");\n\n\t\tProduto produto = new Produto(nome, PrecoComprado, precoVenda, informacaoProduto,informacaoTecnicas);\n\n\t\tListaDProduto.add(produto);\n\n\t}",
"private void pesquisar_cliente() {\n String sql = \"select id, empresa, cnpj, endereco, telefone, email from empresa where empresa like ?\";\n try {\n pst = conexao.prepareStatement(sql);\n //passando o conteudo para a caixa de pesquisa para o ?\n // atenção ao ? q é a continuacao da string SQL\n pst.setString(1, txtEmpPesquisar.getText() + \"%\");\n rs = pst.executeQuery();\n // a linha abaixo usa a biblioteca rs2xml.jar p preencher a TABELA\n tblEmpresas.setModel(DbUtils.resultSetToTableModel(rs));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }",
"public String buscarTrabajadoresPorParametros() {\r\n try {\r\n inicializarFiltros();\r\n listaTrabajadores = null;\r\n //listaTrabajadores = administrarGestionarTrabajadoresBO.consultarTrabajadoresPorParametro(filtros);\r\n return null;\r\n } catch (Exception e) {\r\n System.out.println(\"Error ControllerAdministrarTrabajadores buscarTrabajadoresPorParametros : \" + e.toString());\r\n return null;\r\n }\r\n }",
"public void actualizarFiltrarEstadoRequisicion(Requisicion req) throws Exception{\n String carnet = req.getCarnetEmpleado();\n\n java.util.Date utilDate = req.getFechaNueva();\n java.sql.Date fechaConvertida = new java.sql.Date(utilDate.getTime()); \n\n List<Requisicion> requisicion = new ArrayList<>();\n \n Connection miConexion = null;\n Statement miStatement = null;\n ResultSet miResultset = null; \n\n \n //Establecer la conexion\n miConexion = origenDatos.getConexion();\n \n \n //Verificar si existe empleado\n String sqlEmpleado = \"Select CARNETEMPLEADO FROM EMPLEADO WHERE CARNETEMPLEADO = '\"+carnet+\"'\";\n miStatement = miConexion.createStatement();\n miResultset = miStatement.executeQuery(sqlEmpleado);\n \n if(miResultset.next()){\n \n String empleado = carnet;\n \n \n String sqlDepto = \"select d.NOMBREDEPARTAMENTO from departamento d \" + \n \"inner join catalagopuesto c on d.codigodepartamento = c.codigodepartamento \" + \n \"inner join empleado e on c.codigopuesto = e.codigopuesto where e.carnetempleado ='\"+carnet+\"'\";\n \n miStatement = miConexion.createStatement();\n \n //Ejecutar SQL\n miResultset = miStatement.executeQuery(sqlDepto);\n //Crear sentencia SQL y Statement\n miResultset.next();\n String nomdepto = miResultset.getString(\"NOMBREDEPARTAMENTO\");\n \n String miSQl = \"select r.NUMREQ, r.FECPEDIDOREQ, r.FECENTREGAREQ, r.AUTORIZADO, e.CARNETEMPLEADO, e.NOMBREEMPLEADO, e.APELLIDOEMPLEADO, d.NOMBREDEPARTAMENTO \" + \n \"from requisicion r inner join empleado e on r.carnetempleado =e.carnetempleado \" + \n \"inner join catalagopuesto c on e.codigopuesto =c.codigopuesto \" + \n \"inner join departamento d on c.codigodepartamento = d.codigodepartamento \" + \n \"where r.AUTORIZADO = 1 and d.NOMBREDEPARTAMENTO='\"+nomdepto+\"' and r.FECPEDIDOREQ >=TO_DATE('\"+fechaConvertida+\"', 'YYYY/MM/DD HH:MI:SS') order by r.FECPEDIDOREQ\";\n \n miStatement = miConexion.createStatement();\n \n //Ejecutar SQL\n miResultset = miStatement.executeQuery(miSQl);\n \n while(miResultset.next()){\n int numReq = miResultset.getInt(\"NUMREQ\");\n Date fechaPedido = miResultset.getDate(\"FECPEDIDOREQ\");\n Date fechaEntrega = miResultset.getDate(\"FECENTREGAREQ\"); \n String carnetEmpleado = miResultset.getString(\"CARNETEMPLEADO\");\n String nombreEmpleado = miResultset.getString(\"NOMBREEMPLEADO\"); \n String apellidoEmpleado = miResultset.getString(\"APELLIDOEMPLEADO\");\n String nombreDepartamento = miResultset.getString(\"NOMBREDEPARTAMENTO\"); \n\n //*************************ACTUALIZAR**************************\n Connection miConexion1 = null;\n PreparedStatement miStatement1 = null;\n \n //Obtener la conexion\n \n miConexion1 = origenDatos.getConexion();\n \n //Crear sentencia sql que inserte la requisicion a la base\n String misql = \"UPDATE requisicion SET autorizado = ? WHERE numreq = ?\";\n \n miStatement1 = miConexion1.prepareStatement(misql);\n \n //Establecer los parametros para insertar la requisicion \n if(\"aceptado\".equals(req.getEstadoAut())) {\n miStatement1.setInt(1, 0);\n }else{\n miStatement1.setInt(1, 1);\n } \n\n miStatement1.setInt(2, numReq);//se obtendra dentro del while\n \n //Ejecutar la instruccion sql\n miStatement1.execute(); \n //Requisicion temporal = new Requisicion(numReq, fechaPedido, fechaEntrega, carnetEmpleado, nombreEmpleado, apellidoEmpleado, nombreDepartamento);\n //requisicion.add(temporal);\n }\n \n }\n //return requisicion; \n }",
"public List<Object[]> getRetencionesAnuladas(int mes, int anio, int idOrganizacion, Sucursal sucursalFP, Sucursal sucursalRetencion, PuntoDeVenta puntoVentaRetencion, String orden, TipoComprobanteSRI tipoComprobante)\r\n/* 125: */ {\r\n/* 126:175 */ StringBuilder sql = new StringBuilder();\r\n/* 127: */ \r\n/* 128:177 */ sql.append(\" SELECT a.fechaEmisionDocumento, f.fechaRegistro, f.fechaEmision, CONCAT(f.establecimiento,'-',f.puntoEmision,'-',f.numero), f.identificacionProveedor, \");\r\n/* 129: */ \r\n/* 130:179 */ sql.append(\" \\t'', f.montoIva*0, f.montoIva*0, f.montoIva*0, '', '', \");\r\n/* 131: */ \r\n/* 132:181 */ sql.append(\" \\tCONCAT(a.establecimiento,'-',a.puntoEmision,'-',a.numeroDesde), f.montoIva*0, f.montoIva*0, f.montoIva*0, f.nombreProveedor, \");\r\n/* 133: */ \r\n/* 134:183 */ sql.append(\"\\tf.montoIva*0, f.montoIva*0, '', a.autorizacion, f.fechaRegistro, f.autorizacion, '', 'ANULADO', f.idFacturaProveedorSRI,'' \");\r\n/* 135:184 */ sql.append(\" FROM AnuladoSRI a, FacturaProveedorSRI f \");\r\n/* 136:185 */ sql.append(\" WHERE a.documentoRelacionado = f.idFacturaProveedorSRI \");\r\n/* 137:186 */ sql.append(\" AND a.tipoComprobanteSRI = :tipoComprobante \");\r\n/* 138:187 */ sql.append(\" AND a.anio = :anio AND a.mes = :mes \");\r\n/* 139:188 */ sql.append(\" AND a.idOrganizacion = :idOrganizacion \");\r\n/* 140:189 */ if (sucursalFP != null) {\r\n/* 141:190 */ sql.append(\" AND f.idSucursal = :idSucursal \");\r\n/* 142: */ }\r\n/* 143:192 */ if (sucursalRetencion != null) {\r\n/* 144:193 */ sql.append(\" AND a.establecimiento = :sucursalRetencion \");\r\n/* 145: */ }\r\n/* 146:195 */ if (puntoVentaRetencion != null) {\r\n/* 147:196 */ sql.append(\" AND a.puntoEmision = :puntoVentaRetencion \");\r\n/* 148: */ }\r\n/* 149:198 */ Query query = this.em.createQuery(sql.toString());\r\n/* 150:199 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 151:200 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 152:201 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 153:202 */ query.setParameter(\"tipoComprobante\", tipoComprobante);\r\n/* 154:203 */ if (sucursalFP != null) {\r\n/* 155:204 */ query.setParameter(\"idSucursal\", Integer.valueOf(sucursalFP.getId()));\r\n/* 156: */ }\r\n/* 157:206 */ if (sucursalRetencion != null) {\r\n/* 158:207 */ query.setParameter(\"sucursalRetencion\", sucursalRetencion.getCodigo());\r\n/* 159: */ }\r\n/* 160:209 */ if (puntoVentaRetencion != null) {\r\n/* 161:210 */ query.setParameter(\"puntoVentaRetencion\", puntoVentaRetencion.getCodigo());\r\n/* 162: */ }\r\n/* 163:213 */ return query.getResultList();\r\n/* 164: */ }",
"public List<CXPFactura> buscarFacturasPorRequisitar(final Proveedor proveedor,final Currency moneda){\r\n\t\treturn getFacturaDao().buscarFacturasPorRequisitar(proveedor, moneda);\r\n\t}",
"@Override\r\n public List<QuestaoDiscursiva> consultarTodosQuestaoDiscursiva()\r\n throws Exception {\n return rnQuestaoDiscursiva.consultarTodos();\r\n }",
"@Query(value = \"SELECT * FROM proveedor where (:idTipoProveedor \"\n + \"= 0 or idTipoProveedor=:idTipoProveedor) and (:idLocalidad \"\n + \"= 0 or idLocalidad=:idLocalidad) and (:idCondicionCompra=0 or \"\n + \"idCondicionCompra=:idCondicionCompra)\", nativeQuery = true)\n public List<Proveedor> listarPorFiltros(@Param(\"idTipoProveedor\") String idTipoProveedor, @Param(\"idLocalidad\") String idLocalidad,\n @Param(\"idCondicionCompra\") String idCondicionCompra);",
"public ArrayList<TicketDto> consultarVentasChance(String fecha, String moneda) {\n ArrayList<TicketDto> lista = new ArrayList();\n Connection con = null;\n try {\n con = Recurso.Conexion.getPool().getDataSource().getConnection();\n String sql = \"SELECT codigo,sum(vrl_apuesta) \"\n + \"FROM ticket\"\n + \" where \"\n + \" fecha='\" + fecha + \"' and moneda='\" + moneda + \"' group by codigo\";\n\n PreparedStatement str;\n str = con.prepareStatement(sql);\n ResultSet rs = str.executeQuery();\n\n while (rs.next()) {\n TicketDto dto = new TicketDto();\n dto.setCodigo(rs.getString(1));\n dto.setValor(rs.getInt(2));\n dto.setMoneda(moneda);\n lista.add(dto);\n }\n str.close();\n rs.close();\n } catch (SQLException ex) {\n ex.printStackTrace();\n } finally {\n if (con != null) {\n try {\n con.close();\n } catch (SQLException ex) {\n Logger.getLogger(GestorPremio.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return lista;\n }\n }",
"@Override\n public ArrayList<Propiedad> getPropiedadesFiltroCliente(String pCriterio, String pDato) throws\n SQLException {\n ArrayList<Propiedad> resultado = new ArrayList<Propiedad>();\n resultado = (ArrayList<Propiedad>) bdPropiedad.selectQuery(\"SELECT * FROM PROPIEDAD WHERE ESTADO \"\n + \"= 'ACTIVO' AND \" + pCriterio + \" = '\" + pDato + \"'\");\n return resultado;\n }",
"@Override\r\n public Resultado consultar(EntidadeDominio entidade) {\n String nmClass = entidade.getClass().getName();\r\n // instanciando DAO de acordo com a classe\r\n IDAO dao = daos.get(nmClass);\r\n //executando validações de regras de negocio \r\n String msg = executarRegras(entidade, \"PESQUISAR\");\r\n if (msg.isEmpty()) {\r\n if (dao.consultar(entidade).isEmpty()) {\r\n //caso dados não foram encontrados\r\n resultado.setMsg(\"dados nao encontrados\");\r\n } else {\r\n //caso dados foram encontrados \r\n resultado.setMsg(\"pesquisa feita com sucesso\");\r\n }\r\n resultado.setEntidades(dao.consultar(entidade));\r\n } else {\r\n resultado.setMsg(msg.toString());\r\n }\r\n return resultado;\r\n }",
"public static void getProduto(){\r\n try {\r\n PreparedStatement stmn = connection.prepareStatement(\"select id_produto, codigo, produto.descricao pd,preco, grupo.descricao gd from produto inner join grupo on grupo.id_grupo = produto.idgrupo order by codigo\");\r\n ResultSet result = stmn.executeQuery();\r\n\r\n System.out.println(\"id|codigo|descricao|preco|grupo\");\r\n while (result.next()){\r\n long id_produto = result.getLong(\"id_produto\");\r\n String codigo = result.getString(\"codigo\");\r\n String pd = result.getString(\"pd\");\r\n String preco = result.getString(\"preco\");\r\n String gd = result.getString(\"gd\");\r\n\r\n\r\n\r\n System.out.println(id_produto+\"\\t\"+codigo+\"\\t\"+pd+\"\\t\"+preco+\"\\t\"+gd);\r\n }\r\n\r\n }catch (Exception throwables){\r\n throwables.printStackTrace();\r\n }\r\n\r\n }",
"@WebMethod\n @WebResult(name = \"ResultadoObtenerProductos\")\n public List<Producto> consultaObtenerProductos(\n @WebParam(name = \"idIntermediario\") Long idIntermediario) {\n logger.debug(\"consultaObtenerProductos-Inicia idIntermediario:\" + idIntermediario);\n\n List<Producto> productos = new ArrayList<Producto>();\n try {\n productos = administracionParametrosService\n .obtenerProductos(idIntermediario);\n } catch (Exception e1) {\n logger.error(\"consultaObtenerProductos-Fin Error Exception:\" + e1.getMessage(), e1);\n \n }\n return productos;\n }",
"@Override\r\n public List<QuestaoMultiplaEscolha> consultarTodosQuestaoMultiplaEscolha()\r\n throws Exception {\n return rnQuestaoMultiplaEscolha.consultarTodos();\r\n }",
"public List getChamado(String servico) {\r\n Solicitacoes e = chamadoHandler(servico);\r\n\r\n List<ChamadoEnderecos> consultas = new ArrayList<>();\r\n String sql = \"SELECT DISTINCT\\n\"\r\n + \"\tpid.cod_pid,\\n\"\r\n + \" pid.nome_estabelecimento,\\n\"\r\n + \" endereco.descricao,\\n\"\r\n + \" endereco.numero,\\n\"\r\n + \" endereco.bairro,\\n\"\r\n + \" endereco.complemento,\\n\"\r\n + \" municipio.nome_municipio,\\n\"\r\n + \" municipio.uf,\\n\"\r\n + \" municipio.cod_IBGE,\\n\"\r\n + \" solicitacoes.id_solicitacao\\n\"\r\n + \" \\n\"\r\n + \" \\n\"\r\n + \"FROM \\n\"\r\n + \"\tpid \\n\"\r\n + \" INNER JOIN contato on \t(pid.cod_pid = contato.PID_cod_pid)\\n\"\r\n + \" INNER JOIN endereco on \t(pid.cod_pid = endereco.PID_cod_pid)\\n\"\r\n + \" INNER JOIN telefone on \t(contato.id_contato = telefone.Contato_id_contato)\\n\"\r\n + \" INNER JOIN municipio on \t(endereco.Municipio_cod_IBGE = municipio.cod_IBGE)\\n\"\r\n + \" INNER JOIN solicitacoes on (pid.cod_pid= solicitacoes.PID_cod_pid)\\n\"\r\n + \" INNER JOIN servico on\t(solicitacoes.Servico_id_servico=servico.id_servico)\\n\"\r\n + \" \\n\"\r\n + \" \\n\"\r\n + \" WHERE solicitacoes.em_chamado= 3 and servico.id_servico=\" + servico + \";\";\r\n\r\n stmt = null;\r\n rs = null;\r\n \r\n try {\r\n stmt = conn.createStatement();\r\n rs = stmt.executeQuery(sql);\r\n while (rs.next()) {\r\n consultas.add(new ChamadoEnderecos(rs.getString(1),\r\n rs.getString(2),\r\n rs.getString(3),\r\n rs.getString(4),\r\n rs.getString(5),\r\n rs.getString(6),\r\n rs.getString(7),\r\n rs.getString(8),\r\n rs.getString(9),\r\n rs.getString(10)\r\n ));\r\n\r\n }\r\n\r\n } catch (SQLException | ArrayIndexOutOfBoundsException ex) {\r\n Logger.getLogger(SimpleQueries.class\r\n .getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return consultas;\r\n }",
"private static void listaProdutosCadastrados() throws Exception {\r\n String nomeCategoria;\r\n ArrayList<Produto> lista = arqProdutos.toList();\r\n if (!lista.isEmpty()) {\r\n System.out.println(\"\\t** Lista dos produtos cadastrados **\\n\");\r\n }\r\n for (Produto p : lista) {\r\n if (p != null && p.getID() != -1) {\r\n nomeCategoria = getNomeCategoria(p.idCategoria - 1);\r\n System.out.println(\r\n \"Id: \" + p.getID()\r\n + \"\\nNome: \" + p.nomeProduto\r\n + \"\\nDescricao: \" + p.descricao\r\n + \"\\nPreco: \" + tf.format(p.preco)\r\n + \"\\nMarca: \" + p.marca\r\n + \"\\nOrigem: \" + p.origem\r\n );\r\n if (nomeCategoria != null) {\r\n System.out.println(\"Categoria: \" + nomeCategoria);\r\n } else {\r\n System.out.println(\"Categoria: \" + p.idCategoria);\r\n }\r\n System.out.println();\r\n Thread.sleep(500);\r\n }\r\n }\r\n }",
"public void buscarDatos() throws Exception {\n\t\ttry {\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\n\t\t\t\t\t.toString();\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\n\n\t\t\tMap<String, Object> parameters = new HashMap<String, Object>();\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\n\n\t\t\tif (admision != null) {\n\t\t\t\tparameters.put(\"identificacion\",\n\t\t\t\t\t\tadmision.getNro_identificacion());\n\t\t\t}\n\n\t\t\tif (parameter.equalsIgnoreCase(\"fecha_inicial\")) {\n\t\t\t\tparameters.put(\"fecha_string\", value);\n\t\t\t} else {\n\t\t\t\tparameters.put(\"parameter\", parameter);\n\t\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\n\t\t\t}\n\n\t\t\tgetServiceLocator().getHisc_urgencia_odontologicoService()\n\t\t\t\t\t.setLimit(\"limit 25 offset 0\");\n\n\t\t\tList<Hisc_urgencia_odontologico> lista_datos = getServiceLocator()\n\t\t\t\t\t.getHisc_urgencia_odontologicoService().listar(parameters);\n\t\t\trowsResultado.getChildren().clear();\n\n\t\t\tfor (Hisc_urgencia_odontologico hisc_urgencia_odontologico : lista_datos) {\n\t\t\t\trowsResultado.appendChild(crearFilas(\n\t\t\t\t\t\thisc_urgencia_odontologico, this));\n\t\t\t}\n\n\t\t\tgridResultado.setVisible(true);\n\t\t\tgridResultado.setMold(\"paging\");\n\t\t\tgridResultado.setPageSize(20);\n\n\t\t\tgridResultado.applyProperties();\n\t\t\tgridResultado.invalidate();\n\n\t\t} catch (Exception e) {\n\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t}\n\t}",
"public List<Produto> buscarProdutos(){\n return new ArrayList<>();\n }",
"public void buscarDatos() throws Exception {\n\t\ttry {\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\n\t\t\t\t\t.toString();\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\n\n\t\t\tMap<String, Object> parameters = new HashMap<String, Object>();\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\n\n\t\t\tif (parameter.equalsIgnoreCase(\"fecha_inicial\")) {\n\t\t\t\tparameters.put(\"fecha_string\", value);\n\t\t\t} else {\n\t\t\t\tparameters.put(\"parameter\", parameter);\n\t\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\n\t\t\t}\n\t\t\tif (admision != null) {\n\t\t\t\tparameters.put(\"identificacion\",\n\t\t\t\t\t\tadmision.getNro_identificacion());\n\t\t\t}\n\n\t\t\tgetServiceLocator().getFicha_epidemiologia_nnService().setLimit(\n\t\t\t\t\t\"limit 25 offset 0\");\n\n\t\t\tList<Ficha_epidemiologia_n3> lista_datos = getServiceLocator()\n\t\t\t\t\t.getFicha_epidemiologia_nnService().listar(\n\t\t\t\t\t\t\tFicha_epidemiologia_n3.class, parameters);\n\t\t\trowsResultado.getChildren().clear();\n\n\t\t\tfor (Ficha_epidemiologia_n3 ficha_epidemiologia_n3 : lista_datos) {\n\t\t\t\trowsResultado.appendChild(crearFilas(\n\t\t\t\t\t\tficha_epidemiologia_n3, this));\n\t\t\t}\n\n\t\t\tgridResultado.setVisible(true);\n\t\t\tgridResultado.setMold(\"paging\");\n\t\t\tgridResultado.setPageSize(20);\n\n\t\t\tgridResultado.applyProperties();\n\t\t\tgridResultado.invalidate();\n\n\t\t} catch (Exception e) {\n\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t}\n\t}",
"public List<Producto> verProductos(){\n SessionFactory sf = NewHibernateUtil.getSessionFactory();\n Session session = sf.openSession();\n // El siguiente objeto de query se puede hacer de dos formas una delgando a hql (lenguaje de consulta) que es el\n //lenguaje propio de hibernate o ejecutar ancestarmente la colsulta con sql\n Query query = session.createQuery(\"from Producto\");\n // En la consulta hql para saber que consulta agregar se procede a añadirla dandole click izquierdo sobre\n // hibernate.cfg.xml y aquí añadir la correspondiente consulta haciendo referencia a los POJOS\n List<Producto> lista = query.list();\n session.close();\n return lista;\n }",
"private String getQuerySelecaoPromocoes()\n\t{\n\t\tString result = \n\t\t\t\"SELECT \" +\n\t\t\t\" PROMOCAO.IDT_PROMOCAO, \" +\n\t\t\t\" PROMOCAO.NOM_PROMOCAO, \" +\n\t\t\t\" PROMOCAO.DAT_INICIO_VALIDADE, \" +\n\t\t\t\" PROMOCAO.DAT_FIM_VALIDADE, \" +\n\t\t\t\" PROMOCAO.VLR_MAX_CREDITO_BONUS \" +\n\t\t \"FROM \" +\n\t\t \" TBL_GER_PROMOCAO PROMOCAO \" + \n\t\t \"WHERE \" +\n\t\t \" PROMOCAO.IDT_CATEGORIA = \" + String.valueOf(ID_CATEGORIA_PULA_PULA);\n\t\t\n\t\treturn result;\n\t}",
"@Override\n\tpublic List<Produto> listar(Produto entidade) {\n\t\treturn null;\n\t}",
"public void buscarDatos() throws Exception {\r\n try {\r\n String parameter = lbxParameter.getSelectedItem().getValue()\r\n .toString();\r\n String value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n Map<String, Object> parameters = new HashMap();\r\n parameters.put(\"parameter\", parameter);\r\n parameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n getServiceLocator().getHospitalizacionService().setLimit(\r\n \"limit 25 offset 0\");\r\n\r\n List<Hospitalizacion> lista_datos = getServiceLocator()\r\n .getHospitalizacionService().listar(parameters);\r\n rowsResultado.getChildren().clear();\r\n\r\n for (Hospitalizacion hospitalizacion : lista_datos) {\r\n rowsResultado.appendChild(crearFilas(hospitalizacion, this));\r\n }\r\n\r\n gridResultado.setVisible(true);\r\n gridResultado.setMold(\"paging\");\r\n gridResultado.setPageSize(20);\r\n\r\n gridResultado.applyProperties();\r\n gridResultado.invalidate();\r\n gridResultado.setVisible(true);\r\n\r\n } catch (Exception e) {\r\n MensajesUtil.mensajeError(e, \"\", this);\r\n }\r\n }",
"@Override\n\tpublic List<Produto> listarTodos() throws ControleEstoqueSqlException {\n\t\treturn null;\n\t}",
"public static void apagarProduto(){\n if(ListaDProduto.size() == 0){\n SaidaDados(\"Nehum produto cadastrado!!\");\n return;\n }\n \n String pesquisarNome = Entrada(\"Informe o nome do produto que deseja deletar: \");\n for(int i =0; i < ListaDProduto.size(); i++){\n \n Produto produtoProcurado = ListaDProduto.get(i);\n \n if(pesquisarNome.equalsIgnoreCase(produtoProcurado.getNome())){\n ListaDProduto.remove(i);\n SaidaDados(\"Produto deletado com sucesso!!\");\n }\n \n }\n \n }",
"public List<Producto> buscar(String nombre) throws Exception {\n\t\ttry{\n\t\t\tthis.objCnx = new Conexion(\"MYSQL\");\n\t\t\tList<Producto> lista = new ArrayList<Producto>();\n\t\t\tthis.objCnx.conectarBD();\n\t\t\tString sql = \"SELECT idproducto, nombre_producto, imagen \"\n\t\t\t\t\t+ \" FROM conftbc_producto WHERE nombre_producto like '%\"+nombre+\"%' \";\n\t\t\tPreparedStatement ps = this.objCnx.cnx.prepareStatement(sql);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\twhile(rs.next()){\n\t\t\t\tProducto producto = new Producto();\n\t\t\t\tproducto.setIdproducto(rs.getInt(\"idproducto\"));\n\t\t\t\tproducto.setNombre(rs.getString(\"nombre_producto\"));\n\t\t\t\tproducto.setImagen(rs.getString(\"imagen\"));\n//\t\t\t\tCategoria categoria = new Categoria();\n//\t\t\t\tcategoria.setIdcategoria(rs.getInt(\"idcategoria\"));\n//\t\t\t\tcategoria.setNombre(rs.getString(\"categoria\"));\n//\t\t\t\tproducto.setCategoria(categoria);\n//\t\t\t\tMarca marca = new Marca();\n//\t\t\t\tmarca.setIdmarca(rs.getInt(\"idmarca\"));\n//\t\t\t\tmarca.setNombre(rs.getString(\"marca\"));\n//\t\t\t\tproducto.setMarca(marca);\n//\t\t\t\tModelo modelo = new Modelo();\n//\t\t\t\tmodelo.setIdmodelo(rs.getInt(\"idmodelo\"));\n//\t\t\t\tmodelo.setNombre(rs.getString(\"modelo\"));\n//\t\t\t\tproducto.setModelo(modelo);\n\t\t\t\tlista.add(producto);\n\t\t\t}\n\t\t\treturn lista;\n\t\t\t\n\t\t}catch(Exception ex){\n\t\t\tthis.objCnx.deshacerDB();\n\t\t\tthrow ex;\n\t\t}finally{\n\t\t\tthis.objCnx.closeDB();\n\t\t\tthis.objCnx = null;\n\t\t}\n\t}",
"@Query(value = \"SELECT * FROM proveedor WHERE (:idTipoProveedor = 0 OR\"\n + \" idTipoProveedor=:idTipoProveedor) AND (:idCondCompra=0 OR idCondCompra=:idCondCompra)\"\n + \" AND (:estadoCuenta = 2 OR estaActiva=:estadoCuenta)AND (:idLocalidad=0 OR \"\n + \"idLocalidad=:idLocalidad)\" , nativeQuery = true)\n public List<Proveedor> listarPorFiltros(@Param(\"idTipoProveedor\") int idTipoProveedor,\n @Param(\"idCondCompra\") int idCondCompra,@Param(\"estadoCuenta\") \n int estadoCuenta,@Param(\"idLocalidad\") int idLocalidad);",
"@Path(\"/Enviar\")\r\n @POST\r\n @Consumes(MediaType.APPLICATION_JSON)\r\n @Produces(MediaType.APPLICATION_JSON) \r\n public Response SendPromotion(String query){\r\n logger.debug(\"Promociones - Enviar - query: \" + query); \r\n \r\n //obtenemos el nombre del cliente\r\n JSONObject jsonObjectRequest = new JSONObject(query); \r\n String nombre = jsonObjectRequest.get(\"nombre\").toString(); \r\n \r\n String msg = MSG_PROCESS_NOT_STARTED;\r\n int cod = -1; \r\n JSONArray result = new JSONArray();\r\n \r\n if(!nombre.equals(\"\")){\r\n //obtenemos la id del cliente a través del nombre\r\n ClienteDao clienteDao = new ClienteDao();\r\n int idCliente = clienteDao.GetId(nombre);\r\n logger.debug(\"SendPromotion - idCustomer: \"+idCliente);\r\n if(idCliente != -1){\r\n //comprobamos que el cliente tenga al menos una reserva\r\n boolean existeReserva = clienteDao.ExisteReserva(idCliente);\r\n if(existeReserva){\r\n //obtenemos las reservas del cliente\r\n ReservaDao reservaDao = new ReservaDao();\r\n ArrayList<Reserva> reservas = reservaDao.GetReservasCliente(idCliente);\r\n \r\n if(reservas.size() > 0){\r\n //obtenemos la preferencia de envío del cliente\r\n String preferencia = clienteDao.GetPreferencia(idCliente);\r\n if(!preferencia.equals(\"\")){\r\n //insertamos en el JSON el nombre del cliente y la preferencia de envío\r\n JSONObject client = new JSONObject();\r\n if (preferencia.equals(\"email\")){\r\n client.put(\"metodoenvio\",\"EMAIL\");\r\n }else{\r\n client.put(\"metodoenvio\",\"SMS\");\r\n }\r\n client.put(\"nombrecliente\",nombre);\r\n result.put(client);\r\n\r\n HotelDao hotelDao = new HotelDao();\r\n ArrayList<Promocion> hotelesPromocionables;\r\n //para todas las reservas del cliente\r\n for(Reserva reserva : reservas){\r\n //obtenemos el id del hotel a través del id de la reserva\r\n int idHotel = reserva.getIdHotel(); \r\n if(idHotel != -1){ \r\n //obtenemos la ciudad del hotel a través la id\r\n String ciudad = hotelDao.GetCiudad(idHotel);\r\n if(!ciudad.equals(\"\")){\r\n //obtenemos los hoteles que se pueden promocionar al cliente en base a la ciudad de anteriores reservas\r\n hotelesPromocionables = hotelDao.GetHotelesPromocionables(idHotel,ciudad);\r\n JSONArray hoteles = new JSONArray();\r\n\r\n if(hotelesPromocionables.size() > 0){\r\n //obtenemos el nombre del hotel a través de su id\r\n String nombreHotel = hotelDao.GetNombre(idHotel);\r\n if(!nombreHotel.equals(\"\")){\r\n //insertamos en el JSON el nombre del hotel ya reservado y la ciudad\r\n JSONObject infoHotelReservado = new JSONObject();\r\n infoHotelReservado.put(\"Hotel Ya Reservado\",nombreHotel);\r\n infoHotelReservado.put(\"Ciudad\",ciudad); \r\n hoteles.put(infoHotelReservado);\r\n\r\n JSONArray promociones = new JSONArray();\r\n //para todos los hoteles promocionales\r\n for(Promocion hp : hotelesPromocionables){\r\n //insertamos el nombre y plantilla del hotel a promocionar\r\n JSONObject p = new JSONObject();\r\n p.put(\"Nombre Hotel\", hp.getNombreHotel());\r\n p.put(\"Asunto\",hp.getAsunto());\r\n p.put(\"Cuerpo\",hp.getCuerpo());\r\n promociones.put(p); \r\n }\r\n hoteles.put(promociones);\r\n }else{\r\n cod = 10;\r\n msg = MSG_10;\r\n }\r\n }else{\r\n cod = 9;\r\n msg = MSG_9;\r\n }\r\n result.put(hoteles);\r\n }else{\r\n cod = 8;\r\n msg = MSG_8;\r\n }\r\n }else{\r\n cod = 7;\r\n msg = MSG_7;\r\n }\r\n cod = 1;\r\n msg = MSG_1;\r\n }\r\n }else{\r\n cod = 6;\r\n msg = MSG_6;\r\n }\r\n }else{\r\n cod = 5;\r\n msg = MSG_5;\r\n } \r\n }else{\r\n cod = 4;\r\n msg = MSG_4;\r\n } \r\n }else{\r\n cod = 3;\r\n msg = MSG_3;\r\n } \r\n }else{\r\n if(nombre.equals(\"\")){\r\n cod = 2;\r\n msg = MSG_2;\r\n }\r\n } \r\n \r\n JSONObject response = new JSONObject(); \r\n response.put(\"msg\",msg);\r\n response.put(\"cod\",cod);\r\n response.put(\"result\",result);\r\n return Response.status(200).entity(response.toString()).build(); \r\n }",
"public ArrayList<ServicioDTO> consultarServicios(String columna, String informacion) throws Exception {\r\n ArrayList<ServicioDTO> dtos = new ArrayList<>();\r\n conn = Conexion.generarConexion();\r\n String sql = \"\";\r\n if (columna.equals(\"nom\")) \r\n sql = \" WHERE SerNombre LIKE ? OR \"\r\n + \"SerNombre LIKE ? OR \"\r\n + \"SerNombre LIKE ? OR \"\r\n + \"SerNombre LIKE ?\";\r\n else if (columna.equals(\"cod\"))\r\n sql = \" WHERE SerCodigo = ? \";\r\n if (conn != null) {\r\n PreparedStatement stmt = conn.prepareStatement(\"SELECT SerCodigo, \"\r\n + \"SerNombre, SerCaracter, SerNotas, SerHabilitado \"\r\n + \"FROM tblservicio\" + sql);\r\n if (columna.equals(\"cod\")) {\r\n stmt.setString(1, informacion);\r\n } else if (columna.equals(\"nom\")) {\r\n stmt.setString(1, informacion);\r\n stmt.setString(2, \"%\" + informacion);\r\n stmt.setString(3, informacion + \"%\");\r\n stmt.setString(4, \"%\" + informacion + \"%\");\r\n }\r\n ResultSet rs = stmt.executeQuery();\r\n while (rs.next()) {\r\n ServicioDTO dto = new ServicioDTO();\r\n dto.setCodigo(rs.getInt(1));\r\n dto.setNombre(rs.getString(2));\r\n dto.setCaracter(rs.getString(3));\r\n dto.setNotas(rs.getString(4));\r\n String habilitado = rs.getString(5);\r\n if(habilitado.equals(\"si\"))\r\n dto.setHabilitado(true);\r\n else\r\n dto.setHabilitado(false);\r\n dtos.add(dto);\r\n }\r\n stmt.close();\r\n rs.close();\r\n conn.close();\r\n }\r\n return dtos;\r\n }",
"public String[][] obtenerConsultasBusqueda(String nombre){\n //VARIABLES PARA ALMACENAR LOS DATOS DE LA BASE DE DATOS\n String[][] datos = new String[obtenerRegistrosBusqueda(nombre)][5];\n int i = 0;\n //SE INTENTA HACE LA CONEXION Y OBTENER LOS RSULTDOS\n try {\n //METODOS DE CONEXION\n Connection connect = getConnection();\n PreparedStatement ps;\n ResultSet res;\n \n //QUERY PARA OBTENER LOS VALORES\n ps = connect.prepareStatement(\"SELECT nombre, apellidos, incentivo, descuentos, total FROM personal INNER JOIN nomina ON personal.id = nomina.id WHERE nombre = ?\");\n ps.setString(1, nombre);\n res = ps.executeQuery();\n \n while (res.next()) {\n //SE ALMACENANAN LOS DATOS DE LA BASE DE DATOS EN EL ARREGLO\n datos[i][0] = res.getString(\"nombre\");\n datos[i][1] = res.getString(\"apellidos\");\n datos[i][2] = res.getString(\"incentivo\");\n datos[i][3] = res.getString(\"descuentos\");\n datos[i][4] = res.getString(\"total\");\n i++; \n }\n //SE CIERRA LA CONEXION Y SE RETORNAN LOS DATOS OBTENIDOS\n connect.close();\n return datos;\n }\n //EN CASO DE ERROR SE MUESTRA EL MENSAJE \n catch (Exception e) {\n System.out.println(\"error en resultado: \"+e);\n JOptionPane.showMessageDialog(null, \"Hubo un error:\"+e);\n return datos;\n }\n }",
"public ArrayList<ProductoDTO> mostrartodos() {\r\n\r\n\r\n PreparedStatement ps;\r\n ResultSet res;\r\n ArrayList<ProductoDTO> arr = new ArrayList();\r\n try {\r\n\r\n ps = conn.getConn().prepareStatement(SQL_READALL);\r\n res = ps.executeQuery();\r\n while (res.next()) {\r\n\r\n arr.add(new ProductoDTO(res.getInt(1), res.getString(2), res.getString(3), res.getInt(4), res.getInt(5), res.getString(6), res.getString(7), res.getString(8), res.getString(9)));\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"error vuelva a intentar\");\r\n } finally {\r\n conn.cerrarconexion();\r\n\r\n }\r\n return arr;\r\n\r\n }",
"public CalMetasDTO cargarRegistro(int codigoCiclo, int codigoPlan, int codigoMeta) {\n/* */ try {\n/* 416 */ String s = \"select m.*,\";\n/* 417 */ s = s + \"tm.descripcion as nombreTipoMedicion,\";\n/* 418 */ s = s + \"est.descripcion as nombreEstado,\";\n/* 419 */ s = s + \"Um.Descripcion as nombre_unidad_medida\";\n/* 420 */ s = s + \" from cal_plan_metas m,sis_multivalores tm,sis_multivalores est,Sis_Multivalores Um\";\n/* 421 */ s = s + \" where \";\n/* 422 */ s = s + \" m.tipo_medicion =tm.valor\";\n/* 423 */ s = s + \" and tm.tabla='CAL_TIPO_MEDICION'\";\n/* 424 */ s = s + \" and m.estado =est.valor\";\n/* 425 */ s = s + \" and est.tabla='CAL_ESTADO_META'\";\n/* 426 */ s = s + \" and m.Unidad_Medida = Um.Valor\";\n/* 427 */ s = s + \" and Um.Tabla = 'CAL_UNIDAD_MEDIDA_META'\";\n/* 428 */ s = s + \" and m.codigo_ciclo=\" + codigoCiclo;\n/* 429 */ s = s + \" and m.codigo_plan=\" + codigoPlan;\n/* 430 */ s = s + \" and m.codigo_meta=\" + codigoMeta;\n/* 431 */ boolean rtaDB = this.dat.parseSql(s);\n/* 432 */ if (!rtaDB) {\n/* 433 */ return null;\n/* */ }\n/* */ \n/* 436 */ this.rs = this.dat.getResultSet();\n/* 437 */ if (this.rs.next()) {\n/* 438 */ return leerRegistro();\n/* */ }\n/* */ }\n/* 441 */ catch (Exception e) {\n/* 442 */ e.printStackTrace();\n/* 443 */ Utilidades.writeError(\"CalPlanMetasFactory:cargarCalMetas \", e);\n/* */ } \n/* 445 */ return null;\n/* */ }",
"public List<Emprestimos> buscarPorPropriedade(String whereClause, Object parametro) {\n\t\treturn manager.createQuery(\"select e from Emprestimos e \" + whereClause + parametro, Emprestimos.class)\n\t\t .getResultList();\n\t}",
"private void cargaInfoEmpleado(){\r\n Connection conn = null;\r\n Conexion conex = null;\r\n try{\r\n if(!Config.estaCargada){\r\n Config.cargaConfig();\r\n }\r\n conex = new Conexion();\r\n conex.creaConexion(Config.host, Config.user, Config.pass, Config.port, Config.name, Config.driv, Config.surl);\r\n conn = conex.getConexion();\r\n if(conn != null){\r\n ArrayList<Object> paramsIn = new ArrayList();\r\n paramsIn.add(txtLogin);\r\n QryRespDTO resp = new Consulta().ejecutaSelectSP(conn, IQryUsuarios.NOM_FN_OBTIENE_INFO_USUARIOWEB, paramsIn);\r\n System.out.println(\"resp: \" + resp.getRes() + \"-\" + resp.getMsg());\r\n if(resp.getRes() == 1){\r\n ArrayList<ColumnaDTO> listaColumnas = resp.getColumnas();\r\n for(HashMap<String, CampoDTO> fila : resp.getDatosTabla()){\r\n usuario = new UsuarioDTO();\r\n \r\n for(ColumnaDTO col: listaColumnas){\r\n switch(col.getIdTipo()){\r\n case java.sql.Types.INTEGER:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Integer.parseInt(fila.get(col.getEtiqueta()).getValor().toString().replaceAll(\",\", \"\").replaceAll(\"$\", \"\").replaceAll(\" \", \"\")));\r\n break;\r\n \r\n case java.sql.Types.DOUBLE:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Double.parseDouble(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n case java.sql.Types.FLOAT:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Float.parseFloat(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n case java.sql.Types.DECIMAL:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Float.parseFloat(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n case java.sql.Types.VARCHAR:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"\":fila.get(col.getEtiqueta()).getValor().toString());\r\n break;\r\n \r\n case java.sql.Types.NUMERIC:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Float.parseFloat(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n default:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"\":fila.get(col.getEtiqueta()).getValor().toString());\r\n break;\r\n } \r\n }\r\n }\r\n sesionMap.put(\"UsuarioDTO\", usuario);\r\n }else{\r\n context.getExternalContext().getApplicationMap().clear();\r\n context.getExternalContext().redirect(\"index.xhtml\");\r\n }\r\n }\r\n }catch(Exception ex){\r\n System.out.println(\"Excepcion en la cargaInfoEmpleado: \" + ex);\r\n }finally{\r\n try{\r\n conn.close();\r\n }catch(Exception ex){\r\n \r\n }\r\n }\r\n }",
"private void llenarListadoPromocionSalarial() {\n\t\tString sql1 = \"select det.* from seleccion.promocion_salarial det \"\r\n\t\t\t\t+ \"join planificacion.estado_cab cab on cab.id_estado_cab = det.id_estado_cab \"\r\n\t\t\t\t+ \"join planificacion.configuracion_uo_cab uo_cab \"\r\n\t\t\t\t+ \"on uo_cab.id_configuracion_uo = det.id_configuracion_uo_cab\"\r\n\t\t\t\t+ \" left join seleccion.promocion_concurso_agr agr \"\r\n\t\t\t\t+ \"on agr.id_promocion_salarial = det.id_promocion_salarial\"\r\n\t\t\t\t\r\n\t\t\t\t+ \" where lower(cab.descripcion) = 'concurso' \" + \"and (\"\r\n\t\t\t\t+ \"\t\tagr.id_estado_det = (\" + \"\t\t\t\tselect est.id_estado_det \"\r\n\t\t\t\t+ \"\t\t\t\tfrom planificacion.estado_det est \"\r\n\t\t\t\t+ \"\t\t\t\twhere lower(est.descripcion)='libre'\" + \"\t\t) \"\r\n\t\t\t\t+ \"\t\tor agr.id_estado_det is null\" + \"\t) \"\r\n\t\t\t\t+ \" and uo_cab.id_configuracion_uo = \"\r\n\t\t\t\t+ configuracionUoCab.getIdConfiguracionUo()\r\n\t\t\t\t+ \" AND det.activo=true\";\r\n\t\t/*\r\n\t\t * Tipo de concurso = CONCURSO SIMPLIFICADO Se despliegan los puestos\r\n\t\t * PERMANENTES o CONTRATADOS, con estado = LIBRE o NULO Los puestos\r\n\t\t * deben ser de nivel 1\r\n\t\t */\r\n//\t\tif (concurso.getDatosEspecificosTipoConc().getDescripcion()\r\n//\t\t\t\t.equalsIgnoreCase(CONCURSO_SIMPLIFICADO)) {\r\n//\t\t\tsql1 += \" and cpt.nivel=1 and cpt.activo=true and (det.permanente is true or det.contratado is true) \";\r\n//\t\t}\r\n\r\n\t\t/*\r\n\t\t * Tipo de concurso = CONCURSO INTERNO DE OPOSICION INSTITUCIONAL Se\r\n\t\t * despliegan los puestos PERMANENTE, con estado = LIBRE o NULO\r\n\t\t */\r\n\r\n//\t\tif (concurso.getDatosEspecificosTipoConc().getDescripcion()\r\n//\t\t\t\t.equalsIgnoreCase(CONCURSO_INTERNO_OPOSICION)) {\r\n//\t\t\tsql1 += \" and det.permanente is true \";\r\n//\t\t}\r\n\r\n\t\t/*\r\n\t\t * Tipo de concurso = CONCURSO INTERNO DE OPOSICION INTER INSTITUCIONAL\r\n\t\t * Se despliegan los puestos PERMANENTE, con estado = LIBRE o NULO\r\n\t\t */\r\n\r\n//\t\tif (concurso.getDatosEspecificosTipoConc().getDescripcion()\r\n//\t\t\t\t.equalsIgnoreCase(CONCURSO_INTERNO_INTERINSTITUCIONAL)) {\r\n//\t\t\tsql1 += \" and det.permanente is true \";\r\n//\t\t}\r\n\t\t\r\n\t\tString sql2 = \"select puesto_det.* \"\r\n\t\t\t\t+ \"from seleccion.promocion_concurso_agr puesto_det \"\r\n\t\t\t\t+ \"join planificacion.estado_det estado_det \"\r\n\t\t\t\t+ \"on estado_det.id_estado_det = puesto_det.id_estado_det \"\r\n\t\t\t\t+ \"join seleccion.promocion_salarial det \"\r\n\t\t\t\t+ \"on det.id_promocion_salarial = puesto_det.id_promocion_salarial \"\r\n\t\t\t\t+ \"join planificacion.configuracion_uo_cab uo_cab \"\r\n\t\t\t\t+ \"on uo_cab.id_configuracion_uo = det.id_configuracion_uo_cab \"\r\n\t\t\t//\t+ \"join seleccion.concurso concurso \"\r\n\t\t\t//\t+ \"on concurso.id_concurso = puesto_det.id_concurso \"\r\n\t\t\t\t\r\n\t\t\t\t+ \" where lower(estado_det.descripcion) = 'en reserva' \"\r\n\t\t\t\t+ \"and uo_cab.id_configuracion_uo = \"\r\n\t\t\t\t+ configuracionUoCab.getIdConfiguracionUo()\r\n\t\t\t//\t+ \" and concurso.id_concurso = \" + concurso.getIdConcurso()\r\n\t\t\t\t+ \" and puesto_det.activo=true\";\r\n\r\n\t\tcargarListaPromocionSalarial(sql1, sql2);\r\n\t}",
"@Override\n\tpublic List<Comisiones> buscar(Comisiones comisiones) {\n\t\tEntityManager manager = createEntityManager();\n\t\tCriteriaBuilder builder = manager.getCriteriaBuilder();\n\t\t\n\t\tCriteriaQuery<Comisiones> criteriaQuery = builder.createQuery(Comisiones.class);\n\t\tRoot<Comisiones> root = criteriaQuery.from(Comisiones.class);\n\t\t\n\t\t \n\t\tPredicate valor1 = builder.equal(root.get(\"region\"), comisiones.getRegion().getrEgionidpk());\n\t\tPredicate valor2 = builder.equal(root.get(\"vCodcomision\"),comisiones.getvCodcomision());\n\t\tPredicate valor3 = builder.equal(root.get(\"vNumdocapr\"),comisiones.getvNumdocapr());\n\t\tPredicate valor4 = null;\n\t\tPredicate valor6 = null; \n\t\tif(comisiones.getvDescripcion().length() >0) {\n\t\t\t valor4 = builder.like(root.get(\"vDescripcion\"), \"%\"+comisiones.getvDescripcion()+\"%\"); \n\t\t\t valor6 = builder.or(valor4);\n\t\t}else {\n\t\t\t if(comisiones.getNombrencargado().length()>0) {\n\t\t\t\t valor4 = builder.like(root.get(\"consejero\").get(\"vDesnombre\"), \"%\"+comisiones.getNombrencargado()+\"%\"); \n\t\t\t\t valor6 = builder.or(valor4);\n\t\t\t }else {\n\t\t\t\t valor6 = builder.or(valor2,valor3); \n\t\t\t }\n\t\t\t \n\t\t}\n\t\tPredicate valor7 = builder.and(valor1,valor6);\n\t\tcriteriaQuery.where(valor7);\n\t\tQuery<Comisiones> query = (Query<Comisiones>) manager.createQuery(criteriaQuery);\n\t\tList<Comisiones> resultado = query.getResultList();\n\t\tmanager.close();\n\t\treturn resultado; \n\t}",
"public String[][] obtenerConsultas(){\n //VARIABLES PARA ALMACENAR LOS DATOS DE LA BASE DE DATOS\n int i = 0;\n String[][] datos = new String[obtenerRegistros()][5];\n //SE INTENTA HACE LA CONEXION Y OBTENER LOS RSULTDOS\n try {\n //METODOS DE CONEXION\n Connection connect = getConnection();\n PreparedStatement ps;\n ResultSet res;\n\n //QUERY PARA OBTENER LOS VALORES\n ps = connect.prepareStatement(\"SELECT nombre, apellidos, incentivo, descuentos, total FROM personal INNER JOIN nomina ON personal.id = nomina.id;\");\n res = ps.executeQuery();\n \n while (res.next()) {\n //SE ALMACENANAN LOS DATOS DE LA BASE DE DATOS EN EL ARREGLO\n datos[i][0] = res.getString(\"nombre\");\n datos[i][1] = res.getString(\"apellidos\");\n datos[i][2] = res.getString(\"incentivo\");\n datos[i][3] = res.getString(\"descuentos\");\n datos[i][4] = res.getString(\"total\"); \n i++; \n }\n //SE CIERRA LA CONEXION Y SE RETORNAN LOS DATOS OBTENIDOS\n connect.close();\n return datos;\n }\n //EN CASO DE ERROR SE MUESTRA EL MENSAJE \n catch (Exception e) {\n System.out.println(\"error en resultado: \"+e);\n JOptionPane.showMessageDialog(null, \"Hubo un error:\"+e);\n return datos;\n }\n }",
"public ArrayList<PedidoProduto> selecionarPorId(String Id) {\n String sql = \"SELECT * FROM pedidos \"\n + \"LEFT JOIN pedidosprodutos ON pedidosprodutos.PedidoId = pedidos.Id \"\n + \"LEFT JOIN produtos ON pedidosprodutos.ProdutoId = produtos.Id \"\n + \"LEFT JOIN estoque ON estoque.ProdutoId = produtos.Id \"\n + \"LEFT JOIN usuarios ON pedidos.UsuarioId = usuarios.Id \"\n + \"WHERE pedidos.Id = ?\";\n int queryId = Integer.parseInt(Id);\n try {\n conn = connFac.getConexao();\n stmt = conn.prepareStatement(sql);\n stmt.setInt(1, queryId);\n rs = stmt.executeQuery();\n while(rs.next()) {\n Pedido pedido = new Pedido();\n this.helper.fillPedido(pedido, rs);\n \n Usuario usuario = new Usuario();\n this.helper.fillUsuario(usuario, rs);\n pedido.setSolicitante(usuario);\n \n Produto produto = new Produto();\n this.helper.fillProduto(produto, rs);\n \n PedidoProduto pedidoProduto = new PedidoProduto();\n this.helper.fillPedidoProduto(pedidoProduto, pedido, produto, rs);\n \n pedidosProdutos.add(pedidoProduto);\n }\n connFac.closeAll(rs, stmt, st, conn);\n return pedidosProdutos;\n } catch (SQLException error) {\n Methods.getLogger().error(\"PedidoDAO.selecionarPorId: \" + error);\n throw new RuntimeException(\"PedidoDAO.selecionarPorId: \" + error);\n }\n }",
"public void buscarDatos()throws Exception{\n\t\ttry {\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue().toString();\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\n\n\t\t\tMap<String, Object> parameters = new HashMap<String, Object>();\n\t\t\tparameters.put(\"parameter\", parameter);\n\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\n\n\t\t\tif (admision != null) {\n\t\t\t\tparameters.put(\"identificacion\",\n\t\t\t\t\t\tadmision.getNro_identificacion());\n\t\t\t}\n\t\t\t\n\t\t\tgetServiceLocator().getFicha_epidemiologia_nnService().setLimit(\"limit 25 offset 0\");\n\t\t\t\n\t\t\tList<Ficha_epidemiologia_n13> lista_datos = getServiceLocator()\n\t\t\t\t\t.getFicha_epidemiologia_nnService().listar(\n\t\t\t\t\t\t\tFicha_epidemiologia_n13.class, parameters);\n\t\t\trowsResultado.getChildren().clear();\n\t\t\t\n\t\t\tfor (Ficha_epidemiologia_n13 ficha_epidemiologia_n13 : lista_datos) {\n\t\t\t\trowsResultado.appendChild(crearFilas(ficha_epidemiologia_n13, this));\n\t\t\t}\n\t\t\t\n\t\t\tgridResultado.setVisible(true);\n\t\t\tgridResultado.setMold(\"paging\");\n\t\t\tgridResultado.setPageSize(20);\n\t\t\t\n\t\t\tgridResultado.applyProperties();\n\t\t\tgridResultado.invalidate();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t}\n\t}",
"public BeanProdutosJsp consultar(String id) throws Exception {\n\t\tString sql = \"select * from produtos where id = '\" + id + \"'\";\n\n\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\t\tResultSet resultSet = preparedStatement.executeQuery();\n\n\t\tif (resultSet.next()) {\n\t\t\tBeanProdutosJsp beanProdutosJsp = new BeanProdutosJsp();\n\n\t\t\tbeanProdutosJsp.setId(resultSet.getLong(\"id\"));\n\t\t\tbeanProdutosJsp.setNome(resultSet.getString(\"nome\"));\n\t\t\tbeanProdutosJsp.setQuantidade(resultSet.getDouble(\"quantidade\"));\n\t\t\tbeanProdutosJsp.setValor(resultSet.getDouble(\"valor\"));\n\t\t\tbeanProdutosJsp.setCategoria_id(resultSet.getLong(\"categoria_id\"));\n\n\t\t\treturn beanProdutosJsp;\n\t\t}\n\t\treturn null;\n\t}",
"public List<ItemVenda> getItemVenda(Lancamento lancamento) {\r\n\r\n List<ItemVenda> resultado = new ArrayList<ItemVenda>();\r\n Connection con = pool.getConnection();\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n String sqlSelect = \"SELECT \\n\" +\r\n \" *\\n\" +\r\n \"FROM\\n\" +\r\n \" (SELECT \\n\" +\r\n \" A.CODIGO_LANCAMENTO,\\n\" +\r\n \" D.CODIGO_PRODUTO AS CODIGO_PRODUTO,\\n\" +\r\n \" D.NOME_PRODUTO AS DESCRICAO,\\n\" +\r\n \" C.QUANTIDADE,\\n\" +\r\n \" C.PRECO_TOTAL,\\n\" +\r\n \" C.PRECO_UNITARIO,\\n\" +\r\n \" C.TYPE_PRODUCT\\n\" +\r\n \" FROM\\n\" +\r\n \" LANCAMENTO A, VENDA B, ITEM_VENDA C, PRODUTO D\\n\" +\r\n \" WHERE\\n\" +\r\n \" A.VENDA_CODIGO_VENDA = B.CODIGO_VENDA\\n\" +\r\n \" AND B.CODIGO_VENDA = C.VENDA_CODIGO_VENDA\\n\" +\r\n \" AND C.PRODUTO_CODIGO_PRODUTO = D.CODIGO_PRODUTO UNION ALL SELECT \\n\" +\r\n \" A.CODIGO_LANCAMENTO,\\n\" +\r\n \" D.CODIGO_PACOTE_PROMOCIONAL AS CODIGO_PRODUTO,\\n\" +\r\n \" D.DESCRICAO,\\n\" +\r\n \" C.QUANTIDADE,\\n\" +\r\n \" C.PRECO_TOTAL,\\n\" +\r\n \" C.PRECO_UNITARIO,\\n\" +\r\n \" C.TYPE_PRODUCT\\n\" +\r\n \" FROM\\n\" +\r\n \" LANCAMENTO A, VENDA B, ITEM_VENDA C, PACOTE_PROMOCIONAL D\\n\" +\r\n \" WHERE\\n\" +\r\n \" A.VENDA_CODIGO_VENDA = B.CODIGO_VENDA\\n\" +\r\n \" AND B.CODIGO_VENDA = C.VENDA_CODIGO_VENDA\\n\" +\r\n \" AND C.PACOTE_PROMOCIONAL_CODIGO_PACOTE_PROMOCIONAL = D.CODIGO_PACOTE_PROMOCIONAL) AS CONSULTA\\n\" +\r\n \" WHERE CODIGO_LANCAMENTO = ?\";\r\n\r\n try {\r\n ps = con.prepareStatement(sqlSelect);\r\n ps.setInt(1, lancamento.getCodigo_lancamento());\r\n\r\n rs = ps.executeQuery();\r\n\r\n resultado = getListaItensVenda(rs);\r\n\r\n ps.close();\r\n } catch (ParseException ex) {\r\n return null;\r\n\r\n } catch (SQLException ex) {\r\n Logger.getLogger(LocacaoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n pool.liberarConnection(con);\r\n }\r\n return resultado;\r\n }",
"@Override\n\tpublic String executa(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tJuncaoEstoqueProduto estoque = new JuncaoEstoqueProduto(Integer.parseInt(request.getParameter(\"quantidade\")),\n\t\t\t\trequest.getParameter(\"nome\"),request.getParameter(\"codProduto\"),Integer.parseInt(request.getParameter(\"quantidadeMinima\")));\n\t\t// enviar dados para o DAO persistir\n\t\tnew JuncaoEstoqueProdutoDAO().salvar(estoque);\n\t\t//retornar o nome da view\n\t\trequest.setAttribute(\"msg\", \"parabéns produto cadastrado com sucesso\");\n\t\treturn \"cadastroProduto\";\n\t}",
"private void listaContatos() throws SQLException {\n limpaCampos();\n DAOLivro d = new DAOLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\"); \n \n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }",
"@SuppressWarnings(\"unchecked\")\n public void consultarCoactivosXLS() throws CirculemosNegocioException {\n\n // consulta la tabla temporal de los 6000 coactivos\n StringBuilder sql = new StringBuilder();\n\n sql.append(\"select [TIPO DOC], [NUMERO DE IDENTIFICACIÓN], [valor multas], [titulo valor], proceso \");\n sql.append(\"from coactivos_xls \");\n sql.append(\"where id_tramite is null and numero_axis is null AND archivo is not null \");\n sql.append(\"AND [titulo valor] IN ('2186721','2187250','2187580','2186845')\");\n\n Query query = em.createNativeQuery(sql.toString());\n\n List<Object[]> listaResultados = Utilidades.safeList(query.getResultList());\n\n Date fechaCoactivo = UtilFecha.buildCalendar().getTime();\n CoactivoDTO coactivoDTOs;\n TipoIdentificacionPersonaDTO tipoIdentificacion;\n List<ObligacionCoactivoDTO> obligacionesCoactivoDTO;\n PersonaDTO personaDTO;\n ProcesoDTO proceso;\n // persiste los resultados en coactivoDTO\n for (Object[] coactivo : listaResultados) {\n coactivoDTOs = new CoactivoDTO();\n // persiste el tipo de indetificacion en TipoIdentificacionPersonaDTO\n personaDTO = new PersonaDTO();\n proceso = new ProcesoDTO();\n tipoIdentificacion = new TipoIdentificacionPersonaDTO();\n obligacionesCoactivoDTO = new ArrayList<>();\n\n tipoIdentificacion.setCodigo((String) coactivo[0]);\n personaDTO.setTipoIdentificacion(tipoIdentificacion);\n coactivoDTOs.setPersona(personaDTO);\n coactivoDTOs.getPersona().setNumeroIdentificacion((String) coactivo[1]);\n\n proceso.setFechaInicio(fechaCoactivo);\n coactivoDTOs.setProceso(proceso);\n coactivoDTOs.setValorTotalObligaciones(BigDecimal\n .valueOf(Double.valueOf(coactivo[2].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n coactivoDTOs.setValorTotalCostasProcesales(\n coactivoDTOs.getValorTotalObligaciones().multiply(BigDecimal.valueOf(0.05)));\n coactivoDTOs.getProceso().setObservacion(\"COACTIVO\");\n String[] numeroFactura = coactivo[3].toString().split(\",\");\n // separa los numeros de factura cuando viene mas de uno.\n for (String nFactura : numeroFactura) {\n // consulta por numero de factura el el saldo a capital por cada factura\n sql = new StringBuilder();\n sql.append(\"select nombre, saldo_capital, saldo_interes \");\n sql.append(\"from cartera_coactivos_xls \");\n sql.append(\"where nombre = :nFactura\");\n\n Query quer = em.createNativeQuery(sql.toString());\n\n quer.setParameter(\"nFactura\", nFactura);\n\n List<Object[]> result = Utilidades.safeList(quer.getResultList());\n // persiste las obligaciones consultadas y las inserta en ObligacionCoactivoDTO\n ObligacionCoactivoDTO obligaciones;\n for (Object[] obligacion : result) {\n obligaciones = new ObligacionCoactivoDTO();\n obligaciones.setNumeroObligacion((String) obligacion[0]);\n obligaciones.setValorObligacion(BigDecimal.valueOf(\n Double.valueOf(obligacion[1].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n obligaciones.setValorInteresMoratorios(BigDecimal.valueOf(\n Double.valueOf(obligacion[2].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n // Adiciona las obligaciones a una lista\n obligacionesCoactivoDTO.add(obligaciones);\n }\n\n }\n coactivoDTOs.setObligacionCoactivos(obligacionesCoactivoDTO);\n try {\n iLCoactivo.registrarCoactivoAxis(coactivoDTOs, coactivo[4].toString());\n } catch (Exception e) {\n logger.error(\"Error al registrar coactivo 6000 :\", e);\n }\n }\n }",
"public ArrayList<Producto> busquedaProductos(Producto.Categoria categoria,String palabrasClave){\n try{\n ArrayList<Producto>productosFiltrados = new ArrayList<>();\n ArrayList<Producto>productosEncontrados = busquedaProductos(categoria);\n ArrayList<String>palabras = new ArrayList<>();\n StringTokenizer tokens = new StringTokenizer(palabrasClave);\n\n while(tokens.hasMoreTokens()){\n palabras.add(tokens.nextToken()); \n }\n \n if(palabras.size()>1){\n for(String cadaPalabra : palabras){\n for(Producto cadaProducto : productosEncontrados){\n String titulo=cadaProducto.getTitulo().toLowerCase();\n if(titulo.contains(cadaPalabra.toLowerCase()) && !productosFiltrados.contains(cadaProducto)){\n productosFiltrados.add(cadaProducto);\n }\n }\n }\n }else{\n for(Producto cadaProducto : productosEncontrados){\n String titulo=cadaProducto.getTitulo().toLowerCase();\n if(titulo.contains(palabrasClave.toLowerCase()) && !productosFiltrados.contains(cadaProducto)){\n productosFiltrados.add(cadaProducto);\n }\n }\n }\n ArrayList <Producto> productosFiltradosOrdenado=getProductosOrdenados(productosFiltrados, this);\n return productosFiltradosOrdenado;\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n return null;\n }",
"public List<SpasaCRN> obtenerSpasaFiltros() {\n\n if (conectado) {\n try {\n String bool = \"false\";\n List<SpasaCRN> filtrosCRNs = new ArrayList();\n\n String Query = \"SELECT * FROM `spasa_filtros` WHERE anio = YEAR(NOW()) AND ciclo = CURRENT_CICLO() ;\";\n Logy.mi(\"Query: \" + Query);\n Statement st = Conexion.createStatement();\n ResultSet resultSet;\n resultSet = st.executeQuery(Query);\n while (resultSet.next()) {\n\n SpasaCRN crn = new SpasaCRN();\n SpasaMateria mat = new SpasaMateria();\n crn.setCodigoProf(resultSet.getString(\"usuario\")); //modificado ahora que se cambio in a String\n crn.setCrnCpr(resultSet.getString(\"crn\"));\n String mc = resultSet.getString(\"materia_cod\");\n if (mc != null && !mc.isEmpty() && !mc.equals(\"null\")) {\n crn.setMateriaRuta(mc);\n mat.setMateriaRuta(mc);\n }\n String m = resultSet.getString(\"materia_nom\");\n if (m != null && !m.isEmpty() && !m.equals(\"null\")) {\n mat.setNombreMat(m);\n }\n String d = resultSet.getString(\"departamento_nom\");\n if (d != null && !d.isEmpty() && !d.equals(\"null\")) {\n mat.setNombreDepto(d);\n }\n String dia = resultSet.getString(\"dia\");\n if (dia != null && !dia.isEmpty() && !dia.equals(\"null\")) {\n crn.setDiaHr(dia);\n }\n String h = resultSet.getString(\"hora\");\n if (h != null && !h.isEmpty() && !h.equals(\"null\")) {\n crn.setHiniHr(h);\n }\n crn.setMateria(mat);\n filtrosCRNs.add(crn);\n }\n\n return filtrosCRNs;\n\n } catch (SQLException ex) {\n Logy.me(\"No se pudo consultar tabla spasa_filtros : \" + ex.getMessage());\n return null;\n }\n } else {\n Logy.me(\"No se ha establecido previamente una conexion a la DB\");\n return null;\n }\n }",
"public void buscarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tString codigo_empresa = empresa.getCodigo_empresa();\r\n\t\t\tString codigo_sucursal = sucursal.getCodigo_sucursal();\r\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\r\n\t\t\t\t\t.toString();\r\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n\t\t\tMap<String, Object> parameters = new HashMap();\r\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\t\tparameters.put(\"parameter\", parameter);\r\n\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n\t\t\tgetServiceLocator().getHis_partoService().setLimit(\r\n\t\t\t\t\t\"limit 25 offset 0\");\r\n\r\n\t\t\tList<His_parto> lista_datos = getServiceLocator()\r\n\t\t\t\t\t.getHis_partoService().listar(parameters);\r\n\t\t\trowsResultado.getChildren().clear();\r\n\r\n\t\t\tfor (His_parto his_parto : lista_datos) {\r\n\t\t\t\trowsResultado.appendChild(crearFilas(his_parto, this));\r\n\t\t\t}\r\n\r\n\t\t\tgridResultado.setVisible(true);\r\n\t\t\tgridResultado.setMold(\"paging\");\r\n\t\t\tgridResultado.setPageSize(20);\r\n\r\n\t\t\tgridResultado.applyProperties();\r\n\t\t\tgridResultado.invalidate();\r\n\t\t\tgridResultado.setVisible(true);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}",
"QuartoConsumo[] busca(Object dadoBusca, String coluna) throws SQLException;",
"public List<Veterinario> pesquisar(String nomeOuCpf) throws ClassNotFoundException, SQLException{ \n VeterinarioDAO dao = new VeterinarioDAO();\n if (!nomeOuCpf.equals(\"\"))\n return dao.listar(\"(nome = '\" + nomeOuCpf + \"' or cpf = '\" + nomeOuCpf + \"') and ativo = true\");\n else\n return dao.listar(\"ativo = true\");\n }",
"public List<ReporteComprasVentasRetenciones> getReporteRetencionClientes(int mes, int anio, int idOrganizacion)\r\n/* 231: */ {\r\n/* 232:307 */ StringBuffer sql = new StringBuffer();\r\n/* 233:308 */ sql.append(\"SELECT new ReporteComprasVentasRetenciones(fp.codigo, fp.nombre, COUNT(fp.codigo),\");\r\n/* 234:309 */ sql.append(\" (CASE WHEN fp.indicadorRetencionIva = true OR fp.indicadorRetencionFuente = true THEN SUM(dcfc.valor) END),\");\r\n/* 235:310 */ sql.append(\" 'Ventas', '' )\");\r\n/* 236:311 */ sql.append(\" FROM DetalleCobroFormaCobro dcfc\");\r\n/* 237:312 */ sql.append(\" JOIN dcfc.detalleFormaCobro dfc\");\r\n/* 238:313 */ sql.append(\" LEFT JOIN dfc.cobro c\");\r\n/* 239:314 */ sql.append(\" LEFT OUTER JOIN dfc.formaPago fp\");\r\n/* 240:315 */ sql.append(\" LEFT OUTER JOIN dcfc.detalleCobro dc\");\r\n/* 241:316 */ sql.append(\" LEFT OUTER JOIN dc.cuentaPorCobrar cpc\");\r\n/* 242:317 */ sql.append(\" LEFT OUTER JOIN cpc.facturaCliente fc\");\r\n/* 243:318 */ sql.append(\" WHERE MONTH(c.fecha) =:mes\");\r\n/* 244:319 */ sql.append(\" AND YEAR(c.fecha) =:anio\");\r\n/* 245:320 */ sql.append(\" AND fc.estado!=:estadoAnulado\");\r\n/* 246:321 */ sql.append(\" AND c.estado!=:estadoAnulado\");\r\n/* 247:322 */ sql.append(\" AND (fp.indicadorRetencionIva=true OR fp.indicadorRetencionFuente=true)\");\r\n/* 248:323 */ sql.append(\" AND fc.idOrganizacion = :idOrganizacion\");\r\n/* 249:324 */ sql.append(\" GROUP BY fp.codigo, fp.nombre, fp.indicadorRetencionIva, fp.indicadorRetencionFuente\");\r\n/* 250:325 */ sql.append(\" ORDER BY fp.codigo, fp.nombre\");\r\n/* 251:326 */ Query query = this.em.createQuery(sql.toString());\r\n/* 252:327 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 253:328 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 254:329 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 255:330 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 256:331 */ return query.getResultList();\r\n/* 257: */ }",
"public void buscarController() {\n\t\tSystem.out.println(\"\\n*** Consultando Registros\\nCampo de Consulta Pesquisa: \"+selectPesquisa);\n\t\tif (selectPesquisa.equals(null) || selectPesquisa.equals(\"\")){\t\t\t\n\t\t\t\n\t\t\tatualizarTela(); \t\t\t\n\t\t}\n\t\t\n\t\tif (selectPesquisa.equals(\"nome\")){\n\t\t\t\n\t\t\tif(campoPesquisa.equals(null)){ // Evitar o Erro de passar parametro nulo para o metodo\n\t\t\t\tatualizarTela(); \t\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(\"\\n*** Buscando por Nome\\n\");\n\t\t\tString nome = campoPesquisa; // Inserindo o valor que vai passar como parametro para os metodos\n\t\t\tlistaPaciente = pacienteService.buscarPorNome(nome);\t\n\t\t\t}\n\t\t} //FECHANDO O IF SELECTPESQUISA(NOME)\n\t\t\n\t\tif (selectPesquisa.equals(\"idPaciente\")){\n\t\t\t\n\t\t\tif(campoPesquisa.equals(null)){ // Evitar o Erro de passar parametro nulo para o metodo\n\t\t\t\tatualizarTela(); \t\n\t\t\t}\t\t\n\t\t\t\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"\\n*** Buscando por ID\\n\");\n\t\t\t\ttry{ // Tratamento de Erro Caso o usuario Colocar Letras no campo\n\t\t\t\t\tSystem.out.println(\"** ID PACIENTE: \"+campoPesquisa);\n\t\t\t\t\tlong idPaciente = Long.parseLong(campoPesquisa); \n\t\t\t\t\tlistaPaciente = pacienteService.buscarPorId(idPaciente);\t\t\t\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\tSystem.err.println(\"\\n ** ID invalido\\n\"+e);\t\t\t\t\t\n\t\t\t\t\tlistaPaciente = null; // Lista vai ser vazia pois o ID foi invalido\n\t\t\t\t}\t\t\n\t\t\t} // FECHANDO O ELSE\n\t\t} //FECHANDO O IF SELECTPESQUISA(IDPROPRIETARIO)\n\t\t\n\t\tif (selectPesquisa.equals(\"cpf\")){\n\t\t\t\n\t\t\tif(campoPesquisa.equals(null)){ // Evitar o Erro de passar parametro nulo para o metodo\n\t\t\t\tatualizarTela(); \t\n\t\t\t}\t\t\n\t\t\telse{\n\t\t\tSystem.out.println(\"\\n*** Buscando por CPF\\n\");\t\t\t\n\t\t\tString cpf = campoPesquisa; // Inserindo o valor que vai passar como parametro para os metodos\n\t\t\tlistaPaciente = pacienteService.buscarPorCpf(cpf);\t\n\t\t\t}\n\t\t\n\t\t} // Fechando IF SELECTPESQUISA(CPF)\n\t\t\n\t\n\t}",
"public List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);",
"private void cargarProductos() {\r\n\t\tproductos = productoEJB.listarInventariosProductos();\r\n\r\n\t\tif (productos.size() == 0) {\r\n\r\n\t\t\tList<Producto> listaProductos = productoEJB.listarProductos();\r\n\r\n\t\t\tif (listaProductos.size() > 0) {\r\n\r\n\t\t\t\tMessages.addFlashGlobalWarn(\"Para realizar una venta debe agregar los productos a un inventario\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}",
"@GET\n\t@Path(\"consultar/{titulo}\") //ruta -> metodo que al que llama\n\t@Produces(\"application/json\") \n\tpublic String buscarTitulo(@PathParam(\"titulo\") String titulo) {\n\t\tList<Libro> lista = negocio.consultarTitulo(titulo);\n\t\tJSONArray array = new JSONArray(lista);\n\t\treturn array.toString();\n\t}",
"public List<Sic3docuprod> obtDetOperacionesXProductos(Sic3docuprod objDocuprod) throws Exception{\n \n List<Sic3docuprod> list = new ArrayList<>();\n\n StoredProcedure Sp = null;\n ResultSet rsConsulta = null;\n \n BigDecimal fecDesde = null;\n BigDecimal fecHasta = null;\n String strCodProd = null;\n\n try{\n \n session = HibernateUtil.getSessionFactory().openSession();\n \n log.debug(\"=============== obtDetOperacionesXProductos ==================\");\n \n if(objDocuprod.getSic1docu() != null && \n objDocuprod.getSic1docu().getFecDesde() != null){\n fecDesde = UtilClass.convertDateToNumber(objDocuprod.getSic1docu().getFecDesde());\n }\n \n if(objDocuprod.getSic1docu() != null && \n objDocuprod.getSic1docu().getFecHasta()!= null){\n fecDesde = UtilClass.convertDateToNumber(objDocuprod.getSic1docu().getFecHasta());\n }\n \n if(objDocuprod.getSic1prod() != null && objDocuprod.getSic1prod().getCodProd() !=null)\n strCodProd = objDocuprod.getSic1prod().getCodProd().trim();\n \n Sp = new StoredProcedure(\"PKG_SICCONSPROD.PRC_SICOBTDETPROD\");\n Sp.addParameter(new InParameter(\"X_ID_PROD\", Types.INTEGER, objDocuprod.getSic1prod().getIdProd()));\n Sp.addParameter(new InParameter(\"X_COD_PROD\", Types.VARCHAR, strCodProd));\n Sp.addParameter(new InParameter(\"X_ID_SCLASEEVEN\", Types.INTEGER, objDocuprod.getSic1docu().getIdSclaseeven()));\n Sp.addParameter(new InParameter(\"X_FEC_DESDE\", Types.NUMERIC, fecDesde));\n Sp.addParameter(new InParameter(\"X_FEC_HASTA\", Types.NUMERIC, fecHasta));\n Sp.addParameter(new InParameter(\"X_ID_DOCU\", Types.INTEGER, objDocuprod.getSic1docu().getIdDocu()));\n Sp.addParameter(new InParameter(\"X_COD_SERIE\", Types.VARCHAR, objDocuprod.getSic1docu().getCodSerie()));\n Sp.addParameter(new InParameter(\"X_NUM_DOCU\", Types.INTEGER, objDocuprod.getSic1docu().getNumDocu()));\n Sp.addParameter(new InParameter(\"X_ID_ESTADOCU\",Types.INTEGER, null));\n \n Sp.addParameter(new OutParameter(\"X_CURSOR\", OracleTypes.CURSOR)); \n Sp.addParameter(new OutParameter(\"X_ID_ERROR\", Types.INTEGER));\n Sp.addParameter(new OutParameter(\"X_DES_ERROR\", Types.VARCHAR));\n \n \n rsConsulta = Sp.ExecuteResultCursor(((SessionImpl)session).connection(),10); \n \n while(rsConsulta.next()){\n \n //Proveedor O Cliente\n Sic1pers objPers = new Sic1pers();\n objPers.setDesPers(rsConsulta.getString(\"DES_PERS\"));\n \n //TIPO DE OPERACION\n Sic1sclaseeven objSclaseeven = new Sic1sclaseeven();\n objSclaseeven.setIdClaseeven(rsConsulta.getBigDecimal(\"ID_SCLASEEVEN\"));\n objSclaseeven.setCodSclaseeven(rsConsulta.getString(\"COD_SCLASEEVEN\"));\n objSclaseeven.setDesSclaseeven(rsConsulta.getString(\"DES_SCLASEEVEN\"));\n\n /*ESTADO DE LA OPERACION*/\n Sic3docuesta objDocuesta = new Sic3docuesta();\n objDocuesta.setDesEsta(rsConsulta.getString(\"DES_ESTA\"));\n \n /*TIPO DE DOCUMENTO*/\n Sic1stipodocu sic1stipodocu = new Sic1stipodocu();\n sic1stipodocu.setDesStipodocu(rsConsulta.getString(\"DES_STIPODOCU\"));\n \n /*Documentos Relacionados*/\n Sic1docu objDocuRel = new Sic1docu();\n objDocuRel.setIdDocu(rsConsulta.getBigDecimal(\"ID_DOCUREL\"));\n objDocuRel.setNumDocuunido(rsConsulta.getString(\"NUM_DOCUUNIDO\"));\n \n Sic3docudocu objDocusRela = new Sic3docudocu();\n objDocusRela.setSic1docurel(objDocuRel);\n \n //Cabecera de la operacion(Compra o Venta)\n Sic1docu objDocu = new Sic1docu();\n objDocu.setIdDocu(rsConsulta.getBigDecimal(\"ID_DOCU\"));\n objDocu.setFecDesde(rsConsulta.getDate(\"FEC_OPERACION\"));\n objDocu.setSic1stipodocu(sic1stipodocu);\n objDocu.setCodSerie(rsConsulta.getString(\"COD_SERIE\"));\n objDocu.setNumDocu(rsConsulta.getBigDecimal(\"NUM_DOCU\"));\n objDocu.setSic1persexterno(objPers);\n objDocu.setSic1sclaseeven(objSclaseeven);\n objDocu.setSic3docuesta(objDocuesta);\n objDocu.setSic3docudocu(objDocusRela);\n \n /*DATOS DE PRODUCTO*/\n Sic1prod objProd = new Sic1prod();\n objProd.setIdProd(rsConsulta.getBigDecimal(\"ID_PROD\"));\n objProd.setCodProd(rsConsulta.getString(\"COD_PROD\"));\n objProd.setDesProd(rsConsulta.getString(\"DES_PROD\"));\n objProd.setNumCantstock(rsConsulta.getBigDecimal(\"NUM_CANTSTOCK\"));\n \n \n \n /**/\n Sic3docuprod detOperacion = new Sic3docuprod();\n detOperacion.setNumCantidad(rsConsulta.getBigDecimal(\"NUM_CANTIDAD\"));\n detOperacion.setNumValor(rsConsulta.getBigDecimal(\"NUM_VALOR\"));\n detOperacion.setSic1docu(objDocu);\n detOperacion.setSic1prod(objProd);\n \n list.add(detOperacion); \n }\n \n } catch (SQLException | HibernateException e){\n throw new Exception(e.getMessage()); \n }finally{\n \n if(rsConsulta != null)\n rsConsulta.close();\n \n if(session != null)\n session.close();\n \n }\n \n return list; \n }",
"@Override\r\n public List<Concursando> consultarTodosConcursando() throws Exception {\n return rnConcursando.consultarTodos();\r\n }",
"public java.sql.ResultSet consultaporespecialidad(String CodigoEspecialidad){\r\n java.sql.ResultSet rs=null;\r\n Statement st = null;\r\n try{\r\n \tConexion con=new Conexion();\r\n \tst = con.conn.createStatement();\r\n \trs=st.executeQuery(\"select phm.codigo,phm.horas,phm.fechas,phm.NombrePaciente,pes.nombre_especialidad,pmd.nombre,pmd.apellidos,phm.estado,pes.codigo,pmd.codigo from pyp_horariomedico phm,pyp_medico pmd,pyp_especialidad pes where pes.codigo=\"+CodigoEspecialidad+\" and phm.codMedico_fk=pmd.codigo and pmd.codEspe_fk=pes.codigo and phm.fechas >= CURDATE() ORDER BY phm.fechas,phm.horas\");\r\n }\r\n catch(Exception ex){\r\n \tSystem.out.println(\"Error en PYP_MetodoConsultasAsignacion>>consultaporespecialidad \"+ex);\r\n }\t\r\n return rs;\r\n }",
"public List selectAllFromProjeto() throws IOException {\n erro = false;\n List projetos = null;\n try{\n projetos = con.query(\"Select * from projeto\", new BeanPropertyRowMapper(Projeto.class));\n } catch (CannotGetJdbcConnectionException ex){\n logger.gravarDadosLog(\"ERRO\",\"SELECT\" , \"Não foi possivel realizar a consulta dos projetos cadastrados.\" + Arrays.toString(ex.getStackTrace()));\n erro = true;\n }\n if(!erro){\n logger.gravarDadosLog(\"INFO\", \"SELECT\" , \"A busca por projetos cadastrados foi realizada com sucesso.\");\n }\n erro = false;\n return projetos;\n }",
"@Override\n\tpublic Collection<LineaComercialClasificacionDTO> consultarLineaComercialClasificacionAsignacionMasivaNoIngresar(String codigoClasificacion,String nivelClasificacion,String valorTipoLineaComercial,String codigoLinCom)throws SICException{\n\t\tLogeable.LOG_SICV2.info(\"Entr� a consultar Linea Comercial Clasificacion Asignacion Masiva No Ingresar: {}\",codigoClasificacion);\n\t\tStringBuilder query = null;\n\t\tQuery sqlQuery = null;\n\t\tSession session=null;\n\t\tBoolean clearCache = Boolean.TRUE;\n\t\tCollection<LineaComercialClasificacionDTO> lineaComercialClasificacionDTOs = new ArrayList<LineaComercialClasificacionDTO>();\n\t\ttry {\n\t\t\tsession = hibernateHLineaComercialClasificacion.getHibernateSession();\n\t\t\tsession.clear();\n\t\t\n\t\t\t\n\t\t\tquery = new StringBuilder();\n\t\t\tquery.append(\" SELECT LC, L, C, CV \");\n\t\t\tquery.append(\" FROM LineaComercialClasificacionDTO LC, LineaComercialDTO L, ClasificacionDTO C, CatalogoValorDTO CV \");\n\t\t\tquery.append(\" WHERE L.id.codigoLineaComercial = LC.codigoLineaComercial \");\n//\t\t\tquery.append(\" AND L.nivel = 0 \");\n\t\t\tquery.append(\" AND L.estado = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\tquery.append(\" AND LC.estado = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\tquery.append(\" AND L.valorTipoLineaComercial = '\"+valorTipoLineaComercial+\"' \");\n\t\t\tquery.append(\" AND LC.id.codigoClasificacion = C.id.codigoClasificacion \");\n\t\tif(!codigoLinCom.equals(\"null\")){\t\n\t\t\tquery.append(\" AND L.id.codigoLineaComercial != \"+codigoLinCom);\n\t\t}\t\n\t\t\tquery.append(\" AND L.valorTipoLineaComercial = CV.id.codigoCatalogoValor \");\n\t\t\tquery.append(\" AND L.codigoTipoLineaComercial = CV.id.codigoCatalogoTipo \");\n\t\t\tquery.append(\" AND LC.id.codigoClasificacion IN ( \");\n\t\t\tif(!nivelClasificacion.equals(SICConstantes.TIPCLA_CLASIFICACION)){\n\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_DIVISION)){\n\t\t\t\tquery.append(\" SELECT id.codigoClasificacion FROM ClasificacionDTO \");\n\t\t\t\tquery.append(\" WHERE estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\t\tquery.append(\" AND codigoClasificacionPadre IN( \");\n\t\t\t}\n\t\t\tquery.append(\" SELECT id.codigoClasificacion FROM ClasificacionDTO \");\n\t\t\tquery.append(\" WHERE estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\tquery.append(\" AND codigoClasificacionPadre IN (\"+codigoClasificacion+\") \"+\" )) \");\n\t\t\t}else{\n\t\t\t\tquery.append(\" \"+codigoClasificacion+\") \");\n\t\t\t}\n\n\t\t\tsqlQuery = hibernateHLineaComercialClasificacion.createQuery(query.toString(), clearCache);\n\t\t\t\n\t\t\t/**\n\t\t\t * aqui se asigna al objeto LineaComercialClasificacionDTO los objetos (ClasificacionDTO,LineaComercialDTO)\n\t\t\t * que nos entrego la consulta por separado\n\t\t\t */\n\t\t\tCollection<Object[]> var = sqlQuery.list();\n\t\t\tfor(Object[] object:var){\n\t\t\t\tLineaComercialClasificacionDTO l=(LineaComercialClasificacionDTO)object[0];\n\t\t\t\tl.setLineaComercial((LineaComercialDTO)object[1]);\n\t\t\t\tl.setClasificacion((ClasificacionDTO)object[2]);\n\t\t\t\tl.getLineaComercial().setTipoLineaComercial((CatalogoValorDTO)object[3]);\n\t\t\t\tlineaComercialClasificacionDTOs.add(l);\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception e) {\n\t\t\tLogeable.LOG_SICV2.info(\"Error al consultar clasificaciones asignacion masiva {}\", e);\n\t\t\tthrow new SICException(\"Error al consultar clasificaciones asignacion masiva {}\", e);\n\t\t}\n\t\t\n\t\t\n\t\treturn lineaComercialClasificacionDTOs;\n\t}",
"private List<Produto> todosProdutos() {\n\t\treturn produtoService.todosProdutos();\n\t}",
"private void listar(HttpPresentationComms comms, String _operacion) throws HttpPresentationException, KeywordValueException {\n/* 219 */ activarVista(\"consulta\");\n/* 220 */ if (_operacion.equals(\"X\")) {\n/* */ return;\n/* */ }\n/* */ \n/* */ \n/* 225 */ PrcRecursoDAO ob = new PrcRecursoDAO();\n/* 226 */ Collection<PrcRecursoDTO> arr = ob.cargarTodos();\n/* 227 */ HTMLTableSectionElement hte = this.pagHTML.getElementDetalle();\n/* 228 */ int cuantas = 0;\n/* 229 */ Iterator<PrcRecursoDTO> iterator = arr.iterator();\n/* 230 */ while (iterator.hasNext()) {\n/* 231 */ PrcRecursoDTO reg = (PrcRecursoDTO)iterator.next();\n/* 232 */ HTMLElement eltr = (HTMLElement)this.pagHTML.createElement(\"tr\");\n/* 233 */ eltr.appendChild(newtd(\"\" + reg.getIdRecurso()));\n/* 234 */ String url = \"PrcRecurso.po?_operacion=V&idRecurso=\" + reg.getIdRecurso() + \"\";\n/* 235 */ eltr.appendChild(newtdhref(\"\" + reg.getNombreIdTipoRecurso(), url));\n/* 236 */ eltr.appendChild(newtd(\"\" + reg.getDescripcionRecurso()));\n/* 237 */ eltr.appendChild(newtd(\"\" + reg.getNombreIdProcedimiento()));\n/* 238 */ eltr.appendChild(newtd(\"\" + reg.getNombreEstado()));\n/* 239 */ hte.appendChild(eltr);\n/* 240 */ cuantas++;\n/* */ } \n/* 242 */ arr.clear();\n/* 243 */ this.pagHTML.setTextNroRegistros(\"\" + cuantas);\n/* */ }",
"public List getPorPertenceAProduto(long id) throws DaoException {\n\t\tsetMontador(null);\n\t\tString sql;\n \tsql = \"select \" + camposOrdenadosJoin() + \" from \" + tabelaSelect() + \n outterJoinAgrupado() +\n \t\" where id_produto_pa = \" + id + orderByLista();\n \tsetMontador(getMontadorAgrupado());\n \treturn getListaSql(sql);\n\t}",
"@GetMapping(\"buscarProductos\")\n\tpublic List<Producto> getProductos(){\n\t\treturn this.productoServicios.findAll();\n\t}",
"public void buscarDocentes() {\r\n try {\r\n List<DocenteProyecto> docenteProyectos = docenteProyectoService.buscar(new DocenteProyecto(\r\n sessionProyecto.getProyectoSeleccionado(), null, null, Boolean.TRUE, null));\r\n if (docenteProyectos.isEmpty()) {\r\n return;\r\n }\r\n for (DocenteProyecto docenteProyecto : docenteProyectos) {\r\n DocenteProyectoDTO docenteProyectoDTO = new DocenteProyectoDTO(docenteProyecto, null,\r\n docenteCarreraService.buscarPorId(new DocenteCarrera(docenteProyecto.getDocenteCarreraId())));\r\n docenteProyectoDTO.setPersona(personaService.buscarPorId(new Persona(docenteProyectoDTO.getDocenteCarrera().getDocenteId().getId())));\r\n sessionProyecto.getDocentesProyectoDTO().add(docenteProyectoDTO);\r\n }\r\n sessionProyecto.setFilterDocentesProyectoDTO(sessionProyecto.getDocentesProyectoDTO());\r\n } catch (Exception e) {\r\n }\r\n }",
"public ArrayList<Proposta> retornaPropostasPeloIdCliente(int idCliente) {\n\n ArrayList<Proposta> listaDePropostas = new ArrayList<>();\n\n conectarnoBanco();\n\n String sql = \"SELECT * FROM proposta\";\n\n try {\n\n st = con.createStatement();\n\n rs = st.executeQuery(sql);\n\n while (rs.next()) {\n\n if(idCliente == rs.getInt(\"id_client\")){\n Proposta propostaTemp = new Proposta(rs.getString(\"propostaRealizada\"), rs.getFloat(\"valorProposta\"), rs.getInt(\"id_usuario\"), rs.getInt(\"id_projeto\"),rs.getInt(\"id_client\"));\n\n listaDePropostas.add(propostaTemp);\n }\n \n sucesso = true;\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro ao retornar propostas pelo id do cliente = \" + ex.getMessage());\n sucesso = false;\n } finally {\n try {\n\n if (con != null && pst != null) {\n con.close();\n pst.close();\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro ao fechar o bd = \" + ex.getMessage());\n }\n\n }\n\n return listaDePropostas;\n }",
"public List<Producto> listar() throws Exception {\n\t\ttry{\n\t\t\tthis.objCnx = new Conexion(\"MYSQL\");\n\t\t\tList<Producto> lista = new ArrayList<Producto>();\n\t\t\tthis.objCnx.conectarBD();\n\t\t\tString sql = \"SELECT t.idproducto, t.nombre_producto, t.imagen, t.idcategoria, t.idmarca, t.idmodelo, c.nombre as categoria, m.nombre as marca, d.nombre as modelo \"\n\t\t\t\t\t+ \" FROM conftbc_producto t INNER JOIN conftbc_categoria c on c.idcategoria = t.idcategoria\"\n\t\t\t\t\t+ \" INNER JOIN conftbc_marca m on m.idmarca = t.idmarca INNER JOIN conftbc_modelo d on d.idmodelo = t.idmodelo \";\n\t\t\tPreparedStatement ps = this.objCnx.cnx.prepareStatement(sql);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\twhile(rs.next()){\n\t\t\t\tProducto producto = new Producto();\n\t\t\t\tproducto.setIdproducto(rs.getInt(\"idproducto\"));\n\t\t\t\tproducto.setNombre(rs.getString(\"nombre_producto\"));\n\t\t\t\tproducto.setImagen(rs.getString(\"imagen\"));\n\t\t\t\tCategoria categoria = new Categoria();\n\t\t\t\tcategoria.setIdcategoria(rs.getInt(\"idcategoria\"));\n\t\t\t\tcategoria.setNombre(rs.getString(\"categoria\"));\n\t\t\t\tproducto.setCategoria(categoria);\n\t\t\t\tMarca marca = new Marca();\n\t\t\t\tmarca.setIdmarca(rs.getInt(\"idmarca\"));\n\t\t\t\tmarca.setNombre(rs.getString(\"marca\"));\n\t\t\t\tproducto.setMarca(marca);\n\t\t\t\tModelo modelo = new Modelo();\n\t\t\t\tmodelo.setIdmodelo(rs.getInt(\"idmodelo\"));\n\t\t\t\tmodelo.setNombre(rs.getString(\"modelo\"));\n\t\t\t\tproducto.setModelo(modelo);\n\t\t\t\tlista.add(producto);\n\t\t\t}\n\t\t\treturn lista;\n\t\t\t\n\t\t}catch(Exception ex){\n\t\t\tthis.objCnx.deshacerDB();\n\t\t\tthrow ex;\n\t\t}finally{\n\t\t\tthis.objCnx.closeDB();\n\t\t\tthis.objCnx = null;\n\t\t}\n\t}",
"public List getPorReferenteAProduto(long id) throws DaoException {\n\t\t// Existe no DAO\n\t\tCompartilhamentoProdutoDao dao = getDao();\n\t\tDaoConexao conn = dao.criaConexao();\n\t\tdao.setConexao(conn);\n\t\treturn dao.ListaPorProdutoReferenteA(id);\n\t}",
"private StringBuilder getSqlSelectContadorDocProrroga() {\n StringBuilder query = new StringBuilder();\n\n query.append(\" \");\n query.append(\" SELECT \\n\");\n query.append(\" PRO.ID_PRORROGA_ORDEN, \\n\");\n query.append(\" PRO.ID_ORDEN, \\n\");\n query.append(\" PRO.FECHA_CARGA, \\n\");\n query.append(\" PRO.RUTA_ACUSE,\\n\");\n query.append(\" PRO.CADENA_CONTRIBUYENTE, \\n\");\n query.append(\" PRO.FIRMA_CONTRIBUYENTE, \\n\");\n query.append(\" PRO.APROBADA, \\n\");\n query.append(\" PRO.ID_ASOCIADO_CARGA, \\n\");\n query.append(\" PRO.ID_AUDITOR, \\n\");\n query.append(\" PRO.ID_FIRMANTE, \\n\");\n query.append(\" PRO.RUTA_RESOLUCION, \\n\");\n query.append(\" PRO.CADENA_FIRMANTE, \\n\");\n query.append(\" PRO.FIRMA_FIRMANTE,\\n\");\n query.append(\" PRO.FECHA_FIRMA, \\n\");\n query.append(\" PRO.ID_ESTATUS, \\n\");\n query.append(\" PRO.FOLIO_NYV, \\n\");\n query.append(\" PRO.FECHA_NOTIF_NYV, \\n\");\n query.append(\" PRO.FECHA_NOTIF_CONT, \\n\");\n query.append(\" PRO.FECHA_SURTE_EFECTOS, \\n\");\n query.append(\" PRO.ID_NYV, \\n\");\n query.append(\" (SELECT COUNT(0) FROM \");\n query.append(FecetDocProrrogaOrdenDaoImpl.getTableName());\n query.append(\" DOCPRO WHERE PRO.ID_PRORROGA_ORDEN = DOCPRO.ID_PRORROGA_ORDEN) TOTAL_DOC_PRORROGA, \\n\");\n query.append(\" ASOCIADO.ID_ASOCIADO, \\n\");\n query.append(\" ASOCIADO.RFC_CONTRIBUYENTE, \\n\");\n query.append(\" ASOCIADO.RFC, \\n\");\n query.append(\" ASOCIADO.ID_ORDEN, \\n\");\n query.append(\" ASOCIADO.ID_TIPO_ASOCIADO, \\n\");\n query.append(\" ASOCIADO.NOMBRE, \\n\");\n query.append(\" ASOCIADO.CORREO, \\n\");\n query.append(\" ASOCIADO.TIPO_ASOCIADO, \\n\");\n query.append(\" ASOCIADO.FECHA_BAJA, \\n\");\n query.append(\" ASOCIADO.FECHA_ULTIMA_MOD, \\n\");\n query.append(\" ASOCIADO.FECHA_ULTIMA_MOD_IDC, \\n\");\n query.append(\" ASOCIADO.MEDIO_CONTACTO, \\n\");\n query.append(\" ASOCIADO.ESTATUS, \\n\");\n query.append(\" ESTATUS.ID_ESTATUS, \\n\");\n query.append(\" ESTATUS.DESCRIPCION, \\n\");\n query.append(\" ESTATUS.MODULO, \\n\");\n query.append(\" ESTATUS.ID_MODULO \\n\");\n\n query.append(\"FROM \");\n query.append(getTableName());\n query.append(\" PRO \\n\");\n query.append(\" INNER JOIN FECEC_ESTATUS ESTATUS \\n\");\n query.append(\" ON PRO.ID_ESTATUS = ESTATUS.ID_ESTATUS \\n\");\n query.append(\" LEFT JOIN FECET_ASOCIADO ASOCIADO \\n\");\n query.append(\" ON PRO.ID_ASOCIADO_CARGA = ASOCIADO.ID_ASOCIADO \\n\");\n return query;\n }",
"public void buscarxdescrip() {\r\n try {\r\n modelo.setDescripcion(vista.jTbdescripcion.getText());//C.P.M le enviamos al modelo la descripcion y consultamos\r\n rs = modelo.Buscarxdescrip();//C.P.M cachamos el resultado de la consulta\r\n\r\n DefaultTableModel buscar = new DefaultTableModel() {//C.P.M creamos el modelo de la tabla\r\n @Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }\r\n };\r\n vista.jTbuscar.setModel(buscar);//C.P.M le mandamos el modelo a la tabla\r\n modelo.estructuraProductos(buscar);//C.P.M obtenemos la estructura de la tabla \"encabezados\"\r\n ResultSetMetaData rsMd = rs.getMetaData();//C.P.M obtenemos los metadatos de la consulta\r\n int cantidadColumnas = rsMd.getColumnCount();//C.P.M obtenemos la cantidad de columnas de la consulta\r\n while (rs.next()) {//C.P.M recorremos el resultado\r\n Object[] fila = new Object[cantidadColumnas];//C.P.M creamos un arreglo con una dimencion igual a la cantidad de columnas\r\n for (int i = 0; i < cantidadColumnas; i++) { //C.P.M lo recorremos \r\n fila[i] = rs.getObject(i + 1); //C.P.M vamos insertando los resultados dentor del arreglo\r\n }\r\n buscar.addRow(fila);//C.P.M y lo agregamos como una nueva fila a la tabla\r\n }\r\n\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al buscar producto por descripcion\");\r\n }\r\n }",
"private static java.util.List<com.esperapp.ws.Empleado> buscarEmpleado(java.lang.String cedula) {\n com.esperapp.ws.AsignarTurnos_Service service = new com.esperapp.ws.AsignarTurnos_Service();\n com.esperapp.ws.AsignarTurnos port = service.getAsignarTurnosPort();\n return port.buscarEmpleado(cedula);\n }",
"public List<EstructuraContratosDatDTO> obtenerConsultaProsperaLista() {\n\t\tList<EstructuraContratosDatDTO> consultaNominaLista = consultaProsperaService.listaEstructuraProspera();\n\t\treturn consultaNominaLista;\n\t}",
"public FlujoDetalleDTO cargarRegistro(int codigoFlujo, int secuencia) {\n/* */ try {\n/* 201 */ String s = \"select t.codigo_flujo,t.secuencia,t.servicio_inicio,r1.descripcion as nombre_servicio_inicio,t.accion,t.codigo_estado,r3.descripcion as nombre_codigo_estado,t.servicio_destino,r4.descripcion as nombre_servicio_destino,t.nombre_procedimiento,t.correo_destino,t.enviar_solicitud,t.ind_mismo_proveedor,t.ind_mismo_cliente,t.estado,t.caracteristica,t.valor_caracteristica,t.caracteristica_correo,m5.descripcion as nombre_estado,c.DESCRIPCION nombre_caracteristica,cv.DESCRIPCION descripcion_valor,t.metodo_seleccion_proveedor,t.ind_correo_clientes,t.enviar_hermana,t.enviar_si_hermana_cerrada,t.ind_cliente_inicial,t.usuario_insercion,t.fecha_insercion,t.usuario_modificacion,t.fecha_modificacion from wkf_detalle t left join SERVICIOS r1 on (r1.CODIGO=t.servicio_inicio) left join ESTADOS r3 on (r3.codigo=t.codigo_estado) left join SERVICIOS r4 on (r4.CODIGO=t.servicio_destino) left join sis_multivalores m5 on (m5.tabla='ESTADO_REGISTRO' and m5.valor=t.estado) LEFT JOIN CARACTERISTICAS c ON (t.Caracteristica = c.CODIGO) LEFT JOIN CARACTERISTICAS_VALOR cv ON (t.CARACTERISTICA=cv.CARACTERISTICA AND t.VALOR_CARACTERISTICA = cv.VALOR) where t.codigo_flujo=\" + codigoFlujo + \" and t.secuencia=\" + secuencia + \"\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 243 */ boolean rtaDB = this.dat.parseSql(s);\n/* 244 */ if (!rtaDB) {\n/* 245 */ return null;\n/* */ }\n/* 247 */ this.rs = this.dat.getResultSet();\n/* 248 */ if (this.rs.next()) {\n/* 249 */ return leerRegistro();\n/* */ }\n/* */ }\n/* 252 */ catch (Exception e) {\n/* 253 */ e.printStackTrace();\n/* 254 */ Utilidades.writeError(\"FlujoDetalleDAO:cargarFlujoDetalle\", e);\n/* */ } \n/* 256 */ return null;\n/* */ }",
"public Productos1[] buscarTodos() {\n\t\treturn productosColeccion.values().toArray(new Productos1[productosColeccion.size()]);// y te mide lo que ocupa procutosColeccion.\r\n\r\n\t}",
"public Collection pesquisarParcelamentoContaUsuario(Integer idUsuario, Date dataInicial, Date dataFinal)\n\t\t\t\t\tthrows ErroRepositorioException{\n\n\t\tCollection retorno = null;\n\t\tSession session = HibernateUtil.getSession();\n\t\tStringBuffer consulta = new StringBuffer();\n\n\t\ttry{\n\t\t\tconsulta.append(\"SELECT MPCCDFUN AS mpccdfun, \");\n\t\t\tconsulta.append(\" MPCDTMPC AS mpcdtmpc, \");\n\t\t\tconsulta.append(\" MPCHRMPC AS mpchrmpc, \");\n\t\t\tconsulta.append(\" MPCAMINI AS mpcamini, \");\n\t\t\tconsulta.append(\" MPCAMFIN AS mpcamfin, \");\n\t\t\tconsulta.append(\" MPCNNMATUSU AS mpcnnatusu, \");\n\t\t\tconsulta.append(\" MPCNNMATUSUD AS mpcnnmatusud, \");\n\t\t\tconsulta.append(\" MPCNNPREST AS mpcnnprest, \");\n\t\t\tconsulta.append(\" MPCVLENTR AS mpcvlentr, \");\n\t\t\tconsulta.append(\" MPCVLPREST AS mpcvlprest, \");\n\t\t\tconsulta.append(\" MPCVLDEBHIST AS mpcvldebhist, \");\n\t\t\tconsulta.append(\" MPCVLDEBCORR AS mpcvldebcorr, \");\n\t\t\tconsulta.append(\" MPCVLTOTSACINCL AS mpcvltotsacincl, \");\n\t\t\tconsulta.append(\" MPCVLPARCEL AS mpcvlparcel, \");\n\t\t\tconsulta.append(\" MPCNNMATGER AS mpcnnmatger \");\n\t\t\tconsulta.append(\"FROM SCITMPC \");\n\t\t\tconsulta.append(\"WHERE MPCNNMATUSU = :idUsuario \");\n\t\t\tconsulta.append(\"AND MPCDTMPC BETWEEN :dataInicial AND :dataFinal \");\n\t\t\tconsulta.append(\"ORDER BY MPCDTMPC, MPCHRMPC, MPCNNMATUSU \");\n\n\t\t\tSQLQuery query = session.createSQLQuery(consulta.toString());\n\n\t\t\t// RETORNO\n\t\t\tquery.addScalar(\"mpccdfun\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcdtmpc\", Hibernate.DATE);\n\t\t\tquery.addScalar(\"mpchrmpc\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcamini\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcamfin\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcnnatusu\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcnnmatusud\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcnnprest\", Hibernate.INTEGER);\n\t\t\tquery.addScalar(\"mpcvlentr\", Hibernate.BIG_DECIMAL);\n\t\t\tquery.addScalar(\"mpcvlprest\", Hibernate.BIG_DECIMAL);\n\t\t\tquery.addScalar(\"mpcvldebhist\", Hibernate.BIG_DECIMAL);\n\t\t\tquery.addScalar(\"mpcvldebcorr\", Hibernate.BIG_DECIMAL);\n\t\t\tquery.addScalar(\"mpcvltotsacincl\", Hibernate.BIG_DECIMAL);\n\t\t\tquery.addScalar(\"mpcvlparcel\", Hibernate.BIG_DECIMAL);\n\t\t\tquery.addScalar(\"mpcnnmatger\", Hibernate.INTEGER);\n\n\t\t\t// PARAMETROS\n\t\t\tquery.setInteger(\"idUsuario\", idUsuario);\n\t\t\tquery.setDate(\"dataInicial\", dataInicial);\n\t\t\tquery.setDate(\"dataFinal\", dataFinal);\n\n\t\t\tretorno = query.list();\n\n\t\t}catch(HibernateException e){\n\t\t\t// levanta a exceção para a próxima camada\n\t\t\tthrow new ErroRepositorioException(e, \"Erro no Hibernate\");\n\t\t}finally{\n\t\t\t// fecha a sessão\n\t\t\tHibernateUtil.closeSession(session);\n\t\t}\n\n\t\treturn retorno;\n\t}",
"public ArrayList listarDetalleVenta(int codVenta){\n ArrayList<DetalleVentaConsulta> lista=new ArrayList<>();\n try {\n PreparedStatement pst=cn.prepareStatement(\"select dv.idVenta,dv.cantidad,p.nombreProducto,dv.precioUnidad from detalleVenta dv \\n\" +\n\"inner join producto p on p.idProducto=dv.nombreProducto\\n\" +\n\"where dv.idVenta=?\");\n pst.setInt(1, codVenta);\n ResultSet rs=pst.executeQuery();\n while (rs.next()) { \n lista.add(new DetalleVentaConsulta(rs.getInt(\"idVenta\"),rs.getInt(\"cantidad\"),rs.getDouble(\"precioUnidad\"),rs.getString(\"cancelado\"),rs.getString(\"nombreProducto\")));\n }rs.close();pst.close();\n } catch (Exception e) {\n System.out.println(\"listar Venta: \"+e.getMessage());\n }return lista;\n }",
"public List<ExistenciaMaq> buscarExistencias(final Producto producto,final Date fecha);",
"public static String buscarTodosLosLibros() throws Exception{ //BUSCARtODOS no lleva argumentos\r\n //primero: nos conectamos a oracle con la clase conxion\r\n \r\n Connection con=Conexion.conectarse(\"system\",\"system\");\r\n //segundo: generamos un statemenr de sql con la conexion anterior\r\n Statement st=con.createStatement();\r\n //3: llevamos a cabo la consulta select \r\n ResultSet res=st.executeQuery(\"select * from persona\"); //reset arreglo enmutado de java estructura de datos\r\n System.out.println(\"depues del select\");\r\n int indice=0;\r\n ArrayList<persona> personas=new ArrayList<persona>();\r\n while(res.next()){ //del primero hasta el ultimo prod que vea SI PONGO SECUENCIA NO ENTRA AL WHILE\r\n Integer id= res.getInt(1); \r\n String nombre=res.getString(2);\r\n String empresa=res.getString(3);\r\n Integer edad=res.getInt(4);\r\n String telefono=res.getString(5);\r\n \r\n ///llenamos el arrayList en cada vuelta\r\n personas.add(new persona(id,nombre,empresa,edad,telefono));\r\n \r\n System.out.println(\"estoy en el array list despues del select\");\r\n }\r\n \r\n //el paso final, transformamos a objeto json con jackson\r\n ObjectMapper maper=new ObjectMapper(); //mapeo a objeto jackson\r\n \r\n st.close();\r\n con.close();\r\n System.out.println(\"convirtiendo el json\");\r\n return maper.writeValueAsString(personas);\r\n \r\n }",
"public ConsultaPNporproducto() {\n initComponents();\n ListarPro();\n }",
"public Resultado executarConsulta(Requisicao requisicao) throws Exception {\r\n return null;\r\n }",
"@Override\n public ArrayList<Propiedad> getPropiedadesFiltroAgente(String pCriterio, String pDato, String pId)\n throws SQLException {\n ArrayList<Propiedad> resultado = new ArrayList<Propiedad>();\n resultado = (ArrayList<Propiedad>) bdPropiedad.selectQuery(\"SELECT * FROM PROPIEDAD WHERE ID_AGENTE \"\n + \"= '\" + pId + \"' AND \" + pCriterio + \" = '\" + pDato + \"'\");\n return resultado;\n }",
"List<Consulta> findAll();"
] | [
"0.7230574",
"0.71158004",
"0.6817351",
"0.66422546",
"0.6603533",
"0.6595486",
"0.6485328",
"0.6441565",
"0.64228743",
"0.6422249",
"0.6398938",
"0.6314859",
"0.63143194",
"0.63047713",
"0.62884015",
"0.62704045",
"0.6267863",
"0.62636036",
"0.62333906",
"0.6231906",
"0.6230151",
"0.62239486",
"0.6207886",
"0.6182578",
"0.6141728",
"0.6140909",
"0.6133156",
"0.6106716",
"0.6094586",
"0.6093058",
"0.60846114",
"0.60671186",
"0.6055032",
"0.60438657",
"0.6043528",
"0.60422194",
"0.60418475",
"0.6036415",
"0.6030601",
"0.60139775",
"0.6001656",
"0.6001559",
"0.6000556",
"0.59891355",
"0.59890676",
"0.59871453",
"0.59820735",
"0.59726757",
"0.59721065",
"0.59642136",
"0.5962795",
"0.5959536",
"0.59506124",
"0.5937904",
"0.59331554",
"0.59268755",
"0.5926378",
"0.5922971",
"0.592267",
"0.59199804",
"0.59174204",
"0.59132385",
"0.587174",
"0.586757",
"0.58652186",
"0.5858809",
"0.5851986",
"0.58438545",
"0.58353156",
"0.583337",
"0.582778",
"0.58273894",
"0.58269125",
"0.58268523",
"0.5819301",
"0.58184814",
"0.58150303",
"0.58121157",
"0.58119637",
"0.58092886",
"0.5808103",
"0.58049184",
"0.579767",
"0.57969034",
"0.5793926",
"0.57922506",
"0.5791467",
"0.57876474",
"0.578298",
"0.57828915",
"0.57796746",
"0.57754046",
"0.5773198",
"0.5768435",
"0.5762291",
"0.576206",
"0.575355",
"0.5750316",
"0.57499367",
"0.5749753"
] | 0.7570636 | 0 |
Retorna um produto "cerveja" a parti da sua identificacao na base de dados esse metodo e usado na pagina de descricao do produto | public Produto consultarProduto(Produto produto) {
ConexaoBDJavaDB conexaoBD = new ConexaoBDJavaDB("routeexpress");
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Produto cerveja = null;
String sql = "SELECT TBL_CERVEJARIA.ID_CERVEJARIA, TBL_CERVEJARIA.CERVEJARIA, TBL_CERVEJARIA.PAIS, "
+ "TBL_CERVEJA.ID_CERVEJA, TBL_CERVEJA.ID_CERVEJARIA AS \"FK_CERVEJARIA\", "
+ "TBL_CERVEJA.ROTULO, TBL_CERVEJA.PRECO, TBL_CERVEJA.VOLUME, TBL_CERVEJA.TEOR, TBL_CERVEJA.COR, TBL_CERVEJA.TEMPERATURA, "
+ "TBL_CERVEJA.FAMILIA_E_ESTILO, TBL_CERVEJA.DESCRICAO, TBL_CERVEJA.SABOR, TBL_CERVEJA.IMAGEM_1, TBL_CERVEJA.IMAGEM_2, TBL_CERVEJA.IMAGEM_3 "
+ "FROM TBL_CERVEJARIA "
+ "INNER JOIN TBL_CERVEJA "
+ "ON TBL_CERVEJARIA.ID_CERVEJARIA = TBL_CERVEJA.ID_CERVEJARIA "
+ "WHERE ID_CERVEJA = ?";
try {
conn = conexaoBD.obterConexao();
stmt = conn.prepareStatement(sql);
stmt.setInt(1, produto.getIdCerveja());
rs = stmt.executeQuery();
if (rs.next()) {
cerveja = new Produto();
cerveja.setIdCervejaria(rs.getInt("ID_CERVEJARIA"));
cerveja.setCervejaria(rs.getString("CERVEJARIA"));
cerveja.setPais(rs.getString("PAIS"));
cerveja.setIdCerveja(rs.getInt("ID_CERVEJA"));
cerveja.setIdFkCervajaria(rs.getInt("FK_CERVEJARIA"));
cerveja.setRotulo(rs.getString("ROTULO"));
cerveja.setPreco(rs.getString("PRECO"));
cerveja.setVolume(rs.getString("VOLUME"));
cerveja.setTeor(rs.getString("TEOR"));
cerveja.setCor(rs.getString("COR"));
cerveja.setTemperatura(rs.getString("TEMPERATURA"));
cerveja.setFamiliaEEstilo(rs.getString("FAMILIA_E_ESTILO"));
cerveja.setDescricao(rs.getString("DESCRICAO"));
cerveja.setSabor(rs.getString("SABOR"));
cerveja.setImagem1(rs.getString("IMAGEM_1"));
cerveja.setImagem2(rs.getString("IMAGEM_2"));
cerveja.setImagem3(rs.getString("IMAGEM_3"));
} else {
return cerveja;
}
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
if (rs != null) {
try {
rs.close();
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
return cerveja;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getIdProduto() {\r\n\t\treturn idProduto;\r\n\t}",
"private static void consultaProduto() throws Exception {\r\n boolean erro;\r\n int id;\r\n Produto p;\r\n Categoria c;\r\n System.out.println(\"\\t** Consultar produto **\\n\");\r\n do {\r\n erro = false;\r\n System.out.print(\"ID do produto a ser consultado: \");\r\n id = read.nextInt();\r\n if (id <= 0) {\r\n erro = true;\r\n System.out.println(\"ID Inválida! \");\r\n }\r\n System.out.println();\r\n } while (erro);\r\n p = arqProdutos.pesquisar(id - 1);\r\n if (p != null && p.getID() != -1) {\r\n c = arqCategorias.pesquisar(p.idCategoria - 1);\r\n System.out.println(\r\n \"Id: \" + p.getID()\r\n + \"\\nNome: \" + p.nomeProduto\r\n + \"\\nDescricao: \" + p.descricao\r\n + \"\\nPreco: \" + tf.format(p.preco)\r\n + \"\\nMarca: \" + p.marca\r\n + \"\\nOrigem: \" + p.origem\r\n );\r\n if (c != null) {\r\n System.out.println(\"Categoria: \" + c.nome);\r\n } else {\r\n System.out.println(\"Categoria: \" + p.idCategoria);\r\n }\r\n } else {\r\n System.out.println(\"Produto não encontrado!\");\r\n }\r\n }",
"public Response getProdutos_e_suas_receitas() {\n\t\tList<Produto> lista = ((ProdutoDao) getDao()).buscarProdutos_e_suas_receitas();\n\t\tif (lista != null) {\n\t\t\tList<Produto> produtos = new ArrayList<>();\n\t\t\t// percorrer a lista retornado do BD.\n\t\t\tfor (Produto produto : lista) {\n\t\t\t\tList<ItemReceita> componentes = new ArrayList<>();\n\t\t\t\t// pega os componentes da receita de cada produto.\n\t\t\t\tfor (ItemReceita item : produto.getReceita().getComponentes()) {\n\t\t\t\t\tcomponentes.add(new ItemReceita(item.getComponente(), item.getQtdUtilizada()));\n\t\t\t\t}\n\t\t\t\t// add um novo produto com os dados da lista percorrida.\n\t\t\t\tprodutos.add(new Produto(produto.getCodigo(), produto.getDescricao(), produto.getCategoria(),\n\t\t\t\t\t\tproduto.getSimbolo(), produto.getPreco(),\n\t\t\t\t\t\tnew Receita(produto.getReceita().getCodigo(), produto.getReceita().getRendimento(),\n\t\t\t\t\t\t\t\tproduto.getReceita().getTempoPreparo(), componentes)));\n\t\t\t}\n\t\t\t// converte a lista com os novos produtos para uma string em JSON.\n\t\t\tString listaEmJson = converterParaArrayJSON(produtos);\n\t\t\t// retorna um response com o lista de produtos em JSON.\n\t\t\tsetResposta(mensagemSucesso(listaEmJson));\n\t\t} else {\n\t\t\t// retorna um response informando que não possui cadastro.\n\t\t\tsetResposta(mensagemNaoEncontrado());\n\t\t}\n\t\treturn getResposta();\n\n\t}",
"public Response getProduto_e_sua_receita(Integer codigo) {\n\t\tProduto resultado = ((ProdutoDao) getDao()).buscarProduto_e_sua_receita(codigo);\n\t\tif (resultado != null) {\n\t\t\t// pega os componentes da receita do produto retornado.\n\t\t\tList<ItemReceita> componentes = new ArrayList<>();\n\t\t\tfor (ItemReceita item : resultado.getReceita().getComponentes()) {\n\t\t\t\tcomponentes.add(new ItemReceita(item.getComponente(), item.getQtdUtilizada()));\n\t\t\t}\n\t\t\t// pega a receita do produto retornado.\n\t\t\tReceita receitaEmJava = new Receita(resultado.getReceita().getCodigo(),\n\t\t\t\t\tresultado.getReceita().getRendimento(), resultado.getReceita().getTempoPreparo(), componentes);\n\t\t\t// Instancia um novo produto com os dados do produto retornado do BD.\n\t\t\tProduto produtoEmJava = new Produto(resultado.getCodigo(), resultado.getDescricao(),\n\t\t\t\t\tresultado.getCategoria(), resultado.getSimbolo(), resultado.getPreco(), receitaEmJava);\n\t\t\t// converte o novo produto para uma string em JSON.\n\t\t\tString produtoEmJson = converterParaJSON(produtoEmJava);\n\t\t\t// retorna um response com o produto em JSON.\n\t\t\tsetResposta(mensagemSucesso(produtoEmJson));\n\t\t} else {\n\t\t\t// retorna um response informando que o Id informado não possui cadastro.\n\t\t\tsetResposta(mensagemNaoEncontrado());\n\t\t}\n\t\treturn getResposta();\n\t}",
"public String getPrecoProduto() {\r\n\t\treturn precoProduto;\r\n\t}",
"@GetMapping(\"/produtos/{id}\")\n @Timed\n public ResponseEntity<Produto> getProduto(@PathVariable Long id) {\n log.debug(\"REST request to get Produto : {}\", id);\n Produto produto = produtoRepository.findOne(id);\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (!PrivilegioService.podeVer(cargoRepository, ENTITY_NAME)) {\n produto = null;\n log.error(\"TENTATIVA DE VISUALIZAR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME + \" : {}\", id);\n }\n//////////////////////////////////REQUER PRIVILEGIOS\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(produto));\n }",
"private String entraCodProd(boolean isIncluir) {\n String cod = \"\";\n boolean isCadastro = false;\n\n ArrayList<Produto> codProd = (obterTodosProdutos());\n\n // loop enquanto teclar vazio ou not fim\n while (cod.isEmpty() || true) {\n // janela de input do CPF\n cod = JOptionPane.showInputDialog(this, \"Cod do Produto\");\n if (cod == null) {\n return null;\n } else if (cod.isEmpty()) {\n // SE DER <ENTER> JOGA MENSAGEM DE ERRO e VOLTA AO LOOP.\n JOptionPane.showMessageDialog(null, \"Por Favor, Digite Algo!\",\n \"Msg do Servidor\", JOptionPane.INFORMATION_MESSAGE);\n } else {\n\n for (Produto codProd1 : codProd) {\n if (cod.equals(codProd1.getCod())) {\n if (isIncluir) {\n // ENQUANTO NAO ENCONTRA JOGA MENSAGEM DE ERRO e\n // VOLTA AO LOOP.\n JOptionPane.showMessageDialog(null,\n \"Produto Ja Cadastrado!!!\",\n \"Msg do Servidor\",\n JOptionPane.INFORMATION_MESSAGE);\n isCadastro = true;\n break;\n } else {\n return cod;\n }\n }\n isCadastro = false;\n }\n\n if (!isIncluir) {\n // ENQUANTO NAO ENCONTRA JOGA MENSAGEM DE ERRO e VOLTA AO\n // LOOP.\n JOptionPane.showMessageDialog(null,\n \"Produto nao encontrado!!!\", \"Msg do Servidor\",\n JOptionPane.INFORMATION_MESSAGE);\n } else {\n if (!isCadastro) {\n return cod;\n }\n }\n }\n\n }\n return cod;\n }",
"Reserva Obtener();",
"private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }",
"public com.gvt.www.metaData.configuradoronline.DadosProduto getProduto() {\r\n return produto;\r\n }",
"@Override\n public String traerProyecto(Proyecto p) {\n JSONObject json = new JSONObject();\n //json.put(\"codigo\", 0004);\n json.put(\"nombre\", p.getNombre());\n json.put(\"descripcion\", p.getDescripcion());\n json.put(\"duracionSprints\", p.getDuracionDeSprints());\n json.put(\"numeroSprints\", p.getNumeroSprints());\n JSONArray jHUs = new JSONArray();\n for (HistoriaDeUsuario h : p.getProductBacklog().getHistorias()) {\n JSONObject historia = new JSONObject();\n historia.put(\"nombre\", h.getNombre());\n historia.put(\"descripcion\", h.getDescripcion());\n historia.put(\"puntos\", h.getPuntosHistoria());\n historia.put(\"estado\", h.getEstado());\n historia.put(\"prioridad\", h.getPrioridad());\n ArrayList<Criterio> criteriosH = h.getListaCriterios();\n JSONArray criterios = new JSONArray();\n for (Criterio crit : criteriosH) {\n criterios.add(crit.getDescripcion());\n }\n historia.put(\"criterios\", criterios);\n jHUs.add(historia);\n }\n json.put(\"historias\", jHUs);\n return json.toJSONString();\n }",
"String getCidade();",
"public RecordSet obtenerTiposCargoPorEtapa(es.indra.sicc.util.DTOOID dtoe) throws MareException{\n UtilidadesLog.info(\"DAOParametrizacionCOB.obtenerTiposCargoPorEtapa(es.indra.sicc.util.DTOOID dtoe): Entrada\");\n \n RecordSet rs = new RecordSet();\n StringBuffer query = new StringBuffer();\n BelcorpService bs;\n try\n { bs = BelcorpService.getInstance();\n }\n catch(MareMiiServiceNotFoundException ex)\n { throw new MareException(ex, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n }\n\n // gPineda - V-COB006 - 30/01/2007\n //query.append(\" SELECT OID_ETAP_DEUD_TIPO_CARG AS OID, VAL_DESC descripcion \");\n query.append(\" SELECT oid_etap_deud_tipo_carg AS OID, NVL(val_desc, gen.VAL_I18N) descripcion \");\n query.append(\" FROM cob_etapa_deuda_tipo_cargo etapTipoCar, \");\n query.append(\" \t\t ccc_tipo_cargo_abono tipoCar, \");\n query.append(\" \t\t gen_i18n_sicc_pais gen \");\n query.append(\" WHERE ETDE_OID_ETAP_DEUD = \" + dtoe.getOid() );\n query.append(\" \t and etapTipoCar.TCAB_OID_TIPO_CARG_ABON = tipoCar.OID_TIPO_CARG_ABON \");\n query.append(\" \t\t and gen.VAL_OID = tipoCar.OID_TIPO_CARG_ABON \");\n query.append(\" \t\t and gen.ATTR_ENTI = 'CCC_TIPO_CARGO_ABONO' \");\n query.append(\" \t\t and gen.ATTR_NUM_ATRI = 1 \");\n query.append(\" ORDER BY descripcion \");\n \n try \n { rs = bs.dbService.executeStaticQuery(query.toString());\n }\n catch (Exception ex) \n { throw new MareException(ex, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS));\n }\n \n UtilidadesLog.info(\"DAOParametrizacionCOB.obtenerTiposCargoPorEtapa(es.indra.sicc.util.DTOOID dtoe): Salida\");\n \n return rs; \n }",
"public String generaIDPortalEmpleo(EmpresaPorAutorizarVO vo){\n\t\tString idPortalEmpleo = \"\";\t\t\n\t\tint digitoVerificador = 1;\n\t\tFormat formatter = new SimpleDateFormat(\"yyMMdd\");\t\t\n\t\ttry {\n\t\t\tDomicilioVO domicilio = vo.getDomicilio();\n\t\t\tif(vo.getIdTipoPersona() == Constantes.TIPO_PERSONA.PERSONA_FISICA.getIdTipoPersona()){\n\t\t\t\t//Tipo de Persona Física\n\t\t\t\tif(vo.getApellido2().isEmpty()){\n\t\t\t\t\t//Primeras tres letras del apellido paterno\n\t\t\t\t\t//System.out.println(\"--original--strApellido1:\" + vo.getApellido1());\n\t\t\t\t\tString strApellido1 = convertAccents(vo.getApellido1());\n\t\t\t\t\t//System.out.println(\"--modificado--strApellido1:\" + strApellido1);\n\t\t\t\t\tidPortalEmpleo = idPortalEmpleo + strApellido1.substring(0, 3);\t\n\t\t\t\t} else {\n\t\t\t\t\t//Primeras dos letras del apellido paterno\n\t\t\t\t\t//Primera letra del apellido materno\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"--original--strApellido1:\" + vo.getApellido1());\n\t\t\t\t\tString strApellido1 = convertAccents(vo.getApellido1());\n\t\t\t\t\t//System.out.println(\"--modificado--strApellido1:\" + strApellido1);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"--original--strApellido2:\" + vo.getApellido2());\n\t\t\t\t\tString strApellido2 = convertAccents(vo.getApellido2());\n\t\t\t\t\t//System.out.println(\"--modificado--strApellido2:\" + strApellido2);\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tidPortalEmpleo = idPortalEmpleo + strApellido1.substring(0, 2);\n\t\t\t\t\tidPortalEmpleo = idPortalEmpleo + strApellido2.substring(0, 1);\n\t\t\t\t}\n\t\t\t\t//Primera letra del nombre\n\t\t\t\t//System.out.println(\"--original--strNombre:\" + vo.getNombre());\n\t\t\t\tString strNombre = convertAccents(vo.getNombre());\n\t\t\t\t//System.out.println(\"--modificado--strNombre:\" + strNombre);\t\t\t\t\t\n\t\t\t\tidPortalEmpleo = idPortalEmpleo + strNombre.substring(0, 1);\n\t\t\t\t//Fecha de nacimiento en formato yymmdd\n\t\t\t\tidPortalEmpleo = idPortalEmpleo + formatter.format(vo.getFechaNacimiento());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//Tipo de Persona Moral\t\t\t\t\t\n\t\t\t\tString strRazonSocial = convertAccents(vo.getRazonSocial());\n\t\t\t\t//Primeras tres letras de razón social\n\t\t\t\t//COMENTAR EN PRODUCCION\t\t\t\t\t\t\t\t\t\n\t\t\t\tif (strRazonSocial.length() < 3) \n\t\t\t\t\tstrRazonSocial = StringUtils.rightPad(strRazonSocial, 3, \"X\");\n\t\t\t\t/**/\t\t\n\t\t\t\t//TERMINA COMENTAR EN PRODUCCION\t\t\t\t\n\t\t\t\t//\n\t\t\t\t//System.out.println(\"--modificado--strRazonSocial:\" + strRazonSocial);\t\t\t\t\t\t\t\t\t\n\t\t\t\tidPortalEmpleo = idPortalEmpleo + strRazonSocial.substring(0, 3);\t\n\t\t\t\t//Fecha de acta en formato yymmdd\n\t\t\t\tidPortalEmpleo = idPortalEmpleo + formatter.format(vo.getFechaActa());\n\t\t\t}\n\t\t\tidPortalEmpleo = idPortalEmpleo + domicilio.getCodigoPostal();\t\t\t\n\t\t\t//Código verificador (1)\t\t\t\t\n\t\t\tEmpresaPorAutorizarDAO epaDAO = new EmpresaPorAutorizarDAO();\n\t\t\tdigitoVerificador = epaDAO.obtenerDigitoVerificador(idPortalEmpleo, vo.getIdTipoPersona());\t\n\t\t\t//rellenar\n\t\t\tint lenId = idPortalEmpleo.length();\n\t\t\t//System.out.println(\"------digitoVerificador:\" + digitoVerificador);\n\t\t\tint lenDigito = String.valueOf(digitoVerificador).length();\n\t\t\t//System.out.println(\"------lenDigito:\" + lenDigito);\n\t\t\tint intRelleno = PORTAL_ID_SIZE - (lenId + lenDigito);\n\t\t\t//System.out.println(\"------intRelleno:\" + intRelleno);\n\t\t\tString strRelleno = \"\";\n\t\t\tif(intRelleno>0){\n\t\t\t\tfor(int i=0; i<intRelleno; i++){\n\t\t\t\t\tstrRelleno = strRelleno + \"0\";\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"------strRelleno:\" + strRelleno);\n\t\t\tidPortalEmpleo = idPortalEmpleo + strRelleno + digitoVerificador;\n\t\t\t//System.out.println(\"------idPortalEmpleo:\" + idPortalEmpleo);\n\t\t\n\t\t} catch (RuntimeException e) {\n\t\t\tlogger.error(e.toString());\n\t\t\te.printStackTrace();\n\t\t\tthrow new PersistenceException(e);\n\t\t} catch (SQLException e) {\n\t\t\tlogger.error(e.toString());\n\t\t\te.printStackTrace();\n\t\t\tthrow new PersistenceException(e);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(e.toString());\t\t\t\n\t\t\te.printStackTrace();\n\t\t\tthrow new PersistenceException(e);\n\t\t}\t\t\n\t\treturn idPortalEmpleo;\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic String obtenerCategoriaDistintoModelo(PlantaCargoDet det) {\r\n\t\tReferencias ref = referenciasUtilFormController.getReferencia(\r\n\t\t\t\t\"ESTADOS_CATEGORIA\", \"MODELO\");\r\n\t\tif (det != null) {\r\n\t\t\tif (det.getPermanente()) {\r\n\t\t\t\tString cad = \"select pago.* from planificacion.puesto_concepto_pago pago \"\r\n\t\t\t\t\t\t+ \"where pago.obj_codigo = 111 \"\r\n\t\t\t\t\t\t+ \"and pago.id_planta_cargo_det = \"\r\n\t\t\t\t\t\t+ det.getIdPlantaCargoDet()\r\n\t\t\t\t\t\t+ \" and pago.activo is true \"\r\n\t\t\t\t\t\t+ \" and pago.estado != \"\r\n\t\t\t\t\t\t+ ref.getValorNum() + \" order by pago.estado\";\r\n\r\n\t\t\t\tList<PuestoConceptoPago> lista = new ArrayList<PuestoConceptoPago>();\r\n\t\t\t\tlista = em.createNativeQuery(cad, PuestoConceptoPago.class)\r\n\t\t\t\t\t\t.getResultList();\r\n\t\t\t\tString resultado = \"\";\r\n\t\t\t\tif (lista.size() > 0) {\r\n\t\t\t\t\tresultado = lista.get(0).getCategoria();\r\n\t\t\t\t\treturn resultado;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (det.getContratado()) {\r\n\t\t\t\tString cad = \"select concepto.* \"\r\n\t\t\t\t\t\t+ \"from planificacion.puesto_concepto_pago concepto \"\r\n\t\t\t\t\t\t+ \"join planificacion.planta_cargo_det det \"\r\n\t\t\t\t\t\t+ \"on det.id_planta_cargo_det = concepto.id_planta_cargo_det \"\r\n\t\t\t\t\t\t+ \"where det.id_planta_cargo_det = \"\r\n\t\t\t\t\t\t+ det.getIdPlantaCargoDet()\r\n\t\t\t\t\t\t+ \" and concepto.estado != \"\r\n\t\t\t\t\t\t+ ref.getIdReferencias() +\" and concepto.activo is true\"\r\n\t\t\t\t\t\t+ \" order by concepto.estado\";\r\n\t\t\t\tList<PuestoConceptoPago> lista = em.createNativeQuery(cad,\r\n\t\t\t\t\t\tPuestoConceptoPago.class).getResultList();\r\n\t\t\t\tif (lista.size() > 0) {\r\n\t\t\t\t\tString resultado = \"\";\r\n\t\t\t\t\tfor (PuestoConceptoPago l : lista)\r\n\t\t\t\t\t\tresultado = resultado + l.getCategoria();\r\n\t\t\t\t\treturn resultado;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Sin Categoria\";\r\n\t}",
"public String deletaProduto(String produtoId) {\n\t\treturn null;\n\t}",
"public IProduto getCodProd();",
"public String MuestraCualquiera() {//PARA MOSTRAR CUALQUIER TIPO DE CLIENTE\nString Muestra=\"\";\n\nif(getTipoCliente().equals(\"Docente\")) {//SI ES DOCENTE\nMuestra=MuestraDocente();//SE MUESTRAN SOLO LOS DATOS DE DOCENTE\n}else if(getTipoCliente().equalsIgnoreCase(\"Administrativo\")) {//SI ES ADMINISTRATIVO\nMuestra=MuestraAdministrativo();//SE MUESTRAN SOLO LOS DATOS DE ADMINISTRATIVO\n}\n\nreturn Muestra;\n}",
"VentaJPA obtenerVenta(int comprobante);",
"String getTitolo();",
"@Path(\"/productos\")\n @GET\n @Produces(MediaType.APPLICATION_JSON) //Por que una track si la aceptaba (ejemplo) pero un producto no?\n public String productos(){\n return test.getProductos().get(\"Leche\").toString();\n\n }",
"public String toString(){\n return \"Codigo Produto: \"+this.idProduto+\n \"\\nNome do Produto \"+this.nomePro+\n \"\\nDescrição \"+this.descricao+\n \"\\nPreço: \"+this.preco;\n }",
"public BeanProdutosJsp consultar(String id) throws Exception {\n\t\tString sql = \"select * from produtos where id = '\" + id + \"'\";\n\n\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\t\tResultSet resultSet = preparedStatement.executeQuery();\n\n\t\tif (resultSet.next()) {\n\t\t\tBeanProdutosJsp beanProdutosJsp = new BeanProdutosJsp();\n\n\t\t\tbeanProdutosJsp.setId(resultSet.getLong(\"id\"));\n\t\t\tbeanProdutosJsp.setNome(resultSet.getString(\"nome\"));\n\t\t\tbeanProdutosJsp.setQuantidade(resultSet.getDouble(\"quantidade\"));\n\t\t\tbeanProdutosJsp.setValor(resultSet.getDouble(\"valor\"));\n\t\t\tbeanProdutosJsp.setCategoria_id(resultSet.getLong(\"categoria_id\"));\n\n\t\t\treturn beanProdutosJsp;\n\t\t}\n\t\treturn null;\n\t}",
"public void generarContrato() {\r\n\t\ttry {\r\n\t\t\tString nombre = Contrato.generarContrato(estudiante, periodo, reserva.getArrSitioPeriodo().getSitNombre());\r\n\t\t\tnombre = \"Contrato_\" + estudiante.getId().getPerDni() + \".zip\";\r\n\t\t\tthis.zip(estudiante.getId().getPerDni(), periodo.getPrdId());\r\n\t\t\tFunciones.descargarZip(url_contrato+ nombre);\r\n\t\t\t// MODIFICAR NOMBRE CONTRATO\r\n\t\t\tmngRes.agregarContratoReserva(estudiante, periodo.getPrdId());\r\n\t\t} catch (Exception e) {\r\n\t\t\tFunciones.descargarPdf(url_contrato + \"error.pdf\");\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\r\n\t}",
"public CompraResponse idProduto(Long idProduto) {\n this.idProduto = idProduto;\n return this;\n }",
"public Producto buscarProducto(int id) throws Exception {\n ProductoLogica pL = new ProductoLogica();\n Producto producto = pL.buscarProductoID(id);\n return producto;\n }",
"protected String getTitoloPaginaMadre() {\n return VUOTA;\n }",
"public Produit getProduit(int theId);",
"@Override\n\tpublic String detalheEleicao(Eleicao eleicao) throws RemoteException {\n\t\tString resultado = \"\";\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy:MM:dd hh:mm\");\n\t\tdataEleicao data_atual = textEditor.dataStringToData(dateFormat.format(new Date()));\n\t\tif (!data_atual.maior_data(textEditor.dataStringToData(eleicao.getDataInicio()))) {\n\t\t\tresultado += \"\\nTítulo eleição: \"+eleicao.getTitulo()+\" - Data início: \"+eleicao.getDataInicio()+\" - Data fim: \"+ eleicao.getDataFim();\n\t\t\tresultado += \"\\nEleição ainda não iniciada.\";\n\t\t\tfor(Candidatos candTemp: eleicao.getCandidatos()) {\n\t\t\t\tif(candTemp.getTipo().equalsIgnoreCase(\"lista\")) {\n\t\t\t\t\tLista lista = (Lista) candTemp;\n\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+lista.getId()+\" - Nome lista: \"+lista.getNome()+\" Membros: \"+lista.getLista_pessoas();\n\t\t\t\t\tfor(PessoaLista pessoalista : lista.getLista_pessoas()) {\n\t\t\t\t\t\tresultado += \"\\n\\tCC: \"+pessoalista.getPessoa().getNcc()+\" - Cargo: \"+pessoalista.getCargo()+ \" - Nome: \"+pessoalista.getPessoa().getNome();\n\t\t\t\t\t}\n\t\t\t\t\tresultado += \"\\n\";\n\t\t\t\t}else {\n\t\t\t\t\tCandidatoIndividual cand = (CandidatoIndividual) candTemp;\n\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+cand.getId()+\" - Nome: \"+cand.getPessoa().getNome()+\" - CC: \"+cand.getPessoa().getNcc();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (data_atual.maior_data(textEditor.dataStringToData(eleicao.getDataFim()))) {\n\t\t\t\tresultado += \"\\nTítulo eleição: \"+eleicao.getTitulo()+\" - Data início: \"+eleicao.getDataInicio()+\" - Data fim: \"+ eleicao.getDataFim();\n\t\t\t\tresultado += \"\\nEleição terminada.\";\n\t\t\t\tresultado += \"\\nVotos em branco/nulos: \"+eleicao.getnVotoBNA();\n\t\t\t\tfor(Candidatos candTemp: eleicao.getCandidatos()) {\n\t\t\t\t\tif(candTemp.getTipo().equalsIgnoreCase(\"lista\")) {\n\t\t\t\t\t\tLista lista = (Lista) candTemp;\n\t\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+lista.getId()+\" - Nome lista: \"+lista.getNome()+\" Membros: \"+lista.getLista_pessoas()+\"Votos: \"+lista.getnVotos();\n\t\t\t\t\t\tresultado += \"\\n\";\n\t\t\t\t\t}else {\n\t\t\t\t\t\tCandidatoIndividual cand = (CandidatoIndividual) candTemp;\n\t\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+cand.getId()+\" - Nome: \"+cand.getPessoa().getNome()+\" - CC: \"+cand.getPessoa().getNcc()+\" - Votos: \"+cand.getnVotos();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(eleicao.getDataInicio()+\"-\"+eleicao.getDataFim()+\": A decorrer\");\n\t\t\t}\n\t\t}\n\t\treturn resultado;\n\t\n\t}",
"public static List<Produto> consultaProduto(int codigo, String nome, String tipo, String fornecedor) throws Exception {\n List<Produto> produto = ProdutoDAO.procurarProduto(codigo, nome, tipo, fornecedor);\r\n for (int i = 0; i < produto.size(); i++) {\r\n if (!produto.isEmpty()) {\r\n return produto;\r\n }\r\n }\r\n return null;\r\n }",
"public String mostrarPedido()\r\n\t{\r\n\t\tString cad=\"\";\r\n\t\tfor (Articulo articulo : articulosPedido) {\r\n\t\t\tcad+=articulo.toString()+\"\\n\";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}",
"@Override\n\tpublic DAOPrimeraLectura primeraCarga() {\n\t\treturn null;\n\t}",
"public static void promedioBoletaCliente() {\r\n\t\tPailTap clienteBoleta = getDataTap(\"C:/Paula/masterset/data/9\");\r\n\t\tPailTap boletaProperty = getDataTap(\"C:/Paula/masterset/data/4\");\r\n\t\t\r\n\t\tSubquery promedio = new Subquery(\"?Cliente_id\", \"?Promedio\", \"?Dia\")\r\n\t\t\t\t.predicate(clienteBoleta, \"_\", \"?data\")\r\n\t\t\t\t.predicate(boletaProperty, \"_\", \"?data2\")\r\n\t\t\t\t.predicate(new ExtractClienteBoleta(), \"?data\").out(\"?Cliente_id\", \"?Boleta_id\", \"?Dia\")\r\n\t\t\t\t.predicate(new ExtractBoletaTotal(), \"?data2\").out(\"?Boleta_id\",\"?Total\")\r\n\t\t\t\t.predicate(new Avg(), \"?Total\").out(\"?Promedio\");\r\n\t\t\r\n\t\tSubquery tobatchview = new Subquery(\"?json\")\r\n\t\t\t\t.predicate(promedio, \"?Cliente\", \"?Promedio\", \"?Dia\")\r\n\t\t\t\t.predicate(new ToJSON(), \"?Cliente\", \"?Promedio\", \"?Dia\").out(\"?json\");\r\n\t\tApi.execute(new batchview(), tobatchview);\r\n\t\t//Api.execute(new StdoutTap(), promedio);\r\n\t}",
"@Override\n public RspPermiso getPermisoPorTraza(String traza) {\n ConectorBDMySQL conectorBD = new ConectorBDMySQL();\n RspPermiso rspPermiso = new RspPermiso();\n //INICIALIZAR VARIABLES\n rspPermiso.setEsConexionAbiertaExitosamente(false);\n rspPermiso.setEsConexionCerradaExitosamente(false);\n rspPermiso.setEsSentenciaSqlEjecutadaExitosamente(false);\n //INTENTA ESTABLECER LA CONEXIÓN CON LA BASE DE DATOS\n if (conectorBD.iniciarConexion()) {\n rspPermiso.setEsConexionAbiertaExitosamente(true);\n rspPermiso.setRespuestaInicioDeConexion(conectorBD.getAtributosConector().getRespuestaInicioConexion());\n String consultaSQL = \"SELECT * FROM permiso WHERE estado = 1 AND traza = '\" + traza + \"'\";\n try {\n Statement sentencia = conectorBD.getConnection().createStatement();\n boolean bandera = sentencia.execute(consultaSQL);\n if (bandera) {\n ResultSet rs = sentencia.getResultSet();\n rspPermiso.setEsSentenciaSqlEjecutadaExitosamente(true);\n rspPermiso.setRespuestaServicio(utilidadSistema.imprimirConsulta(sentencia.toString(), \"getPermisoPorTraza(String traza)\", this.getClass().toString()));\n if (rs.next()) {\n Permiso permiso = new Permiso();\n permiso = rsPermiso(rs, permiso);\n rspPermiso.setPermiso(permiso);\n }\n }\n } catch (SQLException e) {\n rspPermiso.setRespuestaServicio(utilidadSistema.imprimirExcepcion(e, \"getPermisoPorTraza(String traza)\", this.getClass().toString()));\n } finally {\n if (conectorBD.cerrarConexion()) {\n rspPermiso.setEsConexionCerradaExitosamente(true);\n }\n rspPermiso.setRespuestaCierreDeConexion(conectorBD.getAtributosConector().getRespuestaCierreDeConexion());\n return rspPermiso;\n }\n } else {\n rspPermiso.setRespuestaInicioDeConexion(conectorBD.getAtributosConector().getRespuestaInicioConexion());\n return rspPermiso;\n }\n }",
"public List<Produto> consultarProdutos(int consulta, String valor) {\r\n ConexaoBDJavaDB conexaoBD = new ConexaoBDJavaDB(\"routeexpress\");\r\n Connection conn = null;\r\n Statement stmt = null;\r\n ResultSet rs = null;\r\n List<Produto> produtos = new ArrayList<>();\r\n try {\r\n conn = conexaoBD.obterConexao();\r\n stmt = conn.createStatement();\r\n //Se a consulta for igual a zero(0) uma lista de todos os produtos \"cervejas\" e recuperada\r\n if (consulta == 0) {\r\n rs = stmt.executeQuery(consultas[consulta]);\r\n //Se a consulta for igual a tres(3) uma lista de todos os produtos \"cervejas\" e recuperada a parti do preco\r\n } else {\r\n rs = stmt.executeQuery(consultas[consulta] + \"'\" + valor + \"'\");\r\n }\r\n Produto produto;\r\n while (rs.next()) {\r\n produto = new Produto();\r\n produto.setIdCervejaria(rs.getInt(\"ID_CERVEJARIA\"));\r\n produto.setCervejaria(rs.getString(\"CERVEJARIA\"));\r\n produto.setPais(rs.getString(\"PAIS\"));\r\n produto.setIdCerveja(rs.getInt(\"ID_CERVEJA\"));\r\n produto.setIdFkCervajaria(rs.getInt(\"FK_CERVEJARIA\"));\r\n produto.setRotulo(rs.getString(\"ROTULO\"));\r\n produto.setPreco(rs.getString(\"PRECO\"));\r\n produto.setVolume(rs.getString(\"VOLUME\"));\r\n produto.setTeor(rs.getString(\"TEOR\"));\r\n produto.setCor(rs.getString(\"COR\"));\r\n produto.setTemperatura(rs.getString(\"TEMPERATURA\"));\r\n produto.setFamiliaEEstilo(rs.getString(\"FAMILIA_E_ESTILO\"));\r\n produto.setDescricao(rs.getString(\"DESCRICAO\"));\r\n produto.setSabor(rs.getString(\"SABOR\"));\r\n produto.setImagem1(rs.getString(\"IMAGEM_1\"));\r\n produto.setImagem2(rs.getString(\"IMAGEM_2\"));\r\n produto.setImagem3(rs.getString(\"IMAGEM_3\"));\r\n produtos.add(produto);\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (ClassNotFoundException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n if (conn != null) {\r\n try {\r\n conn.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (stmt != null) {\r\n try {\r\n stmt.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (rs != null) {\r\n try {\r\n rs.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n return produtos;\r\n }",
"public String menuProducto() {\n\n\t\tIcon icono = new ImageIcon(getClass().getResource(\"../img/producto.png\"));\n\n\t\tString[] opciones = { \"Mostrar todos los valores\", \"Borrar Producto\", \"Crear Producto\", \"Modificar Producto\",\n\t\t\t\t\"Buscar por nombre\", \"Buscar por clave\", \"Salir\" };\n\n\t\tString opcionElegida = (String) JOptionPane.showInputDialog(null, \"¿Que deseas realizar?\", \"Tabla Producto\",\n\t\t\t\tJOptionPane.QUESTION_MESSAGE, icono, opciones, opciones[0]);\n\n\t\treturn opcionElegida;\n\n\t}",
"public String recuperaCultivoByVariedadAsigCA(){\n\t\tlstVariedad = iDAO.recuperaVariedadByInicilizacionEsquema(idInicializacionEsquema, idCultivo);\n\t\treturn SUCCESS;\t\t\n\t}",
"public String recuperaVariedadByCultivoEdoAsigCA(){\n\t\tlstVariedad = iDAO.recuperaVariedadByInicilizacionEsquema(idInicializacionEsquema, idCultivo, idEstado);\n\t\treturn SUCCESS;\t\t\n\t}",
"public String MuestraAdministrativo() {\n\t\n\tString Muestra=\"\";\n\tMuestra+=MuestraDatosAdministrativos() +\"Tipo de credito especial: Computo\\n\"\n\t\t\t+ \"Monto solicitado: �\"+String.format(\"%.0f\",getMontoCredito())+\"\\n\"\n\t\t\t+ \"Equipo a Adquirir: \"+getDispositivo()+\"\\n\"\n\t\t\t\t+ \"Comercio de compra: \"+getComercio()+\"\\n\"\n\t\t\t\t\t+ \"Plazo fijo: \"+getPlazo()+\" meses.\" +\"\\n\" \n\t\t\t\t\t\t+ \"Interes fijo: \"+String.format(\"%.0f\",getInteres())+\"%\\n\"\n\t\t\t\t\t\t+ \"Cuota a pagar: �\"+String.format(\"%.0f\",getCuotaPagar())+\"\\n\\n\";\n\t\n\treturn Muestra;\n\t\n}",
"public String borra() { \n clienteDAO.borra(c.getId());\n return \"listado\";\n }",
"public ConstrutorDeLeilao para(String produto) {\n\t\t\r\n\t\t this.leilao = new Leilao(produto);\r\n\t\treturn this;\r\n\t}",
"public String getNomeProduto() {\r\n\t\treturn nomeProduto;\r\n\t}",
"public TarjetaDeCreditoEntity getTrajetaDeCredito(Long id) \n {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar Tarjeta con id={0}\", id);\n TarjetaDeCreditoEntity tarjeta= persistence.find(id);\n if (tarjeta == null) {\n LOGGER.log(Level.SEVERE, \"tarjeta con el id {0} no existe\", id);\n }\n LOGGER.log(Level.INFO, \"Termina proceso de consultar tarjeta con id={0}\", id);\n return tarjeta;\n }",
"private Punto getPuntoCercano(Punto puntoini, List<Punto> puntos ){\n\t\t\t\n\t\t List<Segmento> segmentos = new ArrayList<Segmento>();\n\t\t\t// todos contra todos\n\t\t\tfor (Punto punto : puntos) {\n\t\t\t\tif( (puntoini!=null && punto!=null) && !puntoini.equals(punto) ){\n\t\t\t\t\t\tdouble d = Geometria.distanciaDeCoordenadas(puntoini, punto);\n\t\t\t\t\t\tsegmentos.add(new Segmento(puntoini, punto, d));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tCollections.sort(segmentos);\n\t\t\tPunto puntocerano = segmentos.get(0).getPunto2();\n\t\t \n\t\t return puntocerano;\n\t\t \n\t }",
"public String tipoConta() {\n return \"Conta Comum\";\n }",
"@Override\n\tpublic String executa(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tJuncaoEstoqueProduto estoque = new JuncaoEstoqueProduto(Integer.parseInt(request.getParameter(\"quantidade\")),\n\t\t\t\trequest.getParameter(\"nome\"),request.getParameter(\"codProduto\"),Integer.parseInt(request.getParameter(\"quantidadeMinima\")));\n\t\t// enviar dados para o DAO persistir\n\t\tnew JuncaoEstoqueProdutoDAO().salvar(estoque);\n\t\t//retornar o nome da view\n\t\trequest.setAttribute(\"msg\", \"parabéns produto cadastrado com sucesso\");\n\t\treturn \"cadastroProduto\";\n\t}",
"@Override\n\tpublic String crearTramaParaRepartirCarta() {\n\t\treturn null;\n\t}",
"private String getQuerySelecaoPromocoes()\n\t{\n\t\tString result = \n\t\t\t\"SELECT \" +\n\t\t\t\" PROMOCAO.IDT_PROMOCAO, \" +\n\t\t\t\" PROMOCAO.NOM_PROMOCAO, \" +\n\t\t\t\" PROMOCAO.DAT_INICIO_VALIDADE, \" +\n\t\t\t\" PROMOCAO.DAT_FIM_VALIDADE, \" +\n\t\t\t\" PROMOCAO.VLR_MAX_CREDITO_BONUS \" +\n\t\t \"FROM \" +\n\t\t \" TBL_GER_PROMOCAO PROMOCAO \" + \n\t\t \"WHERE \" +\n\t\t \" PROMOCAO.IDT_CATEGORIA = \" + String.valueOf(ID_CATEGORIA_PULA_PULA);\n\t\t\n\t\treturn result;\n\t}",
"public String getInfoTitulos(){\r\n String infoTitulos = \"\";\r\n \r\n if(this.propriedadesDoJogador.size() > 0 || this.companhiasDoJogador.size() > 0){\r\n for(int i = 0; i < this.propriedadesDoJogador.size(); i++){\r\n infoTitulos += propriedadesDoJogador.get(i).getDescricao()+\"\\n\";\r\n }\r\n for(int i = 0; i < this.companhiasDoJogador.size(); i++){\r\n infoTitulos += companhiasDoJogador.get(i).getDescricao()+\"\\n\";\r\n }\r\n return infoTitulos;\r\n \r\n }else{\r\n return \"Você não possui títulos\";\r\n }\r\n }",
"public List<String> pot(ReportePlazaDTO reportePlazaDTO) {\n List<CustomOutputFile> lista = new ArrayList<CustomOutputFile>();\n List<String> listaString = new ArrayList<String>();\n\n String qnaCaptura = reportePlazaDTO.getQnaCaptura();\n String qnaCaptura2 = \"\";\n\n if (new Integer(qnaCaptura) % 2 == 0) {\n qnaCaptura2 = String.valueOf((new Integer(qnaCaptura) - 1));\n } else {\n qnaCaptura2 = qnaCaptura;\n }\n\n\n if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"e\")) {\n\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotEscenario(qnaCaptura);\n listaString.add(\"ID del Cargo,Nombre del Cargo\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"i\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotInmueble(qnaCaptura);\n listaString.add(\"Id Domicilio,Calle,Número Exterior,Número Interior,Colonia,Municipio,Estado/Entidad Fef.,País,Código Postal,Tipo de Oficina\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"a\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotAltas(qnaCaptura, \n qnaCaptura2);\n listaString.add(\"ID del Servidor Público,Nombre,Primer Apellido,Segundo Apellido,Tipo Vacancia,Telefono Directo,Conmutador,Extensión,Fax,Email,ID Domicilio,Nivel de Puesto,Id del Cargo,ID del Cargo Superior,Nivel_Jerarquico\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"b\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotBajas(qnaCaptura, \n qnaCaptura2);\n listaString.add(\"ID del Servidor Público\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"d\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotDirectorio(qnaCaptura, \n qnaCaptura2);\n listaString.add(\"Unidad,RFC,ID del Servidor Público,Nombre,Primer Apellido,Segundo Apellido,Tipo Vacancia,Telefono Directo,Conmutador,Extensión,Fax,Email,ID Domicilio,Nivel de Puesto,Id del Cargo,ID del Cargo Superior,Nivel_Jerarquico\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"r\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotRemuneraciones(qnaCaptura, \n qnaCaptura2);\n listaString.add(\"Id Puesto,Nombre,Tipo,SubTipo,Sueldo Base,Compensación Garantizada, Total Bruto, Total Neto,Nombre 01 Remuneracion,Monto 01 Remuneracion,Nombre 02 Remuneracion,Monto 02 Remuneracion,Nombre 03 Remuneracion,Monto 03 Remuneracion,Nombre 04 Remuneracion,Monto 04 Remuneracion,Nombre 05 Remuneracion,Monto 05 Remuneracion,Nombre 06 Remuneracion,Monto 06 Remuneracion,Nombre 07 Remuneracion,Monto 07 Remuneracion,Nombre 08 Remuneracion,Monto 08 Remuneracion,Nombre 09 Remuneracion,Monto 09 Remuneracion,Nombre 10 Remuneracion,Monto 10 Remuneracion,Nombre 11 Remuneracion,Monto 11 Remuneracion,Nombre 12 Remuneracion,Monto 12 Remuneracion,Nombre 13 Remuneracion,Monto 13 Remuneracion,Nombre 14 Remuneracion,Monto 14 Remuneracion,Nombre 15 Remuneracion,Monto 15 Remuneracion,Institucional,Colectivo de Retiro,Gastos Médicos,Separación Individualizado,Riesgos de Trabajo,Nombre Otros Seguros 1,Monto Otros Seguros 1,Nombre Otros Seguros 2,Monto Otros Seguros 2,Nombre Otros Seguros 3,Monto Otros Seguros 3,Nombre Otros Seguros 4,Monto Otros Seguros 4,Nombre Otros Seguros 5,Monto Otros Seguros 5,Nombre Otros Seguros 6,Monto Otros Seguros 6,Nombre Otros Seguros 7,Monto Otros Seguros 7,Nombre Otros Seguros 8,Monto Otros Seguros 8,Nombre Otros Seguros 9,Monto Otros Seguros 9,Nombre Otros Seguros 10,Monto Otros Seguros 10,Nombre Otros Seguros 11,Monto Otros Seguros 11,Nombre Otros Seguros 12,Monto Otros Seguros 12,Nombre Otros Seguros 13,Monto Otros Seguros 13,Nombre Otros Seguros 14,Monto Otros Seguros 14,Nombre Otros Seguros15,Monto Otros Seguros 15,Prima Vacacional,Primas de Antigüedad,Gratificación de Fin de Año,Pagas de Defunción,Ayuda para Despensa,Vacaciones,Nombre Prest. Econom 1,Monto Prest. Econom 1,Nombre Prest. Econom 2,Monto Prest. Econom 2,Nombre Prest. Econom 3,Monto Prest. Econom 3,Nombre Prest. Econom 4,Monto Prest. Econom 4,Nombre Prest. Econom 5,Monto Prest. Econom 5,Nombre Prest. Econom 6,Monto Prest. Econom 6,Nombre Prest.Econom 7,Monto Prest. Econom 7,Nombre Prest. Econom 8,Monto Prest. Econom 8,Nombre Prest. Econom 9,Monto Prest. Econom 9,Nombre Prest. Econom 10,Monto Prest. Econom 10,Nombre Prest. Econom 11,Monto Prest. Econom 11,Nombre Prest. Econom 12,Monto Prest. Econom 12,Nombre Prest. Econom 13,Monto Prest. Econom 13,Nombre Prest. Econom 14,Monto Prest. Econom 14,Nombre Prest. Econom 15,Monto Prest. Econom 15,Asistencia Legal,Asignación de Vehículo y/o Apoyo Económico ,Equipo de Telefonía Celular,Gastos de Alimentación,Nombre Prest. Inherentes al Puesto 1,Monto Prest. Inherentes al Puesto 1,Nombre Prest. Inherentes al Puesto 2,Monto Prest. Inherentes al Puesto 2,Nombre Prest. Inherentes al Puesto 3,Monto Prest. Inherentes al Puesto 3,Nombre Prest. Inherentes al Puesto 4,Monto Prest. Inherentes al Puesto 4,Nombre Prest. Inherentes al Puesto 5,Monto Prest. Inherentes al Puesto 5,Nombre Prest. Inherentes al Puesto 6,Monto Prest. Inherentes al Puesto 6,Nombre Prest. Inherentes al Puesto 7,Monto Prest. Inherentes al Puesto 7,Nombre Prest. Inherentes al Puesto 8,Monto Prest. Inherentes al Puesto 8,Nombre Prest. Inherentes al Puesto 9,Monto Prest. Inherentes al Puesto 9,Nombre Prest. Inherentes al Puesto 10,Monto Prest. Inherentes al Puesto 10,Nombre Prest. Inherentes al Puesto 11,Monto Prest. Inherentes al Puesto 11,Nombre Prest. Inherentes al Puesto 12,Monto Prest. Inherentes al Puesto 12,Nombre Prest. Inherentes al Puesto 13,Monto Prest. Inherentes al Puesto 13,Nombre Prest. Inherentes al Puesto 14,Monto Prest. Inherentes al Puesto 14,Nombre Prest. Inherentes al Puesto 15,Monto Prest. Inherentes al Puesto 15,ISSSTE / IMSS,FOVISSSTE / INFONAVIT,SAR,Nombre 01 Prest.Seg Social,Monto 01 Prest.Seg Social,Nombre 02 Prest.Seg Social,Monto 02 Prest.Seg Social,Nombre 03 Prest.Seg Social,Monto 03 Prest.Seg Social,Nombre 04 Prest.Seg Social,Monto 04 Prest.Seg Social,Nombre 05 Prest.Seg Social,Monto 05 Prest.Seg Social,Nombre 06 Prest.Seg Social,Monto 06 Prest.Seg Social,Nombre 07 Prest.Seg Social,Monto 07 Prest.Seg Social,Nombre 08 Prest.Seg Social,Monto 08 Prest.Seg Social,Nombre 09 Prest.Seg Social,Monto 09 Prest.Seg Social,Nombre 10 Prest.Seg Social,Monto 10 Prest.Seg Social,Nombre 11 Prest.Seg Social,Monto 11 Prest.Seg Social,Nombre 12 Prest.Seg Social,Monto 12 Prest.Seg Social,Nombre 13 Prest.Seg Social,Monto 13 Prest.Seg Social,Nombre 14 Prest.Seg Social,Monto 14 Prest.Seg Social,Nombre 15 Prest.Seg Social,Monto 15 Prest.Seg Social,Préstamos,Becas,Indemnizaciones,Nombre Otro Tipo Incentivo 01,Monto. Otro Tipo Incentivo 01,Nombre Otro Tipo Incentivo 02,Monto. Otro Tipo Incentivo 02,Nombre Otro Tipo Incentivo 03,Monto. Otro Tipo Incentivo 03,Nombre Otro Tipo Incentivo 04,Monto. Otro Tipo Incentivo 04,Nombre Otro Tipo Incentivo05,Monto. Otro Tipo Incentivo 05,Nombre Otro Tipo Incentivo 06,Monto. Otro Tipo Incentivo 06,Nombre Otro Tipo Incentivo 07,Monto. Otro Tipo Incentivo 07,Nombre Otro Tipo Incentivo 08,Monto. Otro Tipo Incentivo 08,Nombre Otro Tipo Incentivo 09,Monto. Otro Tipo Incentivo 09,Nombre Otro Tipo Incentivo 10,Monto. Otro Tipo Incentivo10,Nombre Otro Tipo Incentivo 11,Monto. Otro Tipo Incentivo 11,Nombre Otro Tipo Incentivo 12,Monto. Otro Tipo Incentivo12,Nombre Otro Tipo Incentivo 13,Monto. Otro Tipo Incentivo 13,Nombre Otro Tipo Incentivo 14,Monto. Otro Tipo Incentivo 14,Nombre Otro Tipo Incentivo 15,Monto. Otro Tipo Incentivo 15\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"f\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotFuncion((reportePlazaDTO.getQnaCaptura().substring(0, \n 4)));\n listaString.add(\"Identificador de la Facultad,Fundamento Legal,Documento Registrado,Unidad Administrativa,Nombre de la Unidad Administrativa\");\n } else if (reportePlazaDTO.getOrigen().equalsIgnoreCase(\"s\")) {\n lista = \n super.persistence().get(QueryTdPlazaDAO.class).findBypotEstadistico(qnaCaptura);\n listaString.add(\"NIVEL,G,H,HH,I,J,K,L,M,N,O,Total\");\n }\n\n if (lista != null) {\n for (CustomOutputFile row: lista) {\n listaString.add(row.getRegistro());\n }\n } else\n listaString = null;\n return listaString;\n\n }",
"private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}",
"String getCognome();",
"public void obtener_proximo_cpte(){\n\t\t_Data data=(_Data) _data;\n\t\tString cb=data.getProximoPGCorrecto();\n\t\t//Pago_frame _frame=(Pago_frame) this._frame;\n\t\tframe.get_txt_idPago().setText(cb);\n\t}",
"String getNombreProducto();",
"public Producto obtenerProductoComprado(int id, boolean usarNumeroProducto){\n \n if(usarNumeroProducto){\n Iterator<Producto> itr = listaProductosComprados.iterator();\n while(itr.hasNext()){\n Producto temp = itr.next();\n if(temp.obtenerNumeroProducto()==id){\n return temp;\n }else{\n return null;\n }\n }\n }\n \n return listaProductosComprados.get(id);\n }",
"String getTheirProductId();",
"public String getTitulo(int codProva) {\n\t\tTransactionManager txManager = new TransactionManager();\n\t return txManager.doInTransactionWithReturn((connection) -> {\n\t \t\n\t\t\tps = connection.prepareStatement(\n\t\t\t\t\t\"SELECT codigo, titulo FROM prova WHERE codigo=?\");\n\t\t\tps.setInt(1, codProva);\n\t\t\trs = ps.executeQuery();\n\t\t\t\n\t\t\treturn (rs.next()) ? rs.getString(2) : \"\";\n\t\t});\n\t}",
"@Path(\"{proveedorId: \\\\d+}/seguros\")\r\n public Class<ProveedorSegurosResource> getCompradorMetodoDePagoResource(@PathParam(\"proveedorId\") Long proveedorId) {\r\n if (proveedorLogic.getProveedor(proveedorId) == null) {\r\n throw new WebApplicationException(\"El recurso /proveedores/\" + proveedorId + \" no existe.\", 404);\r\n }\r\n return ProveedorSegurosResource.class;\r\n }",
"public List<Listas_de_las_Solicitudes> Mostrar_las_peticiones_que_han_llegado_al_Usuario_Administrador(int cedula) {\n\t\t//paso3: Obtener el listado de peticiones realizadas por el usuario\n\t\tEntityManagerFactory entitymanagerfactory = Persistence.createEntityManagerFactory(\"LeyTransparencia\");\n\t\tEntityManager entitymanager = entitymanagerfactory.createEntityManager();\n\t\tentitymanager.getEntityManagerFactory().getCache().evictAll();\n\t\tQuery consulta4=entitymanager.createQuery(\"SELECT g FROM Gestionador g WHERE g.cedulaGestionador =\"+cedula);\n\t\tGestionador Gestionador=(Gestionador) consulta4.getSingleResult();\n\t\t//paso4: Obtener por peticion la id, fecha y el estado\n\t\tList<Peticion> peticion=Gestionador.getEmpresa().getPeticions();\n\t\tList<Listas_de_las_Solicitudes> peticion2 = new ArrayList();\n\t\t//paso5: buscar el area de cada peticion\n\t\tfor(int i=0;i<peticion.size();i++){\n\t\t\tString almcena=\"\";\n\t\t\tString sarea=\"no posee\";\n\t\t\tBufferedReader in;\n\t\t\ttry{\n\t\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(\"C:/area/area\"+String.valueOf(peticion.get(i).getIdPeticion())+\".txt\"), \"utf-8\"));\n\t\t\t\ttry {\n\t\t\t\t\twhile((sarea=in.readLine())!=null){\n\t\t\t\t\t\tint s=0;\n\t\t\t\t\t\talmcena=sarea;\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\tSystem.out.println(almcena);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t//paso6: Mostrar un listado de peticiones observando el id, la fecha de realizacion de la peticion, hora de realizacion de la peticion, y el estado actual de la peticion\n\t\t\tListas_de_las_Solicitudes agregar=new Listas_de_las_Solicitudes();\n\t\t\tagregar.setId(String.valueOf(peticion.get(i).getIdPeticion()));\n\t\t\tagregar.setFechaPeticion(peticion.get(i).getFechaPeticion());\n\t\t\tagregar.setNombreestado(peticion.get(i).getEstado().getTipoEstado());\n\t\t\tagregar.setArea(almcena);\n\t\t\tpeticion2.add(agregar);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"el usuario existe\");\n\t\treturn peticion2;\n\t\t//aun no se\n\t}",
"public TarjetaDeCreditoEntity getTrajetaDeCreditoNumero(Long id, Long numero) \n {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar Tarjeta con numero}\", numero);\n TarjetaDeCreditoEntity tarjeta= persistence.findByNumber(id,numero);\n if (tarjeta == null) {\n LOGGER.log(Level.SEVERE, \"tarjeta con el id {0} no existe\",numero);\n }\n LOGGER.log(Level.INFO, \"Termina proceso de consultar tarjeta con numero}\",numero);\n return tarjeta;\n }",
"public String crearPostulante() {\n\t\tString r = \"\";\n\t\ttry {\n\t\t\tif (edicion) {\n\t\t\t\tsetPos_password(Utilidades.Encriptar(getPos_password()));// PASS\n\t\t\t\tmanagergest.editarPostulante(pos_id.trim(), pos_nombre.trim(),\n\t\t\t\t\t\tpos_apellido.trim(), pos_direccion.trim(),\n\t\t\t\t\t\tpos_correo.trim(), pos_telefono.trim(),\n\t\t\t\t\t\tpos_celular.trim(), pos_password.trim(), \"A\");\n\t\t\t\tpos_id = \"\";\n\t\t\t\tpos_nombre = \"\";\n\t\t\t\tpos_apellido = \"\";\n\t\t\t\tpos_direccion = \"\";\n\t\t\t\tpos_correo = \"\";\n\t\t\t\tpos_password = \"\";\n\t\t\t\tpos_telefono = \"\";\n\t\t\t\tpos_celular = \"\";\n\t\t\t\tpos_institucion = \"\";\n\t\t\t\tpos_gerencia = \"\";\n\t\t\t\tpos_area = \"\";\n\t\t\t\tMensaje.crearMensajeINFO(\"Modificado - Editado\");\n\t\t\t\tr = \"home?faces-redirect=true\";\n\t\t\t} else {\n\t\t\t\tMensaje.crearMensajeINFO(\"Error..!!! Usuario no pudo ser Creado\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tMensaje.crearMensajeINFO(\"Error..!!! Usuario no pudo ser Creado\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn r;\n\t}",
"public Produto buscaPorId(int idProduto) throws NullPointerException {\r\n for (Produto produto : this.produtos) {\r\n if (produto.getId() == idProduto) {\r\n return produto;\r\n }\r\n }\r\n //Joga a exceção pois o método precisa retornar um produto caso seja digitado um id de produto que exista\r\n //caso desse errado teria que ser retorna um produto null e isso é feio e teria que ser trado fora\r\n //com a exceção fica melhor de se entender o que aconteceu\r\n throw new NullPointerException();\r\n }",
"Especialidad getEspecialidadPorId(Integer especialidadId);",
"public static String getCuenta() {\r\n return cuenta;\r\n }",
"List<Pacote> buscarPorTransporte(Transporte transporte);",
"public Proyecto proyectoPorId(int id) {\n\t\t\tRestTemplate plantilla = new RestTemplate();\n\t\t\tProyecto proyecto =plantilla.getForObject(\"http://localhost:5000/proyectos/\" + id, Proyecto.class);\n\t\t\treturn proyecto;\n\t\t}",
"private static void cadastroProduto() {\n\n\t\tString nome = Entrada(\"PRODUTO\");\n\t\tdouble PrecoComprado = Double.parseDouble(Entrada(\"VALOR COMPRA\"));\n\t\tdouble precoVenda = Double.parseDouble(Entrada(\"VALOR VENDA\"));\n String informacaoProduto = Entrada(\"INFORMAÇÃO DO PRODUTO\");\n String informacaoTecnicas = Entrada(\"INFORMAÇÕES TÉCNICAS\");\n\n\t\tProduto produto = new Produto(nome, PrecoComprado, precoVenda, informacaoProduto,informacaoTecnicas);\n\n\t\tListaDProduto.add(produto);\n\n\t}",
"public List getProdutos() {\n\t\treturn null;\n\t}",
"@Override\r\n public Cliente buscarCliente(String cedula) throws Exception {\r\n return entity.find(Cliente.class, cedula);//busca el cliente\r\n }",
"public FacturaCompra pagoPSE(String userName,TipoMoneda tipoMoneda);",
"public static void proveraServisa() {\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje racunate vreme sledeceg servisa:\");\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tif (!Main.getVozilaAll().get(redniBroj).isVozObrisano()) {\n\t\t\t\tUtillMethod.proveraServisaVozila(Main.getVozilaAll().get(redniBroj));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Ovo vozilo je obrisano i ne moze da se koristi!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t}\n\t}",
"public String getDescricaoCaminhao() {\n return getDescricaoVeiculo() + \"\\t\" + capacidadeCarga;\n }",
"public String agregarCuenta(String tipo, String nombre, String ced, String num)throws ExCliente, ExPlan, ExCuenta\n\t{\n\t\t//Crear la cuenta y almacenarla en la lista de cuentas de dicho plan.\n\t\t//Luego asignarsela al cliente\n\t\t//Numero ya usado?\n\t\t\n\t\tPlan p;\n\t\n\t\tif (! clientes.containsKey(ced))\n\t\t{\n\t\t\tthrow (new ExCliente(\"Cedula no encontrada\"));\n\t\t}\n\t\t\n\t\tCuenta obj = buscarCuentaNumero(num);\n\t\tif (obj != null)\n\t\t{\n\t\t\tthrow (new ExCuenta(\"Numero ya ocuopado\"));\n\t\t}\n\t\t\n\t\tif(tipo.equalsIgnoreCase(\"PREPAGO\"))\n\t\t{\n\t\t\tp = buscarPlan(nombre);\n\t\t\tif (p == null || (p != null && p instanceof PlanPostpago))\n\t\t\t{\n\t\t\t\tthrow (new ExPlan(\"El Plan no existe\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCliente c = clientes.get(ced);\n\t\t\t\t\n\t\t\t\treturn c.agregarCuenta(((PlanPrepago)p).agregarCuenta(num));\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(tipo.equalsIgnoreCase(\"POSTPAGO\"))\n\t\t\t{\n\t\t\t\tp = buscarPlan(nombre);\n\t\t\t\tif (p == null || (p != null && p instanceof PlanPrepago))\n\t\t\t\t{\n\t\t\t\t\tthrow (new ExPlan(\"El plan no existe\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tCliente c = clientes.get(ced);\n\t\t\t\t\treturn c.agregarCuenta(((PlanPostpago)p).agregarCuenta(num));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow (new ExCuenta(\"Tipo Incorrecto\"));\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"private Filtro getFiltroPiattiComandabili() {\n /* variabili e costanti locali di lavoro */\n Filtro filtro = null;\n Modulo modPiatto = PiattoModulo.get();\n\n try { // prova ad eseguire il codice\n\n filtro = FiltroFactory.crea(modPiatto.getCampo(Piatto.CAMPO_COMANDA), true);\n\n } catch (Exception unErrore) { // intercetta l'errore\n new Errore(unErrore);\n } // fine del blocco try-catch\n\n /* valore di ritorno */\n return filtro;\n }",
"public List getPorPertenceAProduto(long id) throws DaoException {\n\t\tsetMontador(null);\n\t\tString sql;\n \tsql = \"select \" + camposOrdenadosJoin() + \" from \" + tabelaSelect() + \n outterJoinAgrupado() +\n \t\" where id_produto_pa = \" + id + orderByLista();\n \tsetMontador(getMontadorAgrupado());\n \treturn getListaSql(sql);\n\t}",
"public String darPlaca() {\n\t\treturn placa;\n\t}",
"public int getIdproducto() {\r\n\t\treturn idproducto;\r\n\t}",
"public String estadisticasProductosMasVendidos() {\n String html = \"\";\n DefaultTableModel dtm = producto.estadisticaTopProductosMasVendidos();\n html = Utils.dibujarGraficasHTMLDonut(dtm, \"TOP PRODUCTOS MAS VENDIDOS\");\n return html;\n }",
"public Integer obterIdEmpresaPorRota(Rota rota) throws ErroRepositorioException;",
"public String altaGenero(){\n int id = coleccionGenero.size() + 1;\n Genero gen = new Genero(id, generoSeleccionado);\n //graba en bd\n GeneroService serv = new GeneroService();\n //refrescar otra vez la lista\n return \"lista-genero\";\n }",
"@Override\r\n public VehiculoModel consultarVehiculo(String placa) {\n Connection conn = null;\r\n VehiculoModel vehiculo = null; //defino un objeto de vehiculo como nulo\r\n try{\r\n conn = Conexion.getConnection();\r\n String sql = \"Select * from vehiculo where vehPlaca=?\";\r\n PreparedStatement statement = conn.prepareStatement(sql); //se prepara para la query\r\n statement.setString(1, placa);\r\n ResultSet result = statement.executeQuery(sql);\r\n while(result.next()){\r\n vehiculo = new VehiculoModel(result.getString(1), result.getString(2), result.getString(3), \r\n result.getInt(4), result.getInt(5), result.getString(6), result.getInt(7));\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Codigo : \" + ex.getErrorCode() + \"\\nError: \" + ex.getMessage());\r\n }\r\n \r\n return vehiculo;\r\n }",
"List<CatalogoAprobadorDTO> buscarAprobador(int cveADM, String numEmpleado, Integer claveNivel, Integer centroCostoOP) throws SIATException;",
"public CatalogoBean obtenerCatalogoPorNombre(String nombre) throws Exception;",
"public CompraResponse descricaoProduto(String descricaoProduto) {\n this.descricaoProduto = descricaoProduto;\n return this;\n }",
"@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }",
"@Override\n public Paciente procurarPorId(int id) {\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n Paciente paciente = em.find(Paciente.class, id);\n em.close();\n factory.close();\n return (paciente);\n }",
"public String getCuenta() {\r\n return cuenta;\r\n }",
"public abstract java.lang.Long getId_causal_peticion();",
"@Override\n public ComprobanteContable createComprobante(\n Aerolinea a, Boleto boleto, Cliente cliente, String tipo) throws CRUDException {\n Optional op;\n ComprobanteContable comprobante = new ComprobanteContable();\n //ComprobanteContablePK pk = new ComprobanteContablePK();\n //pk.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n comprobante.setEstado(ComprobanteContable.EMITIDO);\n //comprobante.setComprobanteContablePK(pk);\n //creamos el concepto\n StringBuilder buff = new StringBuilder();\n\n // DESCRIPCION \n // AEROLINEA/ # Boleto / Pasajero / Rutas\n buff.append(a.getNumero());\n\n buff.append(\"/\");\n\n //numero boleto\n buff.append(\"#\");\n buff.append(boleto.getNumero());\n buff.append(\"/\");\n\n //Pasajero\n buff.append(boleto.getNombrePasajero().toUpperCase());\n\n // Rutas\n buff.append(\"/\");\n buff.append(boleto.getIdRuta1() != null ? boleto.getIdRuta1() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta2() != null ? boleto.getIdRuta2() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta3() != null ? boleto.getIdRuta3() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta4() != null ? boleto.getIdRuta4() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta5() != null ? boleto.getIdRuta5() : \"\");\n\n //jala el nombre cliente\n comprobante.setIdCliente(cliente);\n comprobante.setConcepto(buff.toString());\n comprobante.setFactorCambiario(boleto.getFactorCambiario());\n comprobante.setFecha(boleto.getFechaEmision());\n comprobante.setFechaInsert(boleto.getFechaInsert());\n comprobante.setIdEmpresa(boleto.getIdEmpresa());\n comprobante.setIdUsuarioCreador(boleto.getIdUsuarioCreador());\n comprobante.setTipo(tipo);\n\n //ComprobanteContablePK numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n Integer numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n comprobante.setIdNumeroGestion(numero);\n comprobante.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n\n return comprobante;\n }",
"public String buscarCliente(int cedulaCliente) {\n String mostrar = \"\";\n if (verificarCliente(cedulaCliente)) { //Verifica si el cliente a buscar existe o no, para entrar al for, o retornar un Strign vacio\n for (int i = 0; i < posicionActual; i++) { //Si el cliente existe procede a recorrer el vector.\n if (getCedulaCliente(i) == cedulaCliente) { //Pregunta si el cliente en la poscion actual, es el que se quiere mostrar\n mostrar += mostrarCliente(i); //almacena en el String la informacion del cliente en caso de qie la condicion anterior se cumpla\n }\n }\n }\n return mostrar; //Al final retorna la variable String vacia, si el cliente no existe, o con la informacion de este si esxiste\n }",
"public int getCodigo_producto() {\n return codigo_producto;\n }",
"public ComponenteCosto getComponenteCosto()\r\n/* 68: */ {\r\n/* 69: 91 */ return this.componenteCosto;\r\n/* 70: */ }",
"ProductCatelogueResponse getProduct(int catelogueId,int productId);",
"public Computador getComputador(long codigo)throws Exception{\n\t\tString sql = \"select * from \" + TABELA + \" where codigo=?\";\n\n\t\tPreparedStatement stmt = connection.prepareStatement(sql);\n\n\t\t//setar parametro na query sql\n\t\tstmt.setLong(1, codigo);\n\n\t\tResultSet rs = stmt.executeQuery();\n\n\t\t//se não retornar resultados o objeto não existe no banco de dados\n\t\tif(!rs.first()){\n\t\t\tthrow new Exception(\"Produto com codigo \" +codigo+\" não encontrado no banco\");\n\t\t}\n\n\t\tComputador computador = new Computador();\n\t\tcomputador.setCodigo(rs.getLong(\"codigo\"));\n\t\tcomputador.setDescricao(rs.getString(\"descricao\"));\n\t\tcomputador.setPreco(rs.getFloat(\"preco\"));\n\n\t\treturn computador;\n\t}",
"public comercio portalComercioDatos(int idcomer) {\n comercio o = null;\n try {\n Connection conn = DriverManager.getConnection(CONN, USER, PASS);\n\n PreparedStatement st = conn.prepareStatement(\"select nombre, Informacion, direccion, telefono, redSocial, id_comercio, ruta, id_rubro\\n\"\n + \"from Comercios \\n\"\n + \"where id_comercio = ?\");\n st.setInt(1, idcomer);\n ResultSet rs = st.executeQuery();\n\n if (rs.next()) {\n\n String nombre = rs.getString(1);\n String Informacion = rs.getString(2);\n String direccion = rs.getString(3);\n String telefono = rs.getString(4);\n String redsocial = rs.getString(5);\n int id = rs.getInt(6);\n String imagen= rs.getString(7);\n int idr = rs.getInt(8);\n rubro r = new rubro(idr, \"\", true, \"\", \"\");\n o = new comercio(nombre, direccion, telefono, id, true, Informacion, redsocial, r, imagen);\n\n }\n\n st.close();\n conn.close();\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n return o;\n }",
"long buscarProximo(long id);",
"public abstract String tiposervicio();",
"@Override\r\n\tpublic String llamadaEmergencia(TipoEmergencia te, String provincia) {\n\t\tif(provinciaString.equals(provincia)&&\r\n\t\t\t\t(te.equals(TipoEmergencia.TRAFICO)||te.equals(TipoEmergencia.CASERO)||te.equals(TipoEmergencia.INCENDIO))) {\r\n\t\t\tSystem.out.print(\"##Unidad \"+this.id+\" de Ambulancia en la provincia de \"+this.provinciaString+\" en camino!\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"private prestarComputador obtenerComputador() {\n String d = dFormat.format(TXTFechaDeEntrega.getDate());\n prestarComputador elcomputador = new prestarComputador();\n elcomputador.setFechaDeEntrega(dFormat.format(TXTFechaDeEntrega.getDate()));\n elcomputador.setSerialComputadorDoy(TXTSerialEquipo.getText());\n elcomputador.setIdBibliotecario(TXTIdBibliotecario.getText());\n elcomputador.setIdUsuario(TXTIdUsuario.getText());\n elcomputador.setFechaDePrestamo(TXTFechaDePrestamo.getText());\n return elcomputador;\n }",
"public String RespuestaCliente()\n{\tString Muestra=\"\";\n\t\n\tMuestra+=\"DATOS DEL CLIENTE\\n\"\n\t\t\t+ \"Nombre: \"+getNombre()+\"\\n\"\n\t\t\t+ \"DNI: \"+getDni()+\"\\n\"\n\t\t\t+ \"Salario: �\"+String.format(\"%.1f\",getSalario())+\"\\n\\n\";\n\t\n\treturn Muestra;\n\t\n\t}"
] | [
"0.6218365",
"0.6195868",
"0.6070687",
"0.59163153",
"0.59023184",
"0.5900608",
"0.58797425",
"0.5878309",
"0.58523995",
"0.58352804",
"0.57927245",
"0.576316",
"0.57537204",
"0.5747506",
"0.5727239",
"0.5704286",
"0.5700399",
"0.5694638",
"0.5682588",
"0.56583303",
"0.56426126",
"0.56403476",
"0.559073",
"0.5589754",
"0.5585885",
"0.55821836",
"0.5576308",
"0.5569406",
"0.5553015",
"0.5545459",
"0.5544457",
"0.5532123",
"0.5524712",
"0.5512731",
"0.5508973",
"0.5507545",
"0.5504883",
"0.55045795",
"0.54967445",
"0.549609",
"0.5488353",
"0.5479844",
"0.5466231",
"0.5465159",
"0.54635525",
"0.54584",
"0.5454713",
"0.54478776",
"0.54375774",
"0.5437106",
"0.54345834",
"0.54186064",
"0.54070383",
"0.54058677",
"0.5405665",
"0.54043174",
"0.5403546",
"0.54011744",
"0.53921574",
"0.53917617",
"0.5380387",
"0.5376426",
"0.53749335",
"0.5374706",
"0.5374165",
"0.53674185",
"0.53664774",
"0.536321",
"0.5361683",
"0.5354473",
"0.53523",
"0.5350996",
"0.5350198",
"0.53419113",
"0.5335343",
"0.5335241",
"0.5333698",
"0.53336024",
"0.5326873",
"0.5323973",
"0.530908",
"0.5308698",
"0.53051245",
"0.53049266",
"0.5299406",
"0.5297194",
"0.5296373",
"0.52959645",
"0.52932197",
"0.5292905",
"0.5292799",
"0.5291845",
"0.52885556",
"0.52875084",
"0.5286453",
"0.5282815",
"0.5280171",
"0.5277859",
"0.5275493",
"0.52674806"
] | 0.6112823 | 2 |
A component whose lifetime is the life of the application. | @Singleton // Constraints this component to one-per-application or unscoped bindings.
@Component(modules = ApplicationModule.class)
public interface ApplicationComponent {
// Field injections of any dependencies of the DemoApplication
void inject(FeelingApp application);
//Exposed to sub-graphs.
Application application();
Context context();
SessionManager<TwitterSession> sessionManager();
Retrofit networkManager();
ThreadExecutor threadExecutor();
PostExecutionThread postExecutionThread();
TweetCache tweetCache();
TweetRepository tweetRepository();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AppComponent component(){\n return mComponent;\n }",
"@Singleton\n@Component( modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n //Exposed to sub-graphs\n Context context();\n\n ThreadExecutor threadExecutor();\n\n PostExecutionThread postExecutionThread();\n\n ObserverController observerController();\n\n Bundle parametersFactory();\n\n void inject(DevxitActivityDelegateImpl<DevxitView, DevxitPresenter<DevxitView>> devxitActivityDelegate);\n}",
"@Override\n\t\tpublic boolean isComponentAlive() {\n\t\t\treturn false;\n\t\t}",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n// @ApplicationContext\n// Context context();\n\n Application application();\n\n SharedPrefencesHelper sharedPrefencesHelper();\n\n DataManager dataManager();\n\n G3anService g3anService();\n}",
"public interface AppComponent {\n}",
"protected ApplicationComponent getApplicationComponent() {\n return ((MainApp) getApplication()).getApplicationComponent();\n }",
"public static ApplicationComponent component() {\n return instance().applicationComponent;\n }",
"@Singleton\n@Component(modules = {ApplicationModule.class})\npublic interface ApplicationComponent {\n\n void inject(GoToDream goToDream);\n\n @Named(\"application\")\n Context getContext();\n}",
"public interface App {\n AppComponent getAppComponent();\n}",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n @ApplicationContext\n Context context();\n\n void inject(ZoloApplication zoloApplication);\n\n DataManagerLogic datamangerLogic();\n\n Application application();\n\n}",
"@SingleScope\n@Component(modules = ModuleDatabase.class)\npublic interface SavedComponent {\n WorkWithDatabase getDatabase();\n}",
"@Singleton\n@Component(modules = {ContextModule.class, BusModule.class, GithubModule.class, GankModule.class, ZhiHuModule.class, RssModule.class})\npublic interface AppComponent {\n Context getContext();\n GankService getGankService();\n ZhiHuService getZhiHuService();\n RssService getRssService();\n EventBus getBus();\n}",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface AppComponent {\n\n @ContextLife(\"Application\")\n App getContext(); // 提供App的Context\n\n RetrofitHelper retrofitHelper(); //提供http的帮助类\n\n}",
"@Override\n public void disposeComponent() {\n }",
"@Override\n public void disposeComponent() {\n }",
"@Override\n public void disposeComponent() {\n }",
"@Override\n public void disposeComponent() {\n }",
"@Singleton\n@Component(modules = {AppModule.class})\npublic interface AppComponent {\n\n // Exposing to sub-graphs:\n @ApplicationContext\n Context context();\n\n ServiceClient serviceClient();\n\n void inject(BaseActivity baseActivity);\n}",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface ApplicationComponent {\n\n void inject(ContainerActivity containerActivity);\n}",
"@ApplicationScope\n@Component(modules = {ContextModule.class,ServiceModule.class}) // tell which modules to use in order to generate this instance\npublic interface ApplicationComponent {\n\n\n\n SharedPreferencesClass getSharedPrefs();\n\n RequestManager getGlide();\n\n void injectRepo(ProjectRepository repository);\n\n}",
"@Singleton\n@Component(modules = {AppModule.class, AppClientModule.class})\npublic interface AppComponent {\n Application getApplication();\n MainViewInteraction getWeatherInteractor();\n}",
"public Component getComponent() {\n\treturn component;\n}",
"@ActivityScope\n@Component(modules = {ActivityModule.class,ContextModule.class})\npublic interface ActivityComponent {\n Context getContext();\n\n Lifecycle getLifecycle();\n\n Activity getActivity();\n\n FragmentManager getFragmentManager();\n\n DaoSession getDaoSession();\n}",
"@Singleton\n@Component(modules = ImeiMainModule.class)\npublic interface ImeiMainComponent {\n void inject(ImeiAplication app);\n\n //Exposed to sub-graphs.\n ImeiAplication app();\n}",
"@Key(\"application.component\")\n\tString applicationComponent();",
"@Override\r\n public void disposeComponent() {\n }",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n// void inject(BaseActivity baseActivity);\n\n // provide\n Context getContext();\n RxBus getRxBus();\n DaoSession getDaoSession();\n}",
"@Singleton\n@Component(modules = {MainModule.class})\npublic interface MainComponent {\n Context context();\n\n NYTimesService nYTimesService();\n void inject(NYTimesActivity nyTimesActivity);\n}",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n void inject(MvpApp app);\n Application application();\n\n DataManager getDataManager();\n\n}",
"@Singleton\n@Component(modules = ObscuredModule.class)\npublic interface ObscuredComponent {\n}",
"public Component getComponent() {\n return component;\n }",
"Component getComponent() {\n/* 224 */ return this.component;\n/* */ }",
"public Component() {\n }",
"@Singleton @Component(modules = {ApplicationModule.class, ApiModule.class})\npublic interface ApplicationComponent {\n Context getContext();\n Bus getBus();\n TRApi getTRApi();\n\n void inject(ZhihuApplication zhihuApplication);\n\n void inject(BaseNewActivity baseNewActivity);\n}",
"@Singleton\n@Component(modules = {AppModule.class})\npublic interface AppComponent {\n Context getContext();\n CommonUtil getComminUtil();\n}",
"public interface ApplicationComponent extends CloudApplication {\n}",
"Component createComponent();",
"Component createComponent();",
"@PerActivity\n@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)\npublic interface ActivityComponent {\n\n @ContextLife(\"Activity\")\n Context getActivityContext();\n\n @ContextLife(\"Application\")\n Context getApplicationContext();\n\n Activity getActivity();\n\n void inject(MainActivity mainActivity);\n}",
"@Singleton\n@Component(modules = {NetworkModule.class, SubcomponentsModule.class})\npublic interface ApplicationComponent {\n /**\n * This function exposes the HomeComponent Factory out of the graph so consumers\n * can use it to obtain new instances of HomeComponent.\n *\n * @return {@link HomeComponent.Factory}\n */\n HomeComponent.Factory homeComponent();\n}",
"@Singleton\n@Component\npublic interface FactoryActivityComponent {\n void inject(FactoryActivity activity);\n}",
"@ApplicationScope\n@Component(\n dependencies = DataServiceComponent.class,\n modules = {\n DataManagerModule.class\n }\n)\npublic interface DataManagerComponent {\n DataManager dataManager();\n void inject(MainActivity activity);\n}",
"public ComponentsFactory() {\n\t\tsuper();\n\t}",
"public Component getSelf(ExecutionCtrl exec);",
"@Singleton // Constraints this component to one-per-application or unscoped bindings.\n@Component(modules = {\n ApplicationModule.class,\n HomeModule.class\n})\npublic interface ApplicationComponent {\n\n /**\n * Field injections of any dependencies of the app\n *\n * @param mainActivity activity for which dependencies must be satisfied.\n */\n void inject(MainActivity mainActivity);\n\n /**\n * Field injections of any dependencies of the app\n *\n * @param homeView dashboardView for which dependencies must be satisfied.\n */\n void inject(HomeView homeView);\n}",
"@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n Context getApplication();\n}",
"public ExampleComponent(Component parent) {\n super(parent);\n }",
"ComponentContainer container(ContextDefinition context);",
"@ActivityScope\n@Component(\n dependencies = AppComponent.class,\n modules = ActivityModule.class\n)\npublic interface ActivityComponent {\n\n // Expose the activity to sub-graphs.\n Activity activity();\n}",
"@Singleton\n@Component(modules = {AndroidInjectionModule.class, ApplicationModule.class, ActivitiesModule.class, NetworkModule.class, DatabaseModule.class})\npublic interface ApplicationComponent {\n\n void inject(SchoolsApplication schoolsApplication);\n}",
"public GUICarsApp() {\n initComponents();\n \n aList = new ArrayList<Object>();\n }",
"@Singleton\n@Component(modules = {PopularMoviesInjectionModule.class})\npublic interface PopularMoviesApplicationComponent {\n\n Context context();\n\n void inject(MovieDetailsActivity activity);\n\n void inject(MovieGridFragment fragment);\n\n void inject(FavoriteMoviesContentProvider contentProvider);\n}",
"@Override\n public void componentOpened() {\n }",
"protected final Component getComponent()\n\t{\n\t\treturn component;\n\t}",
"@ActivityScope\n@Component(modules = MainModule.class, dependencies = ApplicationComponent.class)\npublic interface MainComponent {\n\n void inject(MainActivity mainActivity);\n\n}",
"public IntroducereDisponibiltate() {\n initComponents();\n \n \n \n \n }",
"@Singleton\n@Component(\n modules = {\n AppModule.class,\n DataModule.class,\n InfoModule.class,\n FlavorModule.class\n }\n)\npublic interface AppComponent {\n\n void inject(HardwiredApp app);\n void inject(AddComputerDialog dialog);\n void inject(ComputerRecyclerAdapter adapter);\n\n DirectoryComponent plus(DirectoryModule module);\n DetailComponent plus(DetailModule module);\n}",
"@SuppressWarnings(\"unused\")\n@Singleton\n@Component(modules = {ApplicationModule.class})\npublic interface ApplicationComponent {\n void inject(DIApplication application);\n\n void inject(BaseActivity activity);\n void inject(BaseFragment fragment);\n\n void inject(DogSyncService service);\n}",
"public interface CustomApplication {\n ComponentBuilder builder();\n}",
"@ForApplication\n@Component(modules = {AppModule.class, NetworkModule.class})\npublic interface AppComponent {\n Context appContext();\n Resources resources();\n PreferencesHelper preferencesHelper();\n void inject(NewsPresenter newsPresenter);\n void inject(FeedStorage feedStorage);\n}",
"@Override\n public void componentOpened() {\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\n public void componentOpened() {\n }",
"@Override\n public void componentOpened() {\n }",
"@ActivityScope\n@Component(modules = {ManagersModule.class, PresentersActivityModule.class},\n dependencies = ApplicationComponent.class)\npublic interface ActivityComponent extends ApplicationComponent{\n\n DefaultInteractor<MainModel> MAIN_MODEL_DEFAULT_INTERACTOR();\n\n DefaultInteractor<ListModel> LIST_MODEL_DEFAULT_INTERACTOR();\n\n DefaultInteractor<DetailModel> DETAIL_MODEL_DEFAULT_INTERACTOR();\n\n BaseFragmentsManager providesListFragmentManager();\n\n BasePresenter<MainActivity, MainModel> BASE_MAIN_PRESENTER();\n\n void inject(MainActivity activity);\n\n}",
"public InjectingComponentType() {\n }",
"@Singleton\n@Component(modules = {NetModule.class})\npublic interface ApplicationComponent {\n void inject(MoviesActivity moviesActivity);\n}",
"private void initcomponent() {\n\r\n\t}",
"public ProcessProvider getComponent() {\n return component;\n }",
"@PerActivity\n@Component(dependencies = { ApplicationComponent.class }, modules = { AccountsModule.class })\npublic interface SplashComponent {\n AccountsManager provideAccountsManager();\n\n void inject(SplashActivity splashActivity);\n\n class Injector {\n static WeakReference<SplashComponent> componentWeakReference;\n\n public static void setSplashComponent(SplashComponent splashComponent) {\n componentWeakReference = new WeakReference<>(splashComponent);\n }\n\n public static SplashComponent getSplashComponent(Context context) {\n if (componentWeakReference == null || componentWeakReference.get() == null) {\n SplashComponent splashComponent = DaggerSplashComponent.builder()\n .applicationComponent(applicationComponent(context))\n .build();\n componentWeakReference = new WeakReference<>(splashComponent);\n }\n return componentWeakReference.get();\n }\n }\n}",
"@Singleton\n@Component(modules = {VehicleModule.class})\npublic interface VehicleComponent {\n Vehicle provideVehicle();\n}",
"@ActivityScope\n@Component(modules = MainModule.class, dependencies = AppComponent.class)\npublic interface MainComponent {\n\n void inject(MainActivity mainActivity);\n}",
"@ActivityScope\n@Subcomponent(modules = MainModule.class)\npublic interface MainComponent {\n\n void inject(MainActivity activity);\n\n\n}",
"public Memory.Component<SharedMemory> newComponent() {\r\n return this._newComponent(new Memory.Requires<SharedMemory>() {}, true);\r\n }",
"public interface DomainBuilderComponent extends PropertyChangeListener {\n\t/**\n\t * get name of the component\n\t * @return\n\t */\n\tpublic String getName();\n\t\n\t/**\n\t * get icon for the component\n\t * @return\n\t */\n\tpublic Icon getIcon();\n\t\n\t\n\t/**\n\t * get component\n\t * @return\n\t */\n\tpublic Component getComponent();\n\t\n\t\n\t/**\n\t * get menu bar\n\t * @return\n\t */\n\tpublic JMenuBar getMenuBar();\n\t\n\t\n\t/**\n\t * load whatever resources one needs to get this piece working \n\t */\n\tpublic void load();\n\t\n\t/**\n\t * dispose of this component\n\t */\n\tpublic void dispose();\n}",
"public abstract void lifeCycle();",
"@ActivityScope\n@Component(modules = AlarmModule.class,dependencies = AppComponent.class)\npublic interface AlarmComponent {\n AlarmActivity inject(AlarmActivity alarmActivity);\n}",
"public ClientApp()\n\t{\n\t\tinitComponents();\n\t\tafterInitComponents();\n\t}",
"@Singleton\n@Component(modules = {AppModule.class})\npublic interface BasicComponent {\n\tvoid inject(AddContactActivity addContactActivity);\n\tvoid inject(MainActivity mainActivity);\n\tvoid inject (MainActivityFragment mainActivityFragment);\n\tvoid inject (HandleClickFromRecyclerContactsModel handleClickFromRecyclerContactsModel);\n}",
"public interface IComponentDestroy {\n Destroyed onComponentDestroyed();\n}",
"public App() {\n\t\tLog.d(\"App\", \"App created\");\n\t\tinstance = this;\n\t}",
"@Singleton\n@Component(modules = UserModule.class, dependencies = FlowerComponent.class)\npublic interface UserComponent {\n User getUser();\n}",
"@Override\n public void initComponent() {\n }",
"@Override\n public void initComponent() {\n }",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface AppComponent {\n\n GeekZoneApplication getApplication();\n\n LocalDataSourceManager getLocalDataSourceManager();\n\n RemoteDataSourceManager getRemoteDataSourceManager();\n}",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface AppComponent {\n void inject(App app);\n}",
"public void initializeInstance() {\n instanceLife = new Timer();\n }",
"public JawbComponent getMainComponent () {\n return null;\n }",
"@Override\n public void componentClosed() {\n }",
"public Lifetime getLifetime() {\n return this.lifetime;\n }",
"@Override\n public void componentOpened() {\n MemoryManager.addMemoryManagerListener(this);\n updateObjectCounts();\n }",
"@Singleton\n@Component(\n modules = {\n AppModule.class,\n ObjectBoxModule.class\n })\npublic interface AppComponent {\n void inject(ToDoListActivity activity);\n void inject(TaskEditorActivity activity);\n //void inject(ICommonRepository repository);\n //ICommonRepository repo();\n}",
"@Singleton\n@Component(modules = {AppModule.class, ConfigModule.class})\npublic interface AppComponent {\n\n Application application();\n\n RepositoryManager repositoryManager();\n\n RxLifecycleManager rxLifecycleManager();\n\n HttpClientHandler httpErrorHandler();\n\n AppManager appManager();\n\n OkHttpClient provideClient();\n\n void inject(AppDelegate delegate);\n\n @Component.Builder\n interface Builder {\n\n @BindsInstance\n Builder application(Application application);\n\n @BindsInstance\n Builder appDelegate(AppDelegate appDelegate);\n\n Builder configModule(ConfigModule configModule);\n\n AppComponent build();\n }\n}",
"@Singleton\n@Component(modules = ListModule.class)\npublic interface ListComponent {\n void inject(HomeActivity activity);\n}",
"public static UILApplication getInstance() {\n\t\treturn instance;\n\t}",
"@Override\n public void componentClosed() {\n }",
"@Override\n public void componentClosed() {\n }",
"@Override\n public void componentClosed() {\n }",
"@Override\n public void componentClosed() {\n }",
"@Override\n public void componentClosed() {\n }"
] | [
"0.6692922",
"0.65639746",
"0.647201",
"0.6398093",
"0.6315624",
"0.6306805",
"0.6265365",
"0.62042046",
"0.6174704",
"0.6134741",
"0.60497403",
"0.60382193",
"0.6022862",
"0.5998089",
"0.5998089",
"0.5998089",
"0.5998089",
"0.59979105",
"0.5984122",
"0.59684795",
"0.596813",
"0.5966841",
"0.59643275",
"0.59627324",
"0.5928773",
"0.5926646",
"0.5902039",
"0.58711314",
"0.58685297",
"0.5865945",
"0.5861666",
"0.5856381",
"0.58463967",
"0.58170855",
"0.58101577",
"0.5805992",
"0.5794997",
"0.5794997",
"0.5786428",
"0.5772729",
"0.57680386",
"0.57412404",
"0.57294875",
"0.5728141",
"0.5724555",
"0.57059777",
"0.57012576",
"0.5699019",
"0.569075",
"0.5688116",
"0.5684555",
"0.56629276",
"0.5646179",
"0.5637275",
"0.5634983",
"0.56333333",
"0.56295997",
"0.56285834",
"0.5624748",
"0.5624544",
"0.5623013",
"0.5623013",
"0.5623013",
"0.5623013",
"0.56055105",
"0.5595284",
"0.5594018",
"0.5586895",
"0.5585569",
"0.55847",
"0.55786914",
"0.5578164",
"0.5572471",
"0.5570087",
"0.55585724",
"0.55558234",
"0.5549927",
"0.5532393",
"0.5527771",
"0.55268085",
"0.5523729",
"0.5523577",
"0.55233544",
"0.55233544",
"0.5514422",
"0.55018353",
"0.55013055",
"0.549537",
"0.5488311",
"0.54872954",
"0.54830074",
"0.54784626",
"0.54770565",
"0.5464783",
"0.54642326",
"0.54609585",
"0.54609585",
"0.54609585",
"0.54609585",
"0.54609585"
] | 0.6160474 | 9 |
Field injections of any dependencies of the DemoApplication | void inject(FeelingApp application); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void inject(BaseApplication application);",
"void inject(MyMoneyApplication myMoneyApplication);",
"private void setup(){\n\n // menginisialisasi variabel component\n component = DaggerApplicationComponent.builder()\n .applicationModule(new ApplicationModule(this)).build();\n\n // memanggil fungsi inject\n component.inject(this);\n }",
"private void inject() {\n }",
"protected abstract void injectDependencies(ApplicationComponent applicationComponent);",
"@Singleton\n@Component(modules = {PopularMoviesInjectionModule.class})\npublic interface PopularMoviesApplicationComponent {\n\n Context context();\n\n void inject(MovieDetailsActivity activity);\n\n void inject(MovieGridFragment fragment);\n\n void inject(FavoriteMoviesContentProvider contentProvider);\n}",
"@Component(\n modules = {\n ComputerModule.class,\n AccessoriesModule.class,\n DrinksModule.class\n }\n)\npublic interface DemoComponent {\n\n Programmer programmer();\n void inject(MainActivity activity);\n\n}",
"@ApplicationScope\n@Component(modules = {ContextModule.class,ServiceModule.class}) // tell which modules to use in order to generate this instance\npublic interface ApplicationComponent {\n\n\n\n SharedPreferencesClass getSharedPrefs();\n\n RequestManager getGlide();\n\n void injectRepo(ProjectRepository repository);\n\n}",
"@Override\n protected void injectDependencies(Context context) {\n }",
"private final void inject() {\n }",
"@Singleton\n@Component(modules = {ModelModule.class, PresenterModule.class})\npublic interface AppComponent {\n void inject(ModelImpl dataRepository);\n\n void inject(BasePresenter basePresenter);\n\n void inject(PresenterSearch presenterSearch);\n\n void inject(FavouriteActivity favouriteActivity);\n}",
"@Singleton\n@Component(\n modules = {\n AppModule.class,\n ObjectBoxModule.class\n })\npublic interface AppComponent {\n void inject(ToDoListActivity activity);\n void inject(TaskEditorActivity activity);\n //void inject(ICommonRepository repository);\n //ICommonRepository repo();\n}",
"@Singleton\n@Component(modules = {AppModule.class, NetworkModule.class,PresenterModule.class})\npublic interface AppComponent {\n\n // void inject(DisplayMovieActivity displayMovieActivity );\n\n //register main activity it will need objects for injection\n void inject(MoviesListFragment moviesListFragment);\n\n //register MainPresenter it will need objects for injection\n void inject(MoviesListPresenter moviesListPresenter);\n\n void inject(MoviesDetailsFragment moviesDetailsFragment);\n void inject(MoviesDetailsPresenter moviesDetailsPresenter);\n\n\n}",
"@Singleton\n@Component(modules = {AndroidInjectionModule.class, ApplicationModule.class, ActivitiesModule.class, NetworkModule.class, DatabaseModule.class})\npublic interface ApplicationComponent {\n\n void inject(SchoolsApplication schoolsApplication);\n}",
"public static void initializeDiContainer() {\n addDependency(new CamelCaseConverter());\n addDependency(new JavadocGenerator());\n addDependency(new TemplateResolver());\n addDependency(new PreferenceStoreProvider());\n addDependency(new CurrentShellProvider());\n addDependency(new ITypeExtractor());\n addDependency(new DialogWrapper(getDependency(CurrentShellProvider.class)));\n addDependency(new PreferencesManager(getDependency(PreferenceStoreProvider.class)));\n addDependency(new ErrorHandlerHook(getDependency(DialogWrapper.class)));\n\n addDependency(new BodyDeclarationOfTypeExtractor());\n addDependency(new GeneratedAnnotationPredicate());\n addDependency(new GenericModifierPredicate());\n addDependency(new IsPrivatePredicate(getDependency(GenericModifierPredicate.class)));\n addDependency(new IsStaticPredicate(getDependency(GenericModifierPredicate.class)));\n addDependency(new IsPublicPredicate(getDependency(GenericModifierPredicate.class)));\n addDependency(new GeneratedAnnotationContainingBodyDeclarationFilter(getDependency(GeneratedAnnotationPredicate.class)));\n addDependency(new PrivateConstructorRemover(getDependency(IsPrivatePredicate.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class)));\n addDependency(new BodyDeclarationOfTypeExtractor());\n addDependency(new BuilderClassRemover(getDependency(BodyDeclarationOfTypeExtractor.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class),\n getDependency(IsPrivatePredicate.class),\n getDependency(IsStaticPredicate.class),\n getDependency(PreferencesManager.class)));\n addDependency(new JsonDeserializeRemover(getDependency(PreferencesManager.class)));\n addDependency(new StagedBuilderInterfaceRemover(getDependency(BodyDeclarationOfTypeExtractor.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class)));\n addDependency(new StaticBuilderMethodRemover(getDependency(IsStaticPredicate.class), getDependency(IsPublicPredicate.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class)));\n addDependency(new BuilderAstRemover(getDependencyList(BuilderRemoverChainItem.class)));\n\n addDependency(new BuilderRemover(getDependency(PreferencesManager.class), getDependency(ErrorHandlerHook.class),\n getDependency(BuilderAstRemover.class)));\n addDependency(new CompilationUnitSourceSetter());\n addDependency(new HandlerUtilWrapper());\n addDependency(new WorkingCopyManager());\n addDependency(new WorkingCopyManagerWrapper(getDependency(HandlerUtilWrapper.class)));\n addDependency(new CompilationUnitParser());\n addDependency(new GeneratedAnnotationPopulator(getDependency(PreferencesManager.class)));\n addDependency(new MarkerAnnotationAttacher());\n addDependency(new ImportRepository());\n addDependency(new ImportPopulator(getDependency(PreferencesManager.class), getDependency(ImportRepository.class)));\n addDependency(new BuilderMethodNameBuilder(getDependency(CamelCaseConverter.class),\n getDependency(PreferencesManager.class),\n getDependency(TemplateResolver.class)));\n addDependency(new PrivateConstructorAdderFragment());\n addDependency(new JsonPOJOBuilderAdderFragment(getDependency(PreferencesManager.class), getDependency(ImportRepository.class)));\n addDependency(new EmptyBuilderClassGeneratorFragment(getDependency(GeneratedAnnotationPopulator.class),\n getDependency(PreferencesManager.class),\n getDependency(JavadocGenerator.class),\n getDependency(TemplateResolver.class),\n getDependency(JsonPOJOBuilderAdderFragment.class)));\n addDependency(new BuildMethodBodyCreatorFragment());\n addDependency(new BuildMethodDeclarationCreatorFragment(getDependency(PreferencesManager.class),\n getDependency(MarkerAnnotationAttacher.class),\n getDependency(TemplateResolver.class)));\n addDependency(new JavadocAdder(getDependency(JavadocGenerator.class), getDependency(PreferencesManager.class)));\n addDependency(new BuildMethodCreatorFragment(getDependency(BuildMethodDeclarationCreatorFragment.class),\n getDependency(BuildMethodBodyCreatorFragment.class)));\n addDependency(new FullyQualifiedNameExtractor());\n addDependency(new StaticMethodInvocationFragment());\n addDependency(new OptionalInitializerChainItem(getDependency(StaticMethodInvocationFragment.class), getDependency(PreferencesManager.class)));\n addDependency(new BuiltInCollectionsInitializerChainitem(getDependency(StaticMethodInvocationFragment.class), getDependency(PreferencesManager.class)));\n addDependency(new FieldDeclarationPostProcessor(getDependency(PreferencesManager.class), getDependency(FullyQualifiedNameExtractor.class),\n getDependency(ImportRepository.class), getDependencyList(FieldDeclarationPostProcessorChainItem.class)));\n addDependency(new BuilderFieldAdderFragment(getDependency(FieldDeclarationPostProcessor.class)));\n addDependency(new WithMethodParameterCreatorFragment(getDependency(PreferencesManager.class), getDependency(MarkerAnnotationAttacher.class)));\n addDependency(new RegularBuilderWithMethodAdderFragment(getDependency(PreferencesManager.class),\n getDependency(JavadocAdder.class),\n getDependency(MarkerAnnotationAttacher.class),\n getDependency(BuilderMethodNameBuilder.class),\n getDependency(WithMethodParameterCreatorFragment.class)));\n addDependency(new BuilderFieldAccessCreatorFragment());\n addDependency(new TypeDeclarationToVariableNameConverter(getDependency(CamelCaseConverter.class)));\n addDependency(new FieldSetterAdderFragment(getDependency(BuilderFieldAccessCreatorFragment.class)));\n addDependency(new IsRegularBuilderInstanceCopyEnabledPredicate(getDependency(PreferencesManager.class)));\n addDependency(new RegularBuilderCopyInstanceConstructorAdderFragment(getDependency(TypeDeclarationToVariableNameConverter.class),\n getDependency(IsRegularBuilderInstanceCopyEnabledPredicate.class)));\n addDependency(new PublicConstructorWithMandatoryFieldsAdderFragment());\n addDependency(new RegularBuilderClassCreator(getDependency(PrivateConstructorAdderFragment.class),\n getDependency(EmptyBuilderClassGeneratorFragment.class),\n getDependency(BuildMethodCreatorFragment.class),\n getDependency(BuilderFieldAdderFragment.class),\n getDependency(RegularBuilderWithMethodAdderFragment.class),\n getDependency(JavadocAdder.class),\n getDependency(RegularBuilderCopyInstanceConstructorAdderFragment.class),\n getDependency(PublicConstructorWithMandatoryFieldsAdderFragment.class)));\n addDependency(new StaticBuilderMethodSignatureGeneratorFragment(getDependency(GeneratedAnnotationPopulator.class), getDependency(PreferencesManager.class)));\n addDependency(new BuilderMethodDefinitionCreatorFragment(getDependency(TemplateResolver.class),\n getDependency(PreferencesManager.class),\n getDependency(JavadocAdder.class), getDependency(StaticBuilderMethodSignatureGeneratorFragment.class)));\n addDependency(new BlockWithNewBuilderCreationFragment());\n addDependency(\n new RegularBuilderBuilderMethodCreator(getDependency(BlockWithNewBuilderCreationFragment.class),\n getDependency(BuilderMethodDefinitionCreatorFragment.class)));\n addDependency(new PrivateConstructorMethodDefinitionCreationFragment(getDependency(PreferencesManager.class),\n getDependency(GeneratedAnnotationPopulator.class),\n getDependency(CamelCaseConverter.class)));\n addDependency(new SuperFieldSetterMethodAdderFragment(getDependency(BuilderFieldAccessCreatorFragment.class)));\n addDependency(new PrivateConstructorBodyCreationFragment(getDependency(TypeDeclarationToVariableNameConverter.class),\n getDependency(FieldSetterAdderFragment.class),\n getDependency(BuilderFieldAccessCreatorFragment.class),\n getDependency(SuperFieldSetterMethodAdderFragment.class)));\n addDependency(new ConstructorInsertionFragment());\n addDependency(new PrivateInitializingConstructorCreator(\n getDependency(PrivateConstructorMethodDefinitionCreationFragment.class),\n getDependency(PrivateConstructorBodyCreationFragment.class),\n getDependency(ConstructorInsertionFragment.class)));\n addDependency(new FieldPrefixSuffixPreferenceProvider(getDependency(PreferenceStoreProvider.class)));\n addDependency(new FieldNameToBuilderFieldNameConverter(getDependency(PreferencesManager.class),\n getDependency(FieldPrefixSuffixPreferenceProvider.class),\n getDependency(CamelCaseConverter.class)));\n addDependency(new TypeDeclarationFromSuperclassExtractor(getDependency(CompilationUnitParser.class),\n getDependency(ITypeExtractor.class)));\n addDependency(new BodyDeclarationVisibleFromPredicate());\n addDependency(new ApplicableFieldVisibilityFilter(getDependency(BodyDeclarationVisibleFromPredicate.class)));\n addDependency(new ClassFieldCollector(getDependency(FieldNameToBuilderFieldNameConverter.class),\n getDependency(PreferencesManager.class), getDependency(TypeDeclarationFromSuperclassExtractor.class),\n getDependency(ApplicableFieldVisibilityFilter.class)));\n addDependency(new RecordFieldCollector(getDependency(FieldNameToBuilderFieldNameConverter.class)));\n addDependency(new BodyDeclarationFinderUtil(getDependency(CamelCaseConverter.class)));\n addDependency(new SuperConstructorParameterCollector(getDependency(FieldNameToBuilderFieldNameConverter.class),\n getDependency(PreferencesManager.class), getDependency(TypeDeclarationFromSuperclassExtractor.class),\n getDependency(BodyDeclarationVisibleFromPredicate.class),\n getDependency(BodyDeclarationFinderUtil.class)));\n addDependency(new SuperClassSetterFieldCollector(getDependency(PreferencesManager.class),\n getDependency(TypeDeclarationFromSuperclassExtractor.class),\n getDependency(CamelCaseConverter.class),\n getDependency(BodyDeclarationFinderUtil.class)));\n addDependency(new ApplicableBuilderFieldExtractor(Arrays.asList(\n getDependency(SuperConstructorParameterCollector.class),\n getDependency(ClassFieldCollector.class),\n getDependency(SuperClassSetterFieldCollector.class),\n getDependency(RecordFieldCollector.class))));\n addDependency(new ActiveJavaEditorOffsetProvider());\n addDependency(new ParentITypeExtractor());\n addDependency(new IsTypeApplicableForBuilderGenerationPredicate(getDependency(ParentITypeExtractor.class)));\n addDependency(new CurrentlySelectedApplicableClassesClassNameProvider(getDependency(ActiveJavaEditorOffsetProvider.class),\n getDependency(IsTypeApplicableForBuilderGenerationPredicate.class),\n getDependency(ParentITypeExtractor.class)));\n addDependency(new BuilderOwnerClassFinder(getDependency(CurrentlySelectedApplicableClassesClassNameProvider.class),\n getDependency(PreferencesManager.class), getDependency(GeneratedAnnotationPredicate.class)));\n addDependency(new BlockWithNewCopyInstanceConstructorCreationFragment());\n addDependency(new CopyInstanceBuilderMethodDefinitionCreatorFragment(getDependency(TemplateResolver.class),\n getDependency(PreferencesManager.class),\n getDependency(JavadocAdder.class), getDependency(StaticBuilderMethodSignatureGeneratorFragment.class)));\n addDependency(new RegularBuilderCopyInstanceBuilderMethodCreator(getDependency(BlockWithNewCopyInstanceConstructorCreationFragment.class),\n getDependency(CopyInstanceBuilderMethodDefinitionCreatorFragment.class),\n getDependency(TypeDeclarationToVariableNameConverter.class),\n getDependency(IsRegularBuilderInstanceCopyEnabledPredicate.class)));\n addDependency(new JsonDeserializeAdder(getDependency(ImportRepository.class)));\n addDependency(new GlobalBuilderPostProcessor(getDependency(PreferencesManager.class), getDependency(JsonDeserializeAdder.class)));\n addDependency(new DefaultConstructorAppender(getDependency(ConstructorInsertionFragment.class), getDependency(PreferencesManager.class),\n getDependency(GeneratedAnnotationPopulator.class)));\n addDependency(new RegularBuilderCompilationUnitGenerator(getDependency(RegularBuilderClassCreator.class),\n getDependency(RegularBuilderCopyInstanceBuilderMethodCreator.class),\n getDependency(PrivateInitializingConstructorCreator.class),\n getDependency(RegularBuilderBuilderMethodCreator.class), getDependency(ImportPopulator.class),\n getDependency(BuilderRemover.class),\n getDependency(GlobalBuilderPostProcessor.class),\n getDependency(DefaultConstructorAppender.class)));\n addDependency(new RegularBuilderUserPreferenceDialogOpener(getDependency(CurrentShellProvider.class)));\n addDependency(new RegularBuilderDialogDataConverter());\n addDependency(new RegularBuilderUserPreferenceConverter(getDependency(PreferencesManager.class)));\n addDependency(new RegularBuilderUserPreferenceProvider(getDependency(RegularBuilderUserPreferenceDialogOpener.class),\n getDependency(PreferencesManager.class),\n getDependency(RegularBuilderDialogDataConverter.class),\n getDependency(RegularBuilderUserPreferenceConverter.class)));\n addDependency(new RegularBuilderCompilationUnitGeneratorBuilderFieldCollectingDecorator(getDependency(ApplicableBuilderFieldExtractor.class),\n getDependency(RegularBuilderCompilationUnitGenerator.class),\n getDependency(RegularBuilderUserPreferenceProvider.class)));\n addDependency(new IsEventOnJavaFilePredicate(getDependency(HandlerUtilWrapper.class)));\n\n // staged builder dependencies\n addDependency(new StagedBuilderInterfaceNameProvider(getDependency(PreferencesManager.class),\n getDependency(CamelCaseConverter.class),\n getDependency(TemplateResolver.class)));\n addDependency(new StagedBuilderWithMethodDefiniationCreatorFragment(getDependency(PreferencesManager.class),\n getDependency(BuilderMethodNameBuilder.class),\n getDependency(MarkerAnnotationAttacher.class),\n getDependency(StagedBuilderInterfaceNameProvider.class),\n getDependency(WithMethodParameterCreatorFragment.class)));\n addDependency(new StagedBuilderInterfaceTypeDefinitionCreatorFragment(getDependency(JavadocAdder.class)));\n addDependency(new StagedBuilderInterfaceCreatorFragment(getDependency(StagedBuilderWithMethodDefiniationCreatorFragment.class),\n getDependency(StagedBuilderInterfaceTypeDefinitionCreatorFragment.class),\n getDependency(StagedBuilderInterfaceTypeDefinitionCreatorFragment.class),\n getDependency(BuildMethodDeclarationCreatorFragment.class),\n getDependency(JavadocAdder.class),\n getDependency(GeneratedAnnotationPopulator.class)));\n addDependency(new StagedBuilderCreationBuilderMethodAdder(getDependency(BlockWithNewBuilderCreationFragment.class),\n getDependency(BuilderMethodDefinitionCreatorFragment.class)));\n addDependency(new NewBuilderAndWithMethodCallCreationFragment());\n addDependency(new StagedBuilderCreationWithMethodAdder(getDependency(StagedBuilderWithMethodDefiniationCreatorFragment.class),\n getDependency(NewBuilderAndWithMethodCallCreationFragment.class), getDependency(JavadocAdder.class)));\n addDependency(new StagedBuilderStaticBuilderCreatorMethodCreator(getDependency(StagedBuilderCreationBuilderMethodAdder.class),\n getDependency(StagedBuilderCreationWithMethodAdder.class),\n getDependency(PreferencesManager.class)));\n addDependency(new StagedBuilderWithMethodAdderFragment(\n getDependency(StagedBuilderWithMethodDefiniationCreatorFragment.class),\n getDependency(MarkerAnnotationAttacher.class)));\n addDependency(new InterfaceSetter());\n addDependency(new StagedBuilderClassCreator(getDependency(PrivateConstructorAdderFragment.class),\n getDependency(EmptyBuilderClassGeneratorFragment.class),\n getDependency(BuildMethodCreatorFragment.class),\n getDependency(BuilderFieldAdderFragment.class),\n getDependency(StagedBuilderWithMethodAdderFragment.class),\n getDependency(InterfaceSetter.class),\n getDependency(MarkerAnnotationAttacher.class)));\n addDependency(new StagedBuilderStagePropertyInputDialogOpener(getDependency(CurrentShellProvider.class)));\n addDependency(new StagedBuilderStagePropertiesProvider(getDependency(StagedBuilderInterfaceNameProvider.class),\n getDependency(StagedBuilderStagePropertyInputDialogOpener.class)));\n addDependency(new StagedBuilderCompilationUnitGenerator(getDependency(StagedBuilderClassCreator.class),\n getDependency(PrivateInitializingConstructorCreator.class),\n getDependency(StagedBuilderStaticBuilderCreatorMethodCreator.class),\n getDependency(ImportPopulator.class),\n getDependency(StagedBuilderInterfaceCreatorFragment.class),\n getDependency(BuilderRemover.class),\n getDependency(GlobalBuilderPostProcessor.class),\n getDependency(DefaultConstructorAppender.class)));\n addDependency(new StagedBuilderCompilationUnitGeneratorFieldCollectorDecorator(\n getDependency(StagedBuilderCompilationUnitGenerator.class),\n getDependency(ApplicableBuilderFieldExtractor.class),\n getDependency(StagedBuilderStagePropertiesProvider.class)));\n\n // Generator chain\n addDependency(new GenerateBuilderExecutorImpl(getDependency(CompilationUnitParser.class),\n getDependencyList(BuilderCompilationUnitGenerator.class),\n getDependency(IsEventOnJavaFilePredicate.class), getDependency(WorkingCopyManagerWrapper.class),\n getDependency(CompilationUnitSourceSetter.class),\n getDependency(ErrorHandlerHook.class),\n getDependency(BuilderOwnerClassFinder.class)));\n addDependency(new GenerateBuilderHandlerErrorHandlerDecorator(getDependency(GenerateBuilderExecutorImpl.class),\n getDependency(ErrorHandlerHook.class)));\n addDependency(new StatefulBeanHandler(getDependency(PreferenceStoreProvider.class),\n getDependency(WorkingCopyManagerWrapper.class), getDependency(ImportRepository.class)));\n addDependency(\n new StateInitializerGenerateBuilderExecutorDecorator(\n getDependency(GenerateBuilderHandlerErrorHandlerDecorator.class),\n getDependency(StatefulBeanHandler.class)));\n }",
"void inject(MainActivity activity);",
"@Singleton\n@Component(modules = {AppModule.class, AppClientModule.class})\npublic interface AppComponent {\n Application getApplication();\n MainViewInteraction getWeatherInteractor();\n}",
"@Singleton\n@Component(modules = {AppModule.class})\npublic interface AppComponent {\n void inject(MovieListPresenter movieListPresenter);\n}",
"@Singleton // Constraints this component to one-per-application or unscoped bindings.\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n // Field injections of any dependencies of the DemoApplication\n void inject(FeelingApp application);\n\n //Exposed to sub-graphs.\n Application application();\n Context context();\n SessionManager<TwitterSession> sessionManager();\n Retrofit networkManager();\n ThreadExecutor threadExecutor();\n PostExecutionThread postExecutionThread();\n TweetCache tweetCache();\n TweetRepository tweetRepository();\n\n}",
"@Singleton\n@Component(modules = {\n ApplicationModule.class,\n PreferenceModule.class,\n NetworkModule.class,\n ServiceModule.class\n})\npublic interface DiComponent {\n void inject(MainActivity activity);\n}",
"@GinModules(MyAppGinModule.class)\npublic interface MyAppGinjector extends Ginjector {\n\n String ANNOTATED_STRING_VALUE = \"abc\";\n\n MyApp getMyApp();\n\n SimpleObject getSimple();\n\n MyService getMyService();\n\n MyServiceImpl getMyServiceImpl();\n\n MyProvided getMyProvided();\n\n @Named(\"blue\") SimpleObject getSimpleBlue();\n @Named(\"red\") SimpleObject getSimpleRed();\n\n EagerObject getEagerObject();\n\n // Providers we never bound explicitly -- they should be synthesized\n // since we bound the keys directly\n Provider<SimpleObject> getSimpleProvider();\n @Named(\"blue\") Provider<SimpleObject> getSimpleBlueProvider();\n\n @MyBindingAnnotation String getAnnotatedString();\n\n MyRemoteServiceAsync getMyRemoteServiceAsync();\n}",
"@Singleton\n@Component(modules = {ApplicationModule.class, NetModule.class})\npublic interface ApplicationComponent {\n Realm realm();\n\n SharedPreferencesStore sharedPreferencesStore();\n\n Retrofit retrofit();\n\n void inject(MyApplication application);\n\n}",
"@Before\n public void setup() {\n RoboGuice.overrideApplicationInjector(RuntimeEnvironment.application, new MyTestModule());\n mainPresenter = new MainPresenter(\n RuntimeEnvironment.application.getApplicationContext(), loginViewMock);\n\n }",
"@SuppressWarnings(\"unused\")\n@Singleton\n@Component(modules = {ApplicationModule.class})\npublic interface ApplicationComponent {\n void inject(DIApplication application);\n\n void inject(BaseActivity activity);\n void inject(BaseFragment fragment);\n\n void inject(DogSyncService service);\n}",
"@Singleton\n@Component(modules = {ContextModule.class, BusModule.class, GithubModule.class, GankModule.class, ZhiHuModule.class, RssModule.class})\npublic interface AppComponent {\n Context getContext();\n GankService getGankService();\n ZhiHuService getZhiHuService();\n RssService getRssService();\n EventBus getBus();\n}",
"@Singleton\n@Component(modules = {ApplicationModule.class})\npublic interface ApplicationComponent {\n\n void inject(GoToDream goToDream);\n\n @Named(\"application\")\n Context getContext();\n}",
"@Singleton\n@Component(\n modules = {\n ApplicationModule.class,\n PresentationModule.class\n }\n)\npublic interface ApplicationComponent {\n void inject(MainActivity baseActivity);\n}",
"@ApplicationScope\n@Component(\n dependencies = DataServiceComponent.class,\n modules = {\n DataManagerModule.class\n }\n)\npublic interface DataManagerComponent {\n DataManager dataManager();\n void inject(MainActivity activity);\n}",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n void inject(MvpApp app);\n Application application();\n\n DataManager getDataManager();\n\n}",
"@GinModules(InjectorModule.class)\npublic interface Injector extends Ginjector {\n PlaceHistoryHandler getPlaceHistoryHandler();\n MainView getAppWidget();\n}",
"@Singleton\n@Component(modules = {MyAppModule.class,TwitterModule.class, ApiModule.class, RxModule.class})\npublic interface MyAppComponent {\n void inject(MainActivity target);\n}",
"@Singleton // Constraints this component to one-per-application or unscoped bindings.\n@Component(modules = {\n ApplicationModule.class,\n HomeModule.class\n})\npublic interface ApplicationComponent {\n\n /**\n * Field injections of any dependencies of the app\n *\n * @param mainActivity activity for which dependencies must be satisfied.\n */\n void inject(MainActivity mainActivity);\n\n /**\n * Field injections of any dependencies of the app\n *\n * @param homeView dashboardView for which dependencies must be satisfied.\n */\n void inject(HomeView homeView);\n}",
"public void boot()\n {\n injector = Guice.createInjector( modules );\n }",
"@ForApplication\n@Component(modules = {AppModule.class, NetworkModule.class})\npublic interface AppComponent {\n Context appContext();\n Resources resources();\n PreferencesHelper preferencesHelper();\n void inject(NewsPresenter newsPresenter);\n void inject(FeedStorage feedStorage);\n}",
"@Inject\n\tprivate DataManager() {\n\t\t// nothing to do\n\t}",
"void inject(MainActivity mainActivity);",
"@Singleton\n@Component(\n modules = {\n AppModule.class,\n DataModule.class,\n InfoModule.class,\n FlavorModule.class\n }\n)\npublic interface AppComponent {\n\n void inject(HardwiredApp app);\n void inject(AddComputerDialog dialog);\n void inject(ComputerRecyclerAdapter adapter);\n\n DirectoryComponent plus(DirectoryModule module);\n DetailComponent plus(DetailModule module);\n}",
"@Singleton\n@Component(modules = {\n CommonsApplicationModule.class,\n NetworkingModule.class,\n AndroidInjectionModule.class,\n AndroidSupportInjectionModule.class,\n ActivityBuilderModule.class,\n FragmentBuilderModule.class,\n ServiceBuilderModule.class,\n ContentProviderBuilderModule.class,\n UploadModule.class,\n ContributionsModule.class,\n SearchModule.class,\n DepictionModule.class,\n CategoriesModule.class\n})\npublic interface CommonsApplicationComponent extends AndroidInjector<ApplicationlessInjection> {\n void inject(CommonsApplication application);\n\n void inject(UploadWorker worker);\n\n void inject(LoginActivity activity);\n\n void inject(SettingsFragment fragment);\n\n void inject(MoreBottomSheetFragment fragment);\n\n void inject(MoreBottomSheetLoggedOutFragment fragment);\n\n void inject(ReviewController reviewController);\n\n //void inject(NavTabLayout view);\n\n @Override\n void inject(ApplicationlessInjection instance);\n\n void inject(FileProcessor fileProcessor);\n\n void inject(PicOfDayAppWidget picOfDayAppWidget);\n\n Gson gson();\n\n @Component.Builder\n @SuppressWarnings({\"WeakerAccess\", \"unused\"})\n interface Builder {\n\n Builder appModule(CommonsApplicationModule applicationModule);\n\n CommonsApplicationComponent build();\n }\n}",
"void inject(StychApplication stychApplication);",
"@Component(modules = WheelsModule.class)\npublic interface CarComponent {\n Car getCar();\n void inject(MainActivity activity); //se necesita declarar especificamente la activity para la forma 2\n}",
"@Singleton\n@Component(modules = {PracticeModule.class})\npublic interface ApplicationComponent {\n\n /**\n * Inject method for the SplashActivity instance.\n *\n * @param activity is the type SplashActivity\n */\n void inject(SplashActivity activity);\n\n /**\n * Inject method for the HomeActivity instance.\n *\n * @param activity is the type HomeActivity\n */\n void inject(HomeActivity activity);\n\n /**\n * Inject method for the SubscriberListFragment\n *\n * @param fragment is the type SubscriberListFragment\n */\n void inject(SubscriberListFragment fragment);\n\n /**\n * Inject method for the SubscriberDetailsFragment\n *\n * @param fragment is the type SubscriberDetailsFragment\n */\n void inject(SubscriberDetailsFragment fragment);\n\n /**\n * Inject method for the WebClientFragment\n *\n * @param fragment is the type WebClientFragment\n */\n void inject(WebClientFragment fragment);\n}",
"@Singleton @Component(modules = {ApplicationModule.class, ApiModule.class})\npublic interface ApplicationComponent {\n Context getContext();\n Bus getBus();\n TRApi getTRApi();\n\n void inject(ZhihuApplication zhihuApplication);\n\n void inject(BaseNewActivity baseNewActivity);\n}",
"@Singleton\n@Component(modules = {ApplicationModule.class})\npublic interface ApplicationComponent {\n void inject(PlayerFragmentPresenter playerFragmentPresenter);\n void inject(PlayerService playerService);\n}",
"@Component(modules = {AppModule.class, UtilsModule.class})\n@Singleton\npublic interface AppComponent {\n\n void doInjection(HomeActivity homeActivity);\n\n}",
"@Singleton\n@Component(modules = {AppModule.class})\npublic interface AppComponent {\n\n void inject(SearchUserPresenter presenter);\n\n void inject(UserDetailsPresenter presenter);\n\n}",
"@Singleton\n@Component(modules = {MainModule.class})\npublic interface MainComponent {\n Context context();\n\n NYTimesService nYTimesService();\n void inject(NYTimesActivity nyTimesActivity);\n}",
"@Component(modules = { ApplicationModule.class, SettingsDataModule.class, UserDataModule.class, RecipeDataModule.class })\n@ApplicationScope\npublic interface ApplicationComponent {\n\n void inject(HoppyApplication application);\n\n @ApplicationContext\n Context applicationContext();\n Navigator navigator();\n\n UserRepository userRepository();\n RecipeRepository recipeRepository();\n SettingsRepository settingsRepository();\n GetCurrentUserInteractor getCurrentUserInteractor();\n}",
"@Singleton\n@Component(modules = {NetModule.class})\npublic interface ApplicationComponent {\n void inject(MoviesActivity moviesActivity);\n}",
"@Singleton\n@Component (modules = MainModule.class)\npublic interface MainComponent {\n void inject(MainActivity mainActivity);\n void inject(ForecastFragment forecastFragment);\n void inject(GPSLocationActivity gpsLocationActivity);\n\n}",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n @ApplicationContext\n Context context();\n\n void inject(ZoloApplication zoloApplication);\n\n DataManagerLogic datamangerLogic();\n\n Application application();\n\n}",
"@Component(modules = BaseTabFPAdapterModule.class)\npublic interface BaseTabFPAdapterComponent {\n void inject(MainActivity activity);\n}",
"@Inject\n public MachineMonkeyRestApiImpl() {\n }",
"@Singleton\n@Component( modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n //Exposed to sub-graphs\n Context context();\n\n ThreadExecutor threadExecutor();\n\n PostExecutionThread postExecutionThread();\n\n ObserverController observerController();\n\n Bundle parametersFactory();\n\n void inject(DevxitActivityDelegateImpl<DevxitView, DevxitPresenter<DevxitView>> devxitActivityDelegate);\n}",
"@Singleton\r\n@Component(modules = {UIModule.class, InteractorModule.class, MockModelModule.class, MockNetworkModule.class})\r\npublic interface MockAnimalFindApplicationComponent extends AnimalFindApplicationComponent {\r\n}",
"public MyDemoApplication(){\n\t\t//System.out.println(\"hi\");\n\t\t/*register(RequestContextFilter.class);\n\t\tregister(RestServiceUsingJersey.class);\n\t\tregister(ServiceYearImpl.class);\n\t\tregister(YearDaoImpl.class);\n\t\tregister(JacksonFeature.class);*/\n\t\t\n\t\t/**\n\t\t * Register JAX-RS application components.\n\t\t */\n\t\t\n\t\t\t\n\t packages(\"com.reporting.webapi\");\n\n\t\t\t// register features\n\t\t\tEncodingFilter.enableFor(this, GZipEncoder.class);\t\t\n\t\t\t\n\t\n\n\t}",
"@Component(modules = {AppModule.class, UtilsModule.class})\n@Singleton\npublic interface AppComponent {\n\n void inject(BaseActivity baseActivity);\n\n}",
"@Component(modules = {ApplicationModule.class,HttpModule.class})\npublic interface ApplicationComponent {\n\n MyApp getApplication();\n\n NewsApi getNetEaseApi();\n\n JanDanApi getJanDanApi();\n\n Context getContext();\n\n}",
"void inject(TravelsProvider provider);",
"@Singleton\n@Component(modules = {DemoRepositoryModule.class, ApplicationModule.class})\npublic interface DemoRepositoryComponent {\n\n DemoRepository getDemoRepository();\n}",
"@Component(modules = MainActivityModuel.class)\npublic interface MainActivityComponent {\n void inject(MainActivity activity);\n}",
"@Singleton\n@Component(modules={\n AccountServiceModule.class,\n UserServiceModule.class,\n ConnectionModule.class,\n RemoteAccountModule.class,\n DaoModule.class,\n AuthenticationModule.class,\n CSVGeneratorModule.class,\n EmailServiceModule.class\n})\npublic interface ApplicationComponent {\n\n /**\n * The view needs classes defined in the services. The inject method\n * lets us do this.\n * Create an inject method for every different classes (controllers) in the views that would need them\n * @param myMoneyApplication\n */\n void inject(MyMoneyApplication myMoneyApplication);\n\n void inject(LoginController loginController);\n\n void inject(AccountListController accountListController);\n\n void inject(SignUpController signUpController);\n\n void inject(TransactionTableController tableController);\n\n void inject(UpdateUserAccountController updateUserAccountController);\n\n void inject(AllTransactionsController allTransactionsController);\n\n void inject(AccountDetailsController accountDetailsController);\n}",
"public void injectMainController(MainController mainController){this.mainController = mainController;}",
"@Singleton\n@Component(modules = {AppModule.class})\npublic interface BasicComponent {\n\tvoid inject(AddContactActivity addContactActivity);\n\tvoid inject(MainActivity mainActivity);\n\tvoid inject (MainActivityFragment mainActivityFragment);\n\tvoid inject (HandleClickFromRecyclerContactsModel handleClickFromRecyclerContactsModel);\n}",
"@Singleton\n@Component(modules = {ApplicationModule.class})\npublic interface ApplicationComponent {\n\n /**\n * Inject method for the {@link PostActivity}.\n *\n * @param activity {@link PostActivity} instance.\n */\n void inject(PostActivity activity);\n\n /**\n * Inject method for the {@link PostFragment}.\n *\n * @param fragment {@link PostFragment} instance.\n */\n void inject(PostFragment fragment);\n\n /**\n * Inject method for the {@link FavoritesFragment}.\n *\n * @param fragment {@link FavoritesFragment} instance.\n */\n void inject(FavoritesFragment fragment);\n\n /**\n * Inject method for the {@link PostDetailsActivity}.\n *\n * @param activity {@link PostDetailsActivity} instance.\n */\n void inject(PostDetailsActivity activity);\n\n}",
"public interface InjectorWrapper {\n\tApplicationInjector getInjector();\n}",
"@Component(modules = MainActivityModule.class, dependencies = BaseComponent.class)\npublic interface MainActivityComponent {\n void inject(MainActivity activity);\n}",
"@Singleton\n@Component(modules = UserModule.class, dependencies = FlowerComponent.class)\npublic interface UserComponent {\n User getUser();\n}",
"void inject(MoviesListPresenter moviesListPresenter);",
"@Singleton\n@Component(modules = {AppModule.class, ProviderModule.class})\npublic interface AppComponent {\n Retrofit provideRetrofit();\n BaseApplication providesApplication();\n\n}",
"@Singleton\n@Component(modules = {AppModule.class, RetrofitModule.class})\npublic interface AppComponent {\n Context getContext();\n KyApiService getKyApiService();\n WyApiService getWyApiService();\n OpApiService getOpApiService();\n ToutiaoVideoApiService getToutiaoVideoApiService();\n LiveApiService getLiveApiService();\n CloudMusicApiService getCloudMusicApiService();\n}",
"@PerActivity\n@Component(dependencies = ApplicationComponent.class,modules = MainModule.class)\npublic interface MainComponent {\n\n void inject(MainActivity activity);\n void inject(SignInFragment fragment);\n void inject(SignOutFragment fragment);\n void inject(AdminFragment fragment);\n void inject(AboutFragment fragment);\n void inject(PicksFragment fragment);\n void inject(TrackFragment fragment);\n}",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface ApplicationComponent {\n\n void inject(ContainerActivity containerActivity);\n}",
"@Override\n public void onAttach(@NotNull Context context) {\n AndroidSupportInjection.inject(this);\n super.onAttach(context);\n }",
"@Override\n public void onAttach(@NotNull Context context) {\n AndroidSupportInjection.inject(this);\n super.onAttach(context);\n }",
"@CustomScope\n@Component(modules = ExModule.class)\npublic interface ExComponent {\n\n /**\n * Inject.\n *\n * @param mapActivity the landing screen\n */\n void inject(MainActivity mapActivity);\n}",
"@Inject\n public BasicApplication(CheckoutService checkoutService)\n {\n this.checkoutService = checkoutService;\n }",
"@PerActivity\n@Component(dependencies = ApplicationComponent.class, modules = ArtistInfoModule.class)\npublic interface ArtistInfoComponent {\n\n void injectForAdapter(ArtistAdapter artistAdapter);\n\n void injectForFragment(ArtistDetailFragment fragment);\n}",
"void inject(PresenterLayer presenterLayer);",
"private <B, I> void _start() throws Exception\n {\n bootstrap.bindBean(ApplicationDescriptor.class, null, descriptor);\n\n // Bind the application context\n bootstrap.declareBean(ApplicationContext.class, null, InternalApplicationContext.class);\n\n //\n bootstrap.setFilter(new BeanFilter()\n {\n public <T> boolean acceptBean(Class<T> beanType)\n {\n if (beanType.getName().startsWith(\"org.juzu.\") || beanType.getAnnotation(Export.class) != null)\n {\n return false;\n }\n else\n {\n // Do that better with a meta annotation that describe Juzu annotation\n // that veto beans\n for (Method method : beanType.getMethods())\n {\n if (method.getAnnotation(View.class) != null || method.getAnnotation(Action.class) != null || method.getAnnotation(Resource.class) != null)\n {\n return false;\n }\n }\n return true;\n }\n }\n });\n\n // Bind the scopes\n for (Scope scope : Scope.values())\n {\n bootstrap.addScope(scope);\n }\n\n // Bind the controllers\n for (ControllerDescriptor controller : descriptor.getControllers())\n {\n bootstrap.declareBean(controller.getType(), null, (Class)null);\n }\n\n // Bind the templates\n for (TemplateDescriptor template : descriptor.getTemplates())\n {\n bootstrap.declareBean(Template.class, null, template.getType());\n }\n\n //\n Class<?> s = descriptor.getPackageClass();\n\n // Bind the bean bindings\n Bindings bindings = s.getAnnotation(Bindings.class);\n if (bindings != null)\n {\n for (Binding binding : bindings.value())\n {\n Class<?> type = binding.value();\n Class<?> implementation = binding.implementation();\n if (MetaProvider.class.isAssignableFrom(implementation))\n {\n MetaProvider mp = (MetaProvider)implementation.newInstance();\n Provider provider = mp.getProvider(type);\n bootstrap.bindProvider(type, null, provider);\n }\n else if (Provider.class.isAssignableFrom(implementation))\n {\n Method m = implementation.getMethod(\"get\");\n ArrayList<Annotation> qualifiers = null;\n for (Annotation annotation : m.getAnnotations())\n {\n if (annotation.annotationType().getAnnotation(Qualifier.class) != null)\n {\n if (qualifiers == null)\n {\n qualifiers = new ArrayList<Annotation>();\n }\n qualifiers.add(annotation);\n }\n }\n bootstrap.declareProvider(type, qualifiers, (Class)implementation);\n }\n else\n {\n if (implementation == Object.class)\n {\n implementation = null;\n }\n bootstrap.declareBean((Class)type, null, (Class)implementation);\n }\n }\n }\n\n //\n List<Class<? extends Plugin>> plugins = descriptor.getPlugins();\n\n // Declare the plugins\n for (Class<? extends Plugin> pluginType : plugins)\n {\n bootstrap.declareBean(pluginType, null, null);\n }\n\n //\n InjectManager<B, I> manager = bootstrap.create();\n\n //\n B contextBean = manager.resolveBean(ApplicationContext.class);\n I contextInstance = manager.create(contextBean);\n \n // Get plugins\n ArrayList<Plugin> p = new ArrayList<Plugin>();\n for (Class<? extends Plugin> pluginType : plugins)\n {\n B pluginBean = manager.resolveBean(pluginType);\n I pluginInstance = manager.create(pluginBean);\n Object o = manager.get(pluginBean, pluginInstance);\n p.add((Plugin)o);\n }\n\n //\n this.context = (InternalApplicationContext)manager.get(contextBean, contextInstance);\n }",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface AppComponent {\n\n void inject(BaseActivity activity);\n void inject(UserListFrag frag);\n void inject(LoginFrag frag);\n void inject(SplashActivity act);\n\n}",
"@Singleton\n@Component(modules = {ApplicationModule.class, LoginModule.class})\npublic interface ApplicationComponent {\n\n void inject(LoginActivity target);\n}",
"@Singleton\n@Component(\n modules = {\n AppModule.class,\n MovieDBApiModule.class\n })\npublic interface AppComponent {\n\n MainActivityComponent plus(MainActivityModule mainActivityModule);\n\n DetailActivityComponent plus(DetailActivityModule detailActivityModule);\n\n}",
"interface Injector {\n void inject(InternalContext context, Object o);\n }",
"@Component\npublic interface ActivityComponent {\n\n void inject(MainActivity activity);\n}",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface AppComponent {\n void inject(MainActivity activity);\n\n Context provideApplication();\n\n IBluetooth provideBluetoothService();\n}",
"@Singleton\n@Component(modules = {ViewModule.class, NetworkModule.class, MapModule.class})\npublic interface ErrandComponent {\n void inject(MapsActivity mapsActivity);\n\n}",
"@Singleton\n@Component(modules = {\n AndroidInjectionModule.class,\n AppModule.class,\n ActivityBuilder.class,\n NetModule.class, GlideAppModules.class\n})\npublic interface AppComponent {\n\n @Component.Builder\n interface Builder {\n\n @BindsInstance Builder application(Application application);\n AppComponent build();\n Builder net(NetModule netModule);\n Builder glide(GlideAppModules glideAppModules);\n }\n\n void inject(MyApplication application);\n\n}",
"Builder injectionFactory(InjectionObjectFactory factory);",
"@PerActivity\n@Component(modules = CakeModule.class, dependencies = ApplicationComponent.class)\npublic interface CakeComponent {\n\n void inject(MainActivity activity);\n\n}",
"private InjectorManager() {\n // no prepared injectors\n }",
"@ActivityScope\n@Component(modules = MainModule.class, dependencies = ApplicationComponent.class)\npublic interface MainComponent {\n\n void inject(MainActivity mainActivity);\n\n}",
"void inject(NYNewsViewModel nyNewsViewModel);",
"@Singleton\n@Component(modules = ImeiMainModule.class)\npublic interface ImeiMainComponent {\n void inject(ImeiAplication app);\n\n //Exposed to sub-graphs.\n ImeiAplication app();\n}",
"@Singleton\n@Component(modules = DoubanHttpModule.class)\npublic interface MovieDetailComponent {\n void injectMovieDetail(MovieDetailActivity movieDetailActivity);\n}",
"@Inject\n\tpublic ProviderBikes() { //has dependencies of its own that's why constructot\n\t\t\t\t\t\t\t\t\t\t//with @Inject annotation\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t\tSystem.out.println(\"Inside the constructor of the provide class\");\n\t}",
"@Singleton\n@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n// @ApplicationContext\n// Context context();\n\n Application application();\n\n SharedPrefencesHelper sharedPrefencesHelper();\n\n DataManager dataManager();\n\n G3anService g3anService();\n}",
"@Component(modules = {ShowModule.class},dependencies = AppComponent.class)\npublic interface ShowComponent {\n void inject(ResultActivity resultActivity);\n IPresenter getPresenter();\n ResultAdapter getResultAdapter();\n}",
"@ActivityScope\n@Component(dependencies = AppComponent.class, modules = MainModule.class)\npublic interface MainComponent {\n void inject(MainActivity mainActivity);\n MainPresenter getMainPresenter();\n}",
"@Component(modules = ActivityModule.class)\npublic interface ActivityComponent {\n\n void injectMainActivity(MainActivity activity);\n\n void injectGankActivity(GankActivity activity);\n\n void injectListActivity(ListActivity activity);\n\n void injectMeiziActivity(MeiziActivity activity);\n\n void injectVideoActivity(VideoActivity activity);\n\n void injectWebActivity(WebActivity activity);\n\n}",
"@ApplicationScope\n@Component(modules = {AppModule.class})\npublic interface AppComponent {\n\n void inject(MyApplication application);\n\n Application application();\n\n Gson gson();\n\n OkHttpClient okHttpClient();\n\n}"
] | [
"0.706479",
"0.69750094",
"0.6759345",
"0.6743867",
"0.6523624",
"0.6409587",
"0.6398414",
"0.6378415",
"0.6376643",
"0.63400584",
"0.6293077",
"0.6290087",
"0.6287861",
"0.62631434",
"0.6260128",
"0.6239555",
"0.6219793",
"0.62046266",
"0.6195358",
"0.6191309",
"0.617562",
"0.61611634",
"0.6153181",
"0.6152235",
"0.6151503",
"0.61514735",
"0.61225384",
"0.6117808",
"0.6115079",
"0.61008817",
"0.60878074",
"0.6075961",
"0.6074754",
"0.6071974",
"0.60577494",
"0.6056796",
"0.6055007",
"0.60425216",
"0.6040729",
"0.6040271",
"0.6023995",
"0.6005917",
"0.6002502",
"0.59995866",
"0.59807694",
"0.5972693",
"0.5972366",
"0.59494877",
"0.59488",
"0.5948354",
"0.5943334",
"0.59376365",
"0.59363085",
"0.593486",
"0.5924227",
"0.5901585",
"0.58976847",
"0.588063",
"0.58729255",
"0.5871431",
"0.58655596",
"0.58464414",
"0.5843583",
"0.58392626",
"0.5834713",
"0.58276695",
"0.5824563",
"0.58042",
"0.5801808",
"0.57971716",
"0.57953507",
"0.57862526",
"0.5785371",
"0.5785371",
"0.5784503",
"0.5771206",
"0.5770965",
"0.5770528",
"0.5769026",
"0.57643545",
"0.5760312",
"0.57579374",
"0.5748034",
"0.57458675",
"0.5741096",
"0.57330775",
"0.5732994",
"0.57321054",
"0.57282686",
"0.5717989",
"0.5714991",
"0.5711504",
"0.5710439",
"0.57063884",
"0.5704969",
"0.56992805",
"0.56974643",
"0.56949615",
"0.5693379",
"0.56906277"
] | 0.677523 | 2 |
Create an entity for this test. This is a static method, as tests for other entities might also need it, if they test an entity which requires the current entity. | public static Questions createEntity(EntityManager em) {
Questions questions = new Questions()
.formId(DEFAULT_FORM_ID)
.type(DEFAULT_TYPE)
.subType(DEFAULT_SUB_TYPE)
.description(DEFAULT_DESCRIPTION);
return questions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Entity createEntity();",
"T createEntity();",
"protected abstract ENTITY createEntity();",
"void create(E entity);",
"void create(T entity);",
"E create(E entity);",
"E create(E entity);",
"protected abstract EntityBase createEntity() throws Exception;",
"TestEntity buildEntity () {\n TestEntity testEntity = new TestEntity();\n testEntity.setName(\"Test name\");\n testEntity.setCheck(true);\n testEntity.setDateCreated(new Date(System.currentTimeMillis()));\n testEntity.setDescription(\"description\");\n\n Specialization specialization = new Specialization();\n specialization.setName(\"Frontend\");\n specialization.setLevel(\"Senior\");\n specialization.setYears(10);\n\n testEntity.setSpecialization(specialization);\n\n return testEntity;\n }",
"public static TestEntity createEntity(EntityManager em) {\n TestEntity testEntity = new TestEntity();\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n testEntity.setUserOneToMany(user);\n return testEntity;\n }",
"void create(T entity) throws Exception;",
"@Override\n protected void createEntity() {\n ProjectStatus status = createProjectStatus(5);\n setEntity(status);\n }",
"protected T createSimulatedExistingEntity() {\n final T entity = createNewEntity();\n entity.setId(IDUtil.randomPositiveLong());\n\n when(getDAO().findOne(entity.getId())).thenReturn(entity);\n return entity;\n }",
"public Entity newEntity() { return newMyEntity(); }",
"public Entity newEntity() { return newMyEntity(); }",
"public static TranshipTube createEntity(EntityManager em) {\n TranshipTube transhipTube = new TranshipTube()\n .status(DEFAULT_STATUS)\n .memo(DEFAULT_MEMO)\n .columnsInTube(DEFAULT_COLUMNS_IN_TUBE)\n .rowsInTube(DEFAULT_ROWS_IN_TUBE);\n // Add required entity\n TranshipBox transhipBox = TranshipBoxResourceIntTest.createEntity(em);\n em.persist(transhipBox);\n em.flush();\n transhipTube.setTranshipBox(transhipBox);\n // Add required entity\n FrozenTube frozenTube = FrozenTubeResourceIntTest.createEntity(em);\n em.persist(frozenTube);\n em.flush();\n transhipTube.setFrozenTube(frozenTube);\n return transhipTube;\n }",
"public static Student createEntity(EntityManager em) {\n Student student = new Student()\n .firstName(DEFAULT_FIRST_NAME)\n .middleName(DEFAULT_MIDDLE_NAME)\n .lastName(DEFAULT_LAST_NAME)\n .studentRegNumber(DEFAULT_STUDENT_REG_NUMBER)\n .dateOfBirth(DEFAULT_DATE_OF_BIRTH)\n .regDocType(DEFAULT_REG_DOC_TYPE)\n .registrationDocumentNumber(DEFAULT_REGISTRATION_DOCUMENT_NUMBER)\n .gender(DEFAULT_GENDER)\n .nationality(DEFAULT_NATIONALITY)\n .dateJoined(DEFAULT_DATE_JOINED)\n .deleted(DEFAULT_DELETED)\n .wxtJwtPq55wd(DEFAULT_WXT_JWT_PQ_55_WD);\n // Add required entity\n NextOfKin nextOfKin;\n if (TestUtil.findAll(em, NextOfKin.class).isEmpty()) {\n nextOfKin = NextOfKinResourceIT.createEntity(em);\n em.persist(nextOfKin);\n em.flush();\n } else {\n nextOfKin = TestUtil.findAll(em, NextOfKin.class).get(0);\n }\n student.getRelatives().add(nextOfKin);\n return student;\n }",
"@PostConstruct\n protected void initNewEntity() {\n setNewEntity(getService().create());\n }",
"public static Emprunt createEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(DEFAULT_DATE_EMPRUNT)\n .dateRetour(DEFAULT_DATE_RETOUR);\n // Add required entity\n Usager usager = UsagerResourceIntTest.createEntity(em);\n em.persist(usager);\n em.flush();\n emprunt.setUsager(usager);\n // Add required entity\n Exemplaire exemplaire = ExemplaireResourceIntTest.createEntity(em);\n em.persist(exemplaire);\n em.flush();\n emprunt.setExemplaire(exemplaire);\n return emprunt;\n }",
"public ClientEntity newEntity() {\r\n if (entityType == null) {\r\n entityType = getEntityType(entitySet);\r\n }\r\n return odataClient.getObjectFactory().newEntity(new FullQualifiedName(NAMESPAVE, entityType));\r\n }",
"@Override\n public EntityResponse createEntity(String entitySetName, OEntity entity) {\n return super.createEntity(entitySetName, entity);\n }",
"ID create(T entity);",
"public static MotherBed createEntity(EntityManager em) {\n MotherBed motherBed = new MotherBed()\n .value(DEFAULT_VALUE)\n .status(DEFAULT_STATUS);\n // Add required entity\n Nursery nursery = NurseryResourceIntTest.createEntity(em);\n em.persist(nursery);\n em.flush();\n motherBed.setNursery(nursery);\n return motherBed;\n }",
"private FailingEntity createFailingEntity() {\n FailingEntity entity = app.createAndManageChild(EntitySpec.create(FailingEntity.class)\n .configure(FailingEntity.FAIL_ON_START, true));\n return entity;\n }",
"@Override\n public EntityResponse createEntity(String entitySetName, OEntityKey entityKey, String navProp, OEntity entity) {\n return super.createEntity(entitySetName, entityKey, navProp, entity);\n }",
"public <T extends Entity> T createEntity(EntitySpec<T> spec) {\n Map<String,Entity> entitiesByEntityId = MutableMap.of();\n Map<String,EntitySpec<?>> specsByEntityId = MutableMap.of();\n \n T entity = createEntityAndDescendantsUninitialized(spec, entitiesByEntityId, specsByEntityId);\n initEntityAndDescendants(entity.getId(), entitiesByEntityId, specsByEntityId);\n return entity;\n }",
"public static Prestamo createEntity(EntityManager em) {\n Prestamo prestamo = new Prestamo().observaciones(DEFAULT_OBSERVACIONES).fechaFin(DEFAULT_FECHA_FIN);\n // Add required entity\n Libro libro;\n if (TestUtil.findAll(em, Libro.class).isEmpty()) {\n libro = LibroResourceIT.createEntity(em);\n em.persist(libro);\n em.flush();\n } else {\n libro = TestUtil.findAll(em, Libro.class).get(0);\n }\n prestamo.setLibro(libro);\n // Add required entity\n Persona persona;\n if (TestUtil.findAll(em, Persona.class).isEmpty()) {\n persona = PersonaResourceIT.createEntity(em);\n em.persist(persona);\n em.flush();\n } else {\n persona = TestUtil.findAll(em, Persona.class).get(0);\n }\n prestamo.setPersona(persona);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n prestamo.setUser(user);\n return prestamo;\n }",
"default E create(E entity)\n throws TechnicalException, ConflictException {\n return create(entity, null);\n }",
"public static Rentee createEntity(EntityManager em) {\n Rentee rentee = new Rentee();\n rentee = new Rentee()\n .firstName(DEFAULT_FIRST_NAME)\n .lastName(DEFAULT_LAST_NAME)\n .email(DEFAULT_EMAIL)\n .phoneNumber(DEFAULT_PHONE_NUMBER)\n .password(DEFAULT_PASSWORD);\n return rentee;\n }",
"public static Pocket createEntity(EntityManager em) {\n Pocket pocket = new Pocket()\n .key(DEFAULT_KEY)\n .label(DEFAULT_LABEL)\n .startDateTime(DEFAULT_START_DATE_TIME)\n .endDateTime(DEFAULT_END_DATE_TIME)\n .amount(DEFAULT_AMOUNT)\n .reserved(DEFAULT_RESERVED);\n // Add required entity\n Balance balance = BalanceResourceIntTest.createEntity(em);\n em.persist(balance);\n em.flush();\n pocket.setBalance(balance);\n return pocket;\n }",
"public static ItemSubstitution createEntity(EntityManager em) {\n ItemSubstitution itemSubstitution = new ItemSubstitution()\n .timestamp(DEFAULT_TIMESTAMP)\n .type(DEFAULT_TYPE)\n .substituteType(DEFAULT_SUBSTITUTE_TYPE)\n .substituteNo(DEFAULT_SUBSTITUTE_NO)\n .description(DEFAULT_DESCRIPTION)\n .isInterchangeable(DEFAULT_IS_INTERCHANGEABLE)\n .relationsLevel(DEFAULT_RELATIONS_LEVEL)\n .isCheckedToOriginal(DEFAULT_IS_CHECKED_TO_ORIGINAL)\n .origCheckDate(DEFAULT_ORIG_CHECK_DATE);\n // Add required entity\n Item item;\n if (TestUtil.findAll(em, Item.class).isEmpty()) {\n item = ItemResourceIT.createEntity(em);\n em.persist(item);\n em.flush();\n } else {\n item = TestUtil.findAll(em, Item.class).get(0);\n }\n itemSubstitution.getItems().add(item);\n return itemSubstitution;\n }",
"E create(E entity, RequestContext context)\n throws TechnicalException, ConflictException;",
"public static A createEntity(EntityManager em) {\n A a = new A();\n return a;\n }",
"public static Edge createEntity(EntityManager em) {\n Edge edge = new Edge()\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Stone from = StoneResourceIntTest.createEntity(em);\n em.persist(from);\n em.flush();\n edge.setFrom(from);\n // Add required entity\n Stone to = StoneResourceIntTest.createEntity(em);\n em.persist(to);\n em.flush();\n edge.setTo(to);\n return edge;\n }",
"public static QuizQuestion createEntity(EntityManager em) {\n QuizQuestion quizQuestion = new QuizQuestion()\n .text(DEFAULT_TEXT)\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Quiz quiz;\n if (TestUtil.findAll(em, Quiz.class).isEmpty()) {\n quiz = QuizResourceIT.createEntity(em);\n em.persist(quiz);\n em.flush();\n } else {\n quiz = TestUtil.findAll(em, Quiz.class).get(0);\n }\n quizQuestion.setQuiz(quiz);\n return quizQuestion;\n }",
"public static Partida createEntity(EntityManager em) {\n Partida partida = new Partida()\n .dataPartida(DEFAULT_DATA_PARTIDA);\n return partida;\n }",
"public T create(T entity) {\n\t \tgetEntityManager().getTransaction().begin();\n\t getEntityManager().persist(entity);\n\t getEntityManager().getTransaction().commit();\n\t getEntityManager().close();\n\t return entity;\n\t }",
"public static Emprunt createEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(DEFAULT_DATE_EMPRUNT);\n return emprunt;\n }",
"public static SitAndGo createEntity(EntityManager em) {\n SitAndGo sitAndGo = new SitAndGo()\n .format(DEFAULT_FORMAT)\n .buyIn(DEFAULT_BUY_IN)\n .ranking(DEFAULT_RANKING)\n .profit(DEFAULT_PROFIT)\n .bounty(DEFAULT_BOUNTY);\n return sitAndGo;\n }",
"public static Exercise createEntity(EntityManager em) {\n Exercise exercise = new Exercise()\n .minutes(DEFAULT_MINUTES);\n return exercise;\n }",
"@Override\n\tpublic Entity createEntity() {\n\t\tEntity entity = new Entity(LINKS_ENTITY_KIND);\n\t\tentity.setProperty(id_property, ID);\n\t\tentity.setProperty(url_property, url);\n\t\tentity.setProperty(CategoryID_property, CategoryID);\n\t\tentity.setProperty(note_property, note);\n\t\tentity.setProperty(createdOn_property, createdOn);\n\t\tentity.setProperty(updatedOn_property, updatedOn);\t\t\t\n\t\treturn entity;\n\t}",
"public static House createEntity(EntityManager em) {\n House house = new House()\n .houseName(DEFAULT_HOUSE_NAME)\n .houseNo(DEFAULT_HOUSE_NO)\n .address(DEFAULT_ADDRESS)\n .houseToFloorNo(DEFAULT_HOUSE_TO_FLOOR_NO)\n .ownToFloorNo(DEFAULT_OWN_TO_FLOOR_NO)\n .lat(DEFAULT_LAT)\n .lon(DEFAULT_LON)\n .createdate(DEFAULT_CREATEDATE)\n .createBy(DEFAULT_CREATE_BY)\n .updateDate(DEFAULT_UPDATE_DATE)\n .updateBy(DEFAULT_UPDATE_BY)\n .image(DEFAULT_IMAGE)\n .imageContentType(DEFAULT_IMAGE_CONTENT_TYPE);\n // Add required entity\n Country country = CountryResourceIntTest.createEntity(em);\n em.persist(country);\n em.flush();\n house.setCountry(country);\n // Add required entity\n State state = StateResourceIntTest.createEntity(em);\n em.persist(state);\n em.flush();\n house.setState(state);\n // Add required entity\n City city = CityResourceIntTest.createEntity(em);\n em.persist(city);\n em.flush();\n house.setCity(city);\n // Add required entity\n Profile profile = ProfileResourceIntTest.createEntity(em);\n em.persist(profile);\n em.flush();\n house.setProfile(profile);\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n house.setUser(user);\n return house;\n }",
"public static CourtType createEntity(EntityManager em) {\n CourtType courtType = new CourtType()\n .type(DEFAULT_TYPE);\n return courtType;\n }",
"public static Ailment createEntity(EntityManager em) {\n Ailment ailment = new Ailment()\n .name(DEFAULT_NAME)\n .symptoms(DEFAULT_SYMPTOMS)\n .treatments(DEFAULT_TREATMENTS);\n return ailment;\n }",
"@Override\r\n public void createNewEntity(String entityName) {\n\r\n }",
"public static Articulo createEntity(EntityManager em) {\n Articulo articulo = new Articulo()\n .titulo(DEFAULT_TITULO)\n .contenido(DEFAULT_CONTENIDO)\n .fechaCreacion(DEFAULT_FECHA_CREACION);\n return articulo;\n }",
"void create(Student entity);",
"public static TipoLocal createEntity(EntityManager em) {\n TipoLocal tipoLocal = new TipoLocal()\n .tipo(DEFAULT_TIPO);\n return tipoLocal;\n }",
"public static Testtable2 createEntity(EntityManager em) {\n Testtable2 testtable2 = new Testtable2();\n testtable2.setColumn2(DEFAULT_COLUMN_2);\n return testtable2;\n }",
"@Override\n\tprotected CoreEntity createNewEntity() {\n\t\treturn null;\n\t}",
"public static OrderItem createEntity(EntityManager em) {\n OrderItem orderItem = new OrderItem().quantity(DEFAULT_QUANTITY).totalPrice(DEFAULT_TOTAL_PRICE).status(DEFAULT_STATUS);\n return orderItem;\n }",
"public static Arrete createEntity(EntityManager em) {\n Arrete arrete = new Arrete()\n .intituleArrete(DEFAULT_INTITULE_ARRETE)\n .numeroArrete(DEFAULT_NUMERO_ARRETE)\n .dateSignature(DEFAULT_DATE_SIGNATURE)\n .nombreAgrement(DEFAULT_NOMBRE_AGREMENT);\n return arrete;\n }",
"public static Tenant createEntity() {\n return new Tenant();\n }",
"public static MyOrders createEntity(EntityManager em) {\n MyOrders myOrders = new MyOrders();\n return myOrders;\n }",
"public static Enseigner createEntity(EntityManager em) {\n Enseigner enseigner = new Enseigner().dateDebut(DEFAULT_DATE_DEBUT).dateFin(DEFAULT_DATE_FIN);\n return enseigner;\n }",
"@Test\n public void eventEntityConstructionTest() {\n\n Event event = new EventEntity();\n\n assertThat(event).isNotNull();\n\n }",
"public static EnteteVente createEntity(EntityManager em) {\n EnteteVente enteteVente = new EnteteVente()\n .enteteVenteType(DEFAULT_ENTETE_VENTE_TYPE)\n .enteteVenteTotalHT(DEFAULT_ENTETE_VENTE_TOTAL_HT)\n .enteteVenteTotalTTC(DEFAULT_ENTETE_VENTE_TOTAL_TTC)\n .enteteVenteDateCreation(DEFAULT_ENTETE_VENTE_DATE_CREATION);\n return enteteVente;\n }",
"public void createNewObject(Representation entity) throws ResourceException {\r\n\t\tT entry = createObjectFromHeaders(null, entity);\r\n\t\texecuteUpdate(entity, entry, createUpdateObject(entry));\r\n\r\n\t}",
"public static Note createEntity(EntityManager em) {\n Note note = new Note().content(DEFAULT_CONTENT).title(DEFAULT_TITLE).xpos(DEFAULT_XPOS).ypos(DEFAULT_YPOS);\n return note;\n }",
"public static Organizer createEntity(EntityManager em) {\n Organizer organizer = new Organizer()\n .name(DEFAULT_NAME)\n .description(DEFAULT_DESCRIPTION)\n .facebook(DEFAULT_FACEBOOK)\n .twitter(DEFAULT_TWITTER);\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n organizer.setUser(user);\n return organizer;\n }",
"public static FillingGapsTestItem createEntity(EntityManager em) {\n FillingGapsTestItem fillingGapsTestItem = new FillingGapsTestItem()\n .question(DEFAULT_QUESTION);\n return fillingGapsTestItem;\n }",
"public Entity build();",
"@Test\n public void createQuejaEntityTest() {\n PodamFactory factory = new PodamFactoryImpl();\n QuejaEntity newEntity = factory.manufacturePojo(QuejaEntity.class);\n QuejaEntity result = quejaPersistence.create(newEntity);\n\n Assert.assertNotNull(result);\n QuejaEntity entity = em.find(QuejaEntity.class, result.getId());\n Assert.assertNotNull(entity);\n Assert.assertEquals(newEntity.getName(), entity.getName());\n}",
"public abstract boolean create(T entity) throws ServiceException;",
"public static Acheteur createEntity(EntityManager em) {\n Acheteur acheteur = new Acheteur()\n .typeClient(DEFAULT_TYPE_CLIENT)\n .nom(DEFAULT_NOM)\n .prenom(DEFAULT_PRENOM)\n .tel(DEFAULT_TEL)\n .cnib(DEFAULT_CNIB)\n .email(DEFAULT_EMAIL)\n .adresse(DEFAULT_ADRESSE)\n .numroBanquaire(DEFAULT_NUMRO_BANQUAIRE)\n .deleted(DEFAULT_DELETED);\n return acheteur;\n }",
"public static RoomGenericProduct createEntity(EntityManager em) {\n RoomGenericProduct roomGenericProduct = new RoomGenericProduct()\n .quantity(DEFAULT_QUANTITY)\n .quantityUnit(DEFAULT_QUANTITY_UNIT);\n return roomGenericProduct;\n }",
"public static TypeOeuvre createEntity(EntityManager em) {\n TypeOeuvre typeOeuvre = new TypeOeuvre()\n .intitule(DEFAULT_INTITULE);\n return typeOeuvre;\n }",
"public static Reservation createEntity(EntityManager em) {\n Reservation reservation = ReservationTest.buildReservationTest(1L);\n //reservation.setUser(User.builder().email(\"adfad\").name(\"\").build());\n return reservation;\n }",
"@Test\n public void testNewEntity() throws Exception {\n\n }",
"public static Model createEntity(EntityManager em) {\n\t\tModel model = new Model().name(DEFAULT_NAME).type(DEFAULT_TYPE).algorithm(DEFAULT_ALGORITHM)\n\t\t\t\t.status(DEFAULT_STATUS).owner(DEFAULT_OWNER).performanceMetrics(DEFAULT_PERFORMANCE_METRICS)\n\t\t\t\t.modelLocation(DEFAULT_MODEL_LOCATION).featureSignificance(DEFAULT_FEATURE_SIGNIFICANCE)\n\t\t\t\t.builderConfig(DEFAULT_BUILDER_CONFIG).createdDate(DEFAULT_CREATED_DATE)\n\t\t\t\t.deployedDate(DEFAULT_DEPLOYED_DATE).trainingDataset(DEFAULT_TRAINING_DATASET)\n .library(DEFAULT_LIBRARY).project(DEFAULT_PROJECT).version(DEFAULT_VERSION);\n\t\treturn model;\n\t}",
"public static ProcessExecution createEntity(EntityManager em) {\n ProcessExecution processExecution = new ProcessExecution()\n .execution(DEFAULT_EXECUTION);\n return processExecution;\n }",
"public static Paiement createEntity(EntityManager em) {\n Paiement paiement = new Paiement()\n .dateTransation(DEFAULT_DATE_TRANSATION)\n .montantTTC(DEFAULT_MONTANT_TTC);\n return paiement;\n }",
"public static Article createEntity(EntityManager em) {\n Article article = new Article()\n .name(DEFAULT_NAME)\n .content(DEFAULT_CONTENT)\n .creationDate(DEFAULT_CREATION_DATE)\n .modificationDate(DEFAULT_MODIFICATION_DATE);\n return article;\n }",
"T makePersistent(T entity);",
"void buildFromEntity(E entity);",
"public static XepLoai createEntity(EntityManager em) {\n XepLoai xepLoai = new XepLoai()\n .tenXepLoai(DEFAULT_TEN_XEP_LOAI);\n return xepLoai;\n }",
"public static Lot createEntity(EntityManager em) {\n Lot lot = new Lot()\n .createdAt(DEFAULT_CREATED_AT)\n .updatedAt(DEFAULT_UPDATED_AT)\n .qte(DEFAULT_QTE)\n .qtUg(DEFAULT_QT_UG)\n .num(DEFAULT_NUM)\n .dateFabrication(DEFAULT_DATE_FABRICATION)\n .peremption(DEFAULT_PEREMPTION)\n .peremptionstatus(DEFAULT_PEREMPTIONSTATUS);\n return lot;\n }",
"private MetaEntityImpl createMetaEntity(Class<?> entityType) {\n String className = entityType.getSimpleName();\n MetaEntityImpl managedEntity = new MetaEntityImpl();\n managedEntity.setEntityType(entityType);\n managedEntity.setName(className);\n ((MetaTableImpl) managedEntity.getTable()).setName(className);\n ((MetaTableImpl) managedEntity.getTable()).setKeySpace(environment.getConfiguration().getKeySpace());\n return managedEntity;\n }",
"public TransporteTerrestreEntity createTransporte(TransporteTerrestreEntity transporteEntity) throws BusinessLogicException {\n LOGGER.log(Level.INFO, \"Inicia proceso de creación del transporte\");\n super.createTransporte(transporteEntity);\n\n \n persistence.create(transporteEntity);\n LOGGER.log(Level.INFO, \"Termina proceso de creación del transporte\");\n return transporteEntity;\n }",
"public static EmployeeCars createEntity(EntityManager em) {\n EmployeeCars employeeCars = new EmployeeCars()\n .previousReading(DEFAULT_PREVIOUS_READING)\n .currentReading(DEFAULT_CURRENT_READING)\n .workingDays(DEFAULT_WORKING_DAYS)\n .updateDate(DEFAULT_UPDATE_DATE);\n // Add required entity\n Employee employee = EmployeeResourceIT.createEntity(em);\n em.persist(employee);\n em.flush();\n employeeCars.setEmployee(employee);\n // Add required entity\n Car car = CarResourceIT.createEntity(em);\n em.persist(car);\n em.flush();\n employeeCars.setCar(car);\n return employeeCars;\n }",
"public static TaskComment createEntity(EntityManager em) {\n TaskComment taskComment = new TaskComment()\n .value(DEFAULT_VALUE);\n // Add required entity\n Task newTask = TaskResourceIT.createEntity(em);\n Task task = TestUtil.findAll(em, Task.class).stream()\n .filter(x -> x.getId().equals(newTask.getId()))\n .findAny().orElse(null);\n if (task == null) {\n task = newTask;\n em.persist(task);\n em.flush();\n }\n taskComment.setTask(task);\n return taskComment;\n }",
"public static Personel createEntity(EntityManager em) {\n Personel personel = new Personel()\n .fistname(DEFAULT_FISTNAME)\n .lastname(DEFAULT_LASTNAME)\n .sexe(DEFAULT_SEXE);\n return personel;\n }",
"public static Territorio createEntity(EntityManager em) {\n Territorio territorio = new Territorio().nome(DEFAULT_NOME);\n return territorio;\n }",
"public static Ordre createEntity(EntityManager em) {\n Ordre ordre = new Ordre()\n .name(DEFAULT_NAME)\n .status(DEFAULT_STATUS)\n .price(DEFAULT_PRICE)\n .creationDate(DEFAULT_CREATION_DATE);\n return ordre;\n }",
"@Override\n @LogMethod\n public T create(T entity) throws InventoryException {\n \tInventoryHelper.checkNull(entity, \"entity\");\n repository.persist(entity);\n return repository.getByKey(entity.getId());\n }",
"public static Poen createEntity(EntityManager em) {\n Poen poen = new Poen()\n .tip(DEFAULT_TIP);\n return poen;\n }",
"public static Expediente createEntity(EntityManager em) {\n Expediente expediente = new Expediente()\n .horarioEntrada(DEFAULT_HORARIO_ENTRADA)\n .horarioSaida(DEFAULT_HORARIO_SAIDA)\n .diaSemana(DEFAULT_DIA_SEMANA);\n return expediente;\n }",
"public static Unidade createEntity(EntityManager em) {\n Unidade unidade = new Unidade()\n .descricao(DEFAULT_DESCRICAO)\n .sigla(DEFAULT_SIGLA)\n .situacao(DEFAULT_SITUACAO)\n .controleDeEstoque(DEFAULT_CONTROLE_DE_ESTOQUE)\n .idAlmoxarifado(DEFAULT_ID_ALMOXARIFADO)\n .andar(DEFAULT_ANDAR)\n .capacidade(DEFAULT_CAPACIDADE)\n .horarioInicio(DEFAULT_HORARIO_INICIO)\n .horarioFim(DEFAULT_HORARIO_FIM)\n .localExame(DEFAULT_LOCAL_EXAME)\n .rotinaDeFuncionamento(DEFAULT_ROTINA_DE_FUNCIONAMENTO)\n .anexoDocumento(DEFAULT_ANEXO_DOCUMENTO)\n .setor(DEFAULT_SETOR)\n .idCentroDeAtividade(DEFAULT_ID_CENTRO_DE_ATIVIDADE)\n .idChefia(DEFAULT_ID_CHEFIA);\n // Add required entity\n TipoUnidade tipoUnidade;\n if (TestUtil.findAll(em, TipoUnidade.class).isEmpty()) {\n tipoUnidade = TipoUnidadeResourceIT.createEntity(em);\n em.persist(tipoUnidade);\n em.flush();\n } else {\n tipoUnidade = TestUtil.findAll(em, TipoUnidade.class).get(0);\n }\n unidade.setTipoUnidade(tipoUnidade);\n return unidade;\n }",
"public void spawnEntity(AEntityB_Existing entity){\r\n\t\tBuilderEntityExisting builder = new BuilderEntityExisting(entity.world.world);\r\n\t\tbuilder.loadedFromSavedNBT = true;\r\n\t\tbuilder.setPositionAndRotation(entity.position.x, entity.position.y, entity.position.z, (float) -entity.angles.y, (float) entity.angles.x);\r\n\t\tbuilder.entity = entity;\r\n\t\tworld.spawnEntity(builder);\r\n }",
"public static Book createEntity() {\n Book book = new Book()\n .idBook(DEFAULT_ID_BOOK)\n .isbn(DEFAULT_ISBN)\n .title(DEFAULT_TITLE)\n .author(DEFAULT_AUTHOR)\n .year(DEFAULT_YEAR)\n .publisher(DEFAULT_PUBLISHER)\n .url_s(DEFAULT_URL_S)\n .url_m(DEFAULT_URL_M)\n .url_l(DEFAULT_URL_L);\n return book;\n }",
"private void createTestData() {\n StoreEntity store = new StoreEntity();\n store.setStoreName(DEFAULT_STORE_NAME);\n store.setPecEmail(DEFAULT_PEC);\n store.setPhone(DEFAULT_PHONE);\n store.setImagePath(DEFAULT_IMAGE_PATH);\n store.setDefaultPassCode(STORE_DEFAULT_PASS_CODE);\n store.setStoreCap(DEFAULT_STORE_CAP);\n store.setCustomersInside(DEFAULT_CUSTOMERS_INSIDE);\n store.setAddress(new AddressEntity());\n\n // Create users for store.\n UserEntity manager = new UserEntity();\n manager.setUsercode(USER_CODE_MANAGER);\n manager.setRole(UserRole.MANAGER);\n\n UserEntity employee = new UserEntity();\n employee.setUsercode(USER_CODE_EMPLOYEE);\n employee.setRole(UserRole.EMPLOYEE);\n\n store.addUser(manager);\n store.addUser(employee);\n\n // Create a new ticket.\n TicketEntity ticket = new TicketEntity();\n ticket.setPassCode(INIT_PASS_CODE);\n ticket.setCustomerId(INIT_CUSTOMER_ID);\n ticket.setDate(new Date(new java.util.Date().getTime()));\n\n ticket.setArrivalTime(new Time(new java.util.Date().getTime()));\n ticket.setPassStatus(PassStatus.VALID);\n ticket.setQueueNumber(INIT_TICKET_QUEUE_NUMBER);\n store.addTicket(ticket);\n\n // Persist data.\n em.getTransaction().begin();\n\n em.persist(store);\n em.flush();\n\n // Saving ID generated from SQL after the persist.\n LAST_TICKET_ID = ticket.getTicketId();\n LAST_STORE_ID = store.getStoreId();\n LAST_MANAGER_ID = manager.getUserId();\n LAST_EMPLOYEE_ID = employee.getUserId();\n\n em.getTransaction().commit();\n }",
"@Test\n public void testNewEntity_0args() {\n // newEntity() is not implemented!\n }",
"public static NoteMaster createEntity(EntityManager em) {\n NoteMaster noteMaster = new NoteMaster()\n .semestre(DEFAULT_SEMESTRE)\n .noteCC1(DEFAULT_NOTE_CC_1)\n .noteCC2(DEFAULT_NOTE_CC_2)\n .noteFinal(DEFAULT_NOTE_FINAL)\n .date(DEFAULT_DATE);\n return noteMaster;\n }",
"public Camp newEntity() { return new Camp(); }",
"T create() throws PersistException;",
"private EntityDef createEntityDef(Class<?> entityClass)\n {\n\t\tif (entityClass.isAnnotationPresent(InheritanceSingleTable.class)) {\n return new SingleTableSubclass.SingleTableSuperclass(entityClass);\n } else if (entityClass.getSuperclass().isAnnotationPresent(InheritanceSingleTable.class)) {\n return new SingleTableSubclass(entityClass);\n } else {\n return new EntityDef(entityClass);\n }\n\t}",
"public static Restaurant createEntity(EntityManager em) {\n Restaurant restaurant = new Restaurant()\n .restaurantName(DEFAULT_RESTAURANT_NAME)\n .deliveryPrice(DEFAULT_DELIVERY_PRICE)\n .restaurantAddress(DEFAULT_RESTAURANT_ADDRESS)\n .restaurantCity(DEFAULT_RESTAURANT_CITY);\n return restaurant;\n }",
"@Override\n\tpublic EmploieType creer(EmploieType entity) throws InvalideTogetException {\n\t\treturn emploieTypeRepository.save(entity);\n\t}",
"public static Team createEntity(EntityManager em) {\n Team team = new Team().name(DEFAULT_NAME).description(DEFAULT_DESCRIPTION)\n .level(DEFAULT_LEVEL).totalMember(DEFAULT_TOTAL_MEMBER)\n .extraGroupName(DEFAULT_EXTRA_GROUP_NAME)\n .extraGroupDescription(DEFAULT_EXTRA_GROUP_DESCRIPTION)\n .extraGroupTotalMember(DEFAULT_EXTRA_GROUP_TOTAL_MEMBER);\n return team;\n }",
"public static Produit createEntity(EntityManager em) {\n Produit produit = new Produit()\n .designation(DEFAULT_DESIGNATION)\n .soldeInit(DEFAULT_SOLDE_INIT)\n .prixAchat(DEFAULT_PRIX_ACHAT)\n .prixVente(DEFAULT_PRIX_VENTE)\n .quantiteDispo(DEFAULT_QUANTITE_DISPO)\n .quantiteInit(DEFAULT_QUANTITE_INIT)\n .seuilReaprov(DEFAULT_SEUIL_REAPROV)\n .reference(DEFAULT_REFERENCE);\n return produit;\n }",
"public void constructEntity (EntityBuilder entityBuilder, Position position){\n entityBuilder.createEntity();\n entityBuilder.buildPosition(position);\n entityBuilder.buildName();\n entityBuilder.buildPosition();\n entityBuilder.buildContComp();\n entityBuilder.buildPhysComp(length, width);\n entityBuilder.buildGraphComp(length, width);\n }"
] | [
"0.77234906",
"0.75053483",
"0.7488514",
"0.73619807",
"0.7314892",
"0.715663",
"0.715663",
"0.7150997",
"0.7150329",
"0.707783",
"0.70170516",
"0.68032324",
"0.675297",
"0.67404056",
"0.67404056",
"0.6712416",
"0.6681341",
"0.6665129",
"0.66405314",
"0.662522",
"0.66240084",
"0.66070676",
"0.65883243",
"0.6575438",
"0.65733784",
"0.65671414",
"0.65520644",
"0.6531545",
"0.6530544",
"0.64816207",
"0.6420523",
"0.6387796",
"0.6376419",
"0.6368608",
"0.6313875",
"0.629758",
"0.62945074",
"0.625894",
"0.6246142",
"0.6243828",
"0.6240795",
"0.62184817",
"0.6209822",
"0.61824185",
"0.6181157",
"0.6175567",
"0.6170038",
"0.6164296",
"0.6161827",
"0.6159261",
"0.6155291",
"0.61512274",
"0.6144015",
"0.61374795",
"0.61351943",
"0.61290896",
"0.61249095",
"0.61210644",
"0.61071074",
"0.6106643",
"0.61031127",
"0.6091865",
"0.6090843",
"0.60812694",
"0.6074732",
"0.60696137",
"0.6067986",
"0.60667306",
"0.60622805",
"0.60590917",
"0.60513926",
"0.60417986",
"0.6038767",
"0.60329217",
"0.6026638",
"0.6023314",
"0.60221237",
"0.6021095",
"0.60159844",
"0.6014945",
"0.6013186",
"0.60032064",
"0.6002827",
"0.6002722",
"0.60007405",
"0.59963554",
"0.59949243",
"0.59824014",
"0.59771353",
"0.59758234",
"0.5972265",
"0.596583",
"0.5963594",
"0.5963186",
"0.5954411",
"0.59460884",
"0.5944332",
"0.5941509",
"0.59383476",
"0.5930737",
"0.5930263"
] | 0.0 | -1 |
Create an updated entity for this test. This is a static method, as tests for other entities might also need it, if they test an entity which requires the current entity. | public static Questions createUpdatedEntity(EntityManager em) {
Questions questions = new Questions()
.formId(UPDATED_FORM_ID)
.type(UPDATED_TYPE)
.subType(UPDATED_SUB_TYPE)
.description(UPDATED_DESCRIPTION);
return questions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Student createUpdatedEntity(EntityManager em) {\n Student student = new Student()\n .firstName(UPDATED_FIRST_NAME)\n .middleName(UPDATED_MIDDLE_NAME)\n .lastName(UPDATED_LAST_NAME)\n .studentRegNumber(UPDATED_STUDENT_REG_NUMBER)\n .dateOfBirth(UPDATED_DATE_OF_BIRTH)\n .regDocType(UPDATED_REG_DOC_TYPE)\n .registrationDocumentNumber(UPDATED_REGISTRATION_DOCUMENT_NUMBER)\n .gender(UPDATED_GENDER)\n .nationality(UPDATED_NATIONALITY)\n .dateJoined(UPDATED_DATE_JOINED)\n .deleted(UPDATED_DELETED)\n .wxtJwtPq55wd(UPDATED_WXT_JWT_PQ_55_WD);\n // Add required entity\n NextOfKin nextOfKin;\n if (TestUtil.findAll(em, NextOfKin.class).isEmpty()) {\n nextOfKin = NextOfKinResourceIT.createUpdatedEntity(em);\n em.persist(nextOfKin);\n em.flush();\n } else {\n nextOfKin = TestUtil.findAll(em, NextOfKin.class).get(0);\n }\n student.getRelatives().add(nextOfKin);\n return student;\n }",
"protected T createSimulatedExistingEntity() {\n final T entity = createNewEntity();\n entity.setId(IDUtil.randomPositiveLong());\n\n when(getDAO().findOne(entity.getId())).thenReturn(entity);\n return entity;\n }",
"public static Prestamo createUpdatedEntity(EntityManager em) {\n Prestamo prestamo = new Prestamo().observaciones(UPDATED_OBSERVACIONES).fechaFin(UPDATED_FECHA_FIN);\n // Add required entity\n Libro libro;\n if (TestUtil.findAll(em, Libro.class).isEmpty()) {\n libro = LibroResourceIT.createUpdatedEntity(em);\n em.persist(libro);\n em.flush();\n } else {\n libro = TestUtil.findAll(em, Libro.class).get(0);\n }\n prestamo.setLibro(libro);\n // Add required entity\n Persona persona;\n if (TestUtil.findAll(em, Persona.class).isEmpty()) {\n persona = PersonaResourceIT.createUpdatedEntity(em);\n em.persist(persona);\n em.flush();\n } else {\n persona = TestUtil.findAll(em, Persona.class).get(0);\n }\n prestamo.setPersona(persona);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n prestamo.setUser(user);\n return prestamo;\n }",
"public static SitAndGo createUpdatedEntity(EntityManager em) {\n SitAndGo sitAndGo = new SitAndGo()\n .format(UPDATED_FORMAT)\n .buyIn(UPDATED_BUY_IN)\n .ranking(UPDATED_RANKING)\n .profit(UPDATED_PROFIT)\n .bounty(UPDATED_BOUNTY);\n return sitAndGo;\n }",
"public static ItemSubstitution createUpdatedEntity(EntityManager em) {\n ItemSubstitution itemSubstitution = new ItemSubstitution()\n .timestamp(UPDATED_TIMESTAMP)\n .type(UPDATED_TYPE)\n .substituteType(UPDATED_SUBSTITUTE_TYPE)\n .substituteNo(UPDATED_SUBSTITUTE_NO)\n .description(UPDATED_DESCRIPTION)\n .isInterchangeable(UPDATED_IS_INTERCHANGEABLE)\n .relationsLevel(UPDATED_RELATIONS_LEVEL)\n .isCheckedToOriginal(UPDATED_IS_CHECKED_TO_ORIGINAL)\n .origCheckDate(UPDATED_ORIG_CHECK_DATE);\n // Add required entity\n Item item;\n if (TestUtil.findAll(em, Item.class).isEmpty()) {\n item = ItemResourceIT.createUpdatedEntity(em);\n em.persist(item);\n em.flush();\n } else {\n item = TestUtil.findAll(em, Item.class).get(0);\n }\n itemSubstitution.getItems().add(item);\n return itemSubstitution;\n }",
"Entity createEntity();",
"@PostConstruct\n protected void initNewEntity() {\n setNewEntity(getService().create());\n }",
"public static A createUpdatedEntity(EntityManager em) {\n A a = new A();\n return a;\n }",
"public static Testtable2 createUpdatedEntity(EntityManager em) {\n Testtable2 testtable2 = new Testtable2();\n testtable2.setColumn2(UPDATED_COLUMN_2);\n return testtable2;\n }",
"public static XepLoai createUpdatedEntity(EntityManager em) {\n XepLoai xepLoai = new XepLoai()\n .tenXepLoai(UPDATED_TEN_XEP_LOAI);\n return xepLoai;\n }",
"public static QuizQuestion createUpdatedEntity(EntityManager em) {\n QuizQuestion quizQuestion = new QuizQuestion()\n .text(UPDATED_TEXT)\n .description(UPDATED_DESCRIPTION);\n // Add required entity\n Quiz quiz;\n if (TestUtil.findAll(em, Quiz.class).isEmpty()) {\n quiz = QuizResourceIT.createUpdatedEntity(em);\n em.persist(quiz);\n em.flush();\n } else {\n quiz = TestUtil.findAll(em, Quiz.class).get(0);\n }\n quizQuestion.setQuiz(quiz);\n return quizQuestion;\n }",
"public static OrderItem createUpdatedEntity(EntityManager em) {\n OrderItem orderItem = new OrderItem().quantity(UPDATED_QUANTITY).totalPrice(UPDATED_TOTAL_PRICE).status(UPDATED_STATUS);\n return orderItem;\n }",
"public static Arrete createUpdatedEntity(EntityManager em) {\n Arrete arrete = new Arrete()\n .intituleArrete(UPDATED_INTITULE_ARRETE)\n .numeroArrete(UPDATED_NUMERO_ARRETE)\n .dateSignature(UPDATED_DATE_SIGNATURE)\n .nombreAgrement(UPDATED_NOMBRE_AGREMENT);\n return arrete;\n }",
"public static Note createUpdatedEntity(EntityManager em) {\n Note note = new Note().content(UPDATED_CONTENT).title(UPDATED_TITLE).xpos(UPDATED_XPOS).ypos(UPDATED_YPOS);\n return note;\n }",
"public static Unidade createUpdatedEntity(EntityManager em) {\n Unidade unidade = new Unidade()\n .descricao(UPDATED_DESCRICAO)\n .sigla(UPDATED_SIGLA)\n .situacao(UPDATED_SITUACAO)\n .controleDeEstoque(UPDATED_CONTROLE_DE_ESTOQUE)\n .idAlmoxarifado(UPDATED_ID_ALMOXARIFADO)\n .andar(UPDATED_ANDAR)\n .capacidade(UPDATED_CAPACIDADE)\n .horarioInicio(UPDATED_HORARIO_INICIO)\n .horarioFim(UPDATED_HORARIO_FIM)\n .localExame(UPDATED_LOCAL_EXAME)\n .rotinaDeFuncionamento(UPDATED_ROTINA_DE_FUNCIONAMENTO)\n .anexoDocumento(UPDATED_ANEXO_DOCUMENTO)\n .setor(UPDATED_SETOR)\n .idCentroDeAtividade(UPDATED_ID_CENTRO_DE_ATIVIDADE)\n .idChefia(UPDATED_ID_CHEFIA);\n // Add required entity\n TipoUnidade tipoUnidade;\n if (TestUtil.findAll(em, TipoUnidade.class).isEmpty()) {\n tipoUnidade = TipoUnidadeResourceIT.createUpdatedEntity(em);\n em.persist(tipoUnidade);\n em.flush();\n } else {\n tipoUnidade = TestUtil.findAll(em, TipoUnidade.class).get(0);\n }\n unidade.setTipoUnidade(tipoUnidade);\n return unidade;\n }",
"@Test\r\n public void testUpdate() throws Exception {\r\n MonitoriaEntity entity = data.get(0);\r\n PodamFactory pf = new PodamFactoryImpl();\r\n MonitoriaEntity nuevaEntity = pf.manufacturePojo(MonitoriaEntity.class);\r\n nuevaEntity.setId(entity.getId());\r\n persistence.update(nuevaEntity);\r\n// Assert.assertEquals(nuevaEntity.getName(), resp.getName());\r\n }",
"@Override\n protected void createEntity() {\n ProjectStatus status = createProjectStatus(5);\n setEntity(status);\n }",
"public static Restaurant createUpdatedEntity(EntityManager em) {\n Restaurant restaurant = new Restaurant()\n .restaurantName(UPDATED_RESTAURANT_NAME)\n .deliveryPrice(UPDATED_DELIVERY_PRICE)\n .restaurantAddress(UPDATED_RESTAURANT_ADDRESS)\n .restaurantCity(UPDATED_RESTAURANT_CITY);\n return restaurant;\n }",
"public static Enseigner createUpdatedEntity(EntityManager em) {\n Enseigner enseigner = new Enseigner().dateDebut(UPDATED_DATE_DEBUT).dateFin(UPDATED_DATE_FIN);\n return enseigner;\n }",
"public static Lot createUpdatedEntity(EntityManager em) {\n Lot lot = new Lot()\n .createdAt(UPDATED_CREATED_AT)\n .updatedAt(UPDATED_UPDATED_AT)\n .qte(UPDATED_QTE)\n .qtUg(UPDATED_QT_UG)\n .num(UPDATED_NUM)\n .dateFabrication(UPDATED_DATE_FABRICATION)\n .peremption(UPDATED_PEREMPTION)\n .peremptionstatus(UPDATED_PEREMPTIONSTATUS);\n return lot;\n }",
"void createOrUpdate(T entity);",
"public static EnteteVente createUpdatedEntity(EntityManager em) {\n EnteteVente enteteVente = new EnteteVente()\n .enteteVenteType(UPDATED_ENTETE_VENTE_TYPE)\n .enteteVenteTotalHT(UPDATED_ENTETE_VENTE_TOTAL_HT)\n .enteteVenteTotalTTC(UPDATED_ENTETE_VENTE_TOTAL_TTC)\n .enteteVenteDateCreation(UPDATED_ENTETE_VENTE_DATE_CREATION);\n return enteteVente;\n }",
"public static TaskComment createUpdatedEntity(EntityManager em) {\n TaskComment taskComment = new TaskComment()\n .value(UPDATED_VALUE);\n // Add required entity\n Task newTask = TaskResourceIT.createUpdatedEntity(em);\n Task task = TestUtil.findAll(em, Task.class).stream()\n .filter(x -> x.getId().equals(newTask.getId()))\n .findAny().orElse(null);\n if (task == null) {\n task = newTask;\n em.persist(task);\n em.flush();\n }\n taskComment.setTask(task);\n return taskComment;\n }",
"protected abstract ENTITY createEntity();",
"public static Articulo createUpdatedEntity(EntityManager em) {\n Articulo articulo = new Articulo()\n .titulo(UPDATED_TITULO)\n .contenido(UPDATED_CONTENIDO)\n .fechaCreacion(UPDATED_FECHA_CREACION);\n return articulo;\n }",
"public static Bounty createUpdatedEntity() {\n Bounty bounty = new Bounty()\n// .status(UPDATED_STATUS)\n// .issueUrl(UPDATED_URL)\n .amount(UPDATED_AMOUNT)\n// .experience(UPDATED_EXPERIENCE)\n// .commitment(UPDATED_COMMITMENT)\n// .type(UPDATED_TYPE)\n// .category(UPDATED_CATEGORY)\n// .keywords(UPDATED_KEYWORDS)\n .permission(UPDATED_PERMISSION)\n .expiryDate(UPDATED_EXPIRES);\n return bounty;\n }",
"TestEntity buildEntity () {\n TestEntity testEntity = new TestEntity();\n testEntity.setName(\"Test name\");\n testEntity.setCheck(true);\n testEntity.setDateCreated(new Date(System.currentTimeMillis()));\n testEntity.setDescription(\"description\");\n\n Specialization specialization = new Specialization();\n specialization.setName(\"Frontend\");\n specialization.setLevel(\"Senior\");\n specialization.setYears(10);\n\n testEntity.setSpecialization(specialization);\n\n return testEntity;\n }",
"public static GoodsReceiptDetails createUpdatedEntity(EntityManager em) {\n GoodsReceiptDetails goodsReceiptDetails = new GoodsReceiptDetails()\n .grnQty(UPDATED_GRN_QTY);\n return goodsReceiptDetails;\n }",
"public static Emprunt createUpdatedEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(UPDATED_DATE_EMPRUNT);\n return emprunt;\n }",
"public static AnnotationType createUpdatedEntity() {\n return new AnnotationType()\n .name(UPDATED_NAME)\n .label(UPDATED_LABEL)\n .description(UPDATED_DESCRIPTION)\n .emotional(UPDATED_EMOTIONAL)\n .weight(UPDATED_WEIGHT)\n .color(UPDATED_COLOR)\n .projectId(DEFAULT_PROJECT_ID);\n }",
"public static Invoice createUpdatedEntity(EntityManager em) {\n Invoice invoice = new Invoice()\n .companyName(UPDATED_COMPANY_NAME)\n .userName(UPDATED_USER_NAME)\n .userLastName(UPDATED_USER_LAST_NAME)\n .userEmail(UPDATED_USER_EMAIL)\n .dateCreated(UPDATED_DATE_CREATED)\n .total(UPDATED_TOTAL)\n .subTotal(UPDATED_SUB_TOTAL)\n .tax(UPDATED_TAX)\n .purchaseDescription(UPDATED_PURCHASE_DESCRIPTION)\n .itemQuantity(UPDATED_ITEM_QUANTITY)\n .itemPrice(UPDATED_ITEM_PRICE);\n return invoice;\n }",
"public static TypeOeuvre createUpdatedEntity(EntityManager em) {\n TypeOeuvre typeOeuvre = new TypeOeuvre()\n .intitule(UPDATED_INTITULE);\n return typeOeuvre;\n }",
"public static Demand createUpdatedEntity(EntityManager em) {\n Demand demand = new Demand()\n .name(UPDATED_NAME)\n .value(UPDATED_VALUE);\n return demand;\n }",
"public static Acheteur createUpdatedEntity(EntityManager em) {\n Acheteur acheteur = new Acheteur()\n .typeClient(UPDATED_TYPE_CLIENT)\n .nom(UPDATED_NOM)\n .prenom(UPDATED_PRENOM)\n .tel(UPDATED_TEL)\n .cnib(UPDATED_CNIB)\n .email(UPDATED_EMAIL)\n .adresse(UPDATED_ADRESSE)\n .numroBanquaire(UPDATED_NUMRO_BANQUAIRE)\n .deleted(UPDATED_DELETED);\n return acheteur;\n }",
"T createEntity();",
"public static MGachaRendition createUpdatedEntity(EntityManager em) {\n MGachaRendition mGachaRendition = new MGachaRendition()\n .mainPrefabName(UPDATED_MAIN_PREFAB_NAME)\n .resultExpectedUpPrefabName(UPDATED_RESULT_EXPECTED_UP_PREFAB_NAME)\n .resultQuestionPrefabName(UPDATED_RESULT_QUESTION_PREFAB_NAME)\n .soundSwitchEventName(UPDATED_SOUND_SWITCH_EVENT_NAME);\n return mGachaRendition;\n }",
"E create(E entity);",
"E create(E entity);",
"public static BII createUpdatedEntity() {\n BII bII = new BII()\n .name(UPDATED_NAME)\n .type(UPDATED_TYPE)\n .biiId(UPDATED_BII_ID)\n .detectionTimestamp(UPDATED_DETECTION_TIMESTAMP)\n .sourceId(UPDATED_SOURCE_ID)\n .detectionSystemName(UPDATED_DETECTION_SYSTEM_NAME)\n .detectedValue(UPDATED_DETECTED_VALUE)\n .detectionContext(UPDATED_DETECTION_CONTEXT)\n .etc(UPDATED_ETC)\n .etcetc(UPDATED_ETCETC);\n return bII;\n }",
"public static EnrollmentDate createUpdatedEntity(EntityManager em) {\n EnrollmentDate enrollmentDate = new EnrollmentDate()\n .name(UPDATED_NAME)\n .isPreEnrollment(UPDATED_IS_PRE_ENROLLMENT)\n .startDate(UPDATED_START_DATE)\n .endDate(UPDATED_END_DATE);\n // Add required entity\n Semester semester;\n if (TestUtil.findAll(em, Semester.class).isEmpty()) {\n semester = SemesterResourceIT.createUpdatedEntity(em);\n em.persist(semester);\n em.flush();\n } else {\n semester = TestUtil.findAll(em, Semester.class).get(0);\n }\n enrollmentDate.setSemester(semester);\n return enrollmentDate;\n }",
"public static Posicion createUpdatedEntity(EntityManager em) {\n Posicion posicion = new Posicion()\n .titulo(UPDATED_TITULO)\n .descripcion(UPDATED_DESCRIPCION)\n .numeroPuestos(UPDATED_NUMERO_PUESTOS)\n .salarioMinimo(UPDATED_SALARIO_MINIMO)\n .salarioMaximo(UPDATED_SALARIO_MAXIMO)\n .fechaAlta(UPDATED_FECHA_ALTA)\n .fechaNecesidad(UPDATED_FECHA_NECESIDAD);\n return posicion;\n }",
"@Test\n void updateSuccess () {\n TestEntity testEntity = buildEntity();\n Api2 instance = new Api2();\n Long result = instance.save(testEntity);\n\n String name = \"Edited name\";\n boolean check = false;\n String description = \"edited description\";\n\n if (result != null) {\n testEntity.setName(name);\n testEntity.setCheck(check);\n testEntity.setDescription(description);\n instance.update(testEntity);\n\n Optional<TestEntity> optionalTestEntity = instance.getById(TestEntity.class, testEntity.getId());\n assertTrue(optionalTestEntity.isPresent());\n\n if (optionalTestEntity.isPresent()) {\n TestEntity entity = optionalTestEntity.get();\n\n assertEquals(entity.getName(), name);\n assertEquals(entity.getDescription(), description);\n assertEquals(entity.isCheck(), check);\n } else {\n fail();\n }\n } else {\n fail();\n }\n }",
"public static Poen createUpdatedEntity(EntityManager em) {\n Poen poen = new Poen()\n .tip(UPDATED_TIP);\n return poen;\n }",
"public static OrderDetailInfo createUpdatedEntity(EntityManager em) {\n OrderDetailInfo orderDetailInfo = new OrderDetailInfo()\n .productName(UPDATED_PRODUCT_NAME)\n .priceProduct(UPDATED_PRICE_PRODUCT)\n .quantityOrder(UPDATED_QUANTITY_ORDER)\n .amount(UPDATED_AMOUNT)\n .orderDate(UPDATED_ORDER_DATE);\n return orderDetailInfo;\n }",
"public static ProcessExecution createUpdatedEntity(EntityManager em) {\n ProcessExecution processExecution = new ProcessExecution()\n .execution(UPDATED_EXECUTION);\n return processExecution;\n }",
"public static Incident createUpdatedEntity(EntityManager em) {\n Incident incident = new Incident()\n .title(UPDATED_TITLE)\n .risk(UPDATED_RISK)\n .notes(UPDATED_NOTES);\n return incident;\n }",
"public static Territorio createUpdatedEntity(EntityManager em) {\n Territorio territorio = new Territorio().nome(UPDATED_NOME);\n return territorio;\n }",
"public static Invite createUpdatedEntity(EntityManager em) {\n Invite invite = new Invite()\n .nom(UPDATED_NOM)\n .prenom(UPDATED_PRENOM)\n .mail(UPDATED_MAIL)\n .mdp(UPDATED_MDP)\n .login(UPDATED_LOGIN)\n .points(UPDATED_POINTS);\n return invite;\n }",
"public static DataModel createUpdatedEntity(EntityManager em) {\n DataModel dataModel = new DataModel()\n .key(UPDATED_KEY)\n .label(UPDATED_LABEL)\n .dataFormat(UPDATED_DATA_FORMAT)\n .maxLength(UPDATED_MAX_LENGTH)\n .precision(UPDATED_PRECISION)\n .modelValues(UPDATED_MODEL_VALUES);\n return dataModel;\n }",
"void create(T entity);",
"public static Horaire createUpdatedEntity(EntityManager em) {\n Horaire horaire = new Horaire()\n .heureDepart(UPDATED_HEURE_DEPART)\n .heureFin(UPDATED_HEURE_FIN)\n .dateJour(UPDATED_DATE_JOUR);\n return horaire;\n }",
"public static Empleado createUpdatedEntity(EntityManager em) {\n Empleado empleado = new Empleado()\n .nombre(UPDATED_NOMBRE)\n .primerApellido(UPDATED_PRIMER_APELLIDO)\n .segundoApellido(UPDATED_SEGUNDO_APELLIDO)\n .sexo(UPDATED_SEXO)\n .fechaNacimiento(UPDATED_FECHA_NACIMIENTO)\n .fechaIngreso(UPDATED_FECHA_INGRESO)\n .salario(UPDATED_SALARIO)\n .puesto(UPDATED_PUESTO)\n .estado(UPDATED_ESTADO);\n return empleado;\n }",
"public static Allegato createUpdatedEntity(EntityManager em) {\n Allegato allegato = new Allegato()\n .nomeAttachment(UPDATED_NOME_ATTACHMENT)\n .algoritmoCompressione(UPDATED_ALGORITMO_COMPRESSIONE)\n .formatoAttachment(UPDATED_FORMATO_ATTACHMENT)\n .descrizioneAttachment(UPDATED_DESCRIZIONE_ATTACHMENT)\n .attachment(UPDATED_ATTACHMENT);\n return allegato;\n }",
"public static NoteMaster createUpdatedEntity(EntityManager em) {\n NoteMaster noteMaster = new NoteMaster()\n .semestre(UPDATED_SEMESTRE)\n .noteCC1(UPDATED_NOTE_CC_1)\n .noteCC2(UPDATED_NOTE_CC_2)\n .noteFinal(UPDATED_NOTE_FINAL)\n .date(UPDATED_DATE);\n return noteMaster;\n }",
"public static TaskExecution createUpdatedEntity(EntityManager em) {\n TaskExecution taskExecution = new TaskExecution()\n .jobOrderTimestamp(UPDATED_JOB_ORDER_TIMESTAMP)\n .taskExecutionStatus(UPDATED_TASK_EXECUTION_STATUS)\n .taskExecutionStartTimestamp(UPDATED_TASK_EXECUTION_START_TIMESTAMP)\n .taskExecutionEndTimestamp(UPDATED_TASK_EXECUTION_END_TIMESTAMP);\n return taskExecution;\n }",
"void create(E entity);",
"public static WorkPlace createUpdatedEntity(EntityManager em) {\n WorkPlace workPlace = new WorkPlace()\n .doctorIdpCode(UPDATED_DOCTOR_IDP_CODE)\n .name(UPDATED_NAME)\n .locationName(UPDATED_LOCATION_NAME)\n .location(UPDATED_LOCATION);\n return workPlace;\n }",
"public static EventAttendance createUpdatedEntity(EntityManager em) {\n EventAttendance eventAttendance = new EventAttendance()\n .attendanceDate(UPDATED_ATTENDANCE_DATE);\n return eventAttendance;\n }",
"public static Fornecedor createUpdatedEntity(EntityManager em) {\n Fornecedor fornecedor = new Fornecedor()\n .tipo(UPDATED_TIPO)\n .cpf(UPDATED_CPF)\n .cnpj(UPDATED_CNPJ)\n .primeiroNome(UPDATED_PRIMEIRO_NOME)\n .nomeMeio(UPDATED_NOME_MEIO)\n .sobreNome(UPDATED_SOBRE_NOME)\n .saudacao(UPDATED_SAUDACAO)\n .titulo(UPDATED_TITULO)\n .cep(UPDATED_CEP)\n .tipoLogradouro(UPDATED_TIPO_LOGRADOURO)\n .nomeLogradouro(UPDATED_NOME_LOGRADOURO)\n .complemento(UPDATED_COMPLEMENTO);\n return fornecedor;\n }",
"public Entity newEntity() { return newMyEntity(); }",
"public Entity newEntity() { return newMyEntity(); }",
"public static Transaction createUpdatedEntity(EntityManager em) {\n Transaction transaction = new Transaction()\n .date(UPDATED_DATE);\n return transaction;\n }",
"public static Author createUpdatedEntity(EntityManager em) {\n Author author = new Author()\n .firstName(UPDATED_FIRST_NAME)\n .lastName(UPDATED_LAST_NAME);\n return author;\n }",
"public static IndActivation createUpdatedEntity(EntityManager em) {\n IndActivation indActivation = new IndActivation()\n .name(UPDATED_NAME)\n .activity(UPDATED_ACTIVITY)\n .customerId(UPDATED_CUSTOMER_ID)\n .individualId(UPDATED_INDIVIDUAL_ID);\n return indActivation;\n }",
"public void updateEntity();",
"public EntityType initUpdateEntity(DtoType dto) throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException;",
"public static MQuestSpecialReward createUpdatedEntity(EntityManager em) {\n MQuestSpecialReward mQuestSpecialReward = new MQuestSpecialReward()\n .groupId(UPDATED_GROUP_ID)\n .weight(UPDATED_WEIGHT)\n .rank(UPDATED_RANK)\n .contentType(UPDATED_CONTENT_TYPE)\n .contentId(UPDATED_CONTENT_ID)\n .contentAmount(UPDATED_CONTENT_AMOUNT);\n return mQuestSpecialReward;\n }",
"protected abstract EntityBase createEntity() throws Exception;",
"public static Sectie createUpdatedEntity(EntityManager em) {\n Sectie sectie = new Sectie()\n .sectieId(UPDATED_SECTIE_ID)\n .nume(UPDATED_NUME)\n .sefId(UPDATED_SEF_ID)\n .tag(UPDATED_TAG)\n .nrPaturi(UPDATED_NR_PATURI);\n return sectie;\n }",
"public static RolEmpleado createUpdatedEntity(EntityManager em) {\n RolEmpleado rolEmpleado = new RolEmpleado();\n return rolEmpleado;\n }",
"public static ExUser createUpdatedEntity(EntityManager em) {\n ExUser exUser = new ExUser()\n .userKey(UPDATED_USER_KEY);\n return exUser;\n }",
"public static ConceptDataType createUpdatedEntity(EntityManager em) {\n ConceptDataType conceptDataType = new ConceptDataType()\n .uuid(UPDATED_UUID)\n .name(UPDATED_NAME)\n .hl7Abbreviation(UPDATED_HL_7_ABBREVIATION)\n .description(UPDATED_DESCRIPTION);\n return conceptDataType;\n }",
"public static Info createUpdatedEntity(EntityManager em) {\n Info info = new Info()\n .nom(UPDATED_NOM)\n .prenom(UPDATED_PRENOM)\n .etablissement(UPDATED_ETABLISSEMENT);\n return info;\n }",
"public static Dishestype createUpdatedEntity(EntityManager em) {\n Dishestype dishestype = new Dishestype()\n .name(UPDATED_NAME)\n .state(UPDATED_STATE)\n .creator(UPDATED_CREATOR)\n .createdate(UPDATED_CREATEDATE)\n .modifier(UPDATED_MODIFIER)\n .modifierdate(UPDATED_MODIFIERDATE)\n .modifiernum(UPDATED_MODIFIERNUM)\n .logicdelete(UPDATED_LOGICDELETE)\n .other(UPDATED_OTHER);\n return dishestype;\n }",
"public static UserDetails createUpdatedEntity(EntityManager em) {\n UserDetails userDetails = new UserDetails()\n .studentCardNumber(UPDATED_STUDENT_CARD_NUMBER)\n .name(UPDATED_NAME)\n .surname(UPDATED_SURNAME)\n .telephoneNumber(UPDATED_TELEPHONE_NUMBER)\n .studyYear(UPDATED_STUDY_YEAR)\n .faculty(UPDATED_FACULTY)\n .fieldOfStudy(UPDATED_FIELD_OF_STUDY);\n return userDetails;\n }",
"public static QueryData createUpdatedEntity(EntityManager em) {\n QueryData queryData = new QueryData()\n .dataValue(UPDATED_DATA_VALUE);\n return queryData;\n }",
"E update(E entity);",
"E update(E entity);",
"public static Pessoa createUpdatedEntity(EntityManager em) {\n Pessoa pessoa = new Pessoa()\n .nome(UPDATED_NOME)\n .email(UPDATED_EMAIL)\n .telefone(UPDATED_TELEFONE)\n .dataNascimento(UPDATED_DATA_NASCIMENTO)\n .cadastro(UPDATED_CADASTRO);\n return pessoa;\n }",
"public static Source createUpdatedEntity(EntityManager em) {\n Source source = new Source()\n .idGloden(UPDATED_ID_GLODEN)\n .name(UPDATED_NAME)\n .description(UPDATED_DESCRIPTION)\n .updateDate(UPDATED_UPDATE_DATE)\n .creationDate(UPDATED_CREATION_DATE);\n return source;\n }",
"public static InventoryProvider createUpdatedEntity(EntityManager em) {\n InventoryProvider inventoryProvider = new InventoryProvider()\n .idInventoryProvider(UPDATED_ID_INVENTORY_PROVIDER)\n .code(UPDATED_CODE)\n .name(UPDATED_NAME)\n .price(UPDATED_PRICE)\n .cuantity(UPDATED_CUANTITY);\n return inventoryProvider;\n }",
"public static Userextra createUpdatedEntity(EntityManager em) {\n Userextra userextra = new Userextra().accountype(UPDATED_ACCOUNTYPE);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n userextra.setUser(user);\n return userextra;\n }",
"void create(T entity) throws Exception;",
"public static ListWrkStatus createUpdatedEntity(EntityManager em) {\n ListWrkStatus listWrkStatus = new ListWrkStatus()\n .code(UPDATED_CODE)\n .name(UPDATED_NAME)\n .fullName(UPDATED_FULL_NAME)\n .isCurrentFlag(UPDATED_IS_CURRENT_FLAG)\n .description(UPDATED_DESCRIPTION)\n .dateCreate(UPDATED_DATE_CREATE)\n .dateEdit(UPDATED_DATE_EDIT)\n .creator(UPDATED_CREATOR)\n .editor(UPDATED_EDITOR);\n // Add required entity\n ListWrkKind listWrkKind;\n if (TestUtil.findAll(em, ListWrkKind.class).isEmpty()) {\n listWrkKind = ListWrkKindResourceIT.createUpdatedEntity(em);\n em.persist(listWrkKind);\n em.flush();\n } else {\n listWrkKind = TestUtil.findAll(em, ListWrkKind.class).get(0);\n }\n listWrkStatus.setIdWrkKind(listWrkKind);\n return listWrkStatus;\n }",
"public static DoctorAssistant createUpdatedEntity(EntityManager em) {\n DoctorAssistant doctorAssistant = new DoctorAssistant()\n .canPrescribe(UPDATED_CAN_PRESCRIBE);\n return doctorAssistant;\n }",
"public static Kpi createUpdatedEntity(EntityManager em) {\n Kpi kpi = new Kpi()\n .title(UPDATED_TITLE)\n .reward(UPDATED_REWARD)\n .rewardDistribution(UPDATED_REWARD_DISTRIBUTION)\n .gradingProcess(UPDATED_GRADING_PROCESS)\n .active(UPDATED_ACTIVE)\n .purpose(UPDATED_PURPOSE)\n .scopeOfWork(UPDATED_SCOPE_OF_WORK)\n .rewardDistributionInfo(UPDATED_REWARD_DISTRIBUTION_INFO)\n .reporting(UPDATED_REPORTING)\n .fiatPoolFactor(UPDATED_FIAT_POOL_FACTOR)\n .grading(UPDATED_GRADING);\n return kpi;\n }",
"private FailingEntity createFailingEntity() {\n FailingEntity entity = app.createAndManageChild(EntitySpec.create(FailingEntity.class)\n .configure(FailingEntity.FAIL_ON_START, true));\n return entity;\n }",
"public static Location createUpdatedEntity(EntityManager em) {\n Location location = new Location()\n .name(UPDATED_NAME)\n .latitude(UPDATED_LATITUDE)\n .longitude(UPDATED_LONGITUDE)\n .details(UPDATED_DETAILS)\n .activated(UPDATED_ACTIVATED);\n return location;\n }",
"public static Favorite createUpdatedEntity(EntityManager em) {\n Favorite favorite = new Favorite();\n return favorite;\n }",
"public static ModePassation createUpdatedEntity(EntityManager em) {\n ModePassation modePassation = new ModePassation()\n .libelle(UPDATED_LIBELLE)\n .code(UPDATED_CODE)\n .description(UPDATED_DESCRIPTION);\n return modePassation;\n }",
"public static TipoObra createUpdatedEntity(EntityManager em) {\n TipoObra tipoObra = new TipoObra().descripcion(UPDATED_DESCRIPCION);\n return tipoObra;\n }",
"public static LifeConstantUnit createUpdatedEntity(EntityManager em) {\n LifeConstantUnit lifeConstantUnit = new LifeConstantUnit()\n .name(UPDATED_NAME)\n .description(UPDATED_DESCRIPTION);\n return lifeConstantUnit;\n }",
"public static Timbre createUpdatedEntity(EntityManager em) {\n Timbre timbre = new Timbre().timbre(UPDATED_TIMBRE);\n return timbre;\n }",
"public static UserExtra createUpdatedEntity(EntityManager em) {\n UserExtra userExtra = new UserExtra().currentParkingSpot(UPDATED_CURRENT_PARKING_SPOT).timeOfParking(UPDATED_TIME_OF_PARKING);\n return userExtra;\n }",
"public static MChallengeQuestWorld createUpdatedEntity(EntityManager em) {\n MChallengeQuestWorld mChallengeQuestWorld = new MChallengeQuestWorld()\n .setId(UPDATED_SET_ID)\n .number(UPDATED_NUMBER)\n .name(UPDATED_NAME)\n .imagePath(UPDATED_IMAGE_PATH)\n .backgroundImagePath(UPDATED_BACKGROUND_IMAGE_PATH)\n .description(UPDATED_DESCRIPTION)\n .stageUnlockPattern(UPDATED_STAGE_UNLOCK_PATTERN)\n .arousalBanner(UPDATED_AROUSAL_BANNER)\n .specialRewardContentType(UPDATED_SPECIAL_REWARD_CONTENT_TYPE)\n .specialRewardContentId(UPDATED_SPECIAL_REWARD_CONTENT_ID)\n .isEnableCoop(UPDATED_IS_ENABLE_COOP);\n return mChallengeQuestWorld;\n }",
"public static TypeIntervention createUpdatedEntity(EntityManager em) {\n TypeIntervention typeIntervention = new TypeIntervention()\n .libelle(UPDATED_LIBELLE);\n return typeIntervention;\n }",
"public static ItemSubstitution createEntity(EntityManager em) {\n ItemSubstitution itemSubstitution = new ItemSubstitution()\n .timestamp(DEFAULT_TIMESTAMP)\n .type(DEFAULT_TYPE)\n .substituteType(DEFAULT_SUBSTITUTE_TYPE)\n .substituteNo(DEFAULT_SUBSTITUTE_NO)\n .description(DEFAULT_DESCRIPTION)\n .isInterchangeable(DEFAULT_IS_INTERCHANGEABLE)\n .relationsLevel(DEFAULT_RELATIONS_LEVEL)\n .isCheckedToOriginal(DEFAULT_IS_CHECKED_TO_ORIGINAL)\n .origCheckDate(DEFAULT_ORIG_CHECK_DATE);\n // Add required entity\n Item item;\n if (TestUtil.findAll(em, Item.class).isEmpty()) {\n item = ItemResourceIT.createEntity(em);\n em.persist(item);\n em.flush();\n } else {\n item = TestUtil.findAll(em, Item.class).get(0);\n }\n itemSubstitution.getItems().add(item);\n return itemSubstitution;\n }",
"public void createNewObject(Representation entity) throws ResourceException {\r\n\t\tT entry = createObjectFromHeaders(null, entity);\r\n\t\texecuteUpdate(entity, entry, createUpdateObject(entry));\r\n\r\n\t}",
"public static Category createUpdatedEntity(EntityManager em) {\n Category category = new Category()\n .label(UPDATED_LABEL)\n .primaryColor(UPDATED_PRIMARY_COLOR)\n .secondaryColor(UPDATED_SECONDARY_COLOR);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n category.setOwner(user);\n return category;\n }",
"public static TestEntity createEntity(EntityManager em) {\n TestEntity testEntity = new TestEntity();\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n testEntity.setUserOneToMany(user);\n return testEntity;\n }",
"public static Course createUpdatedEntity(EntityManager em) {\n Course course = new Course()\n .title(UPDATED_TITLE)\n .description(UPDATED_DESCRIPTION)\n .courseStartDate(UPDATED_COURSE_START_DATE)\n .courseEndDate(UPDATED_COURSE_END_DATE)\n .registerStartDate(UPDATED_REGISTER_START_DATE)\n .registerEndDate(UPDATED_REGISTER_END_DATE)\n .duration(UPDATED_DURATION)\n .maximumNumberOfParticipants(UPDATED_MAXIMUM_NUMBER_OF_PARTICIPANTS)\n .minimalNumberOfParticipants(UPDATED_MINIMAL_NUMBER_OF_PARTICIPANTS)\n .lecturerName(UPDATED_LECTURER_NAME)\n .lecturerSurname(UPDATED_LECTURER_SURNAME)\n .pointPerCourse(UPDATED_POINT_PER_COURSE)\n .isVisibleInApp(UPDATED_IS_VISIBLE_IN_APP);\n return course;\n }"
] | [
"0.6943711",
"0.67901313",
"0.67868626",
"0.6717226",
"0.6693232",
"0.66920424",
"0.6664151",
"0.663629",
"0.6621506",
"0.651395",
"0.6509064",
"0.6447006",
"0.6423055",
"0.6420765",
"0.64195627",
"0.641512",
"0.64126587",
"0.6409344",
"0.6403627",
"0.63938785",
"0.6390684",
"0.63887507",
"0.6381457",
"0.6360957",
"0.6341597",
"0.63414603",
"0.6329691",
"0.6323586",
"0.6318582",
"0.63109",
"0.62988335",
"0.62748015",
"0.62703687",
"0.6269078",
"0.62639505",
"0.6260746",
"0.62558866",
"0.62558866",
"0.62557036",
"0.62366754",
"0.62263167",
"0.61836076",
"0.6176979",
"0.61732566",
"0.6165269",
"0.61628",
"0.6156278",
"0.61354333",
"0.613381",
"0.6129386",
"0.6124798",
"0.6117365",
"0.6116238",
"0.61159945",
"0.6115941",
"0.6114726",
"0.61018556",
"0.61016244",
"0.6089815",
"0.6085106",
"0.6085106",
"0.6073584",
"0.60672337",
"0.6063405",
"0.60605013",
"0.6052787",
"0.6048278",
"0.60459554",
"0.60458124",
"0.60320777",
"0.602921",
"0.6024936",
"0.60234094",
"0.6013431",
"0.6011157",
"0.6005783",
"0.6002495",
"0.6002495",
"0.5995577",
"0.59866637",
"0.59807175",
"0.597776",
"0.5970283",
"0.5965873",
"0.5965348",
"0.5961268",
"0.5952866",
"0.59480345",
"0.5943977",
"0.5943856",
"0.5941346",
"0.59386426",
"0.5936874",
"0.5935027",
"0.59322983",
"0.59232545",
"0.5919068",
"0.5914427",
"0.5910453",
"0.59098834",
"0.5909536"
] | 0.0 | -1 |
Create the Questions with an existing ID | @Test
@Transactional
void createQuestionsWithExistingId() throws Exception {
questions.setId(1L);
QuestionsDTO questionsDTO = questionsMapper.toDto(questions);
int databaseSizeBeforeCreate = questionsRepository.findAll().size();
// An entity with an existing ID cannot be created, so this API call must fail
restQuestionsMockMvc
.perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(questionsDTO)))
.andExpect(status().isBadRequest());
// Validate the Questions in the database
List<Questions> questionsList = questionsRepository.findAll();
assertThat(questionsList).hasSize(databaseSizeBeforeCreate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);",
"public void addTopicQuestion(int id, int tId, int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_TID, tId);\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_TOPICS_QUESTIONS, null, values);\r\n\r\n db.close();\r\n }",
"public void createSurvey(int tid);",
"int createSurvey(List<Question> questions, String userId);",
"public void addExamTopicQuestion(int id, int eId, int tId, int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_EID, eId);\r\n values.put(KEY_TID, tId);\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_EXAMS_TOPICS_QUESTIONS, null, values);\r\n\r\n db.close();\r\n }",
"public com.vportal.portlet.vfaq.model.FAQComment create(long id);",
"void addQuestions(String surveyId, List<Question> questions);",
"public void addQuestionNote(int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_QUESTION_NOTES, null, values);\r\n\r\n db.close();\r\n }",
"public boolean createQuestion(int qID, int cID, String q, String a1, String a2, String a3, String a4, String a5, int correctAns) {\n try {\n Connection con = Database.createDBconnection();\n String ins = \"INSERT into question (question_ID, category_ID, question, ans1, ans2, ans3, ans4, ans5, correct_answer, point_value) values ('\"\n + qID + \"','\" + cID + \"','\" + q + \"','\" + a1 + \"','\" + a2 + \"','\" + a3 + \"','\" + a4 + \"','\" + a5 + \"','\" + correctAns + \"','\" + 10 + \"');\";\n Statement ins_stmt = con.createStatement();\n ins_stmt.executeUpdate(ins);\n\n Database.closeDBconnection(con);\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }",
"public void setQuestions(){\r\n question.setTestname(test.getText().toString());\r\n question.setQuestion(ques.getText().toString());\r\n question.setOption1(opt1.getText().toString());\r\n question.setOption2(opt2.getText().toString());\r\n question.setOption3(opt3.getText().toString());\r\n int num = Integer.parseInt(correct.getText().toString());\r\n question.setAnswerNumber(num);\r\n long check = db.addToDb(question);\r\n if(check == -1){\r\n Toast.makeText(getBaseContext(), \"Question already exists\", Toast.LENGTH_LONG).show();\r\n }else{\r\n Toast.makeText(getBaseContext(), \"Question added\", Toast.LENGTH_LONG).show();\r\n }\r\n }",
"public QueryQuestions saveQuestion(String question) {\n String uniqueId = UUID.randomUUID().toString();\n QueryQuestions queryQuestions1 = new QueryQuestions(uniqueId,question);\n QueryQuestions savedQueryQuestions = questionRepository.save(queryQuestions1);\n return savedQueryQuestions;\n }",
"@Override\n public void add(Question q) {\n try {\n c = DBConncetion.getConnection();\n int type = q.getType() == MultipleChoice ? 1 : 2; // 1 = MC , 2 = FB\n System.out.println(type);\n String sql = \"Insert into mainquestion \\n\" +\n \"Values (?,?,?,?,0,0,0)\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,q.getTitle());\n pstmt.setString(3,String.valueOf(q.getTime()));\n pstmt.setString(4,String.valueOf(type));\n pstmt.executeUpdate();\n if (type == 1) {\n sql = \"Insert into multiplechoice \\n\" +\n \"Values (?,?,?,?,?,?)\";\n MultipleChoice mc = (MultipleChoice) q;\n String[] answers = mc.getAnswers();\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,answers[0]);\n pstmt.setString(3,answers[1]);\n pstmt.setString(4,answers[2]);\n pstmt.setString(5,answers[3]);\n pstmt.setString(6,mc.getCorrectAnswers());\n pstmt.executeUpdate();\n } else {\n sql = \"Insert into fill_blank Values(?,?)\";\n FillBlank fb = (FillBlank) q;\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,fb.getCorrectAnswer());\n pstmt.executeUpdate();\n }\n } catch (Exception e) {\n throw new LoadSaveException(\"Error while adding\");\n }\n }",
"public void addQuestion(Question question);",
"@Override\n\tpublic Questions addQuestions(long testId, Questions question) throws TestMSException {\n\t\treturn null;\n\t}",
"public void addQuiz(Quiz quiz){\n \t\tString id = quiz.getQuizId();\n \t\tString date = quiz.getDateCreated();\n \t\tString creatorId = quiz.getCreatorId();\n \t\tint numQuestions = quiz.getNumQuestions();\n \t\tboolean isRandom = quiz.getIsRandom();\n \t\tboolean isOnePage = quiz.getIsOnePage();\n \t\tboolean isImmediate = quiz.getIsImmediate();\n \t\tint numTimesTaken = 0;\n \t\tString imageURL = quiz.getImageURL();\n \t\tString description = quiz.getDescription();\n \t\tString query = \"INSERT INTO quizzes VALUES('\" + id + \"', '\" + date + \"', '\" + creatorId + \"', \" \n \t\t\t\t+ numQuestions + \", \" + isRandom + \", \" + isOnePage + \", \" + isImmediate + \", \" \n \t\t\t\t+ numTimesTaken + \", '\" + imageURL + \"', '\" + description + \"');\";\n \t\tsqlUpdate(query);\n \t\t\n \t\t// TODO!!!! add each question as well\n \t\tArrayList<Question> questions = quiz.getQuestions();\n \t\tfor(Question q : questions){\n \t\t\tint questionNum = q.getNumber();\n \t\t\t/*ArrayList<String> answers = q.getAnswers();\n \t\t\tfor (String a : answers){\n \t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t}*/\n \t\t\tif(q instanceof MultipleChoice){\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tquery = \"INSERT INTO multiple_choice VALUES('\" + id + \"', '\" + questionNum + \"', '\" + q.getQuestion() + \"', '\" + answers.get(0) + \"', '\" + answers.get(1) + \"', '\" + answers.get(2) + \"', '\" + answers.get(3) + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', \" + questionNum + \", '\" + ((MultipleChoice) q).getCorrectAnswer() + \"');\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t} else if(q instanceof QuestionResponse){\n \t\t\t\tquery = \"INSERT INTO question_response VALUES('\" + id + \"', '\" + questionNum + \"', '\" + q.getQuestion() + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tfor (String a : answers){\n \t\t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t\t\tsqlUpdate(query);\n \t\t\t\t}\n \t\t\t} else if(q instanceof Picture){\n \t\t\t\tquery = \"INSERT INTO picture VALUES('\" + id + \"', '\" + questionNum + \"', '\" + q.getQuestion() + \"', '\" + ((Picture) q).getUrl() + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tfor (String a : answers){\n \t\t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t\t\tsqlUpdate(query);\n \t\t\t\t}\n \t\t\t} else if(q instanceof FillInBlank){\n \t\t\t\tArrayList<String> questionsArray = ((FillInBlank) q).getQuestions();\n \t\t\t\tquery = \"INSERT INTO fill_in_the_blank VALUES('\" + id + \"', '\" + questionNum + \"', '\" + questionsArray.get(0) + \"', '\" + questionsArray.get(1) + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tfor (String a : answers){\n \t\t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t\t\tsqlUpdate(query);\n \t\t\t\t}\n \t\t\t} \n \t\t}\n \t}",
"public void setIdQuestion(int value) {\n this.idQuestion = value;\n }",
"public static void insertQuestion(int i) { \n\t\ttry {\n\t\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"myform1\\\"]/div/div/div/input\")).sendKeys(QandA.getQuestion(i));\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\tSystem.out.println(e.getMessage()+ \" ERROR IN INSERT QUESTION\");\n\t\t}\n\t\tMethods.clickNextBtn();\n\t}",
"@Test\r\n\tpublic void testCreate() {\r\n\t\tQuestion q = new Question(\"Empty\", 1, 20, quizzes, null, choices);\r\n\t\tdao.create(q);\r\n\t}",
"@Override\n\tpublic Answer create(long answerId) {\n\t\tAnswer answer = new AnswerImpl();\n\n\t\tanswer.setNew(true);\n\t\tanswer.setPrimaryKey(answerId);\n\n\t\tanswer.setCompanyId(CompanyThreadLocal.getCompanyId());\n\n\t\treturn answer;\n\t}",
"public static void insertAnswers(String username, int id, String answer) {\n\t\tString user = username;\n \ttry {\n \t\tint rs = Messages.connect().executeUpdate(\"INSERT INTO Answers (Q_id, B_Username, Answer)\" +\n \t \t\"VALUES ('\" + id + \"', '\" + user +\"', '\" + answer +\"')\");\n \t\tMessages.connect().close();\n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n\t}",
"public Question(int id, String question_text) {\n\n this.questionText = question_text;\n\n this.pictureId = id;\n }",
"int insert(QuestionOne record);",
"public Quiz insertQuiz() {\n\n\t\tQuiz q = new Quiz();\n\t\tq.setStartedAt(new Date());\n\t\tq.setCounter(0);\n\n\t\treturn quizRepo.save(q);\n\n\t}",
"private void addQuestion(Questions question) {\n ContentValues cv = new ContentValues();\n cv.put(QuestionsTable.Column_Question, question.getQuestion());\n cv.put(QuestionsTable.Column_Option1, question.getOption1());\n cv.put(QuestionsTable.Column_Option2, question.getOption2());\n cv.put(QuestionsTable.Column_Option3, question.getOption3());\n cv.put(QuestionsTable.Column_Option4, question.getOption4());\n cv.put(QuestionsTable.Column_Answer_Nr, question.getAnswerNr());\n db.insert(QuestionsTable.Table_name, null, cv);\n }",
"@Test\r\n\tpublic void testFindById() throws NoSuchDatabaseEntryException {\r\n\t\tQuestion q = new Question(\"Empty\", 1, 20, quizzes, null, choices);\r\n\t\tdao.create(q);\r\n\t\tassertEquals(q, dao.findById(q.getId()));\r\n\t}",
"private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }",
"int insert(Question record);",
"int insert(Question record);",
"int insert(Question record);",
"int insert(Question record);",
"@RequestMapping(value = \"/addQuestionToTestTeacher/{testId}\",method = RequestMethod.POST)\n\tpublic Test addQuestionToTest(@PathVariable(\"testId\") int testid ,@RequestBody List<Questions> questionList){\n\t\tTest test = testDao.gettestStatus(testid);\n\t\tif(test!=null) {\n\t\t\tList<Questions> availableQuestions = (List<Questions>) test.getQuestions();\n\t\t\tif(availableQuestions.size()>0) {\n\t\t\t\tavailableQuestions.addAll(questionList);\n\t\t\t}else {\n\t\t\t\ttest.setQuestions(questionList);\n\t\t\t}\n\t\t\ttest = testDao.updateTest(test);\n\t\t}\n\t\t\n\t\treturn test;\n\t}",
"public QuestionEntity createQuestion(QuestionEntity questionEntity) {\n entityManager.persist(questionEntity);\n return questionEntity;\n }",
"void addQuestionAnswer(Answer answer);",
"@Override\n\tpublic int topicAdd(QuestionBean q) {\n\t\tString sql = \"insert into topic(title,result,subjectName,difficulty,type,score) values('\"+q.getTitle()+\"','\"+q.getResult()+\"',\"+q.getSubjectName()+\",'\"+q.getDifficulty()+\"',\"+q.getType()+\",\"+q.getScore()+\")\";\n\t\t//int result = jt.update(sql, q.getTitle(),q.getResult(),q.getSubjectName(),q.getDifficulty(),q.getType(),q.getScore());\n\t\tKeyHolder keyHolder = new GeneratedKeyHolder();\n\t\tjt.update(new PreparedStatementCreator() {\n\t\t\t@Override\n\t\t\tpublic java.sql.PreparedStatement createPreparedStatement(java.sql.Connection arg0) throws SQLException {\n\t\t\t\tPreparedStatement ps = arg0.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n\t\t\t\treturn ps;\n\t\t\t}\n\t\t}, keyHolder);\n\t\tSystem.out.println(\"新增加的primarykey:\"+keyHolder.getKey().intValue());\n\t\treturn keyHolder.getKey().intValue();\n\t}",
"@Test\n\tpublic void testSaveQuestion() {\n\t\tAssert.assertEquals(\"qna.sms.question-posted.no-replies\", questionSmsCommand.execute(\n\t\t\t\tnew ParsedMessage(USER_UPDATE, CMD, SITE, \"new question\", 1), ShortMessageCommand.MESSAGE_TYPE_SMS,\"1234\" ));\n\t\tString id = bundleLogicStub.getLastParameters()[1].toString();\n\t\tQnaQuestion question = questionLogic.getQuestionById(Long.valueOf(id));\n\t\tAssert.assertEquals(\"new question\", question.getQuestionText());\n\t\tAssert.assertEquals(USER_UPDATE, question.getOwnerId());\n\t\tAssert.assertEquals(\"1234\", question.getOwnerMobileNr());\n\t\tAssert.assertEquals(1, questionLogic.getAllQuestions(LOCATION1_ID).size()); \n\t}",
"@Test\n\tpublic void testQuestionId() {\n\t\tquestions.setQuestionId(2);\n\t\tassertEquals(2,questions.getQuestionId());\n\t}",
"public Template(String id, String userID, List<Question> questions) {\n this.id = id;\n this.userID = userID;\n this.questions = questions;\n }",
"@Override\n\tpublic Questions addQuestion(BigInteger testId, Questions question) throws UserException {\n\t\treturn null;\n\t}",
"private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }",
"public void testContentCreationTest() {\n\t\tQuestion question = new Question(\"Q title test\", \"Q body test\", \"Q author id test\");\n\t\tAnswer answer = new Answer(\"A body test\", \"A author id test\");\n\t\tReply reply = new Reply(\"R body test\", \"R author id test\");\n\t\tUser user = new User();\n\t\t//adds the question of the topic to an array of saved questions\n\t\tquestion.addAnswer(answer);\n\t\tquestion.addReply(reply);\n\t\t//question.setFavourite(user);\n\t\t//answer.setFavourite(user);\n\t\tanswer.addReply(reply);\n\t\t//tests if answer added to question is correct\n\t\tassertTrue(question.getAnswerCount() == 1);\n\t\t//smoke test code reply and answers.\n\t\tassertTrue(question.getReplies().get(0).getId().equals(reply.getId()));\n\t\tassertTrue(question.getAnswers().get(0).equals(answer));\n\t}",
"public void storeDataTwo(String id, List<String> answers){\n JSONObject questionAnswers = new JSONObject();\n try\n {\n questionAnswers.put(\"usertestid\", id);\n SharedPreferences pref = this.getSharedPreferences(\"session_token\", Context.MODE_PRIVATE);\n String email = pref.getString(\"email\", null);\n questionAnswers.put(\"answered_by\", email);\n questionAnswers.put(\"answers\", answersArray);\n } catch (JSONException e){\n e.printStackTrace();\n }\n new AsyncPost().execute(\"http://webapp.bimorstad.tech/feedback/create\", questionAnswers.toString());\n }",
"void addQuest(Question quest){\r\n\t\t//if the test bank does not contain this topic, create a new one and add question\r\n\t\tif(!bank.containsKey(quest.getTopic())){\r\n\t\t\tquest.setID(0);\r\n\t\t\tbank.put(quest.getTopic(), new ArrayList<Question>());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}else{\r\n\t\t\tquest.setID(bank.get(quest.getTopic()).size());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}\r\n\t}",
"public void setQuestionId(Integer questionId) {\n this.questionId = questionId;\n }",
"@Test\n public void testGetAnswersByQuestion(){\n Survey survey = createSurvey();\n Question question = createQuestion(survey);\n Answer answer = createAnswer(question);\n\n long testQuestionId = question.getId();\n List<Answer> testAnswers = answerDAO.getAnswersByQuestion(testQuestionId);\n // hiç cevap gelebiliyor mu kontrol, en az 1 cevap yukarda verdik çünkü.\n Assert.assertTrue(testAnswers != null && testAnswers.size() >= 1);\n }",
"void deleteQuestion(String questionId);",
"public Question(String id, String description, String correctAnswer,\n List<String> options) {\n super();\n this.id = id;\n this.description = description;\n this.correctAnswer = correctAnswer;\n this.options = options;\n }",
"public void setIdQuestion(int idT) {\r\n idQuestion=rand(idT);\r\n }",
"@GetMapping(\"/getquestion/{id}\")\n public ResponseEntity<List<Questions>> getQuestion(@PathVariable Long id) {\n\n List<Questions> q = this.userServices.getquetion(id);\n\n if (q.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(q);\n\n }",
"@PostMapping(value=\"/add\")\n\tpublic Question addQuestion(@RequestBody Question question) throws EmptyInputException{\n\t\t Question t = questionObj.addQuestion(question);\n\t\t LOGGER.info(\"Adding Questions\");\n\t\t return t;\n\t}",
"public void insertQuestion(Pregunta p){\n\t\tpreguntas.persist(p);\n\t}",
"public void addQuestion(Question question) {\n \t\tquestion.setId(questionIdCounter);\n \t\tquestions.add(question);\n \t\tquestionIdCounter++;\n \t}",
"public void addAnsweredQuestions (int index) {\n\n\t\t_answeredQuestions[index]=_answeredQuestions[index]+1;\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/answered_questions\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\tString answeredQuestions = \"\";\n\t\tfor (int i = 0;i<5;i++) {\n\t\t\tansweredQuestions = answeredQuestions + \" \" + String.valueOf(_answeredQuestions[i]);\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(String.format(\"echo \\\"%s\\\" >> data/answered_questions\", answeredQuestions));\n\n\n\n\t}",
"public void addQuestions() {\n\t\tboolean addNewQuestion = true;\n\t\tString text;\n\t\tQuestion q;\n\t\tString promptResponse;\n\t\t\n\t\twhile (addNewQuestion) {\n\t\t\tSystem.out.print(\"Enter question: \");\n\t\t\ttext = System.console().readLine();\n\t\t\tq = new QuestionImpl(questionId, text);\n\t\t\tthis.questionId++;\n\t\t\tq.addAnswers();\n\t\t\tthis.questions.add(q);\n\n\t\t\tSystem.out.print(\"Hit Return to add another question or q to quit: \");\n\t\t\tpromptResponse = System.console().readLine();\n\t\t\tif (promptResponse.equals(\"q\") ||\n\t\t\t\t\tpromptResponse.equals(\"Q\") ||\n\t\t\t\t\tpromptResponse.equals(\"quit\") ||\n\t\t\t\t\tpromptResponse.equals(\"Quit\")) {\n\t\t\t\taddNewQuestion = false;\n\t\t\t}\n\t\t}\n\t}",
"void create(int id, int authorId, String title);",
"public int getIdQuestion() {\r\n return idQuestion;\r\n }",
"public Question saveQuestion(Question question) throws UserException {\n\t\tOnlineTest onlineTest=new OnlineTest();\r\n\t\tString sql=\"insert into Question(question_title, question_option_a, question_option_b, question_option_c, question_option_d, question_chosen_answer, question_correct_answer, question_marks, question_marks_scored, test_id) values(?,?,?,?,?,?,?,?,?,?)\";\r\n\t\ttry {\r\n\t\t\tpreparedStatement=connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\r\n\t\t\tpreparedStatement.setString(1, question.getQuestionTitle());\r\n\t\t\tpreparedStatement.setString(2, question.getQusetionOptions()[0]);\r\n\t\t\tpreparedStatement.setString(3, question.getQusetionOptions()[1]);\r\n\t\t\tpreparedStatement.setString(4, question.getQusetionOptions()[2]);\r\n\t\t\tpreparedStatement.setString(5, question.getQusetionOptions()[3]);\r\n\t\t\tpreparedStatement.setInt(6, question.getChosenAnswer());\r\n\t\t\tpreparedStatement.setInt(7, question.getQuestionAnswer());\r\n\t\t\tpreparedStatement.setDouble(8, question.getQuestionMarks());\r\n\t\t\tpreparedStatement.setDouble(9, question.getMarksScored());\r\n\t\t\tpreparedStatement.setLong(10, onlineTest.getTestId().longValue());\r\n\t\t\tint result = preparedStatement.executeUpdate();\r\n\t\t\tif(result == 0) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tBigInteger generatedId = BigInteger.valueOf(0L);\r\n\t\t\tresultSet = preparedStatement.getGeneratedKeys();\r\n\t\t\tif (resultSet.next()) {\r\n\t\t\t\tgeneratedId = BigInteger.valueOf(resultSet.getLong(1));\r\n\t\t\t\tSystem.out.println(\"Auto generated id : \" + generatedId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tquestion.setQuestionId(generatedId);\r\n\t\t\tSystem.out.println(\"Added Question to the database with id as : \" + generatedId);\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Error at add Question Dao method: \" + e);\r\n\t\t} finally {\r\n\t\t\tif (preparedStatement != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tpreparedStatement.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tSystem.out.println(\"Error at add Question Dao method: \" + e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn question;\r\n\t}",
"public int getIdQuestion() {\n return idQuestion;\n }",
"QuestionPick addPickDetail(Question question);",
"public void addExamTopic(int id, int eId, int tId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_EID, eId);\r\n values.put(KEY_TID, tId);\r\n\r\n db.insert(TABLE_EXAMS_TOPICS, null, values);\r\n\r\n db.close();\r\n }",
"public void saveQuestion(Questions q) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\tsession.save(q);\n\t\ttx.commit();\n\t\tsession.close();\n\t}",
"public void saveSurveyAnswer(HttpServletRequest request, Answers answers, long userId);",
"public void setQuestionid(Integer questionid) {\n this.questionid = questionid;\n }",
"public void createAnswerStatistics(int sid,int qid);",
"int insert(Question11 record);",
"@Override\n\tpublic int saveQuiz(Quiz newQuiz) {\n\t\ttry {\n\t\t\tConnection database = ds.getConnection();\n\t\t\tString statement = \"INSERT INTO quiz(quiz_id, subject, quiz_description)\\r\\n\" + \n\t\t\t\t\t\"VALUES(QUIZ_ID_SEQ.nextval,?,?)\";\n\t\t\t\n\t\t\tPreparedStatement ps = database.prepareStatement(statement);\n\t\t\tps.setString(1, newQuiz.getSubject());\n\t\t\tps.setString(2, newQuiz.getDescription());\n\t\t\t\n\t\t\treturn ps.executeUpdate();\n\t\t\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn 0;\n\t\t}\n\t}",
"@Test\n void addQuestionToExistingQuiz(){\n quiz = new Quiz(69L, \"weeb over 9000 quiz\", new ArrayList<>(), new User(),\"1\", new ArrayList<>());\n question = new Question(96L, new ArrayList<>(), new Quiz(), \"what is king of flaaaavour?\");\n\n quizService.addQuiz(quiz, new User(42L, \"potato-san\", \"[email protected]\", \"iLovePotatoes420\", new ArrayList<>()));\n int oldCount = quizService.findById(69L).getQuestions().size();\n questionService.addQuestion(question, quiz);\n\n Quiz quizSixtyNine = quizService.findById(69L);\n int newCount = quizSixtyNine.getQuestions().size();\n\n assertNotEquals(oldCount, newCount);\n }",
"public Test(ArrayList<WrittenQuestion> questions){\r\n\t\tmyQuestions = new ArrayList<WrittenQuestion>();\r\n\t\tfor(WrittenQuestion q : questions){\r\n\t\t\tif(q instanceof Question){\r\n\t\t\t\tmyQuestions.add(new Question((Question)q));\r\n\t\t\t}else{\r\n\t\t\t\tmyQuestions.add(new WrittenQuestion(q));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(allIDs==null){\r\n\t\t\tallIDs = new ArrayList<Integer>();\r\n\t\t\tfor (int i = 0; i<1000; i++){\r\n\t\t\t\tallIDs.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom r = new Random();\r\n\t\tid = allIDs.remove((int)(r.nextInt(allIDs.size())));\r\n\r\n\t}",
"public Todo create(long todoId);",
"public void addQuestion(Question quest) {\n ContentValues values = new ContentValues();\n values.put(KEY_QUES, quest.getQUESTION());\n values.put(KEY_ANSWER, quest.getANSWER());\n values.put(KEY_OPTA, quest.getOPTA());\n values.put(KEY_OPTB, quest.getOPTB());\n values.put(KEY_OPTC, quest.getOPTC());\n // Inserting Row\n db.insert(TABLE_NAME_QUEST, null, values);\n }",
"public AnswerEntity createAnswer(AnswerEntity answerEntity) {\n entityManager.persist(answerEntity);\n return answerEntity;\n }",
"public void setQuestionId(int tmp) {\n this.questionId = tmp;\n }",
"Question getQuestion(String questionId);",
"@Test\n\tpublic void testGetQuestionById() {\n\t\tQnaQuestion question = questionLogic.getQuestionById(tdp.question1_location1.getId());\n\t\tAssert.assertNotNull(question);\n\t\tAssert.assertEquals(question.getQuestionText(),tdp.question1_location1.getQuestionText());\n\t\tAssert.assertEquals(question.getId(), tdp.question1_location1.getId());\n\t}",
"@Transactional(propagation = Propagation.REQUIRED)\n public AnswerEntity createAnswer(\n AnswerEntity answerEntity, final String accessToken, final String questionId)\n throws AuthorizationFailedException, InvalidQuestionException {\n UserAuthEntity userAuthEntity = userAuthDao.getUserAuthByToken (accessToken);\n if (userAuthEntity == null) {\n throw new AuthorizationFailedException (\"ATHR-001\", \"User has not signed in\");\n } else if (userAuthEntity.getLogoutAt () != null) {\n throw new AuthorizationFailedException (\n \"ATHR-002\", \"User is signed out.Sign in first to post an answer\");\n }\n QuestionEntity questionEntity = questionDao.getQuestionById (questionId);\n if (questionEntity == null) {\n throw new InvalidQuestionException (\"QUES-001\", \"The question entered is invalid\");\n }\n answerEntity.setUuid (UUID.randomUUID ().toString ());\n answerEntity.setDate (ZonedDateTime.now ());\n answerEntity.setQuestionEntity (questionEntity);\n answerEntity.setUserEntity (userAuthEntity.getUserEntity ());\n return answerDao.createAnswer (answerEntity);\n }",
"public Long getQuestionId();",
"public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}",
"int insert(Question14 record);",
"Question selectByPrimaryKey(String id);",
"int insertSelective(QuestionOne record);",
"@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Void> create(@Valid @RequestBody Enquiry enquiry) throws URISyntaxException {\n log.debug(\"REST request to save Enquiry : {}\", enquiry);\n if (enquiry.getId() != null) {\n return ResponseEntity.badRequest().header(\"Failure\", \"A new enquiry cannot already have an ID\").build();\n }\n enquiryRepository.save(enquiry);\n return ResponseEntity.created(new URI(\"/api/enquirys/\" + enquiry.getId())).build();\n }",
"@Test\n @Transactional\n void createSkillWithExistingId() throws Exception {\n skill.setId(1L);\n SkillDTO skillDTO = skillMapper.toDto(skill);\n\n int databaseSizeBeforeCreate = skillRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSkillMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(skillDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Skill in the database\n List<Skill> skillList = skillRepository.findAll();\n assertThat(skillList).hasSize(databaseSizeBeforeCreate);\n }",
"public Integer addQuestionToList(Long questionId, Long quizId) {\n\n\t\tQuiz quiz = quizRepo.findOneById(quizId);\n\t\tQuestion newQuestion = questionRepo.findOneById(questionId);\n\t\tquiz.add(newQuestion);\n\t\tquiz.setCounter(quiz.getCounter() + 1);\n\t\tquizRepo.save(quiz);\n\t\treturn quiz.getQuestions().size();\n\t}",
"public List<Question> getQuestionsTopic(int tId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_TOPICS_QUESTIONS + \" AS tq ON q.\" +\r\n KEY_ID + \" = tq.\" + KEY_QID +\r\n \" WHERE tq.\" + KEY_TID + \" = \" + tId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }",
"@Override\n\t@Transactional\n\tpublic List<Question> getQuestionsByTestId(int id) {\n\t\treturn questionDao.getQuestionsByTestId(id);\n\t}",
"protected abstract void insertQuestionTx(QuestionImpl question);",
"int insert(CommonQuestionStrategyType record);",
"Question selectByPrimaryKey(Integer id);",
"Question selectByPrimaryKey(Integer id);",
"public void answerUQ(String question, String id, String answer) throws Exception {\n\t\tWebAppDBEngine webDB = new WebAppDBEngine();\r\n\t\twebDB.answerUQ(question,id,answer);\r\n\t}",
"@RequestMapping(value = \"/loadQuestionDetails\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody Question loadQuestionDetails(@RequestParam String questionId) {\r\n\t\tQuestion question = new Question();\r\n\t\tif (null != questionId && !questionId.equalsIgnoreCase(\"\")) {\r\n\t\t\tquestion = questionService.getQuestionById(Integer.parseInt(questionId));\r\n\t\t}\r\n\t\treturn question;\r\n\t}",
"protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }",
"public void setQuestionID(int questionID) {\n this.questionID = questionID;\n }",
"public void deleteQuestion(int sid);",
"private void setAnswer() {\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n setValue();\n }\n }",
"int insert(Question27 record);",
"public void addQuestion(Question a) {\n quesCollec.add(a);\n }",
"@Test\n\tpublic void testAddQuestionToCategory() {\n\t\t// Invalid user id\n\t\texternalLogicStub.currentUserId = USER_NO_UPDATE;\n\t\ttry {\n\t\t\tquestionLogic.addQuestionToCategory( tdp.question1_location1.getId() , tdp.category1_location1.getId(), LOCATION1_ID);\n\t\t\tAssert.fail(\"Should throw SecurityException\");\n\t\t} catch (SecurityException se) {\n\t\t\tAssert.assertNotNull(se);\n\t\t} \n\t\t\n\t\t// Valid user id\n\t\texternalLogicStub.currentUserId = USER_UPDATE;\n\t\ttry {\n\t\t\tquestionLogic.addQuestionToCategory(tdp.question1_location1.getId() , tdp.category1_location1.getId(), LOCATION1_ID);\n\t\t} catch (Exception se) {\n\t\t\tAssert.fail(\"Should not throw Exception\");\n\t\t}\n\t\tAssert.assertTrue(tdp.question1_location1.getCategory().getId().equals(tdp.category1_location1.getId()));\n\t}",
"int insertSelective(Question record);",
"int insertSelective(Question record);"
] | [
"0.72533816",
"0.70812523",
"0.7005376",
"0.69787985",
"0.6930204",
"0.68079114",
"0.67934674",
"0.66462046",
"0.66007435",
"0.6545612",
"0.6447882",
"0.63988286",
"0.6358377",
"0.63307965",
"0.62715846",
"0.6265224",
"0.6214105",
"0.61567163",
"0.6150767",
"0.6147746",
"0.6140284",
"0.6128091",
"0.6095823",
"0.60627097",
"0.6051534",
"0.60398793",
"0.60084194",
"0.5998203",
"0.5998203",
"0.5998203",
"0.5998203",
"0.5972357",
"0.5960999",
"0.59475106",
"0.59321535",
"0.591087",
"0.59082454",
"0.58882606",
"0.5860369",
"0.585461",
"0.58477205",
"0.58407545",
"0.58405346",
"0.5839252",
"0.58382255",
"0.5834634",
"0.58185077",
"0.58166665",
"0.5813257",
"0.57973033",
"0.57659286",
"0.57633215",
"0.5762492",
"0.57408977",
"0.5729198",
"0.57014644",
"0.56938446",
"0.56895477",
"0.5682764",
"0.5680452",
"0.56686157",
"0.56652915",
"0.5648018",
"0.56362563",
"0.5632651",
"0.5629565",
"0.56242347",
"0.56189793",
"0.56067735",
"0.5605786",
"0.55884445",
"0.55716115",
"0.5565922",
"0.55611444",
"0.5541679",
"0.5540257",
"0.5539514",
"0.55253696",
"0.5524085",
"0.55184114",
"0.5505892",
"0.55012643",
"0.54976946",
"0.5481523",
"0.547097",
"0.5466422",
"0.5453717",
"0.5451473",
"0.5451473",
"0.5451174",
"0.54486704",
"0.5448145",
"0.5447564",
"0.5437107",
"0.5432124",
"0.54253465",
"0.54231715",
"0.542255",
"0.5421738",
"0.5421738"
] | 0.69241685 | 5 |
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();
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel24 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
lblAddNew = new javax.swing.JLabel();
jLabel26 = new javax.swing.JLabel();
lblViewAll = new javax.swing.JLabel();
jLabel27 = new javax.swing.JLabel();
lblDelete = new javax.swing.JLabel();
jLabel29 = new javax.swing.JLabel();
lblUpdate = new javax.swing.JLabel();
jLabel31 = new javax.swing.JLabel();
jLabel28 = new javax.swing.JLabel();
jLabel30 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
txtCID = new javax.swing.JTextField();
txtFirst = new javax.swing.JTextField();
txtLast = new javax.swing.JTextField();
txtAddress = new javax.swing.JTextField();
txtEmail = new javax.swing.JTextField();
txtNic = new javax.swing.JTextField();
txtContact = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
lblbackCustOr = new javax.swing.JLabel();
jPanel4 = new javax.swing.JPanel();
lblTime = new javax.swing.JLabel();
lblBack = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel1.setPreferredSize(new java.awt.Dimension(1366, 768));
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel2.setBackground(new java.awt.Color(255, 255, 255));
jLabel2.setFont(new java.awt.Font("Times New Roman", 3, 36)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 0, 255));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Manage Customers");
jPanel2.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 0, 360, 50));
jPanel1.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, 420, 50));
jPanel3.setBackground(new java.awt.Color(255, 255, 255));
jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
jPanel3.setMinimumSize(new java.awt.Dimension(100, 40));
jPanel3.setPreferredSize(new java.awt.Dimension(1300, 40));
jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel24.setBackground(new java.awt.Color(0, 0, 0));
jLabel24.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
jLabel24.setForeground(new java.awt.Color(255, 255, 255));
jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel24.setText("Ecs");
jLabel24.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
jLabel24.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jLabel24.setOpaque(true);
jLabel24.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel24MouseClicked(evt);
}
});
jPanel3.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(25, 11, 50, 20));
jLabel25.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
jLabel25.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel25.setText("Back");
jPanel3.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 10, 30, 20));
lblAddNew.setBackground(new java.awt.Color(0, 0, 0));
lblAddNew.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
lblAddNew.setForeground(new java.awt.Color(255, 255, 255));
lblAddNew.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblAddNew.setText("Ctrl");
lblAddNew.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
lblAddNew.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lblAddNew.setOpaque(true);
lblAddNew.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblAddNewMouseClicked(evt);
}
});
jPanel3.add(lblAddNew, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 10, 50, 20));
jLabel26.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
jLabel26.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel26.setText("Add New Customer");
jPanel3.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 10, 140, 20));
lblViewAll.setBackground(new java.awt.Color(0, 0, 0));
lblViewAll.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
lblViewAll.setForeground(new java.awt.Color(255, 255, 255));
lblViewAll.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblViewAll.setText("Home");
lblViewAll.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
lblViewAll.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lblViewAll.setOpaque(true);
lblViewAll.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblViewAllMouseClicked(evt);
}
});
jPanel3.add(lblViewAll, new org.netbeans.lib.awtextra.AbsoluteConstraints(860, 10, 50, 20));
jLabel27.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
jLabel27.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel27.setText("Select");
jPanel3.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 10, 50, 20));
lblDelete.setBackground(new java.awt.Color(0, 0, 0));
lblDelete.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
lblDelete.setForeground(new java.awt.Color(255, 255, 255));
lblDelete.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblDelete.setText("Delete");
lblDelete.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
lblDelete.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lblDelete.setOpaque(true);
lblDelete.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblDeleteMouseClicked(evt);
}
});
jPanel3.add(lblDelete, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 10, 50, 20));
jLabel29.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
jLabel29.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel29.setText("Delete Customer");
jPanel3.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 10, 100, 20));
lblUpdate.setBackground(new java.awt.Color(0, 0, 0));
lblUpdate.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
lblUpdate.setForeground(new java.awt.Color(255, 255, 255));
lblUpdate.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblUpdate.setText("Alt");
lblUpdate.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
lblUpdate.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lblUpdate.setOpaque(true);
lblUpdate.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblUpdateMouseClicked(evt);
}
});
jPanel3.add(lblUpdate, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 10, 50, 20));
jLabel31.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
jLabel31.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel31.setText("Update Customer details");
jPanel3.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 10, 140, 20));
jLabel28.setBackground(new java.awt.Color(0, 0, 0));
jLabel28.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
jLabel28.setForeground(new java.awt.Color(255, 255, 255));
jLabel28.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel28.setText("Enter");
jLabel28.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
jLabel28.setOpaque(true);
jPanel3.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 10, 50, 20));
jLabel30.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
jLabel30.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel30.setText("View All Customers");
jPanel3.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(920, 10, 140, 20));
jPanel1.add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 690, 1280, -1));
jLabel12.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel12.setText("Last Name :");
jPanel1.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 270, 100, 30));
txtCID.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
txtCID.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtCIDActionPerformed(evt);
}
});
jPanel1.add(txtCID, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 140, 200, 30));
txtFirst.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jPanel1.add(txtFirst, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 200, 350, 30));
txtLast.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jPanel1.add(txtLast, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 270, 350, 30));
txtAddress.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
txtAddress.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtAddressActionPerformed(evt);
}
});
jPanel1.add(txtAddress, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 550, 470, 30));
txtEmail.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jPanel1.add(txtEmail, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 480, 470, 30));
txtNic.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jPanel1.add(txtNic, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 340, 350, 30));
txtContact.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jPanel1.add(txtContact, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 410, 350, 30));
jLabel1.setForeground(new java.awt.Color(102, 102, 102));
jLabel1.setText("xxx-xxxxxxx");
jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 440, 70, -1));
jLabel18.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel18.setText("Email :");
jPanel1.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 480, 120, 30));
jLabel17.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel17.setText("NIC :");
jPanel1.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 340, 100, 30));
jLabel16.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel16.setText("Address :");
jPanel1.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 550, 100, 30));
jLabel15.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel15.setText("Contact Number :");
jPanel1.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 410, 120, 30));
jLabel14.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel14.setText("First Name :");
jPanel1.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 200, 100, 30));
jLabel13.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel13.setText("Customer ID :");
jPanel1.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 140, 100, 30));
jLabel3.setOpaque(true);
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 130, 1250, 535));
lblbackCustOr.setBackground(new java.awt.Color(153, 0, 153));
lblbackCustOr.setOpaque(true);
jPanel1.add(lblbackCustOr, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 100, 1260, 570));
jPanel4.setBackground(new java.awt.Color(255, 255, 255));
jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
lblTime.setFont(new java.awt.Font("Times New Roman", 3, 36)); // NOI18N
lblTime.setForeground(new java.awt.Color(0, 0, 204));
lblTime.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jPanel4.add(lblTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 0, 250, 50));
jPanel1.add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(1030, 20, 290, 50));
lblBack.setBackground(new java.awt.Color(102, 102, 102));
lblBack.setOpaque(true);
jPanel1.add(lblBack, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1366, 768));
getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));
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 Soru1() {\n initComponents();\n }",
"public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\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 PatientUI() {\n initComponents();\n }",
"public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \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}",
"public kunde() {\n initComponents();\n }",
"public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }",
"public MusteriEkle() {\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 frmMain() {\n initComponents();\n }",
"public frmMain() {\n initComponents();\n }",
"public DESHBORDPANAL() {\n initComponents();\n }",
"public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }",
"public frmVenda() {\n initComponents();\n }",
"public Botonera() {\n initComponents();\n }",
"public FrmMenu() {\n initComponents();\n }",
"public OffertoryGUI() {\n initComponents();\n setTypes();\n }",
"public JFFornecedores() {\n initComponents();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }",
"public vpemesanan1() {\n initComponents();\n }",
"public EnterDetailsGUI() {\n initComponents();\n }",
"public Kost() {\n initComponents();\n }",
"public UploadForm() {\n initComponents();\n }",
"public frmacceso() {\n initComponents();\n }",
"public FormHorarioSSE() {\n initComponents();\n }",
"public HW3() {\n initComponents();\n }",
"public Managing_Staff_Main_Form() {\n initComponents();\n }",
"public sinavlar2() {\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 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 POS1() {\n initComponents();\n }",
"public CreateAccount_GUI() {\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.7320782",
"0.72918797",
"0.72918797",
"0.72918797",
"0.728645",
"0.72498447",
"0.7214492",
"0.720934",
"0.7197145",
"0.71912014",
"0.71852076",
"0.7160113",
"0.71487373",
"0.70943654",
"0.70820624",
"0.7058153",
"0.69883204",
"0.6978216",
"0.69558746",
"0.6955715",
"0.69455403",
"0.6944223",
"0.6936588",
"0.6933016",
"0.6929512",
"0.6925853",
"0.6925524",
"0.6912182",
"0.6912122",
"0.6895022",
"0.6894088",
"0.68921435",
"0.68919635",
"0.6889464",
"0.6884104",
"0.6883508",
"0.6882322",
"0.6879773",
"0.6876671",
"0.68755716",
"0.6872437",
"0.6860746",
"0.68575454",
"0.6857284",
"0.68563104",
"0.6854648",
"0.68544936",
"0.68532896",
"0.68532896",
"0.68444484",
"0.68380433",
"0.6837678",
"0.68299913",
"0.6828643",
"0.6828147",
"0.6825278",
"0.6823024",
"0.68182456",
"0.68178964",
"0.681216",
"0.6809752",
"0.6809671",
"0.6809534",
"0.6808423",
"0.6803337",
"0.6794699",
"0.67944574",
"0.6793996",
"0.6792107",
"0.67904186",
"0.67898226",
"0.67888504",
"0.6782858",
"0.67673683",
"0.67670184",
"0.6765726",
"0.6757476",
"0.67573047",
"0.6753978",
"0.6752576",
"0.674217",
"0.67403704",
"0.6738196",
"0.67374873",
"0.67351323",
"0.6728453",
"0.67277855",
"0.6722282",
"0.6716617",
"0.67165154",
"0.67154175",
"0.6709239",
"0.67077744",
"0.6703873",
"0.67028135",
"0.6702373",
"0.6700207",
"0.67000616",
"0.6695769",
"0.6691885",
"0.6690232"
] | 0.0 | -1 |
End of variables declaration//GENEND:variables | private void loadKeyListener() {
KeyboardFocusManager manger = KeyboardFocusManager.getCurrentKeyboardFocusManager();
manger.addKeyEventPostProcessor(new KeyEventPostProcessor() {
@Override
public boolean postProcessKeyEvent(KeyEvent e) {
if(e.getID()== KeyEvent.KEY_PRESSED){
switch(e.getKeyCode()){
case KeyEvent.VK_CONTROL:
AddCustomer();break;
case KeyEvent.VK_ALT:
UpdateCustomer();break;
case KeyEvent.VK_DELETE:
DeleteCustomer();break;
case KeyEvent.VK_HOME:
ViewAllCustomer();break;
case KeyEvent.VK_ESCAPE:
Back();break;
}
}
return false;
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"public void mo38117a() {\n }",
"@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}",
"private void assignment() {\n\n\t\t\t}",
"private void kk12() {\n\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"public void mo21779D() {\n }",
"public final void mo51373a() {\n }",
"protected boolean func_70041_e_() { return false; }",
"public void mo4359a() {\n }",
"public void mo21782G() {\n }",
"private void m50366E() {\n }",
"public void mo12930a() {\n }",
"public void mo115190b() {\n }",
"public void method_4270() {}",
"public void mo1403c() {\n }",
"public void mo3376r() {\n }",
"public void mo3749d() {\n }",
"public void mo21793R() {\n }",
"protected boolean func_70814_o() { return true; }",
"public void mo21787L() {\n }",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo21780E() {\n }",
"public void mo21792Q() {\n }",
"public void mo21791P() {\n }",
"public void mo12628c() {\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"public void mo97908d() {\n }",
"public void mo21878t() {\n }",
"public void mo9848a() {\n }",
"public void mo21825b() {\n }",
"public void mo23813b() {\n }",
"public void mo3370l() {\n }",
"public void mo21879u() {\n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"public void mo21785J() {\n }",
"public void mo21795T() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void m23075a() {\n }",
"public void mo21789N() {\n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"public void mo21794S() {\n }",
"public final void mo12688e_() {\n }",
"@Override\r\n\tvoid func04() {\n\t\t\r\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"public void mo6944a() {\n }",
"public static void listing5_14() {\n }",
"public void mo1405e() {\n }",
"public final void mo91715d() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"public void mo9137b() {\n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"public void func_70295_k_() {}",
"void mo57277b();",
"public void mo21877s() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"public void Tyre() {\n\t\t\r\n\t}",
"void berechneFlaeche() {\n\t}",
"public void mo115188a() {\n }",
"public void mo21880v() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public void mo21784I() {\n }",
"private stendhal() {\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"public void mo56167c() {\n }",
"public void mo44053a() {\n }",
"public void mo21781F() {\n }",
"public void mo2740a() {\n }",
"public void mo21783H() {\n }",
"public void mo1531a() {\n }",
"double defendre();",
"private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }",
"public void stg() {\n\n\t}",
"void m1864a() {\r\n }",
"private void poetries() {\n\n\t}",
"public void skystonePos4() {\n }",
"public void mo2471e() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"private void yy() {\n\n\t}",
"@Override\n\tpublic void verkaufen() {\n\t}",
"@AnyLogicInternalCodegenAPI\n private void setupPlainVariables_Main_xjal() {\n }",
"static void feladat4() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }",
"public void furyo ()\t{\n }",
"public void verliesLeven() {\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"protected void mo6255a() {\n }"
] | [
"0.6359434",
"0.6280371",
"0.61868024",
"0.6094568",
"0.60925734",
"0.6071678",
"0.6052686",
"0.60522056",
"0.6003249",
"0.59887564",
"0.59705925",
"0.59680873",
"0.5967989",
"0.5965816",
"0.5962006",
"0.5942372",
"0.5909877",
"0.5896588",
"0.5891321",
"0.5882983",
"0.58814824",
"0.5854075",
"0.5851759",
"0.58514243",
"0.58418584",
"0.58395296",
"0.5835063",
"0.582234",
"0.58090156",
"0.5802706",
"0.5793836",
"0.57862717",
"0.5784062",
"0.5783567",
"0.5782131",
"0.57758564",
"0.5762871",
"0.5759349",
"0.5745087",
"0.57427835",
"0.573309",
"0.573309",
"0.573309",
"0.573309",
"0.573309",
"0.573309",
"0.573309",
"0.57326084",
"0.57301426",
"0.57266665",
"0.57229686",
"0.57175463",
"0.5705802",
"0.5698347",
"0.5697827",
"0.569054",
"0.5689405",
"0.5686434",
"0.56738997",
"0.5662217",
"0.56531453",
"0.5645255",
"0.5644223",
"0.5642628",
"0.5642476",
"0.5640595",
"0.56317437",
"0.56294966",
"0.56289655",
"0.56220204",
"0.56180173",
"0.56134313",
"0.5611337",
"0.56112075",
"0.56058615",
"0.5604383",
"0.5602629",
"0.56002104",
"0.5591573",
"0.55856615",
"0.5576992",
"0.55707216",
"0.5569681",
"0.55570376",
"0.55531484",
"0.5551123",
"0.5550893",
"0.55482954",
"0.5547471",
"0.55469507",
"0.5545719",
"0.5543553",
"0.55424106",
"0.5542057",
"0.55410767",
"0.5537739",
"0.55269134",
"0.55236584",
"0.55170715",
"0.55035424",
"0.55020875"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void keyPressed(KeyEvent typedKey)
{
if(typedKey.getID() == KeyEvent.VK_ENTER)
{
gatherInfo();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void keyReleased(KeyEvent arg0)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Card associated with account | public void cardsAssociated(){
Scanner input = new Scanner(System.in);
System.out.print("Enter associated card: ");
cardAssociated = input.nextLine();
System.out.println("Associated card: " + cardAssociated);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getCardNumber() {\n return this.account;\n }",
"Card getCard(UUID cardId);",
"public void addPartnerCard(Card card);",
"public Card getCard() {\n return this.card;\n }",
"public Card getCard() {\n return this.card;\n }",
"public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card createCard();",
"public void addCard(Card card) {\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n \r\n ContentValues values = new ContentValues();\r\n values.put(COL_ACCOUNT, card.getAccount()); \r\n values.put(COL_USERNAME, card.getUsername()); \r\n values.put(COL_PASSWORD, card.getPassword()); \r\n values.put(COL_URL, card.getUrl()); \r\n values.put(COL_DELETED, card.getDeleted()); \r\n values.put(COL_HIDE_PWD, card.getHidePwd()); \r\n values.put(COL_REMIND_ME, card.getRemindMe()); \r\n values.put(COL_UPDATED_ON, card.getUpdatedOn()); \r\n values.put(COL_COLOR, String.valueOf(card.getColor()));\r\n values.put(COL_REMIND_ME_DAYS, card.getRemindMeDays());\r\n \r\n db.insert(TABLE_CARDS, null, values);\r\n db.close(); \r\n }",
"Symbol getActiveCard();",
"public CreditCardAccount getCreditCardAccount() {\n return this.creditCardAccount;\n }",
"private void addCard() {\n Intent intent = new Intent(this, NewCard.class);\n intent.putExtra(\"cardSetId\", cardSetId);\n startActivity(intent);\n }",
"public interface CreditCard {\n\t// Getter Methods\n\tpublic Long getId();\n\tpublic CreditCardType getCreditCardType();\n\tpublic String getAccountNumber();\n\t/**\n\t * CVV number is the three-digit number on the back of a Discover, Visa or MasterCard;\n\t * or the four-digit number on the front of the American Express card.\n\t * @return\n\t */\n\tpublic String getCvvNumber();\n\tpublic String getCardHolderFirstName();\n\tpublic String getCardHolderLastName();\n\tpublic String getExpirationMonth();\n\tpublic String getExpirationYear();\n\tpublic String getBillingAddress();\n\tpublic String getBillingAddress2();\n\tpublic String getBillingCity();\n\tpublic States getBillingState();\n\tpublic String getBillingZipcode();\n\tpublic User getCreditCardHolder();\n\tpublic Boolean getPrimaryCreditCard();\n\tpublic Boolean getActive();\n\tpublic Date getCreationDate();\n\tpublic Date getModifiedDate();\n\tpublic Date getDeactivationDate();\n\t\n\t// Setter Methods\n\tpublic void setId(Long id);\n\tpublic void setCreditCardType(CreditCardType creditCardType);\n\tpublic void setAccountNumber(String accountNumber);\n\tpublic void setCvvNumber(String cvvNumber);\n\tpublic void setCardHolderFirstName(String cardHolderFirstName);\n\tpublic void setCardHolderLastName(String cardHolderLastName);\n\tpublic void setExpirationMonth(String expirationMonth);\n\tpublic void setExpirationYear(String expirationYear);\n\tpublic void setBillingAddress(String billingAddress);\n\tpublic void setBillingAddress2(String billAddress2);\n\tpublic void setBillingCity(String billingCity);\n\tpublic void setBillingState(States billingState);\n\tpublic void setBillingZipcode(String billingZipcode);\n\tpublic void setCreditCardHolder(User creditCardHolder);\n\tpublic void setPrimaryCreditCard(Boolean primaryCreditCard);\n\tpublic void setActive(Boolean active);\n\tpublic void setCreationDate(Date creationDate);\n\tpublic void setModifiedDate(Date modifiedDate);\n\tpublic void setDeactivationDate(Date deactivationDate);\n\n\t// Check to see if this card is active.\n\tpublic Boolean isActive();\n\t\n\t// Check to see if this card is the primary one for the account\n\tpublic Boolean isPrimaryCreditCard();\n\t\n\t// See if the card has expired.\n\tpublic Boolean hasCardExpired(Date currentDate);\n}",
"void setCard(Card card) {\n this.card = card;\n }",
"CarPaymentMethod cardHolder(String firstName, String lastName);",
"public Long getCardId() {\r\n return cardId;\r\n }",
"private void cards() {\n newUserCard();\n editTypeCard();\n changePasswordCard();\n }",
"public Cardholder(String name, String address, int cardNumber){\n this.name = name;\n this.address = address;\n this.cardNumber = cardNumber;\n }",
"private void editUserCard() {\n getUserCard();\n }",
"Cards(String cardName, String cardDes, int puntosHabilidad) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = puntosHabilidad;\n }",
"Card dealOneCard();",
"public UserCard(Name alias) {\n this(alias, USER_CARD);\n }",
"@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}",
"public abstract void addCard();",
"CarPaymentMethod creditCardNumber(String cardNumber);",
"public void setPaymentInfoInCart(CreditCard cc);",
"public String getIdentityCard() {\n return identityCard;\n }",
"public void ActonCard() {\n\t}",
"public UserCard(String alias) {\n this(DSL.name(alias), USER_CARD);\n }",
"public List<Card> getcardbyuser(String user_id);",
"public CreditCard getCreditCard(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard res){\n\t\tCreditCard creditCard = new CreditCard();\n\t\t\n\t\tcreditCard.setCardType( res.getCardType() );\n\t\tcreditCard.setName( res.getName() );\n\t\tcreditCard.setCardNo( res.getCardNo() );\n\t\tcreditCard.setExpiryMonth( res.getExpiryMonth() );\n\t\tcreditCard.setExpiryYear( res.getExpiryYear() );\n\t\tcreditCard.setLastName( res.getLastName() );\n\t\tcreditCard.setFirstName( res.getFirstName() );\n\t\tcreditCard.setPaymentDate( res.getPaymentDate() );\n\t\tcreditCard.setStreet( res.getStreet() );\n\t\tcreditCard.setCity( res.getCity() );\n\t\tcreditCard.setState( res.getState() );\n\t\tcreditCard.setPostalCode( res.getPostalCode() ); \n\t\tcreditCard.setDistrict( res.getDistrict() );\n\t\tcreditCard.setCountryCode( res.getCountryCode() );\n\t\tcreditCard.setTelephone( res.getTelephone() );\n\t\tcreditCard.setPassengerId( res.getPassengerId() );\n\t\tcreditCard.setCVVCode( res.getCVVCode() );\n\t\tcreditCard.setDescription( res.getDescription() );\n\t\tcreditCard.setOtherCardHolderEmail( res.getOtherCardHolderEmail() );\n\t\tif( res.getUseSameCard() != null ){\n\t\t\tcreditCard.setUseSameCard( res.getUseSameCard().charAt(0) );\n\t\t}\n\t\tif( res.getOtherCardHolderFlag() != null ){\n\t\t\tcreditCard.setOtherCardHolderFlag( res.getOtherCardHolderFlag().charAt(0) );\n\t\t}\n\t\tif( res.getAmountUSD() != null ){\n\t\t\tcreditCard.setAmountUSD( res.getAmountUSD().doubleValue() );\n\t\t}\n\t\tif( res.getAmount() != null ){\n\t\t\tcreditCard.setAmount( res.getAmount().doubleValue() );\n\t\t}\n\t\t\n\t\treturn creditCard;\n\t}",
"void addCustomerCard(CardDto cardDto, String name) throws EOTException;",
"Cards(String cardName, String cardDes, int ataque, int defensa) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = ataque;\n this.def = defensa;\n }",
"public Card(User user) {\n\t\tsuper();\n\t\tthis.user=user;\n\t\tuser.setCard(this);\n\t}",
"public CardDetail(String suit, String rank){\r\n this.suit = suit;\r\n this.rank = rank;\r\n }",
"Card(){\t \n}",
"CardDto getCustomerCardDetails(Long cardId) throws EOTException;",
"public AccountDto getAccountFor(int cardNumber, int cardPIN) {\n Account account = repository.getAccount(cardNumber, cardPIN);\n return getAccountDtoFor(account.getAccountId());\n }",
"Card(int num,String suit){\n this.number = num;\n this.suits = suit;\n }",
"@Override\n\tpublic void createCard(Card card) {\n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction(); \n\n\t\t/* persist */ \n\t\tsession.save(card); \n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\t}",
"public void drawCard(Card card) {\n hand.addCard(card);\n }",
"public int getCardID() {\n return cardID;\n }",
"@Override\n\tpublic String cardDetail() {\n\t\treturn atmCard.cardDetail();\n\t}",
"public String getUserCardId() {\n return userCardId;\n }",
"private void scanCard() {\n\n Intent intent = new ScanCardIntent.Builder(getActivity()).build();\n startActivityForResult(intent, Constant.REQUEST_CODE_SCAN_CARD);\n }",
"public void takeACard(Card card){\n hand.add(card);\n }",
"public Card(String name) {\n setValue(name);\n }",
"public Card() {\n var random = new SecureRandom();\n var allTypes = Type.values();\n var allSuits = Suit.values();\n this.type = allTypes[random.nextInt(10)];\n this.suit = allSuits[random.nextInt(4)];\n }",
"void pushCard(ICard card);",
"public Card()\n {\n suit = 0;\n rank = Card.ACE;\n }",
"public String getIdCard() {\n return idCard;\n }",
"public String getIdCard() {\r\n return idCard;\r\n }",
"public String getCardNumber()\n {\n return cardNumber;\n }",
"public void addCard(Card card) {\n personHand.add(card);\n }",
"public UserCard() {\n this(DSL.name(\"b2c_user_card\"), null);\n }",
"public Card(){\n this.name = \"\";\n this.description = \"\";\n this.element = null;\n this.img = \"\";\n }",
"public Card next();",
"public CreditCard(int pin, String number, String holder, Date expiryDate, int cvc){\r\n this.pin = pin;\r\n this.number = number;\r\n this.holder = holder;\r\n this.expiryDate = expiryDate;\r\n this.cvc = cvc;\r\n}",
"public Card(){\n suit = 0;\n rank = 0;\n }",
"public void registerCard(String alias, int card_nr, String Bank_name) {\n }",
"public void drawCard();",
"void addCard(Card card) {\n\t\t_hand.addCard(card);\n\t}",
"CardController getCardController() { return cardController; }",
"public UnoCard getCardByName(String cardName){\n Drawable color_change_plus4 = this.appContext.getResources().getDrawable(R.drawable.color_change_plus4);\n Drawable card_back = this.appContext.getResources().getDrawable(R.drawable.card_back);\n UnoCard card = new UnoCard(this.appContext, deckPos, new Point(20, 20), color_change_plus4, card_back, \"Color Change Plus 4\", \"\", \"COLOR CHANGE PLUS 4\", \"COLOR CHANGE PLUS 4\");\n for (UnoCard c : this.cards){\n if (c.getName().equals(cardName)){\n card = c;\n break;\n }\n }\n return card;\n }",
"public int getCardNumber() {\n return cardNumber;\n }",
"public interface Card {\n\n}",
"public interface Card {\n\n}",
"public void addCard(PlayingCard aCard);",
"public Card (Rank rank, Suit suit)\n {\n this.rank = rank;\n this.suit = suit;\n }",
"private Card loadCardFromForm() {\n //validate fields\n Card card;\n\n String cardNum = mCardForm.getCardNumber();\n\n //build card object with ONLY the number, update the other fields later\n card = new Card.Builder(cardNum, 0, 0, \"\").build();\n String cvc = mCardForm.getCvv();\n //update the cvc field of the card\n card.setCvc(cvc);\n\n //validate expiry month;\n String sMonth = mCardForm.getExpirationMonth();\n int month = 0;\n try {\n month = Integer.parseInt(sMonth);\n } catch (Exception ignored) {\n }\n\n card.setExpiryMonth(month);\n\n String sYear = mCardForm.getExpirationYear();\n int year = 0;\n try {\n year = Integer.parseInt(sYear);\n } catch (Exception ignored) {\n }\n card.setExpiryYear(year);\n\n return card;\n }",
"public String toString(){//method of return card number and balance\r\n return \"Card no:\" +number+\" has a balance of: \"+balance; \r\n }",
"public String getencodedCard() {\r\n \r\n String cardDesc=\"\";\r\n String partnerId=\"\";\r\n String cardId=\"\";\r\n \r\n if(session!=null) {\r\n if (session.getAttribute(\"Partner_Object_List\") != null) {\r\n partnerInfoList =\r\n (List<PartnerInfo>)session.getAttribute(\"Partner_Object_List\");\r\n if(getPartner()!=null && !getPartner().equals(\"\") && getCardPk() != null && !getCardPk().equals(\"\")){\r\n partnerId=getPartner();\r\n cardId=getCardPk().toString().trim();\r\n \r\n if (partnerInfoList != null) {\r\n for (int k = 0; k < partnerInfoList.size(); k++) {\r\n if (partnerId.equalsIgnoreCase(partnerInfoList.get(k).getPartnerValue().toString())) {\r\n for (int ac = 0;ac < partnerInfoList.get(k).getAccountList().size();ac++) {\r\n for (int cg = 0;cg < partnerInfoList.get(k).getAccountList().get(ac).getCardGroup().size();cg++) {\r\n for (int cd = 0;cd < partnerInfoList.get(k).getAccountList().get(ac).getCardGroup().get(cg).getCard().size();cd++) {\r\n if(cardId.equalsIgnoreCase(partnerInfoList.get(k).getAccountList().get(ac).getCardGroup().get(cg).getCard().get(cd).getCardID())) {\r\n if(partnerInfoList.get(k).getAccountList().get(ac).getCardGroup().get(cg).getCard().get(cd).getDisplayCardNumber() != null)\r\n {\r\n cardDesc= partnerInfoList.get(k).getAccountList().get(ac).getCardGroup().get(cg).getCard().get(cd).getDisplayCardNumber().toString();\r\n }\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return cardDesc;\r\n \r\n \r\n }",
"public Cards(int imageProfile, String cardtext) {\n this.imageProfile = imageProfile;\n this.cardtext = cardtext;\n }",
"public void addCard(Card card)\n {\n if (card1 == null)\n {\n card1 = card;\n }\n else if (card2 == null)\n {\n card2 = card;\n }\n }",
"@ModelAttribute(\"card\")\n public ApplicationCard getApplicationCard(PortletRequest request, PortletResponse response) throws PortletException {\n // Portal controller context\n PortalControllerContext portalControllerContext = new PortalControllerContext(this.portletContext, request, response);\n \n return this.service.getApplicationCard(portalControllerContext);\n }",
"public String getIdcard() {\n return idcard;\n }",
"public String getCardNumber() {\n return cardNumber;\n }",
"public String getCardNumber()\r\n {\r\n return cardNumber;\r\n }",
"public String getIdcard() {\r\n return idcard;\r\n }",
"public String getIdcard() {\r\n return idcard;\r\n }",
"public String getIdcard() {\r\n return idcard;\r\n }",
"private Image getCardImage(Card card) {\n return getImage(\"playing-cards/\" + card + \".png\");\n }",
"public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }",
"@GetMapping(\"{cardId}\")\n public Card getCardById(@PathVariable String cardId){\n return cardService.getCardById(cardId);\n // To service guy, grab the card object first, then iterate the \"finishedUsersId\"\n }",
"public void setIdentityCard(String identityCard) {\n this.identityCard = identityCard;\n }",
"public void getCard(Card card, Board board){\n card.action(this, board);\n }",
"@Override\n\tpublic String addCard(String name, String cpasswd, int vid, double cmoney) {\n\t\treturn cb.addCard(name, cpasswd, vid, cmoney);\n\t}",
"@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}",
"public Account(String currency) {\n //numAccount += 1;\n incrementNumAccount();\n this.accountID = numAccount;\n this.dateOfCreation = LocalDate.now();\n\n setPrimaryCurrency(currency);\n this.currencyBalance = Money.of(0, this.primaryCurrency);\n ownerID = new ArrayList<>();\n }",
"protected static Card userOwnsCard(Integer cardId, Integer userId) {\n ArrayList<Card> cards;\n try {\n cards = CardDatabase.retrieveCardsByCardId(cardId);\n } catch (Exception e) {\n return null;\n }\n\n // If no cards return null\n if (cards.size() != 1) {\n return null;\n }\n Card card = cards.get(0);\n\n // Check that accountId on the card matches accountid that user owns\n if (userOwnsAccount(card.accountId, userId) == null) {\n return null;\n }\n return card;\n }",
"public account(){\n this.accNo = 000;\n this.id = 000;\n this.atype = \"\";\n this.abal = 0.00;\n }",
"public Card(String cardFace, String cardSuit) {\r\n this.face = cardFace; // initialize face of card\r\n this.suit = cardSuit; // initialize suit of card\r\n }",
"private void setCard(@NonNull Card card) {\n Debug.trace(\"CardDetails\", card.toString());\n etCardNumber.setText(card.getCardNumber());\n etCardHolderName.setText(card.getCardHolderName());\n// etCardExpiryDate.removeTextListener();\n etCardExpiryDate.setText(DateFormatUtils.stringToStringConversion(card.getExpirationDate(), \"MM/yy\", \"MM/yyyy\"));\n// etCardExpiryDate.addDateSlash(etCardExpiryDate.getEditableText());\n// etCardExpiryDate.addTextListener();\n }",
"public void creditCard() {\n\t\tSystem.out.println(\"hsbc --- credit card\");\n\t\t\n\t}",
"public String getIdCard() {\n\t\treturn idCard;\n\t}",
"@Override\n public String toString() {\n return \"Card{\"\n + \"frontInfo='\" + frontInfo\n + '\\''\n + \", backInfo='\" + backInfo\n + '\\''\n + \", startTime=\" + startTime\n + \", ID=\" + cardID\n + '}';\n }",
"public void setCreditCardAccount(CreditCardAccount newCreditCard) {\n this.creditCardAccount = newCreditCard;\n }",
"public Card getCard(){\n return cards.get(0);\n }",
"public void addResourceCard(HexType type){\n \n }",
"CarPaymentMethod processCreditCard();",
"public java.lang.String getCardID() {\r\n return localCardID;\r\n }",
"private void chooseAcc() {\n //If there are no accounts in the database, you will be sent back to home (MainActivity).\n //Otherwise all the accounts of the logged in user will be added to a list and the list will\n // be added to a spinner\n if (db.getAllAccounts().size() == 0) {\n Toast.makeText(CreateCardActivity.this, \"You don't have any accounts. Create an account first.\",\n Toast.LENGTH_LONG).show();\n Intent intent = new Intent(CreateCardActivity.this, MainActivity.class);\n startActivity(intent);\n } else {\n List<String> accList = new ArrayList<>();\n for (int i = 0; i < db.getAllAccounts().size(); i++) {\n if (db.getAllAccounts().get(i).getUsername().equals(logUser)) {\n accList.add(db.getAllAccounts().get(i).getAccNum());\n }\n }\n\n ArrayAdapter<String> accAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_dropdown_item, accList);\n accSpinner.setAdapter(accAdapter);\n accSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n chosenAcc = parent.getItemAtPosition(position).toString();\n Toast.makeText(CreateCardActivity.this, \"Selected: \" + chosenAcc, Toast.LENGTH_SHORT).show();\n\n //Sets the visibility of different fields and therefore allows or denys creation\n // of cards based on whether a card can be created to that account or not.\n //An error message will tell why creating a card for a certain account isn't\n // allowed, if necessary\n if (!db.getAllCards().isEmpty()) {\n for (int i = 0; i < db.getAllAccounts().size(); i++) {\n for (int j = 0; j < db.getAllCards().size(); j++) {\n if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) &&\n db.getAllCards().get(j).getAccNum().equals(chosenAcc)) {\n withdrawLimit.setVisibility(View.GONE);\n payLimit.setVisibility(View.GONE);\n wholeWorld.setVisibility(View.GONE);\n europe.setVisibility(View.GONE);\n nordic.setVisibility(View.GONE);\n finland.setVisibility(View.GONE);\n save.setVisibility(View.GONE);\n withdrawText.setVisibility(View.GONE);\n payText.setVisibility(View.GONE);\n checkText.setVisibility(View.GONE);\n\n Toast.makeText(CreateCardActivity.this, \"Card already exists for this account\",\n Toast.LENGTH_LONG).show();\n } else if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) &&\n db.getAllAccounts().get(i).getType().equals(\"Savings\")) {\n\n withdrawLimit.setVisibility(View.GONE);\n payLimit.setVisibility(View.GONE);\n wholeWorld.setVisibility(View.GONE);\n europe.setVisibility(View.GONE);\n nordic.setVisibility(View.GONE);\n finland.setVisibility(View.GONE);\n save.setVisibility(View.GONE);\n withdrawText.setVisibility(View.GONE);\n payText.setVisibility(View.GONE);\n checkText.setVisibility(View.GONE);\n\n Toast.makeText(CreateCardActivity.this, \"Can't create a card to a savings account\",\n Toast.LENGTH_LONG).show();\n } else if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) && db.getAllAccounts().get(i).getCanPay() == 0) {\n withdrawLimit.setVisibility(View.GONE);\n payLimit.setVisibility(View.GONE);\n wholeWorld.setVisibility(View.GONE);\n europe.setVisibility(View.GONE);\n nordic.setVisibility(View.GONE);\n finland.setVisibility(View.GONE);\n save.setVisibility(View.GONE);\n withdrawText.setVisibility(View.GONE);\n payText.setVisibility(View.GONE);\n checkText.setVisibility(View.GONE);\n\n Toast.makeText(CreateCardActivity.this, \"Can't create a card to an account that doesn't allow payments\",\n Toast.LENGTH_LONG).show();\n } else if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) &&\n !db.getAllAccounts().get(i).getType().equals(\"Savings\") &&\n !db.getAllCards().get(j).getAccNum().equals(chosenAcc) &&\n db.getAllAccounts().get(i).getCanPay() == 1) {\n withdrawLimit.setVisibility(View.VISIBLE);\n payLimit.setVisibility(View.VISIBLE);\n wholeWorld.setVisibility(View.VISIBLE);\n europe.setVisibility(View.VISIBLE);\n nordic.setVisibility(View.VISIBLE);\n finland.setVisibility(View.VISIBLE);\n save.setVisibility(View.VISIBLE);\n withdrawText.setVisibility(View.VISIBLE);\n payText.setVisibility(View.VISIBLE);\n checkText.setVisibility(View.VISIBLE);\n }\n }\n }\n } else {\n for (int i = 0; i < db.getAllAccounts().size(); i++) {\n if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) &&\n db.getAllAccounts().get(i).getType().equals(\"Savings\")) {\n\n withdrawLimit.setVisibility(View.GONE);\n payLimit.setVisibility(View.GONE);\n wholeWorld.setVisibility(View.GONE);\n europe.setVisibility(View.GONE);\n nordic.setVisibility(View.GONE);\n finland.setVisibility(View.GONE);\n save.setVisibility(View.GONE);\n withdrawText.setVisibility(View.GONE);\n payText.setVisibility(View.GONE);\n checkText.setVisibility(View.GONE);\n\n Toast.makeText(CreateCardActivity.this, \"Can't create a card to a savings account\",\n Toast.LENGTH_LONG).show();\n } else if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) && db.getAllAccounts().get(i).getCanPay() == 0) {\n withdrawLimit.setVisibility(View.GONE);\n payLimit.setVisibility(View.GONE);\n wholeWorld.setVisibility(View.GONE);\n europe.setVisibility(View.GONE);\n nordic.setVisibility(View.GONE);\n finland.setVisibility(View.GONE);\n save.setVisibility(View.GONE);\n withdrawText.setVisibility(View.GONE);\n payText.setVisibility(View.GONE);\n checkText.setVisibility(View.GONE);\n\n Toast.makeText(CreateCardActivity.this, \"Can't create a card to an account that doesn't allow payments\",\n Toast.LENGTH_LONG).show();\n } else if (db.getAllAccounts().get(i).getAccNum().equals(chosenAcc) &&\n !db.getAllAccounts().get(i).getType().equals(\"Savings\") &&\n db.getAllAccounts().get(i).getCanPay() == 1) {\n withdrawLimit.setVisibility(View.VISIBLE);\n payLimit.setVisibility(View.VISIBLE);\n wholeWorld.setVisibility(View.VISIBLE);\n europe.setVisibility(View.VISIBLE);\n nordic.setVisibility(View.VISIBLE);\n finland.setVisibility(View.VISIBLE);\n save.setVisibility(View.VISIBLE);\n withdrawText.setVisibility(View.VISIBLE);\n payText.setVisibility(View.VISIBLE);\n checkText.setVisibility(View.VISIBLE);\n }\n }\n }\n }\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n }\n });\n selections();\n }\n }",
"public String getCardName() {\n \t\treturn cardName;\n \t}"
] | [
"0.7155004",
"0.6921156",
"0.6790602",
"0.67315984",
"0.66407627",
"0.663757",
"0.6528622",
"0.644414",
"0.64044315",
"0.6340787",
"0.6296873",
"0.62698823",
"0.6260192",
"0.624901",
"0.6246388",
"0.6217464",
"0.6215577",
"0.6205179",
"0.61956036",
"0.61787814",
"0.6138406",
"0.61103827",
"0.61076164",
"0.6098865",
"0.6092034",
"0.60904586",
"0.60849905",
"0.6074351",
"0.60630375",
"0.60581416",
"0.6040626",
"0.60337865",
"0.60094106",
"0.6009139",
"0.6008691",
"0.6005346",
"0.5992895",
"0.5974239",
"0.59694034",
"0.5964831",
"0.5959913",
"0.59536135",
"0.59523135",
"0.59404707",
"0.5931087",
"0.593006",
"0.59249383",
"0.59231913",
"0.5916354",
"0.5914165",
"0.5907079",
"0.59052163",
"0.5889369",
"0.5887647",
"0.58811647",
"0.5881084",
"0.587526",
"0.5862674",
"0.58432657",
"0.58349115",
"0.58326346",
"0.5829068",
"0.5826779",
"0.5825775",
"0.5825775",
"0.5823532",
"0.5821961",
"0.58094144",
"0.57846075",
"0.5780202",
"0.5757878",
"0.57535464",
"0.57498235",
"0.5749057",
"0.57446617",
"0.57427627",
"0.5742699",
"0.5742699",
"0.5742699",
"0.57358015",
"0.57329756",
"0.5730918",
"0.5725392",
"0.57135725",
"0.5696707",
"0.5690834",
"0.5690585",
"0.5687355",
"0.56853133",
"0.5684232",
"0.56830114",
"0.5681427",
"0.5680022",
"0.5679044",
"0.5678539",
"0.5674773",
"0.56744176",
"0.56710714",
"0.5669798",
"0.5669436",
"0.56684315"
] | 0.0 | -1 |
Requires minimum amount in account | public void lowCredit(){
if (getBalance() < minAmount){
System.out.println("Your current account is running low on credit");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setMinAmount(int min) {\n _min = min;\n }",
"public int getMinAmount() {\n return minAmount;\n }",
"protected void imposeTransactionFee ()\n {\n if (getBalance () < minimumBalance)\n super.withdraw (transactionFee);\n }",
"public int getMinAmount() {\n return _min;\n }",
"public void setMinWithdrawal(double minWithdrawal) {\n\t\tthis.minWithdrawal = minWithdrawal;\n\t}",
"public double getMinWithdrawal() {\n\t\treturn minWithdrawal;\n\t}",
"public double minimumDue(){\n return ((this.creditHours*this.feePerCreditHour)-this.scholarshipAmount+((this.healthInsurancePerAnnum*4)/12))/2;\n }",
"private boolean isValidTransaction(double remainingCreditLimit, double transactionAmount){\n return transactionAmount <= remainingCreditLimit;\n }",
"java.math.BigDecimal getSingleBetMinimum();",
"public static int minimumNumberOfPayments() {\n return 0;\n }",
"public void withdraw (int amount) {\n if (amount >= 0) {\n balance = balance - amount;\n valueWithdrawals = valueWithdrawals + amount;\n if (balance < minimumBalance){\n minimumBalance = balance;\n }\n }\n }",
"public FeeAccount (double minimumBalance, double transactionFee)\n {\n this.minimumBalance = minimumBalance;\n this.transactionFee = transactionFee;\n }",
"public static void isGreaterThanMinAmount(double userInput, double minAmount) {\n\t\tif (userInput < minAmount) {\n\t\t\tthrow new IllegalArgumentException(\"You must enter at least $\" + minAmount + \". Please try again:\");\n\t\t}\n\t}",
"public Object getMinimumBalance() {\n\treturn null;\n}",
"public void setminimumBalance(double parseDouble) {\n\t\n}",
"org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();",
"boolean isSetSingleBetMinimum();",
"public long getAmountRequested();",
"protected boolean ensureBalance(BigInteger value)\n {\n String account = appContext.getSettingProvider().getSelectedAccount();\n\n BigInteger balance = appContext.getServiceProvider().getAccountService().getAccountBalance(account).get();\n if(balance == null)\n {\n appContext.getMessageService().showErrorMessage(\"Cannot reach the exchange service. Try again later.\");\n return false;\n }\n\n if(balance.compareTo(value) < 0)\n {\n appContext.getMessageService().showErrorMessage(\"You need at least \" + value.toString() + \" wei to do that!\");\n return false;\n }\n\n return true;\n }",
"public String getVlidationMinimumQuantity()\n\t{\n\t\twaitForVisibility(validationMinimumQuantity);\n\t\treturn validationMinimumQuantity.getText();\n\t}",
"int getAllowedCredit();",
"org.apache.xmlbeans.XmlDecimal xgetWagerMinimum();",
"int askForTempMin();",
"@Override\r\n\tvoid withdraw(double amount) {\n\t\tsuper.withdraw(amount);\r\n\t\tif(minimumblc>500)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"you have withdraw rupees\"+ (amount));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"withdraw failed \");\r\n\t\t}\r\n\t\t\r\n\t}",
"java.math.BigDecimal getMultipleBetMinimum();",
"public BigDecimal getMinQuantity() {\n return _minQuantity;\n }",
"public int withdraw() {\n\t\tif ((acc.getBalance() - keyboard.getAmt()) > acc.getMinimumBalace()) {\r\n\t\t\tif (casher.withdraw(keyboard.getAmt()) == 1) {\r\n\t\t\t\tsetNewBalance();\r\n\t\t\t\t\r\n\t\t\t\treciept.printer(acc.getAccountNumber(), acc.getBalance(), keyboard.getAmt());\r\n\t\t\t\treturn 1;\r\n\t\t\t} else\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn 0;\r\n\r\n\t}",
"public int getMinimumPaymentSum() {\n return model.getMinimumPaymentSum();\n }",
"void setSingleBetMinimum(java.math.BigDecimal singleBetMinimum);",
"public void setMaxTotalCost(int amount);",
"public void becomePremium() {\n\t\tif (this.account >= 100 && this.premium == false) {\n\t\t\tthis.account -= 100;\n\t\t\tthis.premium = true;\n\t\t\tSystem.out.println(\"Premium transaction successful\");\n\n\t\t} else if (this.premium == true) {\n\t\t\tSystem.out.println(\"They are already a premium user!\");\n\n\t\t} else {\n\t\t\tSystem.err.println(\n\t\t\t\t\t\"Error - not enough funds in account.\\nPremium charge is $100\\nBalance: $\" + this.getBalance() + \"\\nPlease top up account manually.\\nReturning to main menu.\");\n\t\t}\n\t}",
"public BigDecimal getPriceLimitEntered();",
"public Object setminHolding$minCash(double holding, double minimumcash)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setminHolding$minCash : \" + \"Agent\");\r\n/* 77 */ \tthis.minholding = holding;\r\n/* 78 */ \tthis.mincash = minimumcash;\r\n/* 79 */ \treturn this;\r\n/* */ }",
"InsufficientFunds(Account a) {\n balance = a.currentBalance();\n }",
"public withdrawException() {\n super(\"The Sum you entered is greater than your available money... \");\n }",
"void setNilSingleBetMinimum();",
"public int getInitialMoney() {\n return initialMoney;\n }",
"public Double getMinimumTransaction() {\n if (transactions.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tDouble min = transactions.get(0).getAmount().doubleValue();\n\t\t\tfor (int i = 1; i < transactions.size(); i++) {\n\t\t\t\tif (min > transactions.get(i).getAmount().doubleValue()) {\n\t\t\t\t\tmin = transactions.get(i).getAmount().doubleValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n }",
"public static WebElement txtbx_enterMinOrderQuantity() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.id(\"MOQ\"));\r\n \t\tAdd_Log.info(\"User is enter text for 'Min Order Quantity' field.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Min Order Quantity field is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }",
"public void withdraw(double ammount) throws insufficientFunds{\n if(ammount > abal)\n throw new insufficientFunds();\n else{\n ammount = abal - ammount;\n UpdateDB();\n }\n }",
"public void enoughForTransfer(double amount) throws BankException {\n if (this.currentAmount + amount > MAX_AMOUNT) {\n logger.warning(\"The amount in the receiving bank account cannot exceed 9 digits\");\n throw new BankException(\"The amount in the receiving bank account cannot exceed 9 digits\");\n }\n }",
"private void validateBalance(Double fromBalance, Double transferAmount) throws PaymentsException {\n\t\tif ((fromBalance - transferAmount) <= 0) {\n\t\t\tlogger.error(\"Not enough balance.\");\n\t\t\tthrow new PaymentsException(\" Not enough funds. \");\n\t\t\t\n\t\t}\n\t}",
"public BigDecimal getBSCA_ProfitPriceLimitEntered();",
"public DecimalMinValidator(BigDecimal min) {\n this.min = min;\n }",
"@Payable @Entry\n\tpublic ExternallyOwnedAccount(int initialAmount) {}",
"public abstract int getMinimumValue();",
"@Test\n public void testMoreRequired() throws VendingMachineInventoryException{\n service.addFunds(\"1.00\");\n Item testitem = new Item(\"testitem\", \"1.50\", \"5\");\n service.addItem(\"testitem\", testitem);\n BigDecimal moneyRequired = service.moreRequired(\"testitem\");\n BigDecimal expectedMoneyRequired = new BigDecimal(\"0.50\");\n assertEquals(moneyRequired, expectedMoneyRequired);\n }",
"public double getMinCharge() {\r\n return minCharge;\r\n }",
"public CheckingAccount (double openingBalance) {\n\t\t//super(openingBalance; INT_RATE);\n\t\tsuper(openingBalance);\n\t}",
"public void setMinTransfer(double minTransfer) {\n\t\tthis.minTransfer = minTransfer;\n\t}",
"private void CustomerPaidCheck() {\n\t\tfloat CompanyDemand = Float.parseFloat(label_7.getText());\n\t\tif (CompanyDemand > 0) {\n\n\t\t\ttry {\n\t\t\t\tPreparedStatement statement = DBConnection.connection\n\t\t\t\t\t\t.prepareStatement(\"update customer_list set `Check` = 0 where Name = '\"\n\t\t\t\t\t\t\t\t+ name + \"'And Last_Name = '\" + lastName + \"' \");\n\t\t\t\tstatement.execute();\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} else {\n\t\t\ttry {\n\t\t\t\tPreparedStatement statement = DBConnection.connection\n\t\t\t\t\t\t.prepareStatement(\"update customer_list set `Check` = 1 where Name = '\"\n\t\t\t\t\t\t\t\t+ name + \"'And Last_Name = '\" + lastName + \"' \");\n\t\t\t\tstatement.execute();\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}",
"public void payEconomical() {\n if (this.balance >= 2.50) {\n this.balance -= 2.50;\n }\n }",
"public void enterMinimumQuantity(String minimum_quantity)\n\t{\n\t\twaitForVisibility(minimumQuantity);\n\t\tminimumQuantity.clear();\n\t\tminimumQuantity.sendKeys(minimum_quantity);\n\t}",
"public Account(String name, double balance){\n\n this.name = name;\n\n if (balance > 0.0 )\n this.balance = balance;\n }",
"boolean check(double amount) {\n\t\treturn (balance >= amount);\n\t}",
"public void setMinQuantity(BigDecimal minQuantity) {\n this._minQuantity = minQuantity;\n }",
"org.apache.xmlbeans.XmlDecimal xgetMultipleBetMinimum();",
"public void withdraw(double amount) throws \n\t\t\t\t\t\t\t\t\tBalanceTooLowException{\n\t\tif(balance >= amount){\n\t\t\tbalance -= amount;\n\t\t}\n\t\telse{\n\t\t\tdouble needs = amount - balance;\n\t throw new BalanceTooLowException(needs);\n\t\t}\n\t}",
"@Payable @Entry\n\tpublic ExternallyOwnedAccount(long initialAmount) {}",
"private void checkAnnoRateo() {\n\t\tif(req.getRateo().getAnno()>=primaNota.getBilancio().getAnno()){\n\t\t\tthrow new BusinessException(ErroreCore.OPERAZIONE_NON_CONSENTITA.getErrore(\"L'anno del Rateo deve essere minore dell'anno della prima nota di partenza.\"));\n\t\t}\n\t}",
"public GiftCardProductQuery openAmountMin() {\n startField(\"open_amount_min\");\n\n return this;\n }",
"java.math.BigDecimal getWagerMinimum();",
"private double requestCashPayment(double total) {\n double paid = 0;\n while (paid < total) {\n double entered = ScannerHelper.getDoubleInput(\"Enter amount paid: \", 0);\n paid += entered;\n System.out.printf(\"Accepted $%.2f in cash, Remaining amount to pay: $%.2f\\n\", entered, (total - paid >= 0) ? total - paid : 0);\n }\n return paid;\n }",
"public void recordPurchase(double amount)\n {\n balance = balance - amount;\n // your code here\n \n }",
"boolean isSetMultipleBetMinimum();",
"private void notEligibleForRealMin() {\n eligibleForRealMin = false;\n }",
"private boolean validateAmountSize(double amount, HttpServletRequest req, HttpServletResponse resp) throws IOException {\n if(amount > maxAmount\n || amount <= 0){\n page.redirectTo(\"/account\", resp, req,\n \"errorMessage\", \"Transactions of that size are not permitted!\");\n return false;\n }\n return true;\n }",
"private void validateSendAmount() {\n try {\n if (new BigDecimal(sanitizeNoCommas(sendNanoAmount))\n .compareTo(new BigDecimal(sanitizeNoCommas(NumberUtil.getRawAsLongerUsableString(accountBalance.toString())))) > 0) {\n RxBus.get().post(new SendInvalidAmount());\n }\n } catch (NumberFormatException e) {\n ExceptionHandler.handle(e);\n }\n }",
"public int getMinimum() {\n \tcheckWidget();\n \treturn minimum;\n }",
"void setWagerMinimum(java.math.BigDecimal wagerMinimum);",
"public boolean canCredit(double amount);",
"public boolean addTransaction(double amount) {\n if ((this.balance+amount)>=0) {\r\n this.transactions.add(amount);\r\n balance+=amount;\r\n return true;\r\n }else{\r\n System.out.println(\"Balance Insufficient\");\r\n return false;\r\n }\r\n }",
"@Override\r\n\tpublic boolean withdraw(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tif (balance > amount) {\r\n\t\t\t\t\tbalance = (float) (balance - amount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InsufficientBalanceException(\"You'er Balance is insufficient to make this transation !\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public void validateMinBid(String value){\n boolean isValid = validateBidPrice(value);\n setMinBidValid(isValid);\n }",
"boolean hasAmount();",
"boolean hasAmount();",
"public Integer withdraw(Integer amount) {\r\n\t if (balance < amount) {\r\n\t throw new NotEnoughFundsException(amount, balance);\r\n\t }\r\n\t balance -= amount;\r\n\t return balance;\r\n\t }",
"private void checkDebtTotal(Double totalDebt, Double amountInCurrencyDefault) {\n\t\tif(amountInCurrencyDefault > totalDebt) {\n\t\t\tthrow new PaymentExceedsTotalDebtException(String.format(\"El pago con monto '%1$,.2f' excede la deuda del usuario '%2$,.2f'\", amountInCurrencyDefault, totalDebt));\n\t\t}\n\t}",
"@Test\n\tpublic void moneyTrnasferExcetionInsufficientBalanceOfFromAccount() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 40000.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Account Number - \");\n\t\tsb.append(accountNumberFrom);\n\t\tsb.append(\" do not have sufficient amout to transfer.\");\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}",
"@Override\n\tpublic void withdraw(double amount) {\n\t\tif (super.getBalance() - amount > overdraftLimit) {\n\t\t\tsuper.setBalance(getBalance() - amount);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Amount exceeds overdraft limit.\");\n\t}",
"public Wallet() {\n total_bal = 10;\n }",
"void preWithdraw(double amount) {\n\t\tSystem.out.println(\"Your account is not saver account.\");\n\t}",
"public void setMinCharge(double minCharge) {\r\n if (minCharge < 0 || Double.isNaN(minCharge)){\r\n throw new IllegalArgumentException();\r\n }\r\n this.minCharge = minCharge;\r\n }",
"public void credit(float amount){\n\t\taccount.credit(amount);\n\t\tSystem.out.println(\"\\t+ \"+ this + \" account is credited with \" + amount + \" euros; its balance is now \" + account );\n\t}",
"@Override\r\n\tpublic double checkBalance(String mobileNo) {\n\t\tCustomer custCheckBalance = custMap.get(mobileNo);\r\n\t\tdouble amount = custCheckBalance.getInitialBalance();\r\n\t\treturn amount;\r\n\t}",
"public Checking_Account (int account_num, double initial_balance, Savings_Account protection)\r\n {\r\n\r\n super (account_num, initial_balance);\r\n overdraft = protection;\r\n\r\n }",
"boolean isNilSingleBetMinimum();",
"public double getMinimumValue() { return this.minimumValue; }",
"void xsetSingleBetMinimum(org.apache.xmlbeans.XmlDecimal singleBetMinimum);",
"Double getMinimumValue();",
"@Override\n public int getAmount() {\n return 1;\n }",
"double getMin();",
"double getMin();",
"int getRequiredAmountFor(AResourceType type);",
"public double getMinTransfer() {\n\t\treturn minTransfer;\n\t}",
"public StandardAccount(int accountNumber, double creditLimit) {\n super(accountNumber);\n this.creditLimit = creditLimit;\n }",
"@Transactional(readOnly = true)\n public boolean checkAvailableBalance(Long accountId, Double amount) {\n return getAccountBalance(accountId) < amount;\n }",
"@Override\r\n\tpublic int isMinimalCostToReach17Plus()\r\n\t{\r\n\t\treturn 1;\r\n\t}",
"void xsetWagerMinimum(org.apache.xmlbeans.XmlDecimal wagerMinimum);",
"public void setMinimum(Number min) {\n this.min = min;\n }"
] | [
"0.7066626",
"0.6845851",
"0.66401434",
"0.6609423",
"0.65257716",
"0.63705397",
"0.6354063",
"0.6210831",
"0.6202264",
"0.6199206",
"0.61766666",
"0.6168882",
"0.6141158",
"0.6141129",
"0.60745937",
"0.60523885",
"0.6044942",
"0.60281575",
"0.6001876",
"0.59945154",
"0.594173",
"0.59298617",
"0.5896633",
"0.5872481",
"0.5863418",
"0.58484524",
"0.58318436",
"0.58239216",
"0.58099556",
"0.5801091",
"0.5798445",
"0.5785247",
"0.57850784",
"0.5782403",
"0.57811856",
"0.57743376",
"0.57730746",
"0.57623714",
"0.5751177",
"0.57510936",
"0.5750395",
"0.5716167",
"0.5712956",
"0.5680061",
"0.56757283",
"0.567167",
"0.5668255",
"0.56627226",
"0.5658573",
"0.5645689",
"0.5645339",
"0.5637164",
"0.5632845",
"0.56274354",
"0.5627323",
"0.56164217",
"0.5613607",
"0.56077516",
"0.5606235",
"0.5606222",
"0.55992645",
"0.5585316",
"0.5579224",
"0.5579081",
"0.5576678",
"0.557298",
"0.55678505",
"0.556473",
"0.5561918",
"0.55600065",
"0.5557024",
"0.55562454",
"0.5555075",
"0.554342",
"0.5540886",
"0.5540886",
"0.5540648",
"0.5529371",
"0.5523725",
"0.5516145",
"0.5515617",
"0.5509942",
"0.5503399",
"0.550163",
"0.55009425",
"0.55003303",
"0.54975736",
"0.5491298",
"0.54908466",
"0.54904306",
"0.54898757",
"0.5488533",
"0.5488533",
"0.5486663",
"0.5482757",
"0.5478884",
"0.54755145",
"0.5469046",
"0.5461723",
"0.5456862"
] | 0.68042725 | 2 |
things concerning ShPrefs should be in separate class, | void removeAccessToken() {
SharedPreferences prefs = // because rest also needs token
context.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);
prefs.edit()
.remove(KEY_ACCESS_TOKEN)
.apply();
// notification to all listeners
state.onNext(new AuthState(false));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPrefs(GamePreferences prefs) {\n\t\tthis.prefs = prefs;\n\t}",
"SharedPreferences mo117960a();",
"public void handlePreferences() {\n displayPrefs ();\n }",
"ReadOnlyUserPrefs getUserPrefs();",
"ReadOnlyUserPrefs getUserPrefs();",
"ReadOnlyUserPrefs getUserPrefs();",
"ReadOnlyUserPrefs getUserPrefs();",
"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 }",
"public SharedPreferences getPrefs() { return this.prefs; }",
"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}",
"public interface PreferencesHelper {\r\n\r\n int getUserLoggedInMode();\r\n\r\n void setUserLoggedInMode(DataManager.LoggedInMode mode);\r\n\r\n String getUserName();\r\n\r\n void setUserName(String userName);\r\n\r\n String getAccessToken();\r\n\r\n void setAccessToken(String accessToken);\r\n\r\n String getUserProfilePicUrl();\r\n\r\n void setUserProfilePicUrl(String profilePicUrl);\r\n\r\n String getStoredProfilePicPath();\r\n\r\n void setStoredProfilePicPath(String profilePicPath);\r\n\r\n}",
"private GlobalPrefs() {\n\t\tprops = new Properties();\n\t}",
"public SharedPref() {\n super();\n }",
"public void save() {\n savePrefs();\n }",
"void realizeMeaningPrefs(Object obj, Variable[] vars) {\n realizeMeaningPrefs(projectSettings, obj, vars);\n \t}",
"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 }",
"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 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 }",
"public DeveloperPrefsPanel(DeveloperPreferences prefs) {\n\t\tthis.prefs = prefs;\n\t\tinitComponents();\n\t}",
"@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 Preferences getPrefs() {\n return _prefs;\n }",
"public SharePref(Context context) {\n sPrefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);\n }",
"@Provides\n @Singleton\n UtilsPrefs providesUtilsPrefs(SharedPreferences sharedPreferences) {\n UtilsPrefs utilsPrefs = new UtilsPrefs(sharedPreferences);\n return utilsPrefs;\n }",
"public static interface Prefs{\n /**\n * The key-value pair stores the name of the file\n */\n public static final String FILE_NAME = \"game_preferences\";\n\n /**\n * The key that stores the field name: the best score\n */\n public static final String KEY_BEST_SCORE = \"best_score\";\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 }",
"@Override\n public void clearSharedPrefs() {\n\n }",
"private void getAutonomousPrefs() {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(hardwareMap.appContext);\n alliance = preferences.getString(\"AllianceColor\", \"error\");\n frontBack = preferences.getString(\"FrontBack\", \"error\");\n getPartnerGlyph = preferences.getBoolean(\"PickupAllianceGlyph\", false);\n getPitGlyph = preferences.getBoolean(\"PickupPitGlyph\", false);\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}",
"private MinesweeperPreferences getPrefs() {\n return Main.getPrefs();\n }",
"public SettingsPreferenceStore(Settings base){\n\t\tthis.base = base;\n\t}",
"public interface PreferenceHelper {\r\n // Preference Name\r\n String PREFERENCE_NAME = \"Embedded_Downloads_preference\";\r\n // Preference mode\r\n int PRIVATE_MODE = 0;\r\n String INITIAL_START = \"initial_start\";\r\n String WALLET_ADDRESS = \"wallet_address\";\r\n String WALLET_NAME = \"wallet_name\";\r\n String TRANSACTION_WALLET_ADDRESS = \"transaction_wallet_address\";\r\n String WALLET_POSITION =\"wallet_position\";\r\n String CALL_TRANSACTION_STATUS = \"call_transaction_status\";\r\n String CALL_INCOMING = \"call_incoming\";\r\n String CALL_OUTGOING = \"call_outgoing\";\r\n}",
"protected abstract IPreferenceStore getPreferenceStore();",
"@SuppressWarnings(\"deprecation\")\n\tprivate void setupSimplePreferencesScreen() {\n\t\tif (!isSimplePreferences(this)) {\n\t\t\treturn;\n\t\t}\n\n\t\taddPreferencesFromResource(R.xml.pref_blank);\n\n\t\t// Add 'filters' preferences.\n\t\tPreferenceCategory fakeHeader = new PreferenceCategory(this);\n\n\t\t// Add 'appearance' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.appearance);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_appearance);\n\n\t\t// Add 'text color' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.text_color);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_textcolor);\n\n\t\t// Add 'info' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.information);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_info);\n\n\t\t// Add others\n\t\tsetupOpenSourceInfoPreference(this, findPreference(getString(R.string.pref_info_open_source)));\n\t\tsetupVersionPref(this, findPreference(getString(R.string.pref_version)));\n\n\t}",
"private SharedPreferencesManager(){}",
"public abstract SharedPreferences getStateSettings();",
"private void initAuthorizedPrefs()\n {\n authorizedPrefs = new ArrayList<String>();\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_LABEL );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_ABBREVIATE );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_ABBREVIATE_MAX_LENGTH );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_DISPLAY );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_GROUPING );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_SORTING_BY );\n authorizedPrefs.add( PluginConstants.PREFS_SCHEMA_VIEW_SORTING_ORDER );\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}",
"private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}",
"public SettingsController(){\n SharedPreferences prefs = MainActivity.context.getSharedPreferences(MY_PREFERENCES, MODE_PRIVATE);\n backgroundMusicOn = prefs.getBoolean(MUSIC_PREFERENCES, true);\n soundEffectsOn= prefs.getBoolean(SOUND_EFFECTS_PREFERENCES, true);\n deckSkin=prefs.getString(DECK_SKIN_PREFERENCES, \"back1\");\n animationSpeed=prefs.getInt(ANIMATION_SPEED_PREFERENCES,ANIMATION_MEDIUM);\n }",
"protected void addStaticPreferences(PreferenceScreen screen) {\n }",
"public Prefs(Activity context){\n this.preferences = context.getSharedPreferences(prefContext, Context.MODE_PRIVATE);\n this.context = context;\n\n }",
"static void realizeMeaningPrefs(HashMap<Setting,Object> projectSettings, Object obj, Variable[] vars) {\n HashMap<String,Object> settingsByPrefName = new HashMap<String,Object>();\n for (int i = 0; i < vars.length; i++) {\n Variable var = vars[i];\n if (var == null) continue;\n Object value = var.getObject();\n if (!(value instanceof String)) {\n if (value instanceof Short || value instanceof Byte)\n value = new Integer(((Number)value).intValue());\n if (!(value instanceof Number) && !(value instanceof Boolean))\n continue;\n }\n String prefName = var.getKey().getName();\n String prefPath = null;\n if (obj instanceof Technology) {\n prefPath = Technology.TECH_NODE + \"/\";\n Map<Setting,Object> convertedVars = ((Technology)obj).convertOldVariable(prefName, value);\n if (convertedVars != null) {\n for (Map.Entry<Setting,Object> e: convertedVars.entrySet()) {\n Setting setting = e.getKey();\n prefName = setting.getPrefName();\n value = e.getValue();\n projectSettings.put(setting, value);\n }\n continue;\n }\n } else if (obj instanceof Tool) {\n prefPath = ((Tool)obj).prefs.relativePath() + \"/\";\n }\n settingsByPrefName.put(prefPath + prefName, value);\n }\n Setting.Group grp = obj instanceof Technology ? ((Technology)obj).getProjectSettings() : ((Tool)obj).getProjectSettings();\n for (Setting setting: grp.getSettings()) {\n Object value = settingsByPrefName.get(setting.getPrefPath());\n if (value != null)\n projectSettings.put(setting, value);\n }\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 processPrefs(Class<?> baseClass, SimplTypesScope translationScope,\n \t\t\tStack<String> argStack, float prefsAssetVersion) throws SIMPLTranslationException\n \t{\n \t\tLaunchType launchType = LaunchType.ECLIPSE; // current default\n \n \t\t// look for launch method identifier in upper case\n \t\tString arg = pop(argStack);\n \n \t\tif (arg != null)\n \t\t{\n \t\t\tString uc = arg.toUpperCase();\n \t\t\tif (\"JNLP\".equals(uc))\n \t\t\t{ // tells us how we were launched: e.g., JNLP, ECLIPSE, ...\n \t\t\t\tlaunchType = LaunchType.JNLP;\n \t\t\t}\n \t\t\telse if (\"STUDIES\".equals(uc))\n \t\t\t{\n \t\t\t\tlaunchType = LaunchType.STUDIES;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t// TODO -- recognize JAR here !!!\n \t\t\t\targStack.push(arg);\n \t\t\t}\n \t\t\tLAUNCH_TYPE_PREF.setValue(launchType);\n \t\t}\n \t\tprintln(\"LaunchType = \" + launchType);\n \t\tthis.launchType = launchType;\n \t\t// look for codeBase path\n \t\targ = pop(argStack);\n \n \t\t// read perhaps meta-preferences and surely preferences from application data dir\n \t\tFile applicationDir = PropertiesAndDirectories.thisApplicationDir();\n \n \t\tParsedURL applicationDataPURL = new ParsedURL(applicationDir);\n \t\tprefsPURL = applicationDataPURL.getRelative(\"preferences/prefs.xml\");\n \t\tdebugA(\"prefsPURL= \" + prefsPURL);\n \n \t\tSystem.out.println(\"arg: \" + arg);\n \n \t\tswitch (launchType)\n \t\t{\n \t\tcase STUDIES:\n \t\tcase JNLP:\n \t\t\t// next arg *should* be code base\n \t\t\tif ((arg != null) && arg.endsWith(\"/\"))\n \t\t\t{\n \t\t\t\t// JNLP only! (as of now)\n \t\t\t\t// right now this only works for http://\n \t\t\t\tParsedURL codeBase = ParsedURL.getAbsolute(arg, \"Setting up codebase\");\n \t\t\t\tthis.setCodeBase(codeBase);\n \n \t\t\t\t// XXX is this right?\n \t\t\t\tfinal String host = codeBase.host();\n \t\t\t\tif (\"localhost\".equals(host) || \"127.0.0.1\".equals(host))\n \t\t\t\t{\n \t\t\t\t\tdebug(\"launched from localhost. must be a developer.\");\n \t\t\t\t\tLAUNCH_TYPE_PREF.setValue(LaunchType.LOCAL_JNLP);\n \t\t\t\t}\n \n \t\t\t\tSIMPLTranslationException metaPrefSetException = null;\n \t\t\t\tParsedURL metaPrefsPURL = null;\n \t\t\t\ttry\n \t\t\t\t{\n \t\t\t\t\tAssetsRoot prefAssetsRoot = new AssetsRoot(this, PREFERENCES, null);\n \t\t\t\t\tFile metaPrefsFile = Assets.getAsset(\tprefAssetsRoot,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMETAPREFS_XML,\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\"prefs\",\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefsAssetVersion);\n \t\t\t\t\tmetaPrefsPURL = new ParsedURL(metaPrefsFile);\n \t\t\t\t\tmetaPrefSet = MetaPrefSet.load(metaPrefsFile, translationScope);\n \t\t\t\t\tprintln(\"OK: loaded MetaPrefs from \" + metaPrefsFile);\n \t\t\t\t}\n \t\t\t\tcatch (SIMPLTranslationException e)\n \t\t\t\t{\n \t\t\t\t\tmetaPrefSetException = e;\n \t\t\t\t}\n \t\t\t\tcatch (Exception e)\n \t\t\t\t{\n \t\t\t\t\te.printStackTrace();\n \t\t\t\t}\n \t\t\t\t// from supplied URL instead of from here\n \t\t\t\ttry\n \t\t\t\t{\n \t\t\t\t\tdebugA(\"Considering prefSet=\" + prefSet + \"\\tprefsPURL=\" + prefsPURL);\n \t\t\t\t\tif (prefSet == null) // Normal Case\n \t\t\t\t\t{\n \t\t\t\t\t\tprefSet = PrefSet.load(prefsPURL, translationScope);\n \t\t\t\t\t\tif (prefSet != null)\n \t\t\t\t\t\t\tprintln(\"OK: Loaded Prefs from \" + prefsPURL);\n \t\t\t\t\t\telse\n \t\t\t\t\t\t\tprintln(\"No Prefs to load from \" + prefsPURL);\n \t\t\t\t\t}\n \t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t{\n \t\t\t\t\t\twarning(\"Couldn't load MetaPrefs:\");\n \t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tcatch (SIMPLTranslationException e)\n \t\t\t\t{\n \t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t{\n \t\t\t\t\t\terror(\"Can't load MetaPrefs or Prefs. Quitting.\");\n \t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\te.printTraceOrMessage(this, \"Prefs\", prefsPURL);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\t// meta prefs o.k. we can continue\n \t\t\t\t\t\twarning(\"Couldn't load Prefs:\");\n \t\t\t\t\t\te.printTraceOrMessage(this, \"Prefs\", prefsPURL);\n \t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\tdebugA(\"argStack.size() = \" + argStack.size());\n \t\t\t\tif (argStack.size() > 0)\n \t\t\t\t{\n \t\t\t\t\tString prefSpec = \"\";\n \t\t\t\t\tif (arg.startsWith(\"http://\"))\n \t\t\t\t\t{\n \t\t\t\t\t\t// PreferencesServlet\n \t\t\t\t\t\tprefSpec = pop(argStack);\n \n \t\t\t\t\t\tif (prefSpec != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\t// load URLEncoded prefs XML straight from the argument\n \t\t\t\t\t\t\tPrefSet JNLPPrefSet = loadPrefsFromJNLP(prefSpec);\n \n \t\t\t\t\t\t\tif (JNLPPrefSet != null)\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tif (prefSet == null)\n \t\t\t\t\t\t\t\t\tprefSet = JNLPPrefSet;\n \t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\tprefSet.append(JNLPPrefSet);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t{ // if we got args straight from jnlp, then continue\n \t\t\t\t\t\t\t\tif (JNLPPrefSet != null)\n \t\t\t\t\t\t\t\t\tprefSpec = pop(argStack);\n \n \t\t\t\t\t\t\t\tif (prefSpec != null)\n \t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\tPrefSet servletPrefSet = requestPrefFromServlet(prefSpec, translationScope);\n \t\t\t\t\t\t\t\t\tif (servletPrefSet == null)\n \t\t\t\t\t\t\t\t\t\terror(\"incorrect prefXML string returned from the servlet=\" + prefSpec);\n \t\t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\t\tif (prefSet == null)\n \t\t\t\t\t\t\t\t\t\t\tprefSet = servletPrefSet;\n \t\t\t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\t\t\tprefSet.append(servletPrefSet);\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\terror(\"No code base argument :-( Can't load preferences.\");\n \t\t\t}\n \t\t\tbreak;\n \t\tcase ECLIPSE:\n \t\tcase JAR:\n \t\t\t// NB: This gets executed even if arg was null!\n \t\t\tFile localCodeBasePath = deriveLocalFileCodeBase(baseClass); // sets codeBase()!\n \t\t\targStack.push(arg);\n \n \t\t\t// AssetsRoot prefAssetsRoot = new AssetsRoot(Assets.getAssetsRoot().getRelative(PREFERENCES),\n \t\t\t// Files.newFile(PropertiesAndDirectories.thisApplicationDir(), PREFERENCES));\n \t\t\t// Assets.downloadZip(prefAssetsRoot, \"prefs\", null, false, prefsAssetVersion);\n \n \t\t\tSIMPLTranslationException metaPrefSetException = null;\n \t\t\tFile metaPrefsFile = new File(localCodeBasePath, ECLIPSE_PREFS_DIR + METAPREFS_XML);\n \t\t\tParsedURL metaPrefsPURL = new ParsedURL(metaPrefsFile);\n \t\t\ttry\n \t\t\t{\n \t\t\t\tmetaPrefSet = MetaPrefSet.load(metaPrefsPURL, translationScope);\n \t\t\t\tprintln(\"OK: Loaded MetaPrefs from: \" + metaPrefsFile);\n \t\t\t}\n \t\t\tcatch (SIMPLTranslationException e)\n \t\t\t{\n \t\t\t\tmetaPrefSetException = e;\n \t\t\t}\n \n \t\t\t// load the application dir prefs from this machine\n \t\t\t// (e.g., c:\\Documents and Settings\\andruid\\Application\n \t\t\t// Data\\combinFormation\\preferences\\prefs.xml\n \t\t\t// these are the ones that get edited interactively!\n \n \t\t\tprefSet = PrefSet.load(prefsPURL, translationScope);\n \t\t\tif (prefSet != null)\n \t\t\t\tprintln(\"Loaded Prefs from: \" + prefsPURL);\n \t\t\telse\n \t\t\t\tprintln(\"No Prefs to load from: \" + prefsPURL);\n \n \t\t\t// now seek the path to an application specific xml preferences file\n \t\t\targ = pop(argStack);\n \t\t\t// if (arg == null)\n \t\t\t// return;\n \t\t\tif (arg != null)\n \t\t\t{\n \t\t\t\t// load preferences specific to this invocation\n \t\t\t\tif (arg.endsWith(\".xml\"))\n \t\t\t\t{\n \t\t\t\t\tFile argPrefsFile = new File(localCodeBasePath, ECLIPSE_PREFS_DIR + arg);\n \t\t\t\t\tParsedURL argPrefsPURL = new ParsedURL(argPrefsFile);\n \t\t\t\t\ttry\n \t\t\t\t\t{\n \t\t\t\t\t\tPrefSet argPrefSet = PrefSet.load(argPrefsPURL, translationScope);\n \t\t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\twarning(\"Couldn't load MetaPrefs:\");\n \t\t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (argPrefSet != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tprintln(\"OK: Loaded Prefs from: \" + argPrefsFile);\n \t\t\t\t\t\t\tif (prefSet != null)\n \t\t\t\t\t\t\t\tprefSet.addPrefSet(argPrefSet);\n \t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\tprefSet = argPrefSet;\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tprintln(\"\");\n \t\t\t\t\t\t\tString doesntExist = argPrefsFile.exists() ? \"\" : \"\\n\\tFile does not exist!!!\\n\\n\";\n \t\t\t\t\t\t\tprintln(\"ERROR: Loading Prefs from: \" + argPrefsFile + doesntExist);\n \t\t\t\t\t\t}\n \n \t\t\t\t\t}\n \t\t\t\t\tcatch (SIMPLTranslationException e)\n \t\t\t\t\t{\n \t\t\t\t\t\tif (metaPrefSetException != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\terror(\"Can't load MetaPrefs or Prefs. Quitting.\");\n \t\t\t\t\t\t\tmetaPrefSetException.printTraceOrMessage(this, \"MetaPrefs\", metaPrefsPURL);\n \t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\tthrow e;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t// meta prefs o.k. we can continue without having loaded Prefs now\n \t\t\t\t\t\te.printTraceOrMessage(this, \"Couldn't load Prefs\", argPrefsPURL);\n \t\t\t\t\t\tprintln(\"\\tContinuing.\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t\targStack.push(arg);\n \t\t\t}\n \t\t\telse\n \t\t\t\targStack.push(arg); // let the next code handle returning.\n \t\t\tbreak;\n \t\t}\n \t\tSystem.out.println(\"Printing Prefs:\\n\");\n \t\ttry\n \t\t{\n \t\t\tif (prefSet != null)\n \t\t\t\tSimplTypesScope.serialize(prefSet, System.out, StringFormat.XML);\t\t\t\t\n \t\t}\n \t\tcatch (SIMPLTranslationException e)\n \t\t{\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\n \t\t}\n \t\tSystem.out.println(\"\\nPrefs Printed\");\n \t\tif (prefSet != null)\n \t\t\tpostProcessPrefs(prefSet);\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 }",
"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 GamePreferences getPrefs() {\n\t\treturn prefs;\n\t}",
"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 }",
"@SuppressLint(\"CommitPrefEdits\")\n @Override\n public void onLoadFinished(Loader<SharedPreferences> loader,\n SharedPreferences prefs) {\n }",
"private void currentStateSaveToSharedPref() {\n sharedPreferences = getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"nameOfActiveChallenge\", nameOfCurrentChallenge);\n editor.putInt(\"key1OfActiveChallenge\", key1OfActiveChallenge);\n editor.putString(\"dateOfLastEdit\", dateOfLastEdit);\n editor.putFloat(\"goal\", goal);\n editor.putFloat(\"carry\", carry);\n editor.putInt(\"challengeDaysRunning\", challengeDaysRunning);\n editor.commit();\n }",
"public void 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 }",
"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 }",
"private void getPrefStatus() {\n Log.i(TAG, \"getPrefStatus()\");\n mPref = getSharedPreferences(PREF_NAME, Context.MODE_WORLD_READABLE\n | Context.MODE_WORLD_WRITEABLE);\n mHasGotPref = true;\n for (int i = SPEED_DIAL_MIN; i < SPEED_DIAL_MAX + 1; ++i) {\n mPrefNumState[i] = mPref.getString(String.valueOf(i), \"\");\n mPrefMarkState[i] = mPref.getInt(String.valueOf(offset(i)), -1);\n }\n }",
"private void getDataFromSharedPrefernce() {\r\n\r\n\t\tprofileImageString = mSharedPreferences_reg.getString(\"ProfileImageString\",\"\");\r\n\t\tpsedoName = mSharedPreferences_reg.getString(\"PseudoName\", \"\");\r\n\t\tprofiledescription = mSharedPreferences_reg.getString(\"Pseudodescription\", \"\");\r\n\r\n\t\tsetDataToRespectiveFields();\r\n\t}",
"protected void onPref(String name, String value){}",
"private void setPreferences(Preferences preferences) {\n this.preferences = preferences;\n }",
"public void savePreferences(SharedPreferences preferences){\r\n\t\tSharedPreferences.Editor editor = preferences.edit();\r\n editor.putBoolean(\"initialSetupped\", initialSetuped);\r\n editor.putString(\"username\", userName);\r\n editor.putString(\"useremail\", userEmail);\r\n editor.putString(\"recipientemail\", recipientEmail);\r\n editor.putBoolean(\"option\", option.isPound());\r\n\r\n // Commit the edits!\r\n editor.commit();\r\n\t}",
"private void 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 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 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 }",
"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 }",
"void updatePreferences(List<IPreference> prefs);",
"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 }",
"public interface MlPreference {\r\n\r\n public void storePreferences();\r\n\r\n}",
"public Object createPrefsEditor()\n \t{\n \t\treturn this.createPrefsEditor(true, false);\n \t}",
"private void fetchPreferences() {\n macAddress = prefs.getString(getString(R.string.pref_mac), DEF_VALUE);\n macSet = prefs.getBoolean(getString(R.string.mac_set), false);\n //fetch previous values for temp, max, min\n tempMeasured = Double.parseDouble(prefs.getString(getString(R.string.text_temp), \"0\"));\n tempMax = Double.parseDouble(prefs.getString(getString(R.string.text_max), \"0\"));\n tempMin = Double.parseDouble(prefs.getString(getString(R.string.text_min), \"0\"));\n }",
"private PrefUtils() {\n }",
"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}",
"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 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 }",
"private void getPreferences() {\n\n if(sharedpreferences.getBoolean(\"usaGPU\", true)) {\n mUtilizzoGPU.setChecked(true);\n }\n else{\n mUtilizzoGPU.setChecked(false);\n }\n\n }",
"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 }",
"private void setupSimplePreferencesScreen() {\n if (!isSimplePreferences(this)) {\n return;\n }\n\n // In the simplified UI, fragments are not used at all and we instead\n // use the older PreferenceActivity APIs.\n\n // Add 'general' preferences.\n addPreferencesFromResource(R.xml.pref_general);\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(\"pref_favColor\"));\n }",
"private void setupSharedPreferences() {\n\n this.colorLine = new Vector3(255,255,0);\n this.colorOrigin= new Vector3(255,255,255);\n this.colorElement= new Vector3(255,255,255);\n this.colorMark= new Vector3(0,0,255);\n this.labelsSize = 5120; //5cm in dp\n this.unitsPref = 1000.f;\n this.autoFocus = true;\n this.quaternionAngles = false;\n this.unitString=getString(R.string.pref_units_mm_value);\n this.externalImage = false;\n this.widthImage = 50.f;\n this.scaleMarker = new Vector3(0.01f, 0.01f, 0.01f);\n this.moveCenter = new Vector3(0,0.0f,0.05f);\n this.alphaColor = 1.0f;\n this.sizeLine = .001f;\n this.sizeSphere = 0.001f;\n\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\n this.autoFocus = prefs.getBoolean(getString(R.string.pref_focus_key),true);\n this.quaternionAngles = prefs.getBoolean(getString(R.string.pref_quaternion_key),false);\n\n String valueTemp= prefs.getString(getString(R.string.pref_measure_units_key),getString(R.string.pref_units_mm_value));\n this.unitString=valueTemp;\n\n if(valueTemp.equals(getString(R.string.pref_units_mm_value)))\n {\n this.unitsPref = 1000.f;\n\n }\n else if(valueTemp.equals(getString(R.string.pref_units_cm_value)))\n {\n this.unitsPref = 100.f;\n\n }\n else if(valueTemp.equals(getString(R.string.pref_units_meter_value)))\n {\n this.unitsPref = 1.f;\n\n }\n\n\n\n valueTemp= prefs.getString(getString(R.string.pref_color_line_key),getString(R.string.pref_color_yellow_value));\n if(valueTemp.equals(getString(R.string.pref_color_red_value)))\n {\n this.colorLine = new Vector3(255, 0, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_blue_value)))\n {\n this.colorLine = new Vector3(0, 0, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_green_value)))\n {\n this.colorLine = new Vector3(0, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_yellow_value)))\n {\n this.colorLine = new Vector3(255, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_white_value)))\n {\n this.colorLine = new Vector3(255, 255, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_black_value)))\n {\n this.colorLine = new Vector3(0, 0, 0);\n\n }\n\n valueTemp= prefs.getString(getString(R.string.pref_color_origin_key),getString(R.string.pref_color_white_value));\n if(valueTemp.equals(getString(R.string.pref_color_red_value)))\n {\n this.colorOrigin = new Vector3(255, 0, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_blue_value)))\n {\n this.colorOrigin = new Vector3(0, 0, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_green_value)))\n {\n this.colorOrigin = new Vector3(0, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_yellow_value)))\n {\n this.colorOrigin = new Vector3(255, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_white_value)))\n {\n this.colorOrigin = new Vector3(255, 255, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_black_value)))\n {\n this.colorOrigin = new Vector3(0, 0, 0);\n\n }\n\n valueTemp= prefs.getString(getString(R.string.pref_color_element_key),getString(R.string.pref_color_white_value));\n if(valueTemp.equals(getString(R.string.pref_color_red_value)))\n {\n this.colorElement = new Vector3(255, 0, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_blue_value)))\n {\n this.colorElement = new Vector3(0, 0, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_green_value)))\n {\n this.colorElement = new Vector3(0, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_yellow_value)))\n {\n this.colorElement = new Vector3(255, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_white_value)))\n {\n this.colorElement = new Vector3(255, 255, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_black_value)))\n {\n this.colorElement = new Vector3(0, 0, 0);\n\n }\n\n\n valueTemp= prefs.getString(getString(R.string.pref_color_mark_sphere_key),getString(R.string.pref_color_blue_value));\n\n if(valueTemp.equals(getString(R.string.pref_color_red_value)))\n {\n this.colorMark = new Vector3(255, 0, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_blue_value)))\n {\n this.colorMark = new Vector3(0, 0, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_green_value)))\n {\n this.colorMark = new Vector3(0, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_yellow_value)))\n {\n this.colorMark = new Vector3(255, 255, 0);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_white_value)))\n {\n this.colorMark = new Vector3(255, 255, 255);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_color_black_value)))\n {\n this.colorMark = new Vector3(0, 0, 0);\n\n }\n\n\n\n valueTemp= prefs.getString(getString(R.string.pref_labels_size_key),getString(R.string.pref_size_label_five_value));\n if(valueTemp.equals(getString(R.string.pref_size_label_two_value)))\n {\n this.labelsSize = 10240; //2.5cm\n\n }\n else if(valueTemp.equals(getString(R.string.pref_size_label_five_value)))\n {\n this.labelsSize = 5120; //5 cm\n\n }\n else if(valueTemp.equals(getString(R.string.pref_size_label_ten_value)))\n {\n this.labelsSize = 2560; //10cm\n\n }\n\n valueTemp= prefs.getString(getString(R.string.pref_ref_marker_size_key),getString(R.string.pref_ref_marker_one_value));\n\n if(valueTemp.equals(getString(R.string.pref_ref_marker_one_value)))\n {\n this.scaleMarker = new Vector3(.01f, .01f, 0.01f);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_ref_marker_half_value)))\n {\n this.scaleMarker = new Vector3(.02f, .02f, 0.02f);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_ref_marker_normal_value)))\n {\n this.scaleMarker = new Vector3(.05f, .05f, 0.05f);\n\n }\n\n\n\n valueTemp= prefs.getString(getString(R.string.pref_move_center_key),getString(R.string.pref_move_center_half_value));\n\n if(valueTemp.equals(getString(R.string.pref_move_center_zero_value)))\n {\n this.moveCenter = new Vector3(0.0f, 0.0f, 0.0f);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_move_center_half_value)))\n {\n this.moveCenter = new Vector3(0.0f, 0.0f, 0.05f);\n\n }\n else if(valueTemp.equals(getString(R.string.pref_move_center_one_value)))\n {\n this.moveCenter = new Vector3(0.0f, 0.0f, 0.1f);\n\n }\n\n\n valueTemp= prefs.getString(getString(R.string.pref_sphere_size_key),getString(R.string.pref_ref_marker_one_value));\n\n if(valueTemp.equals(getString(R.string.pref_ref_marker_one_value)))\n {\n this.sizeSphere = 0.001f;\n }\n else if(valueTemp.equals(getString(R.string.pref_ref_marker_half_value)))\n {\n this.sizeSphere = 0.005f;\n\n }\n else if(valueTemp.equals(getString(R.string.pref_ref_marker_normal_value)))\n {\n this.sizeSphere = 0.01f;\n\n }\n\n\n valueTemp= prefs.getString(getString(R.string.pref_line_size_key),getString(R.string.pref_ref_marker_one_value));\n\n if(valueTemp.equals(getString(R.string.pref_ref_marker_one_value)))\n {\n this.sizeLine = 0.001f;\n }\n else if(valueTemp.equals(getString(R.string.pref_ref_marker_half_value)))\n {\n this.sizeLine = 0.005f;\n\n }\n else if(valueTemp.equals(getString(R.string.pref_ref_marker_normal_value)))\n {\n this.sizeLine = 0.01f;\n\n }\n\n\n this.externalImage = prefs.getBoolean(getString(R.string.pref_external_image_key),false);\n\n this.pathImageOne = prefs.getString(getString(R.string.pref_external_path_one_key),\"\");\n\n this.pathImageTwo = prefs.getString(getString(R.string.pref_external_path_two_key),\"\");\n\n this.widthImage = Float.parseFloat(prefs.getString(getString(R.string.pref_size_key),getString(R.string.pref_size_default))) / 1000.f;\n\n this.alphaColor = Float.parseFloat(prefs.getString(getString(R.string.pref_alpha_key),getString(R.string.pref_alpha_default))) / 100.f;\n\n }",
"private LODEParameters(){\n prefsFile=new File(LODEConstants.PARAMS_FILE);\n }",
"void savePreferences() throws OntimizeJEERuntimeException;",
"private Settings() {\n prefs = NbPreferences.forModule( Settings.class );\n }",
"private void currentStateRestoreFromSharedPref() {\n sharedPreferences = getPreferences(MODE_PRIVATE);\n int key1DeffaultValue = -1;\n key1OfActiveChallenge = sharedPreferences.getInt(\"key1OfActiveChallenge\", key1DeffaultValue);\n nameOfCurrentChallenge = sharedPreferences.getString(\"nameOfActiveChallenge\", nameOfCurrentChallenge);\n\n dateOfLastEdit = sharedPreferences.getString(\"dateOfLastEdit\", dateOfLastEdit);\n\n goal = sharedPreferences.getFloat(\"goal\", goal);\n carry = sharedPreferences.getFloat(\"carry\", carry);\n\n challengeDaysRunning = sharedPreferences.getInt(\"challengeDaysRunning\", challengeDaysRunning);\n }",
"private PreferencesModule() {\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 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 }",
"@Override\n public void saveToPreferencesAdditional(PortletPreferences pp) {\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 getSharedPrefs() {\n return Freelancer.getContext().getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);\n }",
"public SPHandler(Context context){\n this.context = context;\n sharedPref = context.getSharedPreferences(\n prefName, Context.MODE_PRIVATE);\n\n }",
"private void savePreferences() {\n SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(\" \", \"\");\n\n SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0);\n SharedPreferences.Editor editer = sharedPref.edit();\n editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr);\n editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr);\n editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr);\n editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr);\n\n // The commit runs faster.\n editer.apply();\n\n // Run this every time we're building a query.\n SharedPrefStatic.buildUriQuery();\n SharedPrefStatic.mEditIntentSaved = true;\n }",
"public interface PrefsKey {\n\n String Ssid = \"Ssid\";\n String HotKeys = \"HotKeys\";\n String HistoryKeys = \"HistoryKeys\";\n String HistoryCooking = \"HistoryCooking\";\n\n String Guided = \"Guided\";\n}",
"@Override\r\n \tpublic void onCreate() {\r\n \t\tsuper.onCreate();\r\n \t\t// keep a copy of resources for later use in application\r\n \t\tres = getResources();\r\n \t\t// read preferences\r\n \t\treadPreferences();\r\n \t}",
"private void loadPreferences() {\n\t\tXSharedPreferences prefApps = new XSharedPreferences(PACKAGE_NAME);\n\t\tprefApps.makeWorldReadable();\n\n\t\tthis.debugMode = prefApps.getBoolean(\"waze_audio_emphasis_debug\", false);\n }",
"public XmlParserPref(Context cont, String name) {\n\t\tcontext = cont;\n\t\tprefEdit = PreferenceManager.getDefaultSharedPreferences(context).edit();\n\t\tprofileName = name;\n\t}",
"@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.preferences);\n }",
"public void save () {\n preference.putBoolean(\"sound effect\", hasSoundOn);\n preference.putBoolean(\"background music\", hasMusicOn);\n preference.putFloat(\"sound volume\", soundVolume);\n preference.putFloat(\"music volume\", musicVolume);\n preference.flush(); //this is called to write the changed data into the file\n }",
"public void 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 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 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\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 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 }",
"@SuppressLint(\"CommitPrefEdits\")\n public HaloPreferencesStorageEditor(SharedPreferences preferences) {\n mPreferencesEditor = preferences.edit();\n }",
"ProfessorPreference(ClassInfo[] p){\n\t\tthis.preferences = p;\n\t}",
"private final class <init>\n implements <init>, com.ebay.nautilus.domain.dcs.tionHelper\n{\n\n private SharedPreferences listingDraftPrefs;\n private SharedPreferences prefs;\n final MyApp this$0;\n\n public void disableDeveloperOptions()\n {\n MyApp.getPrefs().removeGlobalPref(\"developerOptions\");\n }",
"public static TinkerPrefs getInstance() {\n\t\treturn instance;\n\t}"
] | [
"0.6773953",
"0.6682362",
"0.653805",
"0.6450078",
"0.6450078",
"0.6450078",
"0.6450078",
"0.6442011",
"0.6440156",
"0.6407665",
"0.6374938",
"0.6364127",
"0.63118935",
"0.62254256",
"0.62092805",
"0.61672926",
"0.61577004",
"0.61533004",
"0.6152302",
"0.61442715",
"0.6130067",
"0.6077517",
"0.60402256",
"0.6037962",
"0.60337454",
"0.6020296",
"0.60165614",
"0.60162383",
"0.60006607",
"0.6000254",
"0.5980394",
"0.5969737",
"0.5966426",
"0.59484106",
"0.59466815",
"0.59394604",
"0.5915679",
"0.5905961",
"0.58371353",
"0.58358705",
"0.5835165",
"0.5833506",
"0.58305615",
"0.5826733",
"0.5808934",
"0.5803826",
"0.5798795",
"0.5798018",
"0.5793989",
"0.5781174",
"0.57706314",
"0.5767577",
"0.57542866",
"0.57513255",
"0.573952",
"0.5724807",
"0.57222605",
"0.57205033",
"0.57136893",
"0.5703437",
"0.56979054",
"0.56856406",
"0.5683204",
"0.5678038",
"0.5676956",
"0.56714684",
"0.56568635",
"0.56567454",
"0.56537753",
"0.56405574",
"0.564046",
"0.5633714",
"0.56298923",
"0.56151336",
"0.56137884",
"0.5595079",
"0.5563484",
"0.5562822",
"0.55558133",
"0.55549",
"0.5553456",
"0.5553221",
"0.55469185",
"0.5545611",
"0.5545077",
"0.5541469",
"0.5531821",
"0.55248284",
"0.5523459",
"0.5514239",
"0.5514222",
"0.5513351",
"0.5504824",
"0.5504408",
"0.55014867",
"0.5495783",
"0.5495194",
"0.54933727",
"0.5489109",
"0.548753",
"0.54858303"
] | 0.0 | -1 |
return super.onCreateView(inflater, container, savedInstanceState); | @Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_forgot_password_verification, container, false);
extractArguments();
initViews(view);
setWizRocket();
return view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return super.onCreateView(inflater, container, savedInstanceState);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return super.onCreateView(inflater, container, savedInstanceState);\n }",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\treturn super.onCreateView(inflater, container, savedInstanceState);\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return super.onCreateView(inflater, container, savedInstanceState);\n }",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn super.onCreateView(inflater, container, savedInstanceState);\n\t}",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn super.onCreateView(inflater, container, savedInstanceState);\n\t}",
"@Override\n\tpublic View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {\n\t\treturn super.onCreateView(inflater, container, savedInstanceState);\n\t}",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n \tthis.setRetainInstance(true);\n \treturn super.onCreateView(inflater, container, savedInstanceState);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n \n return this.view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = getThisView(inflater,container);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }",
"@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n\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 void onViewCreated(View view, Bundle savedInstanceState) {\n }",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onCreateView---------\");\n\t\tview = inflater.inflate(getContentViewId(),container,false);\n\t\tunbinder = ButterKnife.bind(this,view);\n\t\tinitView(savedInstanceState);\n\t\treturn view;\n\t}",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n\n\n view = inflater.inflate(LAYOUT, container, false);\n return view;\n }",
"@Override\n public void onViewCreated(View view , Bundle savedInstanceState) {\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\treturn inflater.inflate(R.layout.activity_main, container, false);\n }",
"@Override\n public void onViewCreate() {\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_main4, container, false);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_add_meals, container, false);\n return view;\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.activity_adddatacat, container, false);\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_sesion3, container, false);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return initUiComponents(inflater, container);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.layoutview3, container, false);\n }",
"public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {\n return null;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_conta, container, false);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return super.onCreateView(inflater, (ViewGroup) inflater.inflate(R.layout.fragment_display_good_detial, container, false), savedInstanceState);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }",
"@Override\n public View onCreateView(\n LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState\n ) {\n return inflater.inflate(R.layout.select_game, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n root = inflater.inflate(R.layout.activity_show3, container, false);\n return root;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }",
"@Override\n public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n }",
"@Override\r\n\tprotected void initViews(Bundle savedInstanceState) {\n\t\t\r\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n Log.d(TAG, \"onCreateView\");\n return inflater.inflate(R.layout.fragment_crime, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n mLayoutInflater = inflater;\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n Log.d(LOG, \"Inflating...\");\n return inflater.inflate(R.layout.fragment_milk_adder, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n mView = inflater.inflate(R.layout.fragment_list_book, container, false);\n initViews();\n if(BuildConfig.enableDebugLogging) {\n Log.i(TAG, \"onCreateView\");\n }\n return mView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder=ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n\r\n View v = inflater.inflate(R.layout.fragment_donor_dash, container, false);\r\n\r\n\r\n\r\n return v;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n activity = (InitializeDineOrderActivity) getActivity();\n View view = inflater.inflate(R.layout.fragment_items_added_success, container, false);\n unbinder = ButterKnife.bind(this, view);\n //animate(imageView);\n return view;\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_coat_of_arms, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\r\n\t\tView view = inflater.inflate(R.layout.frag_main_pak, container, false);\r\n\r\n\t\tinit(view);\r\n\t\t\r\n\t\t\r\n\t\treturn view;\r\n\r\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n parent_view = inflater.inflate(R.layout.fragment_medals, container, false);\n initComponent(parent_view);\n\n return parent_view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.folio_activity, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fg_movie, null);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n return inflater.inflate(R.layout.frag_new_entries, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.activity_post_property_screen, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n if (view == null) {\n view = inflater.inflate(R.layout.fragment_bao_yang_scx, container, false);\n unbinder = ButterKnife.bind(this, view);\n init();\n }\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n ButterKnife.inject(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n ButterKnife.inject(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n ButterKnife.inject(this, rootView);\n return rootView;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n Fabric.with(getContext(), new Crashlytics());\r\n View view = inflater.inflate(R.layout.fragment_open_ticket_general_enquiries_department, container, false);\r\n unbinder = ButterKnife.bind(this, view);\r\n\r\n\r\n intialize();\r\n return view;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }",
"@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\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 return inflater.inflate(R.layout.fragment_intro_ds, container, false);\n\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container , savedInstanceState);\n View rootView = inflater.inflate(R.layout.fragment_info_, container, false);\n //return inflater.inflate(R.layout.fragment_info_, container, false);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\r\n unbinder = ButterKnife.bind(this, rootView);\r\n return rootView;\r\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\r\n unbinder = ButterKnife.bind(this, rootView);\r\n return rootView;\r\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\r\n unbinder = ButterKnife.bind(this, rootView);\r\n return rootView;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.main_fragment, container, false);\n\n\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view= inflater.inflate(R.layout.fragment_votevents, container, false);\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n view = inflater.inflate(R.layout.layout_inventory_list, container, false);\n\n return view;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_vicky, container, false);\r\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\r\n ButterKnife.bind(this, rootView);\r\n return rootView;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, final ViewGroup container,\n Bundle savedInstanceState) {\n\n\n return inflater.inflate(R.layout.fragment_splash, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.frag__tanding, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n View view= inflater.inflate(R.layout.fragment_insect, container, false);\n\n return view;\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder2 = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder2 = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n View view = inflater.inflate(R.layout.fragment_guan_lxswei_shen, container, false);\n ButterKnife.bind(this, view);\n init();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_eatery_detail, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder1 = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder1 = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = super.onCreateView(inflater, container, savedInstanceState);\n unbinder = ButterKnife.bind(this, rootView);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_outfits, container, false);\n }"
] | [
"0.8520886",
"0.8520886",
"0.8470085",
"0.84399784",
"0.8238763",
"0.8238763",
"0.82017916",
"0.8171367",
"0.8142269",
"0.8109519",
"0.80197686",
"0.79594636",
"0.793347",
"0.7910684",
"0.79052544",
"0.790123",
"0.78920996",
"0.7887842",
"0.7887525",
"0.7875352",
"0.7838532",
"0.7825342",
"0.7803424",
"0.7797102",
"0.77890486",
"0.77691555",
"0.7766806",
"0.77636427",
"0.77587414",
"0.7755472",
"0.7753194",
"0.7748234",
"0.77404845",
"0.77359843",
"0.77214605",
"0.7719199",
"0.7718605",
"0.77163124",
"0.77137285",
"0.7710186",
"0.77069515",
"0.76939297",
"0.76775676",
"0.7676584",
"0.7670277",
"0.7666009",
"0.7660692",
"0.76560056",
"0.76548433",
"0.76518583",
"0.76460373",
"0.7645312",
"0.76427937",
"0.7642745",
"0.76412344",
"0.76412344",
"0.76412344",
"0.76379216",
"0.7637584",
"0.76357454",
"0.76290584",
"0.762845",
"0.7625059",
"0.76248693",
"0.7617058",
"0.7617058",
"0.7617058",
"0.76133674",
"0.76118815",
"0.7610198",
"0.76009387",
"0.7600024",
"0.75975335",
"0.75965506",
"0.7589037",
"0.75877833",
"0.7587697",
"0.7587697",
"0.7586397",
"0.75845367",
"0.75831074",
"0.75831074",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.7572699",
"0.75682694"
] | 0.0 | -1 |
Api call for login with username and password | private void verifyCode() {
com.explara_core.login.LoginScreenManager.getInstance().verifyCode(getActivity().getApplicationContext(), mCode, mEmail, new com.explara_core.login.LoginScreenManager.VerifyCodeListener() {
@Override
public void onCodeVerified(com.explara_core.login.login_dto.LoginResponseDto loginResponse) {
if (getActivity() != null && loginResponse != null) {
if (loginResponse.status.equals(Constants.STATUS_ERROR)) {
//Constants.createToastWithMessage(this, response.getMessage());
mMaterialProgressDialog.dismiss();
AppUtility.createSnackWithMessage(getActivity().findViewById(R.id.forgot_verification_activity_relative_layout), loginResponse.message);
} else {
mMaterialProgressDialog.dismiss();
mMaterialAlertDialog = new MaterialDialog.Builder(getActivity())
.title("Alert")
.content(loginResponse.message)
.positiveText("Ok")
.positiveColor(Color.RED)
.negativeColor(Color.GRAY)
.callback(new MaterialDialog.ButtonCallback() {
@Override
public void onPositive(MaterialDialog dialog) {
super.onPositive(dialog);
// navigate to login screen
navigateToResetPage();
}
@Override
public void onNegative(MaterialDialog dialog) {
super.onNegative(dialog);
}
})
.show();
}
}
}
@Override
public void onCodeVerifyFailed() {
if (getActivity() != null) {
mMaterialProgressDialog.dismiss();
Toast.makeText(getActivity(), "Oops! Could not verify the code.", Toast.LENGTH_SHORT).show();
}
}
}, TAG);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GET(\"/login\")\n Call<LoginResponse> loginRequest(@Path(\"username\") String username\n , @Path(\"password\") String password);",
"RequestResult loginRequest() throws Exception;",
"private void login(String username,String password){\n\n }",
"@GetMapping(\"/user\")\n public User login(@RequestParam String username, @RequestParam String password) { return userDataTierConnection.login(username,password); }",
"protected Response login() {\n return login(\"\");\n }",
"void login(String user, String password);",
"public void login(String username, String password) {\n User user = new User(username, password);\r\n String paramBodyJsonStr = new Gson().toJson(user);\r\n Logger.d(\"paramBodyJsonStr=\" + paramBodyJsonStr);\r\n // handle login\r\n AndroidNetworking.post()\r\n .setContentType(\"application/json; charset=utf-8\")\r\n .setTag(this)\r\n .setUrl(Constants.URL_LOGIN)\r\n .build()\r\n .setApplicationJsonString(paramBodyJsonStr)\r\n .setAnalyticsListener(analyticsListener)\r\n .getAsJSONObject(new JSONObjectRequestListener() {\r\n @Override\r\n public void onResponse(JSONObject result) {\r\n Logger.d(\"response result=\" + result.toString());\r\n Result<LoggedInUser> defultResult = loginRepository.getDataSource().login(username, password);\r\n LoggedInUser data = ((Result.Success<LoggedInUser>) defultResult).getData();\r\n loginResult.setValue(new LoginResult(new LoggedInUserView(data.getDisplayName())));\r\n }\r\n\r\n @Override\r\n public void onError(ANError anError) {\r\n loginResult.setValue(new LoginResult(new Result.Error(anError)));\r\n Logger.d(\"anError=\" + anError.toString());\r\n if (!TextUtils.isEmpty(anError.getErrorDetail())) {\r\n Logger.d(\"getMessage=\" + anError.getMessage() + \" getErrorDetail=\" + anError.getErrorDetail());\r\n }\r\n }\r\n });\r\n\r\n }",
"public String signIn(String username, String password);",
"@POST\n\t@Path(\"/LoginService\")\n\tpublic String loginService(@FormParam(\"uname\") String uname,\n\t\t\t@FormParam(\"password\") String pass) \n\t{\n\t\tJSONObject object = new JSONObject();\n\t\tUserEntity user = UserEntity.getUser(uname, pass);\n\t\tif (user == null) {\n\t\t\tobject.put(\"Status\", \"Failed\");\n\t\t} else {\n\t\t\tUserEntity.currentUser = user;\n\t\t\tobject.put(\"Status\", \"OK\");\n\t\t\tobject.put(\"name\", user.getName());\n\t\t\tobject.put(\"email\", user.getEmail());\n\t\t\tobject.put(\"password\", user.getPass());\n\t\t}\n\n\t\treturn object.toString();\n\n\t}",
"@POST(\"login\")\n Call<User> login();",
"User login(String username, String password);",
"private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }",
"@FormUrlEncoded\n @POST(\"login.php\")\n Call<LoginResponse> loginRequest(@Field(\"username\") String username,\n @Field(\"password\") String password);",
"LoginContext login(String username, String password) throws LoginException;",
"@POST\n\t@Path(\"/LoginService\")\n\tpublic String loginService(@FormParam(\"uname\") String uname,\n\t\t\t@FormParam(\"password\") String pass) {\n\t\tJSONObject object = new JSONObject();\n\t\tUserEntity user = UserEntity.getUser(uname, pass);\n\t\tif (user == null) {\n\t\t\tobject.put(\"Status\", \"Failed\");\n\n\t\t} else {\n\t\t\tobject.put(\"Status\", \"OK\");\n\t\t\tobject.put(\"name\", user.getName());\n\t\t\tobject.put(\"email\", user.getEmail());\n\t\t\tobject.put(\"password\", user.getPass());\n\t\t}\n\n\t\treturn object.toString();\n\n\t}",
"@PostMapping(\"/login\")\n public ResponseEntity<Object> login( @RequestParam(\"username\") String username, @RequestParam(\"password\") String password) { \n \tif(!username.isEmpty() && !password.isEmpty()) {\n \t\tString token = authenticationService.login(username, password);\n \t\tif(!token.isEmpty()) {\n \t\t\treturn new ResponseEntity<>(token,HttpStatus.OK);\n \t\t}else {\n \t\t\treturn new ResponseEntity<>(\"Credenziali errate!\",HttpStatus.UNAUTHORIZED); \t\t\t\n \t\t}\n \t}else {\n \t\treturn new ResponseEntity<>(\"Dati mancanti\",HttpStatus.BAD_REQUEST);\n \t}\n }",
"@WebMethod public boolean logIn(String userName, String password);",
"public void login() {\n try {\n callApi(\"GET\", \"account/session\", null, null, true);\n } catch (RuntimeException re) {\n\n }\n\n Map<String, Object> payload = new HashMap<>();\n payload.put(\"name\", \"admin\");\n payload.put(\"password\", apiAdminPassword);\n payload.put(\"remember\", 1);\n\n callApi(\"POST\", \"account/signin\", null, payload, true);\n }",
"Document login(String username, String password);",
"private void sendLogin(String username, String password) {\n LoginService loginService = NetContext.instance.createLoginService();\n // data & format\n // format => MediaType\n // data => json\n MediaType jsonMediaType = MediaType.parse(\"application/json\");\n String loginJson = (new Gson()).toJson(new LoginBodyJson(username, password));\n\n RequestBody loginBody = RequestBody.create(jsonMediaType, loginJson);\n\n //3: Create Call\n Call<LoginResponseJson> loginCall = loginService.login(loginBody);\n\n loginCall.enqueue(new Callback<LoginResponseJson>() {\n @Override\n public void onResponse(Call<LoginResponseJson> call, Response<LoginResponseJson> response) {\n LoginResponseJson loginResponseJson = response.body();\n if (loginResponseJson == null) {\n Log.d(TAG, \"onResponse: Could not parse body\");\n etUsername.setError(\"Tên đăng nhập hoặc mật khẩu sai\");\n } else {\n Log.d(TAG, String.format(\"onResponse, oh yeah: %s\", loginResponseJson));\n if (response.code() == 200) {\n token = loginResponseJson.getAccessToken();\n\n onLoginSuccess();\n }\n }\n }\n\n @Override\n public void onFailure(Call<LoginResponseJson> call, Throwable t) {\n Log.d(TAG, String.format(\"onFailure: %s\", t));\n Toast.makeText(LoginActivity.this,\"Mất kết nối\",Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n }\n });\n }",
"public Person login(String username, String password);",
"@GetMapping(\"/api/v1/login\")\n public String login() {\n return \"Success\";\n }",
"User signIn(String login, String password);",
"String signIn(String userName, String password) throws UserNotFoundException;",
"public interface LoginService {\n @POST(\"user/login\")\n @FormUrlEncoded\n Call<LoginBean> login(@Field(\"username\") String username, @Field(\"password\") String password);\n\n}",
"@GET\n Call<String> getLogin(@Url String URL);",
"@Override\n public JsonResponse duringAuthentication(String... params) {\n try {\n final String username = params[0];\n final String password = params[1];\n return RequestHandler.authenticate(this.getApplicationContext(), username, password);\n } catch (IOException e) {\n return null;\n }\n }",
"public String login(String username, String password){\n return login.login(username, password);\n }",
"void login(String email, String password) throws InvalidCredentialsException, IOException;",
"@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/login\",method= RequestMethod.POST)\n @ResponseBody\n public LoginResVO loginHomeconnect(@ApiParam(value = \"account login\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n\t\t\t\t\t@RequestHeader HttpHeaders httpHeaders,\n\t\t\t\t\t@RequestBody(required = false) LoginReqVO body,HttpServletResponse response){\n\tString url = \"/api/translator/user/login\";\n\tLoginResVO result = new LoginResVO(RetObject.fail());\n\tMap<String,String> headerMap = new HashedMap();\n\theaderMap.put(\"PlatID\", platID);\n\theaderMap.put(\"AppID\", appID);\n\tString headers = getJSONString(headerMap);\n\tString bodyText = getJSONString(body);\n\tError headerError = validateHeaders(platID,appID);\n\tError bodyError = validateLoginBodyError(body);\n\tif ( bodyError == null && headerError == null){\n\t\tresponse.addHeader(\"AccessToken\",\"12345678\");\n\t\tresult = new LoginResVO();\n\t}\n\treturn result;\n}",
"Login.Req getLoginReq();",
"public void authenticate(LoginRequest loginRequest) {\n\n }",
"public User doAuthentication(String account, String password);",
"UserToken login(String username, String password) throws WorkspaceException;",
"@GET(\"users/signin\")\r\n Call<User> signIn(@Header(\"Authorization\") String token);",
"public void login(String username, String password) {\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httppost = new HttpPost(\n \"https://epitech-tiekeo.c9.io/login/check-mobile\");\n\n try {\n // Add your data\n List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();\n nameValuePairs.add(new BasicNameValuePair(\"username\",\n username));\n nameValuePairs.add(new BasicNameValuePair(\"password\",\n password));\n httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n HttpEntity entity = response.getEntity();\n InputStream is = entity.getContent();\n String resp = convertStreamToString(is);\n System.out.println(\"tssttt \"+resp);\n\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n } catch (IOException e) {\n // TODO Auto-generated catch block\n }\n }",
"@POST\r\n\t@Path(\"/login/\")\r\n\tpublic User login(@RequestBody User user);",
"private void loginUser() throws JSONException, UnsupportedEncodingException {\n JSONObject jsonObject = new JSONObject();\n jsonObject.put(\"username\", editUserName.getText().toString());\n jsonObject.put(\"password\", editPassword.getText().toString());\n jsonObject.put(\"DeviceID\", diviceToken);\n jsonObject.put(\"DevicePlatform\", devicePlatform);\n invokeLogin(jsonObject);\n\n\n }",
"@PostMapping(value = \"/login\", headers = {\"content-type=application/x-www-form-urlencoded\"})\n\tpublic ResponseEntity<UserDTO> login(WebRequest request){\n\t\t\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\t\n\t\tUser user = userService.findByUsername(username);\n\t\tif(user == null) {\n\t\t\t//ovo glumi token i ide u session local storage\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.NOT_FOUND);\n\t\t}else if(user.getPassword().equals(password)) {\n\t\t\treturn new ResponseEntity<UserDTO>(new UserDTO(user), HttpStatus.OK);\n\t\t}else {\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.UNAUTHORIZED);\n\t\t}\n\t\t\n\t\t\n\t}",
"public abstract void login(String userName, String password) throws RemoteException;",
"protected Response login(String environment) {\n environment = Strings.isNullOrEmpty(environment) ? \"\"\n : \"/\" + environment;\n JsonObject creds = new JsonObject();\n creds.addProperty(\"username\", \"admin\");\n creds.addProperty(\"password\", \"admin\");\n Response resp = post(environment + \"/login\", creds.toString());\n return resp;\n }",
"public String loginUser(Credentials credentials) throws Exception {\n\n\t\tString url = server_url + \"/user/login\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\n\t\t//String urlParameters = \"username=\" + credentials.username + \"&password=\" + credentials.password;\n\t\tJsonObject urlParameters = new JsonObject();\n\t\turlParameters.addProperty(\"username\", credentials.username);\n\t\turlParameters.addProperty(\"password\", credentials.password);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(urlParameters.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t\n\t\tif (responseCode != 200) {\n\t\t\treturn \"Failure\";\n\t\t}\n\t\t////System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t////System.out.println(\"Post parameters : \" + urlParameters);\n\t\t////System.out.println(\"Response Code : \" + responseCode);\n\t\t\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\t\n\t\t//When we log in the server gives us a cookie that keeps the user identity\n\t\tusercookie = con.getHeaderField(\"set-cookie\");\n\t\tusercookie = usercookie.substring(0, usercookie.length() - 8);\n\n//\t\t@SuppressWarnings(\"deprecation\")\n//\t\tString decodedUserCookie = URLDecoder.decode(usercookie.substring(11));\n//\t\t\n//\t\tJsonParser jsonParser = new JsonParser();\n//\t\tJsonObject element = jsonParser.parse(decodedUserCookie).getAsJsonObject();\n\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\treturn response.toString();\n\t}",
"public Single<LoginResponse> requestLogin(Map<String, String> params) {\n return supportAppService.login(params);\n }",
"User login(String email, String password) throws AuthenticationException;",
"public void userNormalLogin(String username, String password, FutureCallback<Response<JsonObject>> callback)\n\t{\n\t}",
"@Override\n public Auth call() throws IOException {\n OkHttpClient client = new OkHttpClient();\n client.setFollowRedirects(false);\n client.setFollowSslRedirects(false);\n\n Request initRequest = new Request.Builder()\n .url(\"https://lobste.rs/login\")\n .build();\n\n Response initResponse = client.newCall(initRequest).execute();\n String initCookie = initResponse.header(\"Set-Cookie\").split(\";\")[0];\n String initBody = initResponse.body().string();\n String authenticity_token = Jsoup.parse(initBody).body().select(\"[name=authenticity_token]\").val();\n\n // Phase 2 is to authenticate given the cookie and authentication token\n RequestBody loginBody = new FormEncodingBuilder()\n .add(\"utf8\", \"\\u2713\")\n .add(\"authenticity_token\", authenticity_token)\n .add(\"email\", login)\n .add(\"password\", password)\n .add(\"commit\", \"Login\")\n .add(\"referer\", \"https://lobste.rs/\")\n .build();\n Request loginRequest = new Request.Builder()\n .url(\"https://lobste.rs/login\")\n .header(\"Cookie\", initCookie) // We must use #header instead of #addHeader\n .post(loginBody)\n .build();\n\n Response loginResponse = client.newCall(loginRequest).execute();\n String loginCookie = loginResponse.header(\"Set-Cookie\").split(\";\")[0];\n\n // Phase 3 is to grab the actual username/email from the settings page\n Request detailsRequest = new Request.Builder()\n .url(\"https://lobste.rs/settings\")\n .header(\"Cookie\", loginCookie)\n .build();\n Response detailsResponse = client.newCall(detailsRequest).execute();\n String detailsHtml = detailsResponse.body().string();\n\n Document dom = Jsoup.parse(detailsHtml);\n String username = dom.select(\"#user_username\").val();\n String email = dom.select(\"#user_email\").val();\n\n // And then we return the result of all three phases\n return new Auth(email, username, loginCookie);\n }",
"@RequestMapping(value=\"/login/{username}/{password}\")\n @ResponseBody\n public boolean login(@PathVariable String username, @PathVariable String password){\n return customUserDetailsService.login(username, password);\n\n }",
"User loginUser(User userLoginRequest, HttpSession httpSession) throws Exception;",
"@FormUrlEncoded\n @POST(\"/linker/login\")\n Call<LoginResponse> login(@FieldMap Map<String, Object> parameters);",
"User authenticate(String username, String password);",
"public static String loginHelper(String userName, String password, TestRestTemplate restTemplate) throws Exception {\n String loginContent = ApplicationUserUtility.getLoginRequestAsJson(userName, password);\n String loginURL = BASE_URL + USERS_API + LOGIN_URL;\n URI uri = new URI(loginURL);\n\n ResponseEntity<Object> result = restTemplate.exchange(uri, HttpMethod.POST, WebUtility.getEntity(loginContent), Object.class);\n Object loginSuccessResponse = result.getBody();\n LinkedHashMap response = (LinkedHashMap) loginSuccessResponse;\n Gson gson = new Gson();\n String json = gson.toJson(response,LinkedHashMap.class);\n ObjectMapper objectMapper = new ObjectMapper();\n JWTLoginSuccessResponse loginResponse = objectMapper.readValue(json, JWTLoginSuccessResponse.class);\n\n assertNotNull(loginResponse.getToken());\n assertTrue(loginResponse.getSuccess());\n return loginResponse.getToken().substring(7);\n }",
"public void loginAsUser() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"user\");\n vinyardApp.fillPassord(\"123\");\n vinyardApp.clickSubmitButton();\n }",
"@Override\n public void doLogin(String userName, String password, final RequestResultListener requestResultListener) {\n\n initApiService();\n\n apiService.token(\"password\", userName, password).enqueue(new Callback<Response4Login>() {\n @Override\n public void onResponse(Call<Response4Login> call, Response<Response4Login> response) {\n if (response.isSuccessful()) {\n requestResultListener.onSuccess(response);\n } else {\n requestResultListener.onUnSuccess(response);\n }\n }\n\n @Override\n public void onFailure(Call<Response4Login> call, Throwable t) {\n requestResultListener.onFail();\n }\n });\n\n\n }",
"@GET\n @Path(\"/{userid}/{password}\")\n public Response logIn(@PathParam(\"userid\") String userid, @PathParam(\"password\") String password) throws ProfileDaoException {\n Optional<Profile> user = api.getProfile(userid);\n\n \n \n if(BCrypt.hashpw(password, user.get().getPassword()).equals(user.get().getPassword())){\n //create Session\n return Response\n .ok(loginApi.logIn(userid))\n .build();\n } else {\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n\n }",
"public AgentDTO login(String login, String senha);",
"String login(Integer userId);",
"public interface UserMgrService {\n\n @GET(\"login\")\n Call<UserInfoModel> login(@Query(\"username\") String username,@Query(\"pwd\") String pwd);\n\n\n}",
"public MutableLiveData<TokenResponse> login(String email, String password) {\n return repository.login(email, password);\n }",
"private ResponseEntity<TokenLoginResponse> requestLoginResponse() {\n LoginRequest userLogin = new LoginRequest();\n userLogin.setUsername(\"user\");\n userLogin.setPassword(\"password\");\n ResponseEntity<TokenLoginResponse> loginResponse = new TestRestTemplate().postForEntity(\"http://localhost:\" + port + \"/login/api\", userLogin, TokenLoginResponse.class);\n assertEquals(HttpStatus.OK, loginResponse.getStatusCode());\n return loginResponse;\n }",
"@PostMapping(Constants.URI_API_AUTH)\n\tpublic ResponseEntity<?> authenticateUser(@RequestParam(required=true) String username,\n\t\t\t\t\t\t\t\t\t\t\t @RequestParam(required=true) String password){\n\t\t\n\t\tLOG.debug(\"API Authenticate User: User '\" + username + \"'\");\n\t\t\n\t\tAuthenticationToken authToken = new AuthenticationToken(userService.authenticateUser(username, password));\n\t\t\n\t\treturn ResponseEntity.ok(authToken);\n\t}",
"@GetMapping(\"/authentication/{username}/{password}\")\n public ResponseEntity<AuthenticationDTO> login(@PathVariable(value = \"username\") String username,\n @PathVariable(value = \"password\") String password) {\n return new ResponseEntity<>(authenticationConvertor.convertToAuthenticationDTO(authenticationService.login(username,password)),\n HttpStatus.OK);\n }",
"private void sendToAPI(final View v, JSONObject jsonLogin){\n APIClient apiClient = new APIClient();\n Service apiService = apiClient.getClient().create(Service.class);\n Call<User> call = apiService.login(new Login(\"efef\",\"dfwd\"));\n call.enqueue(new Callback<User>() {\n @Override\n public void onResponse(Call<User> call, Response<User> response) {\n if (response.isSuccessful()) {\n new CustomToast().displyToast(getContext(), v, \"Error:\"+response.code()+\" \"+response.body().getMessage()+\n \"Token is: \"+response.body().getAccessToken());\n }\n else{\n new CustomToast().displyToast(getContext(), v, \"Error: \"+response.code()+\" \"+\n response.headers()+ \"...Incorrect username or password!\");\n }\n }\n\n @Override\n public void onFailure(Call<User> call, Throwable t) {\n new CustomToast().displyToast(getContext(), v, \"Server unreachable, Please retry again later\");\n }\n });\n\n }",
"@POST\n @Path(\"user/login\")\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n public void userLogIn(@FormParam(\"email\") String email, @FormParam(\"password\") String password){\n \n // set the userSession Variable here\n System.out.println(email);\n System.out.println(password);\n \n userSession = 1; // change to the id retrieved from the db search\n \n }",
"@RequestMapping(\"/login\")\n\tprivate ResponseEntity<String> login (@RequestParam int id, @RequestParam String password) throws JsonProcessingException {\n\t\t\n\t\tUsers user = u_service.loginUser(id, password);\n\t HttpHeaders responseHeaders = new HttpHeaders();\n\t \n\t if (user == null || !user.getPassword().equals(password)) {\n\t return new ResponseEntity<String>(\"No such userId/password combo\", \n\t responseHeaders, HttpStatus.UNAUTHORIZED);\n\t } else {\n\t responseHeaders.add(\"Content-Type\", \"application/json\");\n\t String json = convertToJson(user);\n\t return new ResponseEntity<String>(json, responseHeaders, HttpStatus.OK); \n\t }\t\t\n\t\t\n\t}",
"public User logInUser(final String login, final String password);",
"public static void signIn(String username, String password, final Context context, final OnLoginListener onLoginListener)\n {\n HttpClientHelper client = new HttpClientHelper(Endpoints.User.login, context);\n\n client.addParamForPost(\"api_type\", \"json\");\n client.addParamForPost(\"user\", username);\n client.addParamForPost(\"passwd\", password);\n client.addParamForPost(\"rem\", String.valueOf(true));\n\n Network.newRequest(client, Network.POST, Network.WITHOUT_COOKIE, new Delegate()\n {\n @Override\n public void requestResults(Network.Status status)\n {\n User user = null;\n boolean err = false;\n\n if(status.hasInternet)\n {\n if(status.response.getStatusLine().getStatusCode() == 200\n || status.response.getStatusLine().getStatusCode() == 409)\n {\n try\n {\n JSONObject values = (JSONObject) ((JSONObject) status.result.get(\"json\")).get(\"data\");\n String cookie = values.getString(\"cookie\");\n\n status.httpClientHelper.setCookie(cookie, context);\n\n getMe(context, onLoginListener);\n }\n catch (JSONException e)\n {\n err = true;\n onLoginListener.onLogin(user, status, err);\n }\n }\n else\n {\n err = true;\n onLoginListener.onLogin(user, status, err);\n }\n }\n else\n {\n onLoginListener.onLogin(user, status, err);\n }\n }\n });\n }",
"User login(Uuid id, String username, String password, Time creationTime);",
"boolean authenticate(String userName, String password);",
"private void loginUser(final String email, final String password){\n String cancel_req_tag = \"login\";\n progressDialog.setMessage(\"Logging you in...\");\n showDialog();\n \n Map<String, String> params = new HashMap<>();\n params.put(\"email\", email);\n params.put(\"password\", password);\n \n JSONObject req = new JSONObject(params);\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, URL_FOR_LOGIN, req,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response){\n try{\n boolean error = response.getBoolean(\"error\");\n if(!error){\n Intent intent = new Intent(LoginActivity.this, UserActivity.class);\n String token = response.getString(\"token\");\n saveToken(getApplicationContext(), token);\n hideDialog();\n \n startActivity(intent);\n finish();\n } else {\n String error_msg = response.getString(\"error_msg\");\n Toast.makeText(getApplicationContext(), error_msg,Toast.LENGTH_LONG).show();\n hideDialog();\n }\n \n } catch (JSONException e){\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener(){\n @Override\n public void onErrorResponse(VolleyError error){\n Toast.makeText(getApplicationContext(), \"An error occurred while logging in, please try again.\", Toast.LENGTH_LONG).show();\n error.printStackTrace();\n hideDialog();\n }\n });\n \n AppSingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest, cancel_req_tag);\n }",
"public String login(String email, String password, HttpServletRequest req, HttpServletResponse resp) {\r\n log.info(\"login player api service:\" + mso.getId());\r\n log.info(\"login: email=\" + email + \";password=\" + password);\r\n if (!BasicValidator.validateRequired(new String[] {email, password}))\r\n return this.assembleMsgs(NnStatusCode.INPUT_MISSING, null);; \r\n\r\n String result[] = {\"\"};\r\n NnUser user = userMngr.findAuthenticatedUser(email, password, mso.getId(), req);\r\n if (user != null) {\r\n result[0] = this.prepareUserInfo(user, null, req, true);\r\n userMngr.save(user); //change last login time (ie updateTime)\r\n this.setUserCookie(resp, CookieHelper.USER, user.getToken());\r\n } else {\r\n return this.assembleMsgs(NnStatusCode.USER_LOGIN_FAILED, null);\r\n }\r\n return this.assembleMsgs(NnStatusCode.SUCCESS, result);\r\n }",
"public void login(User user);",
"@Action(value = \"userAction_login\", results = {\n\t\t\t@Result(name = \"login-error\", location = \"/login.jsp\"),\n\t\t\t@Result(name = \"login-ok\", type = \"redirect\", location = \"/index.jsp\"),\n\t\t\t@Result(name = \"login-params-error\", location = \"/login.jsp\") })\n\t@InputConfig(resultName = \"login-params-error\")\n\tpublic String login() {\n\t\tremoveSessionAttribute(\"key\");\n\t\ttry {\n\t\t\t// 1.获取subject对象\n\t\t\tSubject subject = SecurityUtils.getSubject();\n\t\t\t// 2.获取令牌对象(封装参数数据)\n\t\t\tUsernamePasswordToken token = new UsernamePasswordToken(\n\t\t\t\t\tmodel.getEmail(), model.getPassword());\n\t\t\tsubject.login(token);\n\t\t\treturn \"login-ok\";\n\t\t} catch (AuthenticationException e) {\n\t\t\te.printStackTrace();\n\t\t\tthis.addActionError(this.getText(\"login.emailorpassword.error\"));\n\t\t\treturn \"login-error\";\n\t\t}\n\t}",
"public static boolean login(Context ctx) {\n\t\t\n\t\tString username = ctx.formParam(\"username\");\n\t\tString password = ctx.formParam(\"password\");\n\t\t\n\t\tSystem.out.println(username);\n\t\tSystem.out.println(password);\n\t\t\n\t\tif(username.equals(\"user\") && password.equals(\"pass\")) {\n\t\t\tctx.res.setStatus(204);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"McBobby\",true));\n\t\t\treturn true;\n\t\t}else {\n\t\t\t\n\t\t\tctx.res.setStatus(400);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"fake\",false));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n//\t\tctx.queryParam(password); /authenticate?password=value\n//\t\tctx.pathParam(password); /authenticate/{password}\n\t}",
"void loginAttempt(String email, String password);",
"public Response login(String username, String password) {\n\t\tResponse response = new Response();\n\n\t\tfor (String user : users) {\n\t\t\tif (user.equals(username)) {\n\t\t\t\tresponse.setResult(user);\n\t\t\t\tresponse.setEsito(true);\n\t\t\t}\n\t\t}\n\t\treturn response;\n\t}",
"private static void login(String role, String password) {\n String json = String.format(\"{username: \\\"%s\\\", password: \\\"%s\\\"}\", role, password);\n securityToken = given()\n .contentType(\"application/json\")\n .body(json)\n //.when().post(\"/api/login\")\n .when().post(\"/login\")\n .then()\n .extract().path(\"token\");\n }",
"public User getUser(String userName, String password);",
"com.bingo.server.msg.REQ.LoginRequest getLogin();",
"public abstract User login(User data);",
"public int login(String username, String password) \n {\n\treturn this.acctCtrl.login(username, password);\n\n }",
"public JSONObject loginUser(String email, String password) {\n\t\t// Building Parameters\n\t\tList<NameValuePair> params = new ArrayList<NameValuePair>();\n\t\tparams.add(new BasicNameValuePair(\"email\", email));\n\t\tparams.add(new BasicNameValuePair(\"password\", password));\n\t\t\n\t\t// getting JSON object\n\t\tJSONObject json = jsonParser.makeHttpRequest(URL_LOGIN_USER, \"POST\", params);\n\t\t\n\t\treturn json;\n\t}",
"@Test\n public void bTestLogin(){\n given()\n .param(\"username\", \"playlist\")\n .param(\"password\", \"playlist\")\n .post(\"/login\")\n .then()\n .statusCode(200);\n }",
"public void login(String username, String password){\n\n //Para las pruebas un usuario por defecto\n if(username.equals(\"xxx\") && password.equals(\"xxx\")){\n LoginUserMutation.LoginUser loginUser = new LoginUserMutation.LoginUser(\n \"jwt\", \"xxx\"+username+\"xxx\",\n \"type\",9999999, \"ni idea\");\n jwt.setValue(new LoginUserMutation.Data(loginUser));\n }\n\n if(isUserNameValid(username) && isPasswordValid(password)){\n CompletableFuture<LoginUserMutation.Data> loginDataPromise = loginRepository.gqlLoginUser(username, password);\n try {\n LoginUserMutation.Data loginData = loginDataPromise.get(2L, TimeUnit.SECONDS);\n System.out.println(loginData.loginUser());\n if(loginData.loginUser() != null){\n jwt.setValue(loginData);\n }else{\n toastErrorObserver.setValue(\"Correo o Contraseña Incorrectas\");\n }\n }catch(Error | ExecutionException | InterruptedException | TimeoutException e){\n toastErrorObserver.setValue(\"No se pudo comunicar con el servidor\");\n }\n }else{\n toastErrorObserver.setValue(\"Formato de Correo o Contraseña Erroneos\");\n }\n }",
"public UserTo callLoginUser(UserTo userTo) throws ConnectException {\n\t\tif(Objects.isNull(userTo.getUsername()) || Objects.isNull(userTo.getPassword())) {\n\t\t\tSystem.out.println(\"Invalid login credentials.\");\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tWebResource webResource = getJerseyClient(\"http://localhost:8080/useroptix/j_spring_security_check\");\n\t\t\tString postBodyStr = \"username=\" + userTo.getUsername() + \"&password=\"+userTo.getPassword();\n\t\t\tString respStr = webResource.type(MediaType.APPLICATION_FORM_URLENCODED ).post(String.class, postBodyStr);\n\t\t\tif(Objects.nonNull(respStr) && !respStr.isEmpty() && respStr.contains(\"token\")) {\n\t\t\t\t//response contains date values so need to provide the date formate.\n\t\t\t\tGson gson = new GsonBuilder().setDateFormat(\"yyyy-MM-dd\").create();\n\t\t\t\tType userLoginResults = new TypeToken<Map<String, String>>(){}.getType();\n\t\t\t\t// // Convert the data from the response JSON object\n\t\t\t\tMap<String, String> userLoginResultMap = gson.fromJson(respStr, userLoginResults);\n\t\t\t\tif(userLoginResultMap != null \n\t\t\t\t\t\t&& !userLoginResultMap.isEmpty() \n\t\t\t\t\t\t&& userLoginResultMap.containsKey(\"token\")) {\n\t\t\t\t\tuserTo.setToken(String.valueOf(userLoginResultMap.containsKey(\"token\")));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\" ----->>> \" + userLoginResultMap.get(\"token\"));\n\t\t\t}\n\t\t} catch (UniformInterfaceException e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call LoginUser : (401 Unauthorized) \"+e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call CreateUser : \"+e.getMessage());\n\t\t}\n\t\treturn userTo;\n\t}",
"@PostMapping(\"/login\")\n\t public String login(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password, Model model) {\n\t \t\tSystem.out.println(username +\"Hello \"+ password);\n\t \t\tboolean flag=userService.autoLogin(username, password);\n\t if(flag) {\n\t \tmodel.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t \t model.addAttribute(\"username\",username);\n\t \t localUsername = username;\n\t \t return \"redirect:/dashboard\";\n\t }\n\t model.addAttribute(\"error\",true);\n\t return \"login\";\n\t }",
"@RequestMapping(\"/login\")\n public ConfirmationMessage login(@RequestParam(value = \"username\", defaultValue = \"\") String username,\n @RequestParam(value = \"password\", defaultValue = \"\") String password) {\n return userLogic.login(username, password);\n }",
"@PostMapping(\"/login\")\n @CrossOrigin\n public ResponseEntity<?> login(@RequestParam String contactNumber, @RequestParam String password) {\n String passwordByUser = String.valueOf(userService.findUserPassword(contactNumber));\n String sha256hex = Hashing.sha256()\n .hashString(password, Charsets.US_ASCII)\n .toString();\n if (userService.findUserPassword(contactNumber) == null)\n return new ResponseEntity<>(\"This contact number has not been registered!\", HttpStatus.OK);\n else if (!(passwordByUser.equalsIgnoreCase(sha256hex))) {\n return new ResponseEntity<>(\"Invalid Credentials\", HttpStatus.UNAUTHORIZED);\n } else {\n User user = userService.findUser(contactNumber);\n String accessToken = UUID.randomUUID().toString();\n userAuthTokenService.addAccessToken(user.getId(), accessToken);\n HttpHeaders headers = new HttpHeaders();\n headers.add(\"access-token\", accessToken);\n List<String> header = new ArrayList<>();\n header.add(\"access-token\");\n headers.setAccessControlExposeHeaders(header);\n return new ResponseEntity<>(user, headers, HttpStatus.OK);\n }\n }",
"@org.junit.Test\r\n\tpublic void login() {\n\t\tParameters parameters = new Parameters();\r\n\t\tparameters.setUrl(\"LoginServlet?action=login\");\r\n\t\tparameters.setList(new ArrayList<NameValuePair>());\r\n\t\tparameters.getList().add(new BasicNameValuePair(\"info\", \"jitl\"));\r\n\t\tparameters.getList().add(new BasicNameValuePair(\"info2\", \"admin\"));\r\n\t\tparameters.getList().add(new BasicNameValuePair(\"info3\", \"admin\"));\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tString string = (String) MainUtilityTools.execute(parameters);\r\n\t\tSystem.out.println(string);\r\n\t}",
"List<String> authenticateUser(String userName, String password);",
"public static JSONObject login(Context context, String email, String password) {\n\t\ttry {\n\t\t\temail = URLEncoder.encode(email, \"UTF-8\");\n\t\t\tpassword = URLEncoder.encode(password, \"UTF-8\");\n\t\t\tString response = makeAPICall(context, \"login.php?email=\" + email + \"&password=\" + password);\n\t\t\treturn new JSONObject(response);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"String login(String userName, String password) throws RemoteException, InterruptedException;",
"@Test\n public void cTestGetLoginToken() {\n token = given()\n .param(\"username\", \"playlist\")\n .param(\"password\", \"playlist\")\n .post(\"/login\")\n .jsonPath().getString(\"token\");\n }",
"int authenticateUser(IDAOSession session, String userName, String password);",
"String getLoginapiavgrtt();",
"void login(String userName) throws IllegalArgumentException, IOException;",
"EmployeeMaster authenticateUser(int employeeId, String password);",
"AuthenticationToken authenticate(String username, CharSequence password) throws Exception;",
"@RequestMapping(value = \"/{username}/{password}\", method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> login (@PathVariable(\"username\") String username,\n @PathVariable(\"password\") String password) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n Timestamp startTime = getTimeStamp();\n User user = userRepo.findByEmailAddress(username);\n\n if (user != null) { // yes user with this username exists\n\n if (user.getPassword().equals(password)) {\n if ( user.getApproved()) {\n respMap.put(\"message\", user.getType() + \" User \" + user.getFirstname() + \" with id \" + user.getUserid() + \" is logged in!\");\n respMap.put(\"userType\", user.getType());\n\n respMap.put(\"name\", user.getFirstname());\n respMap.put(\"httpStatus\", \"\" + HttpStatus.OK);\n respMap.put(\"startTime\", \"\" + startTime);\n respMap.put(\"userId\", \"\" + user.getUserid());\n respMap.put(\"success\", \"\" + 1);\n } else {\n respMap.put( \"message\" , \"Account has not been approved .. check with Administrator\");\n respMap.put( \"success\" , \"0\");\n message = \"Account has not been approved .. check with Administrator\";\n }\n\n } else { // password incorrect\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"0\");\n message = \"Username or password incorrect\";\n }\n } else { // username not found\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"\"+0);\n respMap.put(\"httpStatus\", \"\"+ HttpStatus.OK);\n\n }\n\n\n\n return new ResponseEntity<>(respMap, httpStatus);\n }",
"public interface LoginSever {\n @FormUrlEncoded//读参数进行urlEncoded\n @POST(\"login\")\n Observable<LoginResult> doPost(\n @Field(\"username\") String user_name,\n @Field(\"password\") String password,\n @Field(\"device_no\") String device_no,\n @Field(\"auth_code\") String auth_code);\n\n @GET(\"Outsides/login\")\n Observable<User> doGet(\n @Query(\"username\") String user_name,\n @Query(\"password\") String password,\n @Query(\"device_no\") String device_no,\n @Query(\"auth_code\") String auth_code);\n}",
"public interface clientAPI {\n @FormUrlEncoded\n @POST(\"login\")\n Call<MainModel> loginUser(\n @Field(\"email\") String username,\n @Field(\"password\") String password\n );\n}",
"public interface RuangguruApiClient {\n\n // TODO: 3/3/17 change this as desired request\n\n @GET(\"/login\")\n Call<LoginResponse> loginRequest(@Path(\"username\") String username\n , @Path(\"password\") String password);\n}"
] | [
"0.83100677",
"0.77972037",
"0.7758927",
"0.7620525",
"0.757486",
"0.7478169",
"0.7453212",
"0.7444127",
"0.7356364",
"0.73234415",
"0.73056644",
"0.7270182",
"0.72536254",
"0.72386557",
"0.7213041",
"0.72084063",
"0.72007513",
"0.70484585",
"0.6980499",
"0.6965086",
"0.69587517",
"0.6956693",
"0.69514537",
"0.6949282",
"0.6935672",
"0.6934591",
"0.6925048",
"0.68766505",
"0.68758774",
"0.68611324",
"0.6854974",
"0.6849723",
"0.6845579",
"0.6835959",
"0.6833996",
"0.6808024",
"0.68024224",
"0.6782646",
"0.6772315",
"0.676862",
"0.6761405",
"0.67583644",
"0.67501134",
"0.6742914",
"0.6715075",
"0.67145085",
"0.67119724",
"0.66950166",
"0.66940767",
"0.6692971",
"0.6685813",
"0.66820157",
"0.6677349",
"0.6665507",
"0.66632575",
"0.66595894",
"0.6648188",
"0.6646973",
"0.66466415",
"0.6644329",
"0.66204584",
"0.6618637",
"0.66066396",
"0.66039574",
"0.6603786",
"0.6594074",
"0.6591811",
"0.65782726",
"0.65714306",
"0.65682226",
"0.65567523",
"0.6542495",
"0.65418476",
"0.65374327",
"0.6520491",
"0.6520039",
"0.6503553",
"0.65031743",
"0.6494311",
"0.6493569",
"0.6483833",
"0.64802665",
"0.64787465",
"0.647624",
"0.64749175",
"0.64742875",
"0.64738023",
"0.6466603",
"0.64649063",
"0.6450163",
"0.644194",
"0.6439928",
"0.64285904",
"0.64236194",
"0.6401437",
"0.63958377",
"0.6392166",
"0.6392126",
"0.6390452",
"0.6385163",
"0.63793516"
] | 0.0 | -1 |
if (Constants.WIZ_ROCKET_API != null) Constants.WIZ_ROCKET_API.event.push(TAG); | public void setWizRocket() {
if (LoginScreenManager.getInstance().mAnalyticsListener != null) {
LoginScreenManager.getInstance().mAnalyticsListener.sendScreenName(getString(R.string.verification_code), getActivity().getApplication(), getContext());
}
//AnalyticsHelper.sendScreenName(getString(R.string.verification_code), getActivity().getApplication(), getContext());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getPushEvent();",
"public boolean hasPushEvent();",
"@Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"Events: \", error.toString());\n\n Toast.makeText(context,\n error.toString(),\n Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"Events: \", error.toString());\n\n Toast.makeText(context,\n error.toString(),\n Toast.LENGTH_SHORT).show();\n }",
"public interface IPushListener {\n /**\n * 获取push返回的数据\n * @param data\n * @param pushType 代表推送消息的类型,\n * PushType:1. 为CMD时,消息为透传消息,消息并未展示在通知栏\n * 2. 为NOTIFIY时,消息已经显示在通知栏了,业务端不用在通知栏展示消息了\n */\n public void onPushMessageReceive(MessageBean data,PushType pushType);\n\n\n /**\n * 返回推送是否在线,在线才能收到推送,否则收不到\n * 如果无其他需求可以不处理\n *\n * @param online\n */\n public void isOnline(boolean online);\n\n /**\n * 返回推送是开启还是关闭,当业务端设置推送开启/关闭成功时会调用\n * 设置推送的开启/关闭参考{@PushInterface#switchPush(boolean)}\n *\n * @param toggle 开启或者关闭push的回调\n */\n public void onPushToggle(boolean toggle);\n\n /**\n *\n * @param token 注册到服务端的token\n * @param status 注册到服务端的 platStatus\n * @param success true 注册push成功,false 注册失败\n * 如果返回失败,业务端需要考虑重新登录push。\n */\n public void onPushRegister(String token,PlatStatus status,boolean success);\n\n /**\n * 将注册的push token 和push 渠道返回给业务端\n * @param token\n * @param status\n */\n public void onPushTokenReceive(String token,PlatStatus status);\n\n\n}",
"@Override\n protected void onPushOpen(Context context, Intent intent) {\n }",
"public interface Constants {\n\n public static final String ACTION_BIND = \"com.avoscloud.beijing.push.demo.keepalive.ACTION_BIND\";\n\n public static final String START_SESSION = \"START_SESSION\";\n public static final int START_SESSION_CODE = 1;\n\n public static final String SEND_MESSAGE = \"SEND_MESSAGE\";\n public static final int SEND_MESSAGE_CODE = 2;\n\n public static final String CLOSE_SESSION = \"CLOSE_SESSION\";\n public static final int CLOSE_SESSION_CODE = 3;\n\n public static final String SEND_MESSAGE_MESSAGE = \"SEND_MESSAGE_message\";\n\n public static final String SEND_MESSAGE_RECEIVERS = \"SEND_MESSAGE_receivers\";\n\n public static final String SESSION_UPDATE = \"SESSION_UPDATE\";\n\n public static final String SESSION_PAUSED = \"SESSION_PAUSED\";\n\n public static final String SESSION_RESUMED = \"SESSION_RESUMED\";\n\n public static final String SESSION_UPDATE_CONTENT = \"SESSION_UPDATE_content\";\n\n public static final String SESSION_UPDATE_TYPE = \"SESSION_UPDATE_type\";\n\n public static final String SESSION_UPDATE_TYPE_NORMAL = \"SESSION_UPDATE_type_normal\";\n\n public static final String SESSION_UPDATE_TYPE_CONTROL = \"SESSION_UPDATE_type_control\";\n\n public static final String SESSION_SHOW_ONLINE = \"SESSION_SHOW_ONLINE\";\n public static final int SESSION_SHOW_ONLINE_CODE = 4;\n\n public static final String SESSION_TRIGGER_PUSH = \"SESSION_TRIGGER_PUSH\";\n public static final int SESSION_TRIGGER_PUSH_CODE = 5;\n}",
"private void recordPushLog(String configName) {\n PushLog pushLog = new PushLog();\n pushLog.setAppId(client.getAppId());\n pushLog.setConfig(configName);\n pushLog.setClient(IP4s.intToIp(client.getIp()) + \":\" + client.getPid());\n pushLog.setServer(serverHost.get());\n pushLog.setCtime(new Date());\n pushLogService.add(pushLog);\n }",
"public void handleSensorEvents(){\n\t}",
"public interface WearConnectionConstants {\n\n\n public static class RequestCode {\n int CONNECT_TO_WEAR = 1000;\n\n }\n\n class KEY {\n public static String SEND_DATA = \"Send_Data\";\n public static String CURRENT_TIME = \"Current_Time\";\n public static String USER_ACTION = \"User_Action\";\n }\n\n public static class TAG {\n String GOOGLE_PLAY_SERVICE_ERROR_DIALOG = \"google_play_service_error_dialog\";\n\n }\n\n public static final String START_WEAR_APPLICATION = \"/start/wear/\";\n public static final String START_MOBILE_APPLICATION = \"/start/mobile/\";\n\n public static final String PATH_WEAR_DATA = \"/data/wear/\";\n public static final String PATH_MOBILE_DATA = \"/data/mobile/\";\n\n public static final String PATH_WEAR_MESSAGE = \"/message/wear/\";\n public static final String PATH_MOBILE_MESSAGE = \"/message/mobile/\";\n\n class Path {\n public static final String PATH_USER_ACTION_DATA = PATH_MOBILE_DATA + \"userAction\";\n }\n\n}",
"public void push(Object activity);",
"private void onPreRequestData(int tag) {\n }",
"public void createProductTagApiCall() {\n if (strLatitude == null && strLongitude == null) {\n startLocationListener();\n buildGoogleApiClient();\n createLocationRequest();\n Loc_Update();\n }\n\n Log.d(\"latitudeLogitude: \",strLongitude+ \" \"+ strLatitude);\n\n getQrAction();\n JsonObject js = new JsonObject();\n\n try {\n\n if (strLatitude != null && strLongitude != null) {\n\n js.addProperty(\"longitude\", Double.parseDouble(strLongitude));\n js.addProperty(\"latitude\", Double.parseDouble(strLatitude));\n\n JsonArray hashCode = new JsonArray();\n\n Extras.qr_hashes_multi = Arrays.asList(strHashCode.split(\",\"));\n\n for(int i = 0; i < Extras.qr_hashes_multi.size(); i++) {\n hashCode.add(Extras.qr_hashes_multi.get(i));\n Log.d(\"strHashCodennnnnnnn: \", Extras.qr_hashes_multi.get(i));\n }\n\n js.add(\"previousProductTagHashes\",hashCode);\n\n JsonArray productTagActionsJsonArray = new JsonArray();\n\n for (String key : qrActions.keySet()) {\n\n Log.d(\"key\", key);\n JsonObject action = new JsonObject();\n action.addProperty(\"actionId\", key);\n productTagActionsJsonArray.add(action);\n\n }\n\n JsonObject productTagProducerJsonObject = new JsonObject();\n productTagProducerJsonObject.addProperty(\"producerId\", strProducerId);\n\n js.add(\"productTagActions\", productTagActionsJsonArray);\n js.add(\"productTagProducer\", productTagProducerJsonObject);\n }\n\n } catch (JsonParseException e) {\n Extras.responseErrorDialog(\"Invalid Input!\", getActivity());\n } catch (NullPointerException e){\n Extras.responseErrorDialog(\"Invalid Information, Make sure your Location is Enabled and try again!\", getActivity());\n\n }\n\n\n Log.d(\"productTagRaw: \", js.toString());\n\n\n Call<ProductTag> createProduct = apiServices.createProductTag(\"Bearer \"+strToken,js);\n createProduct.enqueue(new Callback<ProductTag>() {\n\n @Override\n public void onResponse(Call<ProductTag> call, retrofit2.Response<ProductTag> response) {\n\n\n String response_string = new Gson().toJson(response.body());\n\n Log.d(\"RESPONSE: \",response_string);\n ProductTag productTag = response.body();\n\n\n try {\n\n String productTagHash = productTag.getProductTagHash();\n\n GeneralUtils.putStringValueInEditor(getActivity(), \"hash_code\", \"\").commit();\n\n try {\n\n bitmap = TextToImageEncode(productTagHash);\n genrateQrImage.setImageBitmap(bitmap);\n BitmapDrawable drawable = (BitmapDrawable) genrateQrImage.getDrawable();\n bm = drawable.getBitmap();\n storeImage(bm);\n GeneralUtils.progress.dismiss();\n new SweetAlertDialog(getActivity(), SweetAlertDialog.SUCCESS_TYPE)\n .setTitleText(\"Success\")\n .setContentText(getString(R.string.product_created))\n .setConfirmButton(\"Ok\", new SweetAlertDialog.OnSweetClickListener() {\n @Override\n public void onClick(SweetAlertDialog sweetAlertDialog) {\n sweetAlertDialog.dismiss();\n }\n })\n\n .show();\n\n } catch (WriterException e) {\n Extras.responseErrorDialog(getString(R.string.qr_creation_error), getActivity());\n\n }\n } catch (JsonParseException e) {\n Extras.responseErrorDialog(getString(R.string.invalid_response), getActivity());\n\n }\n catch (NullPointerException e) {\n\n Extras.responseErrorDialog(getString(R.string.try_again), getActivity());\n\n }\n\n }\n\n @Override\n public void onFailure(Call<ProductTag> call, Throwable t) {\n\n Extras.responseErrorDialog(t.getMessage(), getActivity());\n\n }\n });\n\n }",
"@EncoderThread\n protected void onEvent(@NonNull String event, @Nullable Object data) {}",
"void onBusEvent(Event event);",
"public void pushTag(String tag){\n\t\t\n\t\ttagArray.add(tag);\n\t\t\n\t}",
"void onEvent (ZyniEvent event, Object ... params);",
"public final void cZO() {\n AppMethodBeat.i(7673);\n Bundle bundle = new Bundle();\n bundle.putLong(\"msg_id\", cZv().getIntent().getLongExtra(\"msg_id\", Long.MIN_VALUE));\n bundle.putString(\"sns_local_id\", cZv().getIntent().getStringExtra(\"sns_local_id\"));\n bundle.putInt(\"news_svr_id\", cZv().getIntent().getIntExtra(\"news_svr_id\", 0));\n bundle.putString(\"news_svr_tweetid\", cZv().getIntent().getStringExtra(\"news_svr_tweetid\"));\n bundle.putInt(\"message_index\", cZv().getIntent().getIntExtra(\"message_index\", 0));\n bundle.putString(\"rawUrl\", cZv().cOG);\n if (!bo.isNullOrNil(cZv().cOG) && cZv().cOG.endsWith(\"#rd\")) {\n String substring = cZv().cOG.substring(0, cZv().cOG.length() - 3);\n if (!(bo.isNullOrNil(cZv().uxh) || cZv().uxh.startsWith(substring))) {\n bundle.putString(\"rawUrl\", cZv().uxh);\n bundle.putLong(\"msg_id\", Long.MIN_VALUE);\n }\n } else if (!(bo.isNullOrNil(cZv().uxh) || cZv().uxh.startsWith(cZv().cOG))) {\n bundle.putString(\"rawUrl\", cZv().uxh);\n bundle.putLong(\"msg_id\", Long.MIN_VALUE);\n }\n Intent intent = cZv().getIntent();\n if (intent != null) {\n bundle.putString(\"preChatName\", intent.getStringExtra(\"preChatName\"));\n bundle.putInt(\"preMsgIndex\", intent.getIntExtra(\"preMsgIndex\", 0));\n bundle.putString(\"prePublishId\", intent.getStringExtra(\"prePublishId\"));\n bundle.putString(\"preUsername\", intent.getStringExtra(\"preUsername\"));\n }\n try {\n com.tencent.mm.plugin.webview.stub.b Z = cZv().icy.Z(bundle);\n if (Z.cYV()) {\n cZv().uhz.bJ(\"sendAppMessage\", false);\n com.tencent.mm.plugin.webview.ui.tools.jsapi.d dVar = cZv().uhz;\n HashMap cZP = cZP();\n if (dVar.ready) {\n Bundle JL = dVar.JL(1);\n if (JL == null || !JL.getBoolean(\"WebViewShare_reslut\", false)) {\n cZP = new HashMap();\n cZP.put(\"scene\", \"favorite\");\n dVar.uFo.evaluateJavascript(\"javascript:WeixinJSBridge._handleMessageFromWeixin(\" + i.a.b(\"menu:share:appmessage\", cZP, dVar.uFv, dVar.uFw) + \")\", null);\n try {\n dVar.icy.L(\"scene\", \"favorite\", dVar.uqj);\n } catch (Exception e) {\n ab.w(\"MicroMsg.JsApiHandler\", \"jsapiBundlePutString, ex = \" + e.getMessage());\n }\n } else {\n try {\n dVar.icy.L(\"scene\", \"favorite\", dVar.uqj);\n } catch (Exception e2) {\n ab.w(\"MicroMsg.JsApiHandler\", \"jsapiBundlePutString, ex = \" + e2.getMessage());\n }\n dVar.h(JL, \"sendAppMessage\");\n }\n } else {\n try {\n dVar.icy.L(\"scene\", \"favorite\", dVar.uqj);\n dVar.h(dVar.aL(cZP), \"sendAppMessage\");\n } catch (Exception e22) {\n ab.w(\"MicroMsg.JsApiHandler\", \"jsapiBundlePutString, ex = \" + e22.getMessage());\n }\n }\n ab.i(\"MicroMsg.WebViewMenuHelper\", \"on favorite simple url\");\n AppMethodBeat.o(7673);\n return;\n }\n com.tencent.mm.plugin.fav.ui.c.a(Z.getRet(), cZv(), cZv().mUw);\n if (Z.getRet() == 0) {\n Jo(1);\n AppMethodBeat.o(7673);\n return;\n }\n Jo(2);\n AppMethodBeat.o(7673);\n } catch (Exception e222) {\n ab.e(\"MicroMsg.WebViewMenuHelper\", \"edw, favoriteUrl fail, ex = \" + e222.getMessage());\n AppMethodBeat.o(7673);\n }\n }",
"public interface PushCallBack {\n void onSuccess();\n\n void onTimeout();\n}",
"public interface Connection {\r\n\r\n static final String APP_SERVER_URL = \"http://www.softwaresunleashed.com/iots/sending-push-notifications.php?shareRegId=1\";\r\n static final String GOOGLE_PROJECT_ID = \"769537366212\";\r\n\r\n static final String MESSAGE_KEY = \"m\";\r\n\r\n}",
"@Override\r\n\tprotected void processInWifiEvent(InWifiEvent arg0) {\n\t\t\r\n\t}",
"@Subscribe\n public void onMessageEvent(MessageEvent event){\n// Toast.makeText(this, event.message+\"splash\", Toast.LENGTH_SHORT).show();\n }",
"@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}",
"public interface GsoapCallEventListener {\n void onEventSend(int eventType, String... data);\n}",
"@Override\r\n\tpublic void onCreate() {\r\n\t\tsuper.onCreate();\r\n\t\t\r\n\t\t// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext\r\n\t\tSDKInitializer.initialize(this);\r\n\t\t\r\n\t\t\r\n\t\t//初始化云巴推送\t\r\n\t\tYunBaManager.start(getApplicationContext());\r\n YunBaManager.subscribe(getApplicationContext(), new String[]{\"jhd\"}, new IMqttActionListener() {\r\n\r\n @Override\r\n public void onSuccess(IMqttToken arg0) {\r\n Log.e(\"jhd\", \"Subscribe topic succeed\");\r\n }\r\n\r\n @Override\r\n public void onFailure(IMqttToken arg0, Throwable arg1) {\r\n Log.e(\"jhd\", \"Subscribe topic failed\") ;\r\n }\r\n });\r\n \r\n \r\n Log.e(TAG, \"MyApplication onCreate\") ;\r\n \r\n// \r\n//\t\t//云巴\r\n//\t\t YunBaManager.start(getApplicationContext());\r\n//\r\n//\t YunBaManager.subscribe(getApplicationContext(), new String[]{\"aa\"}, new IMqttActionListener() {\r\n//\r\n//\t @Override\r\n//\t public void onSuccess(IMqttToken arg0) {\r\n//\t Log.d(TAG, \"Subscribe topic succeed\");\r\n//\t }\r\n//\r\n//\t @Override\r\n//\t public void onFailure(IMqttToken arg0, Throwable arg1) {\r\n//\t Log.d(TAG, \"Subscribe topic failed\" );\r\n//\t }\r\n//\t });\r\n\r\n\t}",
"public interface SwrvePushManager {\n void processMessage(final Bundle msg);\n}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n //setContentView(R.layout.main);\n try {\n //KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n //ks.load(getResources().openRawResource(R.raw.public_key), \"asdf\".toCharArray());\n\n mobile = new Mobile(1, \"192.168.105.129\", 7777);\n mobile.SetAuthFile(this.getFileStreamPath(\"netronics_auth\").getPath());\n mobile.On(\"hi\", new RecvOnListener() {\n @Override\n public void On(Mobile mobile, Object o) {\n mobile.Emit(\"hi2\", o);\n }\n });\n mobile.On(\"push_test\", new RecvOnListener() {\n @Override\n public void On(Mobile mobile, Object o) {\n Log.d(\"Netronics Push\", o.toString());\n }\n });\n mobile.AddPush(new GCM(this, \"568476072992\"));\n mobile.Run();\n mobile.Emit(\"hi\", \"test\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public interface HuobiConsts {\n String API_HOST_PRO = \"api.huobi.pro\";\n String API_HOST_HADAX = \"api.hadax.com\";\n\n String USER_AGENT = \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36\";\n\n String ENDPOINT_SECURITY_TYPE_APIKEY = \"AccessKeyId\";\n String ENDPOINT_SECURITY_TYPE_APIKEY_HEADER = ENDPOINT_SECURITY_TYPE_APIKEY + \":#\";\n\n String ENDPOINT_SECURITY_TYPE_SIGNED = \"Signature\";\n String ENDPOINT_SECURITY_TYPE_SIGNED_HEADER = ENDPOINT_SECURITY_TYPE_SIGNED + \":#\";\n\n String SIGNATURE_METHOD = \"HmacSHA256\";\n String SIGNATURE_VERSION = \"2\";\n\n DateTimeFormatter DT_FORMAT = DateTimeFormatter.ofPattern(\"uuuu-MM-dd'T'HH:mm:ss\");\n ZoneId ZONE_GMT = ZoneId.of(\"Z\");\n\n\n interface WsCode {\n int manualClose = 4999;\n int autoReconnect = 4998;\n int pingExpired = 1003;\n }\n\n\n}",
"public RecordObject addEvent(String token, Object record) throws RestResponseException;",
"@Override\n public void onReady(ReadyEvent event) {\n\n }",
"public interface SDKCallback {\n void onSDKSuccess(String tag, Object message);\n\n void onSDKFail(String tag, String message);\n\n}",
"@Override\n public void onCallGapRequest(CallGapRequest ind) {\n\n }",
"OrderEvent(String apiName) {\r\n this.apiName = apiName;\r\n }",
"void addToQueue(WebhookMessage msg);",
"@Override\n public void onErrorResponse(VolleyError error) {\n try{\n Log.e(\"wsrong\", error.toString());\n }\n catch (Exception ex)\n {\n Toast.makeText(context,ex.getMessage(),Toast.LENGTH_LONG).show();\n }\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n try{\n Log.e(\"wsrong\", error.toString());\n }\n catch (Exception ex)\n {\n Toast.makeText(context,ex.getMessage(),Toast.LENGTH_LONG).show();\n }\n }",
"public void addToFirebaseAnalytics(boolean z) {\n if (z) {\n FirebaseEventsNewHelper.getInstance().sendShareEvent(\"Video\");\n } else {\n FirebaseEventsNewHelper.getInstance().sendShareEvent(\"Image\");\n }\n }",
"@Override\n public void onEnabled(Context context, Intent intent) {\n new EventBusUtils().send(1);\n// Toast.makeText(context, \"激活ok====\", Toast.LENGTH_SHORT).show();\n//\n }",
"public interface PushFireBaseTokenRequestListener {\n\n public void tokenPushed();\n}",
"private void insertEventRecord(Device device, \n long fixtime, int statusCode, Geozone geozone,\n GeoPoint geoPoint, \n long gpioInput,\n double speedKPH, double heading, \n double altitude,\n double odomKM)\n {\n\n /* create event */\n EventData evdb = createEventRecord(device, fixtime, statusCode, geoPoint, gpioInput, speedKPH, heading, altitude, odomKM);\n\n /* insert event */\n // this will display an error if it was unable to store the event\n Print.logInfo(\"Event : [0x\" + StringTools.toHexString(statusCode,16) + \"] \" + StatusCodes.GetDescription(statusCode,null));\n if (device != null) {\n device.insertEventData(evdb); \n }\n this.eventTotalCount++;\n\n }",
"public void simpleEvent() {\n AdGyde.onSimpleEvent(\"SimpleEventID\");\n Toast.makeText(this, \"Simple event clicked\", Toast.LENGTH_SHORT).show();\n }",
"private void fetchTag() {\n String url = URL_TO_TAG;\n // Volley's json array request object\n JsonArrayRequest req = new JsonArrayRequest(url,\n new Response.Listener<JSONArray>() {\n @Override\n public void onResponse(JSONArray response) {\n //Log.d(TAG, response.toString());\n tagList.clear();\n if (response.length() > 0 && response != null) {\n // looping through json and adding to event list\n for (int i = 0; i < response.length(); i++) {\n try {\n JSONObject json_data = response.getJSONObject(i);\n tagList.add(json_data.getString(\"tag_name\"));\n\n } catch (JSONException e) {\n Log.e(\"Error\", \"JSON Parsing error: \" + e.getMessage());\n }\n }\n\n tagadapter.notifyDataSetChanged();\n }\n\n // stopping swipe refresh\n //swipeRefreshLayout.setRefreshing(false);\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"Error\", \"Server Error: \" + error.getCause());\n if (error.getClass().getName().equals(\"com.android.volley.ParseError\")){\n Toast.makeText(AdQuestionActivity.this, \"No tag yet\", Toast.LENGTH_SHORT).show();\n }else\n Toast.makeText(AdQuestionActivity.this, \"No Internet Connection or Service Unavailable Right Now\"\n + error.getMessage(), Toast.LENGTH_SHORT).show();\n\n // stopping swipe refresh\n //swipeRefreshLayout.setRefreshing(false);\n }\n });\n\n // Adding request to request queue\n MyApplication.getInstance().addToRequestQueue(req);\n }",
"@Override\n\t\t\tpublic void handle(Response response) throws Exception\n\t\t\t{\n\t\t\t\tif(response ==null){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(response.getStatusCode()==200){\n\t\t\t\t\tSystem.out.println(\"push seccuess\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"void updatePushApplication(PushApplication pushApp);",
"@Subscribe\n public void onDeviceInfo(final DeviceInformation event) {\n\n apiService.onSendDeviceInfo(event, new Callback<DeviceInfoSuccess>() {\n\n @Override\n public void success(DeviceInfoSuccess retroResponse, Response response) {\n\n if(retroResponse != null) {\n bus.post(new DeviceInfoSuccess(retroResponse));\n //ealmObjectController.cachedResult(MainFragmentActivity.getContext(), (new Gson()).toJson(retroResponse));\n RealmObjectController.cachedResultWithType(MainFragmentActivity.getContext(), (new Gson()).toJson(retroResponse),\"SplashInfo\");\n\n }else{\n BaseFragment.setAlertNotification(MainFragmentActivity.getContext());\n }\n\n }\n\n @Override\n public void failure(RetrofitError error) {\n BaseFragment.setAlertNotification(MainFragmentActivity.getContext());\n }\n\n });\n }",
"public void push(String name);",
"public final void event(final JSONObject builddata) {\n logger.fine(\"Sending event\");\n\n // Gather data\n JSONObject payload = new JSONObject();\n String hostname = nullSafeGetString(builddata, \"hostname\");\n String number = nullSafeGetString(builddata, \"number\");\n String buildurl = nullSafeGetString(builddata, \"buildurl\");\n String job = nullSafeGetString(builddata, \"job\");\n long timestamp = builddata.getLong(\"timestamp\");\n String message = \"\";\n\n // Setting source_type_name here, to allow modification based on type of event\n payload.put(\"source_type_name\", \"jenkins\");\n\n // Build title\n StringBuilder title = new StringBuilder();\n title.append(job).append(\" build #\").append(number);\n if ( \"SUCCESS\".equals( builddata.get(\"result\") ) ) {\n title.append(\" succeeded\");\n payload.put(\"alert_type\", \"success\");\n message = \"%%% \\n [See results for build #\" + number + \"](\" + buildurl + \") \";\n } else if ( builddata.get(\"result\") != null ) {\n title.append(\" failed\");\n payload.put(\"alert_type\", \"failure\");\n message = \"%%% \\n [See results for build #\" + number + \"](\" + buildurl + \") \";\n } else {\n title.append(\" started\");\n payload.put(\"alert_type\", \"info\");\n message = \"%%% \\n [Follow build #\" + number + \" progress](\" + buildurl + \") \";\n // Remove source_type_name to keep started events from being rolled up\n payload.remove(\"source_type_name\");\n }\n title.append(\" on \").append(hostname);\n\n // Add duration\n if ( builddata.get(\"duration\") != null ) {\n message = message + durationToString(builddata.getDouble(\"duration\"));\n }\n\n // Close markdown\n message = message + \" \\n %%%\";\n\n // Build payload\n payload.put(\"title\", title.toString());\n payload.put(\"text\", message);\n payload.put(\"date_happened\", timestamp);\n payload.put(\"event_type\", builddata.get(\"event_type\"));\n payload.put(\"host\", hostname);\n payload.put(\"result\", builddata.get(\"result\"));\n payload.put(\"tags\", assembleTags(builddata));\n payload.put(\"aggregation_key\", job); // Used for job name in event rollups\n\n post(payload, this.EVENT);\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), error.toString(), Toast.LENGTH_SHORT).show();\n\n }",
"public interface ClearcutLoggerApi\n{\n\n public abstract PendingResult logEventAsync(Context context, LogEventParcelable logeventparcelable);\n}",
"public interface Constants {\n \n public static String LOG_TAG = \"iyokan_parts\";\n}",
"public final void run() {\n AppMethodBeat.i(108148);\n if (q.a(cVar2.aBx(), jSONObject2, (com.tencent.mm.plugin.appbrand.s.q.a) cVar2.aa(com.tencent.mm.plugin.appbrand.s.q.a.class)) == b.FAIL_SIZE_EXCEED_LIMIT) {\n aVar2.BA(\"convert native buffer parameter fail. native buffer exceed size limit.\");\n AppMethodBeat.o(108148);\n return;\n }\n String CS = j.CS(jSONObject2.optString(\"url\"));\n Object opt = jSONObject2.opt(\"data\");\n String optString = jSONObject2.optString(FirebaseAnalytics.b.METHOD);\n if (bo.isNullOrNil(optString)) {\n optString = \"GET\";\n }\n if (TextUtils.isEmpty(CS)) {\n aVar2.BA(\"url is null\");\n AppMethodBeat.o(108148);\n } else if (URLUtil.isHttpsUrl(CS) || URLUtil.isHttpUrl(CS)) {\n byte[] bArr = new byte[0];\n if (opt != null && d.CK(optString)) {\n if (opt instanceof String) {\n bArr = ((String) opt).getBytes(Charset.forName(\"UTF-8\"));\n } else if (opt instanceof ByteBuffer) {\n bArr = com.tencent.mm.plugin.appbrand.r.d.q((ByteBuffer) opt);\n }\n }\n synchronized (d.this.ioA) {\n try {\n if (d.this.ioA.size() >= d.this.ioB) {\n aVar2.BA(\"max connected\");\n ab.i(\"MicroMsg.AppBrandNetworkRequest\", \"max connected mRequestTaskList.size():%d,mMaxRequestConcurrent:%d\", Integer.valueOf(d.this.ioA.size()), Integer.valueOf(d.this.ioB));\n }\n } finally {\n while (true) {\n }\n AppMethodBeat.o(108148);\n }\n }\n } else {\n aVar2.BA(\"request protocol must be http or https\");\n AppMethodBeat.o(108148);\n }\n }",
"@Bean\n public GroupedOpenApi pushApiGroup() {\n String[] packages = {\"io.getlime.push.controller.rest\"};\n\n return GroupedOpenApi.builder()\n .group(\"push\")\n .packagesToScan(packages)\n .build();\n }",
"void addVariant(PushApplication pushApp, Variant variant);",
"public void onUaCallRinging(UserAgent ua)\n { \n }",
"public interface BWAPIEventListener {\n\n /**\n * connection to BWAPI established\n */\n void connected();\n\n /**\n * game has just started, game settings can be turned on here\n */\n void matchStart();\n\n /**\n * perform AI logic here\n */\n void matchFrame();\n\n /**\n * game has just terminated\n */\n void matchEnd(boolean winner);\n\n /**\n * keyPressed from within StarCraft\n */\n void keyPressed(int keyCode);\n\n // BWAPI callbacks\n void sendText(String text);\n\n void receiveText(String text);\n\n void playerLeft(int playerID);\n\n void nukeDetect(Position p);\n\n void nukeDetect();\n\n void unitDiscover(int unitID);\n\n void unitEvade(int unitID);\n\n void unitShow(int unitID);\n\n void unitHide(int unitID);\n\n void unitCreate(int unitID);\n\n void unitDestroy(int unitID);\n\n void unitMorph(int unitID);\n\n void unitRenegade(int unitID);\n\n void saveGame(String gameName);\n\n void unitComplete(int unitID);\n\n void playerDropped(int playerID);\n}",
"@Override\n public void onReady() {\n if (Notificare.shared().isNotificationsEnabled()) {\n Notificare.shared().enableNotifications();\n }\n // Check if location updates are enabled, by default they are not.\n if (Notificare.shared().isLocationUpdatesEnabled()) {\n Notificare.shared().enableLocationUpdates();\n if (NotificarePushLibPlugin.getPluginSetting(\"enableBeacons\")) {\n Notificare.shared().enableBeacons();\n }\n }\n }",
"public void startNewEvent() {\n // JCudaDriver.cuEventRecord(cUevent,stream);\n }",
"@Override\n public void onApplicationEvent(ContextRefreshedEvent event) {\n\n appContext = event.getApplicationContext();\n System.out.println(appContext.getId());\n\n\n log.info(\"api-web初始化\");\n try {\n ApiUtils_.init(appContext);\n } catch (Exception e) {\n log.warn(\"初始化异常!\", e);\n }\n log.info(\"api-web初始化完成\");\n }",
"public void onIBeaconServiceConnect();",
"@Override\n public void onErrorResponse(VolleyError error) {\n try{\n Log.d(\"wsrong\",error.getMessage());\n }catch(NullPointerException ex)\n {\n Toast.makeText(context,\"Server issue try later\", Toast.LENGTH_LONG).show();\n Log.d(\"wsrong\",ex.getMessage());\n }\n }",
"public void onSubscribe() {\n\n }",
"Event () {\n // Nothing to do here.\n }",
"void track(String sender, String additionalInfo);",
"@Override\n\tpublic void handleEvent(EnOceanMessage data) {\n\t}",
"public abstract void push(SDGNode call);",
"public interface CommonEventListener extends EventListener {\n\n\n default boolean filterProject(byte[] data, int project, int clazz, int cmd) {\n\n return data[7] == project && data[8] == clazz && data[9] == cmd;\n }\n}",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();\n\n }",
"public void mo55177a() {\n if (!C3815z4.m2010d().mo55979a(C3815z4.C3816a.SDK_STOPPED, false)) {\n C3490e3.m665e(\"SDK is not stopped\");\n return;\n }\n if (C3615m3.this.f1449h != null) {\n C3615m3.this.f1449h.register();\n }\n C3490e3.m665e(\"SDK stop is reverting\");\n C3815z4.m2010d().mo55985b(C3815z4.C3816a.SDK_STOPPED, false);\n C3754u5.m1743f().mo55866c(false);\n C3496e5.m699h().mo55349a(false);\n AnalyticsBridge.getInstance().reportRevertStopSdkEvent();\n C3815z4.m2010d().mo55984b(C3815z4.C3816a.MISSING_EVENTS, AnalyticsBridge.getInstance().exportPendingEventsToJson());\n C3815z4.m2010d().mo55984b(C3815z4.C3816a.MISSING_EVENTS_V2, AnalyticsBridge.getInstance().exportPendingV2EventsToJson());\n }",
"EventType getEvent();",
"private final void m67085a(Bundle bundle) {\n Set<String> keySet = bundle.keySet();\n SparksEvent put = new SparksEvent(\"Push.Receive\").put(\"source\", 0);\n for (String str : keySet) {\n C2668g.a(str, \"key\");\n String a = C19296q.m68672a(str, \"notification.\", \"\", false, 4, null);\n Object obj = bundle.get(str);\n if (obj instanceof String) {\n put.put(a, Regex.f49051a.m59917a(\"^\\\"|\\\"$\").m59919a((CharSequence) obj, \"\"));\n } else if (obj instanceof Boolean) {\n put.put(a, ((Boolean) obj).booleanValue());\n } else if (obj instanceof Integer) {\n put.put(a, ((Number) obj).intValue());\n } else if (obj instanceof Long) {\n put.put(a, ((Number) obj).longValue());\n } else if (obj instanceof Float) {\n put.put(a, ((Number) obj).floatValue());\n } else if (obj instanceof Double) {\n put.put(a, ((Number) obj).doubleValue());\n } else if (obj instanceof Character) {\n put.put(a, ((Character) obj).charValue());\n } else if (obj instanceof Byte) {\n put.put(a, ((Number) obj).byteValue());\n } else if (obj instanceof int[]) {\n put.put(a, (int[]) obj);\n } else if (obj instanceof byte[]) {\n put.put(a, (byte[]) obj);\n } else if (obj instanceof char[]) {\n put.put(a, (char[]) obj);\n } else if (obj instanceof Map) {\n HashMap hashMap = new HashMap();\n Map map = (Map) obj;\n Collection arrayList = new ArrayList();\n for (Object next : map.keySet()) {\n if (next instanceof String) {\n arrayList.add(next);\n }\n }\n for (String str2 : (List) arrayList) {\n hashMap.put(str2, map.get(str2));\n }\n put.put(a, hashMap);\n } else {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Unsupported data value: \");\n stringBuilder.append(obj);\n C0001a.e(stringBuilder.toString(), new Object[0]);\n }\n }\n bundle = this.f58114e;\n if (bundle == null) {\n C2668g.b(\"managerAnalytics\");\n }\n bundle.a(put);\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();\n }",
"public interface KWEvent {\n\n\tpublic void portError(String msg);\n\n\t//from server.\n\n\tpublic void onRegisterRoomSuccess(RoomBean room);\n\n\tpublic void onRegisterRoomFailure(String msg);\n\n\tpublic void onRemoteAnswer(String sdp);\n\n\tpublic void onRemoteIceCandidate(final IceCandidate candidate);\n\n\tpublic void onDisconnect();\n\n\t//接受聊天信息。\n\tpublic void onMessage(String msg);\n\n\t//from peerconnection.\n\tpublic void onLocalSdp(SessionDescription localsdp);\n\n\t/**\n\t *\n\t */\n\tpublic void onClientPrepareComplete();\n\n\t/**\n\t * Callback fired once local Ice candidate is generated.\n\t *\n\t * @param candidate\n\t */\n\tpublic void onIceCandidate(final IceCandidate candidate);\n\n\t/**\n\t * Callback fired once connection is established(IceConnectionState is CONNECTED).\n\t */\n\tpublic void onIceConnected();\n\n\t/**\n\t * Callback fired once connection is closed(IceConnectionoState is DISCONNECTED).\n\t */\n\tpublic void onIceDisconnected();\n\n\t/**\n\t * Callback fired once peer connection is closed.\n\t */\n\tpublic void onPeerConnectionClosed();\n}",
"private void add(Pair<MarketDataRequestAtom,Event> inData)\n {\n getQueue().add(inData);\n }",
"public void onTag(RFIDTagEvent e) {\n\t\t\t\t\t// Creating string for the tag string\n\t\t\t\t\tString tagStr = e.getTag();\n\t\t\t\t\t// Creating try to check if its thecorrect tag\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// If thetag is \"1600ee15e9\", publish the message\n\t\t\t\t\t\tif (tagArray1.contains(tagStr)) {\n\t\t\t\t\t\t\t// Print message, if it's the correct tag\n\t\t\t\t\t\t\tSystem.out.println(\"Tag read OPEN DOOR: \" + tagStr);\n\n\t\t\t\t\t\t\t// Publish rfid and motor\n\t\t\t\t\t\t\tpublisher.publishRfid(tagStr);\n\t\t\t\t\t\t\tpublisher.publishMotor(tagStr);\n\t\t\t\t\t\t\t//Print statements to the console\n\t\t\t\t\t\t\tSystem.out.println(\"VALID TAG/USER\");\n\t\t\t\t\t\t\tSystem.out.println(\"Room3 - DOOR OPEN\");\n\t\t\t\t\t\t\t// Seting the sensor name(tag), sensorvalue and user id for the valid tag/user)\n\t\t\t\t\t\t\tRFID.setSensorname(\"1600ee15e9\");// Setting valid sensorname (tag)\n\t\t\t\t\t\t\tRFID.setSensorvalue(\"Room1, Door open\");// Setting the valid sensor value\n\t\t\t\t\t\t\tRFID.setUserid(\"16038287\");// Setting valid user id\n\t\t\t\t\t\t\t// Converting the data to json format\n\t\t\t\t\t\t\tRFIDJSON = gson.toJson(RFID);\n\t\t\t\t\t\t\t// Sending the data to the server\n\t\t\t\t\t\t\tsendToServer(RFIDJSON);\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t// inserting rfid data to the database and printing message out onto the console\n\t\t\t\t\t\t\tSystem.out.println(\"Success rrfid data have been added to the database!\"); // printing success message\n\t\t\t\t\t\t\t// Creating variable for gson\n\t\t\t\t\t\t\t// Declaring gson object\n\t\t\t\t\t\t\t// Json is data format which would express data objects consisting of attribute value pairs. \n\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\t// Creating string for the json bject and then converting it to json format\n\t\t\t\t\t\t\tString allRFIDDataJson = gson.toJson(RFIDJSON);\n\n\n\t\t\t\t\t\t\t// Print all rfid data in json format\n\t\t\t\t\t\t\tSystem.out.println(allRFIDDataJson);\n\t\t\t\t\t\t\tSystem.out.println(\"RFID data successfully in json format!\"); // printing success message\n\n\t\t\t\t\t\t} // close if statement to check the tag string\n\n\t\t\t\t\t\t// Otherwise fail and print out invalid rfid tag to the console.\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Print message, if it's the correct tag\n\t\t\t\t\t\t\tSystem.out.println(\"Tag read: DOOR NOT OPEN: \" + tagStr);\n\n\t\t\t\t\t\t\t//Print statements to the console\n\t\t\t\t\t\t\tSystem.out.println(\"INVALID TAG/USER\");\n\t\t\t\t\t\t\tSystem.out.println(\"Room2 - DOOR NOT OPEN\");// CHANGE rfid log..!!!!!\n\t\t\t\t\t\t\t// Seting the sensor name(tag), sensorvalue and user id for the invalid tag/user)\n\t\t\t\t\t\t\tRFID.setSensorname(\"4d004a9afa\");// Setting invalid sensorname (tag)\n\t\t\t\t\t\t\tRFID.setSensorvalue(\"Room2-DOOR NOT OPEN\");// Setting the invalid sensor value\n\t\t\t\t\t\t\tRFID.setUserid(\"16038287\");// Setting valid user id for the invalid user which has been used\n\t\t\t\t\t\t\t// Converting the data to json format\n\t\t\t\t\t\t\tRFIDJSON = gson.toJson(RFID);\n\t\t\t\t\t\t\t// Sending the data to the server\n\t\t\t\t\t\t\tsendToServer(RFIDJSON);\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t// inserting rfid data to the database and printing message out onto the console\n\t\t\t\t\t\t\tSystem.out.println(\"Success rrfid data have been added to the database!\"); // printing success message\n\t\t\t\t\t\t\t// Creating variable for gson\n\t\t\t\t\t\t\t// Declaring gson object\n\t\t\t\t\t\t\t// Json is data format which would express data objects consisting of attribute value pairs. \n\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\t// Creating string for the json bject and then converting it to json format\n\t\t\t\t\t\t\tString allRFIDDataJson = gson.toJson(RFIDJSON);\n\n\n\t\t\t\t\t\t\t// Print all rfid data in json format\n\t\t\t\t\t\t\tSystem.out.println(allRFIDDataJson);\n\t\t\t\t\t\t\tSystem.out.println(\"RFID data successfully in json format!\"); // printing success message\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (MqttException mqtte) {\n\t\t\t\t\t\tmqtte.printStackTrace();\n\t\t\t\t\t} // Close catch mqtt exception\n\t\t\t\t}",
"public void b(Activity activity, Bundle bundle, IUiListener iUiListener) {\n String str;\n String str2;\n String appId;\n String openId;\n Intent intent;\n int size;\n int i;\n Exception e;\n String str3 = \"\";\n f.c(\"openSDK_LOG.QzonePublish\", \"doPublishToQzone() --start\");\n StringBuffer stringBuffer = new StringBuffer(\"mqqapi://qzone/publish?src_type=app&version=1&file_type=news\");\n ArrayList<String> stringArrayList = bundle.getStringArrayList(\"imageUrl\");\n String string = bundle.getString(\"summary\");\n int i2 = bundle.getInt(\"req_type\", 3);\n String string2 = bundle.getString(\"appName\");\n String string3 = bundle.getString(\"videoPath\");\n int i3 = bundle.getInt(\"videoDuration\");\n long j = bundle.getLong(\"videoSize\");\n try {\n Bundle bundle2 = bundle.getBundle(\"extMap\");\n if (bundle2 != null) {\n Set<String> keySet = bundle2.keySet();\n JSONObject jSONObject = new JSONObject();\n for (String str4 : keySet) {\n if (!TextUtils.isEmpty(bundle2.getString(str4))) {\n str = str3;\n try {\n jSONObject.put(str4, bundle2.getString(str4));\n } catch (Exception e2) {\n e = e2;\n f.b(\"openSDK_LOG.QzonePublish\", \"publishToQzone() --error parse extmap\", e);\n str2 = str;\n appId = this.b.getAppId();\n openId = this.b.getOpenId();\n f.a(\"openSDK_LOG.QzonePublish\", \"openId:\" + openId);\n StringBuffer stringBuffer2 = new StringBuffer();\n size = stringArrayList.size();\n i = 0;\n while (i < size) {\n }\n stringBuffer.append(\"&image_url=\" + Base64.encodeToString(j.i(stringBuffer2.toString()), 2));\n str = \"7\";\n if (4 == i2) {\n }\n if (!TextUtils.isEmpty(string)) {\n }\n if (!TextUtils.isEmpty(appId)) {\n }\n if (!TextUtils.isEmpty(string2)) {\n }\n if (!j.e(openId)) {\n }\n if (!TextUtils.isEmpty(str2)) {\n }\n stringBuffer.append(\"&req_type=\" + Base64.encodeToString(j.i(String.valueOf(i2)), 2));\n f.a(\"openSDK_LOG.QzonePublish\", \"doPublishToQzone, url: \" + stringBuffer.toString());\n a.a(e.a(), this.b, \"requireApi\", \"shareToNativeQQ\");\n intent = new Intent(\"android.intent.action.VIEW\");\n intent.setData(Uri.parse(stringBuffer.toString()));\n intent.putExtra(\"pkg_name\", activity.getPackageName());\n if (!a(intent)) {\n }\n f.c(\"openSDK_LOG\", \"doPublishToQzone() --end\");\n }\n } else {\n str = str3;\n }\n str3 = str;\n }\n str = str3;\n if (jSONObject.length() > 0) {\n str2 = jSONObject.toString();\n appId = this.b.getAppId();\n openId = this.b.getOpenId();\n f.a(\"openSDK_LOG.QzonePublish\", \"openId:\" + openId);\n if (3 == i2 && stringArrayList != null) {\n StringBuffer stringBuffer2 = new StringBuffer();\n size = stringArrayList.size();\n i = 0;\n while (i < size) {\n stringBuffer2.append(URLEncoder.encode(stringArrayList.get(i)));\n if (i != size - 1) {\n stringBuffer2.append(\";\");\n }\n i++;\n stringArrayList = stringArrayList;\n }\n stringBuffer.append(\"&image_url=\" + Base64.encodeToString(j.i(stringBuffer2.toString()), 2));\n str = \"7\";\n }\n if (4 == i2) {\n stringBuffer.append(\"&videoPath=\" + Base64.encodeToString(j.i(string3), 2));\n stringBuffer.append(\"&videoDuration=\" + Base64.encodeToString(j.i(String.valueOf(i3)), 2));\n stringBuffer.append(\"&videoSize=\" + Base64.encodeToString(j.i(String.valueOf(j)), 2));\n str = \"8\";\n }\n if (!TextUtils.isEmpty(string)) {\n stringBuffer.append(\"&description=\" + Base64.encodeToString(j.i(string), 2));\n }\n if (!TextUtils.isEmpty(appId)) {\n stringBuffer.append(\"&share_id=\" + appId);\n }\n if (!TextUtils.isEmpty(string2)) {\n stringBuffer.append(\"&app_name=\" + Base64.encodeToString(j.i(string2), 2));\n }\n if (!j.e(openId)) {\n stringBuffer.append(\"&open_id=\" + Base64.encodeToString(j.i(openId), 2));\n }\n if (!TextUtils.isEmpty(str2)) {\n stringBuffer.append(\"&share_qzone_ext_str=\" + Base64.encodeToString(j.i(str2), 2));\n }\n stringBuffer.append(\"&req_type=\" + Base64.encodeToString(j.i(String.valueOf(i2)), 2));\n f.a(\"openSDK_LOG.QzonePublish\", \"doPublishToQzone, url: \" + stringBuffer.toString());\n a.a(e.a(), this.b, \"requireApi\", \"shareToNativeQQ\");\n intent = new Intent(\"android.intent.action.VIEW\");\n intent.setData(Uri.parse(stringBuffer.toString()));\n intent.putExtra(\"pkg_name\", activity.getPackageName());\n if (!a(intent)) {\n a(activity, 10104, intent, false);\n d.a().a(0, \"SHARE_CHECK_SDK\", \"1000\", this.b.getAppId(), String.valueOf(4), Long.valueOf(SystemClock.elapsedRealtime()), 0, 1, \"hasActivityForIntent success\");\n d.a().a(this.b.getOpenId(), this.b.getAppId(), \"ANDROIDQQ.SHARETOQZ.XX\", \"11\", \"3\", \"1\", str, \"0\", \"1\", \"0\");\n } else {\n f.e(\"openSDK_LOG.QzonePublish\", \"doPublishToQzone() target activity not found\");\n d.a().a(1, \"SHARE_CHECK_SDK\", \"1000\", this.b.getAppId(), String.valueOf(4), Long.valueOf(SystemClock.elapsedRealtime()), 0, 1, \"hasActivityForIntent fail\");\n d.a().a(this.b.getOpenId(), this.b.getAppId(), \"ANDROIDQQ.SHARETOQZ.XX\", \"11\", \"3\", \"1\", str, \"0\", \"1\", \"0\");\n }\n f.c(\"openSDK_LOG\", \"doPublishToQzone() --end\");\n }\n } else {\n str = str3;\n }\n } catch (Exception e3) {\n e = e3;\n str = str3;\n f.b(\"openSDK_LOG.QzonePublish\", \"publishToQzone() --error parse extmap\", e);\n str2 = str;\n appId = this.b.getAppId();\n openId = this.b.getOpenId();\n f.a(\"openSDK_LOG.QzonePublish\", \"openId:\" + openId);\n StringBuffer stringBuffer2 = new StringBuffer();\n size = stringArrayList.size();\n i = 0;\n while (i < size) {\n }\n stringBuffer.append(\"&image_url=\" + Base64.encodeToString(j.i(stringBuffer2.toString()), 2));\n str = \"7\";\n if (4 == i2) {\n }\n if (!TextUtils.isEmpty(string)) {\n }\n if (!TextUtils.isEmpty(appId)) {\n }\n if (!TextUtils.isEmpty(string2)) {\n }\n if (!j.e(openId)) {\n }\n if (!TextUtils.isEmpty(str2)) {\n }\n stringBuffer.append(\"&req_type=\" + Base64.encodeToString(j.i(String.valueOf(i2)), 2));\n f.a(\"openSDK_LOG.QzonePublish\", \"doPublishToQzone, url: \" + stringBuffer.toString());\n a.a(e.a(), this.b, \"requireApi\", \"shareToNativeQQ\");\n intent = new Intent(\"android.intent.action.VIEW\");\n intent.setData(Uri.parse(stringBuffer.toString()));\n intent.putExtra(\"pkg_name\", activity.getPackageName());\n if (!a(intent)) {\n }\n f.c(\"openSDK_LOG\", \"doPublishToQzone() --end\");\n }\n str2 = str;\n appId = this.b.getAppId();\n openId = this.b.getOpenId();\n f.a(\"openSDK_LOG.QzonePublish\", \"openId:\" + openId);\n StringBuffer stringBuffer2 = new StringBuffer();\n size = stringArrayList.size();\n i = 0;\n while (i < size) {\n }\n stringBuffer.append(\"&image_url=\" + Base64.encodeToString(j.i(stringBuffer2.toString()), 2));\n str = \"7\";\n if (4 == i2) {\n }\n if (!TextUtils.isEmpty(string)) {\n }\n if (!TextUtils.isEmpty(appId)) {\n }\n if (!TextUtils.isEmpty(string2)) {\n }\n if (!j.e(openId)) {\n }\n if (!TextUtils.isEmpty(str2)) {\n }\n stringBuffer.append(\"&req_type=\" + Base64.encodeToString(j.i(String.valueOf(i2)), 2));\n f.a(\"openSDK_LOG.QzonePublish\", \"doPublishToQzone, url: \" + stringBuffer.toString());\n a.a(e.a(), this.b, \"requireApi\", \"shareToNativeQQ\");\n intent = new Intent(\"android.intent.action.VIEW\");\n intent.setData(Uri.parse(stringBuffer.toString()));\n intent.putExtra(\"pkg_name\", activity.getPackageName());\n if (!a(intent)) {\n }\n f.c(\"openSDK_LOG\", \"doPublishToQzone() --end\");\n }",
"public interface TrackGPListerner {\n public void onTrackSuccess(ReferData referData);\n public void onTrackFailed();\n}",
"void pushOk(PushConnection pushConnection);",
"public interface BridgeEventHandler {\n\n void onMounted();\n\n void onPress(ReadableMap parameters);\n\n void shareTitle(ReadableMap parameters);\n\n void shareUrl(ReadableMap parameters);\n\n void onScrub(ReadableMap percentage);\n\n void onDiscoveryRow(ReadableMap parameters);\n\n void onLanguageSelected(ReadableMap parameters);\n\n void handleTouchStart(ReadableMap parameters);\n\n void handleTouchMove(ReadableMap parameters);\n\n void handleTouchEnd(ReadableMap parameters);\n\n void onAudioTrackSelected(ReadableMap parameters);\n}",
"public boolean beaconEvent(ByteBuffer beaconInfo);",
"private void createEvents()\r\n\t{\r\n\t\teventsCount.add(new Event(RequestMethod.PUT, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.GET, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.POST, 0));\r\n\t}",
"public interface Constant {\n\n String ACCESSIBILITY_SERVICE = \"github.hellocsl.smartmonitor/github.hellocsl.smartmonitor.VideoAccessibilityService\";\n\n String QQ_PKG = \"com.tencent.mobileqq\";\n\n String QQ_NUMBER = \"929371293\";\n\n String DIALER = \"com.google.android.dialer\";\n\n String MONITOR_CMD_VIDEO = \"monitor_cmd_video\";\n\n String MONITOR_TAG = \"WaterMonitor\";\n\n String MONITOR_CMD_RESET = \"110\";\n\n String MEIZU_IN_CALL_PKG = \"com.android.incallui\";\n\n //NEXUS 5\n String N5_MODEL = \"Nexus 5\";\n\n //MEIZU\n String MX_MODEL = \"mx\";\n\n\n}",
"void pushNotConnected(JsonObject payload);",
"@Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getApplicationContext(),\n error.getMessage(), Toast.LENGTH_SHORT).show();\n\n }",
"public ContainerRegistryImagePushedEventData() {}",
"@Override\n public void publish(Object event) {\n System.out.println(\"Sending Event\");\n\n List<Hub> hubList = hubFacade.findAll();\n Iterator<Hub> it = hubList.iterator();\n while (it.hasNext()) {\n Hub hub = it.next();\n restEventPublisher.publish(hub, event);\n\n\n //Thread.currentThread().sleep(1000);\n }\n System.out.println(\"Sending Event After\");\n }",
"public void beforeSendingeGainChatRequest();",
"public interface XEventCode {\n\n public static final int EVENT_MAINMENU = R.id.id_main_menu;\n\n public static int SMS_CODE_EVENT = R.id.ev_sms; //短信验证码\n public static int EVENT_MENU_SELECT = R.id.menu_select; // 测试页面类型选择\n public static int EVENT_USER_LOGIN = R.id.login_back;\n public static int EVENT_CITY_ALL = R.id.city_all;\n int EVENT_RUNCODE = R.id.event_runcode;\n int EVENT_SWIP_CALENAR = R.id.event_swip_cal;\n int ASYN_CALENAR = R.id.syn_cal;\n int EVENT_AUTH_CODE = R.id.evevnt_auth_code;\n int HTTP_AUTH_WECHAT = R.id.auth_wechat;\n int HTTP_USER_AOUTH = R.id.user_aouth;\n\n public static int HTTP_GET_ACCESS_TOKEN = R.id.get_atoken;\n public static int HTTP_USER_LOGIN = R.id.user_login;\n public static int HTTP_USER_SIGNOUT = R.id.user_signout;\n public static int HTTP_USER_REG = R.id.user_reg;\n public static int HTTP_USER_REG2 = R.id.user_reg2;\n public static int HTTP_USER_INFO = R.id.user_info;\n public static int HTTP_USER_UPDATE_PUSH = R.id.user_update_push;\n public static int HTTP_USER_EDIT = R.id.user_edit;\n public static int HTTP_USER_FINDPWD = R.id.user_findpwd;\n public static int HTTP_MARRY_DAY_EDIT = R.id.marry_day_edit;\n\n public static int HTTP_MARRY_ADDPROCESS = R.id.marry_addprocess;\n public static int HTTP_MARRY_QUERYALLPRO = R.id.marry_allprocess;\n public static int HTTP_MARRY_DELONEPRO = R.id.marry_deloneprocess;\n public static int HTTP_GIFTS_QUERYALL = R.id.gifts_queryall;\n public static int HTTP_GIFTS_ADDONE = R.id.gifts_addone;\n public static int HTTP_GIFTS_DELONE = R.id.gifts_delone;\n int HTTP_PCHLIST_ALL = R.id.pchlist_all;\n int HTTP_PCHLIST_ADD = R.id.pchlist_add;\n int HTTP_PCHLIST_DEL = R.id.pchlist_del;\n\n int HTTP_NEWS_DETAIL = R.id.news_detail;\n\n int HTTP_TASK_USERADDLIST = R.id.task_useraddlist;\n int HTTP_TASK_USERADD = R.id.task_useradd;\n int HTTP_TASK_USERDEL = R.id.task_userdel;\n int HTTP_TASK_USEREDIT = R.id.task_useredit;\n int HTTP_TASK_USERCOM = R.id.task_usercom;\n int HTTP_TASK_MY = R.id.task_my;\n int HTTP_SPEECH_ADD = R.id.speech_add;\n int HTTP_SPEECH_DEL = R.id.speech_del;\n int HTTP_SPEECH_LIST = R.id.speech_list;\n\n int HTTP_BUDGET_ALL = R.id.budget_all;\n int HTTP_BUDGET_GET = R.id.budget_get;\n int HTTP_BUDGET_EDIT = R.id.budget_edit;\n int HTTP_BUDGET_COMPUTE = R.id.budget_compute;\n\n int HTTP_FORTUNE_FIND = R.id.fortune_find;\n\n int HTTP_CARD_SAVE = R.id.card_save;\n int HTTP_CARD_INFO = R.id.card_info;\n int CARD_GETINFO = R.id.card_getinfo;\n\n int HTTP_GUESTLIST_ALL = R.id.guestlist_all;\n int HTTP_GUESTLIST_ADD = R.id.guestlist_add;\n int HTTP_GUESTLIST_DEL = R.id.guestlist_del;\n\n int HTTP_PRODUCT_CATE = R.id.product_cate;\n int HTTP_PRODUCT_BYTYPE = R.id.product_bytype;\n int HTTP_PRODUCT_DETAIL = R.id.product_detail;\n int HTTP_PRODUCT_COMMENT = R.id.product_comment;\n int HTTP_PRODUCT_FAVORITE = R.id.product_favorite;\n int HTTP_PRODUCT_FINDCOLLECT = R.id.product_findfavorite;\n int HTTP_PRODUCT_FINDCOMMENT = R.id.product_findcomment;\n\n int HTTP_TOPIC_ADD_EDIT = R.id.topic_addedit;\n int HTTP_TOPIC_BEST = R.id.topic_best;\n int HTTP_TOPIC_LATEST = R.id.topic_latest;\n int HTTP_TOPIC_INFO = R.id.topic_info;\n int HTTP_TOPIC_COLLECT = R.id.topic_collect;\n int HTTP_TOPIC_DELCOLLECT = R.id.topic_delcollect;\n int HTTP_TOPIC_COMMENT = R.id.topic_comment;\n int HTTP_TOPIC_COMMENT_LIST = R.id.topic_comment_list;\n\n int HTTP_PHASES_ALL = R.id.phases_all;\n\n int HTTP_TAGS_INPHASE = R.id.tags_inphase;\n int HTTP_TAGS_ADDONE = R.id.tags_addone;\n\n int HTTP_TOPIC_MYALL = R.id.topic_myall;\n int HTTP_TOPIC_MYCOLLECT = R.id.topic_mycollect;\n\n\n int HTTP_HOME_PAGE = R.id.home_page;\n\n int HTTP_SHOP_LIST = R.id.shop_list;\n int HTTP_SHOP_INFO = R.id.shop_info;\n int HTTP_SHOP_PACKAGE = R.id.shop_package;\n int HTTP_SHOP_FOLLOW = R.id.shop_follow;\n int HTTP_SHOP_DIS_FOLLOW = R.id.shop_dis_follow;\n int HTTP_SHOP_DEMO = R.id.shop_demo;\n int HTTP_SHOP_AD_LIST = R.id.shop_ad_list;\n int HTTP_SHOP_PACKAGE_INFO = R.id.shop_package_info;\n int HTTP_SHOP_DEMO_INFO = R.id.shop_demo_info;\n int HTTP_SHOP_MY_COLLECT = R.id.shop_my_collect;\n\n int HTTP_CITY_COUNTY = R.id.city_county;\n int HTTP_APPOINTMENT = R.id.shop_appointment;\n\n int HTTP_SHOP_COMMENT_LIST = R.id.shop_comment_list;\n int HTTP_SHOP_COMMENT_ADD = R.id.shop_comment_add;\n\n\n int HTTP_CHECK_VERSION = R.id.check_version;\n\n}",
"public static void main(String args[]) {\n BezirkMiddleware.initialize();\n Bezirk bezirk = BezirkMiddleware.registerZirk(\"Hello World Zirk\");\n\n //Create a new event and publish it\n\n\n\n }",
"public void onFlight() {\r\n }",
"public interface OnConnectListener {\n void onSuccess(AWSIotDevice device);\n\n void onFail();\n\n}",
"private void sendNotification() {\n }",
"public interface IEndpointsListener {\n void onJokeTold(String joke);\n}",
"private void logCallMade(String number, String leadId) {\n\n final HashMap<String, String> params = new HashMap<>();\n\n params.put(Constants.SHARE_SOURCE, Constants.CATEGORY_SELLER_LEADS);\n\n params.put(Constants.SHARE_TYPE, ShareType.CALL.name());\n params.put(Constants.MOBILE_NUM, number);\n // params.put(Constants.CAR_ID, carId);\n params.put(Constants.LEAD_ID_KEY, leadId);\n params.put(Constants.METHOD_LABEL, Constants.SENT_CARS_METHOD);\n\n RetrofitRequest.shareCarsRequest(mContext, params, new Callback<GeneralResponse>() {\n @Override\n public void success(GeneralResponse generalResponse, retrofit.client.Response response) {\n }\n\n @Override\n public void failure(RetrofitError error) {\n if (error.getCause() instanceof UnknownHostException) {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.ACTION_TAP,\n Constants.LABEL_NO_INTERNET,\n 0);\n\n } else {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_IO_ERROR,\n error.getMessage(),\n 0);\n }\n }\n });\n /* ShareCarsRequest shareCarsRequest = new ShareCarsRequest(mContext,\n Request.Method.POST,\n Constants.getWebServiceURL(mContext),\n params,\n new Response.Listener<GeneralResponse>() {\n @Override\n public void onResponse(GeneralResponse response) {\n\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error.getCause() instanceof UnknownHostException) {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.ACTION_TAP,\n Constants.LABEL_NO_INTERNET,\n 0);\n\n } else {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_IO_ERROR,\n error.getMessage(),\n 0);\n }\n\n }\n });\n\n ApplicationController.getInstance().addToRequestQueue(shareCarsRequest);*/\n\n }",
"com.google.speech.logs.timeline.InputEvent.Event getEvent();",
"public interface IWXAPI {\n boolean handleIntent(Intent intent, IWXAPIEventHandler iWXAPIEventHandler);\n\n boolean registerApp(String str);\n\n boolean sendReq(BaseReq baseReq);\n}",
"void addingGlobalData() {\n\n }",
"protected static void pushLog(GDsendObj _pushAction) {\n\t\tint i = 0;\n for (i = 0; i < Pool.size(); i++) {\n if ( Pool.get(i).action == _pushAction.action) {\n if (Pool.get(i).action == \"custom\" && ((GDcustomLog)Pool.get(i).value).key == ((GDcustomLog)_pushAction.value).key) {\n ((GDcustomLog)Pool.get(i).value).value++;\n } else {\n Pool.get(i).value = _pushAction.value;\n }\n break;\n }\n }\n if (i == Pool.size()) Pool.add(_pushAction);\n return; \t\t\n\t}",
"void notify(String data, PushType type);"
] | [
"0.6184982",
"0.5738616",
"0.5546473",
"0.5546473",
"0.5520843",
"0.54978114",
"0.5380214",
"0.5335049",
"0.5323172",
"0.5312438",
"0.5280938",
"0.5258079",
"0.52555025",
"0.5239534",
"0.51957357",
"0.5173001",
"0.516579",
"0.5149144",
"0.51482856",
"0.51423895",
"0.5135265",
"0.51200324",
"0.5103945",
"0.51027876",
"0.5069316",
"0.50545174",
"0.5048388",
"0.5043526",
"0.50419694",
"0.5040006",
"0.5039755",
"0.5037356",
"0.5030446",
"0.50292224",
"0.50264376",
"0.50264376",
"0.5018261",
"0.5010189",
"0.5009529",
"0.49955133",
"0.49948272",
"0.49799746",
"0.49685895",
"0.4954152",
"0.49509278",
"0.494482",
"0.49379554",
"0.49368104",
"0.4927184",
"0.49258897",
"0.4916859",
"0.49140745",
"0.49105483",
"0.49016976",
"0.49007913",
"0.48928627",
"0.4873265",
"0.4862506",
"0.4860739",
"0.48602784",
"0.48556805",
"0.4854314",
"0.48535398",
"0.48488048",
"0.48480925",
"0.4846262",
"0.4845853",
"0.48385653",
"0.48305234",
"0.48305026",
"0.48225263",
"0.48225263",
"0.48225263",
"0.48225263",
"0.4818112",
"0.48154324",
"0.48151857",
"0.48113874",
"0.48098424",
"0.48085958",
"0.48076746",
"0.48062417",
"0.48020563",
"0.48009834",
"0.479821",
"0.4797691",
"0.47966555",
"0.47883135",
"0.47850254",
"0.47799313",
"0.4772019",
"0.47705698",
"0.4770177",
"0.47676402",
"0.47662863",
"0.47631615",
"0.47512662",
"0.4750268",
"0.47492117",
"0.4745419",
"0.4742795"
] | 0.0 | -1 |
What happends why listener receives a click | @Override
public void onClick(View v) {
switch (v.getId())
{
case R.id.bRegister: //Register button clicked
String username = etUsername.getText().toString();
String email = etEmail.getText().toString();
String password = etPassword.getText().toString();
User user = new User(username, email, password);
registerUser(user); //Calling the registration activity
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ClickListener(){\n System.out.println(\"I've been attached\");\n }",
"@Override\n\t\tpublic void onClick(View v) {\n\t\t\tlistener(v);\n\n\t\t}",
"public void onClicked();",
"private void assertStreamItemViewHasOnClickListener() {\n assertFalse(\"listener should have not been invoked yet\", mListener.clicked);\n mView.performClick();\n assertTrue(\"listener should have been invoked\", mListener.clicked);\n }",
"@Override\n\tpublic void onClick(View v) {\n\t\tlistener.onClick(v);\n\t}",
"public void click() {\n\t\tif(this.buttonListener != null) {\n\t\t\tthis.buttonListener.onClicked();\n\t\t}\n\t}",
"public static void clickEvent() {\n counterClicks += 1;\n }",
"@Override\n public void mouseClicked(MouseEvent e) {\n clicked = true;\n }",
"@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmButtonListener.onButtonListener();\n\t\t\t}",
"@Override\n\tprotected void OnClick() {\n\t\t\n\t}",
"@Override\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\r\n\t}",
"@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t}",
"@Override\n public void mouseClicked(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n System.out.println(\" Mouse: Click \" + boton ); \n }",
"@Override\r\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t}",
"@Override\n\tpublic void onClick(ClickEvent arg0) {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tllistenBtnset();\n\t\t\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\r\n\t\t}",
"public interface ClickListener {\n\n public void Onclick(int pos);\n}",
"@Override\r\n public void mouseClicked(MouseEvent e) {\n }",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\n\tpublic void mouseClicked (MouseEvent e) {\n\t}",
"@Override\r\n public void mouseClicked(MouseEvent event) {\r\n System.out.println(\"clicked\");\r\n\r\n }",
"public void mouseClicked(MouseEvent e) \t{\n\t\t\t\t\r\n\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void addListener(ClickListener listener);",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.i(\"click\", \"ll_click\");\n\t\t\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e)\n\t{\n\n\t}",
"public void act() \n {\n checkClicked();\n }",
"@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\n\t}",
"public void mouseClicked(MouseEvent e) {\r\n\t\t// nothing\r\n\t}",
"@Override\r\n public void mouseClicked(MouseEvent e) {\n }",
"@Override\n public void onClick(View v) {\n if (listener!=null){\n int position = getAdapterPosition();\n /*I: making sure that the position is valid*/\n if (position!=RecyclerView.NO_POSITION){\n listener.onItemClick(position);\n }\n }\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\treceive();\r\n\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t}",
"public void mouseClicked(MouseEvent e) {\n\t}",
"public void mouseClicked(MouseEvent e) {\n\t}",
"@Override\r\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\treceive();\r\n\t\t\t\t}",
"@Override\r\n public void mouseClicked(MouseEvent e) { }",
"@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\n\n\t\t}",
"@Override\r\n public void mouseClicked(MouseEvent e) {}",
"@Override\n public void onClick() {\n System.out.println(\"Button has been JUST clicked\");\n }",
"public void mouseClicked(MouseEvent e) {}",
"public void mouseClicked(MouseEvent e) {}",
"public void mouseClicked(MouseEvent e) {}",
"public void mouseClicked(MouseEvent e) {}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(View v) {\n\t\t\n\t}",
"@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }"
] | [
"0.7196371",
"0.71776503",
"0.7054671",
"0.69351345",
"0.68766093",
"0.6791085",
"0.67683405",
"0.675258",
"0.6735415",
"0.6698541",
"0.66727525",
"0.66455597",
"0.6591304",
"0.65756935",
"0.6563104",
"0.6563104",
"0.6563104",
"0.654559",
"0.65415823",
"0.6540156",
"0.6533549",
"0.6530264",
"0.6521711",
"0.6517308",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6507312",
"0.6503951",
"0.64950836",
"0.64929795",
"0.6492633",
"0.64900523",
"0.64880055",
"0.64880055",
"0.64880055",
"0.64880055",
"0.64880055",
"0.64880055",
"0.64880055",
"0.64880055",
"0.6482448",
"0.64819014",
"0.6481363",
"0.64699966",
"0.64699966",
"0.64699966",
"0.64655024",
"0.64645374",
"0.6464153",
"0.6464153",
"0.6464153",
"0.6464153",
"0.6464153",
"0.6464153",
"0.6459007",
"0.6458489",
"0.6456332",
"0.6456332",
"0.6446865",
"0.6446865",
"0.64468384",
"0.64405143",
"0.64380485",
"0.64357394",
"0.6431076",
"0.6431076",
"0.6431076",
"0.6428729",
"0.6425879",
"0.6423366",
"0.6422814",
"0.64207923",
"0.64206636",
"0.64206636",
"0.64206636",
"0.64206636",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6418118",
"0.6414352"
] | 0.0 | -1 |
Store the user data in background | @Override
public void done(User returnedUser) {
startActivity(new Intent(Register.this, Login.class));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void run() {\n P2PContext.getInstance().createShardProfilePreferences();\n String userId = P2PContext.getLoggedInUser();\n String deviceId = P2PContext.getCurrentDevice();\n DBSyncManager.getInstance(that).upsertUser(userId, deviceId, \"Photo Message\");\n that.manager.notifyUI(\"Added user -> \" + userId, \" --------> \", LOG_TYPE);\n that.manager.startBluetoothBased();\n }",
"private void persistData() {\n mSharedPref.storeLastScreen(SCREEN_NAME);\n }",
"public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }",
"private void loadUserData() {\n\t\tuserData = new UserData();\n }",
"private void saveUserData() {\n mSharedPreferences.clearProfile();\n mSharedPreferences.setName(mName);\n mSharedPreferences.setEmail(mEmail);\n mSharedPreferences.setGender(mGender);\n mSharedPreferences.setPassWord(mPassword);\n mSharedPreferences.setYearGroup(mYearGroup);\n mSharedPreferences.setPhone(mPhone);\n mSharedPreferences.setMajor(mMajor);\n\n mImageView.buildDrawingCache();\n Bitmap bmap = mImageView.getDrawingCache();\n try {\n FileOutputStream fos = openFileOutput(getString(R.string.profile_photo_file_name), MODE_PRIVATE);\n bmap.compress(Bitmap.CompressFormat.PNG, 100, fos);\n fos.flush();\n fos.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n\n if (entryPoint.getStringExtra(SOURCE).equals(MainActivity.ACTIVITY_NAME)) {\n Toast.makeText(RegisterActivity.this,\n R.string.edit_success, Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(RegisterActivity.this,\n R.string.register_success, Toast.LENGTH_SHORT).show();\n }\n\n }",
"public void storeGlucose(){\n String HBA1C = hba1c.getText().toString();\n String date = glucose_date.getText().toString();\n String medication = String.valueOf(medication_spinner.getSelectedItem());\n UserData userdata = new UserData(\"rjgalleg\", date, glucose_number, tag, medication, HBA1C);\n Log.i(\"Authorize\", \"date: \"+date +\", medication: \"+medication+\", HBA1C: \"+HBA1C+\", glucose number: \"+glucose_number +\"tag: \"+tag);\n ServerRequests serverRequests = new ServerRequests(this);\n serverRequests.storeUserGlucoseInBackground(userdata, new GetUserCallback() {\n @Override\n public void done(User returnedUser) {\n startActivity(new Intent(GlucoseActivity.this, GlucoseActivity.class));\n }\n });\n\n\n }",
"public void dataAddAppInstance() {\n String endScore = Integer.toString(pointsScore);\r\n String mLongestWordScore = Integer.toString(longestWordScore);\r\n String date = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.US).format(new Date());\r\n\r\n // creating a new user for the database\r\n User newUser = new User(userNameString, endScore, date, longestWord, mLongestWordScore); // creating a new user object to hold that data\r\n\r\n // add new node in database\r\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\r\n mDatabase.child(token).child(userNameString).setValue(newUser);\r\n\r\n // get this device's all time high score for comparison\r\n int highScore = getInt();\r\n\r\n // if high score is achieved, send notification\r\n if ( pointsScore > highScore) {\r\n setInt(\"high score\", pointsScore);\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n sendMessageToNews();\r\n }\r\n }).start();\r\n }\r\n }",
"void saveUserData(User user);",
"private void storeUser(User user){\n // instantiate SharedPreferences\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n // stores each attribute in a variable, if attribute is null the editor will clear the corresponding value.\n editor.putString(KEY_USER, user.toJSONString());\n // commit changes\n editor.apply();\n }",
"private static void storeActivation(Context context) {\n\t\t//securely store in shared preference\n\t\tSharedPreferences secureSettings = new SecurePreferences(context);\n\t\tString account = UserEmailFetcher.getEmail(context);\n\n\t\t//update preference\n\t\tSharedPreferences.Editor secureEdit = secureSettings.edit();\n\t\tsecureEdit.putBoolean(account + \"_paid\", true);\n\t\tsecureEdit.apply();\n\t}",
"private void sendUserData() {\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\n DatabaseReference myref = firebaseDatabase.getReference(Objects.requireNonNull(firebaseAuth.getUid()));\n UserProfile userProfile = new UserProfile(name, email, post, 0);\n myref.setValue(userProfile);\n }",
"private void saveData() {\n\n SharedPreferences sharedPreferences=getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n\n editor.putString(\"name\",name.getText().toString());\n editor.putString(\"regnum\",regnum.getText().toString());\n editor.putInt(\"count\", count);\n editor.apply();\n\n }",
"public void saveData() {\n try {\n JsonWriter jw = new JsonWriter(openFileOutput(DATA_FILE, Context.MODE_PRIVATE));\n jw.write(user);\n jw.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\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}",
"@Override\n public void onResume() {\n super.onResume();\n setUserInfo(((MyApplication) getApplication()).getUser());\n\n UpdateUserInfo.getInstance().addOnUpdateUserInfo(\"my\", this);\n }",
"void enableBackgroundData();",
"public void store() {\n session=(HttpSession)getPageContext().getSession();\n session.setAttribute(\"remoteUser\", getRemoteUser());\n session.setAttribute(\"authCode\", getAuthCode());\n }",
"private void storeLoggedInUser(LoginResponse response){\n preferenceManager = SharedPreferenceManager.getInstance(this);\n preferenceManager.StoreAccountDetails(response.getAccount());\n\n if(response.getCamera() != null){\n preferenceManager.StoreDeviceDetails(response.getCamera());\n }\n registerDeviceToken();\n }",
"public void storeUserPrefs(User user) {\n //start writing (open the file)\n SharedPreferences.Editor editor = prefs.edit();\n //put the data\n Gson gson = new Gson();\n String json = gson.toJson(user);\n editor.putString(USER_PREFS, json);\n //close the file\n editor.apply();\n }",
"private void setUserData(){\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 }",
"protected void proccesValues() {\n Users user = new Users();\n user.setName(bean.getName());\n user.setSurname(bean.getSurname());\n user.setUsername(bean.getUsername());\n StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();\n String encryptedPassword = passwordEncryptor.encryptPassword(bean.getPassword());\n user.setPassword(encryptedPassword);\n \n usersService.persist(user);\n Notification.show(msgs.getMessage(INFO_REGISTERED), Notification.Type.ERROR_MESSAGE);\n resetValues();\n UI.getCurrent().getNavigator().navigateTo(ViewLogin.NAME);\n }",
"@Override\n protected void onPause() {\n\t\tsuper.onPause();\n//\t\tmUser.put(Constants.FRIENDS, mFriends);\n//\t\tmUser.saveInBackground();\n }",
"public void setUser(UserData data) {\n user = data;\n }",
"public void getStarted(View view)\n {\n\n if(ParseUser.getCurrentUser().getUsername()!=null)\n {\n\n\n ParseUser.getCurrentUser().put(\"riderOrdriver\",currentUserIs);\n\n\n ParseUser.getCurrentUser().saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if(e == null)\n {\n Log.i(\"userSaved as \",ParseUser.getCurrentUser().getUsername()); //save in the object of that user the type\n }else\n {\n Log.i(\"error in saving\",e.toString());\n\n }\n\n }\n });\n\n activityStartType(currentUserIs);\n }\n\n }",
"private void getGredentialsFromMemoryAndSetUser()\n\t{\n\t SharedPreferences settings = getSharedPreferences(LOGIN_CREDENTIALS, 0);\n\t String username = settings.getString(\"username\", null);\n\t String password = settings.getString(\"password\", null);\n\t \n\t //Set credentials to CouponsManager.\n\t CouponsManager.getInstance().setUser(new User(username, password));\n\t \n\t}",
"public void saveData(){\n SharedPreferences sharedPreferences = getSharedPreferences(\"SHARED_PREFS\",MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"email_pref\",email.getText().toString());\n editor.putString(\"password_pref\",uPassword.getText().toString());\n editor.apply();\n }",
"@Override\r\n public void onStop() {\r\n super.onStop();\r\n UserDataManager.getManager().saveUserData(this);\r\n }",
"public void writeUserInro(String name,String key){\n SharedPreferences user = context.getSharedPreferences(\"user_info\",0);\n SharedPreferences.Editor mydata = user.edit();\n mydata.putString(\"uName\" ,name);\n mydata.putString(\"uKey\",key);\n mydata.commit();\n }",
"public void storeLogUser(UserModel user)\n {\n\n // convert User object into String\n //convert to string using gson\n String stringUser= gson.toJson(user);\n\n //creating an Editor object ; to Edit(write into the file)\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n //storing the VoiceMArkerModel object\n editor.putString(\"LogUser\",stringUser);\n\n //apply the changes\n editor.apply();\n }",
"private void loadDataAsync() {\n\n FirebaseHandler.userRef.child(\"preferences\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n\n Dictionary<String,String> preferences = null;\n\n for (DataSnapshot child : dataSnapshot.getChildren()) {\n preferences.put(child.getKey()+\"\",child.getValue()+\"\");\n }\n\n if(listener != null) {\n Log.d(\"fuck\", dataSnapshot+\"\");\n listener.onPreferencesRetrieved(preferences);\n }\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\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 }",
"private void saveData() {\n // Save data to ReminderData class\n reminderData.setMinutes(timePicker.getMinute());\n reminderData.setDataHours(timePicker.getHour());\n reminderData.setNotificationText(reminderText.getText().toString());\n reminderData.saveDataToSharedPreferences();\n }",
"private void saveUserData() {\n\t\ttry {\n\t\t\t// if the user did not change default profile\n\t\t\t// picture, mProfilePictureArray will be null.\n\t\t\tif (bytePhoto != null) {\n\t\t\t\tFileOutputStream fos = openFileOutput(\n\t\t\t\t\t\tgetString(R.string.profile_photo_file_name),\n\t\t\t\t\t\tMODE_PRIVATE);\n\t\t\t\tfos.write(bytePhoto);\n\t\t\t\tfos.flush();\n\t\t\t\tfos.close();\n\t\t\t}\n\t\t} catch (Exception ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\tdb = new PersonalEventDbHelper(this);\n\t\t// Getting the shared preferences editor\n\t\tString mKey = getString(R.string.preference_name);\n\t\tSharedPreferences mPrefs = getSharedPreferences(mKey, MODE_PRIVATE);\n\n\t\tSharedPreferences.Editor mEditor = mPrefs.edit();\n\t\tmEditor.clear();\n\n\t\tFriend user = new Friend();\n\t\tArrayList<Event> list = new ArrayList<Event>();\n\n\t\t// Save name information\n\t\tmKey = getString(R.string.name_field);\n\t\tString mValue = (String) ((EditText) findViewById(R.id.editName))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\t\tname = mValue;\n\t\tuser.setName(mValue);\n\n\t\t// PARSE\n\t\tGlobals.USER = name;\n\n\t\t// Save class information\n\t\tmKey = getString(R.string.class_field);\n\t\tmValue = (String) ((EditText) findViewById(R.id.editClass)).getText()\n\t\t\t\t.toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\tuser.setClassYear(mValue);\n\n\t\t// Save major information\n\t\tmKey = getString(R.string.major_field);\n\t\tmValue = (String) ((EditText) findViewById(R.id.editMajor)).getText()\n\t\t\t\t.toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Save course information\n\t\t// Course 1\n\t\t// Course name\n\t\tmKey = \"Course #1 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse1name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\tEvent event1 = new Event();\n\t\tevent1.setEventName(mValue);\n\t\tevent1.setColor(Globals.USER_COLOR);\n\t\t// Course time period\n\t\tmKey = \"Course #1 Time\";\n\t\tSpinner mSpinnerSelection = (Spinner) findViewById(R.id.course1TimeSpinner);\n\t\tint selectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\n\t\tevent1.setClassPeriod(selectedCourse);\n\n\t\t// Course location\n\t\tmKey = \"Course #1 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse1loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course 2\n\t\tevent1.setEventLocation(mValue);\n\t\tevent1.setOwnerName(name);\n\t\t// if (!Globals.classList.contains(event1.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event1.getString(\"objectId\"));\n\t\t// System.out.println(event1.getString(\"objectId\"));\n\t\tevent1.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY1, event1.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(0));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event1.getClassPeriod());\n\t\t// event.setEventLocation(event1.getEventLocation());\n\t\t// event.setEventName(event1.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\n\t\tdb.insertEntry(event1);\n\t\tlist.add(event1);\n\n\t\t// Course 2\n\n\t\t// Save course information\n\t\t// Course name\n\t\tmKey = \"Course #2 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse2name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course time period\n\t\tmKey = \"Course #2 Time\";\n\t\tmSpinnerSelection = (Spinner) findViewById(R.id.course2TimeSpinner);\n\t\tselectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\t\tEvent event2 = new Event();\n\t\tevent2.setEventName(mValue);\n\t\tevent2.setColor(Globals.USER_COLOR);\n\n\t\t// Course time period\n\t\tmKey = \"Course #2 Time\";\n\t\tSpinner mSpinnerSelection2 = (Spinner) findViewById(R.id.course2TimeSpinner);\n\t\tint selectedCourse2 = mSpinnerSelection2.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse2);\n\n\t\tevent2.setClassPeriod(selectedCourse2);\n\n\t\t// Course location\n\t\tmKey = \"Course #2 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse2loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course 3\n\t\tevent2.setEventLocation(mValue);\n\t\tevent2.setOwnerName(name);\n\t\t// System.out.println(event2.getString(\"objectId\"));\n\t\t// if (!Globals.classList.contains(event2.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event2.getString(\"objectId\"));\n\t\tevent2.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY2, event2.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(1));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event2.getClassPeriod());\n\t\t// event.setEventLocation(event2.getEventLocation());\n\t\t// event.setEventName(event2.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\t\tdb.insertEntry(event2);\n\t\tlist.add(event2);\n\n\t\t// Course 3\n\n\t\t// Save course information\n\t\t// Course name\n\t\tmKey = \"Course #3 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse3name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course time period\n\t\tmKey = \"Course #3 Time\";\n\t\tmSpinnerSelection = (Spinner) findViewById(R.id.course3TimeSpinner);\n\t\tselectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\n\t\tEvent event3 = new Event();\n\t\tevent3.setEventName(mValue);\n\t\tevent3.setColor(Globals.USER_COLOR);\n\n\t\t// Course time period\n\t\tmKey = \"Course #3 Time\";\n\t\tSpinner mSpinnerSelection3 = (Spinner) findViewById(R.id.course3TimeSpinner);\n\t\tint selectedCourse3 = mSpinnerSelection3.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse3);\n\n\t\tevent3.setClassPeriod(selectedCourse3);\n\n\t\t// Course location\n\t\tmKey = \"Course #3 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse3loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course 4\n\t\tevent3.setEventLocation(mValue);\n\t\tevent3.setOwnerName(name);\n\t\t// if (!Globals.classList.contains(event3.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event3.getString(\"objectId\"));\n\t\tevent3.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY3, event3.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(2));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event3.getClassPeriod());\n\t\t// event.setEventLocation(event3.getEventLocation());\n\t\t// event.setEventName(event3.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\t\tdb.insertEntry(event3);\n\t\tlist.add(event3);\n\t\t// Course 4\n\n\t\t// Save course information\n\t\t// Course name\n\t\tmKey = \"Course #4 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse4name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course time period\n\t\tmKey = \"Course #4 Time\";\n\t\tmSpinnerSelection = (Spinner) findViewById(R.id.course4TimeSpinner);\n\t\tselectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\t\tEvent event4 = new Event();\n\t\tevent4.setEventName(mValue);\n\t\tevent4.setColor(Globals.USER_COLOR);\n\n\t\t// Course time period\n\t\tmKey = \"Course #4 Time\";\n\t\tSpinner mSpinnerSelection4 = (Spinner) findViewById(R.id.course4TimeSpinner);\n\t\tint selectedCourse4 = mSpinnerSelection4.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse4);\n\n\t\tevent4.setClassPeriod(selectedCourse4);\n\n\t\t// Course location\n\t\tmKey = \"Course #4 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse4loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\tevent4.setEventLocation(mValue);\n\n\t\tlist.add(event4);\n\t\tevent4.setOwnerName(name);\n\t\t// if (!Globals.classList.contains(event4.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event4.getString(\"objectId\"));\n\t\tevent4.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY4, event4.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(3));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event4.getClassPeriod());\n\t\t// event.setEventLocation(event4.getEventLocation());\n\t\t// event.setEventName(event4.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\t\tdb.insertEntry(event4);\n\t\tuser.setSchedule(list);\n\n\t\t// Call method to get all entries from the datastore!!!\n\n\t\t// EventDbHelper db = new EventDbHelper(this);\n\t\t// try {\n\t\t// db.insertEntry(user);\n\t\t// } catch (IOException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\n\t\t// Commit all the changes into the shared preference\n\t\tmEditor.commit();\n\t\tGlobals.isProfileSet = true;\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 }",
"public void storeSession(@NonNull User user){\n //calls storeUser method with mUser as argument\n storeUser(user);\n // validate input data\n checkSessionState();\n }",
"private UserInterface() {\r\n\t\tif (yesOrNo(\"Look for saved data and use it?\")) {\r\n\t\t\tretrieve();\r\n\t\t} else {\r\n\t\t\tstore = Store.instance();\r\n\t\t}\r\n\t}",
"private void getUser(){\n user = new User();\n SharedPreferences preferences = getSharedPreferences(\"account\", MODE_PRIVATE);\n user.setId(preferences.getInt(\"id\", 0));\n user.setPhone(preferences.getString(\"phone\", \"\"));\n user.setType(preferences.getInt(\"type\",0));\n }",
"public void saveSelfInfo()\n\t{\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\thelper.addSelfInfo(uid, myApp.getSelfInfoList());\n\t\t\t}\n\t\t}).start();\n\t}",
"public static void userData(Context context)\r\n\t{\r\n\t\ttry {\r\n\t\t\tcontext.json(((Account)context.sessionAttribute(\"currentUser\")));\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t}\r\n\t}",
"public void saveUserData(UserData userData){\n userDataRepository.save(userData);\n }",
"public void doDataAddToDb() {\n String endScore = Integer.toString(pointsScore);\r\n String mLongestWordScore = Integer.toString(longestWordScore);\r\n String date = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.US).format(new Date());\r\n Log.e(TAG, \"date\" + date);\r\n\r\n // creating a new user for the database\r\n User newUser = new User(userNameString, endScore, date, longestWord, mLongestWordScore); // creating a new user object to hold that data\r\n\r\n // add new node in database\r\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\r\n mDatabase.child(\"users\").child(userNameString).setValue(newUser);\r\n\r\n Log.e(TAG, \"pointsScore\" + pointsScore);\r\n Log.e(TAG, \"highestScore\" + highestScore);\r\n\r\n\r\n // if high score is achieved, send notification\r\n if (highestScore > pointsScore) {\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n sendMessageToNews();\r\n }\r\n }).start();\r\n }\r\n }",
"public Object getUserData () {\n\t\treturn userData;\n\t}",
"private void setUsersScore() {\n BackgroundDataBaseTasks tempTask =new BackgroundDataBaseTasks(this);\n tempTask.delegate = this;\n SharedPreferences userInfo = getSharedPreferences(\"user_info\",\n Context.MODE_PRIVATE);\n String id = (userInfo.getString(\"id\", \"\"));\n String SQL = \"WHERE id=\"+ id + \";\";\n\n String method = \"friend\";\n try {\n tempTask.execute(method, SQL).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onResume(){\n super.onResume();\n new Database();\n Auth.addAuthListener();\n fetchData();\n updateUIMode();\n }",
"public void loadAllUserData(){\n\n }",
"public void updateCurrentTrempitUser() {\n\n // create the trempituser object\n TrempitUser currentUser = new TrempitUser();\n currentUser.setFullName(Profile.getCurrentProfile().getName());\n currentUser.setId(Long.valueOf(Profile.getCurrentProfile().getId()));\n\n // update the global variable so all activities can access the user\n globalState.setCurrentUser(currentUser);\n\n // insert the user to the server\n insertTrempitUserToServer(currentUser);\n\n Toast.makeText(this, \"logged in to facebook:\" + globalState.getCurrentUser().getFullName(), Toast.LENGTH_LONG).show();\n }",
"public Object getUserData()\n\t{\n\t\treturn userData;\n\t}",
"public void run() {\n User user = userFactory.create();\n queue.add(user);\n }",
"@Override\r\n\tpublic void initData() {\n\t\tThreadUtils.getSinglePool().execute(new Runnable() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t\tIntent intent =null;\r\n\t\t\t\t\tChainApplication application = (ChainApplication) getApplicationContext();\r\n\t\t\t\t\tUser user = application.getUserInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(StringUtils.isEmpty(user.getUser_Name()) && StringUtils.isEmpty(HttpManager.getInstance().getToken(HttpManager.KEY_TOKEN))){\r\n\t\t\t\t\t\tintent = new Intent(getActivity(),LoginActivity.class);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tintent = new Intent(getActivity(), MainActivity.class);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tfinish();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\n public void run() {\n\n String userid = SharedPreferenceStore.getValue(getApplicationContext(), \"Userid\", \"\");\n String userCompId = SharedPreferenceStore.getValue(getApplicationContext(), \"client_comp_id\", \"\");\n String loginType = SharedPreferenceStore.getValue(getApplicationContext(), \"Type\",\"\");\n SharedPreferenceStore.getValue(getApplicationContext(), \"LoadingPoint\", \"\");\n String country_code = SharedPreferenceStore.getValue(getApplicationContext(), \"country_code\",\"AE\"); // May Put Here default\n String currency_code = SharedPreferenceStore.getValue(getApplicationContext(),\"currency_code\",\"AED\"); // May put here Default\n appGlobal.userType = loginType ;\n appGlobal.userId = userid;\n appGlobal.userCompId = userCompId;\n appGlobal.currency_code = currency_code ;\n appGlobal.country_code = country_code ;\n\n /*******************/\n if(userid.isEmpty()) {\n Intent intent = new Intent(SplashActivity.this, HomeContainer.class); // LoginContainer.class\n startActivity(intent);\n finish();\n }\n else\n {\n Intent intent = new Intent(getApplicationContext(), HomeContainer.class);\n startActivity(intent);\n finish();\n }\n\n }",
"public Object getUserData() {\n return userData;\n }",
"public void saveUserSettings() {\n\t}",
"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}",
"void storeEvents()\n {\n this.storedPresences = new ArrayList<Presence>();\n this.storeEvents = true;\n }",
"private void saveRegistration() {\n if (hasCorrectDetails()) {\n if (entryPoint != null) {\n switch (entryPoint.getStringExtra(SOURCE)) {\n case MainActivity.ACTIVITY_NAME:\n // Check any change in password? We know mPassword is never null since it's required\n if (!mPassword.equals(mSharedPreferences.getPassWord())) {\n saveUserData();\n startActivity(new Intent(RegisterActivity.this,\n LoginActivity.class)\n .putExtra(SOURCE, RegisterActivity.ACTIVITY_NAME));\n finish();\n } else {\n saveUserData();\n finish();\n }\n break;\n case LoginActivity.ACTIVITY_NAME:\n saveUserData();\n finish();\n break;\n }\n }\n\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 User() {\n this.prefs = Gdx.app.getPreferences(\"prefs\");\n\n this.noWalls = prefs.getBoolean(\"noWalls\");\n this.noGrid = prefs.getBoolean(\"noGrid\");\n }",
"private void saveUserDetails()\r\n\t{\r\n\t\t/*\r\n\t\t * Retrieve content from form\r\n\t\t */\r\n\t\tContentValues reg = new ContentValues();\r\n\r\n\t\treg.put(UserdataDBAdapter.C_NAME, txtName.getText().toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_USER_EMAIL, txtUserEmail.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_RECIPIENT_EMAIL, lblAddressee.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\tif (rdbKilo.isChecked())\r\n\t\t{\r\n\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 1);\t// , true\r\n\t\t}\r\n\t\telse\r\n\t\t\tif (rdbPound.isChecked())\r\n\t\t\t{\r\n\t\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 0);\t// , false\r\n\t\t\t}\r\n\r\n\t\t/*\r\n\t\t * Save content into database source:\r\n\t\t * http://stackoverflow.com/questions/\r\n\t\t * 9212574/calling-activity-methods-from-fragment\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tActivity parent = getActivity();\r\n\r\n\t\t\tif (parent instanceof LauncherActivity)\r\n\t\t\t{\r\n\t\t\t\tif (arguments == null)\r\n\t\t\t\t{\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().insert(\r\n\t\t\t\t\t\t\treg);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treg.put(UserdataDBAdapter.C_ID, arguments.getInt(\"userId\"));\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().update(\r\n\t\t\t\t\t\t\treg);\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).queryForUserDetails();\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(parent, \"User details successfully stored\",\r\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\tLog.i(this.getClass().toString(), e.getMessage());\r\n\t\t}\r\n\t}",
"@Override\n\t\tprotected void onSuccess(final Context context) {\n\t\t\tfinal SharedPreferences settings = getSharedPreferences(Constants.PREFS_NAME, 0);\n\t\t\tfinal SharedPreferences.Editor editor = settings.edit();\n\t\t\teditor.putString(\"email\", email);\n\t\t\teditor.putString(\"password\", user.getPassword());\n\t\t\teditor.commit();\n\n\t\t\tlaunchMain();\n\t\t\tfinish();\n\t\t}",
"public void setUserData (Object userData) {\n\t\tthis.userData = userData;\n\t}",
"public void setUserData(Object userData) {\n this.userData = userData;\n }",
"public void saveCurrentUserState(){\n\t\tCurrentUserState currState = new CurrentUserState();\n\t\tcurrState.setBatchOutput(batchState.getBatchOutput());\n\t\tcurrState.setCurrFields(batchState.getFields());\n\t\tcurrState.setCurrProject(batchState.getProject());\n\t\tcurrState.setCurrScale(display.getScale());\n\t\tcurrState.setCurrSelectedCell(batchState.getSelectedCell());\n\t\tcurrState.setErrorCells(batchState.getErrors());\n\t\t\n\t\tcurrState.setHighlight(display.isToggleOn());\n\t\tcurrState.setInverted(display.isInverted());\n\t\t\n\t\tcurrState.setCurrWindowPos(getLocationOnScreen());\n\t\tcurrState.setCurrWindowSize(getSize());\n\t\t\n\t\tcurrState.setHorizontalDiv(bottomPanel.getDividerLocation());\n\t\tcurrState.setVertivalDiv(centerPanel.getDividerLocation());\n\t\t\n\t\tcurrState.setOriginX(display.getW_originX());\n\t\tcurrState.setOriginY(display.getW_originY());\n\t\t\n\t\tcurrState.setValues(batchState.getValues());\n\t\t\n\t\t//put to xstream\n\t\tXStream xstream = new XStream(new DomDriver());\n\t\ttry {\n\t\t\n\t\t\txstream.toXML(currState, new FileOutputStream(new File(info.getUsername() + \".xml\")));\n\t\t\tSystem.out.println(\"current state is saved!\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"file not found/ couldn't go to xml\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void Register(String mailSTR, String passwordSTR, String fNameSTR, String lNameSTR, String citySTR, String phoneNumberSTR) throws Exception {\n mAuth.createUserWithEmailAndPassword(mailSTR, passwordSTR)\n .addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n final Map<String, Object>[] dataToSave = new Map[]{new HashMap<String, Object>()};\n dataToSave[0].put(constants.FIRST_NAME, fNameSTR);\n dataToSave[0].put(constants.SEC_NAME, lNameSTR);\n dataToSave[0].put(constants.CITY, citySTR);\n dataToSave[0].put(constants.EMAIL, mailSTR);\n dataToSave[0].put(constants.PHONE, phoneNumberSTR);\n dataToSave[0].put(constants.VOLUNTEER, \"false\");\n\n\n FirebaseDatabase.getInstance().getReference(constants.DOC_REF_USERS)\n //here we creating users folder in real time data baes , getting uid from user and storing the data in folder named by id\n .child(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getUid())\n .setValue(dataToSave[0]).addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(register2.this,\n R.string.register_toast_success, Toast.LENGTH_LONG).show();\n {//adds all new data for newely registered clients\n dayTime dtDEF = new dayTime(0, 0, 23, 59);//default for first time\n Gson gson = new Gson();\n SharedPreferences sp = getSharedPreferences(constants.SHARED_PREFS,\n Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n String dayDEF = gson.toJson(dtDEF);\n Map<String, String> docData = new HashMap<>();\n for (String day : constants.daysNames) {\n docData.put(day, dayDEF);\n editor.putString(day, dayDEF);\n }\n docData.put(constants.rangeChoice, \"\" + 10.0);\n editor.putFloat(constants.rangeChoice, (float) 10.0);\n\n docData.put(constants.SHARED_PREFS_LOCATION, constants.SET_CITY);\n editor.putString(constants.SHARED_PREFS_LOCATION, constants.SET_CITY);\n\n FirebaseAuth userIdentifier = FirebaseAuth.getInstance();\n String UID = userIdentifier.getCurrentUser().getUid();\n DocumentReference DRF = FirebaseFirestore.getInstance()\n .document(constants.DOC_REF_USERS+\"/\" + UID);\n final boolean[] success = {true};\n final Exception[] failToRet = new Exception[1];\n DRF.set(docData).addOnFailureListener(e -> {\n success[0] = false;\n failToRet[0] = e;\n });\n if (!success[0]) {\n // show/make log for case of failure\n }\n editor.apply();\n\n }\n }\n });\n\n\n }\n\n }).addOnFailureListener(e -> {\n try {\n throw new Exception(constants.FAILED_REGISTER);\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n\n }",
"public static void save(Context context,User user){\n try\n {\n\n FileOutputStream fileOutputStream = context.openFileOutput(\"UserData.dat\", Context.MODE_PRIVATE);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(user);\n objectOutputStream.close();\n fileOutputStream.close();\n\n }\n\n catch(IOException ex) {\n System.out.println(\"IOException is caught\");\n }\n }",
"public void onResume() {\n super.onResume();\n MainTask.GetInstance().SetUserCallBack(this);\n ResetData(false);\n Log.d(TAG, \"-----onResume-----\");\n }",
"public void setAuthentication(){\n SharedPreferences settings = mContext.getSharedPreferences(\"UserData\", Context.MODE_PRIVATE);\n SharedPreferences.Editor preferencesEditor = settings.edit();\n preferencesEditor.putString(\"userid\", mUserId);\n preferencesEditor.putString(\"areaid\", mAreaId);\n preferencesEditor.commit();\n }",
"@Override\n public Object getUserData() {\n return this.userData;\n }",
"private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.requestFocus();\n return;\n }\n\n FirebaseUser user = mAuth.getCurrentUser();\n if (user != null) {\n if (isBname()) {\n updateName(user);\n }\n if (isBtitle()) {\n updateTitle(user);\n }\n }\n }",
"private void writeAccount() {\n SharedPreferences pref = getSharedPreferences(\"ACCOUNT\", Context.MODE_PRIVATE);\n SharedPreferences.Editor edt = pref.edit();\n\n edt.putString(\"email\", Me.getInstance().getEmail());\n edt.putString(\"password\", txtPassword.getText().toString().trim());\n\n edt.commit();\n }",
"private void loadUser() {\n File dataFile = new File(getFilesDir().getPath() + \"/\" + DATA_FILE);\n\n if(dataFile.exists()) {\n loadData();\n } else { // First time CigCount is launched\n user = new User();\n }\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 }",
"private void Register(String mailSTR, String passwordSTR, String fNameSTR, String lNameSTR, String citySTR, String phoneNumberSTR) throws Exception {\n mAuth.createUserWithEmailAndPassword(mailSTR, passwordSTR)\n .addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n final Map<String, Object>[] dataToSave = new Map[]{new HashMap<String, Object>()};\n dataToSave[0].put(constants.FIRST_NAME, fNameSTR);\n dataToSave[0].put(constants.SEC_NAME, lNameSTR);\n dataToSave[0].put(constants.CITY, citySTR);\n dataToSave[0].put(constants.EMAIL, mailSTR);\n dataToSave[0].put(constants.PHONE, phoneNumberSTR);\n\n\n\n FirebaseDatabase.getInstance().getReference(constants.DOC_REF_USERS)\n //here we creating users folder in real time data baes , getting uid from user and storing the data in folder named by id\n .child(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getUid())\n .setValue(dataToSave[0]).addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(register3.this,\n R.string.register_toast_success, Toast.LENGTH_LONG).show();\n {//adds all new data for newely registered clients\n dayTime dtDEF = new dayTime(0, 0, 23, 59);//default for first time\n Gson gson = new Gson();\n SharedPreferences sp = getSharedPreferences(constants.SHARED_PREFS,\n Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n String dayDEF = gson.toJson(dtDEF);\n Map<String, String> docData = new HashMap<>();\n for (String day : constants.daysNames) {\n docData.put(day, dayDEF);\n editor.putString(day, dayDEF);\n }\n docData.put(constants.rangeChoice, \"\" + 10.0);\n editor.putFloat(constants.rangeChoice, (float) 10.0);\n\n docData.put(constants.SHARED_PREFS_LOCATION, constants.CITY);\n editor.putString(constants.SHARED_PREFS_LOCATION, constants.CITY);\n editor.putBoolean(\"sync\",true);\n FirebaseAuth userIdentifier = FirebaseAuth.getInstance();\n String UID = userIdentifier.getCurrentUser().getUid();\n DocumentReference DRF = FirebaseFirestore.getInstance()\n .document(constants.DOC_REF_USERS+\"/\" + UID);\n final boolean[] success = {true};\n final Exception[] failToRet = new Exception[1];\n DRF.set(docData).addOnFailureListener(e -> {\n success[0] = false;\n failToRet[0] = e;\n });\n if (!success[0]) {\n // show/make log for case of failure\n }\n editor.apply();\n\n }\n }\n });\n\n\n }\n\n }).addOnFailureListener(e -> {\n try {\n throw new Exception(constants.FAILED_REGISTER);\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n\n }",
"private void saveData() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n Gson gson = new Gson();\n String jsonItem = gson.toJson(reminderItems);\n editor.putString(REMINDER_ITEM, jsonItem);\n editor.apply();\n }",
"@Override\n public void run() {\n User user = new UserSessionDataSource(MainActivity.this).SelectTableUser();\n Grua grua = new GruaSessionDataSource(MainActivity.this).SelectTableUser();\n if(user.getId() == -1)\n return;\n Toast.makeText(getApplicationContext(),\"Entrando en modo desconectado\", Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(MainActivity.this, InitActivity.class);\n intent.putExtra(Register.JSON_USER, user.toJSON());\n intent.putExtra(Register.JSON_GRUA, grua.toJSON());\n startActivity(intent);\n }",
"private void saveToFileData() {//Context context) {\n try {\n FileOutputStream fileOutputStream = openFileOutput(fileNameData, Context.MODE_PRIVATE);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(Data.userData);\n objectOutputStream.close();\n fileOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void onButtonClick()\n {\n txtSign.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n startActivity(new Intent(RegisterUser.this,LogInActivity.class));\n finish();\n }\n });\n\n txtProceed.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n databaseBackgroundTask = new DatabaseBackgroundTask(RegisterUser.this);\n userInformation();//method\n\n if(internetIsOn.isOnline())\n {\n if(checkUserInformation(name,userName,email,password))\n {\n Map<String,String> map = new HashMap<>();\n map.put(\"userName\",userName);\n GetDataFromServer fromServer = new GetDataFromServer(RegisterUser.this,onAsyncTaskInterface,getResources().getString(R.string.nameExist),map);\n fromServer.sendJsonRequest();\n /*try {\n POST_DATA = URLEncoder.encode(\"userName\",\"UTF-8\")+\"=\"+URLEncoder.encode(userName,\"UTF-8\");\n databaseBackgroundTask.setOnResultListener(onAsyncTaskInterface);\n databaseBackgroundTask.execute(getResources().getString(R.string.nameExist),POST_DATA);\n }catch(UnsupportedEncodingException e) {\n e.printStackTrace();\n }*/\n }\n }else dialogClass.noInternetConnection();\n }\n });\n }",
"private void saveSettings(){\n // get current user from shared preferences\n currentUser = getUserFromSharedPreferences();\n\n final User newUser = currentUser;\n Log.i(\"currentUser name\",currentUser.getUsername());\n String username = ((EditText)findViewById(R.id.usernameET)).getText().toString();\n\n if(\"\".equals(username)||username==null){\n Toast.makeText(getApplicationContext(),\"Failed to save, user name cannot be empty\",Toast.LENGTH_LONG).show();\n return;\n }\n\n newUser.setUsername(username);\n\n // update user data in firebase\n Firebase.setAndroidContext(this);\n Firebase myFirebaseRef = new Firebase(Config.FIREBASE_URL);\n\n // set value and add completion listener\n myFirebaseRef.child(\"users\").child(newUser.getFireUserNodeId()).setValue(newUser,new Firebase.CompletionListener() {\n @Override\n public void onComplete(FirebaseError firebaseError, Firebase firebase) {\n if (firebaseError != null) {\n\n Toast.makeText(getApplicationContext(),\"Data could not be saved. \" + firebaseError.getMessage(),Toast.LENGTH_SHORT).show();\n } else {\n // if user info saved successfully, then save user image\n uploadPhoto();\n Toast.makeText(getApplicationContext(),\"User data saved successfully.\",Toast.LENGTH_SHORT).show();\n }\n }\n });\n\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 }",
"private void pushToHibernate(){\n DATA_API.saveUser(USER);\n }",
"private void retrieveAllUserData() {\n retrieveBasicUserInfo();\n retrieveUsersRecentMedia();\n retrieveUsersLikedMedia();\n }",
"public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}",
"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 }",
"public void store(String remoteUser) {\n setRemoteUser(remoteUser);\n setTimeToLiveSeconds(this.DEFAULT_TTL);\n store();\n }",
"private void userInformation()\n {\n name = eName.getText().toString();\n userName = eUserName.getText().toString();\n email = eEmail.getText().toString();\n password = ePassword.getText().toString();\n password = encryptionAlgo.encryptPass(password);//initialize new encrypt password\n address = eAddress.getText().toString();\n favouriteWord = eFavourite.getText().toString();\n }",
"public void requestUserData() {\r\n\t \tmText.setText(\"Fetching user name, profile pic...\");\r\n\t \tBundle params = new Bundle();\r\n\t \tparams.putString(\"fields\", \"name, picture\");\r\n\t \tUtility.mAsyncRunner.request(\"me\", params, new UserRequestListener());\r\n\t }",
"private void saveState() {\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n // Store our count..\n editor.putInt(\"count\", this._tally);\n\n // Save changes\n editor.commit();\n }",
"private void masuk(){\n Preferences.setLoggedInUser(getBaseContext(),Preferences.getRegisteredUser(getBaseContext()));\n Preferences.setLoggedInStatus(getBaseContext(), true);\n startActivity(new Intent(getBaseContext(),MainActivity.class));\n finish();\n }",
"protected void storeCurrentValues() {\n }",
"public void persistLoginState(String email) {\n SharedPreferences sp = getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n editor.putString(SP_USERNAME, email);\n editor.apply();\n }",
"void setUserData(Object userData);",
"public void run()\r\n {\n invokeLater(new Runnable() \r\n {\r\n public void run()\r\n {\r\n _lblUser.setText(_userEdit.getText());\r\n }\r\n }); \r\n \r\n // Save at persistent store\r\n saveOptions(_userEdit.getText(), _passEdit.getText(), _freqEdit.getText());\r\n popScreen(SetupScreen.this);\r\n }",
"public void setUser(java.lang.String param){\r\n localUserTracker = true;\r\n \r\n this.localUser=param;\r\n \r\n\r\n }",
"public void setUser(java.lang.String param){\r\n localUserTracker = true;\r\n \r\n this.localUser=param;\r\n \r\n\r\n }",
"public void setUser(java.lang.String param){\r\n localUserTracker = true;\r\n \r\n this.localUser=param;\r\n \r\n\r\n }",
"private void saveInfoAndGotoMainAct(String uID) {\n\n User mUser = new User(\n acc_type_spinner.getSelectedItem().toString(),\n place_picker_field.getText().toString(),\n phone_number_field.getText().toString(),\n sex_spinner.getSelectedItem().toString(),\n user_name_text_field.getText().toString());\n\n mDatabase.child(\"Users\").child(uID).setValue(mUser)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n toastMsg(\"Cập nhật hồ sơ người dùng thành công!\");\n gotoMainAct();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n toastMsg(\"Cập nhật hồ sơ người dùng thất bại!\");\n }\n });\n\n if (mUser.getAcc_type().equals(\"Người dân\")) {\n mDatabase.child(\"uIDs\").push().setValue(uID);\n }\n\n }",
"protected void saveUser(Context context, String text){\n\n mSharedPreferences = context.getSharedPreferences(USER_DETAILS_PREFS_NAME, Context.MODE_PRIVATE);\n editor = mSharedPreferences.edit();\n\n editor.putString(USER_DETAILS_PREFS_KEY, text);\n\n editor.commit();\n }",
"private void submit(){\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tMyApp app = new MyApp();\n\t\t\t\tapp.user = mUser.getText().toString();\n\t\t\t\tapp.password = mPassword.getText().toString();\n\t\t\t\tMyDbHelper dbHelper = MyDbHelper.getInstance(getApplicationContext());\n\t\t\t\ttry {\n\t\t\t\t\tdbHelper.insert(MyDbHelper.TABLE_NAME, null, app.toContentValues());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally{\n\t\t\t\t\tdbHelper.close();\n\t\t\t\t\tdbHelper = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}).start();\n\t\t//finish self\n\t\tfinish();\n\t}",
"@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 synchronized void zzlx() {\n try {\n JSONObject jSONObject = new JSONObject();\n jSONObject.put(\"castSessionId\", this.zzTp);\n jSONObject.put(\"playerTokenMap\", new JSONObject(this.zzTn));\n this.zztB.edit().putString(\"save_data\", jSONObject.toString()).commit();\n } catch (JSONException e) {\n zzQW.zzf(\"Error while saving data: %s\", e.getMessage());\n }\n return;\n }",
"@Override\n public void onDataChange(@NotNull DataSnapshot dataSnapshot) {\n if (!dataSnapshot.exists()) {\n\n DatabaseReference databaseReference = FirebaseDatabase.getInstance()\n .getReference(DbPath.USERS)\n .child(facebookUser.getId());\n\n FirebaseUser firebaseUser = facebookUser.getAsFirebaseUser();\n\n\n databaseReference.setValue(firebaseUser).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n\n // Save user data on Shared Preferences\n saveUserDataOnSharedPreferences(facebookUser, applicationContext);\n setLoginState(true, applicationContext);\n\n if (mAppAuthListener != null)\n mAppAuthListener.onSuccess();\n }\n }\n });\n\n // Notification token\n\n SharedPreferences preferences = applicationContext.getSharedPreferences(Preferences.FILENAME, Context.MODE_PRIVATE);\n\n if(preferences.contains(Preferences.NOTIFICATIONS_TOKEN)){\n String token = preferences.getString(Preferences.NOTIFICATIONS_TOKEN, null);\n\n if(token != null){\n Map<String, String> map = new HashMap<>();\n map.put(\"token\", token);\n String userId = facebookUser.getId();\n FirebaseDatabase.getInstance().getReference(DbPath.NOTIFICATION_TOKENS)\n .child(userId).setValue(map);\n }\n }\n }\n // If user does exist on database\n else {\n saveUserDataOnSharedPreferences(facebookUser, applicationContext);\n setLoginState(true, applicationContext);\n\n if (mAppAuthListener != null)\n mAppAuthListener.onSuccess();\n }\n }"
] | [
"0.66294515",
"0.6505734",
"0.65045375",
"0.6395841",
"0.6358658",
"0.63127446",
"0.6285636",
"0.6278978",
"0.6276975",
"0.6191232",
"0.61815673",
"0.6159901",
"0.61505497",
"0.6149969",
"0.6147485",
"0.6143553",
"0.6131233",
"0.6099808",
"0.6082955",
"0.60776514",
"0.6072212",
"0.6046792",
"0.6046161",
"0.60422444",
"0.6018829",
"0.5999635",
"0.59696466",
"0.5951215",
"0.5939392",
"0.59240735",
"0.5920097",
"0.5910949",
"0.5904774",
"0.58763295",
"0.5848446",
"0.58431315",
"0.58336776",
"0.5829895",
"0.57798284",
"0.57658166",
"0.57626706",
"0.57397735",
"0.5735481",
"0.57327867",
"0.5722542",
"0.5709526",
"0.5708499",
"0.57050085",
"0.5703261",
"0.5700257",
"0.5684927",
"0.56819594",
"0.5681133",
"0.5668063",
"0.5664796",
"0.5661069",
"0.5655805",
"0.5655261",
"0.5653118",
"0.56479305",
"0.56460434",
"0.564353",
"0.5642967",
"0.5638391",
"0.56152093",
"0.56143993",
"0.5607874",
"0.5601983",
"0.55815333",
"0.55764776",
"0.5575836",
"0.5569461",
"0.55674726",
"0.5564464",
"0.5562973",
"0.55506325",
"0.55498505",
"0.55451024",
"0.5532205",
"0.55315167",
"0.55287015",
"0.55223",
"0.55215347",
"0.55173343",
"0.5512684",
"0.5511291",
"0.55098426",
"0.55022234",
"0.54805803",
"0.5480264",
"0.54789144",
"0.5475772",
"0.54748505",
"0.54748505",
"0.54748505",
"0.547263",
"0.5469852",
"0.54682356",
"0.5467067",
"0.5462868",
"0.5461186"
] | 0.0 | -1 |
Created by root on 11/25/16. | public interface listener_for_frag {
public void set_movie_model(movie_model s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"private static void cajas() {\n\t\t\n\t}",
"private void init() {\n\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"public void gored() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public void mo38117a() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"private void poetries() {\n\n\t}",
"private void m50366E() {\n }",
"public void mo4359a() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private void init() {\n\n\n\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public void mo6081a() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private void initialize() {\n\t\t\n\t}",
"static void feladat9() {\n\t}",
"protected boolean func_70814_o() { return true; }",
"@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 initialize() {\n\n \n }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n protected void init() {\n }",
"private void strin() {\n\n\t}",
"@Override\n public void init() {\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 anular() {\n\n\t}",
"@Override\r\n\tpublic void init() {}",
"static void feladat7() {\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"static void feladat4() {\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo21877s() {\n }",
"@Override\n public void init() {}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n void init() {\n }",
"protected void mo6255a() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"static void feladat6() {\n\t}",
"public void init() {\n\t\t\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void baocun() {\n\t\t\n\t}",
"public void mo12628c() {\n }",
"public void mo3376r() {\n }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"static void feladat5() {\n\t}",
"@Override\r\n\tprotected void processInit() {\n\r\n\t}",
"private void init() {\n }",
"public void mo55254a() {\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}"
] | [
"0.59261405",
"0.58557004",
"0.5848866",
"0.5835963",
"0.5827452",
"0.57890546",
"0.5757426",
"0.57439864",
"0.5743312",
"0.5738614",
"0.57041633",
"0.57041633",
"0.57041633",
"0.57041633",
"0.57041633",
"0.56810004",
"0.5651616",
"0.5635587",
"0.562948",
"0.5610937",
"0.5604139",
"0.5602682",
"0.5602682",
"0.5597488",
"0.5597488",
"0.5596138",
"0.5592471",
"0.5579647",
"0.5579473",
"0.5579473",
"0.5579002",
"0.55729145",
"0.5570575",
"0.5565355",
"0.55540025",
"0.55540025",
"0.55540025",
"0.5553653",
"0.55496657",
"0.5528679",
"0.55252415",
"0.55199915",
"0.5515615",
"0.55110145",
"0.55110145",
"0.55110145",
"0.55102587",
"0.5509854",
"0.5509854",
"0.5509854",
"0.55088323",
"0.5506822",
"0.5506307",
"0.5505511",
"0.5498257",
"0.54964006",
"0.54964006",
"0.54964006",
"0.54964006",
"0.54964006",
"0.54964006",
"0.54964006",
"0.5494373",
"0.54799116",
"0.5479615",
"0.5475349",
"0.5475349",
"0.5473991",
"0.54711646",
"0.546446",
"0.5453711",
"0.54524446",
"0.54519975",
"0.54513097",
"0.54483956",
"0.544246",
"0.54356074",
"0.54284114",
"0.54284114",
"0.54284114",
"0.54284114",
"0.54284114",
"0.54284114",
"0.54239154",
"0.5421336",
"0.54142153",
"0.5412663",
"0.5412663",
"0.54121816",
"0.5409418",
"0.54049706",
"0.54041535",
"0.5400029",
"0.53998095",
"0.53929466",
"0.5384327",
"0.53795666",
"0.5372603",
"0.5370925",
"0.53703684",
"0.5367328"
] | 0.0 | -1 |
create a new graph object | private static Graph fileToGraph(String fileName) throws IOException {
Graph graph = new Graph();
// line counter to help keep track of the first line in the array
// we will add those characters to a arrayList of characters
int lineCounter = 0;
ArrayList<Character> nodeArray = new ArrayList<>();
// check if its a existing file
if (new File(fileName).isFile()) {
Scanner scanner = new Scanner(new File(fileName));
// loop over each line in the file
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
String[] stringNums = line.trim().split("\\s+");
// System.out.println(Arrays.toString(stringNums));
if (lineCounter == 0) {
for (int i = 0; i < stringNums.length; i++) {
// add the character to the array list
nodeArray.add(stringNums[i].charAt(0));
// add the character to the graph
// creating a key based on the character
// and creating a node with the name of that same character
graph.addNode(stringNums[i].charAt(0));
}
} else {
// the first index is always going to be a character
Character nodeName = stringNums[0].charAt(0);
// we will get the node based on what character we are at
Node currentNode = graph.getNode(nodeName);
// loop over the array
for (int i = 1; i < stringNums.length; i++) {
// convert to an int
int weight = Integer.parseInt(stringNums[i]);
// create node by getting
Node destination = graph.getNode(nodeArray.get(i - 1));
// connect the destination node and weight to current node that we are at
if (weight != 0) {
currentNode.addEdge(destination, weight);
}
}
}
lineCounter++;
}
}
return graph;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Graph() {\n }",
"public GraphInfo(){}",
"public Graph() {\r\n\t\tinit();\r\n\t}",
"public PlainGraph createGraph() {\n PlainGraph graph = new PlainGraph(getUniqueGraphName(), GraphRole.RULE);\n graphNodeMap.put(graph, new HashMap<>());\n return graph;\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic AnalysisGraph createNewInstance() {\n\t\tAnalysisGraph graph = new AnalysisGraph();\n\t\tgraph.currentIndex = currentIndex;\n\t\t\n\t\tgraph.nodes = (HashMap<String, Node>) nodes.clone();\n\t\tgraph.nodeList = (ArrayList<Node>)((ArrayList<Node>) nodeList).clone();\n\t\tgraph.links = (ArrayList<Link>)((ArrayList<Link>) links).clone();\n\t\treturn graph;\n\t}",
"public static Graph<Vertex,Edge> createGraphObject()\n\t{\n\t\tGraph<Vertex,Edge> g = new DirectedSparseMultigraph<Vertex, Edge>();\n\t\treturn g;\n\t}",
"public Graphs() {\n graph = new HashMap<>();\n }",
"void createGraphForSingleLoad();",
"public static Graph makeMeAGraph(Set<Operation> operations, State init){\n Graph graph = new implementGraph(operations , init) ;\n return graph;\n\n\t //\t throw new NotImplementedException();\n }",
"public Graph() {\n\t\tdictionary=new HashMap<>();\n\t}",
"public Graph() {\r\n\t\tthis.matrix = new Matrix();\r\n\t\tthis.listVertex = new ArrayList<Vertex>();\r\n\t}",
"public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }",
"public Graph()\r\n\t{\r\n\t\tthis.adjacencyMap = new HashMap<String, HashMap<String,Integer>>();\r\n\t\tthis.dataMap = new HashMap<String,E>();\r\n\t}",
"@Override\n public Graph newInstance(int vertexesCount) {\n return new SimpleGraph();\n }",
"public Graph() {\n\t\ttowns = new HashSet<Town>();\n\t\troads = new HashSet<Road>();\n\t\tprevVertex = new HashMap<String, Town>();\n\t}",
"@SuppressWarnings(\"rawtypes\")\r\n\tpublic Graph() {\r\n \tthis.vertex = new HashMap<T, Vertex>();\r\n \tthis.edge = new HashMap<Integer, Edge>();\r\n }",
"public void buildGraph(){\n\t}",
"public Graph()\n\t{\n\t\tthis.map = new HashMap<Object, SinglyLinkedList>();\n\t}",
"Graph(){\n\t\taddNode();\n\t\tcurrNode=myNodes.get(0);\n\t}",
"Graph(){\n\t\tadjlist = new HashMap<String, Vertex>();\n\t\tvertices = 0;\n\t\tedges = 0;\n\t\tkeys = new ArrayList<String>();\n\t}",
"Vertex createVertex();",
"protected IWeightedGraph<GraphNode, WeightedEdge> createGraph() {\r\n\t\treturn createGraph(goapUnit.getGoalState());\r\n\t}",
"TripleGraph createTripleGraph();",
"void createGraphForDistributedSingleLoad();",
"public GraphWrapper() {\n\t\tthis.graph = new Graph<T,E>();\n\t}",
"public Population(Graph graph)\r\n/* 13: */ {\r\n/* 14:36 */ g = graph.cloneGraph();\r\n/* 15: */ }",
"public Graph(){//constructor\n //edgemap\n srcs=new LinkedList<>();\n maps=new LinkedList<>();\n chkIntegrity(\"edgemap\");\n \n nodes=new LinkedList<>();\n //m=new EdgeMap();\n }",
"public Graph(int numberOfVertices){\r\n this.numberOfVertices = numberOfVertices;\r\n this.adjacencyList = new TreeMap<>();\r\n }",
"public Graph()\n\t{\n\t\tthis.total_verts = null;\n\t\tthis.total_edges = null;\n\t\tnodes = new HashMap<String, Node>();\n\t}",
"protected GraphNode() {\n }",
"protected GraphNode() {\n }",
"GraphFactory getGraphFactory();",
"public static Graph instantiateAdjacencyMapGraph() {\r\n\t\treturn new AdjacencyMapGraph();\r\n\t}",
"public void constructGraph(){\r\n\t\tmyGraph = new Graph();\r\n\r\n\t\tfor(int i =0;i<=35;i++) {\r\n\t\t\tmyGraph.addVertex(allSpots[i]);\r\n\t\t}\r\n\r\n\t\tfor(int i =0;i<=35;i++) {\r\n\t\t\tint th = i;\r\n\t\t\twhile(th%6!=0) {\r\n\t\t\t\tth--;\r\n\t\t\t}\r\n\t\t\tfor(int h=th;h<=th+5;h++) {\r\n\t\t\t\tif(h!=i) {\r\n\t\t\t\t\tif(allSpots[i].equals(allSpots[h])) {\t\t\r\n\t\t\t\t\t\tmyGraph.addEdge(allSpots[i], allSpots[h]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tint tv=i;\r\n\t\t\twhile(tv-6>0) {\r\n\t\t\t\ttv=tv-6;\r\n\t\t\t}\r\n\t\t\tfor(int v=tv;v<36; v=v+6) {\r\n\t\t\t\tif(v!=i) {\r\n\t\t\t\t\tif(allSpots[i].equals(allSpots[v])) {\t\t\r\n\t\t\t\t\t\tmyGraph.addEdge(allSpots[i], allSpots[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\r\n\t\t//Add verticies that store the Spot objects\r\n\t\t//Add edges to connect spots that share a property along an orthogonal direction\r\n\r\n\t\t//This is the ONLY time it is ok to iterate the array.\r\n\t\t\r\n\t\t//myGraph.addVert(...);\r\n\t\t//myGraph.addEdge(...);\r\n\t}",
"private void createGraph() {\n \t\t\n \t\t// Check capacity\n \t\tCytoscape.ensureCapacity(nodes.size(), edges.size());\n \n \t\t// Extract nodes\n \t\tnodeIDMap = new OpenIntIntHashMap(nodes.size());\n \t\tginy_nodes = new IntArrayList(nodes.size());\n \t\t// OpenIntIntHashMap gml_id2order = new OpenIntIntHashMap(nodes.size());\n \n \t\tfinal HashMap gml_id2order = new HashMap(nodes.size());\n \n \t\tSet nodeNameSet = new HashSet(nodes.size());\n \n \t\tnodeMap = new HashMap(nodes.size());\n \n \t\t// Add All Nodes to Network\n \t\tfor (int idx = 0; idx < nodes.size(); idx++) {\n \t\t\t\n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(1,\n \t\t\t\t\t\tidx, nodes.size()));\n \t\t\t}\n \n \t\t\t// Get a node object (NOT a giny node. XGMML node!)\n \t\t\tfinal cytoscape.generated2.Node curNode = (cytoscape.generated2.Node) nodes\n \t\t\t\t\t.get(idx);\n \t\t\tfinal String nodeType = curNode.getName();\n \t\t\tfinal String label = (String) curNode.getLabel();\n \n \t\t\treadAttributes(label, curNode.getAtt(), NODE);\n \n \t\t\tnodeMap.put(curNode.getId(), label);\n \n \t\t\tif (nodeType != null) {\n \t\t\t\tif (nodeType.equals(\"metaNode\")) {\n \t\t\t\t\tfinal Iterator it = curNode.getAtt().iterator();\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tfinal Att curAttr = (Att) it.next();\n \t\t\t\t\t\tif (curAttr.getName().equals(\"metanodeChildren\")) {\n \t\t\t\t\t\t\tmetanodeMap.put(label, ((Graph) curAttr.getContent()\n \t\t\t\t\t\t\t\t\t.get(0)).getNodeOrEdge());\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (nodeNameSet.add(curNode.getId())) {\n \t\t\t\tfinal Node node = (Node) Cytoscape.getCyNode(label, true);\n \n \t\t\t\tginy_nodes.add(node.getRootGraphIndex());\n \t\t\t\tnodeIDMap.put(idx, node.getRootGraphIndex());\n \n \t\t\t\t// gml_id2order.put(Integer.parseInt(curNode.getId()), idx);\n \n \t\t\t\tgml_id2order.put(curNode.getId(), Integer.toString(idx));\n \n \t\t\t\t// ((KeyValue) node_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// node.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\"XGMML id \" + nodes.get(idx)\n \t\t\t\t\t\t+ \" has a duplicated label: \" + label);\n \t\t\t\t// ((KeyValue)node_root_index_pairs.get(idx)).value = null;\n \t\t\t}\n \t\t}\n \t\tnodeNameSet = null;\n \n \t\t// Extract edges\n \t\tginy_edges = new IntArrayList(edges.size());\n \t\tSet edgeNameSet = new HashSet(edges.size());\n \n \t\tfinal CyAttributes edgeAttributes = Cytoscape.getEdgeAttributes();\n \n \t\t// Add All Edges to Network\n \t\tfor (int idx = 0; idx < edges.size(); idx++) {\n \n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(2,\n \t\t\t\t\t\tidx, edges.size()));\n \t\t\t}\n \t\t\tfinal cytoscape.generated2.Edge curEdge = (cytoscape.generated2.Edge) edges\n \t\t\t\t\t.get(idx);\n \n \t\t\tif (gml_id2order.containsKey(curEdge.getSource())\n \t\t\t\t\t&& gml_id2order.containsKey(curEdge.getTarget())) {\n \n \t\t\t\tString edgeName = curEdge.getLabel();\n \n \t\t\t\tif (edgeName == null) {\n \t\t\t\t\tedgeName = \"N/A\";\n \t\t\t\t}\n \n \t\t\t\tint duplicate_count = 1;\n \t\t\t\twhile (!edgeNameSet.add(edgeName)) {\n \t\t\t\t\tedgeName = edgeName + \"_\" + duplicate_count;\n \t\t\t\t\tduplicate_count += 1;\n \t\t\t\t}\n \n \t\t\t\tEdge edge = Cytoscape.getRootGraph().getEdge(edgeName);\n \n \t\t\t\tif (edge == null) {\n \n \t\t\t\t\tfinal String sourceName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getSource());\n \t\t\t\t\tfinal String targetName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getTarget());\n \n \t\t\t\t\tfinal Node node_1 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\tsourceName);\n \t\t\t\t\tfinal Node node_2 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\ttargetName);\n \n \t\t\t\t\tfinal Iterator it = curEdge.getAtt().iterator();\n \t\t\t\t\tAtt interaction = null;\n \t\t\t\t\tString itrValue = \"unknown\";\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tinteraction = (Att) it.next();\n \t\t\t\t\t\tif (interaction.getName().equals(\"interaction\")) {\n \t\t\t\t\t\t\titrValue = interaction.getValue();\n \t\t\t\t\t\t\tif (itrValue == null) {\n \t\t\t\t\t\t\t\titrValue = \"unknown\";\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \n \t\t\t\t\tedge = Cytoscape.getCyEdge(node_1, node_2,\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue, true);\n \n \t\t\t\t\t// Add interaction to CyAttributes\n \t\t\t\t\tedgeAttributes.setAttribute(edge.getIdentifier(),\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue);\n \t\t\t\t}\n \n \t\t\t\t// Set correct ID, canonical name and interaction name\n \t\t\t\tedge.setIdentifier(edgeName);\n \n \t\t\t\treadAttributes(edgeName, curEdge.getAtt(), EDGE);\n \n \t\t\t\tginy_edges.add(edge.getRootGraphIndex());\n \t\t\t\t// ((KeyValue) edge_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// edge.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\n \t\t\t\t\t\t\"Non-existant source/target node for edge with gml (source,target): \"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getSource()) + \",\"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getTarget()));\n \t\t\t}\n \t\t}\n \t\tedgeNameSet = null;\n \n \t\tif (metanodeMap.size() != 0) {\n \t\t\tfinal Iterator it = metanodeMap.keySet().iterator();\n \t\t\twhile (it.hasNext()) {\n \t\t\t\tfinal String key = (String) it.next();\n \t\t\t\tcreateMetaNode(key, (List) metanodeMap.get(key));\n \t\t\t}\n \t\t}\n \t}",
"void createGraphForMassiveLoad();",
"public DFSGraph() {\n this(new HashMap<>(), HashMap::new, HashSet::new, HashSet::new);\n }",
"public Graph(){\n\t\tthis.sizeE = 0;\n\t\tthis.sizeV = 0;\n\t}",
"public Builder() {\n this(Graphs.<N, E>createUndirected());\n }",
"public HashGraph()\n {\n graph = new HashMap <>();\n }",
"public static GraphNode createGraphNodeForUseCase() {\n GraphNode graphNode = new GraphNode();\n GraphNode graphNodeName = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(60, 20 + 20 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNodeName.addContained(childNode);\n }\n\n graphNode.addContained(graphNodeName);\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create a use case\n UseCase usecase = new UseCaseImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n usecase.addStereotype(stereotype);\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n usecase.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(usecase);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }",
"AdjacencyGraph(){\r\n vertices = new HashMap<>();\r\n }",
"private GraphParser(){ \n\t}",
"public GraphNode buildGraph()\n {\n GraphNode node1 = new GraphNode(1);\n GraphNode node2 = new GraphNode(2);\n GraphNode node3 = new GraphNode(3);\n GraphNode node4 = new GraphNode(4);\n List<GraphNode> v = new ArrayList<GraphNode>();\n v.add(node2);\n v.add(node4);\n node1.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node1);\n v.add(node3);\n node2.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node2);\n v.add(node4);\n node3.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node3);\n v.add(node1);\n node4.neighbours = v;\n return node1;\n }",
"public Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }",
"public SubGraph(){\r\n\t\tsuper();\r\n\t}",
"void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}",
"Graph(int size) {\n n = size;\n V = new Vertex[size + 1];\n // create an array of Vertex objects\n for (int i = 1; i <= size; i++)\n V[i] = new Vertex(i);\n }",
"public Graph(PApplet p) {\n\t\tvertices = new HashMap<Integer, Vertex>();\n\t\tedges = new HashSet<Edge>();\n\t\tparent = p;\n\t}",
"Graph() {\r\n\t\tvertices = new LinkedList<Vertex>();\r\n\t\tedges = 0;\r\n\r\n\t\tfor (int i = 0; i < 26; i++) {\r\n\t\t\t// ASCII value of 'A' is 65\r\n\t\t\tVertex vertex = new Vertex((char) (i + 65));\r\n\t\t\tvertices.add(vertex);\r\n\t\t}\r\n\t\tcurrentVertex = vertices.get(0);\r\n\t\tseen = new boolean[26];\r\n\t}",
"public MapGraph()\n {\n this.nodes = new HashMap<Integer, MapNode>();\n this.edges = new HashMap<Integer, Set<MapEdge>>();\n this.nodesByName = new HashMap<String, Set<Integer>>();\n }",
"Vertex(){}",
"public Graph getGraph();",
"public void createGraph() {\n System.out.println(\"The overlay graph will be created from scratch\");\n graph = new MatrixOverlayGraph();\n parse(dumpPath);\n saveGraph();\n graph.createSupporters(kdTreeSupporterActived);\n saveSupporters();\n }",
"Graph(int v) {\n V = v;\n adj = new LinkedList[v];\n for (int i = 0; i < v; ++i)\n adj [i] = new LinkedList();\n }",
"public weighted_graph copy();",
"public ExportGraph()\n {\n }",
"private void buildGraph()\n\t{\n\t\taddVerticesToGraph();\n\t\taddLinkesToGraph();\n\t}",
"private Graph<Node, DefaultEdge> initialiseSpaceGraph() {\n Graph<Node, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class);\n g = addNodes(g);\n g = addEdges(g);\n return g;\n }",
"public WeightedGraph() {\n super();\n }",
"public UGraph()\r\n {\r\n uNodes = new HashMap<Integer , UNode>();\r\n uEdges = new HashMap<Integer, UEdge>();\r\n }",
"GraphObj() {\n this._V = 0;\n this._E = 0;\n inListArray = new ArrayList<>();\n inListArray.add(null);\n outListArray = new ArrayList<>();\n outListArray.add(null);\n selfEdges = new ArrayList<>();\n selfEdges.add(-1);\n edgeList = new ArrayList<>();\n edgeList.add(null);\n }",
"public static GraphNode createGraphNodeForUseCaseConnector() {\n GraphNode graphNode = new GraphNode();\n GraphNode graphNodeName = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(60, 20 + 20 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNodeName.addContained(childNode);\n }\n graphNode.addContained(graphNodeName);\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(-50, -50));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create a use case\n UseCase usecase = new UseCaseImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n usecase.setNamespace(namespace);\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(usecase);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }",
"public ObjectGraph createScopedGraph(Object... modules) {\n return graph.plus(modules);\n }",
"Graph testGraph();",
"public void createGraphFromFile() {\n\t\t//如果图未初始化\n\t\tif(graph==null)\n\t\t{\n\t\t\tFileGetter fileGetter= new FileGetter();\n\t\t\ttry(BufferedReader bufferedReader=new BufferedReader(new FileReader(fileGetter.readFileFromClasspath())))\n\t\t\t{\n\t\t\t\tString line = null;\n\t\t\t\twhile((line=bufferedReader.readLine())!=null)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t}\n\t\t\t\t//create the graph from file\n\t\t\t\tgraph = new Graph();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void setGraph(Graph<V,E> graph);",
"public GraphUtil buildGraph() {\n try {\n GraphUtil graphUtilObject = new GraphUtil();\n graphUtilObject.setCountryGraph(gameMap.getCountryHashMap());\n return graphUtilObject;\n }catch(Exception e) {\n return null;\n }\n }",
"public Graph() {\r\n\t\tnodePos = new HashMap<Integer, Vec2D>();\r\n\t\tconnectionLists = new HashMap<Integer, List<Connection>>();\r\n\t\t//screenWidth = Config.SCREEN_WIDTH;\r\n\t}",
"private void createGraph() {\r\n graph = new Graph(SHELL, SWT.NONE);\r\n\r\n final GridData gridData = new GridData();\r\n gridData.horizontalAlignment = GridData.FILL;\r\n gridData.verticalAlignment = GridData.FILL;\r\n gridData.grabExcessHorizontalSpace = true;\r\n gridData.grabExcessVerticalSpace = true;\r\n gridData.heightHint = DEFAULT_GRAPH_SIZE;\r\n gridData.widthHint = DEFAULT_GRAPH_SIZE;\r\n graph.setLayoutData(gridData);\r\n }",
"public DSAGraph()\n\t{\n\t\tvertices = new DSALinkedList();\n\t\tedgeCount = 0;\n\t}",
"public void create(NetworkNode networkNode);",
"private static ManagementGraph constructTestManagementGraph() {\n\n\t\t/**\n\t\t * This is the structure of the constructed test graph. The graph\n\t\t * contains two stages and all three channel types.\n\t\t * 4\n\t\t * | In-memory\n\t\t * 3\n\t\t * --/ \\-- Network (was FILE)\n\t\t * 2 2\n\t\t * \\ / Network\n\t\t * 1\n\t\t */\n\n\t\t// Graph\n\t\tfinal ManagementGraph graph = new ManagementGraph(new JobID());\n\n\t\t// Stages\n\t\tfinal ManagementStage lowerStage = new ManagementStage(graph, 0);\n\t\tfinal ManagementStage upperStage = new ManagementStage(graph, 1);\n\n\t\t// Group vertices\n\t\tfinal ManagementGroupVertex groupVertex1 = new ManagementGroupVertex(lowerStage, \"Group Vertex 1\");\n\t\tfinal ManagementGroupVertex groupVertex2 = new ManagementGroupVertex(lowerStage, \"Group Vertex 2\");\n\t\tfinal ManagementGroupVertex groupVertex3 = new ManagementGroupVertex(upperStage, \"Group Vertex 3\");\n\t\tfinal ManagementGroupVertex groupVertex4 = new ManagementGroupVertex(upperStage, \"Group Vertex 4\");\n\n\t\t// Vertices\n\t\tfinal ManagementVertex vertex1_1 = new ManagementVertex(groupVertex1, new ManagementVertexID(), \"Host 1\",\n\t\t\t\"small\", 0);\n\t\tfinal ManagementVertex vertex2_1 = new ManagementVertex(groupVertex2, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 0);\n\t\tfinal ManagementVertex vertex2_2 = new ManagementVertex(groupVertex2, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 1);\n\t\tfinal ManagementVertex vertex3_1 = new ManagementVertex(groupVertex3, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 0);\n\t\tfinal ManagementVertex vertex4_1 = new ManagementVertex(groupVertex4, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 0);\n\n\t\t// Input/output gates\n\t\tfinal ManagementGate outputGate1_1 = new ManagementGate(vertex1_1, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate2_1 = new ManagementGate(vertex2_1, new ManagementGateID(), 0, true);\n\t\tfinal ManagementGate outputGate2_1 = new ManagementGate(vertex2_1, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate2_2 = new ManagementGate(vertex2_2, new ManagementGateID(), 0, true);\n\t\tfinal ManagementGate outputGate2_2 = new ManagementGate(vertex2_2, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate3_1 = new ManagementGate(vertex3_1, new ManagementGateID(), 0, true);\n\t\tfinal ManagementGate outputGate3_1 = new ManagementGate(vertex3_1, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate4_1 = new ManagementGate(vertex4_1, new ManagementGateID(), 0, true);\n\n\t\t// Group Edges\n\t\tnew ManagementGroupEdge(groupVertex1, 0, groupVertex2, 0, ChannelType.NETWORK);\n\t\tnew ManagementGroupEdge(groupVertex2, 0, groupVertex3, 0, ChannelType.NETWORK);\n\t\tnew ManagementGroupEdge(groupVertex3, 0, groupVertex4, 0, ChannelType.IN_MEMORY);\n\n\t\t// Edges\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate1_1, 0, inputGate2_1, 0,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate1_1, 1, inputGate2_2, 0,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate2_1, 0, inputGate3_1, 0,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate2_2, 0, inputGate3_1, 1,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate3_1, 0, inputGate4_1, 0,\n\t\t\tChannelType.IN_MEMORY);\n\n\t\treturn graph;\n\t}",
"public Graph(Map<Vertex<? extends Position>, List<Vertex<? extends Position>>> graph){\n\t\tthis.mapGraph = graph;\n\t}",
"IGraphEngine graphEngineFactory();",
"public static Graph instantiateAdjacencyMatrixGraph() {\r\n\t\treturn new AdjacencyMatrixGraph();\r\n\t}",
"public void newGraph(int type) {\r\n graph.getNodes().removeAllElements();\r\n graph.getEdges().removeAllElements();\r\n\r\n graphX.getNodes().removeAllElements();\r\n graphX.getEdges().removeAllElements();\r\n\r\n switch (type) {\r\n case GRAPH_UNORIENTED:\r\n graph = new GraphUnoriented();\r\n break;\r\n case GRAPH_ORIENTED:\r\n graph = new GraphOriented();\r\n break;\r\n }\r\n\r\n repaintGraph();\r\n }",
"public BranchGroup createSceneGraph() {\n BranchGroup node = new BranchGroup();\n TransformGroup TG = createSubGraph();\n TG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n TG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n // mouse behaviour\n MouseRotate mouse = new MouseRotate(TG);\n mouse.setSchedulingBounds(new BoundingSphere());\n // key nav\n KeyNavigatorBehavior keyNav = new KeyNavigatorBehavior(TG); //Imposto il bound del behavior\n keyNav.setSchedulingBounds(new BoundingSphere(new Point3d(), 100.0)); //Aggiungo il behavior alla scena\n TG.addChild(keyNav);\n TG.addChild(mouse);\n node.addChild(TG);\n // Add directionalLight\n node.addChild(directionalLight());\n // Add ambientLight\n node.addChild(ambientLight());\n return node;\n }",
"public static LabelToNode createScopeByGraph() {\n return new LabelToNode(new GraphScopePolicy(), nodeAllocatorByGraph());\n }",
"public static Graph createGraphFromDataSet(DataSet dataset){\n Logger logger = LoggerFactory.getLogger(GSHelper.class);\n Graph g = new DefaultGraph(\"temp\");\n g.setStrict(false);\n g.setAutoCreate(true); //automatically create nodes based on edges\n for (CoriaEdge edge : dataset.getEdges()) {\n try {\n logger.trace(\"Edge: \" + edge);\n Edge e = g.addEdge(edge.getSourceNode() + \"->\" + edge.getDestinationNode(), edge.getSourceNode(), edge.getDestinationNode());\n for(Map.Entry<String, String> att : edge.getAttributes().entrySet()){\n e.addAttribute(att.getKey(), att.getValue());\n }\n } catch (Exception ex) {\n logger.error(\"failed creating edge for CoriaEdge {}\", edge);\n logger.error(ex.getMessage());\n return null;\n }\n }\n return g;\n }",
"Graph(List<Edge> edges) {\n\n //one pass to find all vertices\n // this step avoid add isolated coordinates to the graph\n for (Edge e : edges) {\n if (!graph.containsKey(e.startNode)) {\n graph.put(e.startNode, new Node(e.startNode));\n }\n if (!graph.containsKey(e.endNode)) {\n graph.put(e.endNode, new Node(e.endNode));\n }\n }\n\n //another pass to set neighbouring vertices\n for (Edge e : edges) {\n graph.get(e.startNode).neighbours.put(graph.get(e.endNode), e.weight);\n //graph.get(e.v2).neighbours.put(graph.get(e.v1), e.dist); // also do this for an undirected graph\n }\n }",
"public:\n Graph(int V); // Constructor\n void addEdge(int v, int w);",
"public Graph createGraph() {\n String fileName;\n// fileName =\"./428333.edges\";\n String line;\n Graph g = new Graph();\n// List<String> vertexNames = new ArrayList<>();\n// try\n// {\n// BufferedReader in=new BufferedReader(new FileReader(fileName));\n// line=in.readLine();\n// while (line!=null) {\n////\t\t\t\tSystem.out.println(line);\n// String src = line.split(\" \")[0];\n// String dst = line.split(\" \")[1];\n//// vertexNames.add(src);\n//// vertexNames.add(dst);\n//// System.out.println(src+\" \"+dst);\n// g.addEdge(src, dst, 1);\n// line=in.readLine();\n// }\n// in.close();\n// } catch (Exception e) {\n//\t\t\te.printStackTrace();\n// }\n\n fileName=\"./788813.edges\";\n// List<String> vertexNames = new ArrayList<>();\n try\n {\n BufferedReader in=new BufferedReader(new FileReader(fileName));\n line=in.readLine();\n while (line!=null) {\n//\t\t\t\tSystem.out.println(line);\n String src = line.split(\" \")[0];\n String dst = line.split(\" \")[1];\n g.addEdge(src, dst, 1);\n line=in.readLine();\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n// Graph g = new Graph(new String[]{\"v0\", \"v1\", \"v2\", \"v3\", \"v4\", \"v5\", \"v6\", \"v7\", \"v8\"});\n// // Add the required edges.\n// g.addEdge(\"v0\", \"v1\", 4); g.addEdge(\"v0\", \"v7\", 8);\n// g.addEdge(\"v1\", \"v2\", 8); g.addEdge(\"v1\", \"v7\", 11); g.addEdge(\"v2\", \"v1\", 8);\n// g.addEdge(\"v2\", \"v8\", 2); g.addEdge(\"v2\", \"v5\", 4); g.addEdge(\"v2\", \"v3\", 7);\n// g.addEdge(\"v3\", \"v2\", 7); g.addEdge(\"v3\", \"v5\", 14); g.addEdge(\"v3\", \"v4\", 9);\n// g.addEdge(\"v4\", \"v3\", 9); g.addEdge(\"v4\", \"v5\", 10);\n// g.addEdge(\"v5\", \"v4\", 10); g.addEdge(\"v5\", \"v3\", 9); g.addEdge(\"v5\", \"v2\", 4);\n// g.addEdge(\"v5\", \"v6\", 2);\n// g.addEdge(\"v6\", \"v7\", 1); g.addEdge(\"v6\", \"v8\", 6); g.addEdge(\"v6\", \"v5\", 2);\n// g.addEdge(\"v7\", \"v0\", 8); g.addEdge(\"v7\", \"v8\", 7); g.addEdge(\"v7\", \"v1\", 11);\n// g.addEdge(\"v7\", \"v6\", 1);\n// g.addEdge(\"v8\", \"v2\", 2); g.addEdge(\"v8\", \"v7\", 7); g.addEdge(\"v8\", \"v6\", 6);\n\n//\n return g;\n }",
"public Graph() {\n\t\tthis(new PApplet());\n\t}",
"@Override\n public directed_weighted_graph copy() {\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(G);\n oos.flush();\n oos.close();\n bos.close();\n byte[] byteData = bos.toByteArray();\n\n ByteArrayInputStream bis = new ByteArrayInputStream(byteData);\n return (directed_weighted_graph) (new ObjectInputStream(bis).readObject());\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }",
"public DotGraph(String graphname) {\n this.graphname = graphname;\n this.isSubGraph = false;\n this.nodes = new HashMap<String, DotGraphNode>(100);\n this.drawElements = new LinkedList<Renderable>();\n this.attributes = new LinkedList<DotGraphAttribute>();\n }",
"@Override\n\tpublic graph copy() {\n\t\tgraph copy = new DGraph();\n\t\tCollection<node_data> nColl = this.GA.getV();\n\t\tfor (node_data node : nColl) {\n\t\t\tnode_data temp = new Node((Node) node );\n\t\t\tcopy.addNode(node);\n\t\t}\n\t\tCollection<node_data> nColl2 = this.GA.getV();\n\t\tfor (node_data node1 : nColl2) {\n\t\t\tCollection<edge_data> eColl = this.GA.getE(node1.getKey());\n\t\t\tif (eColl!=null) {\n\t\t\t\tfor (edge_data edge : eColl) {\n\t\t\t\t\tcopy.connect(edge.getSrc(), edge.getDest(), edge.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}",
"private DGraph initFactory(DGraph g) {\n\t\tg= new DGraph();\n\t\tNodeData d0 = new NodeData(0);\n\t\tNodeData d1 = new NodeData(1);\n\t\tNodeData d2 = new NodeData(2);\n\t\tNodeData d3 = new NodeData(3);\n\t\tNodeData d4 = new NodeData(4);\n\t\tg.addNode(d0);\n\t\tg.addNode(d1);\n\t\tg.addNode(d2);\n\t\tg.addNode(d3);\n\t\tg.addNode(d4);\n\t\tg.connect(1, 2, 3);\n\t\tg.connect(2, 1, 4);\n\t\tg.connect(3, 4, 5);\n\t\tg.connect(4,3, 7);\n\t\tg.connect(3,2, 4);\n\t\tg.connect(3,1, 5);\n\t\tg.connect(1,3, 2);\n\t\treturn g;\n\t}",
"private void initGraph() {\n nodeMap = Maps.newIdentityHashMap();\n stream.forEach(t -> {\n Object sourceKey = sourceId.extractValue(t.get(sourceId.getTableId()));\n Object targetKey = targetId.extractValue(t.get(targetId.getTableId()));\n ClosureNode sourceNode = nodeMap.get(sourceKey);\n ClosureNode targetNode = nodeMap.get(targetKey);\n if (sourceNode == null) {\n sourceNode = new ClosureNode(sourceKey);\n nodeMap.put(sourceKey, sourceNode);\n }\n if (targetNode == null) {\n targetNode = new ClosureNode(targetKey);\n nodeMap.put(targetKey, targetNode);\n }\n sourceNode.next.add(targetNode);\n });\n\n }",
"private TbusRoadGraph() {}",
"protected IWeightedGraph<GraphNode, WeightedEdge> createGraph(List<GoapState> goalState) {\r\n\t\tIWeightedGraph<GraphNode, WeightedEdge> generatedGraph = this.generateGraphObject();\r\n\r\n\t\taddVertices(generatedGraph, goalState);\r\n\t\taddEdges(generatedGraph);\r\n\r\n\t\treturn generatedGraph;\r\n\t}",
"private Moneygraph() {\n super(\"moneygraph\", null);\n }",
"private static void createGraph(In in) {\n int vert = in.readInt();\n int edge = in.readInt();\n //Using the graph.java class, create a new graph with the number of vertices + 1 (since the graph class starts with vertex 0)\n Graph graph = new Graph(vert + 1);\n //For loop that adds the edges of the graph to the graph object\n for (int i = 0; i < edge; i++) {\n graph.addEdge(in.readInt(), in.readInt());\n }\n //Uses the bipartite class to check if the graph is bipartite\n if (new Bipartite(graph).isBipartite()) {\n //If the graph is bipartite, prints 1\n StdOut.print(\"1 \");\n }\n else {\n //Prints -1 if the graph is not bipartite\n StdOut.print(\"-1 \");\n }\n }",
"public Graph(String start, String end) {\n findCoordinates(findTime(start, end));\n constructGraph();\n }",
"protected Node createSceneGraph(Entity entity) {\n String name = cell.getCellID().toString();\n\n /* Create the new mesh for the shape */\n TriMesh mesh = new Box(name, new Vector3f(), 0.5f, 0.5f, 0.5f);\n\n /* Create the scene graph object and set its wireframe state */\n node = new Node();\n node.attachChild(mesh);\n node.setModelBound(new BoundingSphere());\n node.updateModelBound();\n node.setName(\"Cell_\"+cell.getCellID()+\":\"+cell.getName());\n\n return node;\n }",
"public static GraphNode createGraphNodeForActor() {\n GraphNode graphNode = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(0, 12 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNode.addContained(childNode);\n }\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create an actor\n Actor actor = new ActorImpl();\n\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n actor.addStereotype(stereotype);\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n actor.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(actor);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }",
"public MyGraph(Collection<Vertex> v, Collection<Edge> e) {\n myGraph = new HashMap<Vertex, Collection<Edge>>();\n \n Iterator<Vertex> vertices = v.iterator();\n while(vertices.hasNext()) {\n //create a new vertex copy of each passes in vertex in Collection v to restrict any reference\n //to the internals of this class\n Vertex currV = new Vertex(vertices.next().getLabel()); //NEW\n //Vertex currV = vertices.next(); OLD\n if(!myGraph.containsKey(currV)){\n //add the copy of the vertex into the HashMap\n myGraph.put(currV, new ArrayList<Edge>());\n }\n }\n\n Iterator<Edge> edges = e.iterator();\n while(edges.hasNext()){\n //copies a new edge for each edge in Collection e to restrict any reference \n //to the internals of this class\n Edge parameterEdge = edges.next();\n Edge currE = new Edge(parameterEdge.getSource(), parameterEdge.getDestination(), parameterEdge.getWeight()); //NEW\n //Edge currE = edges.next(); OLD\n if(currE.getWeight() < 0){\n throw new IllegalArgumentException(\"Edge weight is negative\");\n }\n Vertex currESrc = currE.getSource();\n Vertex currEDest = currE.getDestination();\n if(v.contains(currESrc) && v.contains(currEDest)){\n Collection<Edge> outEdges = myGraph.get(currESrc);\n if(!outEdges.contains(currE)){\n //add the copy of the edge as a value in the HashMap\n outEdges.add(currE);\n }\n } else {\n throw new IllegalArgumentException(\"Vertex in edge is not valid\");\n }\n }\n }",
"public Vertex(){\n\n }",
"public AdjVertex newAdjVertex(String name)\r\n\t{\r\n\t\t// new adjacent vertex\r\n\t\tAdjVertex newAdjVertex = new AdjVertex();\r\n\t\t// initialization\r\n\t\t//newAdjVertex.vertexNum = vertexNum;\r\n\t\tnewAdjVertex.name = name;\r\n\t\tnewAdjVertex.next = null;\r\n\t\t//newAdjVertex.id = some;\r\n\t\treturn newAdjVertex;\r\n\t}",
"private void initializeFromGraph(Graph<HyperNode, DefaultEdge> graph) {\n Map<HyperNode, Node> nodesMap = addNodes(graph);\n addEdges(graph, nodesMap);\n }",
"private GraphObject instantiateGraphObject( String tagname ) {\n// Global.info( \"Instantiating object of type \" + tagname );\n if ( CharGerXMLTagNameToClassName.isEmpty() ) {\n loadCharGerKeyWordToClassTable();\n }\n String t = CharGerXMLTagNameToClassName.getProperty( tagname, \"DUMMY\" );\n if ( t.equals( \"DUMMY\" ) ) {\n return null;\n }\n\n GraphObject go = null;\n Class objClass = null;\n try {\n objClass = Class.forName( \"charger.obj.\" + t );\n go = (GraphObject)objClass.newInstance();\n } catch ( ClassNotFoundException ex ) {\n Global.error( \"Parsing an illegal object tag \" + tagname );\n } catch ( InstantiationException ex ) {\n Global.error( \"Parsing an illegal object tag \" + tagname );\n } catch ( IllegalAccessException ex ) {\n Global.error( \"Parsing an illegal object tag \" + tagname );\n }\n\n return go;\n }"
] | [
"0.747292",
"0.7384809",
"0.7264467",
"0.7156339",
"0.7150749",
"0.71311",
"0.7042738",
"0.6980663",
"0.6899998",
"0.68902886",
"0.6847356",
"0.6814882",
"0.6778108",
"0.674538",
"0.67268586",
"0.67012674",
"0.6693443",
"0.6647704",
"0.66313285",
"0.6630923",
"0.66078913",
"0.65984774",
"0.65909547",
"0.6571307",
"0.65710485",
"0.6551289",
"0.65079284",
"0.6473256",
"0.64510274",
"0.6445307",
"0.6445307",
"0.64337623",
"0.64165014",
"0.6404717",
"0.6388494",
"0.6381389",
"0.63648",
"0.63468856",
"0.63437444",
"0.6339755",
"0.6329276",
"0.6327532",
"0.63198495",
"0.6317326",
"0.6317197",
"0.6314884",
"0.62636435",
"0.6261883",
"0.62596303",
"0.62430805",
"0.62428445",
"0.6223353",
"0.6218894",
"0.62028176",
"0.6193546",
"0.6178251",
"0.6177709",
"0.6170153",
"0.6161983",
"0.615685",
"0.61516243",
"0.61485046",
"0.6121829",
"0.6111352",
"0.6099179",
"0.6096872",
"0.6087477",
"0.60860825",
"0.60844684",
"0.6065781",
"0.6055923",
"0.60388875",
"0.6027033",
"0.60257614",
"0.60253495",
"0.60250026",
"0.6024861",
"0.60073644",
"0.5996213",
"0.599618",
"0.59804684",
"0.5979578",
"0.5962491",
"0.5957822",
"0.5956425",
"0.59461725",
"0.5944115",
"0.59321576",
"0.59233814",
"0.59144825",
"0.5895113",
"0.5891315",
"0.588921",
"0.5880242",
"0.5879506",
"0.58736354",
"0.58719635",
"0.58617806",
"0.5861054",
"0.5851927",
"0.5848122"
] | 0.0 | -1 |
check to see if it is a file | private static void fileToDirectDistance(String fileName, Graph graph) throws IOException {
if (new File(fileName).isFile()) {
Scanner scanner = new Scanner(new File(fileName));
// loop over each line in the file
while(scanner.hasNextLine()) {
String line = scanner.nextLine();
String[] stringCharNumPair = line.split(" ");
// convert to a character type and an int type
Character sourceChar = stringCharNumPair[0].charAt(0);
int numDirectDistance = Integer.parseInt(stringCharNumPair[1]);
// add to node in graph
graph.getNode(sourceChar).setDistanceToZ(numDirectDistance);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isFile() { return true; }",
"boolean isFile() throws IOException;",
"public boolean isFile() { return false; }",
"@Override\n\tpublic boolean isFile() {\n\t\treturn true;\n\t}",
"boolean isFile(FsPath path);",
"public boolean isFile(String path);",
"boolean safeIsFile(FsPath path);",
"@Override\r\n\tpublic boolean isFile(String path) {\n\t\treturn false;\r\n\t}",
"@Override\r\n public boolean isFile() throws FileSystemException {\r\n // Use equals instead of == to avoid any class loader worries.\r\n return FileType.FILE.equals(this.getType());\r\n }",
"boolean hasFilePath();",
"public boolean isFileURL( URL url ) {\n\t\tString protocol = url.getProtocol();\n\t\treturn URL_PROTOCOL_FILE.equals(protocol)\n\t\t\t|| URL_PROTOCOL_VFSFILE.equals(protocol)\n\t\t\t|| URL_PROTOCOL_VFS.equals(protocol);\n\t}",
"boolean hasFileName();",
"boolean hasFileName();",
"public static boolean isFile(Path path) {\n\t\treturn Files.isRegularFile(path, LinkOption.NOFOLLOW_LINKS);\n\t}",
"private boolean isAcceptableFile(File f) {\n \tif( f.getName().length() < 7 ) {\n \t\treturn false;\n \t}\n \t\n \tString extension = f.getName().substring( f.getName().length()-7, f.getName().length() );\n \tif ( !extension.equals(\".tessit\") ) {\n \t\treturn false;\n \t}\n \t\n \treturn true;\n }",
"boolean hasMimeType();",
"public boolean isRegularFile() {\n\t\treturn isRegularFile;\n\t}",
"boolean hasFileInfo();",
"boolean hasFileInfo();",
"public boolean isFileByFile() {\n return fileByFile;\n }",
"public boolean fileIsFile(File file) {\n if (executionEnvironment.isLocal()) {\n return file.isFile();\n } else {\n return ProcessUtils.execute(executionEnvironment, \"test\", \"-f\", \"\\\"\" + file.getPath() + \"\\\"\").isOK(); //NOI18N\n }\n }",
"boolean hasFileLocation();",
"private boolean checkFile(String name) {\n return name.endsWith(extension);\n }",
"@java.lang.Deprecated boolean hasFile();",
"public boolean hasFile(final String file);",
"public boolean isSetFileType() {\n return this.fileType != null;\n }",
"@Override\n\tpublic boolean accept(File file) {\n return file.isDirectory() || (file.isFile() && file.getName().toLowerCase().endsWith(\".txt\"));\n\t}",
"public boolean accept(File f) \n \t{\n if (f.isDirectory()) \t\t\t\t\t\t\t return true;\n\n String extension = getExtension(f);\n if (extension != null) \n \t{\n \tif (extension.equals(\"txt\")) return true;\n \telse\t\t\t\t\t\t\t return false;\n }\n\n return false;\n \t}",
"public boolean isInputFileType(String extension);",
"boolean accept(String filename);",
"public boolean fileFormatSupported(String fmt);",
"private boolean isSupportedFile(Object fileObject) {\n\t\tif (fileObject instanceof IAdaptable)\n\t\t\treturn castToIFile(fileObject).getFileExtension().equals(TestCasePersister.FILE_EXTENSION);\n\t\t\t\n\t\treturn false;\n\t}",
"private static boolean checkFileType(String filename) {\r\n\t\treturn (filename.matches(\"(.*).bf\") || filename.matches(\"(.*).bmp\"));\r\n\t}",
"public boolean isSetFileType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FILETYPE$8) != 0;\n }\n }",
"private void checkFileOrDirectory(Path pathroot) {\n if (Files.notExists(pathroot)) { // Checking path is valid path or the path is exist\n System.out.println(\"Not a valid Path \" + pathroot);\n } else if (Files.isDirectory(pathroot)) {// checking path contains file if contain file display message\n System.out.println(\"It is Directory\");\n } else {\n System.out.println(\"This is File\"); // printing the path is directory\n }\n }",
"public boolean accepts(File f);",
"@Override\r\n\tpublic boolean accept(File f) {\r\n\t\tif (f.isDirectory()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tString extension = FileUtils.getExtension(f);\r\n\t\tif (extension == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (extension.equals(TIFF) || extension.equals(TIF)\r\n\t\t\t\t|| extension.equals(GIF) || extension.equals(JPEG)\r\n\t\t\t\t|| extension.equals(JPG) || extension.equals(PNG)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"boolean hasInodeFile();",
"private boolean isFileAccessible() {\n\t\ttry {\n\t\t\tif (!new File(fileUpload.getFilePath()).exists())\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t} catch (SecurityException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\r\n public boolean accept(File file)\r\n {\n return FileUtil.getFileExtension(file.getPath(), true).toLowerCase().equals(EXT);\r\n }",
"@Override\n public boolean accept(File f) {\n return f.getName().endsWith(FILE_EXTENSION);\n }",
"public boolean isSupportedFile(String fileName)\r\n {\r\n return fileName.toLowerCase().endsWith(\".gtf\");\r\n }",
"@Override\n public boolean isMyFileType(File file)\n {\n String lower = file.getName().toLowerCase();\n if (lower.endsWith(\".maz\") || lower.endsWith(\".mz2\"))\n return true;\n else\n return false;\n }",
"public abstract boolean isPath();",
"private boolean validateFile(String path) {\n return !path.equals(AppStrings.NO_FILE_PATH);\n }",
"@Override\n\tpublic boolean isFileOpen(String fileName) \n\t{\n\t\treturn false;\n\t}",
"public boolean accept(File pathname) {\n return pathname.getName().toLowerCase().endsWith(\".txt\");\n }",
"public Boolean isFile(IDirectory parentDirectory, String path) {\r\n // Get the item given by the path\r\n DirectoryTreeNode item = this.getItemGivenPath(parentDirectory, path);\r\n return item != null && item instanceof IFile;\r\n }",
"public static boolean isTwigFile(final IResource resource) {\n\t\treturn resource instanceof IFile && resource.isAccessible()\n\t\t\t\t&& TWIG_EXTENSION.equals(resource.getFileExtension());\n\t}",
"public static void checkFile(Path path) {\n\n if (!path.isAbsolute()) {\n System.out.format(\"%s must be an absolute path to a file.\", path);\n System.exit(0);\n } else if (!Files.exists(path)) {\n System.out.format(\"%s does not exist.\", path);\n System.exit(0);\n }\n\n // Verify that the path references a file\n try {\n BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class);\n if (!attr.isRegularFile()) {\n System.out.format(\"%s is not a file.\", path);\n System.exit(0);\n }\n } catch (IOException e) {\n System.err.println(\"I/O error: \" + e);\n e.printStackTrace();\n System.exit(1);\n }\n }",
"private static boolean hasFile(Artifact artifact) {\n\t\treturn artifact != null && artifact.getFile() != null && artifact.getFile().isFile();\n\t}",
"boolean getFileErr();",
"private boolean isDataFile(File file) {\n \t\tboolean retVal = true;\n \t\tString name = file.getName();\n \t\tif((name.indexOf(TXT_EXTENSION) < 0) && (name.indexOf(CSV_EXTENSION) < 0)) retVal = false;\n \t\treturn retVal;\n \t}",
"public boolean accept(File file) {\n \tString FileName = file.getName().toLowerCase();\n String FileSuffix = FileName.substring(FileName.lastIndexOf(\".\")+1);\n \treturn Arrays.asList(ValidTails).contains(FileSuffix) || file.isDirectory();\n }",
"boolean isImageType();",
"public static boolean isResultFile(File f) {\n String p = f.getPath();\n return p.endsWith(EXTN);\n }",
"private boolean isCorrectFile(File file) {\n\t\treturn file.getAbsolutePath().endsWith(\".gif\") || file.getAbsolutePath().endsWith(\".jpeg\")\n\t\t\t\t|| file.getAbsolutePath().endsWith(\".jpg\");\n\t}",
"private boolean isValidFile(String sHTTPRequest) {\n String sRootFolder = \"/\" + ROOT_FOLDER.getName();\n return sAvailableFiles.contains(sRootFolder + sHTTPRequest.toLowerCase());\n }",
"boolean hasFileLoc();",
"@Override\n public boolean accept(File file) {\n return file.isDirectory()\n || file.getAbsolutePath().endsWith(\".txt\")\n || file.getAbsolutePath().endsWith(\".avro\")\n || file.getAbsolutePath().endsWith(\".json\")\n || file.getAbsolutePath().endsWith(\".text\")\n || file.getAbsolutePath().endsWith(\".seqjson\")\n || file.getAbsolutePath().endsWith(\".seqfile\");\n }",
"public abstract boolean isFileOutput();",
"public boolean accept(File f) {\r\n\t if (f.isDirectory()) {\r\n\t return true;\r\n\t }\r\n\t \r\n\t String extension = Utils.getExtension(f);\r\n\t if (extension != null) {\r\n\t if (extension.equals(Utils.tiff) ||\r\n\t extension.equals(Utils.tif) ||\r\n\t extension.equals(Utils.gif) ||\r\n\t extension.equals(Utils.jpeg) ||\r\n\t extension.equals(Utils.jpg)||\r\n\t extension.equals(Utils.png)) {\r\n\t return true;\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t }\r\n\t \r\n\t return false;\r\n\t }",
"@Override\n public boolean accept(File file) {\n return file.isDirectory() || file.getAbsolutePath().endsWith(\".xml\");\n }",
"private boolean isEmptyFile(String filename) {\n try (InputStream in = IO.openFile(filename)) {\n int b = in.read();\n return (b == -1);\n } catch (IOException ex) {\n throw IOX.exception(ex);\n }\n }",
"private boolean validateFile(JTextField fileTF,\n Component parentComp) {\n if (fileTF.getText().trim().length() == 0)\n {\n JOptionPane.showMessageDialog(parentComp,\n \"Please enter a file name in the file field\",\n \"No File Name\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n String text = fileTF.getText().trim();\n File file = new File(text);\n if (!file.exists())\n {\n JOptionPane\n .showMessageDialog(\n parentComp,\n \"The file you entered does not exist. Please enter a valid file name\",\n \"Incorrect File Name\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n return true;\n }",
"private boolean isLocalFile(Uri uri) {\n String auth = uri.getHost();\n\n if (auth.equals(\"localhost\") || uri.getScheme().equals(\"file\")) {\n return true;\n }\n return false;\n }",
"public boolean usesFiles(Files inFile) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean accept(Path arg0) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tFileSystem fs = FileSystem.get(Conf);\n\t\t\tFileStatus stat = fs.getFileStatus(arg0);\n\t\t\tString filename=arg0.getName();\n\t\t\t\n\t\t\tif (stat.isDir())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tif (filename.equals(\"data\"))\n\t\t\t{\n\t\t\t\tif (stat.getLen()==0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Ignoring file:\"+ arg0.getName());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean isHeaderFile(String ext);",
"@Override\r\n\tpublic boolean accept(File fich) {\n\t\treturn extension(fich);\r\n\t}",
"public boolean accept(File f) \n \t{\n if (f.isDirectory()) \t\t\t\t\t\t\t return true;\n\n String extension = getExtension(f);\n if (extension != null) \n \t{\n \tif (extension.equals(\"png\")) return true;\n \telse\t\t\t\t\t\t\t return false;\n }\n\n return false;\n \t}",
"protected boolean _isFileTypeOperation(String actionId)\n {\n boolean isLocal = _isLocalOperation(actionId);\n if (isLocal)\n {\n return false;\n }\n \n if (this._actionId.equals(Constants.CHANGEPASSWORD))\n {\n return false;\n }\n else\n return true; //ntt-Jun102013: this was return false\n }",
"public boolean accept(File f)\n {\n\t\t\t\tif (fileTypeCB.getSelectedItem() == \"PNG\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".png\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"JPEG\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".jpg\"))return true;\n\t else if(f.getName().endsWith(\".jpeg\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"GIF\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".gif\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"BMP\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".bmp\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"TIFF\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".tiff\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"EPS\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".eps\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"SVG\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".svg\"))return true;\n\t \n }\n\t\t\t\t\n\t\t\t\treturn false;\n }",
"private static boolean checkURL(String file) {\n\t\tFile myFile = new File(file);\n\t\treturn myFile.exists() && !myFile.isDirectory();\n\t}",
"@Override\n public boolean accept(File file) {\n return file.getName().toUpperCase().endsWith(extension.toUpperCase());\n }",
"private boolean isJavaFile(File file){\n\t\tif(file.isFile())\n\t\t\treturn file.getName().toLowerCase().endsWith(\".java\");\n\t\treturn false;\n\t}",
"public boolean fExists(){\n \n try(ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))){\n \n }\n catch (FileNotFoundException e){\n System.out.println(\"File not found\");\n return false;\n }\n catch (IOException e){\n System.out.println(\"Another exception\");\n return false;\n }\n\n return true;\n }",
"private boolean isValidContentType(String sHTTPRequest) {\n String sFileType = getFileExtension(sHTTPRequest);\n return Arrays.asList(SUPPORTED_FILE_TYPES).contains(sFileType);\n }",
"public boolean isLocalFile() {\n\t\ttry {\n\t\t\tFile localFile = getLocalFile();\n\t\t\treturn localFile != null && localFile.exists();\n\t\t} catch (CoreException e) {\n\t\t\tlogger.debug(\"Unable to determine if file is local\", e);\n\t\t}\n\t\treturn false;\n\t}",
"private boolean doesFileExist(String qualifiedFileName) throws FileNotFoundException {\n\t\t\n\t\t// First get a path object to where the file is.\n\t\t\n\t\tPath inWhichFolder = Paths.get(qualifiedFileName);\n\t\t\n\t\tboolean isFilePresent = (Files.exists(inWhichFolder) && Files.isReadable(inWhichFolder) && !Files.isDirectory(inWhichFolder));\n\t\t\n\t\tif (!isFilePresent) {\n\t\t\tthrow new FileNotFoundException(String.format(\"The file you specified '%s' does not exist or cannot be found!\", qualifiedFileName));\n\t\t\t\n\t\t}\n\t\t\n\t\t// If we're here then we should have a file that can be opened and read.\n\t\t\n\t\treturn isFilePresent;\n\t\t\n\t}",
"public static boolean m39035c(Uri uri) {\n return \"file\".equals(m39043k(uri));\n }",
"public boolean accept(File f) {\n\t\t// show if it is a directory\n\t\tif (f.isDirectory()) {\n\t\t\treturn true;\n\t\t}\n\t\t// show if it is a file with PNG extension\n\t\tString extension = getExtension(f);\n\t\tif (extension != null) {\n\t\t\tif (extension.equals(\"png\"))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t// otherwise don't show\n\t\treturn false;\n\t}",
"public boolean isSetFile() {\n return this.File != null;\n }",
"public boolean isKnownFileType(FileType t) {\n\treturn knownTypes.contains(t);\r\n }",
"public boolean accept(File f) {\n if(f.isDirectory()){\n return true;\n }\n String extension = getExtension(f);\n if(extension.equals(\"ascii\") || extension.equals(\"txt\") || extension.equals(\"asc\")){\n return true;\n }\n return false;\n }",
"public boolean getUseFiles();",
"public boolean hasFileName() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasFileName() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }",
"public static boolean isFileAvailable(String ID, DawnParser parser)\n {\n return (parser.getProperty(\"DAWN.IO#FILE.\" + ID) != null);\n }",
"FileState checkFileState(FsPath path);",
"private boolean isImage(File file) throws IOException {\n if (!file.isFile()) {\n return false;\n } else if (ImageIO.read(file) == null) // if cannot be read by imageIO, then not image\n {\n return false;\n }\n return true;\n }",
"public boolean accept(File file) {\n if (file.getName().contains(CONTAINS_STRING)) {\n return file.isFile();\n }\n return false;\n }",
"private boolean isJavaFile(JarEntry file){\n\t\treturn file.getName().toLowerCase().endsWith(\".java\");\n\t}",
"public static boolean checkFileType(String fileName) {\n\t\t// properties file has a comma delimited list of extensions\n\t\tString extension_value = PropertiesFile.getInstance().getProperty(\"accepted_ext\");\n\n\t\tif (extension_value != null) {\n\t\t\tString[] extensions = extension_value.split(\",\");\n\t\t\tfor (int i = 0; extensions != null && i < extensions.length; i++) {\n\t\t\t\tif (fileName.endsWith(extensions[i].trim()))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean hasFileLocation() {\n return msgCase_ == 9;\n }",
"public boolean hasFileName() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public boolean hasFileName() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }",
"public boolean hasFileLocation() {\n return msgCase_ == 9;\n }",
"@Override\n\t\t\tpublic boolean accept(File file) {\n\t\t\t\tif (file.isDirectory()) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn file.getName().endsWith(\".dat\");\n\t\t\t\t}\n\t\t\t}",
"private boolean canHaveAsPatientFile(PatientFile creator) {\n\n\t\treturn creator != null;\n\t}",
"public boolean isFileMissing(Date timeNow, char typeOfFile) {\r\n boolean isMissing = false;\r\n String getFile = null;\r\n \r\n if(typeOfFile == 'S')\r\n getFile = this.getScaFile();\r\n else if(typeOfFile == 'I')\r\n getFile = this.getImpFile();\r\n \r\n if (getFile != null) {\r\n isMissing = false;\r\n } else {\r\n //If the file doesn't exists, check if the directory is older than one hour\r\n long hDiff = dtUtil.getHoursDif(this.getDirDate(), timeNow);\r\n if (hDiff > 1) {\r\n isMissing = true;\r\n }\r\n }\r\n \r\n return isMissing;\r\n }"
] | [
"0.85381067",
"0.8339644",
"0.8253249",
"0.7958186",
"0.79543257",
"0.794079",
"0.79286766",
"0.78386945",
"0.74281955",
"0.6932908",
"0.6852711",
"0.66972256",
"0.66972256",
"0.66844267",
"0.6644685",
"0.65197283",
"0.6504495",
"0.6500503",
"0.6500503",
"0.64389414",
"0.64069027",
"0.63736814",
"0.635695",
"0.632969",
"0.63131815",
"0.62910223",
"0.6280294",
"0.6272972",
"0.6246426",
"0.6244973",
"0.6227035",
"0.6221835",
"0.6219608",
"0.6200042",
"0.61833394",
"0.618081",
"0.6147042",
"0.6143417",
"0.61428446",
"0.6139233",
"0.61141306",
"0.6104873",
"0.6083352",
"0.60772324",
"0.60712016",
"0.60707545",
"0.60466313",
"0.6035989",
"0.6029534",
"0.60242236",
"0.6022815",
"0.60218513",
"0.6014532",
"0.5998247",
"0.5974289",
"0.5971874",
"0.5959479",
"0.59559524",
"0.5949437",
"0.59360987",
"0.5913493",
"0.5909877",
"0.59074426",
"0.5896478",
"0.58919734",
"0.5886967",
"0.5886812",
"0.58849525",
"0.58807504",
"0.5879542",
"0.587614",
"0.5875795",
"0.5863597",
"0.58557796",
"0.5853101",
"0.5830789",
"0.5823585",
"0.58230084",
"0.5812845",
"0.5805469",
"0.579776",
"0.579011",
"0.57893765",
"0.5787046",
"0.5781973",
"0.57765883",
"0.5766961",
"0.5760706",
"0.5759864",
"0.5757284",
"0.5756093",
"0.5755951",
"0.57541186",
"0.5753114",
"0.5753003",
"0.5746939",
"0.57466686",
"0.5746441",
"0.57335126",
"0.5730318",
"0.57301104"
] | 0.0 | -1 |
check all adjacent nodes to the start node | private static void shortestPath(Graph graph, Character startNode, int algorithm) {
Node currentNode = graph.getNode(startNode);
// keep track of the nodes visited
List<Character> nodesVisited = new ArrayList<>();
// add the current node
nodesVisited.add(currentNode.getName());
// breadth first search to help keep track of the nodes we have already visited
// helps with backtracking
Stack<Node> visitingNodes = new Stack<>();
// loop through the graph
while (currentNode != graph.getNode('Z')) {
// we have visited a node
// add it to the stack
// set true to since its been visited and it will be in the shortest path
visitingNodes.add(currentNode);
currentNode.setNodeVisited(true);
currentNode.setInShortestPath(true);
// get all the edges that are connected to the current node we are on
List<Edge> adjacentNodes = currentNode.getNeighbors();
// temp for next node
Node nextNode = null;
int weightDistanceTotal = Integer.MAX_VALUE;
for (Edge i: adjacentNodes) {
// testing
// System.out.println(i.destination.getName());
// System.out.println(i.destination.getDistanceToZ());
// 1. always check to see if we have visited the node
if (i.destination.isNodeVisited()) {
// System.out.println(i.destination.getName() + " is already in the path");
continue;
}
// 2. assign the next node to the destination
if (nextNode == null) {
nextNode = i.destination;
}
// compare distances
if (algorithm == 1) {
nextNode = updateNextNodeAlgo1(nextNode, i.destination);
} else {
NodeWithWeightDistanceTotal nodeWithWeightDistanceTotal = updateNextNodeAlgo2(nextNode, i, weightDistanceTotal);
nextNode = nodeWithWeightDistanceTotal.node;
weightDistanceTotal = nodeWithWeightDistanceTotal.weightDistanceTotal;
}
//if (nextNode.getDistanceToZ() > i.destination.getDistanceToZ()) {
// nextNode = i.destination;
//}
}
// next has no other edges
if (nextNode == null) {
// System.out.println("There no place to go from " + currentNode.getName());
// pop off the node we just visited
nextNode = visitingNodes.pop();
// its not in the shortest path to Z
nextNode.setInShortestPath(false);
// set the next node to the previous node
nextNode = visitingNodes.pop();
}
// add the nodes we visit to keep track of the path
nodesVisited.add(nextNode.getName());
// System.out.println(Arrays.toString(nodesVisited.toArray()));
// testing purposes to see if the node is on the shortest path
// for (Character node: nodesVisited) {
// Node boolVisit = graph.getNode(node);
// System.out.println(boolVisit.isInShortestPath());
// }
// progress to the next node
currentNode = nextNode;
// when visiting the last node mark z in the shortest path
if (currentNode.getName() == 'Z') {
currentNode.setInShortestPath(true);
}
// testing
// System.out.println("next node = " + currentNode.getName());
}
// keep track of the path visited and the total addition of weights
int pathCounter = 0;
// construct the shortest path
List<Node> shortestPath = new ArrayList<>();
for (Character nodeVisitor: nodesVisited) {
// get the node
Node node = graph.getNode(nodeVisitor);
// add to the shortest path
if (node.isInShortestPath() && !shortestPath.contains(node)) {
shortestPath.add(node);
}
}
// print the shortest path
for (int i = 0; i < shortestPath.size() - 1; i++) {
currentNode = shortestPath.get(i);
Node nextNode = shortestPath.get(i + 1);
// find the weight of that node
int weight = currentNode.findWeight(nextNode);
pathCounter += weight;
// System.out.println("weight " + weight);
// System.out.println("path total " + pathCounter);
}
// final output
String fullPathSequence = "";
String shortestPathSequence = "";
for (int i = 0; i < nodesVisited.size(); i++) {
if (i != nodesVisited.size() - 1) {
fullPathSequence += nodesVisited.get(i) + " -> ";
}
}
fullPathSequence += nodesVisited.get(nodesVisited.size() - 1);
for (int i = 0; i < shortestPath.size(); i++) {
if (i != shortestPath.size() - 1) {
shortestPathSequence += shortestPath.get(i).getName() + " -> ";
}
}
if (currentNode.getName() == 'Z') {
shortestPathSequence += "Z";
} else {
shortestPathSequence += shortestPath.get(shortestPath.size() - 1).getName();
}
System.out.println("Algorithm " + algorithm + " : ");
System.out.println("Sequence of all nodes " + fullPathSequence);
System.out.println("Shortest path: " + shortestPathSequence);
System.out.println("Shortest path length: " + pathCounter);
System.out.println("\n");
// reset the graph
graph.graphReset();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Iterable<T> followNodeAndSelef(T start) throws NullPointerException;",
"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 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 }",
"@Override\n\tpublic boolean traverse(INode startNode, INode destinationNode) {\n\t\tif (isNeighbors(startNode, destinationNode) == true) {\n\t\t\tint zähler = 0;\n\t\t\tString result = \"\";\n\t\t\tMatrixNode startListNode = (MatrixNode) startNode;\n\t\t\tQueue<MatrixNode> queue = new ArrayDeque<>();\n\t\t\tqueue.add(startListNode);\n\t\t\tstartListNode.mark();\n\t\t\twhile (!queue.isEmpty()) { // solange queue nicht leer ist\n\t\t\t\t// erstes Element von der queue nehmen\n\t\t\t\tMatrixNode node = (MatrixNode) queue.poll();\n\t\t\t\tif (node.equals(destinationNode)) {\n\t\t\t\t\tSystem.out.println(\"Zähler: \" + zähler);\n\t\t\t\t\treturn true; // testen, ob Ziel-Knoten gefunden\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < nodes.size(); i++) {\n\t\t\t\t\tif (isNeighbors(node, nodes.get(i))) {\n\t\t\t\t\t\tif (!((MatrixNode) nodes.get(i)).getMark()) {\n\t\t\t\t\t\t\tqueue.add((MatrixNode) nodes.get(i));\n\t\t\t\t\t\t\t((MatrixNode) nodes.get(i)).mark();\n\t\t\t\t\t\t\tresult += node.getName() + \"-\" + nodes.get(i).getName();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tzähler++;\n\t\t\t\tSystem.out.println(result + \"||\");\n\t\t\t}\n\t\t}\n\t\treturn false; // Knoten kann nicht erreicht werden\n\t}",
"static void iterativeDfs(Node startingNode) {\n Set<Node> markedAsVisited = new HashSet<>();\n\n // creates a stack for piling up the nodes to visit\n ArrayDeque<Node> toBeVisited = new ArrayDeque<>();\n\n // sets the starting node as to be visited\n toBeVisited.push(startingNode);\n\n // adds the starting node to the set of marked as visited nodes\n markedAsVisited.add(startingNode);\n\n // while there nodes to visit\n while (!toBeVisited.isEmpty()) {\n\n // gets the current node\n Node current = toBeVisited.pop();\n\n // processes the node\n System.out.print(\"Node \" + current.val + \", \");\n\n // loops over the neighbours of the current node\n for (Node neighbour: current.neighbours) {\n\n // if the neighbour has not been already visited\n if (! markedAsVisited.contains(neighbour)) {\n\n // adds the neighbour to the ones to be visited\n toBeVisited.push(neighbour);\n\n // adds the neighbour to the set of marked as visited nodes\n markedAsVisited.add(neighbour);\n }\n }\n }\n }",
"@Override\r\n public boolean breadthFirstSearch(T start, T end) {\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n Queue<Vertex<T>> queue = new LinkedList<Vertex<T>>();\r\n Set<Vertex<T>> visited = new HashSet<>();\r\n\r\n queue.add(startV);\r\n visited.add(startV);\r\n\r\n while(queue.size() > 0){\r\n Vertex<T> next = queue.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if(next == endV){\r\n return true;\r\n }\r\n\r\n for (Vertex<T> neighbor: next.getNeighbors()){\r\n if(!visited.contains(neighbor)){\r\n visited.add(neighbor);\r\n queue.add(neighbor);\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }",
"public boolean compute() {\n\t\tif(this.startNode.equals(goalNode)) {\r\n\t\t\tSystem.out.println(\"Goal Node Found :)\");\r\n\t\t\tSystem.out.println(startNode);\r\n\t\t}\r\n\t\r\n\t\tQueue<Node> queue = new LinkedList<>();\r\n\t\tArrayList<Node> explored = new ArrayList<>();\r\n\t\tqueue.add(this.startNode);\r\n\t\texplored.add(startNode);\r\n\t\t\r\n\t\t//while queue is not empty\r\n\t\twhile(!queue.isEmpty()) {\r\n\t\t\t//remove and return the first node in the queue\r\n\t\t\tNode current = queue.remove();\r\n\t\t\tif(current.equals(this.goalNode)) {\r\n\t\t\t\tSystem.out.println(\"Explored: \" + explored + \"\\nQueue: \" + queue);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//dead end\r\n\t\t\t\tif(current.getChildren().isEmpty()){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t//add to queue the children of the current node\r\n\t\t\t\telse {\r\n\t\t\t\t\tqueue.addAll(current.getChildren());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\texplored.add(current);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"Iterable<T> followNode(T start) throws NullPointerException;",
"private int searchNext(JmtCell prev) {\r\n \t\tRectangle boundspadre = GraphConstants.getBounds((prev).getAttributes()).getBounds();\r\n \t\tObject[] listEdges = null;\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \t\tList<Object> next = new ArrayList<Object>();\r\n \r\n \t\tif (flag1 == false && prev.seen == false) {\r\n \r\n \t\t\t// Rectangle bounds =\r\n \t\t\t// GraphConstants.getBounds(((JmtCell)prev).getAttributes()).getBounds();\r\n \t\t\tif (!flag2) {\r\n \t\t\t\tboundspadre.setLocation(x, y + ((e + 1) * (42 + heightMax)) - (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t} else {\r\n \t\t\t\tboundspadre.setLocation(x - (int) (boundspadre.getWidth() / 2), y + ((e + 1) * (42 + heightMax))\r\n \t\t\t\t\t\t- (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t}\r\n \r\n \t\t\tGraphConstants.setBounds(prev.getAttributes(), boundspadre);\r\n \t\t\tx = (int) boundspadre.getCenterX() + widthMax + 50;\r\n \t\t\tprev.seen = true;\r\n \t\t\tflag2 = true;\r\n \t\t}\r\n \r\n \t\t// inserisco tutti gli archi uscenti e entranti di min.get(j) in\r\n \t\t// listEdges\r\n \t\tlistEdges = DefaultGraphModel.getOutgoingEdges(graphmodel, prev);\r\n \t\tVector<Object> listEdgestmp = new Vector<Object>();\r\n \t\tfor (Object listEdge : listEdges) {\r\n \t\t\tJmtCell qq = (JmtCell) (graphmodel.getParent(graphmodel.getTarget(listEdge)));\r\n \t\t\tif (!(qq).seen) {\r\n \t\t\t\tlistEdgestmp.add(listEdge);\r\n \t\t\t}\r\n \t\t}\r\n \t\tlistEdges = listEdgestmp.toArray();\r\n \r\n \t\tint numTarget = listEdges.length;\r\n \t\tif (numTarget == 0) {\r\n \t\t\treturn 1;\r\n \t\t}\r\n \r\n \t\tfor (int k = 0; k < numTarget; k++) {\r\n \t\t\tnext.add((graphmodel.getParent(graphmodel.getTarget(listEdges[k]))));\r\n \t\t}\r\n \r\n \t\tint j = 1;\r\n \t\tif (inRepositionSons == false && ((JmtCell) next.get(0)).seen == false) {\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t} else if (inRepositionSons == true && ((JmtCell) next.get(0)).seen == false) {\r\n \r\n \t\t\tRectangle bounds = GraphConstants.getBounds(((JmtCell) next.get(0)).getAttributes()).getBounds();\r\n \t\t\tbounds.setLocation((int) (boundspadre.getCenterX()) + widthMax + 50 - (int) (bounds.getWidth() / 2), (int) boundspadre.getCenterY()\r\n \t\t\t\t\t- (int) (bounds.getHeight() / 2));\r\n \t\t\tGraphConstants.setBounds(((JmtCell) next.get(0)).getAttributes(), bounds);\r\n \r\n \t\t\t((JmtCell) next.get(0)).seen = true;\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t}\r\n \r\n \t\tif (numTarget > 0) {\r\n \t\t\tif (!flag) {\r\n \t\t\t\trepositionSons(prev, next, j - 1, 1);\r\n \t\t\t} else {\r\n \t\t\t\trepositionSons(prev, next, -1, 0);\r\n \t\t\t}\r\n \t\t\tflag = false;\r\n \t\t}\r\n \r\n \t\t(prev).sons = 0;\r\n \t\tfor (int w = 0; w < numTarget; w++) {\r\n \t\t\tprev.sons += ((JmtCell) next.get(w)).sons;\r\n \t\t}\r\n \r\n \t\treturn prev.sons;\r\n \t}",
"public boolean hasNext() {\n return !left_nodes.isEmpty(); // DON'T FORGET TO MODIFY THE RETURN IF NEED BE\r\n\t\t}",
"public void recordNodeDistances(Node start, Node end)\n {\n HashSet<Node> inStack = new HashSet<Node>();\n LinkedList<Node> nodeStack = new LinkedList<Node>();\n\n nodeStack.push(start);\n\n Node curNode;\n\n while(!nodeStack.isEmpty())\n {\n //shortest distance from end to start = shortest distance of neighbor to start\n curNode = nodeStack.peekFirst();\n Collection<? extends Node> neighbors = curNode.getNeighbors();\n\n if(curNode == end) //if we've reached the end\n {\n nodeDists.put(curNode, 0); //the distance to the end is 0 (obviously)\n\n inStack.remove(curNode); //remove from our store of nodes that are in the stack\n nodeStack.removeFirst();\n }\n else\n {\n boolean readyForEval = true; //is node ready to have the min distance calculated?\n\n for (Node n : neighbors)\n {\n if (!nodeDists.containsKey(n) && !inStack.contains(n))\n {\n nodeStack.addFirst(n); //in order to calculate the min distance to target any neighbors not in\n inStack.add(n); //the stack must have already been calculated. Neighbors still in the stack\n //are to be considered closer to the source and, thus, \"behind\" curNode\n readyForEval = false;\n }\n }\n\n if (readyForEval)\n {\n int minDist = getMinDist(curNode); //get the minimum distance from this node to the target\n\n nodeDists.put(curNode, minDist); //if unreachable, distance is maxValue\n nodeStack.removeFirst();\n inStack.remove(curNode);\n }\n }\n }\n }",
"@Override\n\tpublic boolean findPath(PathfindingNode start, PathfindingNode end, ArrayList<PathfindingNode> path) \n\t{\n\t\tpath.clear();\n\t\t\n\t\t_visited.clear();\n\t\t_toVisit.clear();\n\t\t_parents.clear();\n\t\t_costsFromStart.clear();\n\t\t_totalCosts.clear();\n\n\t\t_costsFromStart.put(start, 0);\n\t\t_toVisit.add(start);\n\t\t_parents.put(start, null);\n\t\t\n\t\twhile (!_toVisit.isEmpty() && !_toVisit.contains(end))\n\t\t{\n\t\t\tPathfindingNode m = _toVisit.remove();\n\t\t\t\n\t\t\tint mCost = _costsFromStart.get(m);\n\t\t\t\n\t\t\tfor (int i = 0; i < m.getNeighbors().size(); ++i)\n\t\t\t{\n\t\t\t\tPathfindingNodeEdge n = m.getNeighbors().get(i);\n\t\t\t\tif (n.getNeighbor() != null && !_visited.contains(n.getNeighbor()))\n\t\t\t\t{\n\t\t\t\t\tint costFromSource = mCost + n.getCost();\n\t\t\t\t\tint totalCost = costFromSource + _estimator.estimate(n.getNeighbor(), end);\n\t\t\t\t\tif (!_toVisit.contains(n.getNeighbor()) || totalCost < _totalCosts.get(n.getNeighbor()))\n\t\t\t\t\t{\n\t\t\t\t\t\t_parents.put(n.getNeighbor(), m);\n\t\t\t\t\t\t_costsFromStart.put(n.getNeighbor(), costFromSource);\n\t\t\t\t\t\t_totalCosts.put(n.getNeighbor(), totalCost);\n\t\t\t\t\t\tif (_toVisit.contains(n.getNeighbor()))\n\t\t\t\t\t\t\t_toVisit.remove(n.getNeighbor());\n\t\t\t\t\t\t_toVisit.add(n.getNeighbor());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t_visited.add(m);\n\t\t}\n\t\t\n\t\tif (_toVisit.contains(end))\n\t\t{\n\t\t\t_reversePath.clear();\n\t\t\t\n\t\t\tPathfindingNode current = end;\n\t\t\twhile (current != null)\n\t\t\t{\n\t\t\t\t_reversePath.push(current);\n\t\t\t\tcurrent = _parents.get(current);\n\t\t\t}\n\t\t\t\n\t\t\twhile (!_reversePath.isEmpty())\n\t\t\t\tpath.add(_reversePath.pop());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpath.add(start);\n\t\t\treturn false;\n\t\t}\n\t}",
"public static <T> boolean routeBetween2NodesBFS(MyGraph<T> graph, MyNode<T> start, MyNode<T> end) {\n if (start == end) return true;\n LinkedList<MyNode<T>> queue = new LinkedList<>();\n queue.add(start);\n while (!queue.isEmpty()) {\n MyNode<T> u = queue.removeFirst();\n if (u != null) {\n for (MyNode<T> node : u.getAdjacent()) {\n if (node.getState() == State.Unvisited) {\n if (node == end) {\n return true;\n } else {\n node.setState(State.Visiting);\n queue.add(node);\n }\n }\n }\n\n }\n }\n return false;\n }",
"public boolean hasNeighbours() {\n\t\tif (this.eltZero != null || this.eltOne != null || this.eltTwo != null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"static private void checkStartNode(PathFinder pathFinder) {\n for (Node n : pathFinder.getSpaceTimeGrid().getNodeLayerPointer(pathFinder.getStartTime()).getNodeList()) {\n if (n.getX() == pathFinder.getStartNode().getX() && n.getY() == pathFinder.getStartNode().getY()) {\n return;\n }\n }\n throw new PathNotPossibleException(\"The start point was placed outside the SpaceTimeGrid: (\" + pathFinder.getStartNode().getX() + \";\" + pathFinder.getStartNode().getY() + \")\");\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 }",
"private boolean allAdjacentUsed(Box box) {\n if (box == null)\n throw new IllegalArgumentException(\"Error. null pointer in allAdjacentUsed(box).\");\n return isNextBoxUsed(box, 0) && isNextBoxUsed(box, 1) && isNextBoxUsed(box, 2) && isNextBoxUsed(box, 3);\n }",
"private int checkNeighbours(ArrayList<ArrayList<T>> currNodes, ArrayList<T> goal, int distance, ArrayList<ArrayList<T>> checkedNodes) {\n if (currNodes.contains(goal)) {\n return distance;\n }\n \n ArrayList<ArrayList<T>> neighbours = new ArrayList<ArrayList<T>>();\n //Go through all nodes at level\n for (int i = 0; i < currNodes.size(); i++) {\n ArrayList<T> node = currNodes.get(i);\n T nodeLabel = node.get(0);\n ArrayList<T> connectedNodes = neighbours(nodeLabel);\n //Go through all the connected nodes\n for (int n = 0; n < connectedNodes.size(); n++) {\n ArrayList<T> conNode = labelToVert(connectedNodes.get(n));\n //If the node hasn't yet been checked, add it to the list of neighbours\n if (!checkedNodes.contains(conNode)) {\n neighbours.add(conNode);\n }\n }\n }\n //Determine if source and target are disconnected\n if (neighbours.size() == 0) return disconnectedDist;\n \n checkedNodes.addAll(currNodes);\n //Perform the same set of checks on the next unchecked neighbours\n return checkNeighbours(neighbours, goal, ++distance, checkedNodes);\n }",
"@Override\r\n public boolean isConnected(V start, V destination) {\r\n return !shortestPath(start, destination).isEmpty();\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 }",
"private Node Astar(Node start, Node end) {\n Queue<Node> order = new PriorityQueue<>();\n Set<Node> visited = new HashSet<>();\n\n order.add(start); // add our start node to the queue\n\n while (!order.isEmpty()) {\n // do Astar LOGIC\n Node n = order.poll();\n visited.add(n);\n if (n.equals(end)) return n; // found our path\n else {\n for (Position p : n.getPos().getNeighbours()) {\n Node neighbour = new Node(n, p);\n neighbour.setGoal(end);\n if (!visited.contains(neighbour) && isRoom(p))\n order.add(neighbour);\n }\n }\n }\n throw new IllegalArgumentException(\"Path finder has failed\");\n }",
"private boolean checkScanNodesCompleted() {\n\t\treturn cursor.getSelectionPos() >= jedisNodes.size();\n\t}",
"private boolean hasAdjacent(int node) {\n for (int i = 0; i < this.matrix[node].length; i++) {\n if (this.matrix[node][i]) {\n return true;\n }\n\n }\n return false;\n }",
"public boolean isAdjacent(int from, int to) {\n //your code here\n \tfor (Edge e : myAdjLists[from]) {\n \t\tif (e.to() == to) {\n \t\t\treturn true;\n \t\t}\n \t}\n return false;\n }",
"public abstract boolean isNextVisited();",
"public Set<Vertex> pre(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByEnd.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByEnd.get(start)){\n\t\t\treach.add(trans.getStart());\n\t\t}\n\t\treturn reach;\n\t}",
"boolean hasNextNode()\r\n\t{\n\t\tif (getLink() == null) return false;\r\n\t\telse return true;\r\n\t}",
"public boolean finished() {\r\n\t\tboolean allOccupied = true;\r\n\t\tfor (Node n : allNodes.values()) {\r\n\t\t\tif (n.path == 0) {\r\n\t\t\t\tallOccupied = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (allOccupied) {\r\n\r\n\t\t\tfor (Integer path : paths.keySet()) {\r\n\t\t\t\tStack<Node> sn=paths.get(path);\r\n\t\t\t\tNode n = sn.peek();\r\n\t\t\t\tif (!EndPoint.containsValue(n)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (sn.size() > 1) {\r\n\t\t\t\t\tStack<Node> snBK = (Stack<Node>) sn.clone();\r\n\t\t\t\t\t\r\n\t\t\t\t\tNode n1 = snBK.pop();\r\n\t\t\t\t\twhile (!snBK.isEmpty()) {\r\n\t\t\t\t\t\tif(n1.path!=path)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\tNode n2= snBK.pop();\r\n\t\t\t\t\t\tif(adjaMatrix[n1.index][n2.index]==0)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tn1=n2;\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\t}\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}",
"private void breadthFirstSearch (int start, int[] visited, int[] parent){\r\n Queue< Integer > theQueue = new LinkedList< Integer >();\r\n boolean[] identified = new boolean[getNumV()];\r\n identified[start] = true;\r\n theQueue.offer(start);\r\n while (!theQueue.isEmpty()) {\r\n int current = theQueue.remove();\r\n visited[current] = 1; //ziyaret edilmis vertexler queuedan cikarilan vertexlerdir\r\n Iterator < Edge > itr = edgeIterator(current);\r\n while (itr.hasNext()) {\r\n Edge edge = itr.next();\r\n int neighbor = edge.getDest();\r\n if (!identified[neighbor]) {\r\n identified[neighbor] = true;\r\n theQueue.offer(neighbor);\r\n parent[neighbor] = current;\r\n }\r\n }\r\n }\r\n }",
"public abstract boolean hasEdge(int from, int to);",
"boolean hasIsMidNode();",
"public boolean pathExists(int start, int end) {\n boolean[] visited = new boolean[nodeCount];\n // find a path with a greedy search\n PairHeap q = new PairHeap();\n visited[start] = true;\n int next = start;\n try {\n while (next != end) {\n // check every neighbour of next - add if necessary\n for (int j = 0; j < nodeCount; j++) {\n if (roads[next][j] > 0 && !visited[j]) { // connected\n visited[j] = true;\n int x = xs[j] - xs[end];\n int y = ys[j] - ys[end];\n int d = (int) Math.sqrt(x * x + y * y);\n q.insert(j, d);\n }\n }\n next = q.deleteMin();\n }\n return true;\n } catch (NullPointerException e) {\n return false;\n }\n }",
"public void dfsPrint(Node start){\n Stack<Node> stack = new Stack<>();\n Set<Node> visited = new HashSet<>(); //we can use integer for better space\n\n stack.push(start);\n while (!stack.isEmpty()){\n Node curr = stack.pop();\n if(!visited.contains(curr)){\n visited.add(curr);\n //do something\n }\n for(Node n: curr.adj){\n if(!visited.contains(n)){\n stack.push(n);\n }\n }\n }\n }",
"private void depthFirstSearch(Slot start, ArrayList<Pair<Slot, Slot>> moves, HashMap<Slot, Slot> parents) {\n boolean[][] visitedSlots = new boolean[Board.MAX_ROW][Board.MAX_COLUMN];\n\n setSlotsAsNotVisited(visitedSlots);\n\n Stack<Slot> dfsStack = new Stack<>();\n int color = start.getColor();\n\n dfsStack.push(start);\n Slot previous = start;\n\n boardObject.setSlotColor(boardObject.getSlot(start.getRow(), start.getColumn()), Slot.EMPTY);\n\n while (!dfsStack.empty()) {\n Pair<Slot, Slot> next;\n Slot current = dfsStack.pop();\n\n if (!visitedSlots[current.getRow()][current.getColumn()] && !current.equals(previous)) {\n if (!current.equals(start)) {\n visitedSlots[current.getRow()][current.getColumn()] = true;\n }\n\n next = new Pair<>(start, current);\n\n moves.add(next);\n }\n\n Slot up = getUp(current);\n Slot down = getDown(current);\n Slot left = getLeft(current);\n Slot right = getRight(current);\n\n if (left != null && !visitedSlots[left.getRow()][left.getColumn()]) {\n if (!isChild(current, left, parents)) {\n dfsStack.push(left);\n parents.put(left, current);\n }\n }\n\n if (down != null && !visitedSlots[down.getRow()][down.getColumn()]) {\n if (!isChild(current, down, parents)) {\n dfsStack.push(down);\n parents.put(down, current);\n }\n }\n\n if (right != null && !visitedSlots[right.getRow()][right.getColumn()]) {\n if (!isChild(current, right, parents)) {\n dfsStack.push(right);\n parents.put(right, current);\n }\n }\n\n if (up != null && !visitedSlots[up.getRow()][up.getColumn()]) {\n if (!isChild(current, up, parents)) {\n dfsStack.push(up);\n parents.put(up, current);\n }\n }\n\n previous = current;\n }\n\n boardObject.setSlotColor(boardObject.getSlot(start.getRow(), start.getColumn()), color);\n }",
"private boolean dfs(int start, List<List<Integer>> list, int[] colors) {\n \tcolors[start] = GRAY;\n \tboolean result = true;\n \tList<Integer> edges = list.get(start);\n \tfor(int edge : edges) {\n \t\tif(colors[edge] == WHITE) {\n \t\t\tresult = result & dfs(edge, list, colors);\n \t\t} else if(colors[edge] == GRAY) {\n \t\t\tresult = false;\n \t\t}\n \t}\n \tcolors[start] = BLACK;\n \treturn result;\n }",
"private boolean isValid(AStarNode start, AStarNode end) {\n boolean check = true;\n for (Obstacle obs : getObstacles()) {\n if (isOnTheWay(start, end, obs))\n check = false;\n }\n return check;\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 }",
"@Override\n public boolean checkForBinarySearchTree() {\n if (this.rootNode == null)\n return true;\n \n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n for (int i=1; i<inorderTraverse.size(); i++) {\n if(inorderTraverse.get(i-1).compareTo(inorderTraverse.get(i)) == 1)\n return false;\n }\n \n return true;\n }",
"private boolean checkNext(){\n boolean ret = this.hasNext;\n if ((this.allStatesIterator.hasNext()) || (this.allSubsetsIterator.hasNext()) || (this.allTransitionsIterator.hasNext())){\n hasNext = true;\n return hasNext;\n }\n hasNext = false;\n return ret;\n }",
"public boolean isAdjacent(int from, int to) {\r\n LinkedList<Edge> testList = myAdjLists[from];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tif (testList.get(counter).myTo == to) {\r\n \t\treturn true;\r\n \t}\r\n \tcounter++;\r\n }\r\n return false;\r\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}",
"private static boolean AllCellsVisited()\n {\n for (Cell arr[] : cells){\n for (Cell c : arr)\n {\n if (!c.Visited)\n {\n return false;\n }\n }\n }\n return true;\n }",
"protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getSuccessorEdges(this.getNext()).isEmpty();\n }",
"public boolean checkLastNodeStatus()\r\n {\r\n return visitedNodes.isEmpty();\r\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 boolean canReachDFS(Dot startNode, Dot finishNode ) {\n Set< Dot > visited = new HashSet<>();\n visited.add( startNode );\n\n visitDFS( startNode, visited );\n return visited.contains( finishNode );\n }",
"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}",
"@Override\n\tpublic void run() {\n\t\tMap<Integer, Location> possibleStartLocations = possibleStartLocations();\n\n\t\tfor(Entry<Integer, Location> startLocation : possibleStartLocations.entrySet()) {\n\t\t\t// Add startLocation to visited locations\n\t\t\tMap<Integer, Location> visitedLocations = new HashMap<Integer, Location>();\n\t\t\tvisitedLocations.put(startLocation.getKey(), startLocation.getValue());\n\t\t\t\n\t\t\t// Add startLocation to visited order\n\t\t\tList<Location> visitedOrder = new LinkedList<Location>();\n\t\t\tvisitedOrder.add(startLocation.getValue());\n\t\t\t\n\t\t\t// Start the recursion for the following start node\n\t\t\tfindSolution(startLocation, startLocation, visitedLocations, visitedOrder, 0);\n\t\t}\n\t}",
"public void dfs (int start) {\n vertexList[start].wasVisited = true; // mark it\n print(start); stack.push(start);\n while (!stack.isEmpty()) {\n int b = getNextUnvisitedNeighbor(stack.peek());\n if (b==-1) stack.pop(); // no unvisited neighbor;\n else {\n vertexList[b].wasVisited = true;\n print(b); stack.push(b);\n }\n }\n // clear wasVisited marks\n }",
"private boolean findPath(Node b, Node e) throws GraphException{\n\t\t\n\t\t//mark start node and push it on stack\n\t\tb.setMark(true);\n\t\tthis.S.push(b);\n\t\t\t\t\n\t\t// base case, start is the end and we did not exceed the number of bus changes limit\n\t\tif (this.changeCount <= this.changes && b == e){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// variables to hold old values in case we need to change back\n\t\tint holdOldValue = this.changeCount;\n\t\tString holdLine = this.testLine;\n\t\t\n\t\t//iterator over the edges incident on the start node\n\t\tIterator<Edge> iter = this.graph.incidentEdges(b);\n\t\t\n\t\t// loop through incident edges\n\t\twhile(iter.hasNext()){\n\t\t\tEdge line = iter.next();\n\t\t\tString s = line.getBusLine();\n\t\t\t// increase the bus changes count if we change busLines\n\t\t\tif (!s.equals(this.testLine)){\n\t\t\t\tthis.changeCount++;\n\t\t\t}\n\t\t\t// set the bus line to the current one we are on\n\t\t\tthis.testLine = s;\n\t\t\t\n\t\t\t// take the node that is connected to start node via the edge\n\t\t\tNode u;\n\t\t\tif(line.secondEndpoint().equals(b)){\n\t\t\t\tu = line.firstEndpoint();\n\t\t\t}else{\n\t\t\t\tu = line.secondEndpoint();\n\t\t\t}\n\t\t\t// make sure node is not marked and perform a recursive call on it if\n\t\t\t// also make sure that the number of changes allowed has not already been exceeded\n\t\t\tif (u.getMark() != true && this.changeCount <= this.changes){\n\t\t\t\tif (findPath(u, e) == true){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// undo changes to bus change count and current bus line if we move backwards\n\t\t\tif (holdOldValue < this.changeCount){\n\t\t\t\tthis.changeCount--;\n\t\t\t\tthis.testLine = holdLine;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// unset the start node so that other recursive calls can use it and pop it off the stack\n\t\tb.setMark(false);\n\t\tthis.S.pop();\n\t\t\n\t\treturn false;\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}",
"@Override\n public boolean hasNext() {\n // If there is a valid next, return true\n if (this.next != null){\n return true;\n } else {\n // If next is not calculated, compute the next valid\n Node<S> next = popNextUnvisitedNode();\n this.next = next;\n return next != null;\n }\n }",
"private void runLoopCheck(HashMap<IconMain, Set<IconMain>> connections, IconMain iconFrom) {\n visited.add(iconFrom);\n if (connections.containsKey(iconFrom)) {\n Set<IconMain> set = connections.get(iconFrom);\n\n for (IconMain iconTo : set) {\n while (!iconTo.iconType.equals(\")\")) {\n if (visited.contains(iconTo)) {\n break;\n }\n runLoopCheck(connections, iconTo);\n }\n visited.add(iconTo);\n }\n }\n }",
"private boolean cycleCheck(Node current, Queue<Node> expanded){\n\n if( expanded.size() == 0){\n return false; //Because current is root\n }\n\n for(Node nodeInExpanded : expanded){\n\n if(current!=null && current.getDigit().getDigitString().equals(nodeInExpanded.getDigit().getDigitString())){\n //the digits are same so we check children.\n\n ArrayList<String> currentChildren = makeChildren(current);\n ArrayList<String> childrenOfExpanded = makeChildren(nodeInExpanded);\n\n int size;\n\n if(currentChildren.size() > childrenOfExpanded.size() ){\n size = childrenOfExpanded.size();\n }else if(currentChildren.size() < childrenOfExpanded.size()){\n size = currentChildren.size();\n }else{\n size = childrenOfExpanded.size();\n }\n /*\n I use the modulus operator so that I dont get a ArrayIndexOut of Bounds\n */\n\n if( currentChildren.size() == childrenOfExpanded.size()\n && currentChildren.get(0%size).equals(childrenOfExpanded.get(0%size))\n && currentChildren.get(1%size).equals(childrenOfExpanded.get(1%size))\n && currentChildren.get(2%size).equals(childrenOfExpanded.get(2%size))\n && currentChildren.get(3%size).equals(childrenOfExpanded.get(3%size))\n ){\n return true;\n }\n }\n }\n\n return false;\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 void walkRandom(Cell start) {\n //2.1 mark start as visited\n start.visit();\n //2.2 find unvisited neighbors of start cell\n Cell[] unvisitedNeighborsOfStart = getNeighbors(start, false);\n //2.3 if there are no unvisited neighbors, go hunting --> maybe delete this step here\n if (unvisitedNeighborsOfStart.length == 0) {\n return;\n }\n //3.1 choose random univisited neighbor\n Cell randomUnvisitedNeighbor = randomUnvisitedNeighbor(start);\n //3.2 connect start and random unvisited neighbot\n start.carveThrough(randomUnvisitedNeighbor);\n //4.1 choose random unvisited neighbor as new start\n walkRandom(randomUnvisitedNeighbor);\n }",
"protected void scanNodesForRecursion(Cell cell, HashSet<Cell> markCellForNodes, NodeProto [] nil, int start, int end)\n \t{\n \t\tfor(int j=start; j<end; j++)\n \t\t{\n \t\t\tNodeProto np = nil[j];\n \t\t\tif (np instanceof PrimitiveNode) continue;\n \t\t\tCell otherCell = (Cell)np;\n \t\t\tif (otherCell == null) continue;\n \n \t\t\t// subcell: make sure that cell is setup\n \t\t\tif (markCellForNodes.contains(otherCell)) continue;\n \n \t\t\tLibraryFiles reader = this;\n \t\t\tif (otherCell.getLibrary() != cell.getLibrary())\n \t\t\t\treader = getReaderForLib(otherCell.getLibrary());\n \n \t\t\t// subcell: make sure that cell is setup\n \t\t\tif (reader != null)\n \t\t\t\treader.realizeCellsRecursively(otherCell, markCellForNodes, null, 0);\n \t\t}\n \t\tmarkCellForNodes.add(cell);\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 }",
"private void initiate(Node start) {\n\t\t\tfor (Node node : network.nodes.values()){\r\n\t \r\n\t \t\tdouble nodeCost;\r\n\t if(node.getId() == start.getId()){\r\n\t \tnodeCost = 0.;\r\n\t }\r\n\t else{\r\n\t \tnodeCost = Double.MAX_VALUE;\r\n\t }\r\n\t DijkstraNode dijk = new DijkstraNode(node, nodeCost);\r\n\t this.remainingNodes.add(dijk);\r\n\t this.correspondingNodes.put(node, dijk);\r\n\t }\r\n\t \tCollections.sort(this.remainingNodes);\r\n//\t \tSystem.out.println(\"remainingNodes.size = \" + remainingNodes.size());\r\n\t }",
"@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 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 }",
"private boolean adjacent(Location a, Location b)\n {\n for (Location loc: getAdjacentLocations(a))\n {\n if (loc.equals(b))\n return true;\n }\n return false;\n }",
"public void assignSorting(final CFANode start) {\n\n final Set<CFANode> finished = new HashSet<>();\n\n final Deque<CFANode> nodeStack = new ArrayDeque<>();\n @SuppressWarnings(\"JdkObsolete\") // ArrayDeque doesn't work here because we store nulls\n final Deque<Iterator<CFANode>> iteratorStack = new LinkedList<>();\n\n nodeStack.push(start);\n iteratorStack.push(null);\n\n while (!nodeStack.isEmpty()) {\n assert nodeStack.size() == iteratorStack.size();\n\n final CFANode node = nodeStack.peek();\n Iterator<CFANode> successors = iteratorStack.peek();\n\n if (successors == null) {\n // Entering this stack frame.\n // This part of the code corresponds to the code in checkIds()\n // before the for loop.\n\n if (!finished.add(node)) {\n // already handled, do nothing\n\n // Do a simulated \"return\".\n nodeStack.pop();\n iteratorStack.pop();\n continue;\n }\n\n // enter the for loop\n successors = CFAUtils.successorsOf(node).iterator();\n iteratorStack.pop();\n iteratorStack.push(successors);\n }\n\n if (successors.hasNext()) {\n // \"recursive call\"\n // This part of the code corresponds to the code in checkIds()\n // during the loop.\n CFANode successor = successors.next();\n\n // Do a simulated \"function call\" by pushing something on the stacks,\n // creating a new stack frame.\n nodeStack.push(successor);\n iteratorStack.push(null);\n\n } else {\n // All children handled.\n // This part of the code corresponds to the code in checkIds()\n // after the loop.\n node.setReversePostorderId(reversePostorderId++);\n\n // Do a simulated \"return\".\n nodeStack.pop();\n iteratorStack.pop();\n }\n }\n\n // Disabled because the recursive algorithm throws StackOverflowError\n // for large files.\n //assert checkIds(start);\n }",
"public boolean hasPath(int[][] maze, int[] start, int[] destination) {\n if (isWall(maze, start[0], start[1])) {\n return false;\n }\n\n boolean[][] visited = new boolean[maze.length][maze[0].length];\n\n Queue<int[]> queue = new LinkedList<>();\n queue.add(start);\n\n int[] currentPosition = null;\n visited[start[0]][start[1]] = true;\n while ((currentPosition = queue.poll()) != null) {\n int row = currentPosition[0];\n int col = currentPosition[1];\n\n // whether is destination\n if (reachDest(destination, row, col)) {\n return true;\n }\n\n // for all the 4 neighbours of current position\n for (int i = 0; i < 4; i++) {\n int nRow = row + neighbourDir[i][0]; // neighbour row\n int nCol = col + neighbourDir[i][1]; // neighbour col\n\n // keep going when there is no wall\n while (!isWall(maze, nRow, nCol)) {\n nRow += neighbourDir[i][0];\n nCol += neighbourDir[i][1];\n }\n\n // To get here, means current position is a wall, so the coordinate should be adjusted\n int lastRow = nRow - neighbourDir[i][0];\n int lastCol = nCol - neighbourDir[i][1];\n\n if (!isWall(maze, lastRow, lastCol) && !visited[lastRow][lastCol]) {\n // not visited\n visited[lastRow][lastCol] = true;\n queue.add(new int[]{lastRow, lastCol});\n }\n }\n\n }\n\n return false;\n }",
"private void phaseOne(){\r\n\r\n\t\twhile (allNodes.size() < endSize){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//Pick a random node from allNodes\r\n\t\t\t\tint idx = random.nextInt(allNodes.size());\r\n\t\t\t\tNode node = allNodes.get(idx);\r\n\r\n\t\t\t\t//Get all relationships of node\t\t\t\t\r\n\t\t\t\tIterable<Relationship> ite = node.getRelationships(Direction.BOTH);\r\n\t\t\t\tList<Relationship> tempRels = new ArrayList<Relationship>();\r\n\r\n\t\t\t\t//Pick one of the relationships uniformly at random.\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\ttempRels.add(rel);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tidx = random.nextInt(tempRels.size());\r\n\t\t\t\tRelationship rel = tempRels.get(idx);\r\n\t\t\t\tNode neighbour = rel.getOtherNode(node);\r\n\r\n\t\t\t\t//Add the neighbour to allNodes\r\n\t\t\t\tif (!allNodes.contains(neighbour)){\r\n\t\t\t\t\tallNodes.add(neighbour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttx.success();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\t//If reached here, then phase one completed successfully.\r\n\t\treturn;\r\n\t}",
"public boolean hasNext(){\r\n\t\t\tif (expectedModCount != modCount){\r\n\t\t\t\tthrow new ConcurrentModificationException();\r\n\t\t\t}\r\n\t\t\t//Check this condition, may need to check for empty future nodes\r\n\t\t\tif ((current == null)){//&&(currentNode.getLast()==current)){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t\t//current is not endmarker, \r\n\t\t\t\r\n\t\t\t/*if ((currentNode.getLast()!=current))\r\n\t\t\t\treturn true;\r\n\t\t\tif (currentNode.next.getArraySize()!= 0)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;*/\r\n\t\t}",
"protected boolean hasConnection(int start, int end) {\n\t\tfor (Gene g : genes.values()) {\n\t\t\tif (g.start == start && g.end == end)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private static int breadthFirstSearch(Vertex start) throws Queue.UnderflowException, Queue.EmptyException {\n boolean visited[] = new boolean[48];\n //Keep a queue of vertecies and a queue of the depth of the verticies - they will be added to and poped from identically\n ListQueue<Vertex> queue = new ListQueue<Vertex>();\n ListQueue<Integer> numQueue = new ListQueue<Integer>();\n //Set the starting node as visited\n visited[start.index()] = true;\n queue.enqueue(start);\n numQueue.enqueue(new Integer(1));\n\n //Keep last\n int last = -1;\n //While the queue isnt empty\n while (!queue.isEmpty()) {\n //Pop off the top from both queues and mark as visited\n start = queue.dequeue();\n int current = numQueue.dequeue();\n visited[start.index] = true;\n //For all neigbors\n for (Vertex v : start.neighbors) {\n //If we havent visited it make sure to visit it\n if (visited[v.index()] == false) {\n //As we keep adding new nodes to visit keep track of the depth\n queue.enqueue(v);\n numQueue.enqueue(current + 1);\n }\n }\n //Keep track of the most recent depth before we pop it off (queue will be empty when we exit)\n last = current;\n }\n //Return the max of the depth\n return last;\n }",
"Path run(Maze maze, Cell start, Cell finish) {\n Path path = new Path();\n if (start.equals(finish)) {\n path.add(start);\n return path;\n }\n Maze changed = new Maze(maze);\n CellQueue queue = new CellQueueLinkedListImpl();\n queue.enqueue(start);\n changed.setCellValue(start, 0);\n Cell curCell;\n do {\n curCell = queue.dequeue();\n for (int i = -1; i <= 1; i++) {\n for (int j = -1; j <= 1; j++) {\n for (int k = -1; k <= 1; k++) {\n Cell curNeighbour = new Cell(curCell.x + i, curCell.y + j, curCell.z + k);\n //check that curNeighbour exists and empty\n if (changed.getCellValue(curNeighbour) == -1) {\n changed.setCellValue(curNeighbour, changed.getCellValue(curCell) + 1);\n queue.enqueue(curNeighbour);\n }\n }\n }\n }\n } while (!queue.isEmpty() && !curCell.equals(finish));\n if (!curCell.equals(finish)) {\n return path;\n }\n while (!curCell.equals(start)) {\n path.addBegin(curCell);\n int curPathIndex = changed.getCellValue(curCell);\n boolean foundPrev = false;\n for (int i = -1; i <= 1 && !foundPrev; i++) {\n for (int j = -1; j <= 1 && !foundPrev; j++) {\n for (int k = -1; k <= 1 && !foundPrev; k++) {\n Cell curNeighbour = new Cell(curCell.x + i, curCell.y + j, curCell.z + k);\n if (changed.getCellValue(curNeighbour) == changed.getCellValue(curCell) - 1) {\n curCell = curNeighbour;\n foundPrev = true;\n }\n }\n }\n }\n }\n path.addBegin(start);\n return path;\n }",
"private static Boolean detectLoop(Node head2) {\n\t\tHashSet<Node> s = new HashSet<Node>();\n\t\twhile (head2 != null) {\n\t\t\tif (s.contains(head2))\n\t\t\t\treturn true;\n\t\t\ts.add(head2);\n\t\t\thead2 = head2.next;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean bfs(Node start, String elementToFind) {\r\n if (!graph.containsNode(start)) {\r\n return false;\r\n }\r\n if (start.getElement().equals(elementToFind)) {\r\n return true;\r\n }\r\n Queue<Node> toExplore = new LinkedList<Node>();\r\n marked.add(start);\r\n toExplore.add(start);\r\n while (!toExplore.isEmpty()) {\r\n Node current = toExplore.remove();\r\n for (Node neighbor : graph.getNodeNeighbors(current)) {\r\n if (!marked.contains(neighbor)) {\r\n if (neighbor.getElement().equals(elementToFind)) {\r\n return true;\r\n }\r\n marked.add(neighbor);\r\n toExplore.add(neighbor);\r\n }\r\n }\r\n }\r\n return false;\r\n }",
"public List<Node> findPath(Node start);",
"@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 List<Node> find(Node start, Node finish){\n reachable.add(start);\n this.finish = finish;\n\n while(!reachable.isEmpty()){\n // Select a node from the reachable list\n // If we've reached the end, return the list of nodes in our path\n \n Node node = selectNode(reachable);\n if(node.isEqual(finish)){\n return getPath(node);\n }\n\n // Otherwise, remove the new node from the reachable list, and add it to the \n // visited list so we don't look at a node more than necessary. Build a list of the\n // nodes that are adjacent to our current node.\n \n reachable.remove(node);\n visited.add(node);\n List<Node> adjacent = getAdjacent(node);\n\n // If the current node has adjacent nodes, and if we haven't looked at those nodes before,\n // add those nodes to the reachable list. If the node's cost is lower than 1+the cost to reach it,\n // make the node's parent the previous node and set the cost\n if(!adjacent.isEmpty()) {\n for (Node n : adjacent) {\n if (!reachable.contains(n)&&!visited.contains(n)) {\n reachable.add(n);\n }\n if (node.getCostEstimated() + 1 <= n.getCostEstimated()) {\n n.setParent(node);\n n.setCostEstimated(node.getCostEstimated() + 1);\n }\n }\n }\n }\n return null;\n }",
"private void checkTargetsReachable(){\n\t\tPathfinder pathfinder = new Pathfinder(collisionMatrix);\n\t\tLinkedList<Node> removeList = new LinkedList<Node>();\n\t\tboolean pathWasFound = false;\n\t\tLinkedList<Node> currentPath;\n\t\tLinkedList<Node> reversePath;\n\t\t\n\t\t//Go through all starting positions\n\t\tfor(LinkedList<Node> startList : targets){\n\t\t\tprogress += 8;\n\t\t\tsetProgress(progress);\n\t\t\tfor(Node startNode : startList){\n\t\t\t\t\n\t\t\t\tboolean outsideMap = (startNode.getCollisionXPos(scaleCollision) < 0 || startNode.getCollisionXPos(scaleCollision) >= (collisionMatrix.length-1) || startNode.getCollisionYPos(scaleCollision) < 0 || startNode.getCollisionYPos(scaleCollision) >= (collisionMatrix.length-1));\n\t\t\t\t\n\t\t\t\tpathWasFound = false;\n\t\t\t\t//Make sure that target is inside of map\n\t\t\t\tif(!outsideMap){\n\t\t\t\t\t//Check against all target positions\n\t\t\t\t\tfor(LinkedList<Node> targetList : targets){\n\t\t\t\t\t\tfor(Node targetNode : targetList){\n\t\t\t\t\t\t\t//Only check against targets that have not already been marked as unreachable\n\t\t\t\t\t\t\tboolean selfCheck = (targetNode.getXPos() != startNode.getXPos() || targetNode.getYPos() != startNode.getYPos());\n\t\t\t\t\t\t\tif(!removeList.contains(targetNode) && selfCheck){\n\t\t\t\t\t\t\t\t//Check if this path has already been checked\n\t\t\t\t\t\t\t\tif(!preCalculatedPaths.containsKey(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision))){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcurrentPath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t//Check if a path can be found for this start and target node\n\t\t\t\t\t\t\t\t\tif(pathfinder.findPath(startNode.getCollisionXPos(scaleCollision), startNode.getCollisionYPos(scaleCollision), targetNode.getCollisionXPos(scaleCollision), targetNode.getCollisionYPos(scaleCollision), currentPath)){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(Frame.USE_PRECALCULATED_PATHS)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision), currentPath);\n\t\t\t\t\t\t\t\t\t\t\treversePath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t\t\treversePath.addAll(currentPath);\n\t\t\t\t\t\t\t\t\t\t\tCollections.reverse(reversePath);\n\t\t\t\t\t\t\t\t\t\t\treversePath.removeFirst();\n\t\t\t\t\t\t\t\t\t\t\treversePath.add(startNode);\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(targetNode.toStringCollision(scaleCollision) + \"-\" + startNode.toStringCollision(scaleCollision) ,reversePath);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpathWasFound = true;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tpathWasFound = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Remove nodes which we cannot find a path from\n\t\t\t\tif(!pathWasFound){\n\t\t\t\t\tremoveList.add(startNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Go through the remove list and remove unreachable nodes\n\t\tfor(Node node : removeList){\n\t\t\tfor(LinkedList<Node> startList : targets){\n\t\t\t\tstartList.remove(node);\n\t\t\t}\n\t\t}\n\t}",
"public List<Node> getAdjacent(Node node){\n\n int nodeX, x = node.getX();\n int nodeY, y = node.getY();\n List<Node> adj = new ArrayList<Node>();\n\n for(Node n:allNodes){\n if(n.isReachable()) {\n nodeX = n.getX();\n nodeY = n.getY();\n if ((Math.abs(nodeX - x) == 1 && nodeY == y) || (nodeX == x && Math.abs(nodeY - y) == 1)) {\n adj.add(n);\n //if(node.getCost()==n.getCost()||n.getCost()==1) n.setCost(node.getCost()+1);\n }\n }\n }\n\n return adj;\n }",
"public boolean hasNext(){\r\n return node != null;\r\n }",
"@Override\r\n\tpublic boolean BFS(E src) {\r\n\t\tif(containsVertex(src)) {\r\n\t\t\tVertex<E> s = vertices.get(src);\r\n\t\t\tlastSrc = s;\r\n\t\t\tvertices.forEach((E e, Vertex<E> u) -> {\r\n\t\t\t\tu.setColor(Color.WHITE);\r\n\t\t\t\tu.setDistance(Integer.MAX_VALUE);\r\n\t\t\t\tu.setPredecessor(null);\r\n\t\t\t});\r\n\t\t\ts.setColor(Color.GRAY);\r\n\t\t\ts.setDistance(0);\r\n\t\t\t//s.predecessor is already null so skip that step\r\n\t\t\tQueue<Vertex<E>> queue = new Queue<>();\r\n\t\t\tqueue.enqueue(s);\r\n\t\t\ttry {\r\n\t\t\t\twhile(!queue.isEmpty()) {\r\n\t\t\t\t\tVertex<E> u = queue.dequeue();\r\n\t\t\t\t\tArrayList<Edge<E>> adj = adjacencyLists.get(u.getElement());\r\n\t\t\t\t\tfor(Edge<E> ale: adj) {\r\n\t\t\t\t\t\tVertex<E> v = vertices.get(ale.getDst());\r\n\t\t\t\t\t\tif(v.getColor() == Color.WHITE) {\r\n\t\t\t\t\t\t\tv.setColor(Color.GRAY);\r\n\t\t\t\t\t\t\tv.setDistance(u.getDistance()+1);\r\n\t\t\t\t\t\t\tv.setPredecessor(u);\r\n\t\t\t\t\t\t\tqueue.enqueue(v);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tu.setColor(Color.BLACK);\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception emptyQueueException) {\r\n\t\t\t\t//-_-\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"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 updateNodes(){\n ArrayList<Node> tempBoard = new ArrayList<>();\n\n for(int i = 0; i < board.size(); i++){\n Node node = new Node(board.get(i).getCoordinates());\n\n tempBoard.add(node);\n }\n\n\n //check each node for number of live nodes next to it to determine next iteration\n for(int i = 0; i < board.size(); i++){\n int liveCount = 0;\n\n Coordinate current = board.get(i).getCoordinates();\n\n Coordinate above = new Coordinate(current.getX(), current.getY() - 1);\n if(searchBoard(above) != -1){\n Node aboveNode = board.get(searchBoard(above));\n if(aboveNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bellow = new Coordinate(current.getX(), current.getY() + 1);\n if(searchBoard(bellow) != -1){\n Node bellowNode = board.get(searchBoard(bellow));\n if(bellowNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate right = new Coordinate(current.getX() + 1, current.getY());\n if(searchBoard(right) != -1){\n Node rightNode = board.get(searchBoard(right));\n if(rightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate left = new Coordinate(current.getX() - 1, current.getY());\n if(searchBoard(left) != -1){\n Node leftNode = board.get(searchBoard(left));\n if(leftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topLeft = new Coordinate(current.getX() - 1, current.getY() - 1);\n if(searchBoard(topLeft) != -1){\n Node topLeftNode = board.get(searchBoard(topLeft));\n if(topLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topRight = new Coordinate(current.getX() + 1, current.getY() - 1);\n if(searchBoard(topRight) != -1){\n Node topRightNode = board.get(searchBoard(topRight));\n if(topRightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomLeft = new Coordinate(current.getX() - 1, current.getY() + 1);\n if(searchBoard(bottomLeft) != -1){\n Node bottomLeftNode = board.get(searchBoard(bottomLeft));\n if(bottomLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomRight = new Coordinate(current.getX() + 1, current.getY() + 1);\n if(searchBoard(bottomRight) != -1){\n Node bottomRightNode = board.get(searchBoard(bottomRight));\n if(bottomRightNode.getState()){\n liveCount++;\n }\n }\n\n //determine if node is alive or dead in next frame\n if(board.get(i).getState()){\n if(liveCount <= 1){\n tempBoard.get(i).setState(false);\n } else if(liveCount >= 3){\n tempBoard.get(i).setState(false);\n } else {\n tempBoard.get(i).setState(true);\n }\n } else {\n if(liveCount == 3){\n tempBoard.get(i).setState(true);\n } else {\n tempBoard.get(i).setState(false);\n }\n }\n }\n\n //update current board with new states\n for(int i = 0; i < tempBoard.size(); i++){\n board.get(i).setState(tempBoard.get(i).getState());\n }\n }",
"public boolean reachableWith(Vertex start, Vertex end, Action act){\n\t\tSet<LabeledEdge> reach = edgesByStart.get(start);\n\t\tif(reach.contains(new LabeledEdge(start, end, act)))\n\t\t\treturn true;\n\t\tif(start.equals(end) && act.equals(Action.TAU))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"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 }",
"boolean hasIsNodeOf();",
"public Set<Vertex> post(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByStart.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByStart.get(start)){\n\t\t\treach.add(trans.getEnd());\n\t\t}\n\t\treturn reach;\n\t\t\n\t}",
"private boolean nextL1Node() throws ExecutionException, InterruptedException, TimeoutException {\n l2NodesIter = null;\n while (l2NodesIter == null) {\n if (l1NodesIter.hasNext()) {\n curL1Nodes = l1NodesIter.next();\n } else {\n return false;\n }\n // Top level nodes are always exactly 2 digits long. (Don't pick up long hierarchical top level nodes)\n if (!isLedgerParentNode(curL1Nodes)) {\n continue;\n }\n List<String> l2Nodes = store.getChildren(ledgersRoot + \"/\" + curL1Nodes)\n .get(BLOCKING_CALL_TIMEOUT, MILLISECONDS);\n l2NodesIter = l2Nodes.iterator();\n if (!l2NodesIter.hasNext()) {\n l2NodesIter = null;\n continue;\n }\n }\n return true;\n }",
"public void isStartNeedleTest()\n {\n LinearSearch ls = new LinearSearch();\n int [] haystack1 = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};\n assertTrue(ls.isStartNeedle(5, haystack1, 5, 10));\n }",
"protected final boolean computeHasNext() {\n return this.getEnds().getGraph().getPredecessorEdges(this.getNext()).isEmpty();\n }",
"public int getNodeCount(){\r\n HashSet<FlowGraphNode> visited = new HashSet<>();\r\n LinkedList<FlowGraphNode> queue = new LinkedList<>();\r\n queue.add(start);\r\n visited.add(start);\r\n while(!queue.isEmpty()){\r\n FlowGraphNode node = queue.pop();\r\n for(FlowGraphNode child : node.to){\r\n if(visited.add(child)){\r\n queue.add(child);\r\n }\r\n }\r\n }\r\n return visited.size();\r\n }",
"boolean hasNode()\n/* */ {\n/* 473 */ if ((this.bn == null) && (this.mn == null)) return false;\n/* 474 */ if (this.jt == null) return false;\n/* 475 */ return true;\n/* */ }",
"public boolean isChessOnWay(location start, location end, chess[][] board) {\n int startX = start.getX();\n int startY = start.getY();\n int endX = end.getX();\n int endY = end.getY();\n\n if(Math.abs(startX-endX) > 0){\n int step = startX < endX ? 1 : -1;\n for(int i = startX+step; i != endX ; i+=step){\n if(board[i][startY]!=null){\n return true;\n }\n }\n }\n else if(Math.abs(startY-endY) > 0){\n int step = startY < endY ? 1 : -1;\n for(int i = startY+step; i != endY; i+=step){\n if(board[startX][i]!=null){\n return true;\n }\n }\n\n }\n return false;\n\n }",
"public List<Node> findPath(Vector2i start, Vector2i goal) {\n\t\tList<Node> openList = new ArrayList<Node>(); //All possible Nodes(tiles) that could be shortest path\n\t\tList<Node> closedList = new ArrayList<Node>(); //All no longer considered Nodes(tiles)\n\t\tNode current = new Node(start,null, 0, getDistance(start, goal)); //Current Node that is being considered(first tile)\n\t\topenList.add(current);\n\t\twhile(openList.size() > 0) {\n\t\t\tCollections.sort(openList, nodeSorter); // will sort open list based on what's specified in the comparator\n\t\t\tcurrent = openList.get(0); // sets current Node to first possible element in openList\n\t\t\tif(current.tile.equals(goal)) {\n\t\t\t\tList<Node> path = new ArrayList<Node>(); //adds the nodes that make the path \n\t\t\t\twhile(current.parent != null) { //retraces steps from finish back to start\n\t\t\t\t\tpath.add(current); // add current node to list\n\t\t\t\t\tcurrent = current.parent; //sets current node to previous node to strace path back to start\n\t\t\t\t}\n\t\t\t\topenList.clear(); //erases from memory since algorithm is finished, ensures performance is not affected since garbage collection may not be called\n\t\t\t\tclosedList.clear();\n\t\t\t\treturn path; //returns the desired result shortest/quickest path\n\t\t\t}\n\t\t\topenList.remove(current); //if current Node is not part of path to goal remove\n\t\t\tclosedList.add(current); //and puts it in closedList, because it's not used\n\t\t\tfor(int i = 0; i < 9; i++ ) { //8-adjacent tile possibilities\n\t\t\t\tif(i == 4) continue; //index 4 is the middle tile (tile player currently stands on), no reason to check it\n\t\t\t\tint x = (int)current.tile.getX();\n\t\t\t\tint y = (int)current.tile.getY();\n\t\t\t\tint xi = (i % 3) - 1; //will be either -1, 0 or 1\n\t\t\t\tint yi = (i / 3) - 1; // sets up a coordinate position for Nodes (tiles)\n\t\t\t\tTile at = getTile(x + xi, y + yi); // at tile be all surrounding tiles when iteration is run\n\t\t\t\tif(at == null) continue; //if empty tile skip it\n\t\t\t\tif(at.solid()) continue; //if solid cant pass through so skip/ don't consider this tile\n\t\t\t\tVector2i a = new Vector2i(x + xi, y + yi); //Same thing as node(tile), but changed to a vector\n\t\t\t\tdouble gCost = current.gCost + (getDistance(current.tile, a) == 1 ? 1 : 0.95); //*calculates only adjacent nodes* current tile (initial start is 0) plus distance between current tile to tile being considered (a)\n\t\t\t\tdouble hCost = getDistance(a, goal);\t\t\t\t\t\t\t\t// conditional piece above for gCost makes a more realist chasing, because without it mob will NOT use diagonals because higher gCost\n\t\t\t\tNode node = new Node(a, current, gCost, hCost);\n\t\t\t\tif(vecInList(closedList, a) && gCost >= node.gCost) continue; //is node has already been checked \n\t\t\t\tif(!vecInList(openList, a) || gCost < node.gCost) openList.add(node);\n\t\t\t}\n\t\t}\n\t\tclosedList.clear(); //clear the list, openList will have already been clear if no path was found\n\t\treturn null; //a default return if no possible path was found\n\t}",
"public boolean check(Node n, int path) {\r\n\r\n\t\t// Basic case check.\r\n\t\tif (EndPoint.get(path).equals(n))\r\n\t\t\treturn true;\r\n\r\n\t\t// Basic case check\r\n\t\tboolean okForPath = false;\r\n\t\tfor (Integer neiborIndex : nowMap.get(n.index)) {\r\n\t\t\tNode neibor = allNodes.get(neiborIndex);\r\n\r\n\t\t\tif (neibor.path == 0 || EndPoint.get(path).equals(neibor))\r\n\t\t\t\tokForPath = true;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// Dead end check\r\n\r\n\t\tfor (Integer neiborIndex : nowMap.get(n.index)) {\r\n\t\t\tif (allNodes.get(neiborIndex).path == 0) {\r\n\t\t\t\tint num = 0;\r\n\t\t\t\r\n\t\t\t\t\t// BEGIN check for dead ends\r\n\r\n\t\t\t\t\t// except the node we are testing, all the other neighbor nodes from other paths\r\n\t\t\t\t\t// of the neighbor node of the node we are testing are occupied and then a dead\r\n\t\t\t\t\t// end is created.\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Integer neighborOfNeighborIndex:nowMap.get(neiborIndex)) {\r\n\t\t\t\t\t\tif(neighborOfNeighborIndex!=n.index) {\r\n\t\t\t\t\t\t\tif(allNodes.get(neighborOfNeighborIndex).path==0)\r\n\t\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor(Integer pathIndex:StartPoint.keySet()) {\r\n\t\t\t\t\t\t\t\t\tif(!paths.get(pathIndex).peek().equals(EndPoint.get(pathIndex))){\r\n\t\t\t\t\t\t\t\t\t\tif(neighborOfNeighborIndex==paths.get(pathIndex).peek().index || neighborOfNeighborIndex==EndPoint.get(pathIndex).index)\r\n\t\t\t\t\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(num<=1)\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t// END check for dead ends\r\n\t\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\tLinkedList<Integer> topPathsIndex=new LinkedList<Integer>();\r\n\t\t\r\n\t\tfor(Integer p:paths.keySet())\r\n\t\t\ttopPathsIndex.add(paths.get(p).peek().index);\r\n\t\tboolean deadEnd=true;\r\n\t\tfor(Integer nodeIndex:allNodes.keySet()) {\r\n\t\t\tNode theNode=allNodes.get(nodeIndex);\r\n\t\t\tif(theNode.path==0) {\r\n\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(allNodes.get(itsNeighborIndex).path==0) {\r\n\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(deadEnd) {\r\n\t\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\t\tif(topPathsIndex.contains(itsNeighborIndex)) {\r\n\t\t\t\t\t\t\tint p0=allNodes.get(itsNeighborIndex).path;\r\n\t\t\t\t\t\t\tint itsEndIndex=EndPoint.get(p0).index;\r\n\t\t\t\t\t\t\tif(nowMap.get(nodeIndex).contains(itsEndIndex))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\t\t\tbreak;\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\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tfor(Integer itsNeighborIndex:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(allNodes.get(itsNeighborIndex).path==0 ||allNodes.get(itsNeighborIndex).path==theNode.path) {\r\n\t\t\t\t\t\tdeadEnd=false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(deadEnd)\r\n\t\t\treturn !deadEnd;\r\n\t\t\r\n\t\tHashMap<Integer,Integer> rmap=new HashMap<Integer,Integer>();\r\n\t\tint rcount=state_build_regions(rmap);\r\n\t\tif(state_regions_stranded(rcount,rmap,paths.size()+1,1)>0)\r\n\t\t\treturn false;\r\n\r\n\t\treturn okForPath;\r\n\t}",
"public boolean areAdjacent() {\n return areAdjacent;\n }",
"public boolean leadsToDestination(int n, int[][] edges, int source, int destination) {\n List<Integer>[] G = (List<Integer>[]) new List[n];\n for (int i = 0; i < n; i++) G[i] = new ArrayList();\n for (int[] edge : edges) {\n int s = edge[0], t = edge[1];\n G[s].add(t);\n }\n\n // use dfs to check condition\n Set<Integer> visited = new HashSet();\n if (G[source].size() == 0) return false;\n for (Integer next : G[source]) {\n if (!dfs(next, destination, G, visited, new HashSet()))\n return false;\n }\n return true;\n }",
"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}",
"protected SiblingIterator(TreeNode<T> node) {\n\t\t\tstartNode = node;\n\t\t}",
"@Test\n public void whenTreeIsBlankThanHasNextIsFalse() {\n assertThat(this.tree.iterator().hasNext(), is(false));\n }",
"int astar(Node src, Node last) {\n\t\tPriorityQueue<Node> pq = new PriorityQueue<>((a, b) -> (a.getPrev().getFullDist()) - (b.getPrev().getFullDist()));\n\t\tsrc.getPrev().setDistance(0);\n\t\tsrc.getPrev().setEstimatedDistToEnd(distance(src, last));\n\t\tlast.setFinished(true);\n\t\tpq.add(src);\n\t\t\n\t\tint count = 0;\n\t\twhile (!pq.isEmpty()) {\n\t\t\tNode n = pq.poll();\n\t\t\tcount++;\n\t\t\tif (n.isFinished()) return count;\n\t\t\tfor (Edge edge = n.getEdge(); edge != null; edge = edge.getNextEdge()) {\n\t\t\t\tLast edgeCheck = edge.getTo().getPrev();\n\t\t\t\tLast nodeCheck = n.getPrev();\n\t\t\t\t\n\t\t\t\tif (edgeCheck.getDistance() > nodeCheck.getDistance() + edge.getWeight()) {\n\t\t\t\t\tif (edgeCheck.getEstimatedDistToEnd() == -1)\n\t\t\t\t\t\tedgeCheck.setEstimatedDistToEnd(distance(edge.getTo(), last));\n\t\t\t\t\tedgeCheck.setDistance(nodeCheck.getDistance() + edge.getWeight());\n\t\t\t\t\tedgeCheck.setLast(n);\n\t\t\t\t\tedgeCheck.setFullDist(edgeCheck.getDistance() + edgeCheck.getEstimatedDistToEnd());\n\t\t\t\t\tpq.add(edge.getTo());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}",
"private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\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}",
"private void connectAll()\n {\n\t\tint i = 0;\n\t\tint j = 1;\n\t\twhile (i < getNodes().size()) {\n\t\t\twhile (j < getNodes().size()) {\n\t\t\t\tLineEdge l = new LineEdge(false);\n\t\t\t\tl.setStart(getNodes().get(i));\n\t\t\t\tl.setEnd(getNodes().get(j));\n\t\t\t\taddEdge(l);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++; j = i+1;\n\t\t}\n\n }"
] | [
"0.6503708",
"0.6464634",
"0.6392925",
"0.6195343",
"0.6177544",
"0.6153977",
"0.6109894",
"0.60812926",
"0.6023968",
"0.6019568",
"0.5901867",
"0.5875108",
"0.586079",
"0.58559465",
"0.5810122",
"0.5768248",
"0.5764841",
"0.5753173",
"0.5741814",
"0.57325006",
"0.57240564",
"0.57170177",
"0.5706632",
"0.56979084",
"0.56955177",
"0.5693376",
"0.56915593",
"0.5670663",
"0.5660404",
"0.5631772",
"0.55983764",
"0.5593618",
"0.55924046",
"0.5592209",
"0.55886406",
"0.55877256",
"0.5583624",
"0.5582513",
"0.5580922",
"0.558061",
"0.55692554",
"0.5564407",
"0.5556115",
"0.5552063",
"0.5550404",
"0.55458724",
"0.55414927",
"0.5540392",
"0.55391514",
"0.5530586",
"0.55297285",
"0.5520933",
"0.5520226",
"0.5518412",
"0.55118775",
"0.5509884",
"0.55095744",
"0.5505863",
"0.55004704",
"0.549055",
"0.5490436",
"0.5486736",
"0.54824305",
"0.54670674",
"0.5465254",
"0.54564357",
"0.54447466",
"0.54397976",
"0.5437389",
"0.54373366",
"0.54339606",
"0.54318523",
"0.5424511",
"0.54202867",
"0.5419972",
"0.541656",
"0.5413656",
"0.5410654",
"0.54095614",
"0.54064286",
"0.5404638",
"0.538842",
"0.5381602",
"0.53809947",
"0.5367732",
"0.5365963",
"0.5363296",
"0.5353284",
"0.5350978",
"0.5338732",
"0.5338726",
"0.5338016",
"0.5334543",
"0.5333912",
"0.5333837",
"0.5328799",
"0.5326136",
"0.53224444",
"0.531932",
"0.53183717",
"0.5318239"
] | 0.0 | -1 |
method to update the next method in algorithm 1 | private static Node updateNextNodeAlgo1(Node nextNode, Node destination) {
if (nextNode.getDistanceToZ() > destination.getDistanceToZ()) {
return destination;
}
return nextNode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void calculateNextFactor();",
"protected abstract void recombineNext();",
"@Override\n public WorkflowStep next() {\n this.boardChangeDetected = 0;\n this.missingFutures = 0;\n this.missingTetromino = 0;\n startCalculator(false);\n return DETECT_ANOMALIES;\n }",
"public void advance()\n\t{\n\t\t//calling copy function\n\t\tcopy(); \n\t\t//for loop for row \n\t\tfor(int row =0; row<this.currentVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column =0; column<this.currentVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//if statements to implement 2D CA rules\n\t\t\t\tif (column == 0 && row == 0)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row+1][column] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column +1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row == 0 && column == currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row][column - 1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column - 1];\n\t\t\t\t\telse if (currentVersion[row+1][column] == currentVersion [row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row == 0 && column > 0 && column < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row][column-1] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if(currentVersion[row+1][column] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row == currentVersion.length-1 && column == 0)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row-1][column] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row -1][column]; \n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row > 0 && column ==0 && row < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row+1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\tif(currentVersion[row][column+1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif(row == currentVersion.length-1 && column == currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row-1][column] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(row == currentVersion.length-1 && column > 0 && column < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row-1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1]; \n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\t\n\t\t\t\tif(row>0 && row < currentVersion.length-1 && column == currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif (currentVersion[row-1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row+1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column]; \n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif(row>0 && row < currentVersion.length-1 && column > 0 && column < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif (currentVersion[row-1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row+1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column]; \n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0;\n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t//passing new nextVersion array to currentVersion array\n\tsetUniverse(nextVersion);\n\t}",
"public abstract void goNext();",
"void nextState();",
"private void nextState() {\n int x;\n int y;\n y = st3;\n x = (st0 & MASK) ^ st1 ^ st2;\n x ^= (x << SH0);\n y ^= (y >>> SH0) ^ x;\n st0 = st1;\n st1 = st2;\n st2 = x ^ (y << SH1);\n st3 = y;\n st1 ^= parameter.getMat1(y);\n st2 ^= parameter.getMat2(y);\n }",
"public abstract void next ();",
"public void next() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n //Set up the nextState\n ArrayList<Integer> nextState = new ArrayList<Integer>();\n\n if(Solution.size() == 0) {\n //No Solution\n } else if (Solution.size() == 1) {\n nextState = Solution.get(0);\n curBoard = nextState;\n } else {\n nextState = Solution.get(1);\n curBoard = nextState;\n moveCount++;\n }\n clearStack();\n\n\tsetChanged();\n\tnotifyObservers();\n }",
"public abstract void next();",
"public void Next();",
"public void next(){\n\t\tif(generated)\n\t\t\tcurr++;\n\t}",
"@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}",
"public void nextIteration()\n {\n actuelIteration++;\n }",
"@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}",
"public void next() {\n\t\t}",
"public void next();",
"public void next();",
"@Override\n public WorkflowStep next() {\n startCalculator(true);\n return DETECT_ANOMALIES;\n }",
"void setNextValue() {\n this.value = this.value * 2;\n }",
"public abstract void advance();",
"public void advance( )\n {\n // Implemented by student.\n }",
"public void alternateFunction()\n\t{\n\t\tstart();\n\t\trunAlgorithm();\n\t}",
"public void nextIterate() {\n\tdd1[0] = POW2_53 * d1;\n\tdd1[1] = 0.0;\n\tdddivd(dd1, POW3_33, dd2);\n\tddmuldd(POW3_33, Math.floor(dd2[0]), dd2);\n\tddsub(dd1, dd2, dd3);\n\td1 = dd3[0];\n\tif (d1 < 0.0) {\n\t d1 += POW3_33;\n\t}\n }",
"public void nextIteration() {t++;}",
"void next();",
"@Override\n void advance() {\n }",
"public static void initNext() { //ініціалізація лічильника нульовим значенням\n next = 0;\n }",
"public void advanceSimulation () {\n\t\tstep_++;\n\t}",
"@Override\n public Z computeNext() {\n int n = size();\n if (n <= 2) {\n return Z.valueOf(mInits[n]);\n }\n final int pow2 = Integer.highestOneBit(n);\n final int j = n - pow2;\n Z result = a(j).multiply(mFaj0).add(a(j + 1).multiply(mFaj1));\n if (j == pow2 - 1) {\n result = result.add(1);\n }\n return result;\n \n }",
"@Override\n\tpublic void algorithm() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\t\n\t\tint change = 2;\n\t\t\n\t\tfor(int i=0; i<this.getGridGame().getGridRow(); i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<this.getGridGame().getGridCol(); j++) {\n\t\t\t\t\n\t\t\t\tif(j > 0 && j < this.getGridGame().getGridCol()) {\n\t\t\t\t\t\n\t\t\t\t\tif(this.getGridGame().getPattern(i,j-1) != this.getGridGame().getPattern(i,j)) {\n\t\t\t\t\t\n\t\t\t\t\t\tchange--;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(change > 0) {\n\t\t\t\t\t\n\t\t\t\t\tthis.getArray()[i][0] += this.getGridGame().getPattern(i,j);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tthis.getArray()[i][1] += this.getGridGame().getPattern(i,j);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(change + \" \");\n\t\t\tchange = 2;\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<this.getGridGame().getGridRow(); i++) {\n\t\t\t\n\t\t\tif(this.getArray()[i][1] == 0) {\n\t\t\t\t\n\t\t\t\tthis.getArray()[i][1] = this.getArray()[i][0];\n\t\t\t\tthis.getArray()[i][0] = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<this.getGridGame().getGridRow(); i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<2; j++) {\n\t\t\t\n\t\t\t\tSystem.out.print(this.getArray()[i][j] + \" \");\n\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t\t\n\t\t}\n\t\t\n\t\n\t}",
"public void cycle() {\r\n processTask(); // tune relative frequency?\r\n processConcept(); // use this order to check the new result\r\n }",
"public void next(){\n\t\tboundIndex = (boundIndex+1)%buttonBounds.length;\n\t\tupdateButtonBounds();\n\t}",
"public void updateModuleOneIteration (final double timestep);",
"boolean nextStep();",
"public void nextSet(){\n this.fillVector();\n }",
"private void findNext() {\n \tthis.find(true);\n }",
"@Override\r\n\tpublic void next() {\n\n\t}",
"public String nextStep();",
"public void compNextMove(){\r\n int flatNextMove;\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* choose best next move according to difficulty */\r\n flatNextMove = CompPlayer.nextMove(flatBoard,moves,playerSign,difficulty);\r\n\r\n /* set the sign in the correct place in the matrix */\r\n for (int i=0;i<3;i++)\r\n for (int j=0;j<3;j++){\r\n flatNextMove--;\r\n if (flatNextMove == 0)\r\n setSign(i,j,compSign);\r\n }\r\n }",
"protected abstract boolean computeHasNext();",
"private int getNextMutator()\n\t{\n\t\t\n\t\tif (mutatingHeuristics.size()==0)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn mutatingHeuristics.get(rng.nextInt(mutatingHeuristics.size()));\n\t}",
"public void next() {\n double[][] next = new double[size][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < size; j++) {\n double sum = 0.0;\n for (int k = 0; k < size; k++) {\n sum += state[i][k] * transition[k][j];\n }\n next[i][j] = sum;\n }\n }\n this.currentStep++;\n this.state = next;\n }",
"@Override\n public void next(){\n balls.translate();\n majGui();\n }",
"@Override\n\tpublic void next() {\n\t\t\n\t}",
"public abstract void increaseThis();",
"private void updateNextNode(SkiNode head, int nextI, int nextJ, int nextId) {\n\t\tif (!MatrixHelper.isPosValid(nextI, nextJ, map)) {\n\t\t\treturn;\n\t\t}\n\t\tif (head.v <= map[nextI][nextJ]) {\n\t\t\treturn;\n\t\t}\n\t\tif (hMap[nextI][nextJ] != 0) {\n\t\t\thead.level = Math.max(head.level, hMap[nextI][nextJ] + 1);\n\t\t} else {\n\t\t\thead.next[nextId] = new SkiNode(map[nextI][nextJ], nextI, nextJ, head);\n\t\t\tbuildSkiTree(head.next[nextId]);\n\t\t}\n\t}",
"@Override\n\tpublic void updateLevel() {\n\t\tthis.algorithm();\n\t\t\n\t}",
"@Override\n public void postRound() {\n super.postRound();\n Integer res = 0;\n if(this.algorithm_choosed!=-1){\n switch(this.algorithm_choosed) {\n case 1:\n if((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.first_Algorithm){\n this.first_Algorithm = true;\n Tools.appendToOutput(\"Algorithm1 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm1 find this size of max matching \"+res+\"\\n\");\n }\n break;\n case 2:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.second_Algorithm) {\n this.second_Algorithm = true;\n Tools.appendToOutput(\"Algorithm2 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm2 find this size of max matching \"+res+\"\\n\");\n }\n break;\n case 3:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.third_Algorithm) {\n this.third_Algorithm = true;\n Tools.appendToOutput(\"Algorithm3 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm3 find this size of max matching \"+res+\"\\n\");\n this.tempFourth = res;\n }\n break;\n case 4:\n if(!this.fourth_algorithm && (res=this.checkingIfAllNodesHasFinished())!=-1) {\n Integer c = 0;\n this.fourth_algorithm = true;\n Tools.appendToOutput(\"Maximal converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Maximal matching size is = \"+res+\"\\n\");\n //log.logln(\"Try to find the optimum!!!\");\n for (Iterator<Node> it = Tools.getNodeList().iterator(); it.hasNext();) {\n MS4Node node = (MS4Node) it.next();\n if(node.isMarried()){\n c+=1;\n }\n node.setFindTheOptimum();\n node.end_flag = false;\n }\n this.printTheMarriages();\n //log.logln(\"Total number of nodes married = \"+c);\n this.tempFourth = res;\n }\n if(this.fourth_algorithm && (res=this.checkingIfAllNodesHasFinished())!=-1 && !this.approximazion_alg){\n Tools.appendToOutput(\"RES ---->\"+res+\"\\n\");\n for(Iterator<Node> it = Tools.getNodeList().iterator();it.hasNext();){\n MS4Node node = (MS4Node)it.next();\n if(node.isSecondMatchDone()){\n //Tools.appendToOutput(\"**NODE with a success in MATCH SECOND ==\"+node.ID+\" \\n\");\n node.setColorToEdgeAndNodes(Color.BLACK, Tools.getNodeByID(node.pointingNode));\n Tools.getNodeByID(node.pointingNode).setColor(node.defaultColor);\n node.setColorToEdgeAndNodes(Color.MAGENTA, Tools.getNodeByID(node.getP_v()));\n ((MS4Node)Tools.getNodeByID(node.getP_v())).isMarried = true;\n MS4Node married = (MS4Node)Tools.getNodeByID(node.getPointingNode());\n married.setColorToEdgeAndNodes(Color.MAGENTA,Tools.getNodeByID(married.getP_v()));\n ((MS4Node)Tools.getNodeByID(married.getP_v())).isMarried = true;\n }\n }\n Integer newRes = checkingIfAllNodesHasFinished();\n Tools.appendToOutput(\"Approx algorithm converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"New Maximal matching size is = \"+newRes+\" so improved by \"+(newRes-tempFourth)+\"\\n\");\n //log.logln(\"--------------------APPROX RESULT-----------------------------\");\n Integer count = 0;\n for(Iterator<Node> it = Tools.getNodeList().iterator();it.hasNext();){\n MS4Node node = (MS4Node)it.next();\n if(node.isMarried()) {\n count++;\n }\n }\n this.printTheMarriages();\n //log.logln(\"----------------NUMBER OF MARRIED : \"+count+\"-----------------------------\");\n this.approximazion_alg = true;\n break;\n }\n case 5:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.fifth_algorithm) {\n this.fifth_algorithm = true;\n Tools.appendToOutput(\"Algorithm3_probabilistic converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm3_probabilistic find this size of max matching \" + res + \"\\n\");\n }\n\n }\n }\n }",
"void determineNextAction();",
"@Override\r\n public Integer next() {\r\n // Time complexity: O(1), where the problem size N \r\n // represents the size of the sequence to generate.\r\n if (!hasNext()) // check if the current element has a next element in this sequence\r\n return null; \r\n int current = next; // set the current element to next\r\n generatedCount++; // increment the number of generated elements so far\r\n next *= RATIO; // set the next element (adds the common ratio to the current number)\r\n return current; // return the current number as the generated one\r\n }",
"@Override\n\tpublic WB_Point nextPoint();",
"@Override\n public WorkflowStep next() {\n this.missingTetromino = 0;\n timeCalculationStarted = 0;\n firstScan = true;\n if (checkAutoBlue()) {\n nosync = 0;\n try {\n Thread.sleep(MIN_BLUE_TIME);\n } catch (InterruptedException e) {\n // wait\n }\n return INITIAL_BOARD;\n } else {\n\t \tif (QQTetris.getSleep() < 300) {\n\t\t if (++nosync >= MAX_NOSYNC) {\n\t\t nosync = 0;\n\t\t return INITIAL_BOARD;\n\t\t } else {\n\t\t QQTetris.calculationThread.mergeMove();\n\t\t return DETECT_BLOCKS;\n\t\t }\n\t \t} else {\n\t \t\t\treturn INITIAL_BOARD;\n\t \t}\n }\n }",
"@Override\n\tpublic void next()\n\t{\n\n\t}",
"@Override\n public int nextIndex()\n {\n return idx+1; \n }",
"public abstract void runAlgorithm();",
"void increase();",
"void increase();",
"public void nextPerson(){\n }",
"public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}",
"String getNext();",
"String getNext();",
"public void solution() {\n\t\t\n\t}",
"public boolean getNext();",
"public void runAlgorithm()\n\t{\n\t\tboolean done = false;\n while (!done)\n {\n switch (step)\n {\n case 1:\n step=stepOne(step);\n break;\n case 2:\n step=stepTwo(step);\n break;\n case 3:\n step=stepThree(step);\n break;\n case 4:\n step=stepFour(step);\n break;\n case 5:\n step=stepFive(step);\n break;\n case 6:\n step=stepSix(step);\n break;\n case 7:\n stepSeven(step);\n done = true;\n break;\n }\n }\n\t}",
"@Override\n\tpublic void makeNextMove() \n\t{\n\t}",
"static void nextIteration(Configuration conf) {\n conf.setInt(STEP_PROP, getCurrentIteration(conf)+1);\n }",
"public void handleNextCode() {\n setCurrentCode((currentIndex + 1) % codeCount);\n }",
"public void incrementFitness()\n {\n this.fitness++;\n }",
"java.lang.String getNextStep();",
"@Override\n\t\t\t\t\tpublic void onNext(Object p1) {\n\t\t\t\t\t}",
"@Override\r\n\tpublic void nextStep() {\n\t\tif (this.oldX == this.coord.x && this.oldY == this.coord.y) { \r\n\t\t\tthis.currentPoint = (int) (Math.random()*this.patrol.size());\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\r\n\t\t}\r\n\r\n\t\t// target point reached, make new random target point\r\n\t\tif (this.targetX == this.coord.x && this.targetY == this.coord.y) {\r\n\t\t\tif (this.currentPoint < patrol.size() - 1)\r\n\t\t\t\tthis.currentPoint++;\r\n\t\t\telse\r\n\t\t\t\tthis.currentPoint = 0;\r\n\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\t\t}\r\n\t\tint step = (this.speed == Speed.fast ? 8 : 4);\r\n\t\t// int stepX = (int) (1 + Math.random() * step);\r\n\t\t// int stepY = (int) (1 + Math.random() * step);\r\n\t\tint x0 = (int) (this.coord.getX());\r\n\t\tint y0 = (int) (this.coord.getY());\r\n\r\n\t\tint dx = this.targetX - x0;\r\n\t\tint signX = Integer.signum(dx); // get the sign of the dx (1-, 0, or\r\n\t\t\t\t\t\t\t\t\t\t// +1)\r\n\t\tint dy = this.targetY - y0;\r\n\t\tint signY = Integer.signum(dy);\r\n\t\tthis.nextX = x0 + step * signX;\r\n\t\tthis.nextY = y0 + step * signY;\r\n\t\tthis.oldX = this.coord.x;\r\n\t\tthis.oldY = this.coord.y;\r\n\t\t// System.err.println(\"targetX,targetY \"+targetX+\" \"+targetY);\r\n\t}",
"void goToNext(boolean isCorrect);",
"public void step() {\n // method 1 of Temperature randomness\n enPrice = 1.1 * enPrice;\n\n TempChange = Temperature * (0.1 * (1 - 2 * r.nextDouble()));\n // method 2 of Temperature\n// TempChange = temperature_list.get(count);\n// count+=1;\n\n Temperature += TempChange;\n year_num+=1;\n }",
"@Test\n public void testGetNextIndex() {\n\n final String methodname = \"testGetNextIndex(): \";\n\n final RuleVO rule1 = new RuleVO(\"1\", \"a\", \"\", 10, \"\");\n final RuleVO rule2 = new RuleVO(\"2\", \"a\", \"\", 20, \"\");\n\n final RuleIndexCounter dut = new RuleIndexCounter();\n final int rule11 = dut.getNextIndex(rule1);\n logger.info(methodname + \"rule11 = {}\", rule11);\n Assertions.assertEquals(10, rule11);\n final int rule12 = dut.getNextIndex(rule1);\n logger.info(methodname + \"rule12 = {}\", rule12);\n Assertions.assertEquals(11, rule12);\n final int rule21 = dut.getNextIndex(rule2);\n logger.info(methodname + \"rule21 = {}\", rule21);\n Assertions.assertEquals(20, rule21);\n final int rule22 = dut.getNextIndex(rule2);\n logger.info(methodname + \"rule22 = {}\", rule22);\n Assertions.assertEquals(21, rule22);\n final int rule13 = dut.getNextIndex(rule1);\n logger.info(methodname + \"rule13 = {}\", rule13);\n Assertions.assertEquals(12, rule13);\n final int rule23 = dut.getNextIndex(rule2);\n logger.info(methodname + \"rule23 = {}\", rule23);\n Assertions.assertEquals(22, rule23);\n }",
"public static void update() {\n if (!isEnd()) index++;\n state++;\n return;\n }",
"public void next()\n\t{\n\t\tSystem.err.print(\"-\");\n\t\tif(pp.available())\n\t\t{\n\t\t\tSystem.err.print(\"+\");\n\t\t\timg_header=pp.getFrameHeader();\n\t\t\tbi=pp.getFrame();\n\t\t\tip[ip_index].setImage(bi);\n\t\t\tip[ip_index].repaint();\n\t\t\tip_index++;\n\t\t\t//ip_index%=cols*rows;\n\t\t\tip_index%=tiles;\n\t\t\tpp.next();\n\t\t}\n\t\tif(panel_glass.isVisible() || is_paused)\n\t\t{\n\t\t\tupdateInfoPanel();\n\t\t\tpanel_buffer_fill.setValue(pp.getBufferFillLevel());\n\t\t\tpanel_buffer_fill.repaint();\n\t\t\tif(is_paused)\n\t\t\t{\n\t\t\t\ttry{Thread.sleep(10);}catch(Exception e){}\n\t\t\t}\n\t\t}\n\t}",
"private void setNextStrategy() {\n setCurrentStrategy(getCurrentStrategy().next(_feedId,\n _start,\n _first,\n _last));\n }",
"public abstract void onNext();",
"public Viseme getNextViseme();",
"public void incrementRefusals() {\n\t}",
"public void next(){\n if(stageNum < (defineStageNum)) {\n stageNum++;\n }else {\n stageNum = startStageNum;\n }\n }",
"private void updateMax(int next) {\n while (val < next) {\n val = next;\n }\n }",
"public abstract Tuple getNext();",
"public void setNext(Variable next){\n\t\tthis.next = next;\n\t}",
"public abstract GF2nElement increase();",
"public abstract boolean next();",
"public abstract boolean next();",
"@Override\r\n public final void updateStep() {\n if(!updateDone && canAuthMore()){\r\n leaveIndex++; //increase the index\r\n doBasicUpdate(); //do the updates\r\n measureDynamicSpace(); //measure\r\n calcNextAuthPath(); //calculate the next authentication path\r\n measureDynamicSpace(); //measure\r\n updateDone = true;\r\n if(MeasureToolbox.needsRoundData)MeasureToolbox.finishRound(leaveIndex); //measure\r\n }\r\n }",
"@Override\n public void afterAlgorithmIteration(\n Algorithm alg, ReachedSet reached) {\n }",
"@Override\n public DRFLPSolution algorithm(DRFLPInstance instance) {\n try {\n List<Future<DRFLPSolution>> futures = new ArrayList<>();\n RandomManager.reinitialize(RandomType.LEGACY, 0, this.n);\n for (int i = 0; i < n; i++) {\n int _i = i;\n futures.add(executor.submit(() -> {\n RandomManager.reset(_i);\n return alg.algorithm(instance);\n }));\n }\n var results = ConcurrencyUtil.awaitAll(futures);\n DRFLPSolution best = null;\n for(var solution: results){\n if(solution.isBetterThan(best)){\n best = solution;\n }\n }\n return best;\n } finally {\n executor.shutdown();\n }\n }",
"protected abstract void nextRequest ();",
"public void nextTurn(){\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}",
"BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}",
"protected void incrementCurrent() {\n current++;\n }",
"public ArrayList<Integer> getNext() {\n\t\t\n\t\t// run thru our list of permutations\n\t\tdo {\n\t\t\treturnIndex++;\n\t\t\tif (returnIndex == permutations.size()) {\n\t\t\t\t// we reached end of current permutations-list,\n\t\t\t\t// so we have to expand our termIndices-list,\n\t\t\t\t// re-generate our permutations-list and\n\t\t\t\t// reset out returnIndex\n\t\t\t\ttermIndices.add(termIndices.size());\n\t\t\t\tpermute(\"\");\n\t\t\t\treturnIndex = 0;\n\t\t\t}\n\t\t} while (permHistory.contains(permutations.get(returnIndex)));\n\t\t\n\t\tpermHistory.add(permutations.get(returnIndex));\n\t\t\n\t\treturn permutations.get(returnIndex);\n\t}",
"public void incrementFitnessBy2()\n {\n this.fitness=this.fitness+2;\n }",
"public synchronized void update() {\n\t\tcurrentIteration.clear();\n\t\tcurrentIteration.addAll(currentCalls.values());\n\t\tfor (RegisteredCall i : currentIteration) {\n\t\t\ti.update();\n\t\t}\n\t}",
"public long getNextDynamicMethodSerial() {\n return dynamicMethodSerial.getAndIncrement();\n }",
"protected abstract D getNext(D d);"
] | [
"0.6714282",
"0.66268206",
"0.65343183",
"0.6484457",
"0.64673257",
"0.6219618",
"0.62090564",
"0.6201755",
"0.61920834",
"0.61733496",
"0.6157636",
"0.6118636",
"0.6115528",
"0.60841143",
"0.60812944",
"0.60664",
"0.60594857",
"0.60594857",
"0.6038111",
"0.60264385",
"0.60128814",
"0.60031694",
"0.5954595",
"0.5952356",
"0.59452003",
"0.5923869",
"0.5918348",
"0.591532",
"0.59144217",
"0.58868617",
"0.588605",
"0.5860798",
"0.584704",
"0.5836527",
"0.58322537",
"0.581332",
"0.5812792",
"0.580663",
"0.579725",
"0.57928216",
"0.57914954",
"0.5785463",
"0.57564634",
"0.5750867",
"0.57327145",
"0.57233405",
"0.57217747",
"0.5706029",
"0.56878436",
"0.5683395",
"0.5681599",
"0.56784475",
"0.5672913",
"0.5664389",
"0.5656916",
"0.56430846",
"0.56371146",
"0.56371146",
"0.5627304",
"0.56226444",
"0.5618994",
"0.5618994",
"0.5616292",
"0.5578262",
"0.5577882",
"0.55702686",
"0.557001",
"0.55678856",
"0.55634755",
"0.5561787",
"0.55594957",
"0.5555932",
"0.55552775",
"0.5549756",
"0.5539807",
"0.5535083",
"0.55321544",
"0.5529344",
"0.5525151",
"0.5522479",
"0.5522331",
"0.5514357",
"0.55066514",
"0.549789",
"0.5487841",
"0.54835856",
"0.5479589",
"0.5479589",
"0.54784226",
"0.5468683",
"0.5464427",
"0.54601073",
"0.5449788",
"0.5447563",
"0.5446044",
"0.5437106",
"0.5436959",
"0.5435362",
"0.5430778",
"0.5429595"
] | 0.557019 | 66 |
method to update the node in algorithm 2 | private static NodeWithWeightDistanceTotal updateNextNodeAlgo2(Node nextNode, Edge edge, Integer weightDistanceTotal) {
if (edge.weight + edge.getDestination().getDistanceToZ() < weightDistanceTotal) {
weightDistanceTotal = (edge.weight + edge.getDestination().getDistanceToZ());
return new NodeWithWeightDistanceTotal(edge.destination, weightDistanceTotal);
// System.out.println(nextNode.getName());
}
return new NodeWithWeightDistanceTotal(nextNode, weightDistanceTotal);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void update(NetworkNode networkNode);",
"public void update(Packet p, Node node) {\n }",
"void nodeUpdated(Node n) throws RepositoryException;",
"void refreshNode(ChartNode node);",
"@Override\n public void setNodeStatesForUpdate(int iNode) {\n }",
"public void update() {\n\t\t\n\t}",
"public void update(){}",
"public void update(){}",
"public void update() {}",
"public void update() {\n\t}",
"public void update() {\n\t}",
"public void update() {\n\t}",
"public void update() {\n\t}",
"public void update() ;",
"public void update() {\r\n\t\t\r\n\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"protected abstract void update();",
"protected abstract void update();",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Transactional\n public abstract void updateNode(OnmsNode node);",
"public void update(){\r\n\t\t\r\n\t}",
"abstract public void update();",
"public void updateNodeDataChanges(Object src) {\n\t}",
"public void update() {\n }",
"@Override\n\tpublic void updateLevel() {\n\t\tthis.algorithm();\n\t\t\n\t}",
"protected abstract void update();",
"@Override\r\n\tpublic void update() {\r\n\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\n\tpublic void update() { }",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"public void changingNeighbor() {\n }",
"@Override\n\tpublic void updateNode(JsonObject jsonData) {\n\t\t\n\t}",
"@Override\n\tpublic void update() {}",
"@Override\n\tpublic void update() {}",
"public void update();",
"public void update();",
"public void update();",
"public void update();",
"public void update();",
"public void update();",
"public void update();",
"public void update() {\n\t\tupdate(1);\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\r\n\tpublic void update() {\r\n\t}",
"public void updateGraph(){\n int cont=contador;\n eliminar(0);\n construir(cont);\n }",
"public void update() {\n\n }",
"public void update() {\n\n }",
"private void updateNextNode(SkiNode head, int nextI, int nextJ, int nextId) {\n\t\tif (!MatrixHelper.isPosValid(nextI, nextJ, map)) {\n\t\t\treturn;\n\t\t}\n\t\tif (head.v <= map[nextI][nextJ]) {\n\t\t\treturn;\n\t\t}\n\t\tif (hMap[nextI][nextJ] != 0) {\n\t\t\thead.level = Math.max(head.level, hMap[nextI][nextJ] + 1);\n\t\t} else {\n\t\t\thead.next[nextId] = new SkiNode(map[nextI][nextJ], nextI, nextJ, head);\n\t\t\tbuildSkiTree(head.next[nextId]);\n\t\t}\n\t}",
"default void updateNode(\n com.google.cloud.tpu.v2alpha1.UpdateNodeRequest request,\n io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateNodeMethod(), responseObserver);\n }",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\r\n\tpublic void update() {\n\t}",
"public abstract void update ();",
"@Override\n public void update() {\n \n }",
"abstract void updateStructure();",
"public abstract void setNodes();",
"public void update(){\r\n }",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"public abstract void update();",
"@Override\n\tpublic void update() {\n\t}",
"@Override\n\tpublic void update() {\n\t}",
"@Override\n\tpublic void update() {\n\t}",
"public void setNode_2(String node_2);",
"public void update()\n {\n tick++;\n if (this.part != null)\n {\n for (UpdatedLabel label : dataLabels)\n {\n label.update();\n }\n int c = 0;\n for (Entry<MechanicalNode, ForgeDirection> entry : part.node.getConnections().entrySet())\n {\n if (entry.getKey() != null)\n {\n this.connections[c].setText(\"Connection\" + c + \": \" + entry.getKey());\n c++;\n }\n }\n for (int i = c; i < connections.length; i++)\n {\n this.connections[i].setText(\"Connection\" + i + \": NONE\");\n }\n }\n }",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n public void update() {\n }",
"public void updateGraph(){\n\t\tgraph.update(updatePopulations(), iteration);\n\t\titeration++;\n\t}",
"public void update()\n\t{\n\t\tsuper.update();\n\t}",
"@Override\r\n\tpublic void update() {\n\r\n\t}",
"@Override\r\n\tpublic void update() {\n\r\n\t}",
"public void update(){\n }"
] | [
"0.7385643",
"0.69577956",
"0.68651986",
"0.6720442",
"0.66493297",
"0.66396004",
"0.6624866",
"0.6624866",
"0.66091186",
"0.65708405",
"0.65708405",
"0.65708405",
"0.65708405",
"0.65263414",
"0.6524312",
"0.64950496",
"0.64950496",
"0.64950496",
"0.64439726",
"0.64439726",
"0.64367384",
"0.64367384",
"0.6436731",
"0.638681",
"0.63849485",
"0.63761556",
"0.63707966",
"0.6352102",
"0.6322337",
"0.6320825",
"0.63141537",
"0.63141537",
"0.63141537",
"0.63141537",
"0.63141537",
"0.6309912",
"0.6304954",
"0.6304954",
"0.6304954",
"0.6304954",
"0.6304954",
"0.6304954",
"0.63027215",
"0.62933904",
"0.6288108",
"0.6288108",
"0.628621",
"0.628621",
"0.628621",
"0.628621",
"0.628621",
"0.628621",
"0.628621",
"0.6279889",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6270989",
"0.6260832",
"0.62595624",
"0.62465984",
"0.62465984",
"0.6241158",
"0.6240945",
"0.62370175",
"0.62370175",
"0.6232891",
"0.6231543",
"0.6229486",
"0.62247384",
"0.6223584",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6221421",
"0.6208952",
"0.6208952",
"0.6208952",
"0.6189255",
"0.61877036",
"0.6144921",
"0.6143847",
"0.6139941",
"0.61317956",
"0.60969275",
"0.60969275",
"0.60955775"
] | 0.0 | -1 |
Prevent other user create new Person2 object directly | private PrivatePerson(String name, int age) {
super(name, age);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public boolean create(Person person) {\n return false;\r\n }",
"@Override\r\n\tpublic void create(Person person) {\n\r\n\t}",
"@Override\r\n\tpublic void create(Person p) \r\n\t{\n\t\t\r\n\t}",
"Person createPerson();",
"private void loadExistingPerson() {\r\n\r\n\t\tSystem.out.println(\"Start Load existing Patient...\");\r\n\r\n\t\ttry {\r\n\t\t\tIPerson p1 = new Person(\"admin\", new Role(Roles.ADMINISTRATOR,\r\n\t\t\t\t\t\"Hauptadministrator\"), BCrypt.hashpw(\"admin\", BCrypt\r\n\t\t\t\t\t.gensalt()), \"[email protected]\", \"Vorname\", \"Nachname\",\r\n\t\t\t\t\t\"Organisation\", \"Abteilung\", \"Fachrichtung\", \"Strasse\",\r\n\t\t\t\t\t\"3e\", \"54321\", \"Ort\");\r\n\r\n\t\t\tList<IPerson> possiblePersons = PersistenceService.getService()\r\n\t\t\t\t\t.getPersonsFromDB(\"admin\");\r\n\t\t\tIPerson p2 = null;\r\n\t\t\tfor (IPerson p : possiblePersons) {\r\n\t\t\t\tif (BCrypt.checkpw(\"admin\", p.getPassword()))\r\n\t\t\t\t\tp2 = p;\r\n\t\t\t}\r\n\r\n\t\t\t// Person p2=Person.getPerson(3);\r\n\r\n\t\t\tSystem.out.println(\"Person p1: \" + p1.toString());\r\n\t\t\tif (p2 != null)\r\n\t\t\t\tSystem.out.println(\"Person p2: \" + p2.toString());\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Person p2 nicht geladen.\");\r\n\t\t\tp1.save();\r\n\t\t} catch (BusinesslogicException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} catch (DatabaseException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Patient loaded!!\");\r\n\t}",
"public Person createPerson(Person p);",
"public void create(Person p) {\n\t\t\n\t}",
"@Override\r\n\tpublic boolean savePerson(Person person) {\n\t\treturn false;\r\n\t}",
"private void saveNewPerson() {\r\n\r\n\t\tSystem.out.println(\"Start Save new Patient...\");\r\n\r\n\t\ttry {\r\n\t\t\tIPerson p1 = new Person(\"admin\", new Role(Roles.ADMINISTRATOR,\r\n\t\t\t\t\t\"Hauptadministrator\"), \"Passwort\", \"[email protected]\", \"Vorname\",\r\n\t\t\t\t\t\"Nachname\", \"Organisation\", \"Abteilung\", \"Fachrichtung\",\r\n\t\t\t\t\t\"Strasse\", \"3e\", \"54321\", \"Ort\");\r\n\r\n\t\t\tp1.save();\r\n\t\t} catch (BusinesslogicException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} catch (DatabaseException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"New Patient saved!!\");\r\n\t}",
"public Person2(String fname, String lname) {\n this.fname = fname;\n this.lname = lname;\n }",
"private Permit saveToPermitObject() {\n\n\n\n return null;\n\n }",
"void addPerson(Person person) throws UniquePersonList.DuplicatePersonException;",
"void lookupAndSaveNewPerson();",
"@Override\n public boolean insertmodel(ModelPerson person) {\n return false;\n }",
"@Override\n public boolean create(Revue objet) {\n return false;\n }",
"protected ProcessAddPerson() {\n }",
"private TypicalPersons() {}",
"private TypicalPersons() {}",
"public void CreatePerson(Person p){\n\t\tWeddingConnectionPoolManager con = new WeddingConnectionPoolManager(); \n\t\t Person p1 = new Person(p.getId(), p.getFirstName(), p.getLastName(), p.getRelationship(),\n\t\t\t\t p.getAddress(), p.getPhone(), p.getEmail(), p.getComment(), user.getId());\n\t\t System.out.println(\"p1 : \" + p1);\n\t\t System.out.println(\"p : \" + p);\n\t\t// TODO - should to iterate on the results that returns when calling to \"getpersons\" method.\n\t\tPersonDBManager.getInstance().CreateNewPerson(con.getConnectionFromPool(), p1);\t\n\t}",
"@Test\r\n\tpublic void testDenyFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.receiveFriendRequest(\"JavaLord\", \"JavaLordDisplayName\");\r\n\t\tassertTrue(p1.hasFriendRequest(\"JavaLord\"));\r\n\t\tassertTrue(p1.denyFriendRequest(\"JavaLord\"));\r\n\t\tassertFalse(p1.denyFriendRequest(\"JavaLord\"));\r\n\t}",
"private ImmutablePerson(ImmutablePerson other) {\n firstName = other.firstName;\n middleName = other.middleName;\n lastName = other.lastName;\n nickNames = new ArrayList<>(other.nickNames);\n }",
"void crearNuevaPersona(Persona persona);",
"public Person1() {\n\t\tsuper();\n\t}",
"private FacadePerson() throws personNotFoundExeption{}",
"@Override\n public boolean insertjsonobject(ModelPerson person) {\n return false;\n }",
"public void addPerson(String name){\n Person newPerson = new Person(name,this.x1,this.x2);\n for(Person p : personList){\n if(p.equals(newPerson)){\n System.out.println(\"Error! The person already exists.\");\n }\n }\n personList.add(newPerson);\n }",
"@ManyToOne(fetch=FetchType.LAZY)\n\t@JoinColumn(name=\"User_ID\", nullable=false)\n\tpublic Person getPerson2() {\n\t\treturn this.person2;\n\t}",
"public void testAddAddress2() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationUser(null);\r\n this.dao.addAddress(address, false);\r\n fail(\"IPE expected\");\r\n } catch (InvalidPropertyException e) {\r\n //good\r\n }\r\n }",
"@objid (\"617db225-55b6-11e2-877f-002564c97630\")\n @Override\n public boolean canCreate(Class<? extends MObject> type) {\n return false;\n }",
"private void init(){\r\n\t\tString fullName = this.person_.getFirstName()+\" \"+this.person_.getLastName();\r\n\t\tboolean alreadyExists = PersonModel.exists(fullName);\r\n\t\t\r\n\t\tif(alreadyExists == true){\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//need to create person\r\n\t\t\tPersonModel pm = new PersonModel(fullName);\r\n\t\t\tpm.save();\r\n\t\t}\r\n\r\n\t}",
"@Test(expected = OperationNotPermittedException.class)\n public void testCreateOnBehalfUser_notActingOn() throws Exception {\n idService.createOnBehalfUser(customer2.getOrganizationId(), \"\");\n }",
"public void createEntity2(Entity2 entity2) throws DaoException;",
"@Override\n\tpublic boolean create(User user) {\n\t\treturn false;\n\t}",
"@Test\r\n\tpublic void testOutgoingFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.nonDatabase = true;\r\n\t\tassertTrue(p1.newOutgoingFriendRequest(\"test\"));\r\n\t\tassertFalse(p1.newOutgoingFriendRequest(\"test\")); // Fail if duplicate\r\n\t}",
"@Override\r\n\tpublic boolean create(Jeu obj) {\n\t\treturn false;\r\n\t}",
"public Person createAdminUser(Register entity) {\t\t\n\t\tPerson person = new Person();\n\t\tif(!searchPersonNew(entity)) {\t\t\t\n\t\t\tperson = factory.createPerson(entity);\t\t\t\t\t\t\n\t\t\tcreate(person);\t\t\t\n\t\t}\t\t\n\t\treturn person;\n\t}",
"void deletePerson(ReadOnlyPerson target) throws PersonNotFoundException;",
"public void setCreatePerson(String createPerson) {\n this.createPerson = createPerson;\n }",
"void deletePerson(ReadOnlyPerson target) throws UniquePersonList.PersonNotFoundException;",
"void validateActivoCreate(Activo activo);",
"public void savePerson(Person person) {\n\t\t\n\t}",
"public DaoResult createPerson(final Person person) {\n if (findPersonByFacebookId(person.getFacebookId()) != null) {\n return DaoResult.RECORD_ALREADY_EXIST;\n }\n //if no, find the city from City table, and create\n CityDataHandler cityDataHandler = new CityDataHandler();\n City fromCity = cityDataHandler.findCity(person.getFrom().getName());\n if (fromCity != null) {\n person.setFrom(fromCity);\n }\n City toCity = cityDataHandler.findCity(person.getTo().getName());\n if (toCity != null) {\n person.setTo(toCity);\n }\n\n EntityManager entityManager = CarPoolBuddyEntityManagerFactory.getInstance().makeEntityManager();\n EntityTransaction tx = entityManager.getTransaction();\n try {\n tx.begin();\n entityManager.persist(person);\n tx.commit();\n } finally {\n if (tx.isActive()) {\n tx.rollback();\n }\n entityManager.close();\n }\n\n //check if inserted\n if (findPersonByFacebookId(person.getFacebookId()) != null) {\n return DaoResult.RECORD_CREATED_SUCCESSFULLY;\n } else {\n return DaoResult.RECORD_CREATION_FAILED;\n }\n }",
"private Reservation(Integer id, Person person, Seat seat, Showing showing, boolean objectOnly)\n throws PersistenceException{\n super();\n this.setId(id);\n personReservationSupervisor.getInstance().set(this, person);\n reservationSeatSupervisor.getInstance().set(this, seat);\n if(objectOnly) return;\n try{reservationShowingSupervisor.getInstance().add(showing,this);}catch(ConstraintViolation cv){}// Ok, because consistency is guaranteed with this statement\n }",
"public void addPerson(Person2 p){\n\t\tint index = 0;\r\n\t\tpersons = new Person2[50];\r\n\t\t\r\n\t\tfor(int i = 0; i < persons.length; i++){\r\n\t\t\tif(persons[i] == null){ // location available\r\n\t\t\t\tindex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(index < persons.length){\r\n\t\t\tpersons[index] = p;\r\n\t\t}\r\n\t}",
"@Transactional\r\n public Person createNewBorrower(BorrowerDTO borrowerDTO){\n \tcom.croamora.examenCROA.entity.User appUser = new com.croamora.examenCROA.entity.User();\r\n \tappUser.setUsername(borrowerDTO.getEmail());\r\n \tappUser.setEnabled(true);\r\n \tappUser.setPassword(Utils.Passgenerator(borrowerDTO.getPassword()));\r\n \tAuthority Authority = authorityRepository.findByAuthority(\"borrower\");\r\n \tSet<Authority> authorities = new HashSet<Authority>();\r\n \tauthorities.add(Authority);\r\n \tappUser.setAuthority(authorities);\r\n \tuserRepository.save(appUser);\r\n \t\r\n \t//create new Person, add persist User and save to DB\r\n \tPerson person = new Person();\r\n \tperson.setFirstName(borrowerDTO.getFirstName());\r\n \tperson.setLastName(borrowerDTO.getLastName());\r\n \tperson.setUser(appUser);\r\n \tperson.setPersonType(personTypeRepository.findByShortDescLabel(\"borrower\"));\r\n \tpersonRepository.save(person);\r\n \t\r\n \t//create new Loan and save to DB\r\n \tLoan loan = new Loan();\r\n \tloan.setPerson(person);\r\n \tloan.setReason(borrowerDTO.getNeed());\r\n \tloan.setDescription(borrowerDTO.getDescription());\r\n \tloan.setAmount(borrowerDTO.getMoney());\r\n \tloanRepository.save(loan);\r\n \t\r\n \treturn person;\r\n \t\r\n }",
"public void create(Person person) {\n\t\tpersonRepository.save(person);\n\t}",
"public boolean insertPerson(SamplePerson person) {\n //TODO\n throw new NotImplementedException();\n }",
"@Override\r\n public boolean delete(Person person) {\n return false;\r\n }",
"@Override\n\tpublic void addPerson(User pUser) {\n\t\t\n\t}",
"@Override\n public void savePerson() {\n this.personDao.savePerson();\n }",
"public Friend createFriend();",
"public void addPerson(Person person){\n if (person.getCurrentFloor() != this.currentFloor){\n throw new IllegalArgumentException(\"Person with ID \" + person.getPersonID() +\n \" enters elevator with ID \" + this.ElevatorID + \" on wrong floor\");\n }\n if (!doorOpened) {\n throw new IllegalArgumentException(\"Person with ID \" + person.getPersonID() +\n \" wants to go to closed elevator with ID \" + this.ElevatorID);\n } else if (peopleInside.contains(person)) {\n throw new IllegalArgumentException(\"Person with ID \" + person.getPersonID() +\n \" is already in elevator with ID \" + this.ElevatorID);\n }\n peopleInside.add(person);\n\n }",
"public void setCreateperson(String createperson) {\r\n this.createperson = createperson;\r\n }",
"@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}",
"public void createObject() throws NullPointerException{\n Object object1 = new Object();\r\n Object object2 = new Object();\r\n object2=null;\r\n if(object2!=null){\r\n object2.equals(object1);\r\n }\r\n else{\r\n //throw new NullPointerException(\"Exception handled by throws statement\");//throws an exception, is always followed by an object new.\r\n }\r\n }",
"Individual createIndividual();",
"@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}",
"@FXML\n public void secondPersonSelected() {\n connectionType.getSelectionModel().clearSelection();\n createConnectionButton.setDisable(true);\n\n connectionType.setDisable(false);\n }",
"@Override\n\tpublic void save(Person person) {\n\t\t\n\t}",
"public Person(){\r\n\t\tsuper();\r\n\t}",
"@FXML\n private void handleNewPerson() {\n Shops tempShops = new Shops();\n boolean okClicked = mainApp.showPersonEditDialog(tempShops);\n if (okClicked) {\n mainApp.getPersonData().add(tempShops);\n }\n }",
"public Person(String firstName, String lastName) {\r\n name = new Name(firstName, lastName); \r\n id = (int )(Math.random() * 200 + 100);; \r\n }",
"public void newUser(User user);",
"public Person() {}",
"@Override\n\tprotected Object clone() {\n\t\tUser1 user = null;\n\t\ttry {\n\t\t\tuser = (User1) super.clone();\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\tuser = new User1(this.getFirstName(), this.getLastName(), (Address1)this.getAddress().clone());\n\t\t}\n\t\treturn user;\n\t}",
"public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }",
"@Override\n\tpublic boolean create(Langues obj) {\n\t\treturn false;\n\t}",
"protected void onSavePerson(Person person) {\n boolean isNew = false;\n if (person.getId() == null) {\n isNew = true;\n }\n\n try {\n personManager.save(person);\n } catch (Exception e) {\n e.printStackTrace();\n log.error(\"Error saving person: \" + e.getMessage());\n }\n\n String message = getLocalizer().getString(\"person.updated\", this);\n if (isNew) {\n message = getLocalizer().getString(\"person.added\", this);\n }\n getSession().info(message);\n if (isNew) {\n FeedbackPanel feedback = (FeedbackPanel) responsePage.get(\"feedback\");\n feedback.setVisible(true);\n feedback.setEscapeModelStrings(true);\n throw new RestartResponseAtInterceptPageException(responsePage);\n } else {\n FeedbackPanel feedback = (FeedbackPanel) this.get(\"feedback\");\n feedback.setVisible(true);\n feedback.setEscapeModelStrings(true);\n }\n }",
"void createACustomerWithoutTransaction() {\r\n\t\tSystem.out.println(\"\\nCreating a customer without a transaction:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tCustomer2 c1 = new Customer2(\"Ali\", \"Telli\");\r\n\t\tem.persist(c1);\r\n\t\tem.close();\r\n\t}",
"public Person(String userId, String firstName, String lastName, Gender gender, String spouseId, String fatherId, String motherId) {\n Id = UUID.randomUUID().toString();\n AssociatedUserName = userId;\n FirstName = firstName;\n LastName = lastName;\n Gender = gender;\n SpouseId = spouseId;\n FatherId = fatherId;\n MotherId = motherId;\n }",
"public void create(){}",
"public Criteria andCreatePersonNotEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"create_person <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }",
"public void addPerson(Person p);",
"public void savePerson() {\n\t\tthis.personService.savePerson();\n\t}",
"@PreAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"((hasRole('EMPLOYEE') OR isAnonymous()) AND \"\r\n \t\t\t+ \"(#userDTO.type.typeLabel == 'CUSTOMERLEGAL' OR #userDTO.type.typeLabel == 'CUSTOMERINDIVIDUAL'))\")\r\n \tpublic SystemUserDTO create(SystemUserDTO userDTO);",
"public People savePeople(People people);",
"public static Reservation createAlreadyPersistent(ReservationProxy proxy, Person person, Seat seat, Showing showing)throws PersistenceException{\n if(proxy.isObjectPresent()) return proxy.getTheObject();\n return new Reservation(proxy.getId(), person, seat, showing, true);\n }",
"@Test\r\n\tpublic void testAddFriend() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tFriend p2 = new Friend(\"Dave\");\r\n\t\tassertTrue(p1.addFriend(p2));\r\n\t\tassertFalse(p1.addFriend(p2));\r\n\t}",
"@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative2() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tauthenticate(\"admin\");\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\r\n\t\tunauthenticate();\r\n\t}",
"public void crearPersona(PersonaDTO personaDTO);",
"Student createStudent();",
"@Test(expected = IllegalArgumentException.class)\n public void testAllowedRegistrationsWithNullReference() throws Exception {\n new DefaultPersonBizPolicyConsultant().setAllowedRegistrationStatusOnCreate(null);\n }",
"public void setOwner(Person person) \n {\n owner = person;\n }",
"@Override\n\tpublic boolean create(Etape obj) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void create(Owner owner) {\n\n\t}",
"Not createNot();",
"Not createNot();",
"public boolean isDangerToPeople () {\n\t\treturn false;\n\t}",
"@Transactional\r\n public Person createNewLender(LenderDTO lenderDTO){\n \tcom.croamora.examenCROA.entity.User appUser = new com.croamora.examenCROA.entity.User();\r\n \tappUser.setUsername(lenderDTO.getEmail());\r\n \tappUser.setEnabled(true);\r\n \tappUser.setPassword(Utils.Passgenerator(lenderDTO.getPassword()));\r\n \tAuthority Authority = authorityRepository.findByAuthority(\"lender\");\r\n \tSet<Authority> authorities = new HashSet<Authority>();\r\n \tauthorities.add(Authority);\r\n \tappUser.setAuthority(authorities);\r\n \tuserRepository.save(appUser);\r\n \t\r\n \t//create new Person, add persist User and save to DB\r\n \tPerson person = new Person();\r\n \tperson.setFirstName(lenderDTO.getFirstName());\r\n \tperson.setLastName(lenderDTO.getLastName());\r\n \tperson.setUser(appUser);\r\n \tperson.setPersonType(personTypeRepository.findByShortDescLabel(\"lender\"));\r\n \tpersonRepository.save(person);\r\n \t\r\n \t//create new Wallet register and save to DB\r\n \tWallet wallet = new Wallet();\r\n \twallet.setInflux(lenderDTO.getMoney());\r\n \twallet.setPerson(person);\r\n \twalletRepository.save(wallet);\r\n \t\r\n \treturn person;\r\n \t\r\n }",
"Booking createBooking(Booking newBooking) throws Exception;",
"int insertSelective(PersonRegisterDo record);",
"public Person create() {\n\t\treturn personRepository.create();\n\t}",
"public Connection(Profile person1, Profile person2) {\n\t\n\t\tthis.person1=person1;\n\t\tthis.person2=person2;\n\t}",
"@Ignore\n @Test\n public void whenTestTwoUsersWithTheSameNameAndBirthdayTheGetFalse() {\n Calendar birthday = Calendar.getInstance();\n birthday.set(1001, 12, 21);\n User john = new User(\"John Snow\", birthday);\n User snow = new User(\"John Snow\", (Calendar) birthday.clone());\n\n assertFalse(john.equals(snow));\n }",
"@Override\n\tpublic void create(User user) {\n\t\t\n\t}",
"@Test(expected = IllegalArgumentException.class)\r\n\tpublic void testCreateAndSaveNegative1() {\r\n\t\tBrotherhood brotherhood;\r\n\r\n\t\tauthenticate(\"brother5\");\r\n\r\n\t\tbrotherhood = brotherhoodService.create();\r\n\r\n\t\tbrotherhood.setName(\"Test\");\r\n\t\tbrotherhood.setFoundationYear(1900);\r\n\t\tbrotherhood.setHistory(\"Test\");\r\n\r\n\t\tbrotherhoodService.save(brotherhood);\r\n\r\n\t\tunauthenticate();\r\n\t}",
"public void meet(Person otherPerson) {\n\t\tif (this.equals(otherPerson)) {\n\t\t\tthrow new RuntimeException();\n\t\t} else {\n\t\t\t// add friend\n\t\t\tlistOfFriends.enqueue(otherPerson);\n\t\t\t// add yourself to other person's list\n\t\t\totherPerson.listOfFriends.enqueue(this);\n\t\t}\n\n\t}",
"@Test(enabled = true)\n public void createPerson() {\n List <Account> accounts = new ArrayList<>();\n List<Subscription> sub = new ArrayList<>();\n \n Contact contact = new Contact.Builder().emailaddress(\"[email protected]\").phoneNumber(\"021345685\").build();\n Address address = new Address.Builder().location(\"Daveyton\").streetName(\"Phaswane Street\").houseNumber(45).build();\n \n repo = ctx.getBean(PersonsRepository.class);\n Person p = new Person.Builder()\n .firstname(\"Nobu\")\n .lastname(\"Tyokz\")\n .age(25)\n .account(accounts)\n .sub(sub)\n .contact(contact)\n .address(address)\n .build();\n repo.save(p);\n id = p.getId();\n Assert.assertNotNull(p);\n\n }",
"protected void reservePerson(Person person) {\n person.setIsWorking(true);\n this.setAvailablePersons(this.getAvailablePersons() - 1);\n this.countLabel.setText(\"Available: \" + String.valueOf(this.getAvailablePersons()));\n }",
"User createUser();"
] | [
"0.6937202",
"0.62410724",
"0.61413133",
"0.60717875",
"0.6036145",
"0.6032061",
"0.6005502",
"0.5932953",
"0.58173513",
"0.57905924",
"0.57120997",
"0.56888086",
"0.5681965",
"0.56132746",
"0.5598604",
"0.5545052",
"0.5542349",
"0.5542349",
"0.5518318",
"0.5503342",
"0.5472009",
"0.54528207",
"0.5450138",
"0.54485375",
"0.5445737",
"0.5344482",
"0.5322965",
"0.5322958",
"0.53208715",
"0.5309264",
"0.52955455",
"0.5281833",
"0.52756196",
"0.52742344",
"0.5272559",
"0.5243432",
"0.52325577",
"0.5224998",
"0.5195608",
"0.5160375",
"0.5145252",
"0.511813",
"0.51169",
"0.510102",
"0.50937164",
"0.5091038",
"0.50871354",
"0.5074373",
"0.50629675",
"0.50566053",
"0.50516486",
"0.5045604",
"0.5042875",
"0.5033474",
"0.50303483",
"0.5029793",
"0.5026003",
"0.5024774",
"0.50077224",
"0.49944448",
"0.498916",
"0.49882936",
"0.49849665",
"0.4977757",
"0.49772575",
"0.49762037",
"0.4970216",
"0.49572295",
"0.495519",
"0.49481347",
"0.49390462",
"0.4935574",
"0.49260935",
"0.4920639",
"0.49199265",
"0.49140903",
"0.4903124",
"0.48978388",
"0.48939618",
"0.48924157",
"0.48851016",
"0.48797926",
"0.48742142",
"0.48688006",
"0.48629338",
"0.4860908",
"0.4860908",
"0.4859843",
"0.48571435",
"0.4853845",
"0.48520413",
"0.48319358",
"0.483035",
"0.4829132",
"0.48290673",
"0.4829036",
"0.48289037",
"0.48250276",
"0.48222154",
"0.48218158"
] | 0.533119 | 26 |
Spring will scan to see if anything will return data Only if we put an annotation on it: If I get something from /api/books it will figure things out for me This mapping is called a route The 'api' here is just a prefix we're using. | @GetMapping("api/books")
public List<Book> getallBooks() {
return bookService.all().getPayload();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GetMapping(\"/data\")\n public void testData() {\n }",
"public interface ApiService {\n\n @GET(\"datacatalog?format=json\")\n Call<Catalog> getTopCatalog();\n\n\n/* @GET(\"item/{storyid}.json\")\n Call<StoryResponse> getStoryDetails(@Path(\"storyid\") String storyid);\n\n @GET(\"autocomplete/json\")\n Call<AutoCompleteGooglePlaces> getAutoCompleteResults(@Query(\"key\") String API_KEY,\n @Query(\"input\") String encode);\n\n @GET(\"nearbysearch/json\")\n Call<GetPlacesResponse> getPlaceDetails(@Query(\"location\") String location,\n @Query(\"radius\") int radius,\n @Query(\"key\") String key);*/\n}",
"public interface ApiMovieService {\n\n @GET(\"{filter}\")\n Call<MoviesResponse> getListMovies(@Path(\"filter\") String filter,\n @Query(\"page\") int page,\n @Query(\"api_key\") String apiKey);\n\n @GET(\"{id}\")\n Call<MovieResponse> getMovieDetail(@Path(\"id\") long id, @Query(\"api_key\") String apiKey);\n}",
"public interface IApiService {\n\n @GET(\"/its/master_halte/{id}\")\n public Data<Station> getSynchListStation(@Path(\"id\") String id);\n\n @GET(\"/its/eta/{koridor}/{id}\")\n public Data<Incoming> getSynchListIncoming(@Path(\"koridor\") String koridor,@Path(\"id\") String id);\n}",
"@GetMapping(\"/person\")\r\n@ApiOperation( value = \"Find all Persons\", notes = \"retrieves all the persons detail from the database\", response = Person.class)\r\nprivate List<Person> getAllPerson()\r\n{\r\n\r\n return personService.getAllPerson();\r\n}",
"@GetMapping(\"/product\") \nprivate List<Products> getAllProducts() \n{ \nreturn ProductsService.getAllProducts(); \n}",
"@RequestMapping(\"/member\")\npublic interface TestApiServer {\n @RequestMapping(\"/test\")\n public Map<String,Object> test(Integer id,String name);\n}",
"public interface MovieApiService {\n\n @GET(\"movie/popular\")\n Call<MoviesResponse> getPopularMovies(@Query(\"page\") int page);\n\n @GET(\"movie/top_rated\")\n Call<MoviesResponse> getTopRatedMovies(@Query(\"page\") int page);\n\n @GET(\"movie/{id}\")\n Call<MoviesResponse> getMovieDetails(@Path(\"id\") long id);\n}",
"public interface API {\n @GET(\"today\")\n Observable<RecommendBean> getRecommendData();\n\n @GET(\"search/query/listview/category/{category}/count/10/page/{page}\")\n Observable<SearchBean> getSearchData(@Path(\"category\") String category, @Path(\"page\") int page);\n\n @GET(\"xiandu/categories\")\n Observable<Categories> getCategoriesData();\n\n @GET(\"xiandu/category/{type}\")\n Observable<Category> getCategoryData(@Path(\"type\") String type);\n}",
"@Bean\n\tpublic Docket api() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())\n\t\t\t\t.paths(PathSelectors.any()).build();\n\t}",
"public interface Api {\n @GET(\"ad/getAd\")\n Observable<ImageBean> getImage();\n @GET(\"product/getCatagory\")\n Observable<JiuBean> getJiu();\n @GET(\"home/getHome\")\n Observable<HomeBean> getHome();\n @GET(\"product/getProductCatagory\")\n Observable<SortBean> getSort(@Query(\"cid\") int cid);\n @GET(\"user/reg\")\n Observable<RegBean> getReg(@Query(\"mobile\") String mobile, @Query(\"password\") String password);\n @GET(\"user/login\")\n Observable<LoginBean> getLogin(@Query(\"mobile\") String mobile, @Query(\"password\") String password);\n @GET(\"product/searchProducts\")\n Observable<SouSuoBean> getSouSuo(@Query(\"keywords\") String keywords, @Query(\"page\") int page);\n @GET(\"product/getProductDetail\")\n Observable<XiangQingBean> getXiangQing(@Query(\"pid\") int pid);\n @GET(\"product/getCarts\")\n Observable<CarBean> getCar(@Query(\"uid\") int uid);\n}",
"public interface IteBooksApi {\n\n @GET(\"search/{query}\")\n Observable<SearchBookResult> getBooksByCategory(@Path(\"query\") String query);\n\n @GET(\"search/{query}/page/{number}\")\n Observable<SearchBookResult> getBooksByPage(@Path(\"query\") String query, @Path(\"number\") String number);\n\n @GET(\"book/{id}\")\n Observable<BookDetailResult> getBookDetail(@Path(\"id\") String id);\n}",
"@GetMapping\n public String helloRoot() {\n return \"Hello in root, Spring!\";\n }",
"@GetMapping\n @RequestMapping(\"v2\")\n public String getAllCars(){\n String carName=carRepository.findCardWithinYear(\"1920\");\n return \"The car is: \"+carName;\n }",
"public interface ApiService {\n\n\n //--------------------------------------------Movies------------------------------------------------------------------------------\n\n @GET(\"discover/movie?\" + ApiConstants.ApiKey)\n Call<MovieModel> getMoviesByGenre(@Query(\"with_genres\") String genre,@Query(\"page\") int page);\n\n @GET(\"discover/movie?\" + ApiConstants.ApiKey)\n Call<MovieModel> getMoviesByYear(@Query(\"primary_release_year\") int year,@Query(\"page\") int page);\n\n @GET(\"movie/{popular}?\" + ApiConstants.ApiKey)\n Call<MovieModel> getMovies(@Path(\"popular\")String popular,@Query(\"page\") int page);\n\n @GET(\"movie/{movie_id}?\" + ApiConstants.ApiKey)\n Call<Movie> getMovie(@Path(\"movie_id\") int link,@Query(\"append_to_response\")String credits);\n\n @GET(\"movie/{movie_id}/credits?\" + ApiConstants.ApiKey)\n Call<CreditsModel> getMovieCredits(@Path(\"movie_id\") int link);\n\n @GET(\"genre/movie/list?\" + ApiConstants.ApiKey)\n Call<GenresModel> getGenres();\n\n @GET(\"movie/{movie_id}/\" + \"similar?\" + ApiConstants.ApiKey)\n Call<MovieModel> getSimilar(@Path(\"movie_id\") int link);\n\n @GET(\"movie/{movie_id}/\" + \"videos?\" + ApiConstants.ApiKey)\n Call<VideoModel> getVideo(@Path(\"movie_id\") int link);\n\n @GET(\"search/movie?\" + ApiConstants.ApiKey)\n Call<MovieModel> getSearchMovie(@Query(\"query\") String query);\n\n @GET(\"movie/{movie_id}/images?\" + ApiConstants.ApiKey)\n Call<ImageModel> getMovieImages(@Path(\"movie_id\") int link);\n\n @GET(\"movie/{movie_id}/reviews?\" + ApiConstants.ApiKey)\n Call<ReviewsModel> getMovieReviews(@Path(\"movie_id\") int link);\n\n //--------------------------------------------Shows------------------------------------------------------------------------------\n @GET(\"genre/tv/list?\" + ApiConstants.ApiKey)\n Call<GenresModel> getTVGenres();\n\n @GET(\"discover/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getTVByGenre(@Query(\"with_genres\") String genre,@Query(\"page\") int page);\n\n @GET(\"discover/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getTVByNetwork(@Query(\"with_networks\") int id,@Query(\"page\") int page);\n\n @GET(\"discover/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getTVByYear(@Query(\"primary_release_year\") int year,@Query(\"page\") int page);\n\n @GET(\"tv/{tv_id}?\" + ApiConstants.ApiKey)\n Call<Shows> getShows(@Path(\"tv_id\") int link ,@Query(\"append_to_response\")String credits);\n\n @GET(\"tv/{shows}?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getShows(@Path(\"shows\")String shows,@Query(\"page\") int page);\n\n @GET(\"search/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getSearchShows(@Query(\"query\") String query);\n\n @GET(\"tv/{tv_id}/\" + \"videos?\" + ApiConstants.ApiKey)\n Call<VideoModel> getShowVideo(@Path(\"tv_id\") int link);\n\n @GET(\"tv/{tv_id}/\" + \"similar?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getSimilarShows(@Path(\"tv_id\") int link);\n\n @GET(\"tv/{tv_id}/credits?\" + ApiConstants.ApiKey)\n Call<CreditsModel> getShowCredits(@Path(\"tv_id\") int link);\n\n @GET(\"tv/{tv_id}/images?\" + ApiConstants.ApiKey)\n Call<ImageModel> getShowsImages(@Path(\"tv_id\") int link);\n\n\n //--------------------------------------------Person------------------------------------------------------------------------------\n\n @GET(\"person/popular?\" + ApiConstants.ApiKey)\n Call<PersonModel> getPopularPeople(@Query(\"page\") int page);\n\n @GET(\"person/{person_id}/\" + \"movie_credits?\" + ApiConstants.ApiKey)\n Call<CreditsModel> getPersonCredits(@Path(\"person_id\") int link);\n\n @GET(\"person/{person_id}?\" + ApiConstants.ApiKey)\n Call<Person> getPerson(@Path(\"person_id\") int link);\n\n @GET(\"search/person?\" + ApiConstants.ApiKey)\n Call<PersonModel> getSearchPerson(@Query(\"query\") String query);\n\n //--------------------------------------------Login------------------------------------------------------------------------------\n\n @GET(\"authentication/{guest_session}/new?\" + ApiConstants.ApiKey)\n Call<User> getGuestUser(@Path(\"guest_session\")String guest);\n\n @GET(\"authentication/token/validate_with_login?\" + ApiConstants.ApiKey)\n Call<User> getValidateUser(@Query(\"username\") String username,@Query(\"password\") String password,@Query(\"request_token\")String request_token);\n\n @GET(\"authentication/session/new?\" + ApiConstants.ApiKey)\n Call<User> getUserSession(@Query(\"request_token\") String reques_token);\n\n @GET(\"account?\" + ApiConstants.ApiKey)\n Call<User> getUserDetails(@Query(\"session_id\") String session_id);\n\n //--------------------------------------------Favorites------------------------------------------------------------------------------\n\n @GET(\"account/{account_id}/favorite/movies?\" + ApiConstants.ApiKey)\n Call<MovieModel> getUserFavorites(@Path(\"account_id\") String account_id,@Query(\"session_id\") String session_id);\n\n @GET(\"movie/{movie_id}/\" + \"account_states?\" + ApiConstants.ApiKey)\n Call<Movie> getFavorites(@Path(\"movie_id\") int link,@Query(\"session_id\")String session_id);\n\n @POST(\"account/{account_id}/favorite?\" + ApiConstants.ApiKey)\n Call<Movie> postUserFavorites(@Path(\"account_id\") String account_id, @Query(\"session_id\") String session_id, @Body FavoriteMoviePost body);\n\n @POST(\"account/{account_id}/favorite?\" + ApiConstants.ApiKey)\n Call<Shows> postUserShowFavorites(@Path(\"account_id\") String account_id, @Query(\"session_id\") String session_id, @Body FavoriteMoviePost body);\n\n @GET(\"account/{account_id}/favorite/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getUserShowsFavorites(@Path(\"account_id\") String account_id,@Query(\"session_id\") String session_id);\n\n @GET(\"tv/{tv_id}/\" + \"account_states?\" + ApiConstants.ApiKey)\n Call<Shows> getShowFavorite(@Path(\"tv_id\") int link,@Query(\"session_id\")String session_id);\n\n //--------------------------------------------Watchlist------------------------------------------------------------------------------\n\n @GET(\"account/{account_id}/watchlist/movies?\" + ApiConstants.ApiKey)\n Call<MovieModel> getUserWatchlist(@Path(\"account_id\") String account_id,@Query(\"session_id\") String session_id);\n\n @GET(\"movie/{movie_id}/\" + \"account_states?\" + ApiConstants.ApiKey)\n Call<Movie> getWatchlist(@Path(\"movie_id\") int link,@Query(\"session_id\")String session_id);\n\n @POST(\"account/{account_id}/watchlist?\" + ApiConstants.ApiKey)\n Call<Movie> postUserWatchlist(@Path(\"account_id\") String account_id, @Query(\"session_id\") String session_id, @Body WatchlistMoviePost body);\n\n @POST(\"account/{account_id}/watchlist?\" + ApiConstants.ApiKey)\n Call<Shows> postUserShowWatchlist(@Path(\"account_id\") String account_id, @Query(\"session_id\") String session_id, @Body WatchlistMoviePost body);\n\n @GET(\"account/{account_id}/watchlist/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getUserShowsWatchlist(@Path(\"account_id\") String account_id,@Query(\"session_id\") String session_id);\n\n //--------------------------------------------Rated------------------------------------------------------------------------------\n\n @POST(\"movie/{movie_id}/rating?\" + ApiConstants.ApiKey)\n Call<Movie> postUserRating(@Path(\"movie_id\") int account_id, @Query(\"session_id\") String session_id,@Body Rated body);\n\n @POST(\"tv/{tv_id}/rating?\" + ApiConstants.ApiKey)\n Call<Shows> postUserShowRating(@Path(\"tv_id\") int account_id, @Query(\"session_id\") String session_id,@Body Rated body);\n\n @GET(\"account/{account_id}/rated/movies?\" + ApiConstants.ApiKey)\n Call<MovieModel> getUserRated(@Path(\"account_id\") String account_id,@Query(\"session_id\") String session_id);\n\n @GET(\"account/{account_id}/rated/tv?\" + ApiConstants.ApiKey)\n Call<ShowsModel> getUserRatedShows(@Path(\"account_id\") String account_id,@Query(\"session_id\") String session_id);\n}",
"@RequestMapping(value=\"/book/all\",method=RequestMethod.GET)\n\t\t public @ResponseBody ResponseEntity<List<Books>> getAllBooks(){\n\t\t\t List<Books> books=(List<Books>) booksDAO.findAll();\n\t\t\t return new ResponseEntity<List<Books>>(books,HttpStatus.OK);\n\t\t }",
"@Bean\n\tpublic Docket api() {\n\t// @formatter:off\n return new Docket(DocumentationType.SWAGGER_2)\n // 為了顯示 CompletableFuture 內的 DTO 描述\n .genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class)\n .apiInfo(this.apiInfo())\n .select()\n .apis(RequestHandlerSelectors.any())\n // 濾掉預設的與監控路徑\n .paths(\n path -> {\n return !(path.matches(\"/error\")\n || path.matches(\"/actuator+(.*)\")\n || path.matches(\"/profile\"));\n })\n .build();\n // @formatter:on\n\t}",
"public interface MovieDatabaseService {\n\n @GET(\"3/movie/{sort_by}\")\n Call<Movies> fetchMovies(@Path(\"sort_by\") String sortBy, @Query(\"api_key\") String apiKey);\n\n @GET(\"3/movie/{id}/videos\")\n Call<Trailers> findTrailersById(@Path(\"id\") long movieId, @Query(\"api_key\") String apiKey);\n\n @GET(\"3/movie/{id}/reviews\")\n Call<Reviews> findReviewsById(@Path(\"id\") long movieId, @Query(\"api_key\") String apiKey);\n}",
"public interface ApiService {\n\n @GET(\"classify\")\n Call<GalleryClassResult> getGalleryClassList();\n\n @GET(\"list\")\n Call<GalleryResult> getGalleryList(@Query(\"page\") int page, @Query(\"rows\") int rows, @Query(\"id\") int id);\n\n @GET(\"show\")\n Call<PictureResult> getPictureList(@Query(\"id\") long id);\n\n}",
"public interface EndpointsApi {\n\n @GET(ConstantesRestApi.URL_GET_FOLOWS_MEDIA_RECENT)\n Call<MascotasResponse> getRecentMedia(@Path(\"user-id\") String id);\n\n @GET(ConstantesRestApi.URL_GET_PROFILE_USER_WITH_ID)\n Call<MascotasResponse> getProfile(@Path(\"user-id\") String id);\n\n @GET(ConstantesRestApi.URL_GET_FOLLOWS)\n Call<MascotasResponse> getFollows();\n\n @GET(ConstantesRestApi.URL_GET_FOLOWS_MEDIA_RECENT)\n Call<MascotasResponse> getFollowsMediaRecent(@Path(\"user-id\") String id);\n}",
"public interface AApi {\n //Post示例 http://www.apic.in/anime/33089.htm\n @GET(\"{type}/page/{page}/\")\n Observable<ResponseBody> getPosts(@Path(\"type\") String type, @Path(\"page\") int page);\n\n @GET(\"/{post}/{page}\")\n Observable<ResponseBody> getPictures(@Path(\"post\") String postUrl, @Path(\"page\") int page);\n\n}",
"@RestController\npublic interface UserContoller extends UserApi {\n\n}",
"@GetMapping(\"\")\r\n @ResponseStatus(code = HttpStatus.OK)\r\n public void main() {\r\n LOGGER.info(\"GET /\");\r\n }",
"@RequestMapping(value=\"/api/books/{id}\", method=RequestMethod.GET)\n public Book get(@PathVariable(\"id\") Long id) {\n return this.bookService.findBook(id);\n }",
"@Bean\n public Docket api(){\n //Enables following endpoints once configured\n //http://localhost:8080/swagger-ui.html\n //http://localhost:8080/v2/api-docs\n return new Docket(DocumentationType.SWAGGER_2)\n //.apiInfo(ApiInfo.DEFAULT)\n .apiInfo(DEFAULT_API_INFO)\n .produces(DEFAULT_PRODUCES_AND_CONSUMES)\n .consumes(DEFAULT_PRODUCES_AND_CONSUMES);\n }",
"public interface MovieApiService {\n\n @GET(\"movie/upcoming\")\n Call<JsonRequestDiscoverMovieResult> getDiscoverMovieFeed(\n @Query(\"api_key\") String apiKey\n );\n\n// @GET(\"movie/{id}/videos\")\n// Call<JsonRequestMovieVideoResult> getMovieVideoFeed(\n// @Path(\"id\") String movieId,\n// @Query(\"api_key\") String apiKey\n// );\n}",
"public interface ApiService {\n\n //http://api.themoviedb.org/3/discover/movie?sort_by=popularity_desc&api_key=8df5a981e3421ec1fe8fb26bc13e368b\n @GET(Constants.API_ADDRESS_ENDPOINT_MOVIES)\n Observable<Movies> getMovies(@Query(\"sort_by\") String sortBy);\n\n //http://api.themoviedb.org/3/movie/23800?api_key=8df5a981e3421ec1fe8fb26bc13e368b\n @GET(Constants.API_ADDRESS_ENDPOINT_DETAILS)\n Observable<Movie> getMovieDetails(@Path(\"id\") String id);\n\n //http://api.themoviedb.org/3/movie/500/videos?api_key=8df5a981e3421ec1fe8fb26bc13e368b\n @GET(Constants.API_ADDRESS_ENDPOINT_TRAILERS)\n Observable<Trailers> getTrailers(@Path(\"id\") String id);\n\n //http://api.themoviedb.org/3/movie/49026/reviews?api_key=8df5a981e3421ec1fe8fb26bc13e368b\n @GET(Constants.API_ADDRESS_ENDPOINT_REVIEWS)\n Observable<Reviews> getReviews(@Path(\"id\") String id);\n}",
"@GetMapping(\"/book/{id}\")\n public ResponseEntity<Book> get(@PathVariable(\"id\") String id) {\n Book result = bookService.get(id);\n return ResponseEntity.ok().body(result);\n }",
"public interface Api {\n @GET(\"v2/book/search\")\n Observable<BaseApi<List<Book>>> searchBook(@Query(\"q\") String bookName);\n}",
"@GetMapping(\"/books/{id}\")\n public ResponseEntity<book> getBook(@PathVariable(\"id\") int id){\n book b = bs.getBookById(id);\n if(b == null){\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n }\n return ResponseEntity.of(Optional.of(b));\n }",
"@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)\n\t/*\n\t * @ApiOperation(value = \"Get all the customers\", notes =\n\t * \"Send GET request to get all the customers\" , httpMethod = \"GET\", code = 200,\n\t * response = CustomerResponse.class, responseContainer = \"List\", produces =\n\t * MediaType.APPLICATION_JSON_VALUE)\n\t * \n\t * @ApiResponses(value = {\n\t * \n\t * @ApiResponse(code = 200, response = CustomerResponse.class, responseContainer\n\t * = \"List\", message = \"List of all customers\"),\n\t * \n\t * @ApiResponse(code = 401, response = ErrorResponse.class, message =\n\t * \"Invalid or expired token provided. Error code: CREDENTIALS_REJECTED\"),\n\t * \n\t * @ApiResponse(code = 500, response = ErrorResponse.class, message =\n\t * \"Runtime server error occurred. Error code: SERVER_ERROR\")})\n\t */\n\tpublic List<CustomerResponse> getCustomers() {\n\t\tlog.info(\"hit the controller\");\n\t\treturn customerService.findAll();\n\t}",
"public interface Api {\n\n// root url after add multiple servlets\n\n String BASE_URL = \"https://simplifiedcoding.net/demos/\";\n\n @GET(\"marvel\")\n Call<List<Modelclass>> getmodelclass();\n\n\n\n}",
"public interface BookService {\n //order:bydefault\n //http://api2.qingting.fm/v6/media/categories/527/channels/order/bydefault/0/attr/855/curpage/1/pagesize/30\n @GET(\"v6/media/categories/527/channels/order/{order}/0/attr/{id}/curpage/{curpage}/pagesize/{pagesize}\")\n Observable<BookResult> getBookList(@Header(\"Cache-Control\") String cacheControl, @Path(\"order\") String order, @Path(\"id\") int id, @Path(\"curpage\") int curpage, @Path(\"pagesize\") int pagesize);\n}",
"@Bean\n\tpublic Docket api() { \n\n\t\tDocket docket= new Docket(DocumentationType.SWAGGER_2) \n\t\t\t\t.select() \n\t\t\t\t.apis(RequestHandlerSelectors.basePackage(\"com.authorizationservice.authorization\")) \n\t\t\t\t.paths(PathSelectors.any()) \n\t\t\t\t.build().apiInfo(apiDetails()); \n\t\tlog.debug(\"Docket{}:\", docket);\n\t\treturn docket;\n\t}",
"@Api(tags = \"Address Entity\")\n@RepositoryRestResource(collectionResourceRel = \"taxInformation\", path =\"taxInformation\")\npublic interface TaxInformationRepository extends PagingAndSortingRepository<TaxInformation,Integer> {\n}",
"@DebugLog\npublic interface ApiService {\n final static String APPSETTINGS = \"/application_settings.json\";\n final static String MOVIES = \"/in_theaters.json\";\n\n // APPLICATION SETTINGS\n @Headers(\"Cache-Control: no-cache\")\n @GET(APPSETTINGS)\n void getApplicationSettings(Callback<ApplicationSettings> cb);\n\n // IN THEATERS\n @GET(MOVIES)\n void getMovies(@Query(\"apikey\") String key, @Query(\"page\") int page, @Query(\"page_limit\") int page_limit, Callback<Movies> cb);\n}",
"@RequestMapping(value = \"/book/{id}\", method = RequestMethod.GET)\r\n public ResponseEntity<Book> get(@PathVariable(\"id\") long id) throws Exception{\r\n Book book = bookService.getBookById(id);\r\n return ResponseEntity.ok().body(book);\r\n }",
"@FeignClient(name=\"amsapi\", url=\"localhost:9090\")\n@RequestMapping(\"/api\")\npublic interface AmsApiProxy {\n \n @GetMapping(\"/serieses/{id}\")\n public SeriesDTO getSeries(@PathVariable(\"id\") long id);\n \n @GetMapping(\"/episodes/{id}\")\n public EpisodeDTO getEpisode(@PathVariable(\"id\") long id);\n \n @GetMapping(\"/episodes/{id}/series\")\n public SeriesDTO getEpisodeSeries(@PathVariable(\"id\") long id);\n \n}",
"@GetMapping(\"/product/{productid}\") \nprivate Products getProducts(@PathVariable(\"productid\") int productid) \n{ \nreturn productsService.getProductsById(productid); \n}",
"public interface APIService {\n /**\n * 如果不需要转换成Json数据,可以用了ResponseBody;\n * @return call\n */\n @GET(\"apps?api_token={Your API Token}\")\n// Call<AppInfo> getAppInfo();\n Call<ResponseBody> getAppInfo();\n // you can add some other meathod\n}",
"interface ApiService {\n\n @GET(\"users/{user}/repos\")\n Call<List<FlickR>> getFlickRItems(@Path(\"user\") String user);\n\n @GET(\"users/{user}\")\n Call<Owner> getFlickRMedia(@Path(\"user\") String user);\n\n }",
"@RequestMapping(value=\"/getbooks\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic List<Book> getAll() {\n\t\tList<Book> books = new ArrayList<>();\n\t\tbooks = bookDao.getAllFromDB();\n\t\t\n\t\treturn books;\n\t}",
"@GetMapping(\"/person/{id}\")\r\n@ApiOperation( value = \"Find Person by id\", notes = \"retrieves the details of a specific person\")\r\nprivate Person getPerson(@PathVariable(\"id\") int id)\r\n{\r\n Person person = personService.getPersonById(id);\r\n if(person == null){\r\n throw new PersonNotFoundException(\"PersonNotFound\");\r\n }\r\n System.out.println(person);\r\n return person;\r\n}",
"public interface BaseRoleRemoteService {\n\n /**\n * 根据userId查询角色\n * @param userId\n * @return\n */\n @RequestMapping(value = \"/role/user/{userId}\", method = RequestMethod.GET)\n ResponseData<List<BaseRole>> getRoleByUserId(@PathVariable(\"userId\")String userId);\n}",
"public interface ApiService {\n\t@GET(\"photos\")\n\tCall<List<ApiModel>> getApiData();\n}",
"public interface ApiCategoria {\n @GET(\"4A/webresources/categorias\")\n Call<List<Categoria>> getCategorias();\n\n @GET(\"4A/webresources/categorias/{id}\")\n Call<List<Produto>> getProdutos(@Path(\"id\") int id);\n}",
"@Bean\n public SwaggerSpringMvcPlugin swaggerSpringMvcPlugin() {\n return new SwaggerSpringMvcPlugin(springSwaggerConfig)\n .includePatterns(\n \"/business.*\",\n \"/api-docs.*\"\n\n )\n .pathProvider(new CustomRelativeSwaggerPathProvider() )\n .apiInfo(apiInfo())\n .build();\n }",
"@GetMapping(\"/hello/{name}\")\n @ResponseBody\n public String sayHello(@PathVariable String name){\n return \"Hello \" + name + \"!\";\n }",
"@Bean\r\n public Docket api() {\n\r\n return new Docket(DocumentationType.SWAGGER_2)\r\n .select()\r\n .apis(RequestHandlerSelectors.basePackage(\"com.varun.swaggerapp\"))\r\n .paths(PathSelectors.any())\r\n .build()\r\n .apiInfo(getMyAppInfo());\r\n }",
"@Bean\n public Docket swaggerApi() {\n\n return new Docket(DocumentationType.SWAGGER_2).apiInfo(swaggerInfo()).select()\n .apis(RequestHandlerSelectors.basePackage(\"rooftophero.io.toyp2p.api\"))\n .paths(PathSelectors.any())\n// .paths(PathSelectors.ant(\"/api/*\"))\n .build()\n .useDefaultResponseMessages(false); // 기본으로 세팅되는 200,401,403,404 메시지를 표시 하지 않음\n }",
"public interface Endpoints {\n\n @GET(\"/posts\")\n Call<List<Posts>> getAllPosts();\n}",
"public interface DouBanApi {\n\n @GET(\"movie/top250\")\n Observable<Response<MovieInfoResponse>> getMovieList(@Query(\"start\") int start,\n @Query(\"count\") int count);\n /**\n * /v2/movie/subject/1764796\n */\n\n @GET(\"movie/subject/{resId}\")\n Observable<Response<MoiveSeriesListRespnse>> getMovieSeriesList(@Path(\"resId\") String resId);\n\n /**\n * 热映榜\n * https://api.douban.com/v2/movie/in_theaters\n */\n @GET(\"movie/in_theaters\")\n Observable<Response<MovieInfoResponse>> gethotMovieList(@Query(\"start\") int start,\n @Query(\"count\") int count);\n /**\n * https://api.douban.com/v2/book/search?tag=%E6%8E%A8%E8%8D%90&start=0&count=10\n */\n @GET(\"book/search\")\n Observable<Response<BookInfoResponse>> getBookList(@Query(\"q\") String q, @Query(\"tag\") String tag,\n @Query(\"start\") int start, @Query(\"count\") int count);\n}",
"public interface NewsAPI {\n\n// @GET(\"1.json ?api-key= b6075f230e154c32accba228515bdce5\")\n @GET(\"home.json?api-key=b6075f230e154c32accba228515bdce5\")\n Call<NewsModel>getNewsModel();\n\n\n //Dynamic method\n //use if you would like user to alter the information returned from api call\n //\n// @GET(\"{section}.{format}\")\n// Call<NewsModel>test(@Path(\"section\") String s, @Path(\"format\") String f);\n\n\n}",
"public interface RestApi {\n}",
"@Override\n\tprotected String route() {\n\t\treturn \"api/ad\";\n\t}",
"public interface ApiInterface {\n @GET(\"movie/top_rated\")\n Call<MoviesResponse> getTopRatedMovies(@Query(\"api_key\") String apiKey);\n\n @GET(\"movie/{id}\")\n Call<MoviesResponse> getMovieDetails(@Path(\"id\") int id, @Query(\"api_key\") String apiKey);\n\n}",
"public interface ApiService {\n\n @GET(\"20/1\")\n Observable<HttpResult<List<Result>>> getWeal();\n\n\n}",
"@GetMapping(\"/\")\r\npublic String index(Model model) {\n\r\n return \"index\";\r\n}",
"public interface MovieDbApiService {\n @GET(\"search/movie\")\n Observable<SearchMovie> searchMovie(\n @Query(\"api_key\")String apiKey,\n @Query(\"language\") String language,\n @Query(\"query\") String query\n );\n\n @GET(\"movie/{MovieId}\")\n Observable<DetailMovie> getDetailMovie(\n @Path(\"MovieId\") String movieId,\n @Query(\"api_key\") String apiKey,\n @Query(\"language\") String language\n );\n\n\n @GET(\"movie/upcoming\")\n Observable<UpcomingMovie> getUpcomingMovie(\n @Query(\"api_key\") String apiKey,\n @Query(\"language\") String language\n );\n}",
"@GetMapping\n @RequestMapping(\"/\")\n public Map defaultHome() {\n Map map = new HashMap();\n map.put(\"app-version\", appVersion);\n map.put(\"api call 1\", \"/api/v1/sessions\");\n map.put(\"api call 2\", \"/api/v1/speakers\");\n return map;\n }",
"public interface RESTfulAPI {\r\n @GET(\"posts\")\r\n Call<List<Post>> getAllPosts();\r\n\r\n @GET(\"posts\")\r\n Call<List<Post>> getAllPostsByUserID(@Query(\"userID\") int userID);\r\n\r\n @GET(\"post/{postID}\")\r\n Call<Post> getPostByID();\r\n\r\n// @POST(\"post\")\r\n}",
"@GetMapping(\"/home\")\n\t//@ResponseBody\n\tpublic String home()\n\t{\n\t\treturn\"/first/home\";\n\t}",
"@GetMapping(\"/recommendations\")\n public ResponseEntity<?> getMovies() {\n Movie[] result = restTemplate.getForObject(\"http://movie-service/movies\", Movie[].class);\n System.out.println(result);\n return new ResponseEntity<>(result, HttpStatus.OK);\n }",
"public interface UserApi {\r\n @GetMapping(\"query\")\r\n public User queryUser(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password);\r\n}",
"public interface KanazawaApi {\n /*@以降は用途に合わせて Get Post Put Delete を用いる\n @Pathは{}内の物を照会\n @Queryを用いることでよくあるevent.json?1d=19などを簡単に記述できる\n 例 getEvent(@Query(\"id\"));\n */\n\n @GET(\"/{name}.json\")// 「/」から開始しないとはじかれる\n public Observable<KanazawaEntity> getEvent(@Path(\"name\")String url);\n}",
"public interface CatagoryApiService {\n\n @GET(\"product/getCatagory\")\n Observable<CatagoryBean> getCatagory();\n}",
"public interface ApiService {\n @GET(\"/student/mobileRegister\")\n Observable<HttpResult<UserEntity>> login(@Query(\"phone\") String phone, @Query(\"password\") String psw);\n\n\n @GET(\"top250\")\n Observable<HttpResult<List<Subject>>> getTopMovie(@Query(\"start\") int start, @Query(\"count\") int count);\n\n @GET(\"top250\")\n Observable<HttpResult<Subject>> getUser( @Query(\"touken\") String touken);\n}",
"@GetMapping(\"/books\")\n public String list(Model model){\n model.addAttribute(\"book\", bookService.findAllBooks());\n return \"books\";\n }",
"@GetMapping(path = \"/hello-world\")\n public String helloWorld(){\n return \"Hello World\";\n }",
"public interface BookService {\n\n @GET(\"books.json\")\n Call<List<Book>> getBooks();\n\n}",
"@GetMapping(\"/info\")\n public String info(){\n return \"info\";\n }",
"@Path(\"/index\")\n public void index(){\n }",
"@Api(value = \"课程分类管理\",description = \"课程分类管理\",tags = {\"课程分类管理\"})\npublic interface CategoryControllerApi {\n @ApiOperation(\"查询分类\")\n public CategoryNode findList(String id);\n}",
"public interface APIService {\n\n @GET(\"api/rates\")\n Observable<List<ProductModel>> getproductdata();\n\n}",
"public interface Service {\n\n @GET(\"movie/{sub_type}\")\n Call<MovieResponse> getMovie(@Path(\"sub_type\")String sub_type, @Query(\"api_key\")String api_key, @Query(\"language\")String language, @Query(\"page\")int page);\n\n @GET(\"tv/{sub_type}\")\n Call<TvShowResponse> getTvShow(@Path(\"sub_type\")String sub_type, @Query(\"api_key\")String api_key, @Query(\"language\")String language, @Query(\"page\")int page);\n\n @GET(\"movie/{movie_id}/recommendations\")\n Call<MovieResponse> getMovieRecommendations(@Path(\"movie_id\")int movie_id,@Query(\"api_key\")String api_key, @Query(\"language\")String language,@Query(\"page\")int page);\n\n @GET(\"tv/{tv_id}/recommendations\")\n Call<TvShowResponse> getTvShowRecommendations(@Path(\"tv_id\")int tv_id, @Query(\"api_key\")String api_key, @Query(\"language\")String language, @Query(\"page\")int page);\n\n @GET(\"search/movie\")\n Call<MovieResponse> getMovieSearch(@Query(\"query\")String query,@Query(\"api_key\")String api_key, @Query(\"language\")String language,@Query(\"page\")int page);\n\n @GET(\"search/tv\")\n Call<TvShowResponse> getTvShowSearch(@Query(\"query\")String query, @Query(\"api_key\")String api_key, @Query(\"language\")String language, @Query(\"page\")int page);\n\n}",
"@GetMapping(\"/{id}/students\")\n public List<Students> getStudents(@PathVariable long id) {\n //code\n return null;\n }",
"@RequestMapping(value=\"/getbook\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic Book getBook() {\n\t\treturn new Book(\"1\", \"Marvel Comics\", \"Stanlee\", 200D, \"Awesome book\");\n\t}",
"@CrossOrigin(origins = \"http://localhost:4200\")\n\t@GetMapping(\"/businesses\")\n public List<Business> getAllBusiness() {\n return businessRepository.findAll();\n }",
"@Bean\n\tpublic Docket postApi() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2)\n\t\t\t\t.apiInfo(metadata()).select().paths(regex(\"/api.*\")).build();\n\t}",
"public interface ServiceApi {\n @GET(\"/user/login\")\n Observable<DlBean> dL(@Query(\"mobile\") String mobile,@Query(\"password\") String password );\n @GET(\"/user/reg\")\n Observable<ZcBean> zC(@Query(\"mobile\") String mobile,@Query(\"password\") String password );\n @GET(\"/ad/getAd\")\n Observable<LbBean> lieb(@Query(\"source\") String source );\n // http://120.27.23.105/product/getProductDetail?pid=1&source=android\n @GET(\"/product/getProductDetail\")\n Observable<XqBean> xQ(@Query(\"source\") String source, @Query(\"pid\") int pid);\n @GET(\"product/getCarts\")\n Observable<MsgBean<List<DataBean>>> getDatas(@Query(\"uid\") String uid, @Query(\"source\") String source);\n @GET(\"product/deleteCart\")\n Observable<MsgBean> deleteData(@Query(\"uid\") String uid, @Query(\"pid\") String pid, @Query(\"source\") String source);\n\n}",
"public interface Api {\n\n\n @GET(\"users?site=stackoverflow\")\n Call<UserResponse> getUser(@Query(\"pagesize\")int size,@Query(\"sort\")String sort);\n\n @GET(\"comments?site=stackoverflow\")\n Call<CommentsResponse> getComments(@Query(\"order\")String order,@Query(\"sort\")String votes,@Query(\"pagesize\")int size,@Query(\"min\")int min);\n\n @GET(\"posts/{ids}?site=stackoverflow\")\n Call<PostResponse> getPostResponseCall(@Path(\"ids\") long id);\n @GET(\"users/{ids}/questions?site=stackoverflow\")\n Call<QuestionsResponse> getQuestionsResponseCall (@Path(\"ids\")long id),@Query(\"sort\")String votes,\n}",
"public interface IBookDetailInteractor {\n @GET(Api.GET_BOOK_DETAIL)\n Observable<Book> getBookDetail(@Path(\"id\") String bookId);\n}",
"@Repository\n@RepositoryRestResource(path = \"employees\")\npublic interface EmployeeRepository extends JpaRepository<Employee, Long> {\n\n /**\n *Retrieve employees ordered be last name\n * With link /api/employees/search/lastname\n */\n @RestResource(path = \"lastname\")\n List<Employee> findAllByOrderByLastNameAsc();\n\n}",
"public interface Api {\n\n @GET(\"posts\")\n Observable<List<Post>> getPosts();\n}",
"@GetMapping(\"/books/{id}\")\n public ResponseEntity<Book> getBookById(@PathVariable(value = \"id\") long bookId ) throws ResourceNotFoundException{\n Book book = bookRepository.findById(bookId)\n .orElseThrow(() -> new ResourceNotFoundException(\"Book not found :: \" + bookId));\n return ResponseEntity.ok().body(book);\n }",
"@CrossOrigin(origins = \"http://localhost:3000\")\n @RequestMapping(value = \"/all\", method = RequestMethod.GET, produces = \"application/json\")\n public List<Student> getAllStudents(){\n return studentService.findAll();\n }",
"public interface IPokeapiService {\n\n\n\n// @GET(\"lp_iem/result.json\")\n// Call<PokemonWs> listPokemon();\n\n @GET(\"?action=cardlist&\")\n Call<List<Pokemon>> listPokemon(@Query(\"user\")int user);\n //@Query(\"user\")int user\n\n @GET(\"?action=details&\")\n Call<Pokemon> getPokemon(@Query(\"card\")int id_card);\n\n @GET(\"?action=pokedex\")\n Call<List<Pokemon>> getPokedex();\n\n}",
"public interface MeiZhiService {\n\n /**\n * 妹纸列表\n */\n @GET(\"data/福利/{num}/{page}\")\n Flowable<MeizhiBean> getGirlList(@Path(\"num\") int num, @Path(\"page\") int page);\n}",
"@GetMapping(\"/hi\")\n public String sayHello(){\n return \"Hello\";\n }",
"public interface ReadApi {\n\n @GET(\"auth/token/get\")\n Observable<ApiResponse<ReadToken>> getReadToken(@Query(\"wpy_token\") String wpy_token);\n\n //检查readtoken逻辑,暂时通过http code实现\n// @GET(\"token/check\")\n// Observable<ApiResponse<String>> checkReadToken(@Query())\n\n @GET(\"banner/{count}\")\n Observable<ApiResponse<List<HomeBanner>>> getBanner(@Path(\"count\") String count);\n\n @GET(\"recommended/{count}\")\n Observable<ApiResponse<List<Recommended>>> getRecommendedList(@Path(\"count\") String count);\n\n @GET(\"hotreview/{count}\")\n Observable<ApiResponse<List<Review>>> getReviewList(@Path(\"count\") String count);\n\n @GET(\"starreader/{count}\")\n Observable<ApiResponse<List<User>>> getStarReaderList(@Path(\"count\") String count);\n\n @GET(\"book/search/{info}\")\n Observable<ApiResponse<List<SearchBook>>> searchBooks(@Path(\"info\") String info);\n\n @GET(\"book/detail/{id}?include=review,starreview,holding\")\n Observable<ApiResponse<Detail>> getBookDetail(@Path(\"id\") String id);\n\n // TODO: 16-10-22 略迷\n// @GET(\"review/{id}/{limit}\")\n// Observable<ApiResponse<Review>> getBookReview(@Path(\"id\") String id, @Path(\"limit\") String limit);\n//\n// @GET(\"score/{id}\")\n// Observable<ApiResponse<>>\n\n @GET(\"book/bookshelf/get\")\n Observable<ApiResponse<List<BookInShelf>>> getBookShelf();\n\n @GET(\"book/addbookshelf/{id}\")\n Observable<ApiResponse<Object>> addBookShelf(@Path(\"id\") String id);\n\n @GET(\"book/delbookshelf\")\n Observable<ApiResponse<Object>> delBookShelf(@Query(\"id[]\") String[] id);\n\n @GET(\"review/addlike/{id}\")\n Observable<ApiResponse<Object>> addLike(@Path(\"id\") String id);\n\n @GET(\"review/dellike/{id}\")\n Observable<ApiResponse<Object>> delLike(@Path(\"id\") String id);\n\n @GET(\"review/get\")\n Observable<ApiResponse<List<Review>>> getMyReview();\n\n /**\n * 微北洋的升级接口\n * @return\n */\n @GET(\"http://mobile.twt.edu.cn/api/v1/version/com.twt.service\")\n Observable<LatestVersion> checkLatestVersion();\n\n @FormUrlEncoded\n @POST(\"book/review\")\n Observable<ApiResponse<ReviewCallback>> addReview(@Field(\"id\") String id, @Field(\"content\") String content, @Field(\"score\") float score);\n\n @GET(\"http://api.interlib.com.cn/interlibopac/websearch/metares\")\n Observable<ResponseBody> getBookCover(@Query(\"cmdACT\") String act, @Query(\"isbns\") String isbn, @Query(\"callback\") String callback);\n}",
"public interface ApiInterface {\n @GET(\"/contacts\")\n Call<Details> getAllContacts();\n}",
"public interface PrecosService {\n\n @GET(\"/combustivelbarato/precos/master/precos.json\")\n List<Preco> getPrecos();\n}",
"public interface ApiInterface {\n @GET(\"/index.php/api/\")\n Call<Category> getInfo();\n\n @GET(\"/index.php/api/brand\")\n Call<Brand> getBrand();\n\n @GET(\"/index.php/api/featured_products\")\n Call<FeatureProduct> getFeature();\n\n @POST(\"/index.php/api/product_view\")\n Call<CategoryResponse> CategoryIdPost(@Body CatId catId);\n}",
"public interface ApiService {\n\n @GET(\"sector/allsectors\")\n Observable<AllSectorsResponse> allSectors();\n\n}",
"@Bean\n public Docket userApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .apiInfo(metaData())\n .select()\n .apis(RequestHandlerSelectors.basePackage(API_BASE_PACKAGE))\n .apis(RequestHandlerSelectors.any())\n .paths(PathSelectors.any())\n .build();\n }",
"@Bean\n public Docket api() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(groupName)\n .select()\n .apis(RequestHandlerSelectors.basePackage(basePackage))\n .paths(PathSelectors.any())\n .build()\n .enable(enable)\n .apiInfo(apiInfo());\n }",
"public interface Swapi {\n\n @GET(\"/planets/{id}/\")\n Observable<Planet> planet(@Path(\"id\") int id);\n\n @GET(\"/planets/\")\n Observable<Page<Planet>> planets();\n\n @GET(\"/planets/\")\n Observable<Page<Planet>> planets(@Query(\"page\") int page);\n\n\n @GET(\"/people/{id}/\")\n Observable<People> people(@Path(\"id\") int id);\n\n @GET(\"/people/\")\n Observable<Page<People>> peoples();\n\n @GET(\"/people/\")\n Observable<Page<People>> peoples(@Query(\"page\") int page);\n\n @GET(\"/vehicles/{id}/\")\n Observable<Vehicle> vehicle(@Path(\"id\") int id);\n\n @GET(\"/vehicles/\")\n Observable<Page<Vehicle>> vehicles();\n\n @GET(\"/vehicles/\")\n Observable<Page<Vehicle>> vehicles(@Query(\"page\") int page);\n\n @GET(\"/starships/{id}/\")\n Observable<Starship> starship(@Path(\"id\") int id);\n\n @GET(\"/starships/\")\n Observable<Page<Starship>> starships();\n\n @GET(\"/starships/\")\n Observable<Page<Starship>> starships(@Query(\"page\") int page);\n\n\n}",
"@RequestMapping(\"/\")\n\t@ResponseBody\n\tpublic String home() {\n\t\treturn \"Hi Spring Boot!!\";\n\t}",
"@GetMapping(\"/{userId}\")\n public UserAndCar find(@PathVariable Long userId) {\n }",
"public interface ApiService {\n\n\n public static final String BASE_URL = \"http://112.124.22.238:8081/course_api/cniaoplay/\";\n\n// @GET(\"featured\")\n// public Call<PageBean<AppInfo>> getApps(@Query(\"p\") String jsonParam);\n\n @GET(\"featured\")\n public Observable<BaseBean<PageBean<AppInfo>>> getApps(@Query(\"p\") String jsonParam);\n\n}"
] | [
"0.64259905",
"0.6421049",
"0.6390985",
"0.6311354",
"0.63020283",
"0.6294816",
"0.6265499",
"0.6254691",
"0.62496704",
"0.6232741",
"0.61959434",
"0.615705",
"0.6146646",
"0.6129279",
"0.6113402",
"0.6098971",
"0.60940284",
"0.606532",
"0.60647625",
"0.60594606",
"0.6044754",
"0.60431695",
"0.6010153",
"0.600997",
"0.6009727",
"0.6004365",
"0.60031056",
"0.5998451",
"0.5997787",
"0.5991465",
"0.5990795",
"0.5984036",
"0.59761655",
"0.5968643",
"0.5958925",
"0.59520775",
"0.5943245",
"0.5934073",
"0.5921881",
"0.59160763",
"0.59144473",
"0.5907646",
"0.5905437",
"0.5898396",
"0.58966523",
"0.5895372",
"0.5875421",
"0.58700365",
"0.5866909",
"0.5857752",
"0.58534145",
"0.5850953",
"0.5846363",
"0.58343667",
"0.5831423",
"0.58310115",
"0.5826121",
"0.5813054",
"0.5812748",
"0.58115554",
"0.5809378",
"0.5808924",
"0.58014476",
"0.5800358",
"0.57993287",
"0.5795753",
"0.57934785",
"0.5788537",
"0.5785784",
"0.57856387",
"0.57815456",
"0.5778451",
"0.57764167",
"0.57667744",
"0.57637256",
"0.57632214",
"0.57621604",
"0.57589567",
"0.57524896",
"0.5751245",
"0.57493854",
"0.57484156",
"0.5744733",
"0.5743466",
"0.57414603",
"0.5741152",
"0.5725106",
"0.57188",
"0.57181704",
"0.5713072",
"0.5712589",
"0.57099384",
"0.5708887",
"0.5707698",
"0.57032865",
"0.56993484",
"0.5697859",
"0.5690773",
"0.56858766",
"0.56848824"
] | 0.6261387 | 7 |
Spring will take json objects and turn them into Java objects. Like magic! | @PostMapping("api/book")
public ResponseEntity<Book> addBook(@RequestBody Book book) {
Result<Book> result = bookService.save(book);
if (result.isSuccess()) {
return ResponseEntity.ok(book);
} else {
return ResponseEntity.noContent().build();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"T fromJson(Object source);",
"public interface JSONParserService extends Service {\r\n\r\n /**\r\n * Parses from json to map\r\n *\r\n * @param json data\r\n * @return Map<String, Object> or null, if json equals null\r\n */\r\n Map<String, Object> parseToMap(String json);\r\n\r\n /**\r\n * Parses from map to json\r\n *\r\n * @param data map with data\r\n * @return json or null, if map equals null\r\n */\r\n String parseMapToJson(Map<String, Object> data);\r\n\r\n /**\r\n * Parses from object to json\r\n *\r\n * @param obj object that will be parsed to json\r\n * @return json or null if invalid data\r\n */\r\n String parseObjectToJson(Object obj);\r\n\r\n /**\r\n * Parses from json to object of T class\r\n *\r\n * @param json string of json with data object\r\n * @param classObject type object\r\n *\r\n * @return T object or null, if transferred incorrect data\r\n */\r\n <T> T parseToObject(Object json, Class<T> classObject);\r\n\r\n /**\r\n * Parses from json to collection of object's T class\r\n *\r\n * @param json string of json with data objects\r\n * @param typeClass type of objects collection\r\n *\r\n * @return collection of object's T class or null, if transferred incorrect data\r\n */\r\n <T> Collection<T> parseToCollectionObjects(Object json, Type typeClass);\r\n\r\n\r\n}",
"<T> T parseToObject(Object json, Class<T> classObject);",
"public interface JsonBean {\n String toJson();\n void fromJson(String json) throws Exception;\n}",
"public interface JsonPaser<C> {\n public JsonPaser me();\n\n public C toJson(String json);\n\n public String toJsonString(Object object);\n\n public <T> T toObject(String json, Class<T> type);\n\n public <T> T[] toObjectArray(String json, Class<T> type);\n\n public <T> Collection<T> toObjectList(String json, Class<T> type);\n\n public <T> T toObject(String name, C c, Class<T> type);\n\n public <T> T[] toObjectArray(String name, C c, Class<T> type);\n\n public <T> Collection<T> toObjectList(String name, C c, Class<T> type);\n\n}",
"public interface JsonConverter {\n /** Deserializes a JSON string into a Java object.\n * @param source JSON string.\n * @param type Class type.\n * @param <T> type of class to return.\n * @return A Java object representing the same information as found in the JSON string.\n */\n <T> T fromJson(String source, Class<T> type);\n\n /** Deserializes a JSON string into a Java object.\n * @param source JSON string.\n * @param type JavaType class type.\n * @param <T> type of class to return.\n * @return A Java object representing the same information as found in the JSON string.\n */\n <T> T fromJson(String source, JavaType type);\n\n /** Serializes a Java object into a JSON string.\n * @param source A Java object.\n * @param <T> type of class of the source.\n * @return A JSON string representing the data represented in the Java object.\n */\n <T> String toJson(T source);\n}",
"public abstract void fromJson(JSONObject jsonObject);",
"public FilterItems jsonToObject(String json){\n json = json.replace(\"body=\",\"{ \\\"body\\\" : \");\n json = json.replace(\"&oil=\",\", \\\"oil\\\" : \");\n json = json.replace(\"&transmission=\",\", \\\"transmission\\\" :\");\n json = json + \"}\";\n json = json.replace(\"[]\",\"null\");\n ObjectMapper mapper = new ObjectMapper();\n FilterItems itemSearch = null;\n try {\n itemSearch = mapper.readValue(json, FilterItems.class);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return itemSearch;\n }",
"public interface JsonConverter {\n\n String toJson(Object o) throws IOException;\n\n String toJsonIgnoreException(Object o);\n\n <T> T fromJson(String json, Class<T> type) throws IOException;\n\n <T> T fromJson(String json, TypeData<T> typeData) throws IOException;\n\n <T> T convert(Object o, TypeData<T> typeData) throws IOException;\n}",
"public interface PojoParser {\n\n\n /**\n * Method which converts the Pojo to JSON Object\n * @return return the framed {@link JSONObject} instance\n */\n public abstract JSONObject toJson();\n\n /**\n * Method which convert JSON to POJO.\n * @param jsonObject Josn object which need to be parsed.\n */\n public abstract void fromJson(JSONObject jsonObject);\n}",
"public interface ApiObject {\n\n String toJson();\n\n Object fromJson(JsonObject json);\n}",
"private <T> T convert(String json, Type resultObject) {\n\t\tGson gson = new GsonBuilder().create();\n\t\treturn gson.fromJson(json, resultObject);\n\t}",
"public interface JsonConverter {\n\n /**\n * Encode the given object in a compatible form for the event bus.\n *\n * @param value the value to encode\n * @return the encoded object\n */\n Object encodeObject(Object value);\n\n /**\n * Decode the given object encoded with the encodeObject method.\n *\n * @param value the value to decode\n * @return the decoded object\n */\n Object decodeObject(Object value);\n}",
"public abstract Object toJson();",
"public native Object parse( Object json );",
"public static Object fromJSON(quark.reflect.Class cls, Object result, io.datawire.quark.runtime.JSONObject json) {\n if (((json)==(null) || ((Object)(json) != null && ((Object) (json)).equals(null))) || ((json).isNull())) {\n return null;\n }\n Integer idx = 0;\n if ((result)==(null) || ((Object)(result) != null && ((Object) (result)).equals(null))) {\n if (((cls).name)==(\"quark.String\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.String\"))) {\n String s = (json).getString();\n return s;\n }\n if (((cls).name)==(\"quark.float\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.float\"))) {\n Double flt = (json).getNumber();\n return flt;\n }\n if (((cls).name)==(\"quark.int\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.int\"))) {\n Integer i = ((int) Math.round((json).getNumber()));\n return i;\n }\n if (((cls).name)==(\"quark.bool\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.bool\"))) {\n Boolean b = (json).getBool();\n return b;\n }\n result = (cls).construct(new java.util.ArrayList(java.util.Arrays.asList(new Object[]{})));\n }\n if (((cls).name)==(\"quark.List\") || ((Object)((cls).name) != null && ((Object) ((cls).name)).equals(\"quark.List\"))) {\n java.util.ArrayList<Object> list = (java.util.ArrayList<Object>) (result);\n while ((idx) < ((json).size())) {\n (list).add(Functions.fromJSON(((cls).getParameters()).get(0), null, (json).getListItem(idx)));\n idx = (idx) + (1);\n }\n return list;\n }\n java.util.ArrayList<quark.reflect.Field> fields = (cls).getFields();\n while ((idx) < ((fields).size())) {\n quark.reflect.Field f = (fields).get(idx);\n idx = (idx) + (1);\n if (Boolean.valueOf(((f).name).startsWith(\"_\"))) {\n continue;\n }\n if (!(((json).getObjectItem((f).name)).isNull())) {\n ((io.datawire.quark.runtime.QObject) (result))._setField((f).name, Functions.fromJSON((f).getType(), null, (json).getObjectItem((f).name)));\n }\n }\n return result;\n }",
"public interface JsonParser {\n\n /**\n * convert string to POJO\n *\n * @param jsonString - string to convert to POJO\n * @param classType - POJO Type / Class Type to use for the deserialization\n * @param <T> the returned desirialized POJO\n * @return desiarilized POJO\n */\n <T> T toJsonPOJO(String jsonString, Class<T> classType);\n\n /**\n * convert from POJO to json string\n * @param data POJO to convert to json String\n * @return json string\n */\n String toJSONString(Object data);\n}",
"private JSON() {\n\t}",
"public static void main(String[] args) {\n\t\tStorageEntity sto = new StorageEntity();\r\n\t\tsto.setProductid(1);\r\n\t\tsto.setSkuid(1);\r\n\t\tsto.setSku(\"TEST\");\r\n\t\tsto.setQtycan(10);\r\n\t\tsto.setQty(12);\r\n\t\t// JAVA对象转JSONObject\r\n\t\tJSONObject json = JSONObject.parseObject(sto.toString());\r\n\t\tSystem.out.println(json.toString());\r\n\r\n\t\t// JSONObjectString转JAVA对象\r\n\t\tStorageEntity sto2 = JSONObject.parseObject(json.toJSONString(), StorageEntity.class);\r\n\t\tSystem.out.println(sto2.toString());\r\n\t\t// JSONObject转JAVA对象\r\n\t\tsto2 = JSONObject.toJavaObject(json, StorageEntity.class);\r\n\t\tSystem.out.println(sto2.toString());\r\n\t\tSystem.out.println(JSON.parseObject(json.toString(), TreeMap.class));\r\n\r\n\t\t// JSONArrayString转List\r\n\t\tList<StorageEntity> stos = new ArrayList<StorageEntity>();\r\n\t\tstos.add(sto);\r\n\t\tsto = new StorageEntity();\r\n\t\tsto.setProductid(2);\r\n\t\tsto.setSkuid(2);\r\n\t\tsto.setSku(\"TEST2\");\r\n\t\tsto.setQtycan(20);\r\n\t\tsto.setQty(22);\r\n\t\tstos.add(sto);\r\n\t\tList<StorageEntity> stos2 = JSONArray.parseArray(stos.toString(), StorageEntity.class);\r\n\t\tSystem.out.println(stos2);\r\n\t\tJSONArray j = JSONArray.parseArray(stos2.toString());\r\n\t\tSystem.out.println(j);\r\n\r\n\t\t// json转带有Bean和List参数的java对象\r\n\t\tStorageGetResponse storages = new StorageGetResponse();\r\n\t\tstorages.setResult(stos);\r\n\t\tstorages.setCode(100);\r\n\t\tstorages.getDetail().setDesc(\"test\");\r\n\t\tstorages.getDetail().setDescription(\"测试\");\r\n\t\tStorageGetResponse storage = JSONObject.parseObject(storages.toString(), StorageGetResponse.class);\r\n\t\tSystem.out.println(storage);\r\n\r\n\t\t// 将JSONArray文件转换为List\r\n\t\tSystem.out.println(FileUtil.filetoListFromJSONArray(\"D:/Document/test.json\", BaseRequest.class));\r\n\t}",
"@Test\n public void readSystemObjectClassAppointment() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Appointment\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Appointment properly\", object.getClass(), actual.getClass());\n }",
"@Test\n public void readSystemObjectClassAppointmentRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AppointmentRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AppointmentRequest properly\", object.getClass(), actual.getClass());\n }",
"public static FeedWrapper convertToObjects(String json) {\n // TODO: GSON is created during each conversion - reusing possibilities need to be analyzed\n return new Gson().fromJson(json, FeedWrapper.class); // json -> pojos\n }",
"public static void main(String[] args) {\n Employee employee = new Employee();\n employee.setName(\"utkarsh tyagi\");\n employee.setEmpNo(1001);\n employee.setSalary(20000);\n String jsonEmployee = JsonUtil.convertJavaToJson(employee);\n System.out.println(jsonEmployee);\n\n Employee emp1 =JsonUtil.convertJsonToJava(jsonEmployee,Employee.class);\n System.out.println(emp1.getName()+ \" \"+ emp1.getEmpNo()+\" \"+emp1.getSalary());\n }",
"public interface BaseFormModel {\n JSONObject toJson();\n}",
"@Test\n public void jsonTest() {\n // TODO: test json\n }",
"@Test\n public void readSystemObjectClassPrescription() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Prescription\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Prescription properly\", object.getClass(), actual.getClass());\n }",
"<T> T fromJson(String source, JavaType type);",
"<T> T fromJson(String source, Class<T> type);",
"public static <T> T jsonToBean(String json, Class<T> clazz, boolean isSnakeCase) {\n ObjectMapper mapper = new ObjectMapper();\n // mapper的configure方法可以设置多种配置(例如:多字段 少字段的处理)\n //mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n\n if (isSnakeCase) {\n mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);\n }\n\n try {\n return mapper.readValue(json, clazz);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"<T> T fromJson(String json, Class<T> type);",
"@Bean\n public ObjectMapper objectMapper() {\n return new ObjectMapper();\n }",
"@Bean\n public MessageConverter jsonMessageConverter() {\n return new Jackson2JsonMessageConverter();\n }",
"@Test\n public void oneSpartanPojo(){\n Response response = given().accept(ContentType.JSON)\n .and().pathParam(\"id\", 15)\n .and().get(\"http://18.232.145.26:8000/api/spartans/{id}\");\n\n // Verify response status code should be 200\n Assert.assertEquals(response.statusCode(), 200 , \"Verify status code : \");\n\n // Convert Json to POJO( Our custom Spartan java class )\n Spartan spartan15 = response.body().as(Spartan.class);\n System.out.println(\"spartan15 = \" + spartan15);\n System.out.println(\"spartan15.getNames() = \" + spartan15.getName());\n System.out.println(\"spartan15.getId() = \" + spartan15.getId());\n\n\n }",
"public interface JSONAdapter {\n public JSONObject toJSONObject();\n}",
"public interface IExchangeableByJSON {\r\n\r\n\t/**\r\n\t * Function called when we want to convert the object to a JSON string.\r\n\t * \r\n\t * @return\r\n\t * @throws JSONException\r\n\t */\r\n\tpublic String toJSON() throws JSONException;\r\n\r\n\r\n\t/**\r\n\t * Function called when we want to fill the object from its JSON\r\n\t * representation string.\r\n\t * \r\n\t * @param json\r\n\t * @throws JSONException\r\n\t */\r\n\tpublic void fromJSON(String json) throws JSONException;\r\n\r\n}",
"@Test\n public void readSystemObjectClassDoctorFeedback() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"DoctorFeedback\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return DoctorFeedback properly\", object.getClass(), actual.getClass());\n }",
"public static <T> T pasarAObjeto(String json, Class<T> tipo) {\r\n try {\r\n ObjectMapper mapper = getBuilder().build();\r\n return mapper.readValue(json, tipo);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }",
"public interface JsonUtil {\n /**\n * Encode {@link org.schemarepo.Subject}s into a {@link String} for use by\n * {@link #subjectNamesFromJson(String)}\n *\n * The format is an array of objects containing a name field, for example:\n *\n * [{\"name\": \"subject1\"}, {\"name\": \"subject2\"}]\n *\n * @param subjects the Subject objects to encode\n * @return The {@link org.schemarepo.Subject} objects encoded as a String\n */\n String subjectsToJson(Iterable<Subject> subjects);\n\n /**\n * Decode a string created by {@link #subjectsToJson(Iterable)}\n *\n * @param str The String to decode\n * @return an {@link java.lang.Iterable} of {@link Subject}\n */\n Iterable<String> subjectNamesFromJson(String str);\n\n /**\n * Encode {@link org.schemarepo.SchemaEntry} objects into a {@link String} for use by\n * {@link #schemasFromJson(String)}\n *\n * The format is an array of objects containing id and schema fields, for example:\n *\n * [{\"id\": \"0\", \"schema\": \"schema1\"}, {\"id\": \"2\", \"schema\": \"schema2\"}]\n *\n * @param allEntries the SchemaEntry objects to encode\n * @return The {@link org.schemarepo.SchemaEntry} objects encoded as a String\n */\n String schemasToJson(Iterable<SchemaEntry> allEntries);\n\n /**\n * Decode a string created by {@link #schemasToJson(Iterable)}\n *\n * @param str The String to decode\n * @return An {@link java.lang.Iterable} of {@link SchemaEntry}\n */\n Iterable<SchemaEntry> schemasFromJson(String str);\n}",
"GistUser deserializeUserFromJson(String json);",
"private JsonUtils() {}",
"String parseObjectToJson(Object obj);",
"void mo28373a(JSONObject jSONObject);",
"@Test\n public void readSystemObjectClassMedicineOrderRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"MedicineOrderRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return MedicineOrderRequest properly\", object.getClass(), actual.getClass());\n }",
"public static <T> T mapJsonToObject(String json, Class<T> classType) {\n\t\tT obj = null;\n\t\tif (StringUtils.isBlank(json)) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tobj = jsonMapper.readValue(json, classType);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"error mapJsonToObject: \" + e.getMessage());\n\t\t}\n\t\treturn obj;\n\t}",
"<T> T toJsonPOJO(String jsonString, Class<T> classType);",
"@JsonDeserialize(as=InspectionImpl.class)\npublic interface Inspection {\n\n String getInspectionCode();\n void setInspectionCode(String inspectionCode);\n\n LocalDate getInspectionDate();\n void setInspectionDate(LocalDate inspectionDate);\n\n Boolean getPassedInspection();\n void setPassedInspection(Boolean passedInspection);\n\n String getDescription();\n void setDescription(String description);\n}",
"@Test\n public void readSystemObjectClassMedicine() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Medicine\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Medicine properly\", object.getClass(), actual.getClass());\n }",
"private static <T> T getObjectFromJson(JsonNode dataJson) {\n Object object=null;\n if(!dataJson.has(CLASS_FIELD)) {\n return null;\n }\n /** Determine class of object and return with cast*/\n String classField=dataJson.get(CLASS_FIELD).asText();\n\n /** Lists -> All lists are converted into ArrayLists*/\n if(classField.startsWith(LIST_CLASS)) {\n try {\n String[] listType=classField.split(SEPERATOR);\n if(listType.length<2) {\n return (T) new ArrayList<>();\n }\n Class type=Class.forName(listType[1]);\n String json=dataJson.get(DATA_FIELD).toString();\n List<Object> list=new ArrayList<>();\n ArrayNode array=(ArrayNode) mapper.readTree(json);\n for(JsonNode item : array) {\n Object o=mapper.readValue(item.toString(), type);\n list.add(o);\n }\n return (T) list;\n }\n catch(JsonProcessingException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n }\n /** Single objects*/\n else {\n Class type=null;\n try {\n type=Class.forName(classField);\n /** Read primitive types (String,Integer,...)*/\n if(dataJson.has(PRIMITIVE_FIELD)) {\n object=mapper.readValue(dataJson.get(PRIMITIVE_FIELD).toString(), type);\n }\n else {\n object=mapper.readValue(dataJson.toString(), type);\n }\n return (T) object;\n }\n catch(ClassNotFoundException | JsonProcessingException e) {\n e.printStackTrace();\n }\n }\n return null;\n }",
"@Test\n public void readSystemObjectClassAccCrRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AccountCreationRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AccountCreationRequest properly\", object.getClass(), actual.getClass());\n }",
"public abstract Object deserialize(Object object);",
"public Object jsonToObject(Class<?> clazz, JSONObject jsonObject) throws ClassNotFoundException, SecurityException,\n\t\t\tIllegalAccessException, InvocationTargetException, InstantiationException, JSONException {\n\n\t\tObject object = clazz.newInstance();\n\n\t\tField[] fields = clazz.getDeclaredFields();\n\n\t\tfor (Field field : fields) {\n\n\t\t\tfield.setAccessible(true);\n\n\t\t\tClass<?> typeClazz = field.getType();\n\n\t\t\tif (typeClazz.isPrimitive()) {\n\t\t\t\t/*\n\t\t\t\t * field.set(object,jsonObject.get(field.getName()));\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tif (String.class.isAssignableFrom(field.getType())) {\n\t\t\t\t\t\n\t\t\t\t\tfield.set(object, jsonObject.get(field.getName()));\n\n\t\t\t\t} else if (field.getType().isArray()\n\t\t\t\t\t\t&& (String.class.isAssignableFrom(field.getType().getComponentType()))) {\n\n\t\t\t\t\tJSONArray jArray = jsonObject.getJSONArray(field.getName());\n\t\t\t\t\tint len = jArray.length();\n\t\t\t\t\tString[] array = new String[len];\n\t\t\t\t\tfor (int i = 0; i < len; i++) {\n\n\t\t\t\t\t\tarray[i] = jArray.getString(i);\n\t\t\t\t\t}\n\t\t\t\t\tfield.set(object, array);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfield.set(object, jsonToObject(typeClazz, jsonObject.getJSONObject(field.getName())));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn object;\n\t}",
"public abstract T zzb(JSONObject jSONObject);",
"public void parseJSONData(Object JSONdata){\n\n\t}",
"private <T> T getObjectFromJsonObject(JSONObject j, Class<T> clazz) throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n T t = null;\n t = mapper.readValue(j.toString(), clazz);\n\n return t;\n }",
"@Test\n public void fromJson() throws VirgilException, WebAuthnException {\n AuthenticatorMakeCredentialOptions options = AuthenticatorMakeCredentialOptions.fromJSON(MAKE_CREDENTIAL_JSON);\n AttestationObject attObj = authenticator.makeCredential(options);\n }",
"public static Object jsonToUserPOJO(String body){\n\t\ttry{\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tUser user = mapper.readValue(body, User.class);\n\t\t\treturn user;\n\t\t}\n\t\tcatch (JsonParseException jpe) {\n return createError(\"400\",\"Error in creating user\");\n }\n\t\tcatch (NullPointerException jpe) {\n return createError(\"400\",\"Error in JSON\");\n }\n\t\tcatch (Exception jpe) {\n return createError(Integer.toString(HTTP_BAD_REQUEST),\"Error :\" + jpe.getMessage());\n }\n\t}",
"@Test\n public void readUserClassPatient() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Patient\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Patient properly\", Factory.createUser(\"Patient\").getClass(), actual.getClass());\n }",
"@Test\n public void readUserClassSecretary() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Secretary\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Secretary properly\", Factory.createUser(\"Secretary\").getClass(), actual.getClass());\n }",
"JSONConverter getDefaultConverter();",
"public ClaseJson() {\n }",
"public interface JSONContextConfiguration {\n\n\t/**\n\t * Adds converter.\n\t * @param type Type\n\t * @param converter Converter.\n\t */\n void addConverter(Class<?> type, JSONConverter converter);\n\n /**\n * Gets a converter.\n * @param type Type.\n * @return Converter.\n */\n JSONConverter getConverter(Class<?> type);\n\n /**\n * Gets the default converter.\n * @return Converter.\n */\n JSONConverter getDefaultConverter();\n\n /**\n * Remove a converter.\n * @param type Type.\n */\n void removeConverter(Class<?> type);\n\n /**\n * Sets the bean factory.\n * @param factory Factory.\n */\n void setFactoryBean( FactoryBean factory );\n\n /**\n * Gets the bean factory.\n * @return Factory.\n */\n FactoryBean getFactoryBean();\n \n}",
"public interface CompanyJsonTransformer {\n\n /**\n * Transforms a CompanyJson element with id as UUID to a new CompanyInternal internal element.\n *\n * @param companyId the ID of the CompanyJson object\n * @param company the CompanyJson object\n * @return the CompanyInternal object\n */\n CompanyInternal toCompanyInternal(UUID companyId, CompanyJson company);\n\n /**\n * Transforms a CompanyInternal and BeneficialOwnerInternals to a new CompanyJson element.\n *\n * @param company the CompanyInternal object\n * @param beneficialOwners the List<BeneficialOwnerInternal> object\n * @return the CompanyJson object\n */\n CompanyJson toCompanyJson(CompanyInternal company, List<BeneficialOwnerInternal> beneficialOwners);\n}",
"public Object readInternal(Class<? extends Object> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException {\n return JSON.parseObject(inputMessage.getBody(), this.fastJsonConfig.getCharset(), (Type) clazz, this.fastJsonConfig.getFeatures());\n }",
"@Override\n public void parseJSON(JSONObject jsonObject) {\n if (jsonObject.has(\"business\"))\n try {\n JSONObject businessJsonObject = jsonObject.getJSONObject(\"business\");\n this.businessId = businessJsonObject.getString(\"_id\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n if (jsonObject.has(\"_id\"))\n try {\n this.foodlogiqId = jsonObject.getString(\"_id\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n if (jsonObject.has(\"name\"))\n try {\n this.name = jsonObject.getString(\"name\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n if (jsonObject.has(\"associateWith\"))\n try {\n this.associateWith = jsonObject.getString(\"associateWith\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n if (jsonObject.has(\"attributes\"))\n try {\n this.attributes = new ArrayList<>();\n JSONArray attributesJson = jsonObject.getJSONArray(\"attributes\");\n for (int i = 0; i < attributesJson.length(); i++) {\n JSONObject attributeJson = attributesJson.getJSONObject(i);\n CustomAttribute attribute = new CustomAttribute();\n attribute.parseJSON(attributeJson);\n this.attributes.add(attribute);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }",
"public interface JSONPopulator {\n void populate(JSONObject data);\n}",
"public interface JSONPopulator {\n void populate(JSONObject data);\n}",
"public interface JSONPopulator {\n void populate(JSONObject data);\n}",
"protected abstract Object toObject(InputStream inputStream, Type targetType) throws BeanConversionException;",
"@Test\n public void readUserClassDoctor() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Doctor\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Doctor properly\", Factory.createUser(\"Doctor\").getClass(), actual.getClass());\n }",
"public JsonUtil() {\r\n this.jsonSerializer = new JSONSerializer().transform(new ExcludeTransformer(), void.class).exclude(\"*.class\");\r\n }",
"@Override\n public Object convertJsonToObject(String content) {\n try {\n Map<String, EventDataValue> data = reader.readValue(content);\n\n return convertEventDataValuesMapIntoSet(data);\n } catch (IOException e) {\n throw new IllegalArgumentException(e);\n }\n }",
"@JsonIgnoreProperties(ignoreUnknown = true) // FIXME Think abount ignoring. It's\n\t\t\t\t\t\t\t\t\t\t\t// rather dangerous. Maybe some\n\t\t\t\t\t\t\t\t\t\t\t// handling should be implemented\npublic interface TiesJsonRequest {\n\n}",
"private JSONHelper() {\r\n\t\tsuper();\r\n\t}",
"<T> T fromJsonResult(MvcResult result, Class<T> valueType) throws Exception {\r\n return this.mapper.readValue(result.getResponse().getContentAsString(), valueType);\r\n }",
"@Override\n @SuppressWarnings(\"PMD.LawOfDemeter\")\n public O apply(final String json) {\n return JsonPath\n .parse(json)\n .read(expression, clazz);\n }",
"public interface JsonDeserializer {\n\n /**\n * Parses and deserializes a Gist object from the provided JSON text. This\n * Gist object does not contain all comments on said Gist, as obtaining a\n * given Gist's comments requires a completely separate Github API call.\n *\n * @param json JSON text to parse\n * @return Gist object with related attributes and objects\n */\n Gist deserializeGistFromJson(String json);\n\n /**\n * Parses and deserializes a List of Gist objects from the provided JSON\n * text. If there is an error with parsing the JSON, null is returned.\n *\n * @param json JSON text to parse\n * @return List of Gist objects\n */\n List<Gist> deserializeGistsFromJson(String json);\n\n /**\n * Parses and deserializes a GistComment object from the provided JSON text.\n *\n * @param json JSON text to parse\n * @return GistComment corresponding to some Gist\n */\n GistComment deserializeCommentFromJson(String json);\n\n /**\n * Parses and deserializes a List of GistComment objects from the provided\n * JSON text. If there is an error with parsing the JSON, null is returned.\n *\n * @param json JSON text to parse\n * @return List of GistComment objects\n */\n List<GistComment> deserializeCommentsFromJson(String json);\n\n /**\n * Parses and deserializes an expanded GistUser object from the provided\n * JSON text. This user contains all fields contained in the \"user\" objects\n * found in standard Gist JSON responses, in addition to more fields found\n * in User JSON responses. If certain fields are present, namely\n * \"private_gists\" and \"total_private_repos\", then this must be the\n * currently authenticated user.\n *\n * @param json JSON text to parse\n * @return GistUser corresponding to some Github user\n */\n GistUser deserializeUserFromJson(String json);\n\n}",
"private CMSUser fromJSON(final byte[] bytes) {\n\t\tCMSUser cmsUser = null; \n\t\ttry{\n\t\t\tcmsUser = mapper.readValue(new ByteArrayInputStream(bytes), CMSUser.class);\n\t\t\treturn cmsUser;\n\t\t\t\n\t\t} catch (JsonMappingException jme) {\n\t\t\tlogger.error(\"from JSON JsonMappingException\", jme);\n\t\t\treturn null;\n\t\t} catch (JsonParseException jpe) {\n\t\t\tlogger.error(\"from JSON JsonParseException\", jpe);\n\t\t\treturn null;\n\t\t} catch (IOException ioe) {\n\t\t\tlogger.error(\"from JSON IOException\", ioe);\n\t\t\treturn null;\n\t\t}\t\t\t\t\n\t}",
"@Test\n public void jsonTest(){\n }",
"public Object toPojo(Entity entity) {\n return ofy().load().fromEntity(entity);\n }",
"private DatasetJsonConversion() {}",
"protected <T> Object fromJson(String jsonString, Class<T> classInstance) {\n\n\t\tSystem.out.println(\"jsonString = \" + jsonString);\n\t\treturn gson.fromJson(jsonString, classInstance);\n\n\t}",
"JSONObject toJson();",
"JSONObject toJson();",
"public String getJson();",
"public int processingContract(String json,List<Object[]> list);",
"@Test\n public void readSystemObjectClassAccDelRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AccountDeletionRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AccountDeletionRequest properly\", object.getClass(), actual.getClass());\n }",
"@Test\n public void readUserClassAdmin() throws UnsupportedEncodingException, IOException {\n testJson = gson.toJson(Factory.createUser(\"Administrator\"));\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n IUser actual = DataHandler.readUserClass(reader);\n\n //compare results \n assertEquals(\"Fails to return user class properly\", Factory.createUser(\"Administrator\").getClass(), actual.getClass());\n }",
"public static void main(String[] args) {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\t//mapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE);\n\t\t//mapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);\n\t\t//mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);\n\t\tString jsonInString = \"{'name' : 'mkyong'}\";\n\t\t// JSON from String to Object\n\t\ttry {\n\t\t\tForm obj = mapper.readValue(sample, Form.class);\n\t\t\t\n\t\t\tString jsonInStringx = mapper.writeValueAsString(obj);\n\t\t\t\n\t\t\tSystem.out.println(jsonInStringx);\n\t\t\t\n\t\t} catch (JsonParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (JsonMappingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public interface JsonFormatter {\n JSONArray parseJasonString(String inputString) throws ParseException;\n List<LocationPOJO> formatJsonArray(JSONArray jsonArray);\n}",
"@SuppressWarnings(\"unchecked\")\n\tpublic static<T> T createObjectFromJSON(final JSONObject json) throws JSONException {\n\t\tif(json.has(\"type\")) {\n\t\t\treturn (T) Helper.createItemFromJSON(json);\n\t\t} else if(json.has(\"triple_pattern\")) {\n\t\t\treturn (T) Helper.createTriplePatternFromJSON(json);\n\t\t} else if(json.has(\"histogram\")) {\n\t\t\treturn (T) Helper.createVarBucketFromJSON(json);\n\t\t} else {\n\t\t\tSystem.err.println(\"lupos.distributed.operator.format.Helper.createObjectFromJSON(...): Unknown type stored in JSON object, returning null!\");\n\t\t\treturn null;\n\t\t}\n\t}",
"public JsonSerde(JavaType javaType) {\n\t\tObjectMapper objectMapper = new ObjectMapper();\n\t\tjsonSerializer = new JsonSerializer<T>(objectMapper, javaType);\n\t\tjsonDeserializer = new JsonDeserializer<T>(objectMapper, javaType);\n\t}",
"public interface JsonProperties {\n\n String ACCESS_LEVEL = \"accessLevel\";\n String ADDRESS = \"address\";\n String ASSET_ID = \"assetId\";\n String CONTENT = \"content\";\n String CREATED_BY = \"createdBy\";\n String DATA = \"data\";\n String DATA_HASH = \"dataHash\";\n String EVENT_ID = \"eventId\";\n String ID_DATA = \"idData\";\n String META_DATA = \"metadata\";\n String PERMISSIONS = \"permissions\";\n String REGISTERED_BY = \"registeredBy\";\n String REGISTERED_ON = \"registeredOn\";\n String SEQUENCE_NUMBER = \"sequenceNumber\";\n String SIGNATURE = \"signature\";\n String TIMESTAMP = \"timestamp\";\n}",
"protected Object readResolve()\n/* */ {\n/* 353 */ return new JsonFactory(this, this._objectCodec);\n/* */ }",
"public interface JSONDeserializer<T> {\n\t\n\t/**\n\t * Deserialize a json string\n\t * @param json object to deserialize\n\t * @return JSON representation as {@link JsonObject}\n\t */\n\tJsonObject deserialise(String json);\n\t\n\t/**\n\t * Unmarshall 'meta' section of the response\n\t * @param meta section represented as {@link JsonObject}\n\t * @return object of generic type T\n\t */\n\tT unmarshallMeta(JsonObject meta);\n\t\n\t/**\n\t * Unmarshall 'response' section of the response\n\t * @param response section represented as {@link JsonObject}\n\t * @return list of objects of generic type T\n\t */\n\tCollection<T> unmarshallResponse(JsonObject response);\n\n}",
"private String converttoJson(Object medicine) throws JsonProcessingException {\r\n ObjectMapper objectMapper = new ObjectMapper();\r\n return objectMapper.writeValueAsString(medicine);\r\n }",
"public Object parseJsonToObject(String response, Class<?> modelClass) {\n\n try {\n return gson.fromJson(response, modelClass);\n } catch (Exception ex) {\n ex.printStackTrace();\n return null;\n }\n }",
"private String convertToJson(Users user) throws JsonProcessingException{\n\t ObjectMapper objectMapper = new ObjectMapper();\n\t return objectMapper.writeValueAsString(user); \n\t}",
"private JSONMessageFactory(){}",
"private static User getUserFromJson(String userJson) throws Exception {\n verifyJsonFormatting(userJson);\n ObjectMapper objectMapper = new ObjectMapper();\n return objectMapper.readValue(userJson, User.class);\n }",
"private Object onParse(final String content) throws IOException{\n if(null == this.mBean)\n return null;\n\n try{\n return JSON.parseObject(content, this.mBean);\n }catch(Exception e){\n throw new IOException(e.getMessage());\n }\n }",
"public void setRawObject(final ISerializer serializer, final JsonObject json) {\n mSerializer = serializer;\n mRawObject = json;\n\n\n if (json.has(\"serviceConfigurationRecords\")) {\n final BaseDomainDnsRecordCollectionResponse response = new BaseDomainDnsRecordCollectionResponse();\n if (json.has(\"[email protected]\")) {\n response.nextLink = json.get(\"[email protected]\").getAsString();\n }\n\n final JsonObject[] sourceArray = serializer.deserializeObject(json.get(\"serviceConfigurationRecords\").toString(), JsonObject[].class);\n final DomainDnsRecord[] array = new DomainDnsRecord[sourceArray.length];\n for (int i = 0; i < sourceArray.length; i++) {\n array[i] = serializer.deserializeObject(sourceArray[i].toString(), DomainDnsRecord.class);\n array[i].setRawObject(serializer, sourceArray[i]);\n }\n response.value = Arrays.asList(array);\n serviceConfigurationRecords = new DomainDnsRecordCollectionPage(response, null);\n }\n\n if (json.has(\"verificationDnsRecords\")) {\n final BaseDomainDnsRecordCollectionResponse response = new BaseDomainDnsRecordCollectionResponse();\n if (json.has(\"[email protected]\")) {\n response.nextLink = json.get(\"[email protected]\").getAsString();\n }\n\n final JsonObject[] sourceArray = serializer.deserializeObject(json.get(\"verificationDnsRecords\").toString(), JsonObject[].class);\n final DomainDnsRecord[] array = new DomainDnsRecord[sourceArray.length];\n for (int i = 0; i < sourceArray.length; i++) {\n array[i] = serializer.deserializeObject(sourceArray[i].toString(), DomainDnsRecord.class);\n array[i].setRawObject(serializer, sourceArray[i]);\n }\n response.value = Arrays.asList(array);\n verificationDnsRecords = new DomainDnsRecordCollectionPage(response, null);\n }\n\n if (json.has(\"domainNameReferences\")) {\n final BaseDirectoryObjectCollectionResponse response = new BaseDirectoryObjectCollectionResponse();\n if (json.has(\"[email protected]\")) {\n response.nextLink = json.get(\"[email protected]\").getAsString();\n }\n\n final JsonObject[] sourceArray = serializer.deserializeObject(json.get(\"domainNameReferences\").toString(), JsonObject[].class);\n final DirectoryObject[] array = new DirectoryObject[sourceArray.length];\n for (int i = 0; i < sourceArray.length; i++) {\n array[i] = serializer.deserializeObject(sourceArray[i].toString(), DirectoryObject.class);\n array[i].setRawObject(serializer, sourceArray[i]);\n }\n response.value = Arrays.asList(array);\n domainNameReferences = new DirectoryObjectCollectionPage(response, null);\n }\n }"
] | [
"0.65850544",
"0.64309144",
"0.61834514",
"0.6177249",
"0.61021936",
"0.6002463",
"0.59867543",
"0.5970673",
"0.5946858",
"0.590812",
"0.58193195",
"0.5728247",
"0.5725588",
"0.5702162",
"0.56455666",
"0.5612233",
"0.5603683",
"0.55809355",
"0.5556744",
"0.5528739",
"0.5525364",
"0.55199975",
"0.55093676",
"0.5491568",
"0.54574376",
"0.5452986",
"0.543722",
"0.5433505",
"0.542651",
"0.54152215",
"0.53829074",
"0.5361543",
"0.53599346",
"0.53583896",
"0.5334196",
"0.53298014",
"0.5310723",
"0.5309656",
"0.5309467",
"0.53085345",
"0.5305383",
"0.53010064",
"0.5294725",
"0.52817744",
"0.5278449",
"0.526874",
"0.5266863",
"0.5261549",
"0.5252101",
"0.52488256",
"0.5247563",
"0.52473456",
"0.5247097",
"0.52371395",
"0.5226688",
"0.52249885",
"0.522326",
"0.52192837",
"0.5215993",
"0.5205613",
"0.5202202",
"0.5198681",
"0.5195742",
"0.51900905",
"0.5185861",
"0.5185861",
"0.5185861",
"0.517677",
"0.5174562",
"0.5166292",
"0.5159858",
"0.51582265",
"0.51572007",
"0.51522046",
"0.51506597",
"0.51421666",
"0.5124722",
"0.5123317",
"0.51232",
"0.512224",
"0.5117265",
"0.51123285",
"0.51123285",
"0.5109389",
"0.51061743",
"0.5105402",
"0.5101128",
"0.5098326",
"0.50981236",
"0.509726",
"0.5095811",
"0.5095418",
"0.5082372",
"0.5082204",
"0.50777894",
"0.5076348",
"0.5075361",
"0.50665206",
"0.5053917",
"0.5053446",
"0.5051003"
] | 0.0 | -1 |
The HashMap is productId to count | public Buyer(String username, String password, String firstName, String lastName, String emailAddress, String phoneNumber) {
super(username, password, firstName, lastName, emailAddress, phoneNumber);
this.role = 1;
credit = 10000;
ProgramManager.getProgramManagerInstance().addAccountToList(username, this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getProductCount();",
"@Override\n\tpublic int count(HashMap<String, Object> map) {\n\t\treturn paymentDao.count(map);\n\t}",
"@Override\n\tpublic int count(HashMap<String, String> map) {\n\t\treturn dao.count(map);\n\t}",
"@Override\n\t\tpublic int hashCode() {\n\t\t\treturn countMap.hashCode();\n\t\t}",
"@Override\n public void updateProductCounter() {\n\n }",
"long getTotalProductsCount();",
"public Map<Category, Long> countProductsPerCategory(List<Product> products) {\n // TODO: Group the products by category and count the number of products in each category.\n //\n // Hint: Remember how grouping works. It splits the input stream into multiple streams.\n // You can use a downstream collector to process the output streams of the grouping operation further.\n // For counting the number of products, look at the API documentation of class Collectors - there's a factory method that you can use.\n\n// return products.stream()...;\n\n throw new UnsupportedOperationException(\"Not yet implemented\"); // Remove this line\n }",
"public int getCount(HashMap map) {\n\t\treturn GoodsManager.getCount(map);\n\t}",
"public HashMap<Integer,Integer> countStudent(){\n int i=students.size();\n int y=class_s.size();\n for (int j=0;j<y;j++){\n count=0;\n for (int z=0;z<i;z++){\n if(class_s.get(j).getClassID()==students.get(z).getClassID()){\n count++;\n\n }\n \n }\n map.put(class_s.get(j).getClassID(),count);\n \n }\n return (HashMap<Integer,Integer>)map;\n }",
"@Override\n public Map<EFruits, Integer> count(Branch branch) {\n bananaNumber = super.countBananas(branch);\n super.fruitMap.put(EFruits.BANANAS, bananaNumber);\n return super.fruitMap;\n }",
"public ProductDaoHash() {\n\t\tproductTable = new HashMap<Integer, Product>();\n\t}",
"public Integer getProductCount() {\n return productCount;\n }",
"@Override\n public int hashCode() {\n return Objects.hash(product, quantity);\n }",
"public void updateProductViewCount(Product product) {\n\r\n\t}",
"@Override\r\n\tpublic int listCount(Map<String, Object> map) throws SQLException {\n\t\treturn 0;\r\n\t}",
"long countNumberOfProductsInDatabase();",
"@Override\n public int getProductFavouritesCount(Map<String, Object> params) {\n return yourFavouritesDetaildao.getProductFavouritesCount(params);\n }",
"@Override\r\n\tpublic int dataCount(Map<String, Object> map) {\n\t\treturn 0;\r\n\t}",
"@Override\n\tpublic int countPro() {\n\t\treturn productSubMapper.selectCountPro();\n\t}",
"Map<Goods, Integer> getQuantityByBrand(Brand brand) throws StoreKeeperWorkException;",
"private void increaseProductCountInCart(int productID, List<Product> products) {\n\n for (Product product : products) {\n\n if (product.getId() == productID)\n product.setCount(product.getCount() + 1);\n }\n }",
"@Override\r\n\tpublic Integer countFiltering(Map<String, Object> map) {\n\t\treturn filteringMapper.countFiltering(map);\r\n\t}",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> idiosyncraticEventIncidenceCountMap();",
"public int countByProductType(String productType);",
"public CountingMap( Map<K, Integer> map ) {\n this.map = map;\n }",
"@Override\n public int getProductTypeFavouritesCount(Map<String, Object> params) {\n return yourFavouritesDetaildao.getProductTypeFavouritesCount(params);\n }",
"@Override\r\n\tpublic List<PayedProduct> getProductCount() {\n\t\tList<PayedProduct> list=null;\r\n\t\ttry {\r\n\t\t\tString sql=\"SELECT * FROM payedproduct\";\r\n\t\t\treturn qr.query(sql, new BeanListHandler<PayedProduct>(PayedProduct.class));\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public Map<String, Object> countOrdersByFood() {\n Map<String, Object> foodCount = new HashMap<String, Object>();\n for(Map.Entry<String, List<Order>> order : this.orders.entrySet()){\n foodCount.put(order.getKey(),order.getValue().size());\n }\n return foodCount;\n }",
"public static void main(String[] args) \r\n\t{\r\n\t\tMap<String, String> voting=new HashMap<String, String>();\r\n\t\tvoting.put(\"101\", \"BJP\");\r\n\t\tvoting.put(\"102\", \"ShivSena\");\r\n\t\tvoting.put(\"103\", \"NCP\");\r\n\t\tvoting.put(\"104\", \"Congress\");\r\n\t\tvoting.put(\"105\", \"Other\");\r\n\t\tvoting.put(\"106\", \"BJP\");\r\n\t\tvoting.put(\"107\", \"ShivSena\");\r\n\t\tvoting.put(\"108\", \"NCP\");\r\n\t\tvoting.put(\"109\", \"Congress\");\r\n\t\tvoting.put(\"110\", \"Other\");\r\n\t\tvoting.put(\"111\", \"BJP\");\r\n\t\tvoting.put(\"112\", \"ShivSena\");\r\n\t\tvoting.put(\"113\", \"NCP\");\r\n\t\tvoting.put(\"114\", \"Congress\");\r\n\t\tvoting.put(\"115\", \"Other\");\r\n\t\tvoting.put(\"116\", \"Other\");\r\n\t\tvoting.put(\"117\", \"Other\");\r\n\t\tvoting.put(\"118\", \"BJP\");\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(voting);\r\n\t\t\r\n\t\tMap<String, Integer> countVoting=new HashMap();\r\n\t\t\r\n\t\tfor(Map.Entry<String, String> mapitr:voting.entrySet())\r\n\t\t{\r\n\t\t\t//System.out.println(mapitr.getValue());\r\n\t\t\t\r\n\t\t\tint count=1;\r\n\t\t\t\r\n\t\t\tif(countVoting.containsKey(mapitr.getValue()))\r\n\t\t\t{\r\n\t\t\t\tcount=countVoting.get(mapitr.getValue());\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tcountVoting.put(mapitr.getValue(),count);\r\n\t\t\t//System.out.println(countVoting);\r\n\t\t}\r\n\t\tSystem.out.println(countVoting);\r\n\t\t\r\n\t}",
"public int getQuantity(Product p){\n int count = 0;\n for (Product i : cartContents)\n {\n if (i.getProductID().equals(p.getProductID()))\n {\n count++;\n }\n }\n return count;\n }",
"public int hashCode()\n {\n// return this.getAdjustmentNumber();\n return this.getProductKey();\n }",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();",
"public long countProductCommentByProductId(int productId) {\n long countComments = 0;\n Session session = getSession();\n try {\n //Tao query tim comment moi den cu\n Query query = session.createQuery(\"select count commentId from ProductComments where productId=:productId and isDisabled = false\");\n //Gan gia tri cho query\n query.setInteger(\"productId\", productId);\n countComments = (long) query.uniqueResult();\n session.getTransaction().commit();\n } catch (Exception e) {\n e.printStackTrace();\n session.getTransaction().rollback();\n }\n //dong session\n session.close();\n return countComments;\n }",
"Long queryCount(ProductSearchParm productSearchParm);",
"int computeNutritionalScore(Map<String, Object> product);",
"public void setProductCount(Integer productCount) {\n this.productCount = productCount;\n }",
"int getClassIdXyPairsMapCount();",
"public int getNumberOfProducts(){\n return this.products.size();\n }",
"public void setProductsTable(HashMap<Integer, Product> hashMapProducts) {\n\t\tthis.productTable = hashMapProducts;\n\t}",
"public Map<CardSuit, Integer> getCardCountBySuit(Long idGame) {\n Game game = this.getGameById(idGame);\n\n if(game == null) {\n return null;\n }\n\n Map<CardSuit, Integer> map = new HashMap<>();\n\n List<Card> cards = game.getShoe();\n\n for(int i = 1, count = 0; i <= 4; i++, count = 0) {\n CardSuit cardSuit = CardSuit.fromValue(i);\n for(Card card : cards) {\n if(cardSuit.getValue() ==\n card.getCardSuit().getValue()){\n count++;\n }\n }\n map.put(cardSuit, count);\n }\n\n return map;\n }",
"@Override\r\n\tpublic int getCount(ProductVO vo) {\n\t\treturn dao.getCount(vo);\r\n\t}",
"private static Map<String, Integer> getHashTags(){\n\t\t\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\n\t\tfor(Status status : statusList){\n\t\t\tHashtagEntity[] entitles = status.getHashtagEntities();\n\t\t\tfor(HashtagEntity entity : entitles){\n\t\t\t\tString str = entity.getText();\n\t\t\t\t\n\t\t\t\tif(map.containsKey(str)){\n\t\t\t\t\tint count = map.get(str);\n\t\t\t\t\tmap.put(str, ++count);\n\t\t\t\t}else{\n\t\t\t\t\tmap.put(str, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}",
"public static HashMap<Integer, Item> storeItems(){\n\t\tItem prod1 = new Item(\"Candy\",40);\n\t\tItem prod2 = new Item(\"Bread\",30);\n\t\tItem prod3 = new Item(\"Butter\",50);\n\t\tItem prod4 = new Item(\"Milk\",43);\n\t\tItem prod5 = new Item(\"Toast\",60);\n\t\tItem prod6 = new Item(\"Curd\",20);\n\t\tItem prod7 = new Item(\"Cream\",80);\n\t\tItem prod8 = new Item(\"Pastry\",45);\n\t\tItem prod9 = new Item(\"Cake\",300);\n\t\tItem prod10 = new Item(\"Panner\",200);\n\t\tItem prod11 = new Item(\"Egg\",8);\n\t\tproducts.put(1,prod1);\n\t\tproducts.put(2,prod2);\n\t\tproducts.put(3,prod3);\n\t\tproducts.put(4,prod4);\n\t\tproducts.put(5,prod5);\n\t\tproducts.put(6,prod6);\n\t\tproducts.put(7,prod7);\n\t\tproducts.put(8,prod8);\n\t\tproducts.put(9,prod9);\n\t\tproducts.put(10,prod10);\n\t\tproducts.put(11,prod11);\n\t\treturn products;\n\t}",
"public HashMap<Long, Integer> getProductsToBeOrdered(int totalEntries) {\n HashMap<Long, Integer> listOfProducts = new HashMap<>();\n for (int i = 0; i < totalEntries; i++) {\n listOfProducts.put((long) getRandomNumber(0, 9999), getRandomNumber(1, 10));\n }\n return listOfProducts;\n }",
"private Map<Card, Integer> tally() {\n Map<Card, Integer> result = new HashMap<Card, Integer>();\n for (Card card: this.cards) {\n Integer value = result.get(card);\n if (value == null) {\n result.put(card, 1);\n } else {\n result.put(card, value + 1);\n }\n }\n return result;\n }",
"@Override\n public int getCount(Map<String, Object> params)\n {\n return advertisementMapper.getCount(params);\n }",
"public int findByCount(Map<String, Object> map) {\n\treturn projectmapper.findByCount(map);\n}",
"public Map<Integer, Long> groupByLikesWithCounts() {\n\t\treturn fruits.stream().collect(Collectors.groupingBy(Fruit::getLikes, Collectors.counting()));\n\t}",
"@Override\r\n public int getNumOfProducts() {\r\n return this.productList.size();\r\n }",
"public Map<Long, Long> getInstanceCount() {\n if (instanceCountMap == null) {\n FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<Long, Long>() {\n @Override\n public Long get(Object key) {\n return EJBLookup.getTypeEngine().getInstanceCount(Long.valueOf(key.toString()));\n }\n }, true);\n }\n return instanceCountMap;\n }",
"@Override\n public int getNumberOfProducts() {\n return getAll().size();\n }",
"public abstract Map<Object,Map<String,Integer>> getEventHandlerCounts();",
"public Map<Ingredient, Integer> countIngredients() {\n Map<Ingredient, Integer> ingredientsCount = new HashMap<Ingredient, Integer>();\n for (Meal meal : mMeals) {\n for (Ingredient ingredient : meal.getIngredients()) {\n if (ingredientsCount.containsKey(ingredient)) {\n ingredientsCount.put(ingredient, ingredientsCount.get(ingredient) + 1);\n } else {\n ingredientsCount.put(ingredient, 1);\n }\n }\n }\n return ingredientsCount;\n }",
"public Map<Entity, Integer> computeHyponymCountMap()\r\n\t{\n\t\treturn null;\r\n\t}",
"@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((getId() == null) ? 0 : getId().hashCode());\n result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());\n result = prime * result + ((getHotelId() == null) ? 0 : getHotelId().hashCode());\n result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());\n result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());\n result = prime * result + ((getCreatePerson() == null) ? 0 : getCreatePerson().hashCode());\n result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());\n result = prime * result + ((getUpdatePerson() == null) ? 0 : getUpdatePerson().hashCode());\n result = prime * result + ((getValue() == null) ? 0 : getValue().hashCode());\n return result;\n }",
"ArrayList<Relation> attributeCountLT4ForPropertiesbySupplierId(String supplierId);",
"private static void doBucketCount(HashMap<String, Integer> bigramCount) {\n\t\t//bucketCountT\n\t\tbucketCountT= new HashMap<Integer,Double>();\n\t\t\t\t\n\t\tfor(String s:bigramCount.keySet()){\n\t\t\tdouble count= bucketCountT.getOrDefault(bigramCount.get(s), (double)0);\n\t\t\tbucketCountT.put(bigramCount.get(s), count+1);\n\t\t}\n\t}",
"@Override\r\n\tpublic int updateProductById(HashMap<String, Object> map) {\n\t\tProduct product = (Product) map.get(\"product\");\r\n\t\tdao.updateProductById(product);\r\n\t\tList<ProductOption> oldList = (List<ProductOption>) map.get(\"oldList\");\r\n\t\tfor(int idx=0; idx<oldList.size(); idx++){\r\n\t\t\toldList.get(idx).setProductId(product.getProductId());\r\n\t\t\tdao.updateProductOptionById(oldList.get(idx));\r\n\t\t}\r\n\t\tList<ProductOption> newList = (List<ProductOption>) map.get(\"newList\");\r\n\t\tif(map.get(\"newList\")!=null){\r\n\t\t\tfor(int idx=0; idx<newList.size(); idx++){\r\n\t\t\t\tnewList.get(idx).setProductId(product.getProductId());\r\n\t\t\t\toptionDao.insertOption(newList.get(idx));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( map.get(\"image\")!=null){\r\n\t\t\tProductDetailImage image = ((ProductDetailImage) map.get(\"image\"));\r\n\t\t\tdao.updateDetailImageById(image);\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"@Override\r\n\tpublic int getCount(HashMap<String, Object> queryMap) {\n\t\treturn collectionMedicalRecordDao.getCount(queryMap);\r\n\t}",
"@Override\r\n public int getProductQuantity(Product product) {\r\n int i = 0;\r\n for (Product p : this.productList) {\r\n if (p.getId() == product.getId()) {\r\n return this.productQuantity.get(i);\r\n }\r\n i++;\r\n }\r\n return -1;\r\n }",
"int getListSnIdCount();",
"public void addToHashMap(long productId, java.util.List<Long> descriptionIdList) {\n\t\t// Iterate the list and check\n\t\tfor (long descriptionId : descriptionIdList) {\n\t\t\t// If description id is present in the HashMap, add the product id to it and\n\t\t\t// then update the HashMap\n\t\t\tif (hashMap.containsKey(descriptionId)) {\n\t\t\t\tTreeSet<Long> oldTreeSet = hashMap.get(descriptionId);\n\t\t\t\toldTreeSet.add(productId);\n\t\t\t\thashMap.replace(descriptionId, oldTreeSet);\n\t\t\t}\n\t\t\t// HashMap doesn't contain any product Id corresponding to the desc Id\n\t\t\t// Add a new descId, productId to hashMap\n\t\t\telse {\n\t\t\t\tTreeSet<Long> newTreeSet = new TreeSet<>();\n\t\t\t\tnewTreeSet.add(productId);\n\t\t\t\thashMap.put(descriptionId, newTreeSet);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t Map<String,Integer> hashmap= new HashMap<String,Integer>();\r\n\t hashmap.put(\"Hiamsnhu\",12);\r\n\t hashmap.put(\"Khaneja\", 15);\r\n\t int size=hashmap.size();\r\n\t int hash=hashmap.hashCode();\r\n\t System.out.println(size);\r\n\r\n\t}",
"long getUsesCount(K key);",
"private Map<Long,Boolean> getSaleIdMap(SupplierProductObjectDTO proObjVo){\n \t\tMap<Long, Boolean> saleMap = new LinkedHashMap<Long,Boolean>();\n \t\tList<SupplierProductAttrDTO> supplierProductAttrDTOs = proObjVo.getSupplierProductAttrDTOs();\n \t\tfor(SupplierProductAttrDTO attrDto : supplierProductAttrDTOs){\n \t\t\tSupplierProductAttr supplierProductAttr = attrDto.getSupplierProductAttr();\n \t\t\tif(supplierProductAttr.getSaleAttr().equals((short)1)){\n \t\t\t\tsaleMap.put(supplierProductAttr.getAttrId(), true);\n \t\t\t}else if(supplierProductAttr.getBuyAttr().equals((short)1)){\n \t\t\t\tsaleMap.put(supplierProductAttr.getAttrId(), false);\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn saleMap;\n \t}",
"private Map<Integer,Boolean> getProductCodeMap(){\n\t\t/*\n\t\t * Preleviamo i codici prodotto attualmente registrati nel database\n\t\t */\n\t\tStatement codeSt = null;\n\t\tResultSet codeRs = null;\n\t\ttry{\n\t\t\tcodeSt = connection.createStatement();\n\t\t\tString sql = \"SELECT CODICE FROM PRODOTTO;\";\n\t\t\tcodeRs = codeSt.executeQuery(sql);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to fetch product IDs from database.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\tMap<Integer,Boolean> codeMap = new HashMap<Integer,Boolean>();\n\t\tBoolean placeHolder = new Boolean(true);\n\t\ttry{\n\t\t\twhile(codeRs.next()){\n\t\t\t\tcodeMap.put(codeRs.getInt(\"CODICE\"), placeHolder);\n\t\t\t}\n\t\t\tcodeSt.close(); // Chiude anche il ResultSet codeRs\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue: failed to create the product code list.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\treturn codeMap;\n\t}",
"Map<String, Long> hits();",
"public HashMap<String, Integer> getTagReferenceCount() {\n\n\t\tif (m_db == null)\n\t\t\treturn null;\n\n\t\tCursor cursor = m_db\n\t\t\t\t.query(TAG_TABLE_NAME, new String[] { TAG_FIELD_NAME,\n\t\t\t\t\t\tTAG_FIELD_USAGE }, null, null, null, null, null);\n\n\t\tif (cursor.moveToFirst() == false) {\n\t\t\t//\n\t\t\t// no entries\n\t\t\t//\n\t\t\tcursor.close();\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// construct hash map list\n\t\t//\n\t\tHashMap<String, Integer> list = new HashMap<String, Integer>();\n\n\t\tdo {\n\t\t\t//\n\t\t\t// add result\n\t\t\t//\n\t\t\tlist.put(cursor.getString(0), new Integer(cursor.getInt(1)));\n\n\t\t} while (cursor.moveToNext());\n\n\t\t//\n\t\t// close cursor\n\t\t//\n\t\tcursor.close();\n\n\t\t//\n\t\t// return result list\n\t\t//\n\t\treturn list;\n\t}",
"public Object reduceCount(Map<String, Long> c) {\n\t\treturn couponRepository.reduceCount(c.get(\"id\"), c.get(\"quantity\"));\n\t}",
"@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }",
"public static void addProduct(Product product){\r\n \r\n System.out.println(\"Adding Product \" + product.getProductName());\r\n productInvMap.put(productInvMap.size(),product);\r\n }",
"int count(IDynamoDBMapper mapper);",
"public void reportQuantity() {\n\t\tlogger.debug(\"*** Product quantity report ***\");\n\t\tfor(String prodName: entities.keySet()) {\n\t\t\tProduct prod = (Product)entities.get(prodName);\n\t\t\tlogger.debug(String.format(\"Product: %-3s, quantity: %-5d\", prod.getName(), prod.getQuantity()));\t\t\t\n\t\t}\n\t\tlogger.debug(\"*** *** ***\");\n\t}",
"public int count( K key ) {\n Integer i = map.get( key );\n return i == null ? 0 : i;\n }",
"@Override\r\n\tpublic HashMap<String, Object> selectProductById(String productId) {\n\t\tHashMap<String, Object> map = new HashMap<>();\r\n\t\tmap.put(\"product\", dao.selectProductById(productId));\r\n\t\tmap.put(\"optionList\", dao.selectOptionById(productId));\r\n\t\treturn map;\r\n\t}",
"public Map<String, Integer> valueCounts(ArrayList<ArrayList<String>> datas, int attrIndex) { \n Map<String, Integer> valueCount = new HashMap<String, Integer>(); \n String c = \"\"; \n ArrayList<String> tuple = null; \n for (int i = 0; i < datas.size(); i++) { \n tuple = datas.get(i); \n c = tuple.get(attrIndex); \n if (valueCount.containsKey(c)) { \n valueCount.put(c, valueCount.get(c) + 1); \n } else { \n valueCount.put(c, 1); \n } \n } \n return valueCount; \n }",
"private int getTotalMobilKeys(Map<String, Set<String>> mobileKeysMap) {\n\t\tint totalMobileKeys = 0;\n\t\tSet<String> mobileKeySet = mobileKeysMap.keySet();\n\t\tfor(String mobileKey: mobileKeySet) {\n\t\t\ttotalMobileKeys += mobileKeysMap.get(mobileKey).size();\n\t\t}\n\t\treturn totalMobileKeys;\n\t}",
"public static void main(String[] args) {\n\t\tProduct proone=new Product();\r\n\t\tproone.setProdid(10001);\r\n\t\tproone.setProdname(\"lg\");\r\n\t\tproone.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct protwo=new Product();\r\n\t\tprotwo.setProdid(10008);\r\n\t\tprotwo.setProdname(\"lg\");\r\n\t\tprotwo.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct prothree=new Product();\r\n\t\tprothree.setProdid(10011);\r\n\t\tprothree.setProdname(\"lg\");\r\n\t\tprothree.setProdprice(1181.11);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n /* Map<Integer,String> myMap=new HashMap<>();\r\n myMap.put(1, \"abcd\");\r\n myMap.put(2,\"life\");\r\n myMap.put(3,\"veena\");\r\n */\r\n\t\t Map<Integer,Product> myMap=new HashMap<>();\r\n\t myMap.put(1, protwo);\r\n\t myMap.put(3,prothree);\r\n System.out.println(myMap);\r\n System.out.println(myMap.keySet());//give all keys\r\n System.out.println(myMap.get(2));\r\n System.out.println(myMap.values());//all values\r\n System.out.println(\"____________________for loop_=====================\");\r\n \r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(\"Keys are:\"+keys+\"Values \"+myMap.get(keys));\r\n }\r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(myMap.get(keys).getProdid());\r\n \t System.out.println(myMap.get(keys).getProdname());\r\n \t System.out.println(myMap.get(keys).getProdprice());\r\n \t \r\n }\r\n System.out.println(\"____________________Iterator=====================\");\r\n \r\n // Iterator it=myMap.iterator(); error becoz map is not part of collection but list nd set are part of collection\r\n //convert to set wid help of keyset...keyset will only convert keys entryset will convert evrythng\r\n \r\n Set myData=myMap.entrySet();\r\n Iterator it=myData.iterator();\r\n \r\n while(it.hasNext())\r\n {\r\n \t System.out.println(it.next());\r\n }\r\n \r\n System.out.println(\"============================\");\r\n //Collections.sort(myMap);\r\n \r\n // Set<Product> trgtset=new HashSet<>(myMap.values());\r\n Collection<Product> mySet=myMap.values(); \r\n //Set<Product> sett=new TreeSet<>(mySet);\r\n List<Product> myList=new LinkedList<>(mySet);\r\n Collections.sort(myList);\r\n \r\n /* for(Product prod:myList)\r\n {\r\n \t System.out.println(prod.getProdid());\r\n \t System.out.println(prod.getProdname());\r\n \t System.out.println(prod.getProdprice());\r\n }\r\n\r\n */\r\n Iterator it1=myData.iterator();\r\n \r\n while(it1.hasNext())\r\n {\r\n \t System.out.println(it1.next());\r\n }\r\n Map mp=new HashMap<>();\r\n mp.put(null,null);\r\n mp.put(1, null);\r\n mp.put(2, null);\r\n mp.put(null,null);\r\n System.out.println(mp);\r\n //is same above snippet written with map mp=new HashTable<>() it will giv nullpointer exception\r\n \r\n\t}",
"Map<Goods, Integer> getQuantityByDepartment(Department department) throws StoreKeeperWorkException;",
"@Override\r\n\tpublic int resourcesCount(Map<String, Object> map) {\n\t\treturn resourcesDao.resourcesCount(map);\r\n\t}",
"@Override\n\tpublic int getNoofProduct() {\n\t\tString sql=\"SELECT COUNT(product_product_id) FROM supplier_product\";\n\t\tint total=this.getJdbcTemplate().queryForObject(sql, Integer.class);\n\t\treturn total;\n\t}",
"Integer countForKey(String key);",
"public TypeCountMap<GoodsType> getProductionMap() {\n update();\n TypeCountMap<GoodsType> result = new TypeCountMap<GoodsType>();\n result.putAll(netProduction);\n return result;\n }",
"@Override\r\n\tpublic HashMap<String, Object> selectReviewPaging(int page, String productId)\r\n\t{\n\t\tHashMap<String, Object> map = new HashMap<>();\r\n\t\tPagingBean bean = new PagingBean(dao.selectCountById(productId), page);\r\n\t\tmap.put(\"itemPerPage\", 6);\r\n\t\tmap.put(\"page\", page);\r\n\t\tmap.put(\"productId\", productId);\r\n\t\tmap.put(\"review\", dao.selectReviewById(map));\r\n\t\tmap.put(\"bean\", bean);\r\n\t\treturn map;\r\n\t}",
"public int getproductCount() {\n\t\treturn getFieldCount(productPlate);\n\t}",
"private void addProductId(String productId, int reviewId) {\n\t\tif (!productIds.containsKey(productId)) {\n\t\t\tproductIds.put(productId, new ArrayList<>(Arrays.asList(reviewId, 0)));\n\t\t}\n\t\telse {\n\t\t\tArrayList<Integer> product = productIds.get(productId);\n\t\t\tproduct.set(1, product.get(1) + 1);\n\t\t}\n\t}",
"private Map<Integer, Integer> getShoppingCartBookQtyMap(List<Book> bookList, int userId) {\n Map<Integer, Integer> shoppingCartBookQty = new HashMap<Integer, Integer>();\n for(Book book : bookList) {\n int bookId = book.getBookId();\n DAOShoppingCart daoShoppingCart = new DAOShoppingCart();\n ShoppingCart shoppingCart = daoShoppingCart.getShoppingCartByBookIdCustomerId(userId, bookId);\n if(shoppingCart != null) {\n shoppingCartBookQty.put(bookId, shoppingCart.getQuantity());\n }\n }\n return shoppingCartBookQty;\n }",
"@Override\r\n public int hashCode() {\n int key=(Integer)(this.capsule.get(0)); // Get the key\r\n Integer bkey=Integer.parseInt(Integer.toBinaryString(key)); // Convert into binary \r\n int n=setcount(bkey); //counts the number of 1's in the binary\r\n key=key*n + Objects.hashCode(this.capsule.get(0)); //multiplies that with the hashcode of the pId\r\n return key;\r\n }",
"public void setProductId(Integer productId) {\r\n this.productId = productId;\r\n }",
"public void setProductId(Integer productId) {\r\n this.productId = productId;\r\n }",
"public int updateProductQuantity(String product, int quantity) {\n Collection<String> collection = shoppingBasket.keySet();\n\n for (String key : collection) {\n if (key != null) {\n if (product.equals(key) == true) {\n // нашли наше значение равное ключу\n // кладутся новые значения\n shoppingBasket.put(product, quantity);\n return 1;\n } else {\n return 0;\n }\n }\n }\n return 0;\n }",
"public void addProductToBuyBasket(int productId, int count) {\n if (buyBasket.containsKey(productId))\n buyBasket.replace(productId, buyBasket.get(productId + count));\n else\n buyBasket.put(productId, count);\n }",
"public void setProductId(Integer productId) {\n this.productId = productId;\n }",
"public void setProductId(Integer productId) {\n this.productId = productId;\n }",
"public void setProductId(Integer productId) {\n this.productId = productId;\n }",
"public void setProductId(Integer productId) {\n this.productId = productId;\n }",
"public void setProductId(Integer productId) {\n this.productId = productId;\n }",
"public void setProductId(Integer productId) {\n this.productId = productId;\n }",
"@Test\n\tpublic void populate_map() {\n\t\t//Arrange\n\t\t//testSteve.populateProductMap();\n\t\t\n\t\t//Act\n\t\ttestSteve.populateProductMap();\n\t\t\n\t\t//Assert\n\t\tAssert.assertEquals(testSteve.getProductGenerator().size(), (16));\n\t}",
"public Long findCountByParam(Map<String,Object> map);",
"public Products(){\n services = new LinkedHashMap<>();\n\n //Setting up products\n services.put(\"Consultation\", 30.0);\n services.put(\"Special Acupuncture Treatment\", 80.0);\n services.put(\"Medical Machine Therapy\", 30.0);\n services.put(\"Tapping Treatment\", 25.0);\n\n //Initializing the counter\n numCounter = services.size()+1;\n }"
] | [
"0.68146276",
"0.6790939",
"0.6675468",
"0.6671634",
"0.65927374",
"0.6589253",
"0.6502124",
"0.6499306",
"0.640343",
"0.6402965",
"0.63346493",
"0.6202151",
"0.6197269",
"0.6183564",
"0.61511433",
"0.61475116",
"0.61307245",
"0.6123642",
"0.61045784",
"0.6093298",
"0.6083605",
"0.6045361",
"0.6038083",
"0.60369253",
"0.602344",
"0.6022318",
"0.6012105",
"0.59546095",
"0.59338534",
"0.593265",
"0.59013796",
"0.58893853",
"0.5874835",
"0.5841128",
"0.58351344",
"0.58323735",
"0.582497",
"0.5810892",
"0.58107096",
"0.5808763",
"0.5793211",
"0.5757802",
"0.5754719",
"0.5754472",
"0.57432437",
"0.57348293",
"0.57218736",
"0.57188594",
"0.5714528",
"0.57019377",
"0.57014817",
"0.56984574",
"0.5681752",
"0.5674994",
"0.5672664",
"0.56709194",
"0.56688553",
"0.56672686",
"0.5637877",
"0.5630568",
"0.56132895",
"0.5604881",
"0.55982524",
"0.5594188",
"0.55800384",
"0.5575817",
"0.55741554",
"0.5573406",
"0.5567271",
"0.5566029",
"0.5562826",
"0.5551987",
"0.55515146",
"0.5549504",
"0.55429965",
"0.5524937",
"0.55174893",
"0.55167985",
"0.55127877",
"0.55124456",
"0.55114394",
"0.5503757",
"0.5489715",
"0.5487006",
"0.5486438",
"0.5485084",
"0.5483371",
"0.5483363",
"0.5478088",
"0.5478088",
"0.5469755",
"0.54649556",
"0.54637986",
"0.54637986",
"0.54637986",
"0.54637986",
"0.54637986",
"0.54637986",
"0.54623395",
"0.54571575",
"0.54563385"
] | 0.0 | -1 |
Adds the product to this Buyer's buyBasket. Increases the count if the product is already in the buyBasket. | public void addProductToBuyBasket(Product product, int count) {
if (buyBasket.containsKey(product.getId()))
buyBasket.replace(product.getId(), buyBasket.get(product.getId() + count));
else
buyBasket.put(product.getId(), count);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addProductToBuyBasket(int productId, int count) {\n if (buyBasket.containsKey(productId))\n buyBasket.replace(productId, buyBasket.get(productId + count));\n else\n buyBasket.put(productId, count);\n }",
"public void addToBasket(Product product){\n\n Purchaseitem purchaseitem = new Purchaseitem();\n purchaseitem.setProduct(product.getId());\n purchaseitem.setProductByProduct(product);\n boolean toAdd = false;\n if(basket.isEmpty()){\n purchaseitem.setQuantity(1);\n basket.add(purchaseitem);\n }else {\n for(int i = 0; i < basket.size(); i++){\n if(basket.get(i).getProduct() == product.getId()){\n basket.get(i).setQuantity(basket.get(i).getQuantity() + 1);\n return;\n } else {\n purchaseitem.setQuantity(1);\n toAdd = true;\n }\n }\n }\n if(toAdd){\n basket.add(purchaseitem);\n }\n }",
"public void addBuy() {\r\n\t\tbuys++;\r\n\t\tnotifyObservers();\r\n\t}",
"public void productsToBuy(Product purchase){\n bill.getProducts().add(purchase);\n }",
"public void addBasketItem(BasketItem newItem) {\n \n // If the sku already exists in the basket then update the quantity\n for(BasketItem item : basketItems) {\n if(item.getVariant().getSku().equals(newItem.getVariant().getSku())) {\n item.setQuantity(newItem.getQuantity() + item.getQuantity());\n return;\n }\n }\n \n // If the sku wasn't found above then add it to the basket\n basketItems.add(newItem);\n }",
"public void addProduct(String product, int quantity) {\n if (shoppingBasket.containsKey(product) != true) {\n shoppingBasket.put(product, quantity);\n } else {\n shoppingBasket.put(product, shoppingBasket.get(product) + quantity);\n }\n }",
"public void addProduct(Product p) {\n if(products.size() != 0 && products.get(0).getPricingDetails().equals(p.getPricingDetails()))\n return;\n\n products.add(p);\n quantity++;\n price = price.add(p.getPricingDetails());\n }",
"public void add(int index){\n int i = 0;\n boolean isFound = false;\n for (Product product:inventory.getProducts().keySet())\n {\n i++;\n if (i == index && inventory.getProducts().get(product) > 0)\n {\n if (myBasket.containsKey(product))\n {\n System.out.println(\"One more of this product added.\");\n myBasket.replace(product , myBasket.get(product) + 1);\n }\n else {\n System.out.println(\"Product added to your basket.\");\n myBasket.put(product , 1);\n }\n totalCost = totalCost + product.getPrice();\n isFound = true;\n inventory.updateStock(product , '-');\n }\n }\n if (!isFound)\n System.out.println(\"Sorry. Invalid index or not enough product in stock!\");\n }",
"public synchronized void addItem(Product product){\n \n ShoppingCartItem item = carrito.get(product.getId());\n int new_quantity;\n \n if(item==null){\n carrito.set(product.getId(), new ShoppingCartItem(product));\n new_quantity = 1;\n }else{\n new_quantity = item.getQuantity()+1;\n }\n //even if it's added or not, we call update method to update the quantity of the product\n this.update(product,Integer.toString(new_quantity));\n }",
"public void addProduct(Product product) {\n allProducts.add(product);\n }",
"@Override\r\n public void addProductQuantity(Product product, int quantity) {\r\n int stock;\r\n int i = 0;\r\n for (Product p : this.productList) {\r\n if (p.getId() == product.getId()) {\r\n stock = this.productQuantity.get(i);\r\n this.productQuantity.set(i, stock + quantity);\r\n break;\r\n }\r\n i++;\r\n }\r\n this.productList.add(product);\r\n this.productQuantity.add(quantity);\r\n }",
"public void addProduct(Product product) {\n int newQuantity = product.getQuantity();\n try {\n Product productInCart = getProductInCartCorrespondentTo(product);\n int previousQuantity = productInCart.getQuantity();\n productInCart.setQuantity(newQuantity + previousQuantity);\n this.amount += newQuantity * product.getPrice();\n } catch (NoSuchProductException e) {\n // the product isn't already in the list -> add it\n int index;\n try {\n index = getCategoryIndex(product.getCategory().name());\n } catch (NoSuchCategoryException e2) {\n index = categoryNames.indexOf(Category.OTHER.name());\n }\n shoppingCart.get(index).add(product);\n float price = product.getPrice() * newQuantity;\n this.amount += price;\n }\n for (int i = 0; i < newQuantity; i ++)\n lastProductList.add(product);\n }",
"public void addProduct(Product p){\n stock.add(p);\n }",
"public void addProduct(Product toAdd) {\n\t\tthis.products.add(toAdd);\n\t}",
"public boolean addProductToBasket(Product product, Order order) {\n \tint quantity = orderService.getQuanity(product);\n \treturn orderService.addProductToBasket(order, product, quantity);\n }",
"public void addProduct(Product pProduct)\n\t{\n\t\tmyProductInventory.add(pProduct);\n\n\n\t}",
"public void addProduct(Product item)\n {\n stock.add(item);\n }",
"public void add(WebSite website, int nProductID, int nQuantity) {\r\n\t\tfor (int i = 0; i < orderedItems.size(); i++) {\r\n\t\t\tOrderedItem oi = (OrderedItem) orderedItems.elementAt(i);\r\n\t\t\tif (oi.nProductID == nProductID) {\r\n\t\t\t\toi.nQuantity += nQuantity;\r\n\t\t\t\tcalculate(website);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tOrderedItem oi = new OrderedItem();\r\n\t\toi.nProductID = nProductID;\r\n\t\toi.nQuantity = nQuantity;\r\n\t\tProduct product = website.products.get(nProductID);\r\n\t\toi.dblPrice = product.dblPrice;\r\n\t\toi.dblCost = product.dblCost;\r\n\t\torderedItems.addElement(oi);\r\n\r\n\t\tcalculateCart(website);\r\n\t}",
"public void addProduct(Product product);",
"void addProduct(Product product);",
"public void addProduct(Product p) {\n c.addProduct(p);\n }",
"public static void addProduct(Product newProduct) {\n allProducts.add(newProduct);\n }",
"public void addProduct(Product newProduct) {\n System.out.println(\"addProduct(): \" + newProduct.getName());\n allProducts.add(newProduct);\n }",
"public boolean addProduct(Product p) {\n// products.add(p);\n boolean prodExists = false;\n for(Product prod: products){\n if(prod.getId() == p.getId()){\n prodExists = true;\n break;\n }\n }\n if(!prodExists){\n products.add(p);\n return true;\n }\n return false;\n }",
"public void addProduct(CartProduct p) throws InsufficientQuantityException {\n\t\tfor (CartProduct product : Admin.products) {\n\t\t\tif (product.getDescription().equals(p.getDescription()) && (product.getQuantity() >= 1)) {\n\t\t\t\tcart.addToCart(p);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tthrow new InsufficientQuantityException(\"Out of Stock\");\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic int add(Product product) throws Exception {\n\t\treturn this.dao.add(product);\r\n\t}",
"public void buyProduct(String productName) throws ProductNotFoundException {\r\n\r\n if (doesRecentOrderExist(productName)) {\r\n reorderProduct(productName);\r\n } else {\r\n //Create a new order to be given to the WebMarket\r\n Order newOrder = new Order(this, productName, \"buy\", \"pending\");\r\n\r\n //Acknowlegement print statment\r\n System.out.println(\"CUSTOMER: Request NEW purchase of - \" + newOrder.getProductName());\r\n\r\n //Send the order to WebMarket via placeNewOrder()\r\n market.placeNewOrder(newOrder);\r\n\r\n //Add this order to the customers personel list of orders\r\n orderHistory.add(newOrder);\r\n }\r\n }",
"public void Addproduct(Product objproduct) {\n\t\t\n\t}",
"public boolean addProduct(Product p) {\n\t\t\n\t\treturn products.add(p);\n\t}",
"public void addProduct(Product p) {\n\t\tthis.productList.add(p);\n\t}",
"public boolean addProductToWishlist(String productId) throws WishListException {\n\t\t// TODO Auto-generated method stub\n\t\tboolean result=false;\n\t\tif(ProductRepository.productList.get(productId) != null)\n\t\t{ if(WishlistDaoImpl.wlist.containsKey(productId))\n\t \t{\t\n\t\t\t throw new WishListException(\"WishList already contain this PRODUCT\");\n\t \t}\n\t\t else {\n\t\t\t result=WishlistDaoImplObj.addProductToWishlist(productId);\n\t\t return result;\n\t\t }\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new WishListException(\"Product ID not Found in Product List to Add in WishList\\n\");\n\t\t}\n\t \n\t\t\n\t}",
"public void increaseQuantityOfProductByOne() {\n int intQuantity = Integer.parseInt(quantityOfProducts.getAttribute(\"value\"));\n plusButton.click();\n testClass.waitTillValueOfElementIsIncreasedByOne(\n QUANTITY_OF_PRODUCTS_XPATH, intQuantity + 1);\n }",
"private void buyProduct() {\n\t\tSystem.out.println(\"Enter Number of Product :- \");\n\t\tint numberOfProduct = getValidInteger(\"Enter Number of Product :- \");\n\t\twhile (!StoreController.getInstance().isValidNumberOfProduct(\n\t\t\t\tnumberOfProduct)) {\n\t\t\tSystem.out.println(\"Enter Valid Number of Product :- \");\n\t\t\tnumberOfProduct = getValidInteger(\"Enter Number of Product :- \");\n\t\t}\n\t\tfor (int number = 1; number <= numberOfProduct; number++) {\n\t\t\tSystem.out.println(\"Enter \" + number + \" Product Id\");\n\t\t\tint productId = getValidInteger(\"Enter \" + number + \" Product Id\");\n\t\t\twhile (!StoreController.getInstance().isValidProductId(productId)) {\n\t\t\t\tSystem.out.println(\"Enter Valid Product Id\");\n\t\t\t\tproductId = getValidInteger(\"Enter \" + number + \" Product Id\");\n\t\t\t}\n\t\t\tSystem.out.println(\"Enter product Quantity\");\n\t\t\tint quantity = getValidInteger(\"Enter product Quantity\");\n\t\t\tCartController.getInstance().addProductToCart(productId, quantity);\n\t\t}\n\t}",
"public void addItem(Product p) {\n\t\t_items.add(p);\n\t}",
"public void add(CartItem cartItem){\n\t\tString book_id = cartItem.getBook().getBook_id();\n\t\tint count = cartItem.getCount();\n\t\t// if book exist in cart , change count\n\t\tif(map.containsKey(book_id)){ \n\t\t\tmap.get(book_id).setCount( map.get(book_id).getCount() + count); \n\t\t\t\t\t\n\t\t}else{\n\t\t\t// book not exist in cart, put it to map\n\t\t\tmap.put(cartItem.getBook().getBook_id(), cartItem);\n\t\t}\n\t\t\n\t}",
"public void addProduct(Product item){\n inventory.add(item);\n }",
"@Override\n\tpublic boolean addProduct(Product p) {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean addProduct(Product product) {\n\t\treturn dao.addProduct(product);\r\n\t}",
"public void addProductToWishlist(Product product, long accountId) {\n wishlistService.addProduct(product, accountId);\n }",
"private void addProductToCart(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String productID = request.getParameter(\"ProductID\");\n\n HttpSession session = request.getSession();\n\n List<Product> cartProducts = (List<Product>) session.getAttribute(\"cartProducts\");\n\n if (productID != null) {\n\n int id = Integer.parseInt(productID);\n\n if (cartProducts != null) {\n\n if (getCartSize(cartProducts) < Constants.CART_LIMIT) {\n\n if (!productIsAlreadyInCart(id, cartProducts))\n cartProducts.add(productDAO.getProduct(id));\n else\n increaseProductCountInCart(id, cartProducts);\n\n logger.info(\"Product (ID=\" + productID + \") has been added to the cart\");\n response.sendRedirect(Constants.PATH_CATALOG);\n } else\n response.getWriter().write(notifyCartIsFull());\n\n } else {\n cartProducts = new ArrayList<>();\n cartProducts.add(productDAO.getProduct(Integer.parseInt(productID)));\n\n logger.info(\"Product (ID=\" + productID + \") has been added to the cart\");\n session.setAttribute(\"cartProducts\", cartProducts);\n response.sendRedirect(Constants.PATH_CATALOG);\n }\n }\n }",
"Product addNewProductInStore(Product newProduct);",
"@Override\n\tpublic WishList addProductToWishList(List<String> productName, Long userId) {\n\t\tList<Product> allProduct = productDAO.getallProduct();\n\t\t\n\t\t\n\t\t\n\t\tfor(String p : productName) {\n\t\t\tProduct product = productDAO.getProductByName(p).get(0);\n\t\t\t\n\t\t\t\n\t\t\tif(allProduct.contains(p)) {\n\t\t\t\tUserDetail user = userDetailDAO.getUserById(userId).get(0);\n\t\t\t\tif(user.getWishList().getProducts().contains(p)) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tWishList wishList = new WishList();\n\t\t\t\t\tList<Product> prod = new ArrayList<>();\n\t\t\t\t\tprod.add(product);\n\t\t\t\t\twishList.setProducts(prod);\n\t\t\t\t\tuser.setWishList(wishList);\n\t\t\t\t\tuserDetailDAO.save(user);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn userDetailDAO.getUserById(userId).get(0).getWishList();\n\t}",
"public void increaseQuantity() {\n this.quantity++;\n this.updateTotalPrice();\n }",
"@NonNull\n public BasketItemBuilder incrementQuantity() {\n this.quantity++;\n return this;\n }",
"public void addNbProducts(int nbProducts) {\r\n this.nbProducts += nbProducts;\r\n }",
"@Override\n\tpublic boolean addProduct(Products productInfoBean) {\n\t\treturn dao.addProduct(productInfoBean);\n\t}",
"public void addAmountBought(int amountBought) {\n this.amountBought += amountBought;\n }",
"public boolean addProduct(Product product) {\n\t\treturn false;\n\t}",
"public static void addProduct(Product product){\r\n \r\n System.out.println(\"Adding Product \" + product.getProductName());\r\n productInvMap.put(productInvMap.size(),product);\r\n }",
"public static int addToBasket(Basket basket, String item, int quantity) {\n StockItem stockItem = stockList.get(item);\n if(stockItem == null) {\n System.out.println(\"We don't sell \" + item);\n return 0;\n }\n if(stockList.reserveStock(item, quantity) != 0) {\n basket.addToBasket(stockItem, quantity);\n return quantity;\n }\n return 0;\n }",
"public CategoryIPhone AddProductToCartAndContinue(String strProductName)\n\t{\n\t\t\n\t\twaittillResultload(\".//*[@name='\"+strProductName+\"']/div[2]/div/span/input\", \"xpath\");\n\t\t\n\t\tinputAddToCart.click();\n\t\t\n\t\twaittillResultload(\".continue_shopping\", \"css\");\n\t\t\n\t\tbuttonContinueShopping.click();\n\t\t\n\t\treturn this;\n\t\t\n\t}",
"public void buy() throws CannotAffordException {\r\n\t\tGame game = Game.getInstance();\r\n\t\tgame.decreaseBudget(price);\r\n\t\tgame.getInventory().add(id);\r\n\t}",
"public void addItem(Product p) throws IOException, ClassNotFoundException {\n SortByName sortByName = new SortByName();\n Collections.sort(cartContents, sortByName.productSearch());\n\n int m = this.getQuantity(p);\n //check if in cart will exceed available amount\n if (p.getAvailableQuantity() > m)\n {\n cartContents.add(p);\n }\n saveCart();\n }",
"@PutMapping(value = \"/{productId}/add/{quantity}\")\n @ApiOperation(value = \"Add Product To Basket\",response = CustomResponseEntity.class)\n public ResponseEntity<Object> addProductToBasket(@NotNull @PathVariable(value = \"productId\") @ApiParam(value = \"ID of Product\") String productId,\n @PathVariable(value = \"quantity\") @ApiParam(value = \"Quantity\") Long quantity, @RequestHeader(value = \"userId\") @ApiParam(value = \"ID of User\") Long userId) throws UserException, ProductException, SQLException {\n userService.findUserById(userId);\n CustomResponseEntity customResponseEntity = basketService.addProductToBasket(productId, userId, quantity);\n return new ResponseEntity(customResponseEntity, HttpStatus.CREATED);\n\n }",
"public CheckoutPage AddProductToCartAndCheckout(String strProductName)\n\t{\n\t\twaittillResultload(\".//*[@name='\"+strProductName+\"']/div[2]/div/span/input\", \"xpath\");\n\t\t\n\t\tinputAddToCart.click();\n\t\t\n\t\twaittillResultload(\".go_to_checkout\", \"css\");\n\t\t\n\t\tbuttonCheckout.click();\n\t\t\n\t\treturn new CheckoutPage(driver);\n\t\t\n\t}",
"public void addItem(Product p, int qty){\n //store info as an InventoryItem and add to items array\n this.items.add(new InventoryItem(p, qty));\n }",
"public void addItemQty(int itemQty) {\n this.itemQty += itemQty;\n }",
"public addproduct() {\n\t\tsuper();\n\t}",
"public void addToWish( String product_id, String product_name,String product_brand, String product_img,\n String product_price,String product_desc, String product_discount, String product_varieties )\n {\n boolean isAdded = mDatabaseFavorite.insert(product_id, product_name,product_brand, product_img,\n product_price,product_discount);\n\n if (isAdded == true)\n {\n Toast.makeText(DetailActivity.this,\"Added to Favorite\",Toast.LENGTH_SHORT).show();\n\n }\n\n else {\n\n Toast.makeText(DetailActivity.this,\"Already present in favoriteList\",Toast.LENGTH_SHORT).show();\n\n }\n\n }",
"public void addProductStock(Product product, int nbProducts) {\r\n this.productStocks.add(new ProductStock(product, nbProducts));\r\n }",
"public void addStock(Product p, int n) {\nif (p.id < 0) return;\nif (n < 1) return;\n\nfor (int i = 0; i < productCatalog.size(); i++) {\nProductStockPair pair = productCatalog.get(i);\nif (pair.product.id == p.id) {\nproductCatalog.set(i, new ProductStockPair(p, pair.stock + n));\nreturn;\n}\n}\nproductCatalog.add(new ProductStockPair(p, n));\n}",
"public boolean add(Product product) {\n return cartRepository.add(product);\n }",
"public void incrementAmountBought() {\n amountBought++;\n }",
"private void addProductId(String productId, int reviewId) {\n\t\tif (!productIds.containsKey(productId)) {\n\t\t\tproductIds.put(productId, new ArrayList<>(Arrays.asList(reviewId, 0)));\n\t\t}\n\t\telse {\n\t\t\tArrayList<Integer> product = productIds.get(productId);\n\t\t\tproduct.set(1, product.get(1) + 1);\n\t\t}\n\t}",
"public void addProductToList(Product aProduct){\n listOfProduct.add(aProduct);\n }",
"public void addProducts(Product product, int quantity) {\n this.getProductsQuantities().put(product, quantity);\n this.price += product.getPrice() * quantity;\n }",
"public boolean addProduct(final Product p) {\n\tsynchronized (this.productList) {\n\t boolean returned = this.productList.add(p);\n\t p.setStatus(Product.DONE);\n\t if (p.getOrder().getStatus() == Order.DONE)\n\t\tnew Timer().schedule(new TimerTask() {\n\t\t @Override\n\t\t public void run() {\n\t\t\tOutput.this.removeProduct(p);\n\t\t }\n\t\t}, 5000);\n\t this.setChanged();\n\t this.notifyObservers();\n\t return returned;\n\t}\n }",
"public void add() {\n\t\tcart.add(item.createCopy());\n\t}",
"public void add(Product product) {\r\n sessionFactory.getCurrentSession()\r\n .save(product);\r\n }",
"public void addItem(Product product, int quantity) {\n\t\t// search the Cartline list for the product\n\t\tfor (CartLine cartLine : getCartLineList()) {\n\t\t\t// check if product in cartline matches the product that we looking for\n\t\t\tif (cartLine.getProduct().equals(product)) {\n\t\t\t\tcartLine.setQuantity(quantity + cartLine.getQuantity());\n\t\t\t\treturn;\t//we found the product, exit the loop and the method\n\t\t\t}\n\t\t}\n\t\t//no cartline is found with the product so add new cart line \n\t\tcartLineList.add(new CartLine(product, quantity));\n\t}",
"public void addItemToSale(String productId, int quantity) {\r\n if (productId.isEmpty()) {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"product id is missing - enter valid product id\");\r\n System.exit(1);\r\n }\r\n if (quantity <= 0) {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"quantity is less than or equal to 0 - enter valid quantity\");\r\n System.exit(1);\r\n }\r\n FakeDatabase db = new FakeDatabase();\r\n Product product = db.findProduct(productId);\r\n\r\n if (product != null) { //product found in database\r\n receipt.addLineItem(product, quantity);\r\n } else {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"product id not found in database - enter valid product id\");\r\n System.exit(1);\r\n }\r\n }",
"public void addProduct(MarketObject<?> product) throws IllegalStateException{\n\t\tPlayer sellingPlayer=game.getCurrentPlayer();\n\n\t\tif(product.getObject().getClass().getSuperclass().equals(PoliticsCard.class))\n\t\t\tif(sellingPlayer.getCardsOwned().contains(product.getObject()))\n\t\t\t{\n\t\t\t\tsellingPlayer.getCardsOwned().remove((PoliticsCard)product.getObject());\n\t\t\t\tthis.products.add(product);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new IllegalStateException(\"Impossible to add \"+PoliticsCard.class.getSimpleName()+\n\t\t\t\t\t\t\". You don't own one.\");\n\t\telse if(product.getObject().getClass().equals(Assistant.class))\n\t\t\tif(sellingPlayer.checkAssistants(((Assistant)product.getObject()).getNumber()))\n\t\t\t\tthis.products.add(product);\n\t\t\telse \n\t\t\t\tthrow new IllegalStateException(\"Impossible to add \"+Assistant.class.getSimpleName()+\n\t\t\t\t\t\t\". You own just \"+sellingPlayer.getAssistants()+\" \"+Assistant.class.getSimpleName());\n\t\telse if(product.getObject().getClass().equals(BuildingPermit.class))\n\t\t\tif(sellingPlayer.getAllPermits().contains(product.getObject()))\n\t\t\t{\n\t\t\t\tsellingPlayer.getBuildingPermits().remove((BuildingPermit)product.getObject());\n\t\t\t\tthis.products.add(product);\n\t\t\t}\n\t\t\telse \n\t\t\t\tthrow new IllegalStateException(\"Impossible to add \"+BuildingPermit.class.getSimpleName()+\n\t\t\t\t\t\t\". You don't own one.\");\n\t\tgame.notifyObservers(new ModelChange(game));\n\t}",
"public Product addProduct(final Product newProduct) {\n\t\tfor(final Sku newSku : newProduct.getChildSkus()) {\n\t\t\tnewSku.setParentProduct(newProduct);\n\t\t}\n\t\treturn productRepository.save(newProduct);\n\t}",
"@Override\n public String addToCart(TicketDTO buy) throws InvalidQuantityException, ProductNotFoundException {\n\n return catalogueRepository.addToCart(buy);\n }",
"private void increaseProductCountInCart(int productID, List<Product> products) {\n\n for (Product product : products) {\n\n if (product.getId() == productID)\n product.setCount(product.getCount() + 1);\n }\n }",
"private void addProduct()\n {\n System.out.println(\"|➕| Add new Product:\\n\");\n System.out.println(\"|➕| Enter ID\\n\");\n int id = Integer.parseInt(reader.getInput());\n System.out.println(\"|➕| Enter Name\\n\");\n String name = reader.getInput();\n manager.addProduct(id, name);\n }",
"public static final void activateProduct(String productKey, int quantity) {\n\t\tInteger tValue = sConsumableProducts.get(productKey);\n\t\tif (tValue == null) {\n\t\t\tsConsumableProducts.put(productKey, new Integer(quantity));\n\t\t} else {\n\t\t\tint tQuantity = tValue.intValue();\n\t\t\ttQuantity += quantity;\n\t\t\tsConsumableProducts.put(productKey, new Integer(tQuantity));\n\t\t}\n\t\tsaveSettings();\n\t}",
"public synchronized void pdp_AddToBag() throws Exception {\n\n\t\t// Code to remove focus from zoomed image on page load\n\t\tif (!Utils.isDeviceMobile()) {\n\t\t\tActions actions = new Actions(driver);\n\t\t\tactions.moveToElement(productPrice()).build().perform();\n\t\t}\n\n\t\tutils.scrollToViewElement(driver, pdp_btn_AddToBag());\n\n\t\t// Handling Pop-Up that sometimes over shadows the ADD TO BAG button in mobile\n\t\tif (Utils.isDeviceMobile())\n\t\t\thandleBounceXOnPDP();\n\n\t\tpdp_btn_AddToBag().click();\n\t\t// Thread.sleep(3000);\n\n\t\tif (!utils.brand.equals(\"LGFP\"))\n\t\t\tAssert.assertTrue(utils.isElementPresent(driver, \"PDP_continueShopping\"),\n\t\t\t\t\t\"Item Added To Bag modal not displayed in mobile\");\n\t}",
"@Test\n\tpublic void testAddProductToCart() {\n\t\tdouble startBalance = cart.getBalance();\n\t\tassertEquals(0,startBalance,0.01);\n\t\t\n\t\t\n\t\t\t // 4. CHECK NUM ITEMS IN CART BEFORE ADDING PRODUCT\n\t\t\t // \t\t - PREV NUM ITEMS\n\t\t\n\t\tint StartingNumItems = cart.getItemCount();\n\t\tassertEquals(0,StartingNumItems);\n\t\t\n\t\t\t // 5. ADD THE PRODUCT TO THE CART \n\t\tcart.addItem(phone);\n\t\t\n\t\t\t // 6. CHECK THE UPDATED NUMBER OF ITEMS IN CART \n\t\t\t // \t\t-- EO: NUM ITEMS + 1\n\t\tassertEquals(StartingNumItems + 1, cart.getItemCount());\n\t\t\t // -----------------------\n\t\t\t // 7. CHECK THE UPDATED BALANCE OF THE CART\n\t\t\t // \t\t-- EO: PREVIOUS BALANCE + PRICE OF PRODUCT\n\t\t\n\t\tdouble expectedBalance = startBalance + phone.getPrice();\n\t\t\n\t\tassertEquals(expectedBalance,cart.getBalance(),0.01);\n\t\t\n\t\t\n\t\t\n\t}",
"private void buyButtonClicked(final ShopItem shopItem) {\n int cost = shopItem.getPrice();\n if (GameActivity.buyItem(cost)) {\n shopItem.setState(ItemStatusID.BOUGHT);\n updateUI();\n }\n }",
"@Override\n\tpublic void add(Product p) {\n\t\tproductRepository.save(p);\n\t}",
"public void increasePrice() {\n //price doubled\n itemToSell.setBuyPrice(itemToSell.getBuyPrice() * 2);\n }",
"public void buyItem() {\n List<Gnome> cart = user.getCart();\n String message = \"\";\n List<Gnome> bought = shopFacade.buyGnomes(cart);\n if (!bought.isEmpty()) {\n message = bought.size() + \" items bought\";\n } else {\n message = \"Could not buy any items\";\n }\n userFacade.assignBought(user, bought);\n user.getCart().removeAll(bought);\n cart.removeAll(bought);\n userFacade.setCartToUser(user.getUsername(), cart);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Gnomes\", message);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n }",
"public synchronized void add(Product product) {\n\t\tProduct[] playerProducts = playerMap.getOrDefault(product.getOwner(), new Product[8]);\n\t\tplayerProducts[product.getSlot()] = product;\n\t\tplayerMap.put(product.getOwner(), playerProducts);\n\n\t\tSet<Product> productSet = getProductSet(product);\n\t\tproductSet.add(product);\n\t\ttypeMap.get(product.getType()).get(product.getState()).put(product.getItemId(), productSet);\n\t}",
"@Override\n\tpublic Basket addBasket(Basket basket) {\n\t\treturn br.save(basket);\n\t}",
"public void AddSpecificProduct(String productName) {\n\t\t\n\t\ttest = report.startTest(\"TC: AddSpecificProduct\");\n\t\t\n\t\t// -- Step 1: Ensure we're in the right page after login\n\t\tif (!verifyInProductPage()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// -- Step 2: Construct Dynamic XPath & Add the item\n\t\t\n\t\t// construct dynamic xpath\n\t\tString dynXpath = new String();\n\n\t\t/* method 1\n\t\t\t// Example: //button[@data-test=\"add-to-cart-sauce-labs-bike-light\"]\n\t\t\tproductName.toLowerCase();\n\t\t\tdynXpath=\"//button[@data-test=\\\"add-to-cart-\" + productName.toLowerCase().replace(\" \", \"-\") +\"\\\"]\";\n\t\t*/\n\n\t\t/* method 2 */\n\t\tdynXpath=\"//*[text()='\"+ productName +\"']//following::button[1]\";\n\n\t\t\n\t\t// Check if product listed in the page? If yes, click ADD TO CART button\n\t try {\n\t \twait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(dynXpath)));\n\t \tdriver.findElement(By.xpath(dynXpath)).click();\n\t\t\ttest.log(LogStatus.INFO, \"Product [\" + productName + \"] found, clicked ADD TO CART button.\");\t\n\t } catch (TimeoutException e) {\n\t\t\ttest.log(LogStatus.FAIL, \"Product [\" + productName + \"] not found\");\n\t\t\treturn;\n\t }\n\t\t\n\n\t\t// -- Step 3: Verify item added via number(s) of item in Cart Badge\n\t \n\t\t// Perform simple verification using the Cart Badge on Top Right of the page\n\t\t// Now we update the dynXpath to remove pattern\n\t\tdynXpath=\"//button[@data-test=\\\"remove-\" + productName.toLowerCase().replace(\" \", \"-\") +\"\\\"]\";\n\t\t\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(dynXpath)));\n\t try {\n\t \tdriver.findElement(By.xpath(dynXpath));\n\t\t\ttest.log(LogStatus.PASS, \"Successful added [\" + productName + \"] to cart\");\t\n\t } catch (TimeoutException e) {\n\t\t\ttest.log(LogStatus.FAIL, \"Fail to add [\" + productName + \"] to cart\");\n\t\t\tsoft.fail(\"Failed to add item to cart!\");\t\n\t }\n\t\t\n\t\t\n\t}",
"public void insert(Product product) {\n this.products.add(product);\n }",
"public void addProduct(Product product) {\n orderProducts.add(product);\n product.setOrderProduct(this);\n }",
"@Override\n\tpublic void addProduct(ProductEntity product)\n\t{\n\t\tsave(product);\n\t\tlogger.debug(\"The user added is \" + product.getProductUuid());\n\t}",
"@Override\n\tpublic void add(Entity entity) throws Exception {\n\t\tsuper.add(entity);\n\t\tProduct prod = (Product) entity;\n\n\t\tSQLiteStatement st = db\n\t\t\t\t.prepare(\"INSERT INTO products(sessionID, name, priceMin, priceMax, quantity, category)\"\n\t\t\t\t\t\t+\"VALUES (?, ?, ?, ?, ?, ?)\");\n\t\tst.bind(1, sessionId).bind(2, prod.getName()).bind(3, prod.getPriceMin())\n\t\t\t\t.bind(4, prod.getPriceMin()).bind(5, prod.getQuantity())\n\t\t\t\t.bind(6, prod.getCategory());\n\t\tst.step();\n\t\ttotalQuantity += prod.quantity;\n\t\tif (!categoryList.containsKey(prod.getCategory())) {\n\t\t\tcategoryList.put(prod.getCategory(), new ArrayList<Product>());\n\t\t}\n\t\tcategoryList.get(prod.getCategory()).add(prod);\n\t\tif (availableProducts.get(entity.getName())==null) {\n\t\t\tavailableProducts.put(entity.getName(), \" \");\n\t\t}\n\t}",
"public boolean add(Product product) {\n\t\treturn dao.add(product);\n\t}",
"public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}",
"@Step(\"Add product to cart and proceed to checkout\")\n public HomeSteps addProductToCart(String productName) {\n homePage\n .openPage()\n .clickAddToCartButton(productName)\n .clickProceedToCheckoutButton();\n return this;\n }",
"public void addProduct(Product p) {\n\t\t\n\t\tString manufacturer = p.getManufacturer().toLowerCase();\n\t\t\n\t\tSet<Product> productsForThisManufacturer = productsByManufacturer.get(manufacturer);\n\t\t\n\t\tif (productsForThisManufacturer == null) {\n\t\t\tproductsForThisManufacturer = new HashSet<Product>();\n\t\t\tproductsByManufacturer.put(manufacturer, productsForThisManufacturer);\n\t\t}\n\t\t\n\t\tproductsForThisManufacturer.add(p);\n\n\t}",
"public void addProduct() {\n Product result;\n String prodName = getToken(\"Enter product name: \");\n double price = getDouble(\"Enter price per unit: $\");\n result = warehouse.addProduct(prodName, price);\n if (result != null) {\n System.out.println(result);\n }\n else {\n System.out.println(\"Product could not be added.\");\n }\n }",
"public void add(Weapon weapon){\n\t\tsetCount(getCount() + weapon.getCount());\n\t\tweapon.expire();\n\t}",
"public com.mozu.api.contracts.productadmin.Product addProduct(com.mozu.api.contracts.productadmin.Product product) throws Exception\r\n\t{\r\n\t\treturn addProduct( product, null);\r\n\t}",
"@Override\n\tpublic void addProduct(Product product) throws ProductNotFoundException {\n\t\tif (productRepository.findByName(product.getName()) == null){\n\t\t\tproductRepository.addProduct(product);\n\t\t}\n\n\t}",
"public void addProduct() throws Throwable\r\n\t{\r\n\t\tgoToProductsSection();\r\n\t\tverifyProduct();\r\n\t\tselPproductBtn.click();\r\n\t\twdlib.verify(wdlib.getPageTitle(),flib.getPropKeyValue(PROP_PATH, \"ProductsPage\") , \"Products Page \");\r\n\t\tProductsPage pdpage=new ProductsPage();\r\n\t\tpdpage.selectProducts();\r\n\t}",
"ProductView addProduct(ProductBinding productToAdd) throws ProductException;"
] | [
"0.77412117",
"0.744835",
"0.69609874",
"0.6747533",
"0.6683354",
"0.6633974",
"0.6584789",
"0.6555057",
"0.6521354",
"0.6402838",
"0.64014447",
"0.6397132",
"0.6362184",
"0.63392633",
"0.6327891",
"0.63256496",
"0.6310597",
"0.6277081",
"0.62590605",
"0.6224251",
"0.6201899",
"0.61609006",
"0.61408806",
"0.6136289",
"0.6135018",
"0.6120354",
"0.6117619",
"0.60887665",
"0.6082783",
"0.6067466",
"0.6066131",
"0.6019774",
"0.60104775",
"0.6008144",
"0.60004574",
"0.599861",
"0.59686434",
"0.59532225",
"0.5945497",
"0.5915531",
"0.5908008",
"0.5907271",
"0.5900945",
"0.58974576",
"0.58720154",
"0.5863236",
"0.58596873",
"0.58436483",
"0.5842598",
"0.5840359",
"0.5836119",
"0.5823878",
"0.58199066",
"0.5805121",
"0.57929075",
"0.57773",
"0.57644856",
"0.5755859",
"0.5751834",
"0.57483786",
"0.5743535",
"0.57311517",
"0.57293636",
"0.5727632",
"0.57222605",
"0.57187116",
"0.5711433",
"0.5709919",
"0.57042146",
"0.56993365",
"0.5684115",
"0.5677888",
"0.5676164",
"0.5675266",
"0.56682307",
"0.5666014",
"0.56450176",
"0.5638625",
"0.56290483",
"0.5628962",
"0.5625581",
"0.56208265",
"0.56090796",
"0.5608612",
"0.56003803",
"0.5599018",
"0.55963534",
"0.55940145",
"0.5591332",
"0.5582072",
"0.55807936",
"0.55759615",
"0.5575367",
"0.5569035",
"0.55615014",
"0.55562437",
"0.55483353",
"0.5544919",
"0.55397815",
"0.55388904"
] | 0.7758881 | 0 |
Adds the product to this Buyer's buyBasket. Increases the count if the product is already in the buyBasket. | public void addProductToBuyBasket(int productId, int count) {
if (buyBasket.containsKey(productId))
buyBasket.replace(productId, buyBasket.get(productId + count));
else
buyBasket.put(productId, count);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addProductToBuyBasket(Product product, int count) {\n if (buyBasket.containsKey(product.getId()))\n buyBasket.replace(product.getId(), buyBasket.get(product.getId() + count));\n else\n buyBasket.put(product.getId(), count);\n }",
"public void addToBasket(Product product){\n\n Purchaseitem purchaseitem = new Purchaseitem();\n purchaseitem.setProduct(product.getId());\n purchaseitem.setProductByProduct(product);\n boolean toAdd = false;\n if(basket.isEmpty()){\n purchaseitem.setQuantity(1);\n basket.add(purchaseitem);\n }else {\n for(int i = 0; i < basket.size(); i++){\n if(basket.get(i).getProduct() == product.getId()){\n basket.get(i).setQuantity(basket.get(i).getQuantity() + 1);\n return;\n } else {\n purchaseitem.setQuantity(1);\n toAdd = true;\n }\n }\n }\n if(toAdd){\n basket.add(purchaseitem);\n }\n }",
"public void addBuy() {\r\n\t\tbuys++;\r\n\t\tnotifyObservers();\r\n\t}",
"public void productsToBuy(Product purchase){\n bill.getProducts().add(purchase);\n }",
"public void addBasketItem(BasketItem newItem) {\n \n // If the sku already exists in the basket then update the quantity\n for(BasketItem item : basketItems) {\n if(item.getVariant().getSku().equals(newItem.getVariant().getSku())) {\n item.setQuantity(newItem.getQuantity() + item.getQuantity());\n return;\n }\n }\n \n // If the sku wasn't found above then add it to the basket\n basketItems.add(newItem);\n }",
"public void addProduct(String product, int quantity) {\n if (shoppingBasket.containsKey(product) != true) {\n shoppingBasket.put(product, quantity);\n } else {\n shoppingBasket.put(product, shoppingBasket.get(product) + quantity);\n }\n }",
"public void addProduct(Product p) {\n if(products.size() != 0 && products.get(0).getPricingDetails().equals(p.getPricingDetails()))\n return;\n\n products.add(p);\n quantity++;\n price = price.add(p.getPricingDetails());\n }",
"public void add(int index){\n int i = 0;\n boolean isFound = false;\n for (Product product:inventory.getProducts().keySet())\n {\n i++;\n if (i == index && inventory.getProducts().get(product) > 0)\n {\n if (myBasket.containsKey(product))\n {\n System.out.println(\"One more of this product added.\");\n myBasket.replace(product , myBasket.get(product) + 1);\n }\n else {\n System.out.println(\"Product added to your basket.\");\n myBasket.put(product , 1);\n }\n totalCost = totalCost + product.getPrice();\n isFound = true;\n inventory.updateStock(product , '-');\n }\n }\n if (!isFound)\n System.out.println(\"Sorry. Invalid index or not enough product in stock!\");\n }",
"public synchronized void addItem(Product product){\n \n ShoppingCartItem item = carrito.get(product.getId());\n int new_quantity;\n \n if(item==null){\n carrito.set(product.getId(), new ShoppingCartItem(product));\n new_quantity = 1;\n }else{\n new_quantity = item.getQuantity()+1;\n }\n //even if it's added or not, we call update method to update the quantity of the product\n this.update(product,Integer.toString(new_quantity));\n }",
"public void addProduct(Product product) {\n allProducts.add(product);\n }",
"@Override\r\n public void addProductQuantity(Product product, int quantity) {\r\n int stock;\r\n int i = 0;\r\n for (Product p : this.productList) {\r\n if (p.getId() == product.getId()) {\r\n stock = this.productQuantity.get(i);\r\n this.productQuantity.set(i, stock + quantity);\r\n break;\r\n }\r\n i++;\r\n }\r\n this.productList.add(product);\r\n this.productQuantity.add(quantity);\r\n }",
"public void addProduct(Product product) {\n int newQuantity = product.getQuantity();\n try {\n Product productInCart = getProductInCartCorrespondentTo(product);\n int previousQuantity = productInCart.getQuantity();\n productInCart.setQuantity(newQuantity + previousQuantity);\n this.amount += newQuantity * product.getPrice();\n } catch (NoSuchProductException e) {\n // the product isn't already in the list -> add it\n int index;\n try {\n index = getCategoryIndex(product.getCategory().name());\n } catch (NoSuchCategoryException e2) {\n index = categoryNames.indexOf(Category.OTHER.name());\n }\n shoppingCart.get(index).add(product);\n float price = product.getPrice() * newQuantity;\n this.amount += price;\n }\n for (int i = 0; i < newQuantity; i ++)\n lastProductList.add(product);\n }",
"public void addProduct(Product p){\n stock.add(p);\n }",
"public void addProduct(Product toAdd) {\n\t\tthis.products.add(toAdd);\n\t}",
"public boolean addProductToBasket(Product product, Order order) {\n \tint quantity = orderService.getQuanity(product);\n \treturn orderService.addProductToBasket(order, product, quantity);\n }",
"public void addProduct(Product pProduct)\n\t{\n\t\tmyProductInventory.add(pProduct);\n\n\n\t}",
"public void addProduct(Product item)\n {\n stock.add(item);\n }",
"public void add(WebSite website, int nProductID, int nQuantity) {\r\n\t\tfor (int i = 0; i < orderedItems.size(); i++) {\r\n\t\t\tOrderedItem oi = (OrderedItem) orderedItems.elementAt(i);\r\n\t\t\tif (oi.nProductID == nProductID) {\r\n\t\t\t\toi.nQuantity += nQuantity;\r\n\t\t\t\tcalculate(website);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tOrderedItem oi = new OrderedItem();\r\n\t\toi.nProductID = nProductID;\r\n\t\toi.nQuantity = nQuantity;\r\n\t\tProduct product = website.products.get(nProductID);\r\n\t\toi.dblPrice = product.dblPrice;\r\n\t\toi.dblCost = product.dblCost;\r\n\t\torderedItems.addElement(oi);\r\n\r\n\t\tcalculateCart(website);\r\n\t}",
"public void addProduct(Product product);",
"void addProduct(Product product);",
"public void addProduct(Product p) {\n c.addProduct(p);\n }",
"public static void addProduct(Product newProduct) {\n allProducts.add(newProduct);\n }",
"public void addProduct(Product newProduct) {\n System.out.println(\"addProduct(): \" + newProduct.getName());\n allProducts.add(newProduct);\n }",
"public boolean addProduct(Product p) {\n// products.add(p);\n boolean prodExists = false;\n for(Product prod: products){\n if(prod.getId() == p.getId()){\n prodExists = true;\n break;\n }\n }\n if(!prodExists){\n products.add(p);\n return true;\n }\n return false;\n }",
"public void addProduct(CartProduct p) throws InsufficientQuantityException {\n\t\tfor (CartProduct product : Admin.products) {\n\t\t\tif (product.getDescription().equals(p.getDescription()) && (product.getQuantity() >= 1)) {\n\t\t\t\tcart.addToCart(p);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tthrow new InsufficientQuantityException(\"Out of Stock\");\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic int add(Product product) throws Exception {\n\t\treturn this.dao.add(product);\r\n\t}",
"public void buyProduct(String productName) throws ProductNotFoundException {\r\n\r\n if (doesRecentOrderExist(productName)) {\r\n reorderProduct(productName);\r\n } else {\r\n //Create a new order to be given to the WebMarket\r\n Order newOrder = new Order(this, productName, \"buy\", \"pending\");\r\n\r\n //Acknowlegement print statment\r\n System.out.println(\"CUSTOMER: Request NEW purchase of - \" + newOrder.getProductName());\r\n\r\n //Send the order to WebMarket via placeNewOrder()\r\n market.placeNewOrder(newOrder);\r\n\r\n //Add this order to the customers personel list of orders\r\n orderHistory.add(newOrder);\r\n }\r\n }",
"public void Addproduct(Product objproduct) {\n\t\t\n\t}",
"public boolean addProduct(Product p) {\n\t\t\n\t\treturn products.add(p);\n\t}",
"public void addProduct(Product p) {\n\t\tthis.productList.add(p);\n\t}",
"public boolean addProductToWishlist(String productId) throws WishListException {\n\t\t// TODO Auto-generated method stub\n\t\tboolean result=false;\n\t\tif(ProductRepository.productList.get(productId) != null)\n\t\t{ if(WishlistDaoImpl.wlist.containsKey(productId))\n\t \t{\t\n\t\t\t throw new WishListException(\"WishList already contain this PRODUCT\");\n\t \t}\n\t\t else {\n\t\t\t result=WishlistDaoImplObj.addProductToWishlist(productId);\n\t\t return result;\n\t\t }\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new WishListException(\"Product ID not Found in Product List to Add in WishList\\n\");\n\t\t}\n\t \n\t\t\n\t}",
"public void increaseQuantityOfProductByOne() {\n int intQuantity = Integer.parseInt(quantityOfProducts.getAttribute(\"value\"));\n plusButton.click();\n testClass.waitTillValueOfElementIsIncreasedByOne(\n QUANTITY_OF_PRODUCTS_XPATH, intQuantity + 1);\n }",
"private void buyProduct() {\n\t\tSystem.out.println(\"Enter Number of Product :- \");\n\t\tint numberOfProduct = getValidInteger(\"Enter Number of Product :- \");\n\t\twhile (!StoreController.getInstance().isValidNumberOfProduct(\n\t\t\t\tnumberOfProduct)) {\n\t\t\tSystem.out.println(\"Enter Valid Number of Product :- \");\n\t\t\tnumberOfProduct = getValidInteger(\"Enter Number of Product :- \");\n\t\t}\n\t\tfor (int number = 1; number <= numberOfProduct; number++) {\n\t\t\tSystem.out.println(\"Enter \" + number + \" Product Id\");\n\t\t\tint productId = getValidInteger(\"Enter \" + number + \" Product Id\");\n\t\t\twhile (!StoreController.getInstance().isValidProductId(productId)) {\n\t\t\t\tSystem.out.println(\"Enter Valid Product Id\");\n\t\t\t\tproductId = getValidInteger(\"Enter \" + number + \" Product Id\");\n\t\t\t}\n\t\t\tSystem.out.println(\"Enter product Quantity\");\n\t\t\tint quantity = getValidInteger(\"Enter product Quantity\");\n\t\t\tCartController.getInstance().addProductToCart(productId, quantity);\n\t\t}\n\t}",
"public void addItem(Product p) {\n\t\t_items.add(p);\n\t}",
"public void addProduct(Product item){\n inventory.add(item);\n }",
"public void add(CartItem cartItem){\n\t\tString book_id = cartItem.getBook().getBook_id();\n\t\tint count = cartItem.getCount();\n\t\t// if book exist in cart , change count\n\t\tif(map.containsKey(book_id)){ \n\t\t\tmap.get(book_id).setCount( map.get(book_id).getCount() + count); \n\t\t\t\t\t\n\t\t}else{\n\t\t\t// book not exist in cart, put it to map\n\t\t\tmap.put(cartItem.getBook().getBook_id(), cartItem);\n\t\t}\n\t\t\n\t}",
"@Override\n\tpublic boolean addProduct(Product p) {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean addProduct(Product product) {\n\t\treturn dao.addProduct(product);\r\n\t}",
"public void addProductToWishlist(Product product, long accountId) {\n wishlistService.addProduct(product, accountId);\n }",
"private void addProductToCart(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String productID = request.getParameter(\"ProductID\");\n\n HttpSession session = request.getSession();\n\n List<Product> cartProducts = (List<Product>) session.getAttribute(\"cartProducts\");\n\n if (productID != null) {\n\n int id = Integer.parseInt(productID);\n\n if (cartProducts != null) {\n\n if (getCartSize(cartProducts) < Constants.CART_LIMIT) {\n\n if (!productIsAlreadyInCart(id, cartProducts))\n cartProducts.add(productDAO.getProduct(id));\n else\n increaseProductCountInCart(id, cartProducts);\n\n logger.info(\"Product (ID=\" + productID + \") has been added to the cart\");\n response.sendRedirect(Constants.PATH_CATALOG);\n } else\n response.getWriter().write(notifyCartIsFull());\n\n } else {\n cartProducts = new ArrayList<>();\n cartProducts.add(productDAO.getProduct(Integer.parseInt(productID)));\n\n logger.info(\"Product (ID=\" + productID + \") has been added to the cart\");\n session.setAttribute(\"cartProducts\", cartProducts);\n response.sendRedirect(Constants.PATH_CATALOG);\n }\n }\n }",
"Product addNewProductInStore(Product newProduct);",
"@Override\n\tpublic WishList addProductToWishList(List<String> productName, Long userId) {\n\t\tList<Product> allProduct = productDAO.getallProduct();\n\t\t\n\t\t\n\t\t\n\t\tfor(String p : productName) {\n\t\t\tProduct product = productDAO.getProductByName(p).get(0);\n\t\t\t\n\t\t\t\n\t\t\tif(allProduct.contains(p)) {\n\t\t\t\tUserDetail user = userDetailDAO.getUserById(userId).get(0);\n\t\t\t\tif(user.getWishList().getProducts().contains(p)) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tWishList wishList = new WishList();\n\t\t\t\t\tList<Product> prod = new ArrayList<>();\n\t\t\t\t\tprod.add(product);\n\t\t\t\t\twishList.setProducts(prod);\n\t\t\t\t\tuser.setWishList(wishList);\n\t\t\t\t\tuserDetailDAO.save(user);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn userDetailDAO.getUserById(userId).get(0).getWishList();\n\t}",
"public void increaseQuantity() {\n this.quantity++;\n this.updateTotalPrice();\n }",
"@NonNull\n public BasketItemBuilder incrementQuantity() {\n this.quantity++;\n return this;\n }",
"public void addNbProducts(int nbProducts) {\r\n this.nbProducts += nbProducts;\r\n }",
"@Override\n\tpublic boolean addProduct(Products productInfoBean) {\n\t\treturn dao.addProduct(productInfoBean);\n\t}",
"public void addAmountBought(int amountBought) {\n this.amountBought += amountBought;\n }",
"public boolean addProduct(Product product) {\n\t\treturn false;\n\t}",
"public static void addProduct(Product product){\r\n \r\n System.out.println(\"Adding Product \" + product.getProductName());\r\n productInvMap.put(productInvMap.size(),product);\r\n }",
"public static int addToBasket(Basket basket, String item, int quantity) {\n StockItem stockItem = stockList.get(item);\n if(stockItem == null) {\n System.out.println(\"We don't sell \" + item);\n return 0;\n }\n if(stockList.reserveStock(item, quantity) != 0) {\n basket.addToBasket(stockItem, quantity);\n return quantity;\n }\n return 0;\n }",
"public CategoryIPhone AddProductToCartAndContinue(String strProductName)\n\t{\n\t\t\n\t\twaittillResultload(\".//*[@name='\"+strProductName+\"']/div[2]/div/span/input\", \"xpath\");\n\t\t\n\t\tinputAddToCart.click();\n\t\t\n\t\twaittillResultload(\".continue_shopping\", \"css\");\n\t\t\n\t\tbuttonContinueShopping.click();\n\t\t\n\t\treturn this;\n\t\t\n\t}",
"public void buy() throws CannotAffordException {\r\n\t\tGame game = Game.getInstance();\r\n\t\tgame.decreaseBudget(price);\r\n\t\tgame.getInventory().add(id);\r\n\t}",
"public void addItem(Product p) throws IOException, ClassNotFoundException {\n SortByName sortByName = new SortByName();\n Collections.sort(cartContents, sortByName.productSearch());\n\n int m = this.getQuantity(p);\n //check if in cart will exceed available amount\n if (p.getAvailableQuantity() > m)\n {\n cartContents.add(p);\n }\n saveCart();\n }",
"@PutMapping(value = \"/{productId}/add/{quantity}\")\n @ApiOperation(value = \"Add Product To Basket\",response = CustomResponseEntity.class)\n public ResponseEntity<Object> addProductToBasket(@NotNull @PathVariable(value = \"productId\") @ApiParam(value = \"ID of Product\") String productId,\n @PathVariable(value = \"quantity\") @ApiParam(value = \"Quantity\") Long quantity, @RequestHeader(value = \"userId\") @ApiParam(value = \"ID of User\") Long userId) throws UserException, ProductException, SQLException {\n userService.findUserById(userId);\n CustomResponseEntity customResponseEntity = basketService.addProductToBasket(productId, userId, quantity);\n return new ResponseEntity(customResponseEntity, HttpStatus.CREATED);\n\n }",
"public CheckoutPage AddProductToCartAndCheckout(String strProductName)\n\t{\n\t\twaittillResultload(\".//*[@name='\"+strProductName+\"']/div[2]/div/span/input\", \"xpath\");\n\t\t\n\t\tinputAddToCart.click();\n\t\t\n\t\twaittillResultload(\".go_to_checkout\", \"css\");\n\t\t\n\t\tbuttonCheckout.click();\n\t\t\n\t\treturn new CheckoutPage(driver);\n\t\t\n\t}",
"public void addItem(Product p, int qty){\n //store info as an InventoryItem and add to items array\n this.items.add(new InventoryItem(p, qty));\n }",
"public void addItemQty(int itemQty) {\n this.itemQty += itemQty;\n }",
"public addproduct() {\n\t\tsuper();\n\t}",
"public void addToWish( String product_id, String product_name,String product_brand, String product_img,\n String product_price,String product_desc, String product_discount, String product_varieties )\n {\n boolean isAdded = mDatabaseFavorite.insert(product_id, product_name,product_brand, product_img,\n product_price,product_discount);\n\n if (isAdded == true)\n {\n Toast.makeText(DetailActivity.this,\"Added to Favorite\",Toast.LENGTH_SHORT).show();\n\n }\n\n else {\n\n Toast.makeText(DetailActivity.this,\"Already present in favoriteList\",Toast.LENGTH_SHORT).show();\n\n }\n\n }",
"public void addProductStock(Product product, int nbProducts) {\r\n this.productStocks.add(new ProductStock(product, nbProducts));\r\n }",
"public void addStock(Product p, int n) {\nif (p.id < 0) return;\nif (n < 1) return;\n\nfor (int i = 0; i < productCatalog.size(); i++) {\nProductStockPair pair = productCatalog.get(i);\nif (pair.product.id == p.id) {\nproductCatalog.set(i, new ProductStockPair(p, pair.stock + n));\nreturn;\n}\n}\nproductCatalog.add(new ProductStockPair(p, n));\n}",
"public boolean add(Product product) {\n return cartRepository.add(product);\n }",
"public void incrementAmountBought() {\n amountBought++;\n }",
"private void addProductId(String productId, int reviewId) {\n\t\tif (!productIds.containsKey(productId)) {\n\t\t\tproductIds.put(productId, new ArrayList<>(Arrays.asList(reviewId, 0)));\n\t\t}\n\t\telse {\n\t\t\tArrayList<Integer> product = productIds.get(productId);\n\t\t\tproduct.set(1, product.get(1) + 1);\n\t\t}\n\t}",
"public void addProductToList(Product aProduct){\n listOfProduct.add(aProduct);\n }",
"public void addProducts(Product product, int quantity) {\n this.getProductsQuantities().put(product, quantity);\n this.price += product.getPrice() * quantity;\n }",
"public boolean addProduct(final Product p) {\n\tsynchronized (this.productList) {\n\t boolean returned = this.productList.add(p);\n\t p.setStatus(Product.DONE);\n\t if (p.getOrder().getStatus() == Order.DONE)\n\t\tnew Timer().schedule(new TimerTask() {\n\t\t @Override\n\t\t public void run() {\n\t\t\tOutput.this.removeProduct(p);\n\t\t }\n\t\t}, 5000);\n\t this.setChanged();\n\t this.notifyObservers();\n\t return returned;\n\t}\n }",
"public void add() {\n\t\tcart.add(item.createCopy());\n\t}",
"public void add(Product product) {\r\n sessionFactory.getCurrentSession()\r\n .save(product);\r\n }",
"public void addItem(Product product, int quantity) {\n\t\t// search the Cartline list for the product\n\t\tfor (CartLine cartLine : getCartLineList()) {\n\t\t\t// check if product in cartline matches the product that we looking for\n\t\t\tif (cartLine.getProduct().equals(product)) {\n\t\t\t\tcartLine.setQuantity(quantity + cartLine.getQuantity());\n\t\t\t\treturn;\t//we found the product, exit the loop and the method\n\t\t\t}\n\t\t}\n\t\t//no cartline is found with the product so add new cart line \n\t\tcartLineList.add(new CartLine(product, quantity));\n\t}",
"public void addItemToSale(String productId, int quantity) {\r\n if (productId.isEmpty()) {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"product id is missing - enter valid product id\");\r\n System.exit(1);\r\n }\r\n if (quantity <= 0) {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"quantity is less than or equal to 0 - enter valid quantity\");\r\n System.exit(1);\r\n }\r\n FakeDatabase db = new FakeDatabase();\r\n Product product = db.findProduct(productId);\r\n\r\n if (product != null) { //product found in database\r\n receipt.addLineItem(product, quantity);\r\n } else {\r\n System.out.println(\"Class CashRegister, method addItemToSale\");\r\n System.out.println(\"product id not found in database - enter valid product id\");\r\n System.exit(1);\r\n }\r\n }",
"public void addProduct(MarketObject<?> product) throws IllegalStateException{\n\t\tPlayer sellingPlayer=game.getCurrentPlayer();\n\n\t\tif(product.getObject().getClass().getSuperclass().equals(PoliticsCard.class))\n\t\t\tif(sellingPlayer.getCardsOwned().contains(product.getObject()))\n\t\t\t{\n\t\t\t\tsellingPlayer.getCardsOwned().remove((PoliticsCard)product.getObject());\n\t\t\t\tthis.products.add(product);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new IllegalStateException(\"Impossible to add \"+PoliticsCard.class.getSimpleName()+\n\t\t\t\t\t\t\". You don't own one.\");\n\t\telse if(product.getObject().getClass().equals(Assistant.class))\n\t\t\tif(sellingPlayer.checkAssistants(((Assistant)product.getObject()).getNumber()))\n\t\t\t\tthis.products.add(product);\n\t\t\telse \n\t\t\t\tthrow new IllegalStateException(\"Impossible to add \"+Assistant.class.getSimpleName()+\n\t\t\t\t\t\t\". You own just \"+sellingPlayer.getAssistants()+\" \"+Assistant.class.getSimpleName());\n\t\telse if(product.getObject().getClass().equals(BuildingPermit.class))\n\t\t\tif(sellingPlayer.getAllPermits().contains(product.getObject()))\n\t\t\t{\n\t\t\t\tsellingPlayer.getBuildingPermits().remove((BuildingPermit)product.getObject());\n\t\t\t\tthis.products.add(product);\n\t\t\t}\n\t\t\telse \n\t\t\t\tthrow new IllegalStateException(\"Impossible to add \"+BuildingPermit.class.getSimpleName()+\n\t\t\t\t\t\t\". You don't own one.\");\n\t\tgame.notifyObservers(new ModelChange(game));\n\t}",
"public Product addProduct(final Product newProduct) {\n\t\tfor(final Sku newSku : newProduct.getChildSkus()) {\n\t\t\tnewSku.setParentProduct(newProduct);\n\t\t}\n\t\treturn productRepository.save(newProduct);\n\t}",
"@Override\n public String addToCart(TicketDTO buy) throws InvalidQuantityException, ProductNotFoundException {\n\n return catalogueRepository.addToCart(buy);\n }",
"private void increaseProductCountInCart(int productID, List<Product> products) {\n\n for (Product product : products) {\n\n if (product.getId() == productID)\n product.setCount(product.getCount() + 1);\n }\n }",
"private void addProduct()\n {\n System.out.println(\"|➕| Add new Product:\\n\");\n System.out.println(\"|➕| Enter ID\\n\");\n int id = Integer.parseInt(reader.getInput());\n System.out.println(\"|➕| Enter Name\\n\");\n String name = reader.getInput();\n manager.addProduct(id, name);\n }",
"public static final void activateProduct(String productKey, int quantity) {\n\t\tInteger tValue = sConsumableProducts.get(productKey);\n\t\tif (tValue == null) {\n\t\t\tsConsumableProducts.put(productKey, new Integer(quantity));\n\t\t} else {\n\t\t\tint tQuantity = tValue.intValue();\n\t\t\ttQuantity += quantity;\n\t\t\tsConsumableProducts.put(productKey, new Integer(tQuantity));\n\t\t}\n\t\tsaveSettings();\n\t}",
"public synchronized void pdp_AddToBag() throws Exception {\n\n\t\t// Code to remove focus from zoomed image on page load\n\t\tif (!Utils.isDeviceMobile()) {\n\t\t\tActions actions = new Actions(driver);\n\t\t\tactions.moveToElement(productPrice()).build().perform();\n\t\t}\n\n\t\tutils.scrollToViewElement(driver, pdp_btn_AddToBag());\n\n\t\t// Handling Pop-Up that sometimes over shadows the ADD TO BAG button in mobile\n\t\tif (Utils.isDeviceMobile())\n\t\t\thandleBounceXOnPDP();\n\n\t\tpdp_btn_AddToBag().click();\n\t\t// Thread.sleep(3000);\n\n\t\tif (!utils.brand.equals(\"LGFP\"))\n\t\t\tAssert.assertTrue(utils.isElementPresent(driver, \"PDP_continueShopping\"),\n\t\t\t\t\t\"Item Added To Bag modal not displayed in mobile\");\n\t}",
"private void buyButtonClicked(final ShopItem shopItem) {\n int cost = shopItem.getPrice();\n if (GameActivity.buyItem(cost)) {\n shopItem.setState(ItemStatusID.BOUGHT);\n updateUI();\n }\n }",
"@Test\n\tpublic void testAddProductToCart() {\n\t\tdouble startBalance = cart.getBalance();\n\t\tassertEquals(0,startBalance,0.01);\n\t\t\n\t\t\n\t\t\t // 4. CHECK NUM ITEMS IN CART BEFORE ADDING PRODUCT\n\t\t\t // \t\t - PREV NUM ITEMS\n\t\t\n\t\tint StartingNumItems = cart.getItemCount();\n\t\tassertEquals(0,StartingNumItems);\n\t\t\n\t\t\t // 5. ADD THE PRODUCT TO THE CART \n\t\tcart.addItem(phone);\n\t\t\n\t\t\t // 6. CHECK THE UPDATED NUMBER OF ITEMS IN CART \n\t\t\t // \t\t-- EO: NUM ITEMS + 1\n\t\tassertEquals(StartingNumItems + 1, cart.getItemCount());\n\t\t\t // -----------------------\n\t\t\t // 7. CHECK THE UPDATED BALANCE OF THE CART\n\t\t\t // \t\t-- EO: PREVIOUS BALANCE + PRICE OF PRODUCT\n\t\t\n\t\tdouble expectedBalance = startBalance + phone.getPrice();\n\t\t\n\t\tassertEquals(expectedBalance,cart.getBalance(),0.01);\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic void add(Product p) {\n\t\tproductRepository.save(p);\n\t}",
"public void increasePrice() {\n //price doubled\n itemToSell.setBuyPrice(itemToSell.getBuyPrice() * 2);\n }",
"public void buyItem() {\n List<Gnome> cart = user.getCart();\n String message = \"\";\n List<Gnome> bought = shopFacade.buyGnomes(cart);\n if (!bought.isEmpty()) {\n message = bought.size() + \" items bought\";\n } else {\n message = \"Could not buy any items\";\n }\n userFacade.assignBought(user, bought);\n user.getCart().removeAll(bought);\n cart.removeAll(bought);\n userFacade.setCartToUser(user.getUsername(), cart);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Gnomes\", message);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n }",
"public synchronized void add(Product product) {\n\t\tProduct[] playerProducts = playerMap.getOrDefault(product.getOwner(), new Product[8]);\n\t\tplayerProducts[product.getSlot()] = product;\n\t\tplayerMap.put(product.getOwner(), playerProducts);\n\n\t\tSet<Product> productSet = getProductSet(product);\n\t\tproductSet.add(product);\n\t\ttypeMap.get(product.getType()).get(product.getState()).put(product.getItemId(), productSet);\n\t}",
"@Override\n\tpublic Basket addBasket(Basket basket) {\n\t\treturn br.save(basket);\n\t}",
"public void AddSpecificProduct(String productName) {\n\t\t\n\t\ttest = report.startTest(\"TC: AddSpecificProduct\");\n\t\t\n\t\t// -- Step 1: Ensure we're in the right page after login\n\t\tif (!verifyInProductPage()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// -- Step 2: Construct Dynamic XPath & Add the item\n\t\t\n\t\t// construct dynamic xpath\n\t\tString dynXpath = new String();\n\n\t\t/* method 1\n\t\t\t// Example: //button[@data-test=\"add-to-cart-sauce-labs-bike-light\"]\n\t\t\tproductName.toLowerCase();\n\t\t\tdynXpath=\"//button[@data-test=\\\"add-to-cart-\" + productName.toLowerCase().replace(\" \", \"-\") +\"\\\"]\";\n\t\t*/\n\n\t\t/* method 2 */\n\t\tdynXpath=\"//*[text()='\"+ productName +\"']//following::button[1]\";\n\n\t\t\n\t\t// Check if product listed in the page? If yes, click ADD TO CART button\n\t try {\n\t \twait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(dynXpath)));\n\t \tdriver.findElement(By.xpath(dynXpath)).click();\n\t\t\ttest.log(LogStatus.INFO, \"Product [\" + productName + \"] found, clicked ADD TO CART button.\");\t\n\t } catch (TimeoutException e) {\n\t\t\ttest.log(LogStatus.FAIL, \"Product [\" + productName + \"] not found\");\n\t\t\treturn;\n\t }\n\t\t\n\n\t\t// -- Step 3: Verify item added via number(s) of item in Cart Badge\n\t \n\t\t// Perform simple verification using the Cart Badge on Top Right of the page\n\t\t// Now we update the dynXpath to remove pattern\n\t\tdynXpath=\"//button[@data-test=\\\"remove-\" + productName.toLowerCase().replace(\" \", \"-\") +\"\\\"]\";\n\t\t\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(dynXpath)));\n\t try {\n\t \tdriver.findElement(By.xpath(dynXpath));\n\t\t\ttest.log(LogStatus.PASS, \"Successful added [\" + productName + \"] to cart\");\t\n\t } catch (TimeoutException e) {\n\t\t\ttest.log(LogStatus.FAIL, \"Fail to add [\" + productName + \"] to cart\");\n\t\t\tsoft.fail(\"Failed to add item to cart!\");\t\n\t }\n\t\t\n\t\t\n\t}",
"public void insert(Product product) {\n this.products.add(product);\n }",
"public void addProduct(Product product) {\n orderProducts.add(product);\n product.setOrderProduct(this);\n }",
"@Override\n\tpublic void addProduct(ProductEntity product)\n\t{\n\t\tsave(product);\n\t\tlogger.debug(\"The user added is \" + product.getProductUuid());\n\t}",
"@Override\n\tpublic void add(Entity entity) throws Exception {\n\t\tsuper.add(entity);\n\t\tProduct prod = (Product) entity;\n\n\t\tSQLiteStatement st = db\n\t\t\t\t.prepare(\"INSERT INTO products(sessionID, name, priceMin, priceMax, quantity, category)\"\n\t\t\t\t\t\t+\"VALUES (?, ?, ?, ?, ?, ?)\");\n\t\tst.bind(1, sessionId).bind(2, prod.getName()).bind(3, prod.getPriceMin())\n\t\t\t\t.bind(4, prod.getPriceMin()).bind(5, prod.getQuantity())\n\t\t\t\t.bind(6, prod.getCategory());\n\t\tst.step();\n\t\ttotalQuantity += prod.quantity;\n\t\tif (!categoryList.containsKey(prod.getCategory())) {\n\t\t\tcategoryList.put(prod.getCategory(), new ArrayList<Product>());\n\t\t}\n\t\tcategoryList.get(prod.getCategory()).add(prod);\n\t\tif (availableProducts.get(entity.getName())==null) {\n\t\t\tavailableProducts.put(entity.getName(), \" \");\n\t\t}\n\t}",
"public boolean add(Product product) {\n\t\treturn dao.add(product);\n\t}",
"public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}",
"@Step(\"Add product to cart and proceed to checkout\")\n public HomeSteps addProductToCart(String productName) {\n homePage\n .openPage()\n .clickAddToCartButton(productName)\n .clickProceedToCheckoutButton();\n return this;\n }",
"public void addProduct(Product p) {\n\t\t\n\t\tString manufacturer = p.getManufacturer().toLowerCase();\n\t\t\n\t\tSet<Product> productsForThisManufacturer = productsByManufacturer.get(manufacturer);\n\t\t\n\t\tif (productsForThisManufacturer == null) {\n\t\t\tproductsForThisManufacturer = new HashSet<Product>();\n\t\t\tproductsByManufacturer.put(manufacturer, productsForThisManufacturer);\n\t\t}\n\t\t\n\t\tproductsForThisManufacturer.add(p);\n\n\t}",
"public void addProduct() {\n Product result;\n String prodName = getToken(\"Enter product name: \");\n double price = getDouble(\"Enter price per unit: $\");\n result = warehouse.addProduct(prodName, price);\n if (result != null) {\n System.out.println(result);\n }\n else {\n System.out.println(\"Product could not be added.\");\n }\n }",
"public void add(Weapon weapon){\n\t\tsetCount(getCount() + weapon.getCount());\n\t\tweapon.expire();\n\t}",
"public com.mozu.api.contracts.productadmin.Product addProduct(com.mozu.api.contracts.productadmin.Product product) throws Exception\r\n\t{\r\n\t\treturn addProduct( product, null);\r\n\t}",
"@Override\n\tpublic void addProduct(Product product) throws ProductNotFoundException {\n\t\tif (productRepository.findByName(product.getName()) == null){\n\t\t\tproductRepository.addProduct(product);\n\t\t}\n\n\t}",
"public void addProduct() throws Throwable\r\n\t{\r\n\t\tgoToProductsSection();\r\n\t\tverifyProduct();\r\n\t\tselPproductBtn.click();\r\n\t\twdlib.verify(wdlib.getPageTitle(),flib.getPropKeyValue(PROP_PATH, \"ProductsPage\") , \"Products Page \");\r\n\t\tProductsPage pdpage=new ProductsPage();\r\n\t\tpdpage.selectProducts();\r\n\t}",
"ProductView addProduct(ProductBinding productToAdd) throws ProductException;"
] | [
"0.7759628",
"0.7449064",
"0.69608027",
"0.67480975",
"0.6684752",
"0.6634009",
"0.6586124",
"0.65555584",
"0.6521491",
"0.640355",
"0.6401774",
"0.63978547",
"0.63641346",
"0.63409054",
"0.6328765",
"0.63270277",
"0.6311989",
"0.6277597",
"0.6259772",
"0.62249523",
"0.6203343",
"0.61622435",
"0.6141917",
"0.61374736",
"0.6135799",
"0.6119793",
"0.61183333",
"0.6089394",
"0.6084396",
"0.6069334",
"0.60666674",
"0.6019829",
"0.6010527",
"0.6009874",
"0.5999828",
"0.59995127",
"0.5970032",
"0.59536207",
"0.5946337",
"0.59154034",
"0.5908851",
"0.5907928",
"0.59009904",
"0.58979887",
"0.5871772",
"0.5864015",
"0.5859923",
"0.58441055",
"0.5842662",
"0.583993",
"0.5837156",
"0.58238506",
"0.5820693",
"0.58052856",
"0.5793637",
"0.577845",
"0.5764365",
"0.5756839",
"0.57526803",
"0.5749231",
"0.57445127",
"0.5731634",
"0.57292306",
"0.57271254",
"0.5723724",
"0.5719049",
"0.57126015",
"0.5711626",
"0.57049036",
"0.56992304",
"0.5683529",
"0.56781644",
"0.56772506",
"0.567704",
"0.56673837",
"0.5666168",
"0.56447524",
"0.56397724",
"0.5630154",
"0.5629111",
"0.56267476",
"0.5621993",
"0.5609924",
"0.56082964",
"0.5601434",
"0.5598985",
"0.5597259",
"0.5595412",
"0.55912775",
"0.55822897",
"0.55808794",
"0.5576666",
"0.55765456",
"0.5570499",
"0.5562312",
"0.55552155",
"0.5548846",
"0.55447334",
"0.55400544",
"0.55398536"
] | 0.774172 | 1 |
TODO Autogenerated method stub | @Override
public void onLowMemory() {
if (mImageFetcher != null) {
mImageFetcher.setPauseWork(true);
mImageFetcher.setExitTasksEarly(true);
mImageFetcher.flushCache();
mImageFetcher.closeCache();
}
super.onLowMemory();
} | {
"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 onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ImageCacheParams cacheParams = new ImageCacheParams(getActivity(),
Constants.IMAGE_CACHE_DIR);
cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of
// app memory
// The ImageFetcher takes care of loading images into our ImageView
// children asynchronously
mImageFetcher = new ImageFetcher(getActivity());
// mImageFetcher.setLoadingImage(R.drawable.empty_photo);
mImageFetcher.addImageCache(
((FragmentActivity) getActivity()).getSupportFragmentManager(),
cacheParams);
lsnb_temp = new ArrayList<NewsBean>();
} | {
"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 onScrollStateChanged(AbsListView view, int scrollState) {
if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_FLING) {
mImageFetcher.setPauseWork(true);
} else {
mImageFetcher.setPauseWork(false);
}
} | {
"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 onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
} | {
"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 onClick(View v) {
if (v.getId() == 100 + 0) {
URL = Constants.SERVER_URL + child.get(group[0]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 1) {
URL = Constants.SERVER_URL + child.get(group[1]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 2) {
URL = Constants.SERVER_URL + child.get(group[2]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 3) {
URL = Constants.SERVER_URL + child.get(group[3]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 4) {
URL = Constants.SERVER_URL + child.get(group[4]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 5) {
URL = Constants.SERVER_URL + child.get(group[5]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
}
} | {
"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 onClick(View v) {
if (v.getId() == 100 + 0) {
URL = Constants.SERVER_URL + child.get(group[0]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 1) {
URL = Constants.SERVER_URL + child.get(group[1]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 2) {
URL = Constants.SERVER_URL + child.get(group[2]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 3) {
URL = Constants.SERVER_URL + child.get(group[3]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 4) {
URL = Constants.SERVER_URL + child.get(group[4]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
} else if (v.getId() == 100 + 5) {
URL = Constants.SERVER_URL + child.get(group[5]);
comNewsAdapter = null;
lsnb = null;
new AsyncLoadNews(lsnb, URL).execute();
}
} | {
"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 onPreExecute() {
pd = ProgressDialogExtend.CreateSiglePDE(getActivity(), null);
pd.show();
} | {
"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 List<NewsBean> doInBackground(Void... params) {
synchronized (this) {
return new ParseXMLUtil().parseNewsXml(ls, url);
}
} | {
"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 onPostExecute(final List<NewsBean> result) {
try {
pd.dismiss();
if (result != null && result.size() != 0) {
lsnb = result;
lsnb_temp.clear();
pageNum = result.get(0).getPageNum();
if (pageNum != null) {
pageSize = Integer.parseInt(pageNum);
}
if (pageSize == 1) {
listView.setPullLoadEnable(false);
} else {
listView.setPullLoadEnable(true);
}
if (comNewsAdapter != null) {
comNewsAdapter.notifyDataSetChanged();
listView.requestLayout();
onLoadStop();
// listView.setSelection(lsnb.size()-pageMax);//设置当前第一行显示的数据
} else {
comNewsAdapter = new ComNewsAdapter(getActivity(),
lsnb, mImageFetcher);
// 此处可取当前时间,为第一次刷新时间
time = System.currentTimeMillis();
curDate = new Date(time);
sdf = new SimpleDateFormat("MM-dd HH:mm");
onLoadStop();
listView.setAdapter(comNewsAdapter);
listView.requestLayout();
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public synchronized void onItemClick(
AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// 感谢上帝在此处帮助了我
if (lsnb == null && lsnb_temp != null
&& lsnb_temp.size() > 0) {
// lsnb.addAll(lsnb_temp);
lsnb = lsnb_temp;
} else if (lsnb == null && lsnb_temp.isEmpty()) {
throw new NullPointerException("[[" + TAG
+ "]]--> NewsListAdatper Is Null !");
}
--arg2;
// 打开文章内容
String link = Constants.SERVER_URL
+ lsnb.get(arg2).getUrl();
String title = lsnb.get(arg2).getTitle();
String id = lsnb.get(arg2).getId();
String location = lsnb.get(arg2).getLocation();
if (BuildConfig.DEBUG) {
Log.d(TAG, "id:" + id);
Log.d(TAG, "title:" + title);
Log.d(TAG, "link:" + link);
Log.d(TAG, "location:" + location);
}
try {
startActivity(new Intent(
(MainActivity) getActivity(),
WebViewActivity.getInstance()
.getClass())
.putExtra("PRE_TITLE", cur_title)
.putExtra("URL", link)
.putExtra("CUR_TITLE", title)
.putExtra("id", id)
.putExtra("location", location));
getActivity().overridePendingTransition(
R.anim.hold_enter, R.anim.fade_out);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
}
}
});
}
} else {
onLoadStop();
Toast toast = Toast.makeText(getActivity(), "网速不给力哦!",
Toast.LENGTH_LONG);
// toast.getView().setBackgroundResource(R.drawable.red_toast_bg);
toast.getView().setPadding(20, 10, 20, 10);
toast.show();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | {
"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 synchronized void onRefresh() {
try {
// 此处可取当前时间,为刷新时间
curDate = new Date(System.currentTimeMillis());
sdf = new SimpleDateFormat("MM-dd HH:mm");
if (System.currentTimeMillis() - time > 500) {
URL = URL.substring(0, URL.lastIndexOf("_") + 1);
URL = URL + "1.xml";
if (lsnb != null) {
lsnb_temp.addAll(lsnb);
lsnb = null;
}
new AsyncLoadNews(lsnb, URL).execute();
} else {
Toast toast = Toast.makeText(getActivity(), "目前是最新数据!",
Toast.LENGTH_LONG);
// toast.getView().setBackgroundResource(R.drawable.red_toast_bg);
toast.getView().setPadding(20, 10, 20, 10);
toast.show();
onLoadStop();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | {
"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 synchronized void onLoadMore() {
try {
// 如果总页数大于当前页码数,加载更多
if (pageSize > curPage) {
URL = URL.substring(0, URL.lastIndexOf("_") + 1);
curPage++;
URL = URL + curPage + ".xml";
new AsyncLoadNews(lsnb, URL).execute();
} else {
listView.setPullLoadEnable(false);
onLoadStop();
Toast toast = Toast.makeText(getActivity(), "数据已经加载完毕!",
Toast.LENGTH_LONG);
// toast.getView().setBackgroundResource(R.drawable.red_toast_bg);
toast.getView().setPadding(20, 10, 20, 10);
toast.show();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | {
"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 |
Only change the selection display. This action will not trigger the actions defined in the Listener. | public void select(int index) {
indirect = true;
combo.select(index);
indirect = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void showSelection () {\n checkWidget();\n if( selectedIndex != -1 ) {\n showItem( getSelection() );\n }\n }",
"private void doSelect() {\n this.setVisible(false);\n }",
"@Override\n\tpublic void selectionChanged(IAction action, ISelection selection) {\n\t}",
"@Override\r\n\tpublic void selectionChanged(IAction action, ISelection selection) {\n\r\n\t}",
"@Override\r\n public void selectionChanged(IAction action, ISelection selection) {\n }",
"public void updateSelection() {\n\t\t\n\t}",
"public void setSelectionChanged(boolean selectionChanged);",
"@Override\n\tpublic void selectionChanged(IAction arg0, ISelection arg1) {\n\n\t}",
"public void selectionChanged(IAction action, ISelection selection) {\n\t\t\r\n\t}",
"public void selectionChanged(IAction action, ISelection selection) {\n\t}",
"public void selectionChanged(Selection selecton) {\r\n }",
"protected void onSelectionPerformed(boolean success) {\n }",
"@DISPID(200)\r\n public void selectionChanged() {\r\n throw new UnsupportedOperationException();\r\n }",
"void selectionModeChanged(SelectionMode mode);",
"public void selectionChanged(IAction action, ISelection selection) {\n\r\n\t}",
"public void selectionChanged(IAction action, ISelection selection) {\n\r\n\t}",
"@Override\n\tpublic void selectionChanged(SelectionChangedEvent arg0) {\n\t\t\n\t}",
"public void selectPressed() {\n\t\tif (edit) {\n\t\t\tdisplayCardHelp = !displayCardHelp;\n\t\t} else {\n\t\t\tSoundPlayer.playSound(SoundMap.MENU_ERROR);\n\t\t}\n\t}",
"@Override\r\n public void valueChanged(ListSelectionEvent e) {\n selectionChanged();\r\n }",
"public boolean forceSelection();",
"@Override\r\n protected void updateView() {\r\n putValue(ActionUtil.SELECTED_KEY,\r\n getActiveView() != null &&\r\n ! getActiveView().isPropertiesPanelVisible()\r\n );\r\n }",
"private void updateStateUiAfterSelection() {\n stageManager.updateStateUi();\n eventBus.publish(EventTopic.DEFAULT, EventType.SELECTED_OBJECT_CHANGED);\n eventManager.fireEvent(EngineEventType.SELECTED_OBJECT_CHANGED);\n }",
"private void changeFrame() {\n\t\t\n\t\tselected.setVisible(!selected.isVisible());\n\t}",
"public void selectionChanged(IAction action, ISelection selection) {\n }",
"public void onSelectionChanged();",
"@Override\r\n\tpublic void selectionChanged(IWorkbenchPart part, ISelection selection) {\n\r\n\t}",
"private void actionSwitchSelect()\r\n\t{\r\n\t\tif (FormMainMouse.isSampleSelectOn)\r\n\t\t{\r\n\t\t\thelperSwitchSelectOff();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\thelperSwitchSelectOn();\r\n\r\n\t\t\t//---- If we can select sample, we can not move it\r\n\t\t\thelperSwitchMoveOff();\r\n\t\t}\r\n\t}",
"private void changeShowSettings(SelectionEvent event) {\r\n //System.out.println(\"Show settings shanged\");\r\n \r\n Set <ShowOption> currentlySelected = event.getAllSelectedItems();\r\n \r\n Set <ShowOption> unselected = new HashSet();\r\n unselected.addAll(previousShowOptions);\r\n unselected.removeAll(currentlySelected);\r\n \r\n Set <ShowOption> newlySelected = new HashSet();\r\n newlySelected.addAll(currentlySelected);\r\n newlySelected.removeAll(previousShowOptions);\r\n \r\n Set <ShowOption> changed = new HashSet();\r\n changed.addAll(newlySelected);\r\n changed.addAll(unselected);\r\n \r\n for (ShowOption showOption : changed) {\r\n showOptions.put(showOption, !showOptions.get(showOption));\r\n } \r\n \r\n \r\n// System.out.println(\"previously selected: \" + previousShowOptions);\r\n// System.out.println(\"unselected: \" + unselected);\r\n// System.out.println(\"newly selected: \" + newlySelected);\r\n //System.out.println(\"changed show options: \" + changed);\r\n \r\n //changeShowStatus(changed);\r\n \r\n // TODO: try with JS feedback\r\n //LoadingIndicator <String> loadingIndicator = new LoadingIndicator(\"Loading 3D views ...\");\r\n //getComponent().getUI().addWindow(loadingIndicator);\r\n sendPlotOptions();\r\n //loadingIndicator.close();\r\n \r\n // the option to show the bar chart is only enabled for the 2D view\r\n if (showOptions.get(ShowOption.THREE_D)) {\r\n showOptionsSelector.setItemEnabledProvider(item -> !item.equals(ShowOption.N));\r\n }\r\n else {\r\n showOptionsSelector.setItemEnabledProvider(item -> true);\r\n }\r\n \r\n previousShowOptions = showOptionsSelector.getValue();\r\n }",
"public void selectionChanged(Action item);",
"public void setButtonSelection(String action);",
"protected void selectionChanged(ITextSelection selection) {}",
"@Override\n public void showContextMenu()\n {\n showContextMenu(selection, View.SELECTION);\n }",
"public void selectionChanged(IStructuredSelection selection) {\r\n\t\t\r\n\t\tsetEnabled(canOperateOn(selection));\r\n\t}",
"@Override\n\tpublic void addSelectionChangeListener(SelectionChangeListener listener) {\n\n\t}",
"public boolean canSelectionChange() {\n return true;\n }",
"public void selectPanel() {\n\t\tthis.displayNumberBlock.setBackground(dispSelected);\n\t}",
"@Override\r\n\tpublic boolean forceSelection() {\r\n\t\treturn false;\r\n\t}",
"@Override\n public void valueChanged(ListSelectionEvent e) {\n currentRow = recordList.getSelectedIndex();\n setRowValues(currentRow, currentColumn);\n if (selectionAction == WAITING_ON_SELECTION) {\n selectionAction = SENDING_SELECTION;\n }\n if (selectionAction == SENDING_SELECTION) {\n selectionAction = FINISHED_SELECTION;\n cellNotifier.select(currentRow, currentColumn); // Notify GUI to select\n }\n \n \n }",
"@Override\r\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"public void changeDisplayContent(int index) {\r\n\t\tsetSelectedIndex(index);\r\n\t\tupdateUI();\r\n\t}",
"@Override\n public void valueChanged(final ListSelectionEvent e) {\n if (e.getValueIsAdjusting()) {\n return;\n }\n showObject();\n }",
"@Override\n public void selectionChanged(IAction action, ISelection selection) {\n if (selection != null) {\n action.setEnabled(true);\n return;\n }\n IJavaElement javaElement = JavaEditorUtils.getCurrentSelectedJaveElement();\n if (JavaEditorUtils.isJavaElementSupported(javaElement) == true) {\n action.setEnabled(true);\n return;\n }\n action.setEnabled(false);\n }",
"protected void updateSelection ()\n {\n // find the selected node\n ConfigTreeNode node = _tree.getSelectedNode();\n\n // update the editor panel\n _epanel.removeChangeListener(ManagerPanel.this);\n try {\n ManagedConfig cfg = (node == null) ? null : node.getConfig();\n _epanel.setObject(cfg);\n _lastValue = (cfg == null) ? null : (ManagedConfig)cfg.clone();\n } finally {\n _epanel.addChangeListener(ManagerPanel.this);\n }\n\n // enable or disable the menu items\n boolean enable = (node != null);\n boolean writeable = !_readOnly;\n _exportConfigs.setEnabled(enable);\n _cut.setEnabled(enable && writeable);\n _copy.setEnabled(enable);\n _delete.setEnabled(enable && writeable);\n _findUses.setEnabled(enable);\n }",
"@Override\n\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\n\t}",
"@Action (selectedProperty = \"selectorVisible\")\n public void toggleSelectorVisible() {\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent selectionEvent) {\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent selectionEvent) {\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent selectionEvent) {\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent selectionEvent) {\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent selectionEvent) {\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent selectionEvent) {\n }",
"private void fireSelectionChangeNotification () {\r\n\t\tif ( selectionChangeListener!=null)\r\n\t\t\tselectionChangeListener.execute();\r\n\t}",
"public void selectionChanged(GraphSelectionEvent gse) {\n if (!updatingSelection) {\n updatingSelection = true;\n List<Fig> selections = gse.getSelections();\n ActionCut.getInstance().setEnabled(\n selections != null && !selections.isEmpty());\n\n // TODO: If ActionCopy is no longer a singleton, how shall\n // this work?\n ActionCopy.getInstance()\n .setEnabled(selections != null && !selections.isEmpty());\n /*\n * ActionPaste.getInstance().setEnabled( Globals.clipBoard\n * != null && !Globals.clipBoard.isEmpty());\n */\n // the old selection\n Collection currentSelection =\n TargetManager.getInstance().getTargets();\n\n List removedTargets = new ArrayList(currentSelection);\n List addedTargets = new ArrayList();\n for (Object selection : selections) {\n Object owner = TargetManager.getInstance().getOwner(selection);\n if (currentSelection.contains(owner)) {\n removedTargets.remove(owner); // remains selected\n } else {\n // add to selection\n addedTargets.add(owner);\n }\n }\n if (addedTargets.size() == 1\n && removedTargets.size() == currentSelection.size()) {\n // Optimize for the normal case to minimize target changes\n TargetManager.getInstance().setTarget(addedTargets.get(0));\n } else {\n for (Object o : removedTargets) {\n TargetManager.getInstance().removeTarget(o);\n }\n for (Object o : addedTargets) {\n TargetManager.getInstance().addTarget(o);\n }\n }\n updatingSelection = false;\n }\n\n }",
"public void selectionChanged(IAction action, ISelection selection) {\r\n\t\tIStructuredSelection structuredSelection = \r\n\t\t\t(IStructuredSelection) selection;\r\n\t\tif(structuredSelection.getFirstElement() instanceof DiagramEditPart \r\n\t\t\t\t&& structuredSelection.getFirstElement() \r\n\t\t\t\tinstanceof OEPCEditPart){\r\n\t\t\tselectedElement = \r\n\t\t\t\t(OEPCEditPart) structuredSelection.getFirstElement();\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void widgetSelected(SelectionEvent arg0) {\n\n\t}",
"public void select(int action) {\n\t\tselected = true;\n\t\tthis.action = action;\n\t}",
"public void setDisplay(boolean val) {\n \tdisplay = val; \n }",
"abstract public void showSelection(Node[] nodes) ;",
"public void beginSelection()\n {\n\tisMultiSelection = true;\n\tsetMaxCheckCount(-1);\n }",
"public void selectedChanged(SelectEvent e) {\n\t\t\t\tm_Report.getStatusBar().repaint();\r\n\t\t\t}",
"private void displayLessonSelectionDialog() {\n\t\tpauseMedia();\n\t\tint requestCode = onLargeScreen ? LessonSelectionDialog.SELECT_TO_CLASS\n\t\t\t\t: LessonSelectionDialog.SELECT_TO_LESSON;\n\t\tlessonSelectionDialog = LessonSelectionDialog.newInstance(\n\t\t\t\tLessonSelectionDialog.CLASS_LESSON_SELECT, requestCode);\n\t\tlessonSelectionDialog.setOnDialogResultListener(this, requestCode);\n\t\tlessonSelectionDialog.show(this.getSupportFragmentManager(),\n\t\t\t\t\"lessonSelectionDialog\");\n\t}",
"public void widgetDefaultSelected(SelectionEvent e) {\n \t\t\t}",
"public void widgetDefaultSelected(SelectionEvent e) {\n \t\t\t}",
"public void widgetDefaultSelected(SelectionEvent e) {\n \t\t\t}",
"public void widgetDefaultSelected(SelectionEvent e) {\n \t\t\t}",
"public void setSelectionChanged(boolean selectionChanged) {\n this.selectionChanged = selectionChanged;\n }",
"public void updateView()\n {\n int selectionCount = selection.getElementSelectionCount();\n\n // If only one item selected, enable & update the\n // text boxes and pull downs with values.\n if (selectionCount == 1) {\n // preserve selected state if a whole text field is selected\n Text text = WindowUtil.getFocusedText();\n boolean restoreSel = false;\n if ((text != null) &&\n (text.getSelectionCount() == text.getCharCount()))\n {\n restoreSel = true;\n }\n\n // get the selected item\n Iterator<FrameElement> iter =\n selection.getSelectedElementsIterator();\n\n // For each selected object, which there is only one.\n FrameElement elt = iter.next();\n\n if (elt instanceof IWidget) {\n IWidget widget = (IWidget) elt;\n\n view.useParameters(FrameEditorView.USE_SINGLE_SELECT);\n view.updateWidgetProperties(widget);\n }\n else if (elt instanceof FrameElementGroup) {\n FrameElementGroup eltGroup = (FrameElementGroup) elt;\n\n view.useParameters(FrameEditorView.USE_GROUP_SELECT);\n view.updateEltGroupProperties(eltGroup);\n }\n\n // Restore the selection state\n if (restoreSel) {\n text.selectAll();\n }\n }\n else if (selectionCount > 1) {\n // TODO: on multi selection, some values are left enabled\n // We need to set these to something or disable them.\n view.useParameters(FrameEditorView.USE_MULTI_SELECT);\n }\n else {\n view.useParameters(FrameEditorView.USE_NONE);\n view.updateFrameProperties(frame, false);\n }\n }",
"public void setSelection(int x, int y) {\n this.selectionX = x;\n this.selectionY = y;\n\n selectionChanged = true;\n }",
"public void updateSelection() {\n\t\tint index = shell.getConnectionsCombo().getSelectionIndex();\n\t\tif (profiles.length == 0 || index < 0 || index >= profiles.length) {\n\t\t\tshell.getLblServerNameValue().setText(\"\");\n\t\t\tshell.getLblServerHostValue().setText(\"\");\n\t\t\tshell.getBtnConnect().setEnabled(false);\n\t\t\treturn;\n\t\t}\n\t\tIConnectionProfile profile = profiles[index];\n\t\tshell.getLblServerNameValue().setText(profile.getName() + \" (\" + profile.getUsername() + \")\");\n\t\tshell.getLblServerHostValue().setText(profile.getIP() + \":\" + profile.getPort());\n\t\tshell.getBtnConnect().setEnabled(true);\n\t}",
"@Override\r\n\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\r\n\t}",
"private void updateSelectionModeView() {\n mSelectionMode.invalidate();\n }",
"@Override\n public void widgetDefaultSelected(SelectionEvent exc) {\n }",
"public void valueChanged (TreeSelectionEvent event)\n {\n updateSelection();\n }",
"@Override\r\n\tpublic void widgetDefaultSelected(SelectionEvent arg0)\r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void seleccionar() {\n\r\n\t\t\t}",
"@Override\n public void showLensCutterSelection() {\n calledMethods.add(\"showLensCutterSelection\");\n }",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void valueChanged(ListSelectionEvent e) {\n if (!ageList.isSelectionEmpty())\n playButton.setEnabled(true);\n }",
"public void updateSelectionMode() {\n final int numSelected = getSelectedCount();\n if ((numSelected == 0) || mDisableCab || !isViewCreated()) {\n finishSelectionMode();\n return;\n }\n if (isInSelectionMode()) {\n updateSelectionModeView();\n } else {\n mLastSelectionModeCallback = new SelectionModeCallback();\n getActivity().startActionMode(mLastSelectionModeCallback);\n }\n }",
"@Override\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\tpublic void selectionChanged(ActionEvent e) {\n\t\tif (dm != null && dm.getRowSelected() >= 0) {\n\t\t\trowList.removeListSelectionListener(rowSelectListener); \n\t\t\t// disable listener temporarily to prevent looping.\n\t\t\t\n\t\t\tint row = dm.getRowSelected();\n\t\t\tint column = dm.getColSelected();\n\t\t\trowElements.get(column).requestFocus();\n\t\t\tfor (int i = 0; i < rowElements.size(); i++) {\n\t\t\t\tString value = dm.getValue(i, row);\n\t\t\t\trowElements.get(i).setText(value);\n\t\t\t}\n\t\t\trowList.setSelectedIndex(row);\n\t\t\trowList.addListSelectionListener(rowSelectListener);\n\t\t}\n\t}",
"@Override\n public void selectItem(String selection) {\n vendingMachine.setSelectedItem(selection);\n vendingMachine.changeToHasSelectionState();\n }",
"public void resetSelectPresentation();",
"public void selectionChanged() {\r\n int fila = menuCursos.tablaCursos.getSelectedRow();\r\n try {\r\n actual=(Cursos) rs.get(fila);\r\n if(actual.getCodigo()!=null){\r\n MostrarRegistro();\r\n menuCursos.botonCursosBorrar.setEnabled(fila != -1);\r\n menuCursos.botonCursosModificar.setEnabled(fila != -1);\r\n }\r\n } catch (Exception e) {\r\n actual = null;\r\n }\r\n }",
"private void SelectionChanged(String type) {\n try {\n VaadinSession.getCurrent().getLockInstance().lock();\n Listeners_Map.values().stream().forEach((filter) -> {\n filter.selectionChanged(type);\n });\n } finally {\n VaadinSession.getCurrent().getLockInstance().unlock();\n busyTask.setVisible(false);\n }\n\n }",
"@Override\r\n\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\r\n\t\t}",
"public void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}",
"public void setSelection(Pair selection);",
"@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t}",
"@Override\r\n\t\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"public void actionPerformed(ActionEvent ae) {\n rb_selection = ae.getActionCommand(); \t \n }",
"private void changedChoiceBox(){\n\t\thideLackUserPermissionsLabel();\n\t\thideShowCheckBoxes();\n\t}",
"@Override\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\r\n\t\t\t}"
] | [
"0.7296136",
"0.7019872",
"0.7019793",
"0.6971958",
"0.69541943",
"0.6902064",
"0.6779351",
"0.6767216",
"0.67014503",
"0.667815",
"0.6666053",
"0.6662956",
"0.6652822",
"0.6612677",
"0.659442",
"0.659442",
"0.6551435",
"0.6387001",
"0.63714886",
"0.63426226",
"0.6338873",
"0.63384414",
"0.633262",
"0.6332372",
"0.63120514",
"0.6302628",
"0.62969106",
"0.62629974",
"0.62579906",
"0.62510234",
"0.6246367",
"0.623518",
"0.6226742",
"0.62033635",
"0.6197996",
"0.6167734",
"0.6159374",
"0.61588466",
"0.6153563",
"0.6151407",
"0.6142315",
"0.6123761",
"0.60971296",
"0.60822225",
"0.60778683",
"0.60727125",
"0.60727125",
"0.60727125",
"0.60727125",
"0.60727125",
"0.60727125",
"0.6057931",
"0.6056582",
"0.60442895",
"0.6031946",
"0.6024555",
"0.6016647",
"0.6015663",
"0.6012571",
"0.6011303",
"0.6002604",
"0.60022855",
"0.60022855",
"0.60022855",
"0.60022855",
"0.5999896",
"0.5998158",
"0.5994774",
"0.5991288",
"0.59836966",
"0.5977053",
"0.5973247",
"0.5970421",
"0.59685886",
"0.5968196",
"0.5964472",
"0.5957195",
"0.5957195",
"0.5957195",
"0.5957195",
"0.5957195",
"0.5957195",
"0.59567565",
"0.59454864",
"0.5943384",
"0.59404576",
"0.5938371",
"0.59375745",
"0.5937169",
"0.59314936",
"0.5931177",
"0.5931177",
"0.5930519",
"0.5929726",
"0.59228027",
"0.5917339",
"0.5916825",
"0.5912313",
"0.5912094",
"0.5912094",
"0.5912094"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
downLoadApk();
//new DownLoadNewVer().execute();
//finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Determines weather or not the device has Telephony capability | public static boolean HasTelephony(Context context){
PackageManager packageManager = context.getPackageManager();
if(packageManager == null){
return false;
}
return packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean hasTelephonyHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(\"android.hardware.telephony\")) {\n Log.d(\"HardwareFeatureTest\", \"Device can make phone calls\");\n return true;\n }\n return false;\n }",
"private boolean m21869m() {\n return this.f16409k.getPackageManager().hasSystemFeature(\"android.hardware.telephony\");\n }",
"public static boolean canSendSMS2(Context context) {\n //возможно, так нужно вызывать?\n try{\n return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);\n\n }\n catch(Exception e) {\n // code that doesn't use telephony features\n return true;\n }\n }",
"public boolean mo38007a() throws Throwable {\n if (!this.f26625a.getPackageManager().hasSystemFeature(\"android.hardware.telephony\")) {\n return true;\n }\n TelephonyManager telephonyManager = (TelephonyManager) this.f26625a.getSystemService(\"phone\");\n if (VERSION.SDK_INT < 29) {\n telephonyManager.getDeviceId();\n } else {\n telephonyManager.getDeviceSoftwareVersion();\n }\n return true;\n }",
"public static boolean canSendSMS(Context context) {\n return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);\n }",
"@SuppressWarnings(\"unused\")\n public static boolean isTelephonyReady(Context context) {\n boolean teleEnable = true;\n\n try {\n TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx(context);\n telephonyManagerEx.hasIccCard(0);\n\n } catch (NullPointerException e) {\n Log.e(TAG, \"TelephonyManager(Ex) is not ready\");\n teleEnable = false;\n }\n\n return teleEnable;\n }",
"private boolean m21865i() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n return telephonyManager.getNetworkOperatorName().equalsIgnoreCase(\"android\");\n }\n return false;\n }",
"boolean hasDevice();",
"boolean isPeripheralAccess();",
"private Boolean getUseMicrophone() {\n return true;\n }",
"boolean hasMobileDeviceConstant();",
"public boolean deviceIsAPhone() {\n TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);\r\n return manager.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE;\r\n }",
"public boolean isTablet() { \n\t \tTelephonyManager telephony = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE); \n\t \tint type = telephony.getPhoneType();\n\t \tif (type == TelephonyManager.PHONE_TYPE_NONE) { return true;} \n\t \t return false; \n\t }",
"boolean hasDeviceId();",
"boolean hasDeviceId();",
"private boolean checkPermission() {\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_PHONE_STATE);\n\n if (result == PackageManager.PERMISSION_GRANTED) {\n return true;\n } else {\n return false;\n }\n }",
"public interface ITelephonyConnectionServiceExt {\n\n /**\n * Check courrent mode is 4G data only mode.\n *\n * @param context from telephony connection service.\n * @param phone is call via by user\n * @return true if in 4G data only mode.\n */\n boolean isDataOnlyMode(Context context, Phone phone);\n}",
"public boolean HasGotSensorCaps()\n {\n PackageManager pm = context.getPackageManager();\n\n // Require at least Android KitKat\n\n int currentApiVersion = Build.VERSION.SDK_INT;\n\n // Check that the device supports the step counter and detector sensors\n\n return currentApiVersion >= 19\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_DETECTOR)\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);\n }",
"public boolean isMobileNetworkEnabled() {\n final NetworkInfo info = mConnectivityManager.getNetworkInfo(\n ConnectivityManager.TYPE_MOBILE);\n return (info != null && info.isConnected());\n }",
"public boolean getUseInfoForDtmf();",
"private boolean isSupportedInternal() {\n boolean z = false;\n synchronized (this.mLock) {\n if (this.mServiceManager == null) {\n Log.e(TAG, \"isSupported: called but mServiceManager is null!?\");\n return false;\n }\n try {\n if (this.mServiceManager.getTransport(IWifi.kInterfaceName, HAL_INSTANCE_NAME) != (byte) 0) {\n z = true;\n }\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Exception while operating on IServiceManager: \" + e);\n return false;\n }\n }\n }",
"boolean hasPhone();",
"public static boolean isNetworkSettingsApkAvailable() {\n // check whether the target handler exist in system\n boolean isVendorNetworkSettingApkAvailable = false;\n IExtTelephony extTelephony = getIExtTelephony();\n try {\n if (extTelephony != null &&\n extTelephony.isVendorApkAvailable(\"com.qualcomm.qti.networksetting\")) {\n isVendorNetworkSettingApkAvailable = true;\n }\n } catch (RemoteException ex) {\n // could not connect to extphone service, launch the default activity\n log(\"couldn't connect to extphone service, launch the default activity\");\n }\n return isVendorNetworkSettingApkAvailable;\n }",
"DeviceCapabilitiesProvider getDeviceCapabilitiesProvider();",
"public static boolean hasModule() {\n\t\ttry {\n\t\t\tPackageManager packageManager = AppMain.getContext().getPackageManager();\n\t\t\tIntent intent = new Intent(\"android.settings.USAGE_ACCESS_SETTINGS\");\n\t\t\tList<ResolveInfo> list = packageManager.queryIntentActivities(intent,\n\t\t\t\tPackageManager.MATCH_DEFAULT_ONLY);\n\t\t\treturn list.size() > 0;\n\t\t} catch (RuntimeException e) {\n\t\t\t// 在某个三星的设备上出现过安全异常\n\t\t\t// 在某个ZTE的设备上出现过RuntimeException\n\t\t\treturn false;\n\t\t}\n\t}",
"public static boolean isImsCallSupport() {\n return MTK_IMS_SUPPORT && MTK_VOLTE_SUPPORT;\n }",
"public static boolean isEnabledData(Context context) {\n TelephonyManager tm =\n (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n return tm == null ? false : (tm.getDataState() != TelephonyManager.DATA_DISCONNECTED);\n }",
"public boolean isTablet();",
"private boolean isSiwtchAccountAllowed(Context context) {\n int cdmaCardNum = 0;\n int gsmCardNum = 0;\n List<PhoneAccountHandle> accountHandles =\n PhoneAccountUtils.getSubscriptionPhoneAccounts(context);\n for (PhoneAccountHandle handle : accountHandles) {\n int subId = Integer.parseInt(handle.getId());\n if (SubscriptionManager.isValidSubscriptionId(subId)) {\n int slotId = SubscriptionManager.getSlotId(subId);\n if (SvlteUiccUtils.getInstance().getSimType(slotId) == SvlteUiccUtils.SIM_TYPE_CDMA\n && TelephonyManagerEx.getDefault().isInHomeNetwork(subId)) {\n cdmaCardNum ++;\n } else if (SvlteUiccUtils.getInstance().getSimType(slotId) ==\n SvlteUiccUtils.SIM_TYPE_GSM) {\n gsmCardNum ++;\n }\n }\n }\n int mainCapabilitySlotId = getMainCapabilitySlotId();\n boolean isGsmCardHasMainCapability = SvlteUiccUtils.getInstance().getSimType(\n mainCapabilitySlotId) == SvlteUiccUtils.SIM_TYPE_GSM;\n if (cdmaCardNum > 0 && gsmCardNum > 0) {\n if (isGsmCardHasMainCapability && isAirplaneModeOn(context)) {\n showAlertToast(context, R.string.can_not_switch_account_temporarily);\n return false;\n }\n\n ITelephonyEx iTelEx = ITelephonyEx.Stub.asInterface(\n ServiceManager.getService(Context.TELEPHONY_SERVICE_EX));\n try {\n if (iTelEx != null && iTelEx.isCapabilitySwitching()) {\n showAlertToast(context, R.string.can_not_switch_account_temporarily);\n return false;\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n Log.d(TAG, \"fail to judge isCapabilitySwitching, RemoteException\");\n }\n\n if (TelecomManager.from(context).isInCall()) {\n showAlertToast(context, R.string.can_not_switch_account_during_call);\n return false;\n }\n\n return true;\n } else {\n return true;\n }\n }",
"private boolean setRadioCapability(Context context, Intent intent) {\n int phoneNum = TelephonyManager.from(context).getPhoneCount();\n int[] phoneRat = new int[phoneNum];\n boolean isSwitchSuccess = true;\n\n PhoneAccountHandle selectedHandle = (PhoneAccountHandle) intent.getParcelableExtra(\n EXTRA_ACCOUNT);\n int subId = Integer.parseInt(selectedHandle.getId());\n int phoneId = SubscriptionManager.getPhoneId(subId);\n\n Log.d(TAG, \"setCapability: \" + phoneId);\n\n String curr3GSim = SystemProperties.get(PROPERTY_3G_SIM, \"\");\n Log.d(TAG, \"current 3G Sim = \" + curr3GSim);\n\n if (curr3GSim != null && !curr3GSim.equals(\"\")) {\n int curr3GSlotId = Integer.parseInt(curr3GSim);\n if (curr3GSlotId == (phoneId + 1)) {\n Log.d(TAG, \"Current 3G phone equals target phone, don't trigger switch\");\n return isSwitchSuccess;\n }\n }\n\n try {\n ITelephony iTel = ITelephony.Stub.asInterface(\n ServiceManager.getService(Context.TELEPHONY_SERVICE));\n ITelephonyEx iTelEx = ITelephonyEx.Stub.asInterface(\n ServiceManager.getService(Context.TELEPHONY_SERVICE_EX));\n\n if (null == iTel || null == iTelEx) {\n Log.e(TAG, \"Can not get phone service\");\n return false;\n }\n\n int currRat = iTel.getRadioAccessFamily(phoneId);\n Log.d(TAG, \"Current phoneRat:\" + currRat);\n\n RadioAccessFamily[] rat = new RadioAccessFamily[phoneNum];\n for (int i = 0; i < phoneNum; i++) {\n if (phoneId == i) {\n Log.d(TAG, \"SIM switch to Phone \" + i);\n if (DialerFeatureOptions.isLteSupport()) {\n phoneRat[i] = RadioAccessFamily.RAF_LTE\n | RadioAccessFamily.RAF_UMTS\n | RadioAccessFamily.RAF_GSM;\n } else {\n phoneRat[i] = RadioAccessFamily.RAF_UMTS\n | RadioAccessFamily.RAF_GSM;\n }\n } else {\n phoneRat[i] = RadioAccessFamily.RAF_GSM;\n }\n rat[i] = new RadioAccessFamily(i, phoneRat[i]);\n }\n if (false == iTelEx.setRadioCapability(rat)) {\n Log.d(TAG, \"Set phone rat fail!!!\");\n isSwitchSuccess = false;\n }\n } catch (RemoteException ex) {\n Log.d(TAG, \"Set phone rat fail!!!\");\n ex.printStackTrace();\n isSwitchSuccess = false;\n }\n Log.d(TAG, \"setRadioCapability isSwitchSuccess = \" + isSwitchSuccess);\n return isSwitchSuccess;\n }",
"public boolean isBluetoothEnabled() {\n BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();\n if (bluetooth == null)\n return false;//\"device not BT capable\";\n return bluetooth.isEnabled();\n }",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean readDeviceInfo() {\n\t\tboolean flag = oTest.readDeviceInfo();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}",
"public static boolean isOpLightCustSupport() {\n return SystemProperties.get(\"ro.cmcc_light_cust_support\").equals(\"1\") &&\n SystemProperties.get(\"ro.mtk_c2k_support\").equals(\"1\");\n }",
"private boolean m30313d() {\n NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.f30042b.getSystemService(\"connectivity\")).getActiveNetworkInfo();\n return activeNetworkInfo != null && activeNetworkInfo.isConnected();\n }",
"private boolean checkDeviceResourcePermissions() {\n // Check if the user agrees to access the microphone\n boolean hasMicrophonePermission = checkPermissions(\n Manifest.permission.RECORD_AUDIO,\n REQUEST_MICROPHONE);\n boolean hasWriteExternalStorage = checkPermissions(\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n REQUEST_EXTERNAL_PERMISSION);\n\n if (hasMicrophonePermission && hasWriteExternalStorage) {\n return true;\n } else {\n return false;\n }\n }",
"boolean hasNetworkSettings();",
"public static boolean isMmsCapable(Context context) {\n\t\tTelephonyManager telephonyManager = (TelephonyManager) context\n\t\t\t\t.getSystemService(Context.TELEPHONY_SERVICE);\n\t\tif (telephonyManager == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tClass<?> partypes[] = new Class[0];\n\t\t\tMethod sIsVoiceCapable = TelephonyManager.class.getMethod(\n\t\t\t\t\t\"isVoiceCapable\", partypes);\n\n\t\t\tObject arglist[] = new Object[0];\n\t\t\tObject retobj = sIsVoiceCapable.invoke(telephonyManager, arglist);\n\t\t\treturn (Boolean) retobj;\n\t\t} catch (java.lang.reflect.InvocationTargetException ite) {\n\t\t\t// Failure, must be another device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (IllegalAccessException iae) {\n\t\t\t// Failure, must be an other device.\n\t\t\t// Assume that it is voice capable.\n\t\t} catch (NoSuchMethodException nsme) {\n\t\t}\n\t\treturn true;\n\t}",
"private boolean isLocationEnabled() {\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n }",
"boolean hasSystemRequest();",
"private boolean checkPhoneStatusOK() {\n return true;\n }",
"boolean hasUserPhone();",
"public boolean WifiAvaible() {\n boolean Wifi = false;\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo[] netInfo = cm.getAllNetworkInfo();\n for (NetworkInfo NI : netInfo) {\n if (NI.getTypeName().equalsIgnoreCase(\"WIFI\")){\n if (NI.isConnected()){\n Wifi = true;\n }\n }\n }\n return Wifi;\n }",
"@VisibleForTesting\n public boolean isSmallBatteryDevice() {\n return ActivityManager.isSmallBatteryDevice();\n }",
"private boolean m21868l() {\n String[] split;\n if (!m21858b(this.f16409k, \"android.permission.INTERNET\")) {\n return false;\n }\n String[] strArr = {\"/system/bin/netcfg\"};\n StringBuilder sb = new StringBuilder();\n try {\n ProcessBuilder processBuilder = new ProcessBuilder(strArr);\n processBuilder.directory(new File(\"/system/bin/\"));\n processBuilder.redirectErrorStream(true);\n InputStream inputStream = processBuilder.start().getInputStream();\n byte[] bArr = new byte[C1245d.f3947iP];\n while (inputStream.read(bArr) != -1) {\n sb.append(new String(bArr));\n }\n inputStream.close();\n } catch (Exception unused) {\n }\n String sb2 = sb.toString();\n if (TextUtils.isEmpty(sb2)) {\n return false;\n }\n for (String str : sb2.split(\"\\n\")) {\n if ((str.contains(\"wlan0\") || str.contains(\"tunl0\") || str.contains(\"eth0\")) && str.contains(\"10.0.2.15\")) {\n return true;\n }\n }\n return false;\n }",
"public boolean hasConnectivityManagedCapability() {\n return ((mNetworkCapabilities & CONNECTIVITY_MANAGED_CAPABILITIES) != 0);\n }",
"public int getSupportedCapabilities(Transport transport) {\n Integer capabilities = supportedCapabilities.get(transport);\n return capabilities == null ? 0 : capabilities;\n }",
"boolean hasSms();",
"private boolean isSupported(Context context, int sensorType) {\n\t\t\tsensorManager =\n\t\t (SensorManager) context\n\t\t .getSystemService(Context.SENSOR_SERVICE);\n\t\t List<Sensor> sensors = sensorManager.getSensorList(sensorType);\n\t\t return sensors.size() > 0;\n\t\t}",
"public boolean hasTransport(Transport transport) {\n return supportedCapabilities.containsKey(transport);\n }",
"private Boolean isDeviceYouWant(BleManager.DiscoveryListener.DiscoveryEvent event) {\n String name = event.device().getName_native();\n if (name.toLowerCase().startsWith(\"polar\")) {\n Log.v(TAG, event.device().getName_native());\n return true;\n }\n return false;\n\n// // Test with prototype BLE device, same repro.\n// byte[] b = event.device().getScanRecord();\n// if (null == b) {\n// return false;\n// }\n// if (b.length < 22) {\n// return false;\n// }\n//\n// byte[] kCompanyIdentifier = new byte[] {(byte)0x01, (byte)0x02, (byte)0x03};\n// byte[] companyIdentifier = new byte[] {b[19], b[20], b[21]};\n// if (Arrays.equals(kCompanyIdentifier, companyIdentifier)){\n// return true;\n// }\n// return false;\n }",
"public Boolean isMSROnline() throws DeviceException;",
"public boolean canRequestPower();",
"private boolean isLocationEnabled() {\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n }",
"@RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)\n public static boolean isWifiAvailable(Context cxt) {\n @NetworkType int netType = getSimpleNetworkType(cxt);\n return (NETWORK_TYPE_WIFI == netType || NETWORK_TYPE_BLUETOOTH_WIFI == netType);\n }",
"private boolean checkDeviceSettings()\n {\n List<String> listPermissionNeeded= new ArrayList<>();\n boolean ret = true;\n for(String perm : permission)\n {\n if(ContextCompat.checkSelfPermission(this,perm)!= PackageManager.PERMISSION_GRANTED)\n listPermissionNeeded.add(perm);\n }\n if(!listPermissionNeeded.isEmpty())\n {\n ActivityCompat.requestPermissions(this,listPermissionNeeded.toArray(new String[listPermissionNeeded.size()]),REQUEST_PERMISSION);\n ret = false;\n }\n\n return ret;\n }",
"static boolean m61447d(Context context) {\n try {\n if (System.getInt(context.getContentResolver(), \"airplane_mode_on\", 0) != 0) {\n return true;\n }\n return false;\n } catch (NullPointerException unused) {\n return false;\n }\n }",
"public boolean getDataOnRoamingEnabled() {\n try {\n return Settings.Secure.getInt(phone.getContext().getContentResolver(), \n Settings.Secure.DATA_ROAMING) > 0;\n } catch (SettingNotFoundException snfe) {\n return false;\n }\n }",
"public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }",
"public boolean isSetDeviceType() {\n return this.DeviceType != null;\n }",
"private boolean isNetWorkConnected()\n {\n boolean connectedOrNot = false;\n\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\n if (activeNetwork != null)\n {\n if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI)\n {\n connectedOrNot = true;\n }\n\n else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE)\n {\n connectedOrNot = true;\n }\n\n }\n\n else\n {\n connectedOrNot = false;\n }\n \n return connectedOrNot;\n }",
"public boolean isIPVoiceCallSupported() {\n\t\tLogger.i(TAG, \"isIPVoiceCallSupported value \" + ipVoiceCall);\n\t\treturn ipVoiceCall;\t\t\t\t\n\t}",
"private boolean isMobileconnected(){\n\t\tConnectivityManager connMgr\n\t\t= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo networkInfo\n\t\t= connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); \n\t\tboolean isMobileConn = networkInfo.isConnected();\n\t\treturn isMobileConn;\n\t}",
"public boolean getDataOnRoamingEnabled() {\n try {\n return Settings.Secure.getInt(phone.getContext().getContentResolver(),\n Settings.Secure.DATA_ROAMING) > 0;\n } catch (SettingNotFoundException snfe) {\n return false;\n }\n }",
"boolean hasPhy();",
"private boolean canStartServer() {\n\n\t\tfinal ConnectivityManager connMgr = (ConnectivityManager) this\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n\t\tfinal android.net.NetworkInfo wifi =\n\n\t\tconnMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n\n\t\tfinal android.net.NetworkInfo mobile = connMgr\n\t\t\t\t.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);\n\n\t\treturn wifi.isAvailable() || mobile.isAvailable();\n\t}",
"boolean onPhone() {\n\t\treturn ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)\n\t\t\t\t< Configuration.SCREENLAYOUT_SIZE_LARGE);\n\t}",
"boolean hasPhoneNumber();",
"public boolean isAccessGranted() {\n try {\n PackageManager packageManager = getPackageManager();\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPackageName(), 0);\n AppOpsManager appOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE);\n int mode;\n assert appOpsManager != null;\n mode = appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n applicationInfo.uid, applicationInfo.packageName);\n return (mode == AppOpsManager.MODE_ALLOWED);\n\n } catch (PackageManager.NameNotFoundException e) {\n return false;\n }\n }",
"public boolean checkCameraHardware(Context context) {\n if(context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {\n return true;\n }\n else {\n return false;\n }\n }",
"public boolean haveNetworkAccess() {\n ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n if (manager != null) {\n NetworkInfo connection = manager.getActiveNetworkInfo();\n if (connection != null && connection.isConnectedOrConnecting()) {\n return true;\n }\n }\n return false;\n }",
"public boolean micEnabled();",
"private boolean checkCameraHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){\n // this device has a camera\n return true;\n } else {\n // no camera on this device\n return false;\n }\n }",
"private boolean checkCameraHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){\n // this device has a camera\n return true;\n } else {\n // no camera on this device\n return false;\n }\n }",
"private boolean checkCameraHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){\n // this device has a camera\n return true;\n } else {\n // no camera on this device\n return false;\n }\n }",
"public boolean isIsPhysicalDevice() {\n return isPhysicalDevice;\n }",
"private boolean checkCameraHardware(Context context) {\r\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){\r\n return true; // Tiene camara\r\n } else {\r\n return false;// No tiene camara\r\n }\r\n }",
"boolean isSMSPromptEnabled();",
"public Boolean isWifiEnabled() {\n return (mask / 2) % 2 == 1;\n }",
"boolean isContactPresenceTaskEnabled();",
"private boolean haveNetworkConnection() {\n boolean haveConnectedWifi = false;\n boolean haveConnectedMobile = false;\n\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo[] netInfo = cm.getAllNetworkInfo();\n for (NetworkInfo ni : netInfo) {\n if (ni.getTypeName().equalsIgnoreCase(\"WIFI\"))\n if (ni.isConnected())\n haveConnectedWifi = true;\n if (ni.getTypeName().equalsIgnoreCase(\"MOBILE\"))\n if (ni.isConnected())\n haveConnectedMobile = true;\n }\n return haveConnectedWifi || haveConnectedMobile;\n }",
"public boolean IsAvailable()\n\t{\n\t\treturn mbHasAccelerometer;\n\t}",
"private boolean isDeviceOnline() {\n ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n return (networkInfo != null && networkInfo.isConnected());\n }",
"public static boolean isCdmaSupport() {\n return \"1\".equals(android.os.SystemProperties.get(\"ro.mtk_c2k_support\"));\n }",
"public static boolean isSupported() {\n\t\tLog.v(\"trace\", \"Checking Vibrator is supported \" + mVibrator.hasVibrator() );\n\t\treturn mVibrator != null && mVibrator.hasVibrator();\n\t}",
"public boolean m6592I() {\n ActivityManager activityManager = (ActivityManager) getSystemService(\"activity\");\n int i = Build.VERSION.SDK_INT;\n if (i >= 23) {\n if (activityManager.getLockTaskModeState() != 0) {\n return true;\n }\n return false;\n } else if (i >= 21) {\n return activityManager.isInLockTaskMode();\n } else {\n return false;\n }\n }",
"private boolean m21863g() {\n TelephonyManager telephonyManager = (TelephonyManager) this.f16409k.getSystemService(\"phone\");\n if (telephonyManager != null) {\n String deviceId = telephonyManager.getDeviceId();\n for (String equalsIgnoreCase : f16398b) {\n if (equalsIgnoreCase.equalsIgnoreCase(deviceId)) {\n return true;\n }\n }\n }\n return false;\n }",
"private boolean checkCameraHardware(Context context) {\n\t if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){\n\t // this device has a camera\n\t Log.d(TAG, \"this device has a camera\");\n\t return true;\n\t } else {\n\t // no camera on this device\n\t Log.d(TAG, \"no camera on this device\");\n\t return false;\n\t }\n\t}",
"@java.lang.Override\n public boolean hasDeviceSettings() {\n return deviceSettings_ != null;\n }",
"public boolean CheckGPS(){\n\n boolean status;\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n status = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n return status;\n }",
"@RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)\n public static boolean isNetworkAvailable(Context cxt) {\n NetworkInfo network = getActiveNetworkInfo(cxt);\n return network != null && network.isConnected();\n }",
"public String getType() {\n return Phone.FEATURE_ENABLE_RCSE;\n }",
"private boolean checkCameraHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {\n // this device has a camera\n return true;\n } else {\n // no camera on this device\n return false;\n }\n }",
"private boolean checkCameraHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {\n // this device has a camera\n return true;\n } else {\n // no camera on this device\n return false;\n }\n }",
"private boolean isDeviceOnline() {\n ConnectivityManager connMgr =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connMgr != null ? connMgr.getActiveNetworkInfo() : null;\n return (networkInfo != null && networkInfo.isConnected());\n }",
"boolean hasTelemetry();",
"public boolean isGivingInformation();",
"private void checkLocationConnection() {\n LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);\n String message = \"\";\n\n // prepare output message to indicate whether location services are enabled\n try {\n message = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) ?\n \"Location Services are enabled!\" :\n \"Location Services are not enabled!\";\n } catch(Exception e) { e.printStackTrace(); }\n\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }",
"boolean hasPingerLoc();",
"private boolean isDeviceOnline() {\n ConnectivityManager connMgr =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n return (networkInfo != null && networkInfo.isConnected());\n }",
"private boolean isDeviceOnline() {\n ConnectivityManager connMgr =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n return (networkInfo != null && networkInfo.isConnected());\n }"
] | [
"0.7540525",
"0.68971205",
"0.6819521",
"0.6802003",
"0.665245",
"0.6547293",
"0.6446512",
"0.6340952",
"0.63336885",
"0.6168149",
"0.61583644",
"0.61538893",
"0.6143716",
"0.6121797",
"0.6121797",
"0.60077065",
"0.5956055",
"0.5924581",
"0.5915969",
"0.5889738",
"0.5843085",
"0.5825772",
"0.58224994",
"0.5788472",
"0.5772738",
"0.5766505",
"0.5732485",
"0.5720009",
"0.57149714",
"0.57139933",
"0.5711302",
"0.5709257",
"0.5708233",
"0.57035476",
"0.5699074",
"0.5694685",
"0.5670912",
"0.5668847",
"0.56679726",
"0.56634134",
"0.56592995",
"0.56553495",
"0.5649743",
"0.5648542",
"0.5644751",
"0.56436217",
"0.56281227",
"0.55879503",
"0.5582839",
"0.557403",
"0.5572011",
"0.55622",
"0.55576825",
"0.5543535",
"0.55412513",
"0.553442",
"0.55323774",
"0.5530936",
"0.55294806",
"0.5529398",
"0.55239236",
"0.551159",
"0.5508323",
"0.5504306",
"0.5503979",
"0.5498744",
"0.54878986",
"0.5475634",
"0.54604334",
"0.5459742",
"0.54518497",
"0.54482156",
"0.54482156",
"0.54482156",
"0.54454976",
"0.5444984",
"0.544215",
"0.5434811",
"0.5433214",
"0.54278964",
"0.54244715",
"0.54097855",
"0.53895706",
"0.5387111",
"0.53857845",
"0.5380658",
"0.5380647",
"0.5374852",
"0.5373666",
"0.5373191",
"0.537021",
"0.5364321",
"0.5364321",
"0.5363145",
"0.53559077",
"0.5352468",
"0.5348126",
"0.53467095",
"0.53456163",
"0.53456163"
] | 0.7801513 | 0 |
Renvoie l'objet Color correspondant a la String passee en parametre | public Color choixCouleur(String s) {
if(s.equals("ROUGE")) return Color.RED;
else if(s.equals("VERT")) return Color.GREEN;
else if(s.equals("BLEU")) return Color.BLUE;
else if(s.equals("ROSE")) return Color.PINK;
else if(s.equals("BLANC")) return Color.WHITE;
else if(s.equals("VIOLET")) return Color.PURPLE;
else if(s.equals("JAUNE")) return Color.YELLOW;
else if(s.equals("ORANGE")) return Color.ORANGE;
else if(s.equals("MARRON")) return Color.BROWN;
else if(s.equals("GRIS")) return Color.GREY;
else if(s.equals("ROUGE")) return Color.RED;
else return Color.BLACK;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setColor(String c);",
"public void set_color(String color){ color_ = GralColor.getColor(color.trim()); }",
"String getColor();",
"public String getColorString();",
"public java.awt.Color colorFromString(String s) {\n if (s.contains(\"RGB\")) {\n String[] parts = s.split(\"\\\\(|\\\\)\");\n String[] parameter = parts[2].split(\",\");\n int r = Integer.parseInt(parameter[0]);\n int g = Integer.parseInt(parameter[1]);\n int b = Integer.parseInt(parameter[2]);\n return new Color(r, g, b);\n }\n if (s.contains(\"color\")) {\n String[] parts = s.split(\"\\\\(|\\\\)\");\n String color = parts[1];\n return colorMap.get(color);\n }\n return null;\n\n }",
"abstract String getColor();",
"public static java.awt.Color colorFromString(String s) {\r\n Color color = null;\r\n s = s.substring(6, s.length() - 1);\r\n if (s.startsWith(\"RGB\")) {\r\n s = s.substring(4, s.length() - 1);\r\n String[] split = s.split(\",\");\r\n int color1 = Integer.parseInt(split[0]);\r\n int color2 = Integer.parseInt(split[1]);\r\n int color3 = Integer.parseInt(split[2]);\r\n color = new Color(color1, color2, color3);\r\n } else {\r\n Field field = null;\r\n try {\r\n field = Class.forName(\"java.awt.Color\").getField(s);\r\n } catch (NoSuchFieldException | SecurityException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n color = (Color) field.get(null);\r\n } catch (IllegalArgumentException e) {\r\n e.printStackTrace();\r\n } catch (IllegalAccessException e) {\r\n e.printStackTrace();\r\n }\r\n// if (s.equals(\"blue\")) {\r\n// return Color.blue;\r\n// } else if (s.equals(\"black\")) {\r\n// return Color.black;\r\n// } else if (s.equals(\"cyan\")) {\r\n// return Color.cyan;\r\n// } else if (s.equals(\"gray\")) {\r\n// return Color.gray;\r\n// } else if (s.equals(\"lightGray\")) {\r\n// return Color.lightGray;\r\n// } else if (s.equals(\"green\")) {\r\n// return Color.green;\r\n// } else if (s.equals(\"orange\")) {\r\n// return Color.orange;\r\n// } else if (s.equals(\"pink\")) {\r\n// return Color.pink;\r\n// } else if (s.equals(\"red\")) {\r\n// return Color.red;\r\n// } else if (s.equals(\"white\")) {\r\n// return Color.white;\r\n// } else if (s.equals(\"yellow\")) {\r\n// return Color.yellow;\r\n// }\r\n }\r\n return color;\r\n }",
"Color(String text) {\n this.text = text;\n }",
"public String seeColor(String str) {\r\n if (str.startsWith(\"red\")) {\r\n return \"red\";\r\n }\r\n if (str.startsWith(\"blue\")) {\r\n return \"blue\";\r\n }\r\n\r\n return \"\";\r\n }",
"public static\n Color convertStringToColor(String val)\n {\n Color ret_Color;\n\n try\n {\n String workstr1;\n int slen = val.length();\n if (val.startsWith(\"0x\") || val.startsWith(\"0X\"))\n {\n workstr1 = val.substring(2);\n slen -= 2;\n }\n else\n if (val.startsWith(\"#\"))\n {\n workstr1 = val.substring(1);\n slen -= 1;\n }\n else\n { // decimal integer\n return new Color(Integer.parseInt(val));\n }\n\n // process hex string\n if (slen <= 6)\n { // no alpha\n int ival = Integer.parseInt(workstr1, 16);\n ret_Color = new Color(ival);\n }\n else\n { // has alpha of some sort\n String workstr2;\n if (slen == 8)\n {\n workstr2 = workstr1;\n }\n else\n if (slen == 7)\n {\n workstr2 = \"0\" + workstr1;\n }\n else\n {\n workstr2 = workstr1.substring(slen - 8); // get rightmost 8\n }\n\n // System.out.println(\"Color,val=[\" + val + \"],key=[\" + key + \"],slen=\" + slen + \"]\");\n // System.out.println(\" workstr1=[\" + workstr1 + \"],workstr2=[\" + workstr2 + \"]\");\n int a = Integer.parseInt(workstr2.substring(0, 2), 16); // a\n int r = Integer.parseInt(workstr2.substring(2, 4), 16); // r\n int g = Integer.parseInt(workstr2.substring(4, 6), 16); // g\n int b = Integer.parseInt(workstr2.substring(6, 8), 16); // b\n // System.out.println(\" ret_Color1=[\" + r + \":\" + g + \":\" + b +\":\" + a + \"]\");\n // int ival = Integer.parseInt(workstr2, 16);\n // ret_Color = new Color(ival, true);\n // System.out.println(\" ival=\" + ival);\n try {\n ret_Color = new Color(r, g, b, a);\n }\n catch (NoSuchMethodError excp1) {\n System.out.println(\"YutilProperties:convertStringToColor|excp1=[\" + excp1 + \"]\");\n ret_Color = new Color(r, g, b);\n }\n // System.out.println(\" ret_Color1=[\" + ret_Color + \"]\");\n }\n }\n catch(NumberFormatException e)\n {\n ret_Color = Color.black;\n // System.out.println(\"Color,ret_Color3=[\" + ret_Color + \"]\");\n }\n\n return ret_Color;\n }",
"public Piezas(String color) {\r\n this.color = color;\r\n }",
"private static TextColor colorString(String color) {\n if (color.toLowerCase().trim().startsWith(\"#\")) {\n // pass this for now.\n }\n switch (color.toLowerCase().trim()) {\n case \"blue\":\n case \"&9\":\n return TextColors.BLUE;\n case \"dark_blue\":\n case \"dark blue\":\n case \"&1\":\n return TextColors.DARK_BLUE;\n case \"dark red\":\n case \"dark_red\":\n case \"&4\":\n return TextColors.DARK_RED;\n case \"red\":\n case \"&c\":\n return TextColors.RED;\n case \"reset\":\n case \"&r\":\n return TextColors.RESET;\n case \"gold\":\n case \"&6\":\n return TextColors.GOLD;\n case \"yellow\":\n case \"&e\":\n return TextColors.YELLOW;\n case \"dark_green\":\n case \"dark green\":\n case \"&2\":\n return TextColors.DARK_GREEN;\n case \"green\":\n case \"lime\":\n case \"&a\":\n return TextColors.GREEN;\n case \"aqua\":\n case \"&b\":\n return TextColors.AQUA;\n case \"dark_aqua\":\n case \"dark aqua\":\n case \"&3\":\n return TextColors.DARK_AQUA;\n case \"light_purple\":\n case \"light purple\":\n case \"pink\":\n case \"%d\":\n return TextColors.LIGHT_PURPLE;\n case \"dark_purple\":\n case \"dark purple\":\n case \"purple\":\n case \"magenta\":\n case \"&5\":\n return TextColors.DARK_PURPLE;\n case \"white\":\n case \"&f\":\n return TextColors.WHITE;\n case \"gray\":\n case \"grey\":\n case \"&7\":\n return TextColors.GRAY;\n case \"dark_grey\":\n case \"dark_gray\":\n case \"dark gray\":\n case \"dark grey\":\n case \"&8\":\n return TextColors.DARK_GRAY;\n case \"black\":\n case \"&0\":\n return TextColors.BLACK;\n default:\n return TextColors.NONE;\n }\n }",
"private String comprobarColor(String color) {\r\n String colores[] = { \"blanco\", \"negro\", \"rojo\", \"azul\", \"gris\" };\r\n boolean encontrado = false;\r\n for (int i = 0; i < colores.length && !encontrado; i++) {\r\n if (colores[i].equals(color)) {\r\n encontrado = true;\r\n }\r\n }\r\n if (encontrado) {\r\n this.color = color;\r\n } else {\r\n this.color = COLOR_POR_DEFECTO;\r\n }\r\n return this.color;\r\n }",
"public static int parseColor(String str) {\n if (!TextUtils.isEmpty(str)) {\n if (str.startsWith(DXBindingXConstant.SINGLE_QUOTE) || str.startsWith(\"\\\"\")) {\n str = str.substring(1, str.length() - 1);\n }\n int parseColor = Color.parseColor(str);\n return Color.argb(255, Color.red(parseColor), Color.green(parseColor), Color.blue(parseColor));\n }\n throw new IllegalArgumentException(\"Unknown color\");\n }",
"public void setColor(String newColor){\n invalidate();\n // Comprobar si el valor del color o el nombre del patrón\n if(newColor.startsWith(\"#\")){\n paintColor = Color.parseColor(newColor);\n drawPaint.setColor(paintColor);\n drawPaint.setShader(null);\n }\n else{\n int patternID = getResources().getIdentifier(newColor, \"drawable\", \"com.example.drawingfun\");\n // decodifica los colores\n Bitmap patternBMP = BitmapFactory.decodeResource(getResources(), patternID);\n BitmapShader patternBMPshader = new BitmapShader(patternBMP,\n Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);\n drawPaint.setColor(0xFFFFFFFF);\n drawPaint.setShader(patternBMPshader);\n }\n }",
"public String getColor(){\r\n return color;\r\n }",
"private @NotNull Color parseColor (@NotNull String classColorString, @NotNull Color defaultColor)\n {\n try\n {\n if (classColorString != null)\n {\n return new Color ((int) Long.parseLong (classColorString, 16));\n }\n }\n catch (NumberFormatException e)\n {\n // ignore\n }\n return defaultColor;\n }",
"public Color stringToColor (String sColor, Color cDefault)\r\n\t{\r\n\tInteger iRgb;\r\n\t\r\n\tif ((sColor == null)\r\n\t|| (sColor.charAt (0) != '#')\r\n\t|| (sColor.length () != 7))\r\n\t\t{\r\n\t\treturn (cDefault);\r\n\t\t}\r\n\t\t\r\n\ttry\r\n\t {\r\n\t iRgb = Integer.valueOf (sColor.substring (1,7), 16);\r\n\t return (new Color (iRgb.intValue ()));\r\n\t }\r\n\tcatch (Exception e)\r\n\t {\r\n\t return (cDefault);\r\n\t }\r\n\t}",
"public void setColor(String color) {\n this.color=color; //el this se coloca a la propiedad de la clase \n // para diferenciarla del parametro\n }",
"@Override\r\n\tpublic Color getColor(String color) {\n\t\tif(color==null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//是否是red类型\r\n\t\tif(color.equalsIgnoreCase(\"RED\")) {\r\n\t\t\treturn new Red();\r\n\t\t}else if(color.equalsIgnoreCase(\"GREEN\")) {\r\n\t\t\treturn new Green();\r\n\t\t}else if(color.equalsIgnoreCase(\"BLUE\")) {\r\n\t\t\treturn new Blue();\r\n\t\t}\r\n\t\t//都没返回类型时,返回null\r\n\t\treturn null;\r\n\t}",
"abstract public String getColor();",
"abstract public String getColor();",
"public Color getColor(final String colorString) {\n \t\treturn new Color(Integer.parseInt(colorString.substring(1), 16));\n \t}",
"public void setColor(String color){\n this.color = color;\n }",
"public void cambia_color(String color) {\n\t\tif (color.equals(\"azul\")||color.equals(\"rojo\")) {\n\t\t\tthis.color=color;\n\t\t}else {\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null,\"color incorrecto\");\n\t\t\t\n\t\t}\n\t\t \n\t\t \n\t\t\n\t\t}",
"public String getColor() { \n return color; \n }",
"public void setColor(String c)\n { \n color = c;\n draw();\n }",
"public String getColor() {\n\t\treturn \"Elcolor del vehiculo es: \"+color; \n\t }",
"String getColour();",
"static Color getColor(String colorString) {\n if (ArgumentCheckUtil.isNullOrEmptyString(colorString)) {\n return Color.LIGHT_GRAY;\n } else if (colorString.toLowerCase().equals(\"white\")) {\n return Color.WHITE;\n } else if (colorString.toLowerCase().equals(\"lightgray\")) {\n return Color.LIGHT_GRAY;\n } else if (colorString.toLowerCase().equals(\"gray\")) {\n return Color.GRAY;\n } else if (colorString.toLowerCase().equals(\"darkgray\")) {\n return Color.DARK_GRAY;\n } else if (colorString.toLowerCase().equals(\"black\")) {\n return Color.BLACK;\n } else if (colorString.toLowerCase().equals(\"red\")) {\n return Color.RED;\n } else if (colorString.toLowerCase().equals(\"pink\")) {\n return Color.PINK;\n } else if (colorString.toLowerCase().equals(\"orange\")) {\n return Color.ORANGE;\n } else if (colorString.toLowerCase().equals(\"yellow\")) {\n return Color.YELLOW;\n } else if (colorString.toLowerCase().equals(\"green\")) {\n return Color.GREEN;\n } else if (colorString.toLowerCase().equals(\"magenta\")) {\n return Color.MAGENTA;\n } else if (colorString.toLowerCase().equals(\"cyan\")) {\n return Color.CYAN;\n } else if (colorString.toLowerCase().equals(\"blue\")) {\n return Color.BLUE;\n } else if (colorString.toLowerCase().equals(\"light_gray\")) {\n return Color.LIGHT_GRAY;\n } else if (colorString.toLowerCase().equals(\"dark_gray\")) {\n return Color.DARK_GRAY;\n } else if (colorString.startsWith(\"#\") && colorString.length() == 7) {\n // for #RRGGBB format\n try {\n return new Color(Integer.parseInt(colorString.substring(1, 3), 16), Integer.parseInt(colorString\n .substring(3, 5), 16), Integer.parseInt(colorString.substring(5), 16));\n } catch (NumberFormatException e) {\n return Color.LIGHT_GRAY;\n }\n } else {\n return Color.LIGHT_GRAY;\n }\n }",
"public void setColor(String color) {\r\n this.color = color;\r\n }",
"public S<T> color(String color){\n\t\t\n\t\ttry{\n\t\t\tint c = Color.parseColor(color);\n\t\t\tcolor(c);\n\t\t}catch(IllegalArgumentException ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\treturn this;\n\t}",
"public ColouredString(String string) {\n this.content = string;\n }",
"public ColouredString(ColourPair color, String content) {\n this.colour = color;\n this.content = content;\n }",
"public String getColor(){\n return this.color;\n }",
"public void setColor(String pColor){\n this._color=pColor;\n }",
"public void setColor(String color) {\r\n this.color = color;\r\n }",
"@Override\n public Color getWebColor(String webColor) {\n return new Style.Color(webColor);\n }",
"public String getColorFromAsString() {\n\t\treturn getValue(Property.COLOR_FROM, SankeyDataset.DEFAULT_COLOR_FROM);\n\t}",
"public void setColor(String color) {\n this.color = color;\n }",
"public void setColor(String color) {\n this.color = color;\n }",
"public void setColor(String color) {\n this.color = color;\n }",
"public void setColor(String color) {\n this.color = color;\n }",
"public void setColor(String color) {\n this.color = color;\n }",
"public void setColor(String color) {\n this.color = color;\n }",
"private static Color colorParse(String colorString)\n\t{\n\t\tString[] parts = colorString.split(\"\\\\Q,\\\\E\");\n\t\treturn new Color(Integer.parseInt(parts[0]),Integer.parseInt(parts[1]),Integer.parseInt(parts[2]));\n\t}",
"Color userColorChoose();",
"Integer getTxtColor();",
"private static int getTextColor(String s, int start) {\n int j = getValidStrPos(s, start, \"color\", 10);\n if (j < 0) {\n return COLOR_NONE;\n }\n //color 排除background-color bgcolor\n if (j > start + 5 && ((s.charAt(j - 6) == '-') || (s.charAt(j - 6) == 'g'))) {\n return COLOR_NONE;\n }\n\n while (j < s.length() - 3) {\n if (s.charAt(j) == '=') {\n while (j < (s.length() - 3) && s.charAt(j) != '\\\"') {\n j++;\n }\n\n if (s.charAt(j) == '\\\"') {\n start = j + 1;\n while (start < s.length()\n && s.charAt(start) != '\\\"'\n && s.charAt(start) != ' '\n && s.charAt(start) != '\\n') {\n start++;\n }\n\n return getHtmlColor(j + 1, start, s);\n }\n\n return -1;\n } else if (s.charAt(j) == ':') {\n j++;\n while (j < s.length() - 3 && (s.charAt(j) == ' ' || s.charAt(j) == '\\n')) {\n j++;\n }\n\n start = j + 1;\n while (start < s.length()\n && s.charAt(start) != ';'\n && s.charAt(start) != ' '\n && s.charAt(start) != '\\n'\n && s.charAt(start) != '\\\"') {\n start++;\n }\n\n return getHtmlColor(j, start, s);\n } else {\n if (s.charAt(j) == '\\\"') {\n return COLOR_NONE;\n }\n j++;\n }\n }\n\n return COLOR_NONE;\n }",
"public void setColor(String color) \n\t{\n\t\tthis.color = color;\n\t}",
"public void setForegroundColor(String colorString)\r\n {\r\n/* if(colorString.equals(\"red\"))\r\n graphic.setColor(Color.red);\r\n else if(colorString.equals(\"black\"))\r\n graphic.setColor(Color.black);\r\n else if(colorString.equals(\"blue\"))\r\n graphic.setColor(Color.blue);\r\n else if(colorString.equals(\"yellow\"))\r\n graphic.setColor(Color.yellow);\r\n else if(colorString.equals(\"green\"))\r\n graphic.setColor(Color.green);\r\n else if(colorString.equals(\"magenta\"))\r\n graphic.setColor(Color.magenta);\r\n else if(colorString.equals(\"white\"))\r\n graphic.setColor(Color.white);\r\n else if(colorString.equals(\"cyan\"))\r\n graphic.setColor(Color.cyan);\r\n else\r\n graphic.setColor(Color.black); */\r\n }",
"abstract Color linkColor(String link);",
"public void setColor(String color) {\n if (color == null) {\n this.color = Color.black;\n } try {\n this.color = Color.decode(color);\n } catch (NumberFormatException nfe) {\n try {\n final Field f = Color.class.getField(color);\n this.color = (Color) f.get(null);\n } catch (Exception e) {\n this.color = Color.black;\n }\n }\n }",
"public Color getColor(String key) {\r\n String cs = getString(key);\r\n cs.trim();\r\n int i1 = cs.indexOf(','), i2 = cs.lastIndexOf(',');\r\n if (i1 != i2) {\r\n try {\r\n int r = Integer.decode(cs.substring(0, i1).trim()).intValue();\r\n int g = Integer.decode(cs.substring(i1 + 1, i2).trim()).intValue();\r\n int b = Integer.decode(cs.substring(i2 + 1).trim()).intValue();\r\n\r\n return new Color(r, g, b);\r\n }\r\n catch (Exception e) {}\r\n }\r\n\r\n return null;\r\n }",
"public void setColor(String color) {\n if (color.equals(\"blanc\") ||\r\n color.equals(\"blue\")) {\r\n this.color = color;\r\n } else {\r\n System.err.println(\"bad color\");\r\n }\r\n }",
"public void setColor(String color){\n\t\tcolor = this.color;\n\t}",
"public void color(Color the_color) {\n \n }",
"public String getColor(){\n return this._color;\n }",
"@Override\n\tpublic IColor getColor(String color) {\n\t\treturn null;\n\t}",
"public String getColor(){\n\t\treturn color;\n\t}",
"Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }",
"@Override\n public void onColorChange(int color) {\n int r = Color.red(color);\n int g = Color.green(color);\n int b = Color.blue(color);\n Log.w(\"CameraEngineActivity\", \"R:\" + r + \" G:\" + g + \" B:\" + b);\n colorText.setBackgroundColor(color);\n }",
"public void setColor (String color)\n\t{\n\t\ttry {\n\t\t\tField f = Color.class.getField(color);\n\t\t\tthis.setColor((Color)f.get(null));\n\t\t}\n\t\tcatch (Exception e1)\n\t\t{\n\t\t\ttry {\n\t\t\t\tthis.color = Color.decode(color);\n\t\t\t}\n\t\t\tcatch (Exception e2) {\n\t\t\t\te1.printStackTrace();\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"protected String comprobarColor(Colores color){\r\n if(getColor() == Colores.AZUL | getColor() == Colores.BLANCO | getColor() == Colores.GRIS | getColor() == Colores.NEGRO\r\n | getColor() == Colores.ROJO){\r\n return \"Color correcto\";\r\n }\r\n else{\r\n return \"Color erroneo\";\r\n }\r\n }",
"public String getColor()\n {\n return color;\n }",
"public String getColor()\n {\n return color;\n }",
"public String getColor() {\r\n return color;\r\n }",
"@Override\n\tpublic void setColor(String color) {\n\t\tthis.color=color;\n\t}",
"public\n static\n String convertColorToString(Color val)\n {\n String ret_String;\n\n int a;\n try {\n a = val.getAlpha();\n }\n catch (NoSuchMethodError excp) {\n System.out.println(\"YutilProperties:convertColorToString:excp=[\" + excp + \"]\");\n a = 0xFF;\n }\n int r = val.getRed(), g = val.getGreen(), b = val.getBlue();\n String as, rs, gs, bs;\n\n rs = Integer.toHexString(r); if (rs.length() == 1) rs = \"0\" + rs;\n gs = Integer.toHexString(g); if (gs.length() == 1) gs = \"0\" + gs;\n bs = Integer.toHexString(b); if (bs.length() == 1) bs = \"0\" + bs;\n\n if (a == 0xFF)\n {\n ret_String = \"#\" + rs + gs + bs;\n }\n else\n {\n as = Integer.toHexString(a); if (as.length() == 1) as = \"0\" + as;\n ret_String = \"#\" + as + rs + gs + bs;\n } \n\n return ret_String;\n }",
"public void setColor(String color) {\r\n\t\tthis.color = color;\r\n\t}",
"@NoProxy\n @NoWrap\n public void setColor(final String val) {\n color = val;\n }",
"public void setColor(String newColor)\n {\n invalidate();\n paintColor = Color.parseColor(newColor);\n drawPaint.setColor(paintColor);\n }",
"String carsFromColor(String color);",
"public void setColor(String color) {\n\t\tthis.color = color;\n\t}",
"public void setColor(String color) {\n\t\tthis.color = color;\n\t}",
"public static String color(String textToTranslate){\n\t\tif (textToTranslate == null) return null;\n\t\tif (!textToTranslate.contains(\"&\")) return textToTranslate;\n\t\tchar[] b = textToTranslate.toCharArray();\n\t\tfor (int i = 0; i < b.length - 1; i++) {\n\t\t\tif ((b[i] == '&') && (\"0123456789AaBbCcDdEeFfKkLlMmNnOoRr\".indexOf(b[(i + 1)]) > -1)){\n\t\t\t\tb[i] = Shared.COLOR;\n\t\t\t\tb[(i + 1)] = Character.toLowerCase(b[(i + 1)]);\n\t\t\t}\n\t\t}\n\t\treturn new String(b);\n\t}",
"public static Color colorStringToColor(String color) throws NoSuchFieldException {\r\n\t\tField field;\r\n\t\ttry {\r\n\t\t\tfield = Color.class.getField(color.toLowerCase());\r\n\t\t\treturn (Color) field.get(null);\r\n\t\t} catch (IllegalAccessException | IllegalArgumentException e) {\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t}",
"Color getColor();",
"Color getColor();",
"Color getColor();",
"Color getColor();",
"Color getColor();",
"public void setCombi(String s) throws BadFormatException, BadColorException{\r\n //Cut the string into the colors\r\n ArrayList<String> colors = new ArrayList<String>(Arrays.asList(s.split(\"\\\\+\")));\r\n\r\n //Remove empty Strings\r\n for (int i = 0; i < colors.size(); i++)\r\n if (colors.get(i).length() == 0)\r\n colors.remove(i--);\r\n\r\n //Check if we have the right amount of colors\r\n if (colors.size() != COMBI_LENGTH)\r\n throw new BadFormatException();\r\n\r\n //Transform the Strings into Colors\r\n for (int i = 0; i < COMBI_LENGTH; i++){\r\n\r\n combi[i] = Colors.getColor(colors.get(i));\r\n\r\n //Throws exception if it was a bas color name\r\n if (combi[i] == Colors.EMPTY)\r\n throw new BadColorException();\r\n }\r\n }",
"@Override\n public String getColor() {\n return this.color;\n }",
"java.awt.Color getColor();",
"public Pawn(String color){\r\n this.color=color; \r\n }",
"@Override\n\tpublic Color getColor(String colorType) {\n\t\t\n\t\tif(colorType == null){\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(colorType.equalsIgnoreCase(\"RED\")){\n\t\t\treturn new Red();\n\t\t} else if(colorType.equalsIgnoreCase(\"GREEN\")){\n\t\t\treturn new Green();\n\t\t} else if(colorType.equalsIgnoreCase(\"Blue\")){\n\t\t\treturn new Blue();\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}",
"public String obtenColor() {\r\n return color;\r\n }",
"public static Color valueOf(String s) {\n Matcher m = THREE_DIGIT_PATTERN.matcher(s);\n if (m.matches()) {\n return new Color(Integer.parseInt(m.group(1), 16) * 0x11,\n Integer.parseInt(m.group(2), 16) * 0x11,\n Integer.parseInt(m.group(3), 16) * 0x11);\n }\n m = SIX_DIGIT_PATTERN.matcher(s);\n if (m.matches()) {\n return new Color(Integer.parseInt(m.group(1), 16),\n Integer.parseInt(m.group(2), 16),\n Integer.parseInt(m.group(3), 16));\n }\n Color color = KEYWORD_MAP.get(s);\n if (color != null) {\n return color;\n }\n throw new IllegalArgumentException(\"Can't parse \\\"\" + s\n + \"\\\" as a CSS color.\");\n }",
"@Override\n\tpublic void setColor(String color) {\n\t\tthis.color = color;\n\t}",
"@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}",
"Color(Scalar s) {\n setScalar(s);\n }",
"private void parseColors(String colors){\n String pattern = \"#([A-F0-9]||[a-f0-9]){6}\";\n if (colors.matches(pattern)){\n paint.setColor(Color.parseColor(colors));\n return;\n }\n pattern = \"rgb\\\\(\\\\d\\\\d?\\\\d?,\\\\d\\\\d?\\\\d?,\\\\d\\\\d?\\\\d?\\\\)\";\n if (!colors.matches(pattern)) return;\n\n colors = colors.substring(4);\n\n int r = Integer.parseInt(colors.substring(0,colors.indexOf(',')));\n if (r > 255) return;\n\n colors = colors.substring(colors.indexOf(',') + 1);\n\n int g = Integer.parseInt(colors.substring(0,colors.indexOf(',')));\n if (g > 255) return;\n\n int b = Integer.parseInt(colors.substring(colors.indexOf(',') + 1, colors.length()-1));\n if (b > 255) return;\n\n paint.setColor(Color.argb(255, r, g, b));\n\n }",
"public void setColour(String c)\n\t{\n\t\tcolour = c;\n\t}",
"public static String toColor(String s) {\n\t\treturn ChatColor.translateAlternateColorCodes('&', s);\n\t}",
"public static void main(String[] args) {\n\t\tString x = \"rgb(40, 116, 240)\";\r\n\t\tString[] ar1 = {\"(\",\")\",\",\"};\r\n\t\tfor (int i = 0; i < ar1.length; i++) {\r\n\t\t\tx = x.replace(ar1[i], \" \");\t\t\r\n\t\t}\r\n\t\t\r\n\t\tString[] ans = x.split(\" \");\r\n\t\tint color = Integer.parseInt(ans[ans.length-1]);\r\n\t\tif(color>133 && color<250){\r\n\t\t\tSystem.out.println(\"The Text color is BLUE\");\r\n\t\t}\r\n\t\tSystem.out.println(color);\r\n\t}",
"abstract Color nodeColor(String node);",
"public Paint convertToPaint(String str) {\r\n\t\tswitch (str) {\r\n\t\tcase(\"BLU\"): return Color.BLUE; \r\n\t\tcase(\"YEL\"): return Color.YELLOW;\r\n\t\tcase(\"BLA\"): return Color.BLACK;\r\n\t\tcase(\"RED\"): return Color.RED;\r\n\t\tcase(\"BRO\"): return Color.BROWN;\r\n\t\tcase(\"GRE\"): return Color.GREEN;\r\n\t\tcase(\"WHI\"): return Color.WHITE;\r\n\t\tcase(\"PUR\"): return Color.PURPLE;\r\n\t\tcase(\"PIN\"): return Color.PINK;\r\n\t\tcase(\"TEA\"): return Color.TEAL;\r\n\t\tcase(\"GRA\"): return Color.GRAY;\r\n\t\tcase(\"VIO\"): return Color.VIOLET;\r\n\t\tdefault: throw new UnsupportedOperationException(\"Why is the string not a valid paint?\");\r\n\t\t}\r\n\t}",
"protected static String getColouredString(final String colour, final String line) {\n String res = null;\n if (colour.length() < 3) {\n int num;\n \n try {\n num = Integer.parseInt(colour);\n } catch (NumberFormatException ex) {\n num = -1;\n }\n \n if (num >= 0 && num <= 15) {\n res = String.format(\"%c%02d%s%1$c\", Styliser.CODE_COLOUR, num, line);\n }\n } else if (colour.length() == 6) {\n try {\n Color.decode('#' + colour);\n res = String.format(\"%c%s%s%1$c\", Styliser.CODE_HEXCOLOUR, colour, line);\n } catch (NumberFormatException ex) { /* Do Nothing */ }\n }\n \n if (res == null) {\n res = String.format(\"%c%02d%s%1$c\", Styliser.CODE_COLOUR, 14, line);\n }\n return res;\n }",
"public void setColor(String color) {\r\n color = color.toLowerCase();\r\n switch (color) {\r\n case \"red\":\r\n this.c = Color.RED;\r\n break;\r\n case \"blue\":\r\n this.c = Color.BLUE;\r\n break;\r\n case \"green\":\r\n this.c = Color.GREEN;\r\n break;\r\n case \"yellow\":\r\n this.c = Color.YELLOW;\r\n break;\r\n default:\r\n this.c = Color.COLORLESS;\r\n break;\r\n }\r\n }"
] | [
"0.73979235",
"0.73011035",
"0.7248116",
"0.72088754",
"0.7115448",
"0.7110303",
"0.707938",
"0.70585144",
"0.6966418",
"0.68594825",
"0.683967",
"0.67895025",
"0.6750269",
"0.6729635",
"0.66942334",
"0.66722894",
"0.6637339",
"0.66357714",
"0.66224813",
"0.6603873",
"0.65941036",
"0.65941036",
"0.6587268",
"0.657875",
"0.6571853",
"0.65549266",
"0.65125877",
"0.650577",
"0.6493128",
"0.6445839",
"0.64457554",
"0.6434292",
"0.6426699",
"0.6424738",
"0.64051664",
"0.6401509",
"0.6389159",
"0.63769144",
"0.6355551",
"0.6345899",
"0.6345899",
"0.6345899",
"0.6345899",
"0.6345899",
"0.6345899",
"0.63433003",
"0.6325987",
"0.6316682",
"0.63128316",
"0.63076603",
"0.62929887",
"0.6287649",
"0.62779814",
"0.6273777",
"0.62648726",
"0.626184",
"0.6260239",
"0.62570864",
"0.62514055",
"0.62447023",
"0.624316",
"0.6234303",
"0.62331736",
"0.6230274",
"0.6223066",
"0.6223066",
"0.6211354",
"0.6208684",
"0.62045336",
"0.6201337",
"0.6200044",
"0.6193889",
"0.619298",
"0.61866426",
"0.61866426",
"0.61862516",
"0.61843634",
"0.6180286",
"0.6180286",
"0.6180286",
"0.6180286",
"0.6180286",
"0.61698776",
"0.6166556",
"0.6158621",
"0.6151042",
"0.6150956",
"0.6147768",
"0.6145356",
"0.6143636",
"0.61386436",
"0.61359227",
"0.6133594",
"0.61280215",
"0.61205876",
"0.61184585",
"0.61086",
"0.6099092",
"0.6096958",
"0.60949105"
] | 0.6320764 | 47 |
MODIFIES: this EFFECTS: spawn new enemy in the game | public void spawn(Integer spawnSize) {
for (Integer i = 0; i < spawnSize; i++) {
Enemy enemy = new Enemy(mainPlayerPosX, mainPlayerPosY);
enemies.put(i, enemy);
}
initEnemiesSpawned = spawnSize;
enemiesSize = spawnSize;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void enemy(){\n\t\tenemy = null;\n\t\twhile(enemy == null){\n\t\t spawnEnemy();\n\t\t}\n\t}",
"public void enemySpawner(){\n\t\tif (spawnFrame >= spawnTime){\n\t\t\tfor(int i =0;i<enemies.size();i++){\n\t\t\t\tif (!enemies.get(i).getInGame()){\n\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy);\n\t\t\t\t\tbreak;\n\t\t\t\t\t/*if (enemies.get(i).getNum()==1){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==2){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==3){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}*/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tspawnFrame=0;\n\t\t} else{\n\t\t\tspawnFrame+=1;\n\t\t}\n\t}",
"private void addEnemySheild() {\n this.enemyShield += 1;\n }",
"private void spawnEnemy() {\n float randomEnemy = (float) Math.random();\n\n if (round == 1) {\n addActorFunction.accept(new SimpleEnemy(tileSet));\n } else {\n float speedMultiplier = 1 + (0.08f * round);\n float healthMultiplier = 1 + (0.01f * round * round);\n\n if (randomEnemy < (round - 1) * 0.1) {\n addActorFunction.accept(new HeavyEnemy(tileSet, speedMultiplier, healthMultiplier));\n } else {\n addActorFunction.accept(new SimpleEnemy(tileSet, speedMultiplier, healthMultiplier));\n }\n }\n }",
"private void createEnemyHelicopter()\n\t {\n\t \t\tRandNum = 0 + (int)(Math.random()*700);\n\t\t \t\tint xCoordinate = 1400;\n\t int yCoordinate = RandNum; \n\t eh = new Enemy(xCoordinate,yCoordinate);\n\t \n\t // Add created enemy to the list of enemies.\n\t EnemyList.add(eh);\n\t \n\t }",
"@SuppressWarnings(\"unused\")\n void spawn(Entity entity);",
"public void dispara()\r\n {\r\n BulletEnemy bala = new BulletEnemy();\r\n getWorld().addObject(bala,getX(),getY()+25);\r\n }",
"protected abstract void defineEnemy();",
"public void enemyCreator() { // Creates enemies\n \tif(createFrame >= createTime) {\n \t\tfor(int i = 0; i < enemies.length; i++) {\n \t\t\tif(!enemies[i].isAlive) { // If the enemy is no longer alive\n \t\t\t\tenemies[i].Create(0); // Create a new one\n \t\t\t\tbreak;\n \t\t\t} \t\t\t\t\n \t\t}\n \t\tcreateFrame = 0;\n \t}\n \telse\n \t\tcreateFrame += 1;\n \t\n \tif(killCount == 10){ // Every ten enemies\n \t\tkillCount = 0;\n \t\tif(createTime > 700)\n \t\t\tcreateTime -= 275; // Increase spawn rate\n \t\t\n \t\tif(Enemy.moveSpeed > 8)\t\n \t\t\t\tEnemy.moveSpeed -= 2; // Increase enemy movement speed\n \t\tif(killed > 100)\n \t\t\tBlock.healthTime += 25; // Increase enemy health\n \t\telse if(killed > 200)\n \t\t\tBlock.healthTime += 30;\n \t\telse\n \t\t\tBlock.healthTime += 20;\n \t}\n }",
"private void createEnemy()\n {\n scorpion = new Enemy(\"Giant Scorpion\", 5, 10); \n rusch = new Enemy(\"Mr. Rusch\", 10, 1000);\n skeleton = new Enemy(\"Skeleton\", 10, 50);\n zombie = new Enemy(\"Zombie\", 12, 25);\n ghoul = new Enemy(\"Ghoul\", 15, 45);\n ghost = new Enemy(\"Ghost\", 400, 100);\n cthulu = new Enemy(\"Cthulu\", 10000000, 999999);\n concierge = new Enemy(\"Concierge\", 6, 100);\n wookie = new Enemy(\"Savage Wookie\", 100, 300);\n }",
"public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }",
"private void spawnMediumEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }",
"void generateEnemy(){\n\t\tEnemy e = new Enemy((int)(Math.random()*\n\t\t\t(cp.getWidthScreen() - (ss.getWidth()/2)))\n\t\t\t,ss.getHeight(), cp.getHieghtScreen());\t\t\t\t//Enemy (int x, int y, int heightScreen)\n\t\tcp.shapes.add(e);\n\t\tenemies.add(e);\n\t}",
"private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }",
"void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }",
"private void spawnStuff(PlayScreen screen, float delta) {\n if (stageId!=3 && stageId!=5) {\n isCombatEnabled = true;\n int where;\n boolean spawnRight = true;\n float speed;\n\n\n //Alien Spawn\n if (System.currentTimeMillis() - lastASpawn >= SpawnATimer + extraTimer) {\n speed = (float)(Utils.doRandom(250,400));\n lastASpawn = System.currentTimeMillis();\n int count = 3;\n if (stageId==4) count = 1;\n for (int i = 0; i < count; i++) {\n if (stageId==4){\n speed = (float) (speed*0.75);\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - Alien.width, y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player));\n }else{\n int x = 0 - Alien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + Alien.width*2 , y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player,false));\n }\n }\n }\n //AcidAlien Spawn\n if (System.currentTimeMillis() - lastBSpawn >= SpawnBTimer + extraTimer) {\n speed = 200;\n lastBSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - AcidAlien.width, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player));\n }else{\n int x = 0 - AcidAlien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + AcidAlien.width*2, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player,false));\n }\n }\n //FastAlien Spawn\n if (System.currentTimeMillis() - lastCSpawn >= SpawnCTimer + extraTimer) {\n speed= Utils.doRandom(250,400);\n lastCSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - FastAlien.width, y, FastAlien.width, FastAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images,speed, screen.player));\n }else{\n int x = 0 - FastAlien.width;\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x-FastAlien.width*2,y,FastAlien.width,FastAlien.height))) hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images, speed,screen.player,false));\n }\n\n }\n\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n }else{\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width*2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages,false));\n }\n }\n /*if (System.currentTimeMillis() - lastBombSpawn >= SpawnTimerBomb) {\n lastBombSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - PurpleCapsuleItem.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x,y,PurpleCapsuleItem.width,PurpleCapsuleItem.height))) hits = true;\n }\n }\n screen.items.add(new PurpleCapsuleItem(x, y, 500, screen.itemPurpleImages));\n }*/\n }else{\n if (stageId==3) {\n //SPACE STAGE\n ///SPAWN ENEMY SHIP:\n //TODO\n if (PlayScreen.entities.size() == 1) {\n isCombatEnabled = false;\n //no enemy spawned, so spawn:\n if (spawnIterator >= killCount) {\n //TODO END STAGE\n } else {\n System.out.println(\"SPAWNS SHIP\");\n spawnIterator++;\n screen.entities.add(new EnemyShipOne(new Vector2(0, 0), 100, screen.enemyShipOne, true, screen.player));\n\n }\n }\n //Items:\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule) {\n lastCapsuleSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new BlackBulletItem(x, y, 1000, screen.itemBlackImages));\n\n\n }\n }else{\n if (stageId == 5){\n isCombatEnabled = true;\n float speed;\n boolean spawnRight=true;\n int where=0;\n //TODO FINAL STAGE\n if (!isBossSpawned){\n //TODO\n screen.entities.add(new Boss(new Vector2(PlayScreen.gameViewport.getWorldWidth(),PlayScreen.gameViewport.getWorldHeight()/2 - Boss.height/2),screen.player));\n isBossSpawned=true;\n }\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId == 4) {\n speed = speed / 2;\n where = Utils.doRandom(0, 1);\n if (where < 50) {\n spawnRight = true;\n } else {\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n } else {\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width * 2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages, false));\n }\n }\n //TODO\n }\n }\n }\n\n //run .update(delta) on all objects\n for (int i=0; i<screen.entities.size();i++){\n screen.entities.get(i).update(delta);\n }\n\n for (int i=0; i<screen.items.size();i++){\n screen.items.get(i).update(delta);\n }\n\n //labels set:\n screen.labelHealth.setText(\"Health: \" + screen.player.health + \"/\" + screen.player.maxHealth);\n if (scoreBased) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + scoreGoal);\n }else{\n if (killCount>0){\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + killCount);\n }else{\n if (boss){\n screen.labelInfo.setText(\"Boss: \"+screen.player.score + \"/\" + Boss.bossHealth);\n }else{\n screen.labelInfo.setText(\"\");\n }\n\n }\n }\n if (this.stageId == 999) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score);\n }\n\n\n }",
"private void addEnemies() {\n\t\tred_ghost = new Enemy();\r\n\t\tthis.add(red_ghost);\r\n\t\tenemies.add(red_ghost);\r\n\t\t\r\n\t}",
"private void generateEnemies(){\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tEnemy enemy = new Enemy(coordX,coordY);\n\t\tenemies.put(0, enemy);\n\t\tcoordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tcoordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tenemy = new Enemy(coordX,coordY);\n\t\tenemies.put(1, enemy);\n\t}",
"@Override\n\t\t\tpublic void attack(Base enemy) {\n\t\t\t}",
"public void enemyoff(){\n getWorld().removeObject(this);\n }",
"public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }",
"public void moveTowards(){\n \n \n \n if(!exploded){\n \n \n move(speed);\n \n if(isTouching(Enemy.class)){\n move(explosionRadius); \n \n inRange = (ArrayList) getObjectsInRange(explosionRadius + 25, Enemy.class);\n for(Enemy e : inRange){\n e.hit(damage);\n }\n \n //explode\n exploded = true;\n \n image = new GreenfootImage(\"50x50 aoe.png\");\n image.scale(explosionRadius*2, explosionRadius*2);\n setImage(image);\n //getWorld().removeObject(this);\n }\n else if (isAtEdge())\n {\n getWorld().removeObject(this);\n }\n else if ( radius < distance) {\n getWorld().removeObject(this); \n }\n }\n else{\n setImage(image);\n image.setTransparency(image.getTransparency() - 5);\n if(image.getTransparency() <= 0) getWorld().removeObject(this);\n }\n }",
"@Override\n public boolean act() {\n float variation = (random.nextFloat() / 2f) - 1;\n\n // Reconfigure the time to wait before spawning another enemy.\n this.deltaLimit = Math.max(100, INITIAL_SPAWN_TIME + variation - (100 * round));\n\n spawnEnemy();\n return false;\n }",
"public void spawnNew() {\n\t\tif (tier> 1) {\n\t\t\ttier--;\n\t\t\thealth = tier;\n\t\t\tdamage = tier;\n\t\t\tspeed = 5;\n\t\t\timg = getImage(updateImage(tier)); // converted getImage to protected b/c it wasn't accessible by Balloon class (child class)\n\t\t}\n\t\telse {\n\t\t\tisAlive = false;\n\t\t\tdeletePath();\t\t\t\n\t\t}\n\t}",
"@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }",
"public void spawnCreature(){\n\t\tif(spawnType.equalsIgnoreCase(\"worm\")){\n\t\t\tRuntimeObjectFactory.getObjectFromPool(\"worm\"+spawnId);\n\t\t}else if(spawnType.equalsIgnoreCase(\"antorc\")){\n\t\t\tGdx.app.debug(TamerGame.LOG, this.getClass()\n\t\t\t\t\t.getSimpleName() + \" :: Ant entered\");\t\t\t\n\t\t\t//CHANGE SPAWNING IMPLEMENTATION\n\t\t\tAntOrc orc = new AntOrc();\n\t\t\torc.setPosition(getPosition());\n\t\t\torc.setWaypoint(waypoint);\n\t\t\tenvironment.addNewObject(orc);\n\t\t\tEventPool.addEvent(new tEvent(this,\"spawnCreature\",sleepTime,1));\n\t\t}\n\t\t\t\n\t}",
"private void createPlayerExplosion() {\n\t\tAsteroidsExplosion explosion = new AsteroidsExplosion(GameObject.ROOT, this, 50, 20.0, 3.0);\n\t\texplosion.translate(player.getPositionVector());\n\t\totherObjects.add(explosion);\n\t}",
"BossEnemy(){\n super();\n totallyDied = true;\n }",
"public abstract void attack(Vector2 spawnPos, Vector2 target);",
"private void explode()\n\t{\n\t\texplosion.setX(getX());\n\t\texplosion.setY(getY());\n\t\t\n\t\tif(!explosion.isOver())\n\t\t{\n\t\t\texplosion.update();\n\t\t\texplosion.drawObject();\n\t\t}\t\n\t\telse\n\t\t\talive = false;\n\t}",
"@Override\r\n public boolean dye() {\r\n if (getX() > 3100 || getX() < 10 || getY() < 10 || getY() > 3100) {\r\n return true;\r\n }\r\n// int pixel = mapRGB.getRGB((int) getX(), (int) getY());\r\n// int red = (pixel >> 16) & 0xff;\r\n// if(red==255){this.handler.getWaves().removeEnemy(); return true;}\r\n int k = collision(velX, velY, this.getX(), this.getY());\r\n if(k!=0) {\r\n this.handler.getWaves().removeEnemy(); \r\n return true;\r\n }\r\n else{\r\n zombie_x = getX(); \r\n zombie_y = getY();\r\n }\r\n //I proiettili hanno una portata limitata o se ha colpito il player o se è uscito dalla mappa o se è andato contro un muro\r\n if ((this.getHealth() == 0) || (handler.getPlayer().getBounds().contains(getX(), getY()))) {\r\n int n = (int) (Math.random() * 10);\r\n if(n>1) n=2;\r\n switch (n) {\r\n case 2:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 3, 200, 25, handler.getPlayer(), this.handler, 30, 60, 60, 5, new Animation(Assets.zombie, 20), new Animation(Assets.zombieAttack, 35), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 0:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 4, 70, 50, handler.getPlayer(), this.handler, 0, 60, 60, 20, new Animation(Assets.zombie2, 15), new Animation(Assets.zombie2Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 1:\r\n this.handler.addSprite(new SpittleZombie(zombie_x, zombie_y, 3, 500, 40, handler.getPlayer(), this.handler, 0, 60, 60, 45, new Animation(Assets.zombie3, 15), new Animation(Assets.zombie3Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n }\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"void setEnemyPos(Point2D pos);",
"@Override\n\tpublic void updateEntity() {\n\t\t\n\t\tif (this.mobID != null && !this.worldObj.isRemote) {\n\t\t\t\n\t\t\tif (this.delay > 0) {\n\t\t\t\tthis.delay--;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tEntity entity = EntityList.createEntityByName(this.mobID, this.worldObj);\n\t\t\t\n\t\t\t// L'entity n'existe pas\n\t\t\tif (entity == null) {\n\t\t\t\tModGollumCoreLib.log.warning(\"This mob \"+this.mobID+\" isn't register\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tthis.worldObj.setBlockToAir(this.xCoord , this.yCoord , this.zCoord);\n\t\t\t\n\t\t\tdouble x = (double)this.xCoord + 0.5D;\n\t\t\tdouble y = (double)(this.yCoord);// + this.worldObj.rand.nextInt(3) - 1);\n\t\t\tdouble z = (double)this.zCoord + 0.5D;\n\t\t\tEntityLiving entityLiving = entity instanceof EntityLiving ? (EntityLiving)entity : null;\n\t\t\tentity.setLocationAndAngles(x, y, z, this.worldObj.rand.nextFloat() * 360.0F, this.worldObj.rand.nextFloat() * 360.0F);\n\t\t\tthis.worldObj.spawnEntityInWorld(entity);\n\t\t\t\n\t\t\tif (entityLiving == null || entityLiving.getCanSpawnHere()) {\n\t\t\t\t\n\t\t\t\tthis.worldObj.playSoundEffect (this.xCoord, this.yCoord, this.zCoord, \"dig.stone\", 0.5F, this.worldObj.rand.nextFloat() * 0.25F + 0.6F);\n\t\t\t\t\n\t\t\t\tif (entityLiving != null) {\n\t\t\t\t\tentityLiving.spawnExplosionParticle();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void attack()\n {\n getWorld().addObject(new RifleBullet(player.getX(), player.getY(), 1, 6, true), getX(), getY()); \n }",
"@Override\n public void run() {\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n int rnd_x = rnd.nextInt(Game.WIDTH);\n handler.addObject(new Enemy(getX() + 30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() -30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y+30, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y-30, ID.Trump, 0));\n\n\n }",
"@Override\n\tprotected void fireAddEnemyMissile(String launcherId, String destination,\n\t\t\tint damage, int flyTime){\n\t\t\n\t}",
"private void createBasicEnemies() {\n\t\tint xTemp1 = (int) app.random(60, 500);\n\t\tint xTemp2 = (int) app.random(650, 1140);\n\t\tint yTemp = -60;\n\t\t\n\t\t//Contador para crear enemigo cada cierto tiempo\n\t\tapp.frameRate(80);\n\t\t\n\t\t//Agregar enemigos basicos\n\t\tif (app.frameCount%120 == 0) {\n\t\t\tbasicEnemies1.add(new BasicEnemy(app, xTemp1, yTemp));\n\t\t\tbasicEnemies2.add(new BasicEnemy(app, xTemp2, yTemp));\n\t\t}\n\t\t\n\t\t//Agregar enemigos que disparan\t\t\n\t\tif (app.frameCount%250 == 0) {\n\t\t\thardEnemies1.add(new HardEnemy(app, xTemp1, yTemp));\n\t\t\thardEnemies2.add(new HardEnemy(app, xTemp2, yTemp));\n\t\t}\n\t}",
"public void spawnEnemy(){\n\t\tint initTile = 0;\n\t\n\t\tfor(int i=0; i<screen.maps[screen.currentMap].path.getHeight(); i++){\n\t\t\tif(screen.maps[screen.currentMap].path.getCell(0, i).getTile().getProperties().containsKey(\"ground\") == true){\n\t\t\t\tinitTile = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\txCoor = 2;\n\t\tyCoor = (initTile)*64 + 2;\n\t\tbound = new Circle(xCoor+30, yCoor+30, 30);\n\t\tinGame = true;\n\t}",
"public void killedByPlayer() {\r\n\t\tscreen.enemiesKilled++;\r\n\t\tMazeCrawler mc = screen.mazeHandler.mazeCrawler;\r\n\t\tint n = 2; //if enemy is large do movement n+1 times\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tmc.moveDown();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveDown();}\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tmc.moveLeft();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveLeft();}\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tmc.moveRight();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveRight();}\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tmc.moveUp();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveUp();}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tscreen.enemyDeath.play(.5f);\r\n\t\tdestroy();\r\n\t}",
"private void spawnBigEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createBigEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createBigEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"void spawnEntityAt(String typeName, int x, int y);",
"public void attack(int idx)\n {\n CreatureWorld playerWorld = ;\n \n }",
"private void generateEnemies() {\n for(int i =0; i < currentEnemies.length; i++) {\n Attributes a = genAttributes();\n double[] healthSpeed = genHealthAndSpeed();\n LinkedList<Pathing> paths = map.getPathings();\n this.currentEnemies[i] = new Enemy(determineImage(a, healthSpeed[0]), healthSpeed[0], healthSpeed[1], 10+currentDifficulty/20, a, paths);\n }\n\n }",
"public synchronized void spawnMe()\n\t{\n\t\t_itemInstance = ItemTable.getInstance().createItem(\"Combat\", _itemId, 1, null, null);\n\t\t_itemInstance.dropMe(null, _location.getX(), _location.getY(), _location.getZ());\n\t}",
"public void act() \n {\n //plays animation with a delay between frames\n explosionSound.play();\n i = (i+1)%(frames.length); \n setImage(frames[i]);\n if(i == 0) getWorld().removeObject(this);\n }",
"public void spawnEnemy(Location location) {\r\n\t\t\tlocation.addNpc((Npc) this.getNpcSpawner().newObject());\r\n\t\t}",
"public void act() \r\n {\r\n if(timeInterval > 0) {\r\n timeInterval--;\r\n }else{\r\n if(currentSprite < 30) {\r\n currentSprite++;\r\n GreenfootImage img = new GreenfootImage(\"explosion_\" + currentSprite + \".png\");\r\n img.scale(img.getWidth() / 2 + 25, img.getHeight() / 2 + 25);\r\n setImage(img);\r\n timeInterval = timeIntervalDef;\r\n }else{\r\n getWorld().removeObject(this);\r\n }\r\n }\r\n }",
"public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }",
"abstract public void triggerExplosion();",
"int defend(Unit unit, Unit enemy);",
"public void control(Spawn spawn) {}",
"public void act() \n {\n if(timer > 0){\n timer--;\n }else{\n Greenfoot.playSound(\"explosionSound.wav\");\n getWorld().removeObject(this);\n }\n }",
"private void makeKillerEnemys(int n) {\n List<Enemy> enemies = getEnemies();\n\n for (int i = 0; i < n; i++) {\n Random r = new Random();\n //spawn enemies at random position on the map\n enemies.add(new KillerEnemy(getGameView(), r.nextInt((getMap().width - (-getMap().width)) + 1) + (-getMap().width),\n r.nextInt((getMap().height - (-getMap().height)) + 1) + (-getMap().height),\n 100));\n }\n\n setEnemies(enemies);\n }",
"public TestEnemy(Vector2 spawnPoint) {\n super(spawnPoint);\n this.health = MAX_HEALTH;\n this.speed = MAX_SPEED;\n this.damage = DAMAGE;\n this.moneyOnKill = MONEY_ON_KILL;\n this.bounds = new Circle(spawnPoint, RADIUS);\n this.ai = new RunnerAi(this);\n }",
"@Override\n\tpublic void doCollideEnemy(SlowEnemy enemy) {\n\t\t\n\t}",
"public void enemyTurnStart() {\n\r\n\t}",
"public void takeDamage()\n {\n if(getWorld()!= null)\n {\n if(this.isTouching(Enemies.class))\n {\n Life = Life - Enemies.damage;\n if(Life <=0)\n {\n getWorld().removeObject(this);\n Store.wealth += Game.credit;\n }\n }\n }\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tl.getWorld().createExplosion(drop.getLocation(), 2, false);\n\t\t\t\t\t}",
"void effect(Entity e, BoardPosition bp);",
"public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}",
"public void getEnemyBattleEffects(Enemy enemy) {\n try {\n Ability chosenAbility = enemy.getLastUsableAbility().clone();\n ArrayList<Entity> players = new ArrayList<>();\n players.add(playerInCombat);\n addEffect(enemy.parse(chosenAbility,players,true));\n } catch (InsufficientResourceException ignored) {\n ;\n }\n }",
"public void execute() {\n\t\tif (getTargetEnemies() != null && getTargetEnemies().size() > 0) {\n\t\t\tBuff buff = new Buff(getHero().getId(), null, Buff.SPEED, getAbility().getValue(), CHARGE_DURATION, \"0\", 0);\n\t\t\tThread buffDurationThread = new Thread(() -> {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(CHARGE_DURATION);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tgetHero().removeBuff(buff);\n\t\t\t\tgetGameServer().sendGameStatus();\n\t\t\t\tLog.i(TAG, \"Removed buff, now have these many buffs left : \" + getHero().getBuffs().size());\n\t\t\t});\n\t\t\tbuffDurationThread.start();\n\n\t\t\tgetHero().getBuffs().add(buff);\n\n\t\t\t// Set the cooldown for this ability\n\t\t\tgetAbility().setMillisLastUse(getTime());\n\t\t\tgetAbility().setTimeWhenOffCooldown(\"\" + (getTime() + getAbility().calculateCooldown(getHero(), this)));\n\n\t\t\t// Send castbar information\n\t\t\tgetGameServer().sendCastBarInformation(getHero().getId(), getAbility());\n\n\t\t\t// Add animation to list\n\t\t\tgetGameServer().getAnimations().add(new GameAnimation(\"CHARGE\", 0, getHero().getId(), null, 1));\n\t\t}else{\n\t\t\tLog.i(TAG, \"Hero had no target, canceling ability\");\n\t\t}\n\t\tsuper.execute();\n\t}",
"public void enemySpawn(String typeofEnemy) {\n if (spawnTimer == 0) {\n if (typeofEnemy.equals(\"bee\")) {\n outerloop:\n//label to later break when enemy is spawned\n for (int row = 3; row < 5; row++) {\n for (int column = 0; column < 8; column++) {\n if (canSpawn[row][column] == false) {\n handler.getGalagaState().entityManager.entities.add(new EnemyBee(x, y, 32, 32, handler, row, column));\n canSpawn[row][column] = true;\n spawnTimer = random.nextInt(60 * 7);\n break outerloop;\n } else continue;\n }\n }\n } else {//ENEMYOTHER\n outerloop:\n for (int row = 1; row < 3; row++) {\n for (int column = 0; column < 8; column++) {\n if (canSpawn[row][column] == false) {\n handler.getGalagaState().entityManager.entities.add(new EnemyOther(x, y, 32, 32, handler, row, column));\n canSpawn[row][column] = true;\n spawnTimer = random.nextInt(60 * 7);\n break outerloop;\n } else continue;\n }\n }\n\n }\n }\n else {\n spawnTimer--;\n }\n\n// int enemyType = random.nextInt(2);\n// spawnTimer--;\n// if (spawnTimer == 0) {\n// if (typeofEnemy.equals(\"bee\")) {\n// int row = random.nextInt(2) + 3, column = random.nextInt(8);\n// if (canSpawn[row][column] == false) {\n// handler.getGalagaState().entityManager.entities.add(new EnemyBee(x, y, 32, 32, handler, row, column));\n// canSpawn[row][column] = true;\n// } else {\n// return;\n// }\n// } else {\n// int row = random.nextInt(2) + 1, column = random.nextInt(8);\n// if (canSpawn[row][column] == false) {\n// handler.getGalagaState().entityManager.entities.add(new EnemyOther(x, y, 32, 32, handler, row, column));\n// canSpawn[row][column] = true;\n// }\n// }\n// }\n// else{\n// spawnTimer--;\n// }\n\n\n\n\n }",
"private void doSpawnProcess()\n\t{\n\t\t// spawn sometin\n\t\tthis.spawn();\n\t\t\n\t\t// record another spawned enemy\n\t\tspawnCurrent++;\n\t\t\n\t\t// if that wasn't the last Walker\n\t\tif(currentWave.getNumberOfWalkers() > 0)\n\t\t{\n\t\t\t// restart the spawn timer\n\t\t\tfloat delay = currentWave.getSpawnDelay();\n\t\t\tspawnTimer.start(delay);\n\t\t}\n\t\t// otherwise, we've spawned all our piggies in this wave\n\t\telse\n\t\t{\n\t\t\tprepareNextWave();\n\t\t}\n\t}",
"void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);",
"private void attackPlayer()\n\t{\n\t\tif(shootTimer.done())\n\t\t{\n\t\t\tProjectile spiderWeb = new SpiderWeb(x, y);\n\t\t\tGame.objectWaitingRoom.add(spiderWeb);\n\t\t\tspiderWeb.shoot();\n\t\t\tshootTimer.setTime(200);\n\t\t}\n\t}",
"void deathHandler(Enemy e) {\n\n if (e != null) {\n Explosion rip = new Explosion();\n rip.kaboom.moveToPoint(e.eTank.getX(), e.eTank.getY());\n // println(\"made enemy\");\n rip.kaboom.frontAngle(90);\n rip.kaboom.turn(90);\n explosion.add(rip);\n }\n for (Explosion exp: explosion) {\n if (exp.kaboomCounter > 1) {\n exp.kaboom.display();\n }\n // if (exp.kaboomCounter < 1) {\n // explosion.remove(exp);\n // }\n // else {\n exp.kaboomCounter -= 3;\n // println(exp.kaboomCounter);\n // println(explosion.size());\n // }\n }\n\n}",
"public Enemy() {\n createModel();\n enemyCounter++;\n }",
"public static void spawnEnemy(){\n RNG.D100();\n if(PlayerStats.LVL <= 2){\n if(RNG.num <= 90){\n enemy = \"imp\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 2 && PlayerStats.LVL <= 3){\n if(RNG.num <= 20){\n enemy = \"imp\";\n }else if(RNG.num > 20 && RNG.num <= 90){\n enemy = \"toadman\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 3 && PlayerStats.LVL <= 5){\n if(RNG.num <= 10){\n enemy = \"toadman\";\n }else if(RNG.num > 10 && RNG.num <= 90){\n enemy = \"giant spider\";\n }else{\n enemy = \"BROODMOTHER\";\n }\n }else if (PlayerStats.LVL > 5 && PlayerStats.LVL <= 8){\n if(RNG.num <= 30){\n enemy = \"goblin sorceror\";\n }else if(RNG.num > 30 && RNG.num <= 60){\n enemy = \"goblin warrior\";\n }else if(RNG.num >60 && RNG.num <= 90){\n enemy = \"goblin archer\";\n }else if(RNG.num > 90 && RNG.num <= 100){\n enemy = \"GOBLIN CHIEFTAN\"; \n }\n } \n }",
"public void act() \n {\n moveEnemy();\n checkHealth();\n attacked();\n }",
"private void prepareLevel(){\n levelAnimation = true;\n\n // Reset the menace level\n menaceInterval = 1200;\n\n // Here we will initialize all the game objects\n // Make a new player space ship\n defender = new Defender(context, PlayableX, PlayableY, ExcessX);\n\n // Prepare the players bullet\n bullet = new Bullet(context, PlayableX, PlayableY, (float) 1.2);\n\n // Initialize the invadersBullets array\n for(int i = 0; i < invadersBullets.length; i++){\n invadersBullets[i] = new Bullet(context, PlayableX, PlayableY, (float) 0.80);\n }\n\n // Build an army of invaders\n numInvaders = 0;\n for(int column = 0; column < invadersColumn; column ++ ){\n for(int row = 0; row < invadersRow; row ++ ){\n invaders[numInvaders] = new Invader(context, row, column, PlayableX, PlayableY, ExcessX);\n numInvaders ++;\n }\n }\n invadersLeft = numInvaders;\n\n try {\n // Create objects of the 2 required classes\n AssetManager assetManager = context.getAssets();\n explosionEffect = new Bitmap[12];\n for (int i=0; i < 12; i++) {\n explosionEffect[i] = Bitmap.createScaledBitmap(BitmapFactory.decodeStream(assetManager.open(\"explosion/\" + (i + 1) + \".png\")), (int) (invaders[0].getLength()*1.75), (int) (invaders[0].getLength()*1.75), true);\n }\n } catch (IOException e) {\n e.printStackTrace();\n // Print an error message to the console\n Log.e(\"error\", \"failed to load explosion effect image files\");\n }\n\n }",
"public void act()\n {\n if(isInWorld == true)\n {\n if(!WorldOne.isTimerOn() && getWorld().getClass() == WorldOne.class && WorldControl.subWave == 1)\n { \n getWorld().addObject(healthMessage, getX() - 30, getY() - 30);\n }\n getWorld().addObject(healthMessage, getX() - 30, getY() - 30);\n move();\n lastX = getX();\n lastY = getY();\n healthMessage.updatePosition(getX() - 30, getY() - 30);\n healthMessage.update(\"HP \" + getHealth(), Color.GREEN, font); \n checkKeys();\n incrementReloadDelayCount();\n //healthMessage.update(\"HP \" + getHealth(), Color.GREEN, font);\n if(!hasHealth())\n {\n removeSelfFromWorld(healthMessage);\n removeSelfFromWorld(this);\n isInWorld = false;\n isRocketAlive = false;\n Greenfoot.playSound(\"Explosion.wav\");\n }\n } \n\n }",
"public void hack(Entity e) {\r\n\t\te.modifyHp(10);\r\n\t}",
"private void spawnPlayer() {\n\t\tplayer.show(true);\n\t\tplayer.resetPosition();\n\t\tplayerDead = false;\n\t\tplayerDeadTimeLeft = 0.0;\n\t}",
"@Override\n\tpublic void loadEnemies() {\n\t\t\n\t}",
"public void act()\r\n {\n \r\n if (Background.enNum == 0)\r\n {\r\n length = Background.length;\r\n width = Background.width;\r\n getWorld().addObject (new YouWon(), length / 2, width / 2);\r\n \r\n //long lastAdded2 = System.currentTimeMillis();\r\n //long curTime3 = System.currentTimeMillis();\r\n //long curTime3 = System.currentTimeMillis();\r\n //long seconds = curTime3 / 1000;\r\n //sleep = 3;\r\n //try {\r\n //TimeUnit.SECONDS.sleep(sleep);\r\n //} catch(InterruptedException ex) {\r\n //Thread.currentThread().interrupt();\r\n //}\r\n //Greenfoot.delay(3);\r\n //long curTime3 = System.currentTimeMillis();\r\n //long secs2 = curTime3 / 1000;\r\n //long curTime4;\r\n //long secs3;\r\n //do\r\n //{\r\n //getWorld().addObject (new YouWon(), length / 2, width / 2);\r\n //curTime4 = System.currentTimeMillis();\r\n //secs3 = curTime3 / 1000;\r\n //} while (curTime4 / 1000 < curTime3 / 1000 + 3);\r\n //if (System.currentTimeMillis()/1000 - 3 >= secs2)\r\n //{\r\n //do\r\n //{\r\n pause(3000);\r\n Actor YouWon;\r\n YouWon = getOneObjectAtOffset(0, 0, YouWon.class);\r\n World world;\r\n world = getWorld();\r\n world.removeObject(this);\r\n Background.xp += 50;\r\n Background.myGold += 100;\r\n if (Background.xp >= 50 && Background.xp < 100){\r\n Background.myLevel = 2;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 100 && Background.xp < 200){\r\n Background.myLevel = 3;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 200 && Background.xp < 400){\r\n Background.myLevel = 4;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 400 && Background.xp < 800){\r\n Background.myLevel = 5;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 800 && Background.xp < 1600){\r\n Background.myLevel = 6;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 1600 && Background.xp < 3200){\r\n Background.myLevel = 7;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 3200 && Background.xp < 6400){\r\n Background.myLevel = 8;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 6400 && Background.xp < 12800){\r\n Background.myLevel = 9;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 12800){\r\n Background.myLevel = 10;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n }\r\n //curTime3 = System.currentTimeMillis();\r\n //secs2 = curTime3 / 1000;\r\n //index2++;\r\n //Greenfoot.setWorld(new YouWon());\r\n //lastAdded2 = curTime3;\r\n //}\r\n //} while (index2 <= 0);\r\n }\r\n }",
"public void setEnemy(Enemy enemy){\n this.enemy = enemy;\n enemy.setXGrid(getXGrid());\n enemy.setYGrid(getYGrid());\n setEntity(enemy);\n }",
"private void normal(EntityManager manager) {\r\n Shot shot = new Shot(shotTexture, getX() + forwardX, getY() + forwardY, forwardX * 30, forwardY * 30, 800, 0.65f, 1, 0, 1, true, 200, false);\r\n\r\n manager.addEntity(shot);\r\n manager.shotFired(0);\r\n }",
"public void act() \n {\n \n move(1);\n \n Player2 player2 = new Player2();\n myWorld2 world = (myWorld2)getWorld();\n \n \n checkForDeath();\n }",
"public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static Action spawn(final Class<?> e) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.isFacingValidLocation() && a.getFacing() == null) {\n if(a.energy >= getCost()) {\n try {\n Actor b = (Actor) e.newInstance();\n b.putSelfInGrid(a.getGrid(), a.getLocation().getAdjacentLocation(a.getDirection()));\n } catch(InstantiationException r) {\n r.printStackTrace();\n } catch(IllegalAccessException r) {\n r.printStackTrace();\n }\n a.energy = a.energy - 400;\n }\n }\n }\n\n @Override\n public int getCost() {\n return 400;\n }\n\n @Override\n public boolean isExclusive() {\n return true;\n }\n\n @Override\n public Object getData() {\n return e;\n }\n\n @Override\n public String toString() {\n return \"Spawn(\" + (e != null ? e.toString() : \"null\") + \")\";\n }\n };\n }",
"public void addEnemy(Enemy enem)\r\n\t{\r\n\t\tenemy.add(new Enemy(enem));\r\n\t}",
"public void spawnExplosion(Point3d location, double strength, boolean flames){\r\n\t\tworld.newExplosion(null, location.x, location.y, location.z, (float) strength, flames, ConfigSystem.configObject.general.blockBreakage.value);\r\n\t}",
"private void makeBoss()\r\n {\r\n maxHealth = 1000;\r\n health = maxHealth;\r\n \r\n weapon = new Equip(\"Claws of Death\", Equip.WEAPON, 550);\r\n armor = new Equip(\"Inpenetrable skin\", Equip.ARMOR, 200);\r\n }",
"void useInBattle(PlayerCharacter player, Opponent enemy) {\n\t}",
"public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }",
"public void setAlive(boolean alive){\n // make sure the enemy can be alive'nt\n this.alive = alive; \n }",
"public void attack(Entity entity) {\n\t}",
"public Enemy(Texture tex) \r\n\t{\r\n\t\tsuper(tex);\r\n\t\tm_type = \"enemy\";\r\n\t\tm_controller = new IAController();\r\n\t\tm_weapon = new AttackEmitter();\r\n\t\t\r\n\t\tm_lifeBar.setScale(new Vector2(0.3f,0.3f));\r\n\t\t\r\n\t\tm_speed = 50;\r\n\t\tm_life = 4;\r\n\t\t\r\n\t}",
"public void act() \n {\n World w = getWorld();\n int height = w.getHeight();\n \n setLocation(getX(),getY()+1);\n if (getY() <=0 || getY() >= height || getX() <= 0) // off the world\n {\n w.removeObject(this);\n return;\n }\n \n \n SaboWorld thisWorld = (SaboWorld) getWorld();\n Turret turret = thisWorld.getTurret();\n Actor turretActor = getOneIntersectingObject(Turret.class);\n Actor bullet = getOneIntersectingObject(Projectile.class);\n \n if (turretActor!=null && bullet==null) // hit the turret!\n {\n \n turret.bombed(); //Turret loses health\n explode();\n w.removeObject(this);\n } else if (turret==null && bullet!=null) //hit by a bullet!\n {\n explode();\n w.removeObject(this);\n }\n \n }",
"public void spawnWanderingSeeker(LogicEngine in_logicEngine)\r\n\t{\n\t\tGameObject ship = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/triangle.png\",(float)LogicEngine.SCREEN_WIDTH*Math.random(),LogicEngine.SCREEN_HEIGHT-10,0);\r\n\t\t\t\t\r\n\t\t//set animation frame\r\n\t\tship.i_animationFrame=1;\r\n\t\tship.i_animationFrameRow=0;\r\n\t\tship.i_animationFrameSizeWidth=16;\r\n\t\tship.i_animationFrameSizeHeight=16;\r\n\t\t\r\n\t\t//wander \t\r\n\t\tCustomBehaviourStep cb = new CustomBehaviourStep(new Wander(-2.5,2.5,20,0.1));\r\n\t\tship.stepHandlers.add( cb);\r\n\t\t\r\n\t\t//chase player if on medium or hard\r\n\t\tif(Difficulty.difficulty == DIFFICULTY.MEDIUM || \r\n\t\t\t\tDifficulty.difficulty == DIFFICULTY.HARD)\r\n\t\t{\t\r\n\t\t\tSeekNearestPlayerStep sps = new SeekNearestPlayerStep(100);\r\n\t\t\tship.stepHandlers.add(sps);\r\n\t\t}\r\n\t\r\n\t\tship.stepHandlers.add(new FlyStraightStep(new Vector2d(0,-2)));\r\n\t\tship.collisionHandler = new DestroyIfEnemyCollision(ship, 10, true);\r\n\t\tship.v.setMaxForce(2);\r\n\t\tship.v.setMaxVel(2);\r\n\t\t\r\n\t\tship.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t\r\n\t\tin_logicEngine.objectsEnemies.add(ship);\r\n\t\t\r\n\t}",
"public void explosion(){\n explosionEffect.play(pitch, volume);\n }",
"private GameObject spawnBoss(LogicEngine in_logicEngine,LevelManager in_manager)\r\n\t{\n\t\tGameObject go = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/redcube.png\",in_logicEngine.SCREEN_WIDTH/2,LogicEngine.rect_Screen.getHeight()+50,0);\r\n\t\tboss = go;\r\n\t\t\r\n\t\tboss.i_animationFrameRow = 1;\r\n\t\tboss.i_animationFrame =0;\r\n\t\tboss.i_animationFrameSizeWidth =75;\r\n\t\tboss.i_animationFrameSizeHeight =93;\r\n\t\t\r\n\t\tboss.v.setMaxForce(1);\r\n\t\tboss.v.setMaxVel(5);\r\n\t\tboss.stepHandlers.add( new BounceOfScreenEdgesStep());\r\n\t\t\r\n\t\t\r\n\t\tboss_arrive.setAttribute(\"arrivedistance\", \"50\", null);\r\n\t\tboss.stepHandlers.add( new CustomBehaviourStep(boss_arrive));\r\n\t\tboss.isBoss = true;\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\tHitpointShipCollision c = new HitpointShipCollision(boss, 150, 40, true,1);\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\tc.f_numberOfHitpoints = 200;\r\n\t\t\r\n\t\tif(Difficulty.isHard())\r\n\t\t\tc.f_numberOfHitpoints = 250;\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\ti_bossBubbleEvery = 125;\r\n\t\t\r\n\t\tif(Difficulty.isHard())\r\n\t\t\ti_bossBubbleEvery = 100;\r\n\t\t\r\n\t\t\r\n\t\tc.addHitpointBossBar(in_logicEngine);\r\n\t\tc.setExplosion(Utils.getBossExplosion(boss));\r\n\t\tboss.collisionHandler = c;\r\n\t\t\r\n\t\tboss.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t//initial velocity of first one \r\n\t\tboss.v.setVel(new Vector2d(0,-5));\r\n\t\t\r\n\t\tGameObject Tadpole1 = in_manager.spawnTadpole(in_logicEngine);\r\n\t\tGameObject Tadpole2 = in_manager.spawnTadpole(in_logicEngine);\r\n\t\t\r\n\t\tGameObject Bubble = null;\r\n\t\t\r\n\t\t\r\n\t\tBubble = spawnBossBubble(in_logicEngine, 0, 3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tTadpole1.v.setVel(new Vector2d(-10,5));\r\n\t\tTadpole2.v.setVel(new Vector2d(10,5));\r\n\t\tBubble.v.setVel(new Vector2d(0,-5));\r\n\t\t\r\n\t\tLaunchShipsStep l1 = new LaunchShipsStep(Tadpole1 , 50, 5, 1, false);\r\n\t\tLaunchShipsStep l2 = new LaunchShipsStep(Tadpole2, 50, 5, 1, true);\r\n\t\tLaunchShipsStep l3 = new LaunchShipsStep(Bubble, i_bossBubbleEvery, 1, 1, true);\r\n\t\tl1.b_addToBullets = true;\r\n\t\tl2.b_addToBullets = true;\r\n\t\t\r\n\t\tboss.stepHandlers.add(l1);\r\n\t\tboss.stepHandlers.add(l2);\r\n\t\tboss.stepHandlers.add(l3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\td_eye = new Drawable();\r\n\t\td_eye.i_animationFrameSizeHeight=8;\r\n\t\td_eye.i_animationFrameSizeWidth=8;\r\n\t\td_eye.i_animationFrameRow = 3;\r\n\t\td_eye.str_spritename = \"data/\"+GameRenderer.dpiFolder+\"/eye.png\";\r\n\t\t\r\n\t\tboss.visibleBuffs.add(d_eye);\r\n\t\t\r\n\t\treturn boss;\r\n\t}",
"public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }",
"@Override\n\tpublic void OnUse(Bob bob,float x, float y, float dist) {\n\t\tsuper.OnUse(bob,x, y,dist);\n\t\t\n\t\tif(flag)\n\t\t{\n\t\t\tif(!World.CurrentWorld.UpdateList.contains(this)) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tWorld.CurrentWorld.UpdateList.add(update);\n\t\t\t}\n\t\t\t\n\t\t\tint X = (int)x/Terrain.CurrentTerrain.chunkWidth;\n\t\t\tint Y = (int)y/Terrain.CurrentTerrain.chunkHeight;\n\t\t\tint x2 = (int)x%Terrain.CurrentTerrain.chunkWidth;\n\t\t\tint y2 = (int)x%Terrain.CurrentTerrain.chunkWidth;\n\t\t\t\n\t\t\tif(parentinv.owner.firstUse()) {\n\t\t\t\tif(Terrain.CurrentTerrain.CreateBlock(parentinv.owner,(int)x,(int)y, InvObjID))\n\t\t\t\t\tBob.CurrentBob.inventory.AddToBag(name,-1,true);\n\t\t\t}\n\t\t//Terrain.CurrentTerrain.light.floodStack.add(new Vector3(x,y,0));\n\t\t\n\t\t\n\t\tflag=false;\n\t\t}\n\t}",
"protected Enemy spawn(Class enemyClass, final ArrayList<Enemy> enemies, final int spawnRadius, final int escapeRadius) {\n // at a random angle\n double theta = Math.random() * 2 * Math.PI;\n // pick a random point from 10% spawn radius to 100% spawn radius\n double radius = (Math.random() * 0.9 + 0.1) * spawnRadius;\n\n GameUtils.Position p = GameUtils.radialLocation(radius, theta);\n\n Enemy newEnemy = null;\n if (enemyClass == BasicEnemy.class) {\n newEnemy = new BasicEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == ShootEnemy.class) {\n newEnemy = new ShootEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == LaserEnemy.class) {\n newEnemy = new LaserEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == BombEnemy.class) {\n newEnemy = new BombEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == Kraken.class) {\n newEnemy = new Kraken(escapeRadius, spawnRadius);\n } else if (enemyClass == ArcEnemy.class) {\n int rotateSide = (int)Math.round(Math.random());\n newEnemy = new ArcEnemy(p.x, p.y, escapeRadius, rotateSide);\n } else if (enemyClass == ArcShootEnemy.class) {\n int rotateSide = (int)Math.round(Math.random());\n newEnemy = new ArcShootEnemy(p.x, p.y, escapeRadius, rotateSide);\n }\n\n if(newEnemy == null) {\n System.err.println(\"Stage cannot spawn enemy of type \" + enemyClass);\n }\n\n return newEnemy;\n }",
"public void makesHereBack(){this.piece.affect();}",
"public default boolean shouldSpawnEntity(){ return false; }",
"public void attack() {\n\t\t\n\t\tint row = getPosition().getRow();\n\t\tint column = getPosition().getColumn();\n\t\t\n\t\tgetPosition().setCoordinates(row + 1, column);\n\t\tsetPosition(getPosition()) ;\n\t\t// restore health\n\t\tsetHealth(100);\n\t\t// end hunter mode\n\t\tthis.hunter = false;\n\t\t\n\t}"
] | [
"0.7059066",
"0.6955167",
"0.6876833",
"0.6762488",
"0.67242104",
"0.6659563",
"0.6637804",
"0.66267765",
"0.6586828",
"0.6557806",
"0.6549088",
"0.6524559",
"0.6458395",
"0.64501846",
"0.6445646",
"0.6439105",
"0.642568",
"0.6425154",
"0.6420435",
"0.64078677",
"0.64070624",
"0.64063",
"0.6373052",
"0.6360499",
"0.63493174",
"0.63492864",
"0.63214386",
"0.63190633",
"0.6303256",
"0.6280295",
"0.6274877",
"0.6265958",
"0.62646437",
"0.62584823",
"0.6254648",
"0.6200976",
"0.6194845",
"0.61938435",
"0.61908376",
"0.61902547",
"0.61832494",
"0.6179444",
"0.61759293",
"0.6174763",
"0.6159894",
"0.6159483",
"0.6145938",
"0.614014",
"0.6132023",
"0.6109966",
"0.60936755",
"0.6084957",
"0.60816956",
"0.6065185",
"0.60554504",
"0.6045745",
"0.6041315",
"0.60394615",
"0.6021613",
"0.59942776",
"0.5981886",
"0.5977123",
"0.597588",
"0.5975461",
"0.59733194",
"0.5948339",
"0.59417665",
"0.5919964",
"0.5909639",
"0.59076625",
"0.59002614",
"0.58909583",
"0.5888004",
"0.5883437",
"0.58831114",
"0.58828676",
"0.58741146",
"0.5873514",
"0.5871573",
"0.5868794",
"0.586553",
"0.58645904",
"0.58586746",
"0.5840536",
"0.58377355",
"0.5837627",
"0.5832043",
"0.58261704",
"0.5822645",
"0.5822547",
"0.5813784",
"0.5803686",
"0.58036584",
"0.57931745",
"0.57923114",
"0.5789565",
"0.57869524",
"0.578357",
"0.5782218",
"0.5774963"
] | 0.61265224 | 49 |
EFFECT: updates the ememies location | public void updateEnemies() {
for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {
entry.getValue().update(mainPlayerPosX, mainPlayerPosY);
if (entry.getValue().isDead()) {
enemiesSize--;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void update_location() throws Exception {\r\n\t\tif (children.size() == 1) {\r\n\t\t\tCLocation bloc = children.get(0).get_location();\r\n\t\t\tthis.location = bloc.get_source().get_location(bloc.get_bias(), bloc.get_length());\r\n\t\t} else if (children.size() > 1) {\r\n\t\t\tCLocation eloc = children.get(children.size() - 1).get_location();\r\n\t\t\tint beg = this.location.get_bias(), end = eloc.get_bias() + eloc.get_length();\r\n\t\t\tthis.location.set_location(beg, end - beg);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void updatePosition() {\n\t\t\n\t}",
"public void updateLocation();",
"@Override\n\tpublic void update() \n\t{\n\t\tPoint loc = getLocationCopy();\n\t\tEnemy c = game.findNearestEnemy(loc);\n\t\tif (c == null)\n\t\t\treturn;\n\t\t\n\t\tif(c.getLocation().distance(loc) < 100 && game.getFrameCount() % 30 == 0)\n\t\t{\n\t\t\tFlyingSalt s = new FlyingSalt(game, loc, \n\t\t\t\t\t\t\t\t\tc.getLocation().x - position.x,\n\t\t\t\t\t\t\t\t\tc.getLocation().y - position.y);\n\t\t\tgame.addAnimatable(s);\n\t\t}\n\t}",
"public void act() \n {\n setLocation(getX() + Hur_Speed, getY());\n }",
"@Override\r\n public void act() \r\n {\n int posx = this.getX();\r\n int posy = this.getY();\r\n //calculamos las nuevas coordenadas\r\n int nuevox = posx + incx;\r\n int nuevoy = posy + incy;\r\n \r\n //accedemos al mundo para conocer su tamaño\r\n World mundo = this.getWorld();\r\n if(nuevox > mundo.getWidth())//rebota lado derecho\r\n {\r\n incx = -incx;\r\n }\r\n if(nuevoy > mundo.getHeight())//rebota en la parte de abajo\r\n {\r\n incy = -incy;\r\n }\r\n \r\n if(nuevoy < 0)//rebota arriba\r\n {\r\n incy = -incy;\r\n }\r\n if(nuevox < 0)//rebota izquierda\r\n {\r\n incx = -incx;\r\n }\r\n //cambiamos de posicion a la pelota\r\n this.setLocation(nuevox,nuevoy);\r\n }",
"protected void update(){\n\t\t_offx = _x.valueToPosition(0);\n\t\t_offy = _y.valueToPosition(0);\n\t}",
"public abstract void updateLocations();",
"private void updatePosition(){\n updateXPosition(true);\n updateYPosition(true);\n }",
"@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }",
"public void update() {\n\t\tgetLocation().offsetX(getDirection().getXOffset());\n\t\tgetLocation().offsetY(getDirection().getYOffset());\n\t\t\n\t\tChunk center = World.getMap().getCenterChunk();\n\t\t\n\t\tint localX = (int) (getLocation().getX() - center.getData().getRealX());\n\t\tint localY = (int) (getLocation().getY() - center.getData().getRealY());\n\t\t\n\t\tif(localX < 0 ||localY< 0\n\t\t\t|| localX > 256 || localY > 256) {\n\t\t\t\tWorld.getMap().load(getLocation());\n\t\t}\n\t}",
"public void updateXLoc();",
"public void updateYLoc();",
"public static void affectLocation(Thing s, Thing caster, Map map, int tx, int ty) {\r\n \t\tif (s.handles(\"OnLocationEffect\")) {\r\n \t\t\t//Game.warn(\"loc effect!\");\r\n \t\t\tEvent e=new Event(\"LocationEffect\");\r\n \t\t\te.set(\"TargetMap\",map);\r\n \t\t\te.set(\"TargetX\",tx);\r\n \t\t\te.set(\"TargetY\",ty);\r\n \t\t\tif (s.handle(e)) return;\r\n \t\t}\r\n \t\t\r\n \t\tThing[] things=map.getThings(tx,ty);\r\n \t\tfor (int i=0; i<things.length; i++) {\r\n \t\t\tdoEffect(caster,s,things[i]);\r\n \t\t}\r\n \t}",
"public void act() \n {\n if(getY()>=30 && !cambia)\n {\n direccion = -1;\n }\n else\n {\n cambia = true;\n }\n if(getY() <= getWorld().getHeight()-30 && cambia)\n {\n direccion = 1;\n }\n else\n {\n cambia = false;\n }\n \n setLocation(getX(),getY()+(velocidad*direccion));\n reglas();\n ataque();\n \n \n \n }",
"public void move(){\n super.move();\n load.updateCoordinates(this.x,this.y);\n }",
"public void update(){\n\t\tdouble timeStep = (double) 1 / METERS_PER_X_TICKS;\n\t\t\n\t\tdouble newXVel = xVel + xAccel * timeStep;\n\t\tdouble newYVel = yVel + yAccel * timeStep;\n\t\t\n//\t\tdouble deltaX = timeStep * (xVel + newXVel) / 2;\n//\t\tdouble deltaY = timeStep * (yVel + newYVel) / 2;\n\t\t\n\t\tdouble deltaX = timeStep * xVel;\n\t\tdouble deltaY = timeStep * yVel;\n\t\t\n\t\txCoord += deltaX;\n\t\tyCoord += deltaY;\n\t\t\n\t\txVel = newXVel;\n\t\tyVel = newYVel;\n\t\t\n\t\t//record new location\n\t\tif(recordPath)\n\t\t\tmyEnviron.getEntityHistories().get(ID).add(new double[]{xCoord, yCoord, xVel, yVel});\n\t\t\n\t\tcontactBlock = null; // reset to the appropriate block during block collision process, if needed\n\t\tcontactBlockSideNum = -1;\n\t\tcontactBlockVertexNum = -1;\n\t\tlifetime++;\n\t}",
"public void setOriginalLocation() {\r\n for (int i = 0; i < this.enemies.size(); i++) {\r\n Point originalPoint = this.startLocations.get(i);\r\n this.enemies.get(i).setLocation(originalPoint);\r\n }\r\n }",
"public void actionPerformed(ActionEvent event) {\t// Positionsdaten der bewegbaren Objekte aktualisieren und im Anschluss neu zeichnen\n \tEnemy.move();\n\t Player.move();\n\t TemporaryItem.updater();\n\t //ProjectileManager.controlProjectiles();\n\t Projectile.move();\n\t DisplayManager.updateDisplayTimers();\n\t Traps.updater();\n\t\n\t Controls.controls.updateGamePad();\n \trepaint();\t\t// neu zeichnen\n }",
"@Override\n\tpublic void posModify() {\n\t\t\n\t}",
"@Override\n\tpublic void posModify() {\n\t\t\n\t}",
"public void updatePosition() {\n\n this.x = this.temp_x;\n this.y = this.temp_y;\n this.ax = 0;\n this.ay = 0;\n\t\tthis.axplusone = 0;\n this.ayplusone = 0;\n \n }",
"public void updatePlayerLocation() {requires new property on gamestate object\n //\n }",
"public void relocateToPoint(boolean isUserClick){\n// System.out.println(\"Scene x: \"+point.getX()+\", y: \"+point.getY());\n// System.out.println(\"Local x: \"+getParent().sceneToLocal(point).getX()+\", y: \"+getParent().sceneToLocal(point).getY());\n// System.out.println(\"Relocate x: \"+(getParent().sceneToLocal(point).getX() - (getWidth() / 2))+\", y: \"+(getParent().sceneToLocal(point).getY() - (getHeight() / 2)));\n// System.out.println(getBoundsInLocal().getWidth());\n// System.out.println(widthProperty());\n\n if (isUserClick) {\n double new_x=getParent().sceneToLocal(x,y).getX();\n double new_y=getParent().sceneToLocal(x,y).getY();\n setX(new_x);\n setY(new_y);\n relocate(\n// (getParent().sceneToLocal(x,y).getX() - (widthCountry / 2)),\n// (getParent().sceneToLocal(x,y).getY() - (heightCountry / 2))\n new_x,new_y\n );\n } else {\n relocate(x,y);\n }\n\n\n }",
"@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}",
"void update(Location location);",
"public void updatePosition() {\n \t\r\n \tx += dx;\r\n \ty += dy;\r\n \t\r\n\t}",
"@Override\n public final void updateOrigin() {\n }",
"public void updateLocation()\r\n {\r\n\t\timg.setUserCoordinator(latitude, longitude);\r\n\t\timg.invalidate();\r\n\t}",
"public void update(long delta){\n \n if(placement <= -1000){\n placement = zPosition;\n }\n placement -= 5;\n \n \n }",
"public void act() \n {\n World myWorld = getWorld();\n \n Mapa mapa = (Mapa)myWorld;\n \n EnergiaMedicZ vidaMZ = mapa.getEnergiaMedicZ();\n \n EnergiaGuerriZ vidaGZ = mapa.getEnergiaGuerriZ();\n \n EnergiaConstrucZ vidaCZ = mapa.getEnergiaConstrucZ();\n \n GasZerg gasZ = mapa.getGasZerg();\n \n CristalZerg cristalZ = mapa.getCristalZerg();\n \n BunkerZerg bunkerZ = mapa.getBunkerZerg();\n \n Mina1 mina1 = mapa.getMina1();\n Mina2 mina2 = mapa.getMina2();\n Mina3 mina3 = mapa.getMina3();\n \n \n //movimiento del personaje\n if(Greenfoot.isKeyDown(\"b\")){\n if(Greenfoot.isKeyDown(\"d\")){\n if(getX()<1000){\n setLocation(getX()+1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"a\")){\n if(getX()<1000){\n setLocation(getX()-1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"w\")){\n if(getY()<600){\n setLocation(getX(),getY()-1);\n }\n }\n if(Greenfoot.isKeyDown(\"s\")){\n if(getY()<600){\n setLocation(getX(),getY()+1);}\n }\n }\n else if(Greenfoot.isKeyDown(\"z\")){\n if(Greenfoot.isKeyDown(\"d\")){\n if(getX()<1000){\n setLocation(getX()+1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"a\")){\n if(getX()<1000){\n setLocation(getX()-1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"w\")){\n if(getY()<600){\n setLocation(getX(),getY()-1);\n }\n }\n if(Greenfoot.isKeyDown(\"s\")){\n if(getY()<600){\n setLocation(getX(),getY()+1);}\n }}\n //encuentro con objeto\n \n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"d\"))\n {\n setLocation(getX()-1,getY());\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"a\"))\n {\n setLocation(getX()+1,getY());\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"w\"))\n {\n setLocation(getX(),getY()+1);\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"s\"))\n {\n setLocation(getX(),getY()-1);\n }\n \n \n //probabilida de daño al enemigo\n \n if(isTouching(MedicTerran.class) && Greenfoot.getRandomNumber(100)==3)\n {\n \n vidaCZ.removervidaCZ();\n \n }\n \n if(isTouching(ConstructorTerran.class) && (Greenfoot.getRandomNumber(100)==3 ||\n Greenfoot.getRandomNumber(100)==2||Greenfoot.getRandomNumber(100)==1))\n {\n \n vidaCZ.removervidaCZ();\n \n }\n if(isTouching(GuerreroTerran.class) && (Greenfoot.getRandomNumber(100)==3||\n Greenfoot.getRandomNumber(100)==2||Greenfoot.getRandomNumber(100)==1||Greenfoot.getRandomNumber(100)==4||Greenfoot.getRandomNumber(100)==5))\n {\n \n vidaCZ.removervidaCZ();\n \n }\n \n \n \n //encuentro con Bunker\n \n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"d\"))\n {\n setLocation(getX()-1,getY());\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"a\"))\n {\n setLocation(getX()+1,getY());\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"w\"))\n {\n setLocation(getX(),getY()+1);\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"s\"))\n \n {\n setLocation(getX(),getY()-1);\n }\n \n //AccionesUnicas\n \n if(isTouching(YacimientoDeGas.class) && gasZ.gasZ < 100)\n {\n \n gasZ.addGasZ();\n \n }\n \n \n if(isTouching(Mina1.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina1.removemina1();\n \n }\n \n if(isTouching(Mina2.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina2.removemina2();\n \n }\n \n if(isTouching(Mina3.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina3.removemina3();\n \n }\n \n \n if(isTouching(DepositoZ.class) && gasZ.gasZ > 4 && bunkerZ.bunkerZ() < 400){\n \n gasZ.removeGasZ();\n bunkerZ.addbunkerZ();\n }\n \n if(isTouching(DepositoZ.class) && cristalZ.cristalZ() > 0 && bunkerZ.bunkerZ() < 400 ){\n \n cristalZ.removeCristalZ();\n bunkerZ.addbunkerZ();\n }\n \n //determinar si la vida llega a 0\n \n if( vidaCZ.vidaCZ <= 0 )\n {\n \n getWorld().removeObjects(getWorld().getObjects(EnergiaConstrucZ.class)); \n \n getWorld().removeObjects(getWorld().getObjects(ConstructorZerg.class));\n \n EnergiaZerg energiaZ = mapa.getEnergiaZerg(); \n \n energiaZ.removenergiaCZ();\n }\n \n if( mina1.mina1() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina1.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal1.class));\n \n }\n \n if( mina2.mina2() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina2.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal2.class));\n \n }\n \n if( mina3.mina3() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina3.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal3.class));\n \n }\n \n \n}",
"void updatePosition() {\n\t\t\n\t\tcoords.x = body.getPosition().x*Simulation.meterToPixel;\n\t\tcoords.y = body.getPosition().y*Simulation.meterToPixel;\n\t\tspeed.x = body.m_linearVelocity.x;\n\t\tspeed.y = body.m_linearVelocity.y;\n\t}",
"@Override\n public void update(){\n getNextPosition();\n checkTileMapCollision();\n setPosition(xtemp, ytemp);\n animation.update();\n }",
"void effect(Entity e, BoardPosition bp);",
"@Override\n\t\tpublic void update() {\n\t\t\tif(!Mouse.isDragging) return;\n\t\t\t\n\t\t\tfor(Editable editable : ServiceLocator.getService(EditorSystem.class).getSelectedEditables()){\n\t\t\t\teditable.getEntity().getComponent(Transform.class).setPosition(Mouse.worldCoordinates.copy());//.sub(SelectionTypeState.mouseClickWorldPosition).add(SelectionTypeState.colliderPositions.get(cnt)));\n\t\t\t}\n\t\t}",
"void setPositionEffect(PositionEffect inPositionEffect);",
"private void update() {\n int curRegionX = client.getRegionBaseX();\n int curRegionY = client.getRegionBaseY();\n if(lastRegionX != curRegionX || lastRegionY != curRegionY) {\n //Search for Altars:\n altars.clear();\n Landscape.accept(new LandscapeVisitor() {\n @Override\n public void acceptObject(RSEntityMarker marker) {\n int id = UID.getEntityID(marker.getUid());\n RSObjectDefinition def = client.getObjectDef(id);\n if(def == null || def.getName() == null) return;\n if(def.getName().equals(\"Altar\")) {\n altars.add(marker);\n }\n }\n });\n }\n }",
"public void update(MazeEventPickup e) {\r\n }",
"public Location changeLocation(Entity entity) {\r\n\r\n // Clone current location with all of its data like rotate, yaw, pitch, etc...\r\n Location newLoc = entity.getLocation().clone();\r\n\r\n // Get new y\r\n double newY = (worldToIsBelow)\r\n ? yTo - Math.ceil(entity.getHeight())\r\n : yTo + Math.ceil(entity.getHeight());\r\n\r\n // Change y to new y\r\n newLoc.setY(newY);\r\n\r\n // Change world\r\n newLoc.setWorld(worldTo);\r\n\r\n return newLoc;\r\n }",
"@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}",
"public void updatePosition(Location loc)\n {\n position = new BlockVector(loc.getX(), loc.getY(), loc.getZ());\n }",
"public void act() \n {\n move(-16);\n \n \n if (isAtEdge())\n {\n setLocation(700,getY());\n }\n \n if (isTouching(Shots.class))\n {\n getWorld().addObject(new SpaceObject(), 500,Greenfoot.getRandomNumber(400));\n }\n \n }",
"@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}",
"@Override\n public void update(float delta) {\n // Make sure to COPY the vector and not copy the reference\n position = new Vector3f(entity.getPosition()).add(offset);\n }",
"public void setLocation(float x, float y);",
"public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"private void updateCurrentTarget(){\n switch (state){\n case States.DEAD:\n currentTarget = currentLocation;\n break;\n case States.FIGHT:\n if (targetEnemy != null)\n currentTarget = targetEnemy.getCurrentLocation();\n else\n currentTarget = targetBuilding.getLocation();\n break;\n case States.RETREAT:\n currentTarget = new Point(20,20);\n break;\n case States.LOSS:\n currentTarget = new Point(20,20);\n break;\n case States.WIN:\n currentTarget = village.getCenter();\n break;\n case States.IDLE:\n currentTarget = targetBuilding.getLocation();\n }\n }",
"public void changeLocation(World newWorld, int x, int y, DIRECTION facing, Color color);",
"public void editShiftAction() {\n\t\tArrayList<SpatialObjectModel> locations = (ArrayList<SpatialObjectModel>) getSpatialObjects();\n\t\tthis.animalShiftEditPanel = new AnimalShiftEditPanel(animalsTab, locations);\n\t\tUtils.changePanelContent(this.animalsTab, this.animalShiftEditPanel);\n\t}",
"public void adjLocation(double l){this.PlayerLocation;}",
"@Test\n public void testAct() {\n world.add(new Location(2, 0), jumper);\n jumper.act();\n jumper.act();\n assertEquals(new Location(0, 0), jumper.getLocation());\n jumper.act();\n jumper.act();\n assertEquals(new Location(0, 2), jumper.getLocation());\n }",
"public void changePositionOfAdjuster() {\n final float txOffset = currentSittingTranslationX;\n final float tyOffset = currentSittingTranslationY;\n final float tzOffset = currentSittingTranslationZ;\n float rxOffset = currentSittingRotationX;\n float ryOffset = currentSittingRotationY;\n float rzOffset = currentSittingRotationZ;\n \n //get cell transform of the sceneroot of cell\n CellRendererJME ret = (CellRendererJME) editor.getCell().getCellRenderer(Cell.RendererType.RENDERER_JME);\n Entity mye = ret.getEntity();\n RenderComponent rc = (RenderComponent) mye.getComponent(RenderComponent.class);\n Node localNode = rc.getSceneRoot();\n Vector3f v3fa = localNode.getWorldTranslation();\n Quaternion quata = localNode.getWorldRotation();\n float[] angles = new float[3];\n angles = quata.toAngles(angles);\n\n //prepare the translation values\n final float tx = v3fa.x + txOffset;\n final float ty = v3fa.y + tyOffset;\n final float tz = v3fa.z + tzOffset;\n\n //prepare the rotation values\n //add 20 degree to y as an adjuster\n final float rx = (float) Math.toRadians((rxOffset + Math.toDegrees(angles[0])));\n final float ry = (float) Math.toRadians((ryOffset + Math.toDegrees(angles[1]) + 20.0f));\n final float rz = (float) Math.toRadians((rzOffset + Math.toDegrees(angles[2])));\n\n //apply the changes\n final WorldManager wm = ClientContextJME.getWorldManager();\n RenderUpdater u = new RenderUpdater() {\n public void update(Object obj) {\n SitAdjusterEntity.getInstance(editor.getCell()).getRootNode()\n .setLocalTranslation(tx, ty, tz);\n SitAdjusterEntity.getInstance(editor.getCell()).getRootNode()\n .setLocalRotation(new Quaternion(new float[]{rx, ry, rz}));\n WorldManager wm = ClientContextJME.getWorldManager();\n wm.addToUpdateList(SitAdjusterEntity.getInstance(editor.getCell()).getRootNode());\n }\n };\n wm.addRenderUpdater(u, this);\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\tAsset asset = ((ImageFileImagePanelModel)imagePanel.getModel()).getAsset(index);\n\t\t\t\t\t\t\tif (!AssetManager.hasAsset(asset)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tAssetManager.putAsset(asset);\n\t\t\t\t\t\t\t\tMapTool.serverCommand().putAsset(asset);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tZone zone = new Zone(asset.getId());\n\t\t\t\t\t\t\tzone.setType(Zone.Type.MAP);\n\t\t\t\t\t\t\t\n\t\t MapTool.addZone(zone);\n\t\t\t\t\t\t}",
"@Override\n\tpublic void update(CorsoDiLaurea corso) {\n\t\t\n\t}",
"@Override\n public void move() {\n _location.x++;\n }",
"@Override\n\tpublic void update() {\n\t\t\n\t\tif(!this.explShowing)\n\t\t{\n\t\t\tx+= dx;\n\t\t\ty+= dy;\n\t\n\t\t\tif(x < 0)\n\t\t\t{\n\t\t\t\tx = 0;\n\t\t\t\tdx = dx *-1;\n\t\t\t}\n\t\t\telse\n\t\t\tif(x + w > MainGame.getInstance().X_WORLD_END)\n\t\t\t{\n\t\t\t\tx = MainGame.getInstance().X_WORLD_END - w ;\n\t\t\t\tdx = dx *-1;\t\n\t\t\t}\n\t\n\t\t\tif(y < 0)\n\t\t\t{\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t\telse\n\t\t\tif(y + h > MainGame.getInstance().Y_WORLD_END)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t}\n\t\t\n\t\ts.update();\n\t\n\t\tif(this.explShowing)\n\t\t{\n\t\t\tif(expl.isHasFinished())\n\t\t\t{\n\t\t\t\texplShowing = false;\n\t\t\t\ts = this.normalImage;\n\t\t\t\tthis.x = this.xStart;\n\t\t\t\tthis.y = this.yStart;\n\t\t\t\ts.setX(this.xStart);\n\t\t\t\ts.setY(this.yStart);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//s.setX(x);\n\t\t//s.setY(y);\n\t\t\n\t\tthis.rect.setFrame(getX(),getY(),getW(),getH());\t\n\t}",
"private void updateLocation() {\n myLocationOnScreenRef.set(myComponent.getLocationOnScreen());\n }",
"public void update(MazeEventTeleported e) {\r\n }",
"private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }",
"public void expLocation() {\n\t\tif (!death) {\t// Geht nicht wenn Tod!\n\t\t\t\n\t\t\t// Beschreibungen anzeigen und boolean explored auf wahr setzen, außer der Raum wurde bereits untersucht\n\t\t\tif (location[this.currentLocation].isExplored()) { Tuna.setMessage(\"Dieser Raum wurde bereits untersucht!\");\n\t\t\t} else {\n\t\t\t\tTuna.addText(location[this.currentLocation].getDescriptions().getExploreDescription());\n\t\t\t\tlocation[this.currentLocation].setExplored(true);\n\t\t\t}\n\t\t\t\n\t\t\t// Items an Stelle null im Item-Array des Standortes sichtbar machen\n\t\t\tif ((currentLocation > 0 && currentLocation < 7 && currentLocation != 2) || currentLocation == 20) {\n\t\t\t\tlocation[this.currentLocation].getItem(0).setVisible(true);\n\t\t\t\t/* Im Korridor (1) der Kaffeelöscherkasten\n\t\t\t\t * Im Konferenzraum (3) der Ventilationsschacht\n\t\t\t\t * In der Kammer der Leere (4) die Notiz\n\t\t\t\t * Im Ventilationsraum (5) die Notiz\n\t\t\t\t * In der Damentoilette (6) das Skillboook\n\t\t\t\t * Im Fahrstuhlschacht (20) die Kaffeetasse\n\t\t\t\t */\n\t\t\t}\n\t\t\t\n\t\t\t// Items an Stelle eins im Item-Array des Standortes sichtbar machen\n\t\t\tif (currentLocation == 9) {\n\t\t\t\tlocation[this.currentLocation].getItem(1).setVisible(true);\n\t\t\t}\n\t\t} else if (death) {\n\t\t\tTuna.setMessage(\"Du bist tot!\");\n\t\t}\n\t}",
"public void update(MazeEvent e) {\r\n\r\n }",
"public void update(MazeEventInfoField e) {\r\n }",
"public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }",
"protected void updateLocation (BodyObject source, Location loc)\n {\n SceneLocation sloc = new SceneLocation(loc, source.getOid());\n if (!_ssobj.occupantLocs.contains(sloc)) {\n // complain if they don't already have a location configured\n Log.warning(\"Changing loc for occupant without previous loc \" +\n \"[where=\" + where() + \", who=\" + source.who() +\n \", nloc=\" + loc + \"].\");\n _ssobj.addToOccupantLocs(sloc);\n } else {\n _ssobj.updateOccupantLocs(sloc);\n }\n }",
"@Override\r\n\tpublic void move()\r\n\t{\r\n\t\t//Updates the X and Y position by using dx and dy\r\n float x = location.getX() + dx;\r\n float y = location.getY() + dy;\r\n \r\n //Updates the particle emitter's position to the missiles current position\r\n emitter.setPosition(this.getPositionX(), this.getPositionY(),false);\r\n \r\n //Updates the location of the missile\n setLocation(x, y);\n\t}",
"@Override\n public void onLocationChanged(Location loc)\n {\n \t\n \tint lat = (int) (loc.getLatitude() * 1E6);\n\t\t\tint lng = (int) (loc.getLongitude() * 1E6);\n\t\t\t point = new GeoPoint(lat, lng);\n\t\t\t \n\t\t\t /** remove the previous overlay so the another\n\t\t\t can be added **/\n\t\t\t itemizedOverlay.removeOverlay(0);\n\t\t\t \n\t\t\n\t\t\t //this follows the same steps in the OnCreate function at start up.\n\t\t\t // //Initialize a normal MapOVerlay item with new point.\n\t\t\t OverlayItem overlayitem = new OverlayItem(point, \"kiddda!\", \"sasri kal!\");\n\t\t \n\t\t itemizedOverlay.addOverlay(overlayitem);\n\t\t mapOverlays.add(itemizedOverlay);\n\t\t // move to new point.\n\t\t\tcontroller.animateTo(point); \n\t\t\t \n\t\n\t\t\t//debug message to say the location has been read.\n\t\t\tLog.i(\"Listener\", \"location read\");\n\t\t\t \n\t\t\n\n\t\t \n // String Text = \"My current location is: \" +\n\t\t\tLog.i(\"service check\",\" Latitude = \" + loc.getLatitude() +\n \" Longitude = \" + loc.getLongitude());\n \n // Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_LONG).show();\n \n }",
"@Override\n\tpublic void act(float delta) {\n\t\tsuper.act(delta);\n\t\t\n\t\tif(PWM.instance().pointIsInObstacle(this.getX(), this.getY())){\n\t\t\tif(!PWM.instance().pointIsInObstacle(this.getX(), lastPos.y)){\n\t\t\t\tthis.setPosition(this.getX(), lastPos.y);\n\t\t\t}else if(!PWM.instance().pointIsInObstacle(lastPos.x, this.getY())){\n\t\t\t\tthis.setPosition(lastPos.x, this.getY());\n\t\t\t}else{\n\t\t\t\tthis.setPosition(lastPos.x, lastPos.y);\n\t\t\t}\n\t\t\t\n\t\t\tthis.lastPos.x = this.getX();\n\t\t\tthis.lastPos.y = this.getY();\n\t\t\t\n\t\t}\t\t\t\t\n\t\t\n\t\tmainCameraFollowHero();\n\t\t\n\t\t\n\t}",
"public void update() {\n\t\tVec2 newPos = calculatePos();\n\t\t/* energy bar */\n\t\tfloat newEnergy = actor.getEnergy();\n\t\tfloat maxEnergy = actor.getEnergyLimit();\n\t\tenergy.setPosition(newPos.getX(), newPos.getY() + paddingHealth / Application.s_Viewport.getX(), newEnergy,\n\t\t\t\tmaxEnergy);\n\t\t/* health bar */\n\t\tfloat newHealth = actor.getHealth();\n\t\tfloat maxHealth = actor.getHealthLimit();\n\t\thealth.setPosition(newPos.getX(), newPos.getY() + paddingEnergy / Application.s_Viewport.getX(), newHealth,\n\t\t\t\tmaxHealth);\n\t\t/* name label */\n\t\tplayerName.setPosition(newPos.getX(), newPos.getY() + paddingName / Application.s_Viewport.getY());\n\t}",
"@Override\n\tpublic void onLocationChanged(Location location) {\n\t\t if (location != null) {\n\t\t //punto = location;\n\t\t GeoPoint puntoCap = new GeoPoint(location);\n\t\t this.posicionActualOverlay.setLocation(puntoCap);\n\t\t mapView.getController().animateTo(puntoCap);\n\t\t mapView.getController().setCenter(puntoCap);\n\t\t }\n\t\t\n\t}",
"public void update() {\n\n if (!isSelected){\n goalManagement();\n }\n\n if (chair != null){ // si une chaise lui est désigné\n if (!hasAGoal && !isSelected){ // et qu'il n'a pas d'objectif\n setSit(true);\n position.setX(chair.getX());\n }\n\n if (isSit){\n chair.setChairState(Chair.ChairState.OCCUPIED);\n }else {\n chair.setChairState(Chair.ChairState.RESERVED);\n }\n }\n\n if (tired > 0 ){\n tired -= Constants.TIRED_LOSE;\n }\n\n if (isSit && comfort>0){\n comfort -= Constants.COMFORT_LOSE;\n }\n\n if (isSitOnSofa && comfort<100){\n comfort += Constants.COMFORT_WIN;\n }\n\n if (!hasAGoal && moveToCoffee && coffeeMachine!=null){\n moveToCoffee = false;\n tired=100;\n\n coffeeMachine.setCoffeeTimer(new GameTimer()) ;\n coffeeMachine.getCoffeeTimer().setTimeLimit(Constants.COFFEE_TIME_TO_AVAILABLE);\n coffeeMachine = null;\n backToSpawn();\n }\n\n if (!hasAGoal && moveToSofa){\n moveToSofa = false;\n isSitOnSofa = true;\n dir = 0 ;\n position.setY(position.getY()-Constants.TILE_SIZE);\n }\n\n if (isSelected){\n flashingColor ++;\n if (flashingColor > 2 * flashingSpeed){\n flashingColor = 0;\n }\n }\n\n }",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"public void changed(LocationEvent arg0) {\n \t\t\t\t\t\t\n \t\t\t\t\t}",
"public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}",
"public void changeLocation(int newLocation) {\t\t\t\t\t\t\t\t\t\t\t\t// Methode zum Raum wechseln. Übergeben wird der neue Standort\n\t\tif(!battle && !death) {\n\t\t\tboolean positionChange = false;\n\t\t\tthis.lockerQuestion = false;\t\t\t \t\t\t\t\t\t\t\t\t\t\t// Abbruch des Minievents\n\t\t\t\n\t\t\tswitch (newLocation) {\n\n\t\t\t// Büro\n\t\t\tcase 0:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 0 || beam) {\n\t\t\t\t\tif (currentLocation == 0) { Tuna.setMessage(\"Du bist schon in deinem Büro!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Location setzen\n\t\t\t\t\t\tthis.currentLocation = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in dein Büro.\");\t\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Korridor\n\t\t\tcase 1:\n\t\t\t\tif (currentLocation == 0 || currentLocation == 1 || currentLocation == 2 || currentLocation == 3 || currentLocation == 6 || currentLocation == 7 || currentLocation == 8\n\t\t\t\t\t\t|| currentLocation == 9 || currentLocation == 10 || beam) {\n\t\t\t\t\tif (currentLocation == 1) { Tuna.setMessage(\"Du bist schon im Korridor!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Korridor.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Tödlicher Kaffeeraum\n\t\t\tcase 2:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 2 || currentLocation == 3 || currentLocation == 4 || beam) {\n\t\t\t\t\tif (currentLocation == 2) { Tuna.setMessage(\"Du bist schon im Kafferaum!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 2;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Kaffeeraum.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Konferenzraum\n\t\t\tcase 3:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 2 || currentLocation == 3 || currentLocation == 4 || currentLocation == 5 || beam) {\n\t\t\t\t\tif (currentLocation == 3) { Tuna.setMessage(\"Du bist schon im Konferenzraum!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 3;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Konferenzraum.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Kammer der Leere\n\t\t\tcase 4:\n\t\t\t\tif (location[4].isVisible()) {\n\t\t\t\t\tif (currentLocation == 2 || currentLocation == 4 || beam) {\n\t\t\t\t\t\tif (currentLocation == 4) { Tuna.setMessage(\"Du bist schon in der Kammer der Leere!\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\t\tthis.currentLocation = 4;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tTuna.setText(\"Du gehst in die Kammer der Leere.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbeep();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Ventilationsraum\n\t\t\tcase 5:\n\t\t\t\tif (location[5].isVisible()) {\n\t\t\t\t\tif (currentLocation == 3 || currentLocation == 5 || beam) {\n\t\t\t\t\t\tif (currentLocation == 5) { Tuna.setMessage(\"Du bist schon im Ventilationsraum!\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\t\tthis.currentLocation = 5;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tTuna.setText(\"Du gehst in den Ventilationsraum.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbeep();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Damen Toiletten\n\t\t\tcase 6:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 6 || beam) {\n\t\t\t\t\tif (currentLocation == 6) { Tuna.setMessage(\"Du bist schon in der Damentoilette!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 6;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in die Damentoilette.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t\tlocation[6].getDescriptions().setDefaultDescription(\"Dies ist die Damentoilette.\"\n\t\t\t\t\t\t\t\t+ \"\\nDu fragst dich, ob du einen bestimmten Grund hast, hier zu sein, oder einfach die Tür verwechselt hast.\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Herren Toiletten\n\t\t\tcase 7:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 7 || beam) {\n\t\t\t\t\tif (currentLocation == 7) { Tuna.setMessage(\"Du bist schon in der Herrentoilette!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 7;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in die Herrentoilette.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Schulleiterzimmer\n\t\t\tcase 8:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 8 || beam) {\n\t\t\t\t\tif (currentLocation == 8) { Tuna.setMessage(\"Du bist schon im Schulleiterzimmer!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 8;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in das Schulleiterzimmer.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\n\t\t\t// Fahrstuhl\n\t\t\tcase 9:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 9 || beam) {\n\t\t\t\t\tif (currentLocation == 9) { Tuna.setMessage(\"Du bist schon im Fahrstuhl!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 9;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Fahrstuhl.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Treppenhaus\n\t\t\tcase 10:\n\t\t\t\tif (currentLocation == 1 || currentLocation == 10 || currentLocation == 11 || beam) {\n\t\t\t\t\tif (currentLocation == 10) { Tuna.setMessage(\"Du bist schon im Treppenhaus!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 10;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in das Treppenhaus.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// Korridor Etage 1\n\t\t\tcase 11:\n\t\t\t\tif (location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 10 || currentLocation == 11 || currentLocation == 12 || currentLocation == 13 || currentLocation == 14 || currentLocation == 15 || currentLocation == 16 || currentLocation == 17 || currentLocation == 18 || currentLocation == 19 || beam) {\n\t\t\t\t\t\tif (currentLocation == 11) { Tuna.setMessage(\"Du bist schon im Korridor der 1 Etage!\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\t\tthis.currentLocation = 11;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tTuna.setText(\"Du gehst in den Korridor.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTuna.setText(\"Du bist am Feuer gestorben. Kaffee wäre spannender gewesen!\"\n\t\t\t\t\t\t\t+ \"\\n\\n\\n<respawn>, um von vorne anzufangen!\");\n\t\t\t\t\tdeath = true;\n\t\t\t\t\tif (amountNotes != 0) {\n\t\t\t\t\t\tTuna.addText(\"\\n\\nDa du bereits Notizen eingesammelt hast, die jetzt verbrannt sind, solltest du das Spiel neu starten [restart].\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Hörsaal 1\n\t\t\tcase 12:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 12 || beam) && location[11].isVisible()) { // Wichtig, dass man bei vorhanden sein des Feuers sich nicht schon in die untere Etage beamen kann, auch für die nächsten Fälle\n\t\t\t\t\tif (currentLocation == 12) { Tuna.setMessage(\"Du bist schon in Hörsaal 1!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\n\t\t\t\t\t\tthis.currentLocation = 12;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Hörsal 1\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Spindraum\n\t\t\tcase 13:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 13 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 13) { Tuna.setMessage(\"Du bist schon im Spindraum!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 13;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Spindraum.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// Abstellraum\n\t\t\tcase 14:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 14 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 14) { Tuna.setMessage(\"Du bist schon im Abstellraum!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 14;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Abstellraum.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Hörsaal 2\n\t\t\tcase 15:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 15 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 15) { Tuna.setMessage(\"Du bist schon in Hörsaal 2!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\n\t\t\t\t\t\tthis.currentLocation = 15;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Hörsal 2\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Hörsaal 3\n\t\t\tcase 16:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 16 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 16) { Tuna.setMessage(\"Du bist schon in Hörsaal 3!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\n\t\t\t\t\t\tthis.currentLocation = 16;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Hörsal 3\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Hörsaal 4\n\t\t\tcase 17:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 17 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 17) { Tuna.setMessage(\"Du bist schon in Hörsaal 4!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\n\t\t\t\t\t\tthis.currentLocation = 17;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in den Hörsal 4\");\n\t\t\t\t\t}\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Damentoilette Etage 1\n\t\t\tcase 18:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 18 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 18) { Tuna.setMessage(\"Du bist schon in der Damentoilette!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 18;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in die Damentoilette.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t \n\t\t\t// Herrentoilette Etage 1\n\t\t\tcase 19:\n\t\t\t\tif ((currentLocation == 11 || currentLocation == 19 || beam) && location[11].isVisible()) {\n\t\t\t\t\tif (currentLocation == 19) { Tuna.setMessage(\"Du bist schon in der Herrentoilette!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\tthis.currentLocation = 19;\n\t\t\t\t\t\t\n\t\t\t\t\t\tTuna.setText(\"Du gehst in die Herrentoilette.\");\t\t// Text zurück setzen mit Hinweis der aktuellen Position\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (location[11].isVisible()) {\n\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t} else if (!location[11].isVisible()) {\t\t\t\t\t// Meldung, wenn das Feuer noch nicht gelöscht wurde\n\t\t\t\t\tTuna.setMessage(\"Nene, so nicht!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// Fahrstuhlschacht\n\t\t\tcase 20:\n\t\t\t\tif (location[20].isVisible()) {\n\t\t\t\t\tif (currentLocation == 9 || currentLocation == 20 || beam) {\n\t\t\t\t\t\tif (currentLocation == 20) { Tuna.setMessage(\"Du bist schon im Fahrstuhlschacht!\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositionChange = true;\t\t\t\t\t\t\t// Positionswechsel ist möglich\n\t\t\t\t\t\t\tthis.lastLocation = this.currentLocation;\t\t// Locations setzen\n\t\t\t\t\t\t\tthis.currentLocation = 20;\n\t\t\t\t\t\t\tTuna.setText(\"Du kletterst den Gullideckel runter, obwohl, eigentlich fällst du eher. Du kriegst es auch irgendwie hin, den Gullideckel über dir wieder zuzuschieben.\");\n\t\t\t\t\t\t\tlocation[20].setVisible(false);\t\t\t\t\t// Der Raum soll nicht wieder begehbar sein\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTuna.setMessage(\"Du hast noch keine Beamfunktion!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbeep();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Wenn der Positionswechsel auf wahr (also möglich) gesetzt wurde soll folgendes gemacht\n\t\t\tif (positionChange) {\n\t\t\t\t// Ausgänge setzen\n\t\t\t\tTuna.setExitsContent(location[newLocation].getExits());\n\t\t\t\t\n\t\t\t\t// Beschreibungen\n\t\t\t\tif (!battle) {\n\t\t\t\t\tif (location[currentLocation].isExplored()) {\n\t\t\t\t\t\tTuna.addText(location[currentLocation].getDescriptions().getAlreadyExploredDescription());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTuna.addText(location[currentLocation].getDescriptions().getDefaultDescription());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t} else if (battle) {\n\t\t\tTuna.setMessage(\"Du befindest dich im Kampf!\");\n\t\t} else if (death) {\n\t\t\tTuna.setMessage(\"Du bist tot!\");\n\t\t}\n\t}",
"void updateStepCoordiantes(){\n if(xIncreasing) {\n lat = lat + STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat + STEP_LENGTH*yCompMotion*degToMRatio;\n }\n else{\n lat = lat - STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat - STEP_LENGTH*yCompMotion*degToMRatio;\n }\n if(yIncreasing) {\n lon = lon + STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon + STEP_LENGTH*xCompMotion*degToMRatio;\n }\n else{\n lon = lon - STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon - STEP_LENGTH*xCompMotion*degToMRatio;\n }\n }",
"@Test\n public void testAct() {\n world.add(new Location(FOUR , FOUR), jumper);\n jumper.act();\n jumper.act();\n assertEquals(new Location(ZERO, FOUR), jumper.getLocation());\n }",
"@Override\n public void recalculatePositions() { \n \n }",
"public void update(MazeEventEnemyWalked e) {\r\n }",
"public void update(MazeEventWon e) {\r\n }",
"public void update() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < columns; j++) {\n Point point = getPointAtLocation(i, j);\n WorldItem item = point.getContainedItem();\n calculatePointTemp(point);\n point.update();\n if (item instanceof FlammableItem) {\n updateIgnition(point);\n } else if (item instanceof SimulatedSensor) {\n updateAlarm(point);\n }\n }\n }\n }",
"public void update(MazeEventPushed e) {\r\n }",
"protected void onUpdated( E entity, GameState state, int index )\r\n\t{\r\n\t\t\r\n\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tregistro.setLocation(thisobject.getX()+100, thisobject.getY());\n\t\t\t\tregistro.setVisible(true);\n\t\t\t}",
"public void update()\r\n {\n for (MapObject mo : gameData.getMap().getObjects())\r\n {\r\n mo.getAI().advance();\r\n }\r\n \r\n // update the UI\r\n for (UIElement uiEl : ui.getUIElements())\r\n {\r\n uiEl.update();\r\n }\r\n\r\n // Move the map objects\r\n movHandler.moveObjects();\r\n\r\n // Refresh the screen position\r\n Player player = gameData.getPlayer();\r\n this.centerScreen((int) player.getX() + Tile.TILESIZE / 2, (int) player.getY() + Tile.TILESIZE / 2);\r\n }",
"public void act() \n {\n // Add your action code here.\n \n //setRotation();\n setLocation(getX(),getY()+2);\n movement();\n \n }",
"@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}",
"@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}",
"public void moveRobber(HexLocation loc) {\n\n\t}",
"public void changePos(double xP, double yP){ \n this.xCoor += xP;\n this.yCoor += yP;\n \n }",
"private Steak(ZooPanel refToZooPanel){\n\t\tpan = refToZooPanel;\n\t\tloadImages(null);\n\t\tint x = (pan.getWidth() - img.getWidth(null)) / 2;\n\t\tint y = (pan.getHeight() - img.getHeight(null)) / 2;\n\t\tlocation = new Point(x + 175,y + 100);\n\t}",
"protected void moveEast(){\n\t\tcar.setXLocation(currentX + 1);\n\t\tcurrentX += 1;\n\t}",
"public void makesHereBack(){this.piece.affect();}",
"@Override\r\n\tpublic void updatePosition(int id, float[] pos) {\n\r\n\t}",
"void setEnemyPos(Point2D pos);",
"@Override\r\n\tpublic void Update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void Update() {\n\t\t\r\n\t}",
"void setLocation(int x, int y);",
"public void act(){\n // Removing object, if out of the simulated zone\n if (atWorldEdge()){\n getWorld().removeObject(this);\n return;\n }\n\n //Move Thanos up\n setLocation (getX(), getY() - speed);\n }",
"void updatePosition() {\n if (gameScreen.cursorIsOnLeft()) \n {\n // set the panel's rightmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 11/12 - getWidth(), \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n else // Otherwise the cursor must be on the right half of the screen\n {\n // set the panel's leftmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 1/12, \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n }",
"public void update(){\r\n\t\t\r\n\t}"
] | [
"0.6861777",
"0.67472553",
"0.66451395",
"0.6483603",
"0.6475358",
"0.6456185",
"0.64536095",
"0.63089585",
"0.62418747",
"0.6203149",
"0.6196039",
"0.61919993",
"0.618857",
"0.6155635",
"0.61126286",
"0.60969734",
"0.609569",
"0.6044318",
"0.6026251",
"0.60257155",
"0.60257155",
"0.6004802",
"0.60040474",
"0.60006106",
"0.5995162",
"0.59838074",
"0.5980708",
"0.5966185",
"0.5964395",
"0.5963666",
"0.59478873",
"0.594236",
"0.5929404",
"0.5925196",
"0.59185046",
"0.591384",
"0.5911344",
"0.59044033",
"0.5888531",
"0.5888172",
"0.5886496",
"0.5883414",
"0.58620137",
"0.585766",
"0.5850435",
"0.58500564",
"0.5837807",
"0.5833668",
"0.58302826",
"0.58227247",
"0.5821841",
"0.58176595",
"0.5813548",
"0.58129424",
"0.5790395",
"0.57890433",
"0.57731676",
"0.57716984",
"0.5770151",
"0.5752306",
"0.5743584",
"0.57363856",
"0.5734184",
"0.57241374",
"0.5717452",
"0.57163143",
"0.5716277",
"0.57099104",
"0.5696606",
"0.56914073",
"0.5683988",
"0.56801844",
"0.56793356",
"0.5655123",
"0.56548727",
"0.5651803",
"0.5640516",
"0.5639615",
"0.56383264",
"0.5632903",
"0.5624684",
"0.5620233",
"0.5615048",
"0.5614451",
"0.5612583",
"0.5611007",
"0.56095296",
"0.56095296",
"0.5605623",
"0.560511",
"0.5600032",
"0.5597474",
"0.55972064",
"0.5596667",
"0.5594277",
"0.5594066",
"0.5594066",
"0.5592722",
"0.5591154",
"0.5590347",
"0.55894655"
] | 0.0 | -1 |
EFFECTS: get number of dead enemies | public int getNumDead() {
int count = 0;
for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {
if (entry.getValue().isDead()) {
count++;
}
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int nbEnemiesAlive(){\n return state.getPlayers().size()-1;\n }",
"public int howManyHeroDead() {\r\n int count;\r\n count = 0;\r\n for (Hero h: team) {\r\n if (h.isDead()) {\r\n count = count + 1;\r\n }\r\n }\r\n return count;\r\n }",
"public int getRemainingEnemies(){\n return mNumberOfEnemies - (mEnemyIndex + 1);\n }",
"public int getTotalEnemies() {\n\t\treturn totalEnemies;\n\t}",
"public int size() {\n return enemies.size();\n }",
"public static int getEnemyLives(){\n return 1 + currentLvl * 2;\n\n }",
"@Override\n\tpublic int getEnemyCount() {\n\t\treturn 0;//enNum;\n\t}",
"public int isSafe(){\n int nbEnnemies = 0;\n List<Player> players = state.getPlayers();\n Player currentPlayer = state.getCurrentPlayer();\n for(Player p : players){\n if(!p.equals(currentPlayer)) {\n nbEnnemies += currentPlayerReachable(state.getCurrentPlayer(), p);\n //nbEnnemies += manhattan(currentPlayer, p); //naive version\n }\n }\n return nbEnnemies;\n }",
"public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}",
"public double bossHealth(ArrayList<Enemy> currentEnemies) {\n return -1;\n }",
"private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }",
"public void damageTargets(List<Slicer> activeEnemies) {\n // Create list of explosives that have been detonated (regardless of they have hit enemies)\n // These explosives will be removed from the map\n List<Explosive> detExp = new ArrayList<>();\n for (int i=0; i<this.explosives.size(); i++) {\n Explosive explosive = this.explosives.get(i);\n if (explosive != null && explosive.getDetTime()>=DET_TIME) {\n numDetonated++;\n detExp.add(explosive);\n // Checks if enemy is in the area\n // Does damage accordingly\n for (Slicer target: activeEnemies) {\n if (explosive.getCenter().distanceTo(target.getCenter()) <= getEffectRadius()) {\n target.reduceHealth(getDamage());\n }\n }\n }\n }\n // Removes all explosives that have detonated\n explosives.removeAll(detExp);\n }",
"public int useBomb(){\n //do harm while the animation start\n //cause harm to the boss\n println(\"BEFORE Main.boss.health: \"+Main.boss.health);\n int count = 0;\n if ((Main.boss.alive) && (Main.boss.posY != -1)){\n Main.boss.decreaseHealth(10);\n if(Main.boss.health <= 0){\n Main.boss.alive = false;\n Main.boss.deadTime = millis();\n Main.score += 100;\n bossKilled = true;\n }\n }\n println(\"AFTER Main.boss.health: \"+Main.boss.health);\n //remove all bullets\n Main.boss.emptyBullets();\n //kill all the enemies\n for(int j = 0; j < Main.enemies.size(); j++){\n Enemy tempEnemy = Main.enemies.get(j);\n tempEnemy.alive = false;\n tempEnemy.deadTime = millis();\n count ++;\n }\n // fill(0,0,0);\n // rect(0,0,width,height);\n return count;\n }",
"public int getDeaths()\n\t{\n \treturn currentDeath;\n\t}",
"void deathHandler(Enemy e) {\n\n if (e != null) {\n Explosion rip = new Explosion();\n rip.kaboom.moveToPoint(e.eTank.getX(), e.eTank.getY());\n // println(\"made enemy\");\n rip.kaboom.frontAngle(90);\n rip.kaboom.turn(90);\n explosion.add(rip);\n }\n for (Explosion exp: explosion) {\n if (exp.kaboomCounter > 1) {\n exp.kaboom.display();\n }\n // if (exp.kaboomCounter < 1) {\n // explosion.remove(exp);\n // }\n // else {\n exp.kaboomCounter -= 3;\n // println(exp.kaboomCounter);\n // println(explosion.size());\n // }\n }\n\n}",
"public int getNumDeaths() {\n\t\treturn this.numDeaths;\n\t}",
"private double enemyKills()\n {\n return (double)enemyResult.shipsLost();\n }",
"private void checkForDeaths() {\n Iterator<Entity> entityIter = this.entities.iterator();\n\n //geht alle teilnehmer durch\n while ( entityIter.hasNext() ) {\n Entity entity = entityIter.next();\n\n //und entfernt sie wenn sie tot sind aus der liste und der engine\n if ( this.combatMapper.get(entity).curHealth <= 0 ) {\n entityIter.remove();\n\n //alle actions der entity entfernen, können ja nichts machen wenn sie tot sind\n Iterator<IAction> actionIter = this.actions.iterator();\n\n while ( actionIter.hasNext() ) {\n if ( actionIter.next().getOwner().equals(entity) ) {\n actionIter.remove();\n }\n }\n\n this.combatExp += this.combatMapper.get(entity).level * 5; //TODO\n\n EventSystem.getInstance().commitEvent(new Event(EventSystem.EventType.KILL_EVENT, entity));\n\n this.combatSystem.getEngine().removeEntity(entity);\n }\n }\n }",
"public void countDeaths() {\n\t\tfor (LogLineData d : dataList) {\n\n\t\t\tif (!d.getDeadName().equals(\"<WORLD>\")) {\n\t\t\t\tint deadIndex = getKillerIndex(d.getDeadName());\n\n\t\t\t\tif (deadIndex == -1) {\n\t\t\t\t\tNinja n = new Ninja(d.getDeadName());\n\t\t\t\t\tn.setDeathsNumber(1);\n\t\t\t\t\tkillers.add(n);\n\t\t\t\t} else {\n\t\t\t\t\tint death = killers.get(deadIndex).getDeathsNumber();\n\t\t\t\t\tkillers.get(deadIndex).setDeathsNumber(death + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"int getMinigameDefenseChancesLeft();",
"public int checkNoOfExplosivesPlayerHolds () { return noOfExplosives; }",
"public int getDeaths() {\n return deaths;\n }",
"public void updateScoreEnemies(int enemiesDestroyed) {\n\t\tscore = (int) (score + (enemiesDestroyed * VALUE_ENEMY));\n\t}",
"private static int getNumLiveUnits(ArrayList<Unit> party){\n\t\tint count=0;\n\t\tfor(Unit u:party){\n\t\t\tif(!u.getPokemon().isFainted())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}",
"@Override\r\n\t/**\r\n\t * Each enemy has a unique health and scales as the game goes along\r\n\t */\r\n\tpublic int enemyHealth() {\n\t\treturn enemyHealth;\r\n\t}",
"public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}",
"public int getDeathPoints() {\n return deathPoints;\n }",
"public void processEnemyHitsAndDeaths(AbstractEnemy enemy) {\n this.scoreCounter.changeScore(2000, '+'); // This was put here to see all objectives being met\n this.gameState.updateScoreGoals(this.scoreCounter);\n this.gameState.updateEnemyHitGoals(enemy.getEnemyType());\n this.killCount += 1; \n }",
"public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }",
"public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }",
"public EnemyGoal(int count) {\n\t\tthis.defeated = 0;\n\t\tthis.totalEnemies = count;\n\t}",
"public ArrayList<Entity> getAllEnemiesDead() {\n ArrayList<Entity> deadEnemies = new ArrayList<>();\n for (Entity enemy : enemiesInCombat) {\n if (enemy.isDead()) {\n collectDeadEnemyResources((Enemy) enemy);\n deadEnemies.add(enemy);\n }\n }\n return deadEnemies;\n }",
"public int getNumAttacked() {\n return this.numAttacked;\n }",
"void playerHit() {\n if (lives == 0) {//if no lives left\n isDead = true;\n } else {//remove a life and reset positions\n lives -=1;\n immortalityTimer = 100;\n resetPositions();\n }\n }",
"public void gotDamaged() {\n \tif(!dead) {\n\t\t\tdamaged = true;\n\t\t\tgettingHitParticleEffect.reset();\n\t\t\tcolorValue = 0;\n\t\t}\n\n }",
"public boolean waveDestroyed() {\n return map.getHell().getEnemies().size() + map.getEarth().getEnemies().size() + map.getHeaven().getEnemies().size() == 0;\n }",
"public int getLivesRemaining();",
"private void removeDeadEnemies() {\n ArrayList<Entity> deadEnemies = getAllEnemiesDead();\n if (deadEnemies.size() > 0) {\n for (Entity enemy : deadEnemies) {\n enemiesInCombat.remove(enemy);\n }\n }\n isStillInCombat();\n }",
"@Override\r\n\tpublic void recieveHit() {\n\t\tif(armour <= 0) {\r\n\t\t\tSystem.out.println(\"Enemy Destroyed\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble calculateHitDamage = shot * basicDamage;\r\n\t\t\tif(calculateHitDamage == armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy Armour Destroyed!!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage > armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy is Dead!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage < armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy not detroyed!! \\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Current Enemy life: \"+ armour);\r\n\t\t}\r\n\t}",
"void takeDamage(int points) {\n this.health -= points;\n }",
"@Override\n\tpublic void setEnemyCount(int n) {\n\t\t\n\t}",
"int getHealth();",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"int getTimesCombatActionsCalled();",
"public int weaponCount(){\n\t\treturn weaponList.size();\n\t}",
"public void findDefeated(){\n for(Enemy enemy: enemies){\n if(enemy.getCurrHP() <= 0 || enemy.isFriendly()){\n if (!defeated.contains(enemy)) {\n defeated.add(enemy);\n }\n }\n }\n }",
"public int addDeath() {\n\t\treturn ++this.numDeaths;\n\t}",
"public void killedByPlayer() {\r\n\t\tscreen.enemiesKilled++;\r\n\t\tMazeCrawler mc = screen.mazeHandler.mazeCrawler;\r\n\t\tint n = 2; //if enemy is large do movement n+1 times\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tmc.moveDown();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveDown();}\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tmc.moveLeft();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveLeft();}\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tmc.moveRight();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveRight();}\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tmc.moveUp();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveUp();}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tscreen.enemyDeath.play(.5f);\r\n\t\tdestroy();\r\n\t}",
"public void recieveDamage(){\n this.health--;\n }",
"public void takeDamage()\n {\n if(getWorld()!= null)\n {\n if(this.isTouching(Enemies.class))\n {\n Life = Life - Enemies.damage;\n if(Life <=0)\n {\n getWorld().removeObject(this);\n Store.wealth += Game.credit;\n }\n }\n }\n }",
"@Override\n\tpublic int fight(Enemy e1) {\n\t\tint damage = 0;\n\t\tRandom randomNum = new Random();\n\t\tdamage = 6 + randomNum.nextInt(4);\n\t\ttry {\n\t\t\te1.takeDamage(damage);\n\t\t} catch (InvalidDamageException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn damage;\n\t}",
"public List<Sprite> getEnnemies() {\r\n return ennemies.stream()\r\n .filter(c -> !SpriteStatusEnum.DEAD.equals(c.getStatus()))\r\n .collect(Collectors.toList());\r\n }",
"void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);",
"int attack(Unit unit, Unit enemy);",
"@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }",
"public int getDmg(){\r\n return enemyDmg;\r\n }",
"int getDamage();",
"int getDamage();",
"int getDamage();",
"int getDamage();",
"int getDamage();",
"double getDeathFactor();",
"public int getHealth();",
"@Override\n public void die() {\n// System.out.println(\"STATE = dead\");\n state = ENEMY_DEAD;\n stateTime = 0;\n velocity.x = 0;\n }",
"public static int getDeadPlayersAmount(List<Player> players) {\n long count = players.stream()\n .filter(player -> !player.isAlive())\n .count();\n\n int result = (int) count;\n\n return result;\n\n }",
"private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }",
"private void subtractEnemyHealth(int damage) {\n this.enemyShipHealth -= damage;\n }",
"public int fire(ArrayList<Enemy> enemies) {\n\t\tint coins = 0;\n\t\tint index = 0;\n\t\tboolean findIt = true;\n\t\t//looking for the first rat\n\t\twhile (!(enemies.get(index) instanceof Rat) || enemies.get(index).getPosition() > position) {\n\t\t\tindex++;\n\t\t\tif (index >= enemies.size()) {\n\t\t\t\tfindIt = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (findIt) {\n\t\t\tEnemy e = enemies.get(index);\n\t\t\te.hit(new Slingshot(position));\n\t\t\tSystem.out.println(type + position + \" hit \" + e.getType() + e.getPosition() + \".\\nEnemy's health is \" + e.getHealth());\n\t\t\tif (e.getHealth() <= 0) {\n\t\t\t\tenemies.remove(e);\n\t\t\t\tcoins += e.getCoins();\n\t\t\t}\n\t\t}\n\t\t//looking for the first lizard\n\t\telse {\n\t\t\tindex = 0;\n\t\t\tfindIt = true;\n\t\t\twhile (!(enemies.get(index) instanceof Lizard) || enemies.get(index).getPosition() > position) {\n\t\t\t\tindex++;\n\t\t\t\tif (index >= enemies.size()) {\n\t\t\t\t\tfindIt = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (findIt) {\n\t\t\t\tEnemy e = enemies.get(index);\n\t\t\t\te.hit(new Slingshot(position));\n\t\t\t\tSystem.out.println(type + position + \" hit \" + e.getType() + e.getPosition() + \".\\nEnemy's health is \" + e.getHealth());\n\t\t\t\tif (e.getHealth() <= 0) {\n\t\t\t\t\tenemies.remove(e);\n\t\t\t\t\tcoins += e.getCoins();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//looking for the first elephant\n\t\t\telse {\n\t\t\t\tindex = 0;\n\t\t\t\tfindIt = true;\n\t\t\t\twhile (!(enemies.get(index) instanceof Elephant) || enemies.get(index).getPosition() > position) {\n\t\t\t\t\tindex++;\n\t\t\t\t\tif (index >= enemies.size()) {\n\t\t\t\t\t\tfindIt = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (findIt) {\n\t\t\t\t\tEnemy e = enemies.get(index);\n\t\t\t\t\te.hit(new Slingshot(position));\n\t\t\t\t\tSystem.out.println(type + position + \" hit \" + e.getType() + e.getPosition() + \".\\nEnemy's health is \" + e.getHealth());\n\t\t\t\t\tif (e.getHealth() <= 0) {\n\t\t\t\t\t\tenemies.remove(e);\n\t\t\t\t\t\tcoins += e.getCoins();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coins;\n\t}",
"void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"public int numAlivePokemon() {\r\n\t\tint count = 0;\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"protected int[] calculateNumAttackingEnemyDirs() throws GameActionException {\n if (cachedNumAttackingEnemyDirs == null) {\n cachedNumAttackingEnemyDirs = new int[9];\n RobotInfo[] visibleEnemies = Cache.getEngagementEnemies();\n for (int i = visibleEnemies.length; i-- > 0;) {\n MapLocation enemyLoc = visibleEnemies[i].location;\n int[] attackedDirs = Util.ATTACK_NOTES[Util.RANGE_TYPE_MAP[visibleEnemies[i].type.ordinal()]][5 + enemyLoc.x - curLoc.x][5 + enemyLoc.y - curLoc.y];\n for (int j = attackedDirs.length; j-- > 0;) {\n cachedNumAttackingEnemyDirs[attackedDirs[j]]++;\n }\n }\n }\n return cachedNumAttackingEnemyDirs;\n }",
"public void incrementNumAttacked( ){\n this.numAttacked++;\n }",
"public void updateEnemies() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n entry.getValue().update(mainPlayerPosX, mainPlayerPosY);\n if (entry.getValue().isDead()) {\n enemiesSize--;\n }\n }\n }",
"public int getHealthCount() {\n return healthCount;\n }",
"private void checkDeath() {\n\t\tif (player.getLives() == 0) {\n shooty.setIv(new Image(\"/img/shipdeath.png\"));\n\t\t\tdie();\n\t\t}\n\t\t// another way to die: the blocks hit you\n\t\tif(btnList.get(0).getLayoutY() >= FATAL_BUTTON_DIST) {\n\t\t\tendGame.play();\n\t\t\tdie();\n\t\t}\n\t}",
"public void die() {\n\t\tsetDead(true);\n\t\tsetHp(0);\n\t\tgetGraphicShapes().get(stats.getBODY()).setLocation((int) getPosition().x(),\n\t\t\t\t(int) getPosition().y() + stats.getHeight() - stats.getWidth());\n\t\tgetGraphicShapes().get(stats.getBODY()).setSize(stats.getHeight(), stats.getWidth());\n\t\tgetPhysicalRectangle().setLocation((int) getPosition().x(),\n\t\t\t\t(int) getPosition().y() + stats.getHeight() - stats.getWidth());\n\t\tgetPhysicalRectangle().setSize(stats.getHeight(), stats.getWidth());\n\t\tgetGraphicShapes().remove(stats.getWEAPON());\n\t}",
"public void deadPlayer() {\r\n\t\tthis.nbPlayer --;\r\n\t}",
"private void addEnemySheild() {\n this.enemyShield += 1;\n }",
"public int getMaxHealth();",
"public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }",
"public void deadMonster() {\r\n\t\tthis.nbMonster --;\r\n\t}",
"@Override\r\n public boolean dye() {\r\n if (getX() > 3100 || getX() < 10 || getY() < 10 || getY() > 3100) {\r\n return true;\r\n }\r\n// int pixel = mapRGB.getRGB((int) getX(), (int) getY());\r\n// int red = (pixel >> 16) & 0xff;\r\n// if(red==255){this.handler.getWaves().removeEnemy(); return true;}\r\n int k = collision(velX, velY, this.getX(), this.getY());\r\n if(k!=0) {\r\n this.handler.getWaves().removeEnemy(); \r\n return true;\r\n }\r\n else{\r\n zombie_x = getX(); \r\n zombie_y = getY();\r\n }\r\n //I proiettili hanno una portata limitata o se ha colpito il player o se è uscito dalla mappa o se è andato contro un muro\r\n if ((this.getHealth() == 0) || (handler.getPlayer().getBounds().contains(getX(), getY()))) {\r\n int n = (int) (Math.random() * 10);\r\n if(n>1) n=2;\r\n switch (n) {\r\n case 2:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 3, 200, 25, handler.getPlayer(), this.handler, 30, 60, 60, 5, new Animation(Assets.zombie, 20), new Animation(Assets.zombieAttack, 35), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 0:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 4, 70, 50, handler.getPlayer(), this.handler, 0, 60, 60, 20, new Animation(Assets.zombie2, 15), new Animation(Assets.zombie2Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 1:\r\n this.handler.addSprite(new SpittleZombie(zombie_x, zombie_y, 3, 500, 40, handler.getPlayer(), this.handler, 0, 60, 60, 45, new Animation(Assets.zombie3, 15), new Animation(Assets.zombie3Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n }\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"public void lifeLost() {\n\n\t\tif (invincipleTimer <= currentTickCount) {\n\t\t\tSystem.out.println(\"Life Lost!\");\n\n\t\t\thealth--;\n\t\t\tinvincipleTimer = currentTickCount + invicibleLength;\n\t\t}\n\t}",
"private void updateEnemies()\n\t \n\t {\n\t for(int i = 0; i < EnemyList.size(); i++)\n\t {\n\t \t//get and update enemy for the enemy list\n\t Enemy eh = EnemyList.get(i);\n\t eh.Update();\n\t \n\t //checks for enemy and player crashes \n\t Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight());\n\t Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());\n\t if(playerRectangel.intersects(enemyRectangel)){\n\t \n\t \t//set player health to zero\n\t \tpl.Health = 0;\n\t \n\t // Remove helicopter from the list.\n\t EnemyList.remove(i);\n\t \n\t //creates new explosion coordinates \n\t enExplosionX = eh.xCoord; \n\t enExplosionY = eh.yCoord; \n\t plExplosionX = pl.xCoord+120;\n\t plExplosionY = pl.yCoord;\n\t GameOn = false;\n\t \n\t }\n\t \n\t // Check health.\n\t if(eh.Health <= 0){\n\t \n\t // Increase the number of destroyed enemies and removes a helicopter froma list.\n\t DestroyedEnemies++;\n\t \n\t \n\t if(DestroyedEnemies == 10)\n\t {\n\t \t//WinsState = true; \n\t \t\n\t }\n\t EnemyList.remove(i);\n\t \n\t }\n\t \n\t // If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased.\n\t if(eh.HasLeftScreen())\n\t {\n\t \tEnemyList.remove(i);\n\t RunAwayEnemies++;\n\t }\n\t \n\t if(RunAwayEnemies > 5)\n\t {\n\t \tGameOn = false; \n\t \t\n\t }\n\t }\n\t \n\t }",
"int getMonstersCount();",
"int getMonstersCount();",
"void gainHealth(int points) {\n this.health += points;\n }",
"@Override\n\tpublic void loadEnemies() {\n\t\t\n\t}",
"public void checkForDeath()\n {\n Bullet2 bullet2 = new Bullet2(getVelocity(), getRotation());\n myWorld2 world = (myWorld2)getWorld();\n Zombie2 zombie = new Zombie2();\n \n if (isTouching(Bullet2.class))\n {\n health -= bullet2.damage;\n \n if(health < 0)\n {\n world.score(2);\n world.removeObject(this);\n } \n }\n else if (getX() == 900) \n {\n world.score(-1);\n world.removeObject(this);\n } \n }",
"public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}",
"public static int[] fight(String enemy, int enemyHealth, int enemyDamage, int playerHealth, int playerDamage, int elixirCount, int elixirHealth, int wins, boolean[] items, int itemCount, int level) {\r\n System.out.println(\"You've chosen to fight!\");\r\n playerHealth = playerHealth - enemyDamage;\r\n enemyHealth = enemyHealth - playerDamage;\r\n //FIGHT: Player died\r\n if (playerHealth <= 0) {\r\n playerHealth = 0;\r\n System.out.println(\"You lost.\");\r\n int[] returned = {50, elixirCount, wins, itemCount};\r\n if (level == 3)\r\n playerHealth = returned[0];\r\n elixirCount = returned[1];\r\n wins = returned[2];\r\n itemCount = returned[3];\r\n return new int[]{playerHealth, elixirCount, wins, itemCount};\r\n }\r\n //FIGHT: Enemy died\r\n else if (enemyHealth <= 0) {\r\n System.out.println(\"You won! You now have \" +playerHealth+ \" HP!\");\r\n wins += 1;\r\n items = drop(enemy, enemyHealth, enemyDamage, playerHealth, playerDamage, elixirCount, elixirHealth, wins, items, itemCount, level);\r\n if (items[wins - 1] ||wins==4)\r\n itemCount += 1;\r\n int[] returned = {playerHealth, elixirCount, wins, itemCount};\r\n if (level == 3)\r\n playerHealth = returned[0];\r\n elixirCount = returned[1];\r\n wins = returned[2];\r\n itemCount = returned[3];\r\n return new int[]{playerHealth, elixirCount, wins, itemCount};\r\n }\r\n //FIGHT: No ones dead yet\r\n else {\r\n System.out.println(\"The \" +enemy+ \" now has \" +enemyHealth+ \" HP!\\nYou now have \" +playerHealth+ \" HP!\\n\");\r\n int[] returned = choice(enemy, enemyHealth, enemyDamage, playerHealth, playerDamage, elixirCount, elixirHealth, wins, items, itemCount, level);\r\n if (level == 3)\r\n playerHealth = returned[0];\r\n elixirCount = returned[1];\r\n wins = returned[2];\r\n itemCount = returned[3];\r\n }\r\n return new int[]{playerHealth, elixirCount, wins, itemCount};\r\n }",
"public void killAll() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (!!!entry.getValue().isDead()) {\n entry.getValue().setHealth(0);\n }\n }\n }",
"public int getDeathsOfPlayer(Player player) {\n\t\treturn getStatsProperty(StatsProperty.DEATHS, player);\n\t}",
"public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"int getAchievementsCount();",
"int defend(Unit unit, Unit enemy);",
"public int getPointsHealthy()\n {\n return pointsHealthy;\n }",
"private void enemyEncounter()\n {\n currentEnemies = currentRoom.getEnemies();\n \n if(currentEnemies.size() > 0)\n {\n for(Enemy e : currentEnemies)\n {\n System.out.println(\"\\n\" + \"A \" + e.getName() + \" stares menacingly!\" + \"\\n\");\n enemyName = e.getName();\n \n }\n enemyPresent = true;\n clearExits();\n }\n else{\n setExits(); \n }\n }",
"public short getSiegeWeaponDamage();"
] | [
"0.7273743",
"0.7135253",
"0.6977248",
"0.67874664",
"0.66465956",
"0.66198313",
"0.6607794",
"0.65182245",
"0.6439028",
"0.64017934",
"0.63974607",
"0.6337892",
"0.633536",
"0.6307335",
"0.629436",
"0.6267729",
"0.6158437",
"0.6147029",
"0.61322856",
"0.6079326",
"0.60603076",
"0.60347927",
"0.5997943",
"0.5961683",
"0.59513927",
"0.59458363",
"0.593696",
"0.59332585",
"0.59268886",
"0.59110695",
"0.5892338",
"0.5889278",
"0.58880574",
"0.5880943",
"0.5840988",
"0.58287543",
"0.5826573",
"0.5815834",
"0.58032936",
"0.5801822",
"0.5796512",
"0.5783653",
"0.5782912",
"0.5776535",
"0.5770479",
"0.5762922",
"0.5757173",
"0.57539034",
"0.5749716",
"0.57480186",
"0.57387346",
"0.5737456",
"0.57361794",
"0.57279396",
"0.57128084",
"0.57106024",
"0.5710202",
"0.5710202",
"0.5710202",
"0.5710202",
"0.5710202",
"0.5692382",
"0.56840307",
"0.568202",
"0.5677034",
"0.5675958",
"0.56591433",
"0.56438416",
"0.56312776",
"0.56273663",
"0.5621086",
"0.5621076",
"0.55958337",
"0.5590105",
"0.55864114",
"0.5586314",
"0.5584475",
"0.5583252",
"0.5578081",
"0.55713356",
"0.5568131",
"0.5566827",
"0.55661505",
"0.55614823",
"0.55598485",
"0.5557954",
"0.5557954",
"0.55566597",
"0.5555735",
"0.5552755",
"0.55308765",
"0.5530054",
"0.55207425",
"0.5519731",
"0.55193913",
"0.5516719",
"0.5509332",
"0.5506676",
"0.5503251",
"0.55017155"
] | 0.7382205 | 0 |
EFFECTS: returns the number of enemies in initially spawned | public int initSize() {
return initEnemiesSpawned;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int nbEnemiesAlive(){\n return state.getPlayers().size()-1;\n }",
"public int size() {\n return enemies.size();\n }",
"public int getTotalEnemies() {\n\t\treturn totalEnemies;\n\t}",
"@Override\n\tpublic int getEnemyCount() {\n\t\treturn 0;//enNum;\n\t}",
"public static int getEnemyLives(){\n return 1 + currentLvl * 2;\n\n }",
"@Override\n\tpublic void setEnemyCount(int n) {\n\t\t\n\t}",
"public int getRemainingEnemies(){\n return mNumberOfEnemies - (mEnemyIndex + 1);\n }",
"void deathHandler(Enemy e) {\n\n if (e != null) {\n Explosion rip = new Explosion();\n rip.kaboom.moveToPoint(e.eTank.getX(), e.eTank.getY());\n // println(\"made enemy\");\n rip.kaboom.frontAngle(90);\n rip.kaboom.turn(90);\n explosion.add(rip);\n }\n for (Explosion exp: explosion) {\n if (exp.kaboomCounter > 1) {\n exp.kaboom.display();\n }\n // if (exp.kaboomCounter < 1) {\n // explosion.remove(exp);\n // }\n // else {\n exp.kaboomCounter -= 3;\n // println(exp.kaboomCounter);\n // println(explosion.size());\n // }\n }\n\n}",
"public int isSafe(){\n int nbEnnemies = 0;\n List<Player> players = state.getPlayers();\n Player currentPlayer = state.getCurrentPlayer();\n for(Player p : players){\n if(!p.equals(currentPlayer)) {\n nbEnnemies += currentPlayerReachable(state.getCurrentPlayer(), p);\n //nbEnnemies += manhattan(currentPlayer, p); //naive version\n }\n }\n return nbEnnemies;\n }",
"public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}",
"void calculateSpawnAmount();",
"private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }",
"public EnemyGoal(int count) {\n\t\tthis.defeated = 0;\n\t\tthis.totalEnemies = count;\n\t}",
"public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }",
"public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}",
"public void incrementNumAttacked( ){\n this.numAttacked++;\n }",
"public int getNumDead() {\n int count = 0;\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (entry.getValue().isDead()) {\n count++;\n }\n }\n return count;\n }",
"void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);",
"public void updateScoreEnemies(int enemiesDestroyed) {\n\t\tscore = (int) (score + (enemiesDestroyed * VALUE_ENEMY));\n\t}",
"@External\r\n\t@ClientFunc\r\n\tpublic MetaVarNumber GetNumActiveParticles();",
"public int howManyHeroDead() {\r\n int count;\r\n count = 0;\r\n for (Hero h: team) {\r\n if (h.isDead()) {\r\n count = count + 1;\r\n }\r\n }\r\n return count;\r\n }",
"public int weaponCount(){\n\t\treturn weaponList.size();\n\t}",
"public int useBomb(){\n //do harm while the animation start\n //cause harm to the boss\n println(\"BEFORE Main.boss.health: \"+Main.boss.health);\n int count = 0;\n if ((Main.boss.alive) && (Main.boss.posY != -1)){\n Main.boss.decreaseHealth(10);\n if(Main.boss.health <= 0){\n Main.boss.alive = false;\n Main.boss.deadTime = millis();\n Main.score += 100;\n bossKilled = true;\n }\n }\n println(\"AFTER Main.boss.health: \"+Main.boss.health);\n //remove all bullets\n Main.boss.emptyBullets();\n //kill all the enemies\n for(int j = 0; j < Main.enemies.size(); j++){\n Enemy tempEnemy = Main.enemies.get(j);\n tempEnemy.alive = false;\n tempEnemy.deadTime = millis();\n count ++;\n }\n // fill(0,0,0);\n // rect(0,0,width,height);\n return count;\n }",
"@Override\n\tpublic void loadEnemies() {\n\t\t\n\t}",
"int getMonstersCount();",
"int getMonstersCount();",
"public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }",
"@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }",
"private void addEnemySheild() {\n this.enemyShield += 1;\n }",
"int getTimesCombatActionsCalled();",
"public double bossHealth(ArrayList<Enemy> currentEnemies) {\n return -1;\n }",
"int getSpriteArraySize();",
"public int getTextureCount()\n\t{\n\t\treturn textures.length;\n\t}",
"@Override\r\n\t/**\r\n\t * Each enemy has a unique health and scales as the game goes along\r\n\t */\r\n\tpublic int enemyHealth() {\n\t\treturn enemyHealth;\r\n\t}",
"private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }",
"public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }",
"public int fire(ArrayList<Enemy> enemies) {\n\t\tint coins = 0;\n\t\tint index = 0;\n\t\tboolean findIt = true;\n\t\t//looking for the first rat\n\t\twhile (!(enemies.get(index) instanceof Rat) || enemies.get(index).getPosition() > position) {\n\t\t\tindex++;\n\t\t\tif (index >= enemies.size()) {\n\t\t\t\tfindIt = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (findIt) {\n\t\t\tEnemy e = enemies.get(index);\n\t\t\te.hit(new Slingshot(position));\n\t\t\tSystem.out.println(type + position + \" hit \" + e.getType() + e.getPosition() + \".\\nEnemy's health is \" + e.getHealth());\n\t\t\tif (e.getHealth() <= 0) {\n\t\t\t\tenemies.remove(e);\n\t\t\t\tcoins += e.getCoins();\n\t\t\t}\n\t\t}\n\t\t//looking for the first lizard\n\t\telse {\n\t\t\tindex = 0;\n\t\t\tfindIt = true;\n\t\t\twhile (!(enemies.get(index) instanceof Lizard) || enemies.get(index).getPosition() > position) {\n\t\t\t\tindex++;\n\t\t\t\tif (index >= enemies.size()) {\n\t\t\t\t\tfindIt = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (findIt) {\n\t\t\t\tEnemy e = enemies.get(index);\n\t\t\t\te.hit(new Slingshot(position));\n\t\t\t\tSystem.out.println(type + position + \" hit \" + e.getType() + e.getPosition() + \".\\nEnemy's health is \" + e.getHealth());\n\t\t\t\tif (e.getHealth() <= 0) {\n\t\t\t\t\tenemies.remove(e);\n\t\t\t\t\tcoins += e.getCoins();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//looking for the first elephant\n\t\t\telse {\n\t\t\t\tindex = 0;\n\t\t\t\tfindIt = true;\n\t\t\t\twhile (!(enemies.get(index) instanceof Elephant) || enemies.get(index).getPosition() > position) {\n\t\t\t\t\tindex++;\n\t\t\t\t\tif (index >= enemies.size()) {\n\t\t\t\t\t\tfindIt = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (findIt) {\n\t\t\t\t\tEnemy e = enemies.get(index);\n\t\t\t\t\te.hit(new Slingshot(position));\n\t\t\t\t\tSystem.out.println(type + position + \" hit \" + e.getType() + e.getPosition() + \".\\nEnemy's health is \" + e.getHealth());\n\t\t\t\t\tif (e.getHealth() <= 0) {\n\t\t\t\t\t\tenemies.remove(e);\n\t\t\t\t\t\tcoins += e.getCoins();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coins;\n\t}",
"@Override\n public String getEntLS() {\n return \"Enemies\";\n }",
"public int getNbBodyInList()\r\n\t{\n\t\treturn this.listUnityEnemy.size();\r\n\t}",
"public int getNumAttacked() {\n return this.numAttacked;\n }",
"public int size()\n\t{\n\t\treturn creatures.size();\n\t}",
"public void damageTargets(List<Slicer> activeEnemies) {\n // Create list of explosives that have been detonated (regardless of they have hit enemies)\n // These explosives will be removed from the map\n List<Explosive> detExp = new ArrayList<>();\n for (int i=0; i<this.explosives.size(); i++) {\n Explosive explosive = this.explosives.get(i);\n if (explosive != null && explosive.getDetTime()>=DET_TIME) {\n numDetonated++;\n detExp.add(explosive);\n // Checks if enemy is in the area\n // Does damage accordingly\n for (Slicer target: activeEnemies) {\n if (explosive.getCenter().distanceTo(target.getCenter()) <= getEffectRadius()) {\n target.reduceHealth(getDamage());\n }\n }\n }\n }\n // Removes all explosives that have detonated\n explosives.removeAll(detExp);\n }",
"public void updateEnemies() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n entry.getValue().update(mainPlayerPosX, mainPlayerPosY);\n if (entry.getValue().isDead()) {\n enemiesSize--;\n }\n }\n }",
"public Enemy() {\n createModel();\n enemyCounter++;\n }",
"int getNumberOfTextureCoordinates();",
"int getQuestCount();",
"public int numActors() { return ActorSet.size(); }",
"public void act()\r\n {\n \r\n if (Background.enNum == 0)\r\n {\r\n length = Background.length;\r\n width = Background.width;\r\n getWorld().addObject (new YouWon(), length / 2, width / 2);\r\n \r\n //long lastAdded2 = System.currentTimeMillis();\r\n //long curTime3 = System.currentTimeMillis();\r\n //long curTime3 = System.currentTimeMillis();\r\n //long seconds = curTime3 / 1000;\r\n //sleep = 3;\r\n //try {\r\n //TimeUnit.SECONDS.sleep(sleep);\r\n //} catch(InterruptedException ex) {\r\n //Thread.currentThread().interrupt();\r\n //}\r\n //Greenfoot.delay(3);\r\n //long curTime3 = System.currentTimeMillis();\r\n //long secs2 = curTime3 / 1000;\r\n //long curTime4;\r\n //long secs3;\r\n //do\r\n //{\r\n //getWorld().addObject (new YouWon(), length / 2, width / 2);\r\n //curTime4 = System.currentTimeMillis();\r\n //secs3 = curTime3 / 1000;\r\n //} while (curTime4 / 1000 < curTime3 / 1000 + 3);\r\n //if (System.currentTimeMillis()/1000 - 3 >= secs2)\r\n //{\r\n //do\r\n //{\r\n pause(3000);\r\n Actor YouWon;\r\n YouWon = getOneObjectAtOffset(0, 0, YouWon.class);\r\n World world;\r\n world = getWorld();\r\n world.removeObject(this);\r\n Background.xp += 50;\r\n Background.myGold += 100;\r\n if (Background.xp >= 50 && Background.xp < 100){\r\n Background.myLevel = 2;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 100 && Background.xp < 200){\r\n Background.myLevel = 3;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 200 && Background.xp < 400){\r\n Background.myLevel = 4;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 400 && Background.xp < 800){\r\n Background.myLevel = 5;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 800 && Background.xp < 1600){\r\n Background.myLevel = 6;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 1600 && Background.xp < 3200){\r\n Background.myLevel = 7;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 3200 && Background.xp < 6400){\r\n Background.myLevel = 8;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 6400 && Background.xp < 12800){\r\n Background.myLevel = 9;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 12800){\r\n Background.myLevel = 10;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n }\r\n //curTime3 = System.currentTimeMillis();\r\n //secs2 = curTime3 / 1000;\r\n //index2++;\r\n //Greenfoot.setWorld(new YouWon());\r\n //lastAdded2 = curTime3;\r\n //}\r\n //} while (index2 <= 0);\r\n }\r\n }",
"void gainHealth(int points) {\n this.health += points;\n }",
"public void drawEnemies(){\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy) e;\n if (enemy instanceof EnemyPistol) {\n spriteBatch.draw(enemyPistolTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyAwp){\n spriteBatch.draw(enemyAWPTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyStalker){\n spriteBatch.draw(enemyStalkerTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyBoss){\n spriteBatch.draw(enemyBossTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }\n }\n }",
"int getActionsCount();",
"int getActionsCount();",
"public int getTotalNumberOfSprites() {\n return this.getRows() * this.getColumns();\n }",
"private void prepareLevel(){\n levelAnimation = true;\n\n // Reset the menace level\n menaceInterval = 1200;\n\n // Here we will initialize all the game objects\n // Make a new player space ship\n defender = new Defender(context, PlayableX, PlayableY, ExcessX);\n\n // Prepare the players bullet\n bullet = new Bullet(context, PlayableX, PlayableY, (float) 1.2);\n\n // Initialize the invadersBullets array\n for(int i = 0; i < invadersBullets.length; i++){\n invadersBullets[i] = new Bullet(context, PlayableX, PlayableY, (float) 0.80);\n }\n\n // Build an army of invaders\n numInvaders = 0;\n for(int column = 0; column < invadersColumn; column ++ ){\n for(int row = 0; row < invadersRow; row ++ ){\n invaders[numInvaders] = new Invader(context, row, column, PlayableX, PlayableY, ExcessX);\n numInvaders ++;\n }\n }\n invadersLeft = numInvaders;\n\n try {\n // Create objects of the 2 required classes\n AssetManager assetManager = context.getAssets();\n explosionEffect = new Bitmap[12];\n for (int i=0; i < 12; i++) {\n explosionEffect[i] = Bitmap.createScaledBitmap(BitmapFactory.decodeStream(assetManager.open(\"explosion/\" + (i + 1) + \".png\")), (int) (invaders[0].getLength()*1.75), (int) (invaders[0].getLength()*1.75), true);\n }\n } catch (IOException e) {\n e.printStackTrace();\n // Print an error message to the console\n Log.e(\"error\", \"failed to load explosion effect image files\");\n }\n\n }",
"private void countItems(ArrayList<Entity> entities) {\n\n\t\thealth = 0;\n\t\tarmor = 0;\n\n\t\tfor (int i = 0; i < entities.size(); i++) {\n\n\t\t\tEntity curr = entities.get(i);\n\n\t\t\tif (curr instanceof Health) {\n\t\t\t\thealth++;\n\t\t\t} else if (curr instanceof Armor) {\n\t\t\t\tarmor++;\n\t\t\t}\n\n\t\t}\n\n\t}",
"private static int getNumLiveUnits(ArrayList<Unit> party){\n\t\tint count=0;\n\t\tfor(Unit u:party){\n\t\t\tif(!u.getPokemon().isFainted())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"public int numWorlds(){\n return worlds.size();\n }",
"public boolean canSpawnMore() {\n for(int e: enemiesLeft) {\n if(e > 0) {\n return true;\n }\n }\n\n return false;\n }",
"public boolean waveDestroyed() {\n return map.getHell().getEnemies().size() + map.getEarth().getEnemies().size() + map.getHeaven().getEnemies().size() == 0;\n }",
"public int getMaxSpawnedInChunk()\n {\n return 1;\n }",
"int getMinigameDefenseChancesLeft();",
"public int getLength () { return spriteLength; }",
"@Override\n\tpublic void onUpdate() {\n\t\tif (this.isEntityAlive()) {\n\t\t\tthis.lastActiveTime = this.timeSinceIgnited;\n\t\t\tint i = this.getCreeperState();\n\t\t\tif (i > 0 && this.timeSinceIgnited == 0) {\n\t\t\t\tthis.playSound(\"random.fuse\", 1.0F, 0.5F);\n\t\t\t}\n\t\t\tthis.timeSinceIgnited += i;\n\t\t\tif (this.timeSinceIgnited < 0) {\n\t\t\t\tthis.timeSinceIgnited = 0;\n\t\t\t}\n\t\t\tif (this.timeSinceIgnited >= this.fuseTime) {\n\t\t\t\tthis.timeSinceIgnited = this.fuseTime;\n\t\t\t\tif (!this.worldObj.isRemote) {\n\t\t\t\t\tthis.worldObj.spawnParticle(\"portal\", this.posX, this.posY,\n\t\t\t\t\t\t\tthis.posZ, 4D, 4D, 4D);\n\t\t\t\t\tthis.worldObj.playSoundEffect(this.posX, this.posY,\n\t\t\t\t\t\t\tthis.posZ, \"mob.endermen.portal\", 2.0F,\n\t\t\t\t\t\t\tthis.worldObj.rand.nextFloat() * 0.1F + 0.9F);\n\t\t\t\t\tList players = worldObj.getEntitiesWithinAABB(\n\t\t\t\t\t\t\tEntityPlayer.class, this.boundingBox.expand(\n\t\t\t\t\t\t\t\t\t3 + Math.floor(this.ticksExisted / 50), 2,\n\t\t\t\t\t\t\t\t\t3 + Math.floor(this.ticksExisted / 50)));\n\t\t\t\t\tObject[] playerArray = players.toArray();\n\t\t\t\t\tfor (Object o : playerArray) {\n\t\t\t\t\t\tEntityPlayer e = (EntityPlayer) o;\n\t\t\t\t\t\tint entityId = e.getEntityId();\n\t\t\t\t\t\tif (!this.worldObj.isRemote) {\n\t\t\t\t\t\t\tint dimensionId = e.dimension == 0 ? 1 : 0;\n\t\t\t\t\t\t\tPacketDispatcher.getSimpleNetworkWrapper()\n\t\t\t\t\t\t\t.sendToServer(\n\t\t\t\t\t\t\t\t\tnew MessageTeleportToDimension(\n\t\t\t\t\t\t\t\t\t\t\t\t\tdimensionId, entityId));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.setDead();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.onUpdate();\n\t}",
"private void drawActivePotionEffects() {\n/* 63 */ int i = this.guiLeft - 124;\n/* 64 */ int j = this.guiTop;\n/* 65 */ int k = 166;\n/* 66 */ Collection<PotionEffect> collection = this.mc.player.getActivePotionEffects();\n/* */ \n/* 68 */ if (!collection.isEmpty()) {\n/* */ \n/* 70 */ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n/* 71 */ GlStateManager.disableLighting();\n/* 72 */ int l = 33;\n/* */ \n/* 74 */ if (collection.size() > 5)\n/* */ {\n/* 76 */ l = 132 / (collection.size() - 1);\n/* */ }\n/* */ \n/* 79 */ for (PotionEffect potioneffect : Ordering.natural().sortedCopy(collection)) {\n/* */ \n/* 81 */ Potion potion = potioneffect.getPotion();\n/* 82 */ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n/* 83 */ this.mc.getTextureManager().bindTexture(INVENTORY_BACKGROUND);\n/* 84 */ drawTexturedModalRect(i, j, 0, 166, 140, 32);\n/* */ \n/* 86 */ if (potion.hasStatusIcon()) {\n/* */ \n/* 88 */ int i1 = potion.getStatusIconIndex();\n/* 89 */ drawTexturedModalRect(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18);\n/* */ } \n/* */ \n/* 92 */ String s1 = I18n.format(potion.getName(), new Object[0]);\n/* */ \n/* 94 */ if (potioneffect.getAmplifier() == 1) {\n/* */ \n/* 96 */ s1 = String.valueOf(s1) + \" \" + I18n.format(\"enchantment.level.2\", new Object[0]);\n/* */ }\n/* 98 */ else if (potioneffect.getAmplifier() == 2) {\n/* */ \n/* 100 */ s1 = String.valueOf(s1) + \" \" + I18n.format(\"enchantment.level.3\", new Object[0]);\n/* */ }\n/* 102 */ else if (potioneffect.getAmplifier() == 3) {\n/* */ \n/* 104 */ s1 = String.valueOf(s1) + \" \" + I18n.format(\"enchantment.level.4\", new Object[0]);\n/* */ } \n/* */ \n/* 107 */ this.fontRendererObj.drawStringWithShadow(s1, (i + 10 + 18), (j + 6), 16777215);\n/* 108 */ String s = Potion.getPotionDurationString(potioneffect, 1.0F);\n/* 109 */ this.fontRendererObj.drawStringWithShadow(s, (i + 10 + 18), (j + 6 + 10), 8355711);\n/* 110 */ j += l;\n/* */ } \n/* */ } \n/* */ }",
"public void explosion(){\n explosionEffect.play(pitch, volume);\n }",
"public int getNumDeaths() {\n\t\treturn this.numDeaths;\n\t}",
"public int getHealthCount() {\n return healthCount;\n }",
"public int getTotalEffect() {\n\t\treturn totalEffect;\n\t}",
"void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }",
"public void makeHero()\r\n { \r\n maxHealth = 100;\r\n health = maxHealth;\r\n }",
"public void draw() {\r\n\r\n if (this.z == 2) {\r\n //--- Shooting//---\r\n for (Enemy e: this.td.getEnemies()) {\r\n if (e.getX() < this.x + this.size / 2\r\n && e.getX() + e.getSize() > this.x - this.size / 2) {\r\n if (e.getY() < this.y + this.size / 2\r\n && e.getY() + e.getSize() > this.y - this.size / 2) {\r\n if (!this.firing) {\r\n this.firing = true;\r\n this.target = e;\r\n }\r\n } else {\r\n this.firing = false;\r\n }\r\n }\r\n this.firing();\r\n }\r\n }\r\n this.update();\r\n\r\n }",
"public int getParticles() {\r\n\t\treturn particles;\r\n\t}",
"public void enemyCreator() { // Creates enemies\n \tif(createFrame >= createTime) {\n \t\tfor(int i = 0; i < enemies.length; i++) {\n \t\t\tif(!enemies[i].isAlive) { // If the enemy is no longer alive\n \t\t\t\tenemies[i].Create(0); // Create a new one\n \t\t\t\tbreak;\n \t\t\t} \t\t\t\t\n \t\t}\n \t\tcreateFrame = 0;\n \t}\n \telse\n \t\tcreateFrame += 1;\n \t\n \tif(killCount == 10){ // Every ten enemies\n \t\tkillCount = 0;\n \t\tif(createTime > 700)\n \t\t\tcreateTime -= 275; // Increase spawn rate\n \t\t\n \t\tif(Enemy.moveSpeed > 8)\t\n \t\t\t\tEnemy.moveSpeed -= 2; // Increase enemy movement speed\n \t\tif(killed > 100)\n \t\t\tBlock.healthTime += 25; // Increase enemy health\n \t\telse if(killed > 200)\n \t\t\tBlock.healthTime += 30;\n \t\telse\n \t\t\tBlock.healthTime += 20;\n \t}\n }",
"void takeDamage(int points) {\n this.health -= points;\n }",
"private void generateEnemies(int count) {\n generateEnemiesOnLayer(map.getHell(), count);\n generateEnemiesOnLayer(map.getEarth(), count);\n generateEnemiesOnLayer(map.getHeaven(), count);\n }",
"private void enemyEncounter()\n {\n currentEnemies = currentRoom.getEnemies();\n \n if(currentEnemies.size() > 0)\n {\n for(Enemy e : currentEnemies)\n {\n System.out.println(\"\\n\" + \"A \" + e.getName() + \" stares menacingly!\" + \"\\n\");\n enemyName = e.getName();\n \n }\n enemyPresent = true;\n clearExits();\n }\n else{\n setExits(); \n }\n }",
"public int checkNoOfExplosivesPlayerHolds () { return noOfExplosives; }",
"public void count() {\n\t\talgae = -1;\n\t\tcrab = -1;\n\t\tbigFish = -1;\n\t\tfor(GameObjects o: objects) {\n\t\t\tswitch(o.toString()) {\n\t\t\tcase \"algae\":\n\t\t\t\talgae +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"crab\":\n\t\t\t\tcrab +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"big fish\":\n\t\t\t\tbigFish +=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public int getNumHurtboxes() {\n return this.weapon.getNumHurtboxes();\n }",
"public void hit() {\n if (explodeTime == 0) {\n if (isExplosive) {\n region = explodeAnimation.getKeyFrame(explodeTime, false);\n explodeTime += Gdx.graphics.getDeltaTime();\n width = region.getRegionWidth();\n height = region.getRegionHeight();\n position.sub(width / 2, height / 2);\n direction = new Vector2(1, 0);\n explosionSound.play();\n } else {\n impactSound.play();\n active = false;\n }\n }\n }",
"void tick() {\n\t\tif (playing) {\n\t\t\tdeadcannon = null;\n\t\t\t// sets general output message\n\t\t\tstatus.setText(\"Engaging alien wave \" + Integer.toString(level)+ \" \");\n\n\t\t\t// controls the first shot fired by the aliens\n\t\t\tif (shot1 == null) {\n\t\t\t\tint count1 = 0;\n\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\tif (alien3[i]!=null) {if (!alien3[i].Destroyed) count1++ ;}\n\t\t\t\t}\n\t\t\t\tif (count1 > 1) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\tshootbottom().pos_x + 18, shootbottom().pos_y); \n\t\t\t\telse {\n\t\t\t\t\tint count2 = 0;\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null) {if(!alien2[i].Destroyed)count2++;}\n\t\t\t\t\t}\n\t\t\t\t\tif (count2 > 1) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\tshootmiddle().pos_x + 18, shootmiddle().pos_y);\n\t\t\t\t\telse {\n\t\t\t\t\t\tint count3 = 0;\n\t\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\t\tif (alien1[i]!=null) {if(!alien1[i].Destroyed)count3++;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count3 != 0) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\t\tshoottop().pos_x + 18, shoottop().pos_y);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// controls the second shot fired by the aliens\n\t\t\tif (shot2 == null) {\n\t\t\t\tint count4 = 0;\n\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\tif (alien3[i]!=null) {if (!alien3[i].Destroyed) count4++ ;}\n\t\t\t\t}\n\t\t\t\tif (count4 != 0) {shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\tshootbottom().pos_x + 18, shootbottom().pos_y); \n\t\t\t\tStdAudio.play(\"zap.wav\"); }\n\t\t\t\telse {\n\t\t\t\t\tint count5 = 0;\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null) {if(!alien2[i].Destroyed)count5++;}\n\t\t\t\t\t}\n\t\t\t\t\tif (count5 != 0) { shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\tshootmiddle().pos_x + 18, shootmiddle().pos_y);\n\t\t\t\t\tStdAudio.play(\"zap.wav\"); }\n\t\t\t\t\telse {\n\t\t\t\t\t\tint count6 = 0;\n\t\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\t\tif (alien1[i]!=null) {if(!alien1[i].Destroyed)count6++;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count6 != 0) {shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\t\tshoottop().pos_x + 18, shoottop().pos_y);\n\t\t\t\t\t\tStdAudio.play(\"zap.wav\");}\n\t\t\t\t\t\telse {level = level + 1; \n\t\t\t\t\t\tnewlevel();\n\t\t\t\t\t\tthescore=thescore + 100;\n\t\t\t\t\t\tStdAudio.play(\"up.wav\");}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move bullet and delete if it reaches the roof\n\t\t\tif (bullet!= null) {\n\t\t\t\tbullet.move();\n\t\t\t\tif (bullet.pos_y == 0) bullet = null;\n\t\t\t}\n\n\t\t\t// controls movement of first shot\n\t\t\tif (shot1 != null) {\n\t\t\t\tshot1.move();\n\t\t\t\tif (shot1.pos_y > 435) shot1 = null;\n\t\t\t}\n\t\t\t// controls movement of second shot\n\t\t\tif (shot2 != null) {\n\t\t\t\tshot2.move();\n\t\t\t\tif (shot2.pos_y > 435) shot2 = null;\n\t\t\t}\n\n\t\t\t// For Top Row\n\n\t\t\t// change alien direction if a wall is reached\n\t\t\tif (alien1[0] != null && alien1[9] != null){\n\t\t\t\tif (alien1[0].pos_x == 0 || alien1[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\tif (alien1[i]!=null){alien1[i].v_x = -alien1[i].v_x;\n\t\t\t\t\t\talien1[i].pos_y=alien1[i].pos_y+15;\n\t\t\t\t\t\tif (alien1[i].pos_y >= 385 && !alien1[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t\t\tstatus.setText(\"You have been overrun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\t \n\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\tif (alien1[i] != null) \n\t\t\t\t\talien1[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\tif (alien1[i] != null && bullet != null) {\n\t\t\t\t\tif (alien1[i].intersects(bullet) && !alien1[i].Destroyed) { \n\t\t\t\t\t\talien1[i].Destroyed=true;\n\t\t\t\t\t\tthescore += 20;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10 ) {\n\t\t\t\t\t\t\talien1[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For Second Row\n\n\t\t\t// change alien direction if a wall is reached\n\t\t\tif (alien2[0] != null && alien2[9] != null){\n\t\t\t\tif (alien2[0].pos_x == 0 || alien2[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null){alien2[i].v_x = -alien2[i].v_x;\n\t\t\t\t\t\talien2[i].pos_y=alien2[i].pos_y+15;\n\t\t\t\t\t\tif (alien2[i].pos_y >= 385 && !alien2[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false; \n\t\t\t\t\t\t\tstatus.setText(\"You have been ovverun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\tif (alien2[i] != null) \n\t\t\t\t\talien2[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\tif (alien2[i] != null && bullet != null) {\n\t\t\t\t\tif (alien2[i].intersects(bullet) && !alien2[i].Destroyed) { \n\t\t\t\t\t\talien2[i].Destroyed=true;\n\t\t\t\t\t\tthescore +=15;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10 ) {\n\t\t\t\t\t\t\talien2[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//For third row\n\n\t\t\t//change alien direction if a wall is reached\n\t\t\tif (alien3[0] != null && alien3[9] != null){\n\t\t\t\tif (alien3[0].pos_x == 0 || alien3[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\t\tif (alien3[i]!=null){alien3[i].v_x = -alien3[i].v_x;\n\t\t\t\t\t\talien3[i].pos_y=alien3[i].pos_y+15;\n\t\t\t\t\t\tif (alien3[i].pos_y >= 385 && !alien3[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t\t\tstatus.setText(\"You have been ovverrun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\n\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\tif (alien3[i] != null) \n\t\t\t\t\talien3[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\tif (alien3[i] != null && bullet != null) {\n\t\t\t\t\tif (alien3[i].intersects(bullet) && !alien3[i].Destroyed) { \n\t\t\t\t\t\talien3[i].Destroyed=true;\n\t\t\t\t\t\tthescore += 10;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10) {\n\t\t\t\t\t\t\talien3[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// destroy cannon if shot\n\t\t\tif (shot1 != null) {\n\t\t\t\tif (shot1.intersects(cannon)){ dead = true; \n\t\t\t\tthelives = thelives - 1;\n\t\t\t\tStdAudio.play(\"bigboom.wav\");\n\t\t\t\tcannon.img_file = \"dead.jpg\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (shot2 != null) {\n\t\t\t\tif (shot2.intersects(cannon)){ dead = true; \n\t\t\t\tthelives = thelives - 1;\n\t\t\t\tStdAudio.play(\"bigboom.wav\");}\n\t\t\t\tcannon.img_file = \"dead.jpg\";\n\t\t\t}\n\n\t\t\t// ends the game when all lives are lost\n\t\t\tif (thelives <= 0) {\n\t\t\t\tplaying = false; \n\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\tstatus.setText(\"You have been killed and Earth has been \" +\n\t\t\t\t\t\t\"destroyed. You are a terrible defender \" +\n\t\t\t\t\t\t\"of humanity. \");\n\t\t\t}\n\n\t\t\t//makes sure lives cannot become negative\n\t\t\tif (thelives <= 0) {\n\t\t\t\tthelives = 0;\n\t\t\t\tdeadcannon = new DeadCannon(COURT_WIDTH, COURT_HEIGHT);\n\t\t\t\tdeadcannon.pos_x = cannon.pos_x;\n\t\t\t\tStdAudio.play(\"loss.wav\");\n\t\t\t}\n\n\t\t\t//set the text labels at the bottom of the screen\n\t\t\tmyscore.setText(\"Score = \"+ Integer.toString(thescore)+ \" \");\n\t\t\tmylives.setText(\"Lives = \"+ Integer.toString(thelives));\n\t\t\trepaint();\n\t\t\n\t\t\t//move cannon\n\t\t\tcannon.move();\n\t\t} \n\t}",
"public int getMasteredSkills() {\r\n int count = 0;\r\n for (int i = 0; i < getTotalSkills(); i++) {\r\n if (getStaticLevel(i) >= 99) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }",
"@Override\r\n public boolean dye() {\r\n if (getX() > 3100 || getX() < 10 || getY() < 10 || getY() > 3100) {\r\n return true;\r\n }\r\n// int pixel = mapRGB.getRGB((int) getX(), (int) getY());\r\n// int red = (pixel >> 16) & 0xff;\r\n// if(red==255){this.handler.getWaves().removeEnemy(); return true;}\r\n int k = collision(velX, velY, this.getX(), this.getY());\r\n if(k!=0) {\r\n this.handler.getWaves().removeEnemy(); \r\n return true;\r\n }\r\n else{\r\n zombie_x = getX(); \r\n zombie_y = getY();\r\n }\r\n //I proiettili hanno una portata limitata o se ha colpito il player o se è uscito dalla mappa o se è andato contro un muro\r\n if ((this.getHealth() == 0) || (handler.getPlayer().getBounds().contains(getX(), getY()))) {\r\n int n = (int) (Math.random() * 10);\r\n if(n>1) n=2;\r\n switch (n) {\r\n case 2:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 3, 200, 25, handler.getPlayer(), this.handler, 30, 60, 60, 5, new Animation(Assets.zombie, 20), new Animation(Assets.zombieAttack, 35), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 0:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 4, 70, 50, handler.getPlayer(), this.handler, 0, 60, 60, 20, new Animation(Assets.zombie2, 15), new Animation(Assets.zombie2Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 1:\r\n this.handler.addSprite(new SpittleZombie(zombie_x, zombie_y, 3, 500, 40, handler.getPlayer(), this.handler, 0, 60, 60, 45, new Animation(Assets.zombie3, 15), new Animation(Assets.zombie3Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n }\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"public void act() \r\n {\r\n Actor hitMC = getOneIntersectingObject(MC.class);\r\n if (hitMC != null) {\r\n ((Hall) getWorld()).player.health++;\r\n getWorld().removeObject(this);\r\n }\r\n }",
"private void updateEnemies()\n\t \n\t {\n\t for(int i = 0; i < EnemyList.size(); i++)\n\t {\n\t \t//get and update enemy for the enemy list\n\t Enemy eh = EnemyList.get(i);\n\t eh.Update();\n\t \n\t //checks for enemy and player crashes \n\t Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight());\n\t Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());\n\t if(playerRectangel.intersects(enemyRectangel)){\n\t \n\t \t//set player health to zero\n\t \tpl.Health = 0;\n\t \n\t // Remove helicopter from the list.\n\t EnemyList.remove(i);\n\t \n\t //creates new explosion coordinates \n\t enExplosionX = eh.xCoord; \n\t enExplosionY = eh.yCoord; \n\t plExplosionX = pl.xCoord+120;\n\t plExplosionY = pl.yCoord;\n\t GameOn = false;\n\t \n\t }\n\t \n\t // Check health.\n\t if(eh.Health <= 0){\n\t \n\t // Increase the number of destroyed enemies and removes a helicopter froma list.\n\t DestroyedEnemies++;\n\t \n\t \n\t if(DestroyedEnemies == 10)\n\t {\n\t \t//WinsState = true; \n\t \t\n\t }\n\t EnemyList.remove(i);\n\t \n\t }\n\t \n\t // If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased.\n\t if(eh.HasLeftScreen())\n\t {\n\t \tEnemyList.remove(i);\n\t RunAwayEnemies++;\n\t }\n\t \n\t if(RunAwayEnemies > 5)\n\t {\n\t \tGameOn = false; \n\t \t\n\t }\n\t }\n\t \n\t }",
"@Override\n public void render(float delta) {\n\n long time = TimeUtils.timeSinceMillis(lastTimeCountedRound);\n lastTimeCountedRound = TimeUtils.millis();\n // Time since last round for spawning enemies\n sinceChangeTime += time;\n\n //Standard settings\n Gdx.gl.glClearColor(0, 0, 0, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n renderer.setView(cam);\n renderer.render();\n cam.update();\n\n game.batch.setProjectionMatrix(cam.combined);\n\n game.batch.begin();\n // show shop if b is pressed\n if(Gdx.input.isKeyJustPressed(Input.Keys.B)){\n showShop = !showShop;\n }\n // if enemies are gone the round is over\n if (enemies.isEmpty()) {\n isDone = true;\n showTime = true;\n if(!moneyAdded){\n money += 180;\n }\n }\n\n //removing enemies\n for (Iterator<PositionsMap02> iter = enemies.iterator(); iter.hasNext(); ) {\n PositionsMap02 it = iter.next();\n if (it.isPositionEnd() || it.getEnemyType().isDead()) {\n\n iter.remove();\n }\n }\n //show turrets\n for (TurretType turretType: turrets) {\n showTurrets(turretType);\n }\n\n // After the round\n if (!isDone) {\n for (PositionsMap02 enemy : enemies) {\n showEnemy(enemy);\n sinceChangeTime = 0;\n }\n } else {\n if(sinceChangeTime > 1){\n moneyAdded = true;\n }\n if (sinceChangeTime > 10000) {\n round++;\n sinceChangeTime = 0;\n isDone = false;\n showTime = false;\n createNewEnemies((int) (round*50));\n moneyAdded = false;\n }\n }\n // if turret is chosen\n if(isTurretChosen){\n hoverTurret();\n }\n //showing fps\n showFPS();\n //shows fps\n font.draw(game.batch, (int) frameRate + \" fps\", 3, Gdx.graphics.getHeight() - 10);\n //shows HP\n font.draw(game.batch, BaseHealth + \" hp\", 160, Gdx.graphics.getHeight() - 10);\n if(showTime){\n font.draw(game.batch, Math.round(sinceChangeTime/1000) + \" s\", Gdx.graphics.getWidth()-300, Gdx.graphics.getHeight() - 10);\n }\n game.batch.end();\n\n // showing Shop if enabled\n if(showShop){\n showShop();\n }\n\n\n }",
"int getExperiencesCount();",
"private void spawnStuff(PlayScreen screen, float delta) {\n if (stageId!=3 && stageId!=5) {\n isCombatEnabled = true;\n int where;\n boolean spawnRight = true;\n float speed;\n\n\n //Alien Spawn\n if (System.currentTimeMillis() - lastASpawn >= SpawnATimer + extraTimer) {\n speed = (float)(Utils.doRandom(250,400));\n lastASpawn = System.currentTimeMillis();\n int count = 3;\n if (stageId==4) count = 1;\n for (int i = 0; i < count; i++) {\n if (stageId==4){\n speed = (float) (speed*0.75);\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - Alien.width, y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player));\n }else{\n int x = 0 - Alien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + Alien.width*2 , y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player,false));\n }\n }\n }\n //AcidAlien Spawn\n if (System.currentTimeMillis() - lastBSpawn >= SpawnBTimer + extraTimer) {\n speed = 200;\n lastBSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - AcidAlien.width, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player));\n }else{\n int x = 0 - AcidAlien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + AcidAlien.width*2, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player,false));\n }\n }\n //FastAlien Spawn\n if (System.currentTimeMillis() - lastCSpawn >= SpawnCTimer + extraTimer) {\n speed= Utils.doRandom(250,400);\n lastCSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - FastAlien.width, y, FastAlien.width, FastAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images,speed, screen.player));\n }else{\n int x = 0 - FastAlien.width;\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x-FastAlien.width*2,y,FastAlien.width,FastAlien.height))) hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images, speed,screen.player,false));\n }\n\n }\n\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n }else{\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width*2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages,false));\n }\n }\n /*if (System.currentTimeMillis() - lastBombSpawn >= SpawnTimerBomb) {\n lastBombSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - PurpleCapsuleItem.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x,y,PurpleCapsuleItem.width,PurpleCapsuleItem.height))) hits = true;\n }\n }\n screen.items.add(new PurpleCapsuleItem(x, y, 500, screen.itemPurpleImages));\n }*/\n }else{\n if (stageId==3) {\n //SPACE STAGE\n ///SPAWN ENEMY SHIP:\n //TODO\n if (PlayScreen.entities.size() == 1) {\n isCombatEnabled = false;\n //no enemy spawned, so spawn:\n if (spawnIterator >= killCount) {\n //TODO END STAGE\n } else {\n System.out.println(\"SPAWNS SHIP\");\n spawnIterator++;\n screen.entities.add(new EnemyShipOne(new Vector2(0, 0), 100, screen.enemyShipOne, true, screen.player));\n\n }\n }\n //Items:\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule) {\n lastCapsuleSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new BlackBulletItem(x, y, 1000, screen.itemBlackImages));\n\n\n }\n }else{\n if (stageId == 5){\n isCombatEnabled = true;\n float speed;\n boolean spawnRight=true;\n int where=0;\n //TODO FINAL STAGE\n if (!isBossSpawned){\n //TODO\n screen.entities.add(new Boss(new Vector2(PlayScreen.gameViewport.getWorldWidth(),PlayScreen.gameViewport.getWorldHeight()/2 - Boss.height/2),screen.player));\n isBossSpawned=true;\n }\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId == 4) {\n speed = speed / 2;\n where = Utils.doRandom(0, 1);\n if (where < 50) {\n spawnRight = true;\n } else {\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n } else {\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width * 2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages, false));\n }\n }\n //TODO\n }\n }\n }\n\n //run .update(delta) on all objects\n for (int i=0; i<screen.entities.size();i++){\n screen.entities.get(i).update(delta);\n }\n\n for (int i=0; i<screen.items.size();i++){\n screen.items.get(i).update(delta);\n }\n\n //labels set:\n screen.labelHealth.setText(\"Health: \" + screen.player.health + \"/\" + screen.player.maxHealth);\n if (scoreBased) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + scoreGoal);\n }else{\n if (killCount>0){\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + killCount);\n }else{\n if (boss){\n screen.labelInfo.setText(\"Boss: \"+screen.player.score + \"/\" + Boss.bossHealth);\n }else{\n screen.labelInfo.setText(\"\");\n }\n\n }\n }\n if (this.stageId == 999) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score);\n }\n\n\n }",
"public int getDeaths()\n\t{\n \treturn currentDeath;\n\t}",
"public int getNumEntities()\n\t{\n\t\treturn this.entities.size();\n\t}",
"public void increseHitCount() {\n\r\n\t}",
"private void createEnemy()\n {\n scorpion = new Enemy(\"Giant Scorpion\", 5, 10); \n rusch = new Enemy(\"Mr. Rusch\", 10, 1000);\n skeleton = new Enemy(\"Skeleton\", 10, 50);\n zombie = new Enemy(\"Zombie\", 12, 25);\n ghoul = new Enemy(\"Ghoul\", 15, 45);\n ghost = new Enemy(\"Ghost\", 400, 100);\n cthulu = new Enemy(\"Cthulu\", 10000000, 999999);\n concierge = new Enemy(\"Concierge\", 6, 100);\n wookie = new Enemy(\"Savage Wookie\", 100, 300);\n }",
"private void generateEnemies() {\n for(int i =0; i < currentEnemies.length; i++) {\n Attributes a = genAttributes();\n double[] healthSpeed = genHealthAndSpeed();\n LinkedList<Pathing> paths = map.getPathings();\n this.currentEnemies[i] = new Enemy(determineImage(a, healthSpeed[0]), healthSpeed[0], healthSpeed[1], 10+currentDifficulty/20, a, paths);\n }\n\n }",
"public int getNumeroTexturas()\n {\n return mTextures.size();\n }",
"@EventHandler\r\n \tpublic void onEntityExplode(EntityExplodeEvent event) \r\n \t{\n \t\tif (event.getEntityType() == EntityType.PRIMED_TNT) \r\n \t\t{\r\n \t\t\tLocation eventLoc = event.getLocation();\r\n \t\t\tServer server = plugin.getServer();\r\n \t\t\t\r\n \t\t\t// Red towers\r\n \t\t\tif (redBuildings.DestroyBuilding(BuildingType.Tower, eventLoc))\r\n \t\t\t{\r\n \t\t\t\ttowerCounts.put(\"red\", redBuildings.BuildingsCount(BuildingType.Tower));\r\n\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"A \"+ ChatColor.RED + \"RED\" + ChatColor.YELLOW + \" Tower Has Been Destroyed! (\" + towerCounts.get(\"red\") + \" remaining)\");\r\n\r\n\t\t\t\t// Check if all towers are destroyed\r\n \t\t\t\t\r\n \t\t\t\tif (towerCounts.get(\"red\") == 0) \r\n \t\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"All \"+ ChatColor.RED + \"RED\" + ChatColor.YELLOW + \" Towers Are Destroyed! Defend the NEXUS!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// Blue Towers\r\n \t\t\tif (blueBuildings.DestroyBuilding(BuildingType.Tower, eventLoc))\r\n \t\t\t{\r\n \t\t\t\ttowerCounts.put(\"blue\", blueBuildings.BuildingsCount(BuildingType.Tower));\r\n\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"A \"+ ChatColor.BLUE + \"BLUE\" + ChatColor.YELLOW + \" Tower Has Been Destroyed! (\" + towerCounts.get(\"blue\") + \" remaining)\");\r\n \r\n \t\t\t\t// Check if all towers are destroyed\r\n \t\t\t\tif (towerCounts.get(\"blue\") == 0) \r\n \t\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"All \"+ ChatColor.BLUE + \"BLUE\" + ChatColor.YELLOW + \" Towers Are Destroyed! Defend the NEXUS!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// Nexus\r\n \t\t\tif (redBuildings.DestroyBuilding(BuildingType.Nexus, eventLoc))\r\n \t\t\t{\r\n \t\t\t\tserver.broadcastMessage(ChatColor.RED + \"The RED NEXUS Has Been Destroyed!\" + ChatColor.BLUE + \" BLUE WINS!\");\r\n \t\t\t}\r\n \t\t\telse if (blueBuildings.DestroyBuilding(BuildingType.Nexus, eventLoc))\r\n \t\t\t{\r\n \t\t\t\tserver.broadcastMessage(ChatColor.BLUE + \"The BLUE NEXUS Has Been Destroyed!\" + ChatColor.RED + \" RED WINS!\");\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t}",
"public void processEnemyHitsAndDeaths(AbstractEnemy enemy) {\n this.scoreCounter.changeScore(2000, '+'); // This was put here to see all objectives being met\n this.gameState.updateScoreGoals(this.scoreCounter);\n this.gameState.updateEnemyHitGoals(enemy.getEnemyType());\n this.killCount += 1; \n }",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public HashMap<Integer, Element> getEnemies() {\n\t\treturn enemies;\n\t}"
] | [
"0.6914131",
"0.68801516",
"0.6689271",
"0.6522364",
"0.6411254",
"0.632378",
"0.6292524",
"0.5932288",
"0.58762866",
"0.5870363",
"0.58427584",
"0.5840926",
"0.581578",
"0.5810007",
"0.5794584",
"0.5778734",
"0.57177705",
"0.5706794",
"0.57060313",
"0.5701659",
"0.5694747",
"0.567637",
"0.5668782",
"0.56582165",
"0.56495565",
"0.56495565",
"0.56290555",
"0.56287956",
"0.5627125",
"0.56239444",
"0.5617483",
"0.5596335",
"0.55957687",
"0.5547317",
"0.5529081",
"0.5510005",
"0.55052197",
"0.55037284",
"0.5485983",
"0.54785",
"0.5475758",
"0.5459884",
"0.54465085",
"0.54389083",
"0.5422258",
"0.5421882",
"0.54145795",
"0.5408895",
"0.5407845",
"0.5401588",
"0.53972846",
"0.53972846",
"0.5386474",
"0.5377595",
"0.537657",
"0.5362315",
"0.5343766",
"0.53370124",
"0.532179",
"0.53152746",
"0.53106385",
"0.5302976",
"0.5301123",
"0.5289978",
"0.5289806",
"0.5289642",
"0.52853346",
"0.5280818",
"0.5280698",
"0.52797556",
"0.52753603",
"0.52738464",
"0.5257894",
"0.5256987",
"0.5253437",
"0.52523863",
"0.5246813",
"0.52404296",
"0.52369386",
"0.52330285",
"0.52250403",
"0.52248985",
"0.5221032",
"0.521994",
"0.52190804",
"0.52104884",
"0.5203642",
"0.5203028",
"0.5194547",
"0.51907593",
"0.51759934",
"0.5173489",
"0.5168785",
"0.5163475",
"0.515164",
"0.5151495",
"0.5150805",
"0.5148911",
"0.51419544",
"0.5140305"
] | 0.6470658 | 4 |
EFFECTS: returns the size of the enemy hashmap | public int size() {
return enemies.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int initSize() {\n return initEnemiesSpawned;\n }",
"@Override\n public int getSize() {\n return map.size();\n }",
"@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }",
"public int sizeOfMap(){return size;}",
"int getSpriteArraySize();",
"public int nbEnemiesAlive(){\n return state.getPlayers().size()-1;\n }",
"public int size() {\n return map.size();\n }",
"public int getShotsFiredOfLoadedMap() {\r\n\t\t\r\n\t\t//TODO\r\n\t\t\r\n\t\treturn -1;\r\n\t}",
"@Override\r\n public int size() {\r\n return map.size();\r\n }",
"@Override\n\tpublic int getEnemyCount() {\n\t\treturn 0;//enNum;\n\t}",
"public int\tsize() {\n\t\treturn map.size();\n\t}",
"public int size ()\n {\n return this.entryMap.size ();\n }",
"public int size() {\n return map.size();\n }",
"@Override\n public int size() {\n return map.size();\n }",
"@Override\n\tpublic int size() {\n\t\treturn map.size();\n\t}",
"public int size() {\n\t\treturn map.size();\n\t}",
"public int weaponCount(){\n\t\treturn weaponList.size();\n\t}",
"public int size() {\r\n return this.map.size();\r\n }",
"public int getLength () { return spriteLength; }",
"public final synchronized int size() {\n\t\treturn map.size();\n\t}",
"@Test\n public void mapSize() {\n check(MAPSIZE);\n query(MAPSIZE.args(MAPENTRY.args(1, 2)), 1);\n }",
"@Override\n\tpublic int size() \n\t{\n\t\treturn this.map.size();\n\t}",
"public int size() {\n int size = 0;\n for (Collection<V> value : map.values()) {\n size += value.size();\n }\n return size;\n }",
"public int getSize() {\n\t\treturn WORLD_SIZE;\n\t}",
"public Integer sizeOfMap() {\n\t\tMap<String, String> simpleMap = createSimpleMap(\"Key\", \"Value\");\n numberOfEntries = 10;\n\t\treturn simpleMap.size();\n\t}",
"public int size()\r\n/* 106: */ {\r\n/* 107:194 */ assert (checkRep());\r\n/* 108:195 */ return this.map.keySet().size();\r\n/* 109: */ }",
"protected int dictionarySize() {\n int count = 0;\n \n for ( WordList w : this.wordLists ) {\n count += w.size();\n }\n \n return count;\n }",
"@org.junit.Test\n public void size() throws Exception {\n assertEquals(3, hashTable.size());\n hashTable.put(\"math\", \"club\");\n assertEquals(3, hashTable.size());\n hashTable.put(\"input\", \"string\");\n assertEquals(4, hashTable.size());\n }",
"private void calculateMapSize() {\n calculateMapSize(true);\n }",
"int sizeOfKeyArray();",
"public int sizeOfTypekeyArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(TYPEKEY$16);\r\n }\r\n }",
"public static int getSize(HashMap<Integer, String> students) {\n\t\treturn students.size();\n\t}",
"@Override\r\n\t/**\r\n\t * Each enemy has a unique health and scales as the game goes along\r\n\t */\r\n\tpublic int enemyHealth() {\n\t\treturn enemyHealth;\r\n\t}",
"int getAchieveInfoCount();",
"public int getNumDead() {\n int count = 0;\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (entry.getValue().isDead()) {\n count++;\n }\n }\n return count;\n }",
"public int total_maps() {\r\n\t\tcheck( 1 );\r\n\r\n\t\treturn total_maps;\r\n\t}",
"public int getTotalEnemies() {\n\t\treturn totalEnemies;\n\t}",
"public int getCount(HashMap map) {\n\t\treturn GoodsManager.getCount(map);\n\t}",
"int getMapEntrySize() {\n if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {\n return 1;\n }\n if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {\n return 1 + (typesOfStackItems[0].hasIndex() ? 3 : 1);\n }\n if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {\n return 3 + (typesOfStackItems[0].hasIndex() ? 3 : 1);\n }\n if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX || frameType == Const.SAME_FRAME_EXTENDED) {\n return 3;\n }\n if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {\n int len = 3;\n for (final StackMapType typesOfLocal : typesOfLocals) {\n len += typesOfLocal.hasIndex() ? 3 : 1;\n }\n return len;\n }\n if (frameType != Const.FULL_FRAME) {\n throw new IllegalStateException(\"Invalid StackMap frameType: \" + frameType);\n }\n int len = 7;\n for (final StackMapType typesOfLocal : typesOfLocals) {\n len += typesOfLocal.hasIndex() ? 3 : 1;\n }\n for (final StackMapType typesOfStackItem : typesOfStackItems) {\n len += typesOfStackItem.hasIndex() ? 3 : 1;\n }\n return len;\n }",
"public int size(){\n\t\treturn hashTableSize;\n\t}",
"int getNumberOfTextureCoordinates();",
"public void dictionarySize() {\r\n\t\tSystem.out.println(\"There are currently \" + dictionary.size() + \" words in the dictionary.\");\t\r\n\t}",
"public int size(){\r\n return cjtMap.size();\r\n }",
"public int getMapSize() {\n return mapSize;\n }",
"public boolean waveDestroyed() {\n return map.getHell().getEnemies().size() + map.getEarth().getEnemies().size() + map.getHeaven().getEnemies().size() == 0;\n }",
"public double collisionLength(){\n //count to keep track of how many words there are the chain\n int count = 0;\n for (int i = 0;i< tableSize;i++){\n if (hashTable[i] != null){\n LLNodeHash ptr = hashTable[i];\n //increments if there is an element\n if (ptr != null){\n count++;\n }\n //while loop to traverse the linked list\n while (ptr.getNext() != null){\n //increments for every word\n count++;\n ptr = ptr.getNext();\n }\n }\n }\n return ((double) count / (double) usedIndex);\n }",
"public int loadedPlayers(){\n return playerMap.size();\n }",
"long getAllSize(final TCServerMap[] maps) throws AbortedOperationException;",
"public static void main(String[] args) {\n\t\t\r\n\t Map<String,Integer> hashmap= new HashMap<String,Integer>();\r\n\t hashmap.put(\"Hiamsnhu\",12);\r\n\t hashmap.put(\"Khaneja\", 15);\r\n\t int size=hashmap.size();\r\n\t int hash=hashmap.hashCode();\r\n\t System.out.println(size);\r\n\r\n\t}",
"@Override\r\n public int getSize()\r\n {\r\n return keyHash.size();\r\n }",
"int getMonstersCount();",
"int getMonstersCount();",
"public static synchronized int size() {\n\t\treturn ClassRegistry.dictionary.size();\n\t}",
"public int size() {\n if (hasKeys) {\n return keys.size();\n } else {\n return objects.size();\n }\n }",
"@Override\n public long size(String reference) throws DataStoreException\n {\n if (!dataMap.containsKey(reference)) {\n throw new DataStoreException(\"Failed to retrieve data, the asset does not exist.\");\n }\n return dataMap.get(reference).length;\n }",
"public abstract float getWidth(EntityLivingBase target);",
"@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }",
"public HashMap<Integer, Element> getEnemies() {\n\t\treturn enemies;\n\t}",
"public int size() { return _byHashCode.size(); }",
"public int size() {\n synchronized (cacheMap) {\n return cacheMap.size();\n }\n }",
"@Override\n\tpublic int getEquipmentListSize(Map map) {\n\t\treturn cardoneinfoDao.getEquipmentListSize(map);\n\t}",
"public int numWorlds(){\n return worlds.size();\n }",
"int getKeySize();",
"public int GetMapSize() {\n\t\treturn m_mapSize;\n\t}",
"int sizeOfRoadsideArray();",
"@Override\n\tpublic void setEnemyCount(int n) {\n\t\t\n\t}",
"public static int size() {\n\t\treturn (anonymousSize() + registeredSize());\n\t}",
"public int getSize() {\r\n return dice.size();\r\n }",
"int sizeOfSpeedsArray();",
"int getGameFieldSize();",
"public int size() {\n int size = 0;\n for (Map<Number160, PeerStatistic> map : peerMapVerified) {\n synchronized (map) {\n size += map.size();\n }\n }\n return size;\n }",
"@Test\n public void TEST_UR_MAP_LENGTH() {\n Object[] objects = loadSave(\"emptyRiver\");\n Map map = (Map) objects[0];\n Player player = (Player) objects[1];\n AI[] opponents = (AI[]) objects[2];\n boolean[] NO_KEYS_PRESSED = {false, false, false, false};\n\n for (int i = 0; i < 60*30; i++) {\n map.stepWorld(player, opponents);\n player.updatePlayer(NO_KEYS_PRESSED, Gdx.graphics.getDeltaTime());\n }\n assertFalse(player.hasFinished());\n\n for (int i = 0; i < 60*30; i++) {\n map.stepWorld(player, opponents);\n player.updatePlayer(NO_KEYS_PRESSED, Gdx.graphics.getDeltaTime());\n }\n assertTrue(player.hasFinished());\n }",
"public int size()\r\n\t{\r\n\t\treturn _tiles.size();\r\n\t}",
"int sizeOfDecisionSightDistanceArray();",
"public static int getEnemyLives(){\n return 1 + currentLvl * 2;\n\n }",
"public int size()\n\t{\n\t\treturn creatures.size();\n\t}",
"public double bossHealth(ArrayList<Enemy> currentEnemies) {\n return -1;\n }",
"public void updateEnemies() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n entry.getValue().update(mainPlayerPosX, mainPlayerPosY);\n if (entry.getValue().isDead()) {\n enemiesSize--;\n }\n }\n }",
"public int mapCount(){\r\n\t\treturn this.mapCount;\r\n\t}",
"public int size()\n\t{\n\t\tint size = 0;\n\t\tfor(List<Registry.Entry> li : this.reg.values())\n\t\t\tsize += li.size();\n\t\treturn size;\n\t}",
"@Override\n public int getShoeSize() {\n return this.cards.size();\n }",
"public static int size() {\n\t\treturn anisLookup.size();\n\t}",
"public int size() \n\t{\n\t\treturn numKeys;\n\t}",
"int getAchievementsCount();",
"public int countPoolMaps(){\n\n\t\treturn poolMaps.size();\n\t}",
"public int size() {\n\t\t\treturn gameObjects.size();\n\t\t}",
"@Override\n\tpublic int size() {\n\t\tint tamano = 0;\n\t\tint i = 0;\n\t\tIterator it = tabla.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tit.next();\n\t\t\ttamano += tabla.get(i).keySet().size();\n\t\t\ti++;\n\t\t}\n\t\treturn tamano;\n\t}",
"public int size() {\r\n return listeners.size() + weak.size();\r\n }",
"int getFaintedPokemonCount();",
"int givePropSize(List<Integer[]> coordsInProp) throws Exception;",
"godot.wire.Wire.Vector3 getSize();",
"public int getInventorySize(){\n return inventory.size();\n }",
"long getHits();",
"Integer getSkillCount( String key ){\n return developer.skills.size();\n }",
"protected long getLiveSetSize() {\n\t\t// Sum of bytes removed from the containers.\n\t\tlong removed = 0;\n\n\t\tfor (int i = 0; i < sets.length; i++)\n\t\t\tremoved += sets[i].getContainer().getBytesRemoved();\n\n\t\t/*\n\t\t * The total number of butes still alive is the throughput minus the number of\n\t\t * bytes either removed from the container or never added in the first place.\n\t\t */\n\t\tlong size = getThroughput() - removed - producerThreadPool.getBytesNeverAdded();\n\n\t\treturn (size > 0) ? size : 0;\n\t}",
"public FireSize getSize() {\n return size;\n }",
"@Override\n\t\tprotected int sizeOf(CacheKey key, CacheInfo cacheInfo) {\n\t\t\tif (cacheInfo == null)\n\t\t\t\treturn 0;\n\t\t\treturn cacheInfo.size;\n\t\t}",
"public int getSize() {\n return hostRobotInfoKeyHostRobotInfoMap.size();\n }",
"public int getNumElements() {\n return theMap.size();\n }",
"@Test\n public void TEST_UR_MAP_OBJECT_COUNT() {\n Map[] maps = new Map[3];\n maps[0] = new Map(\"Map1/Map1.tmx\", 1000, \"easy\");\n maps[1] = new Map(\"Map1/Map1.tmx\", 1000, \"medium\");\n maps[2] = new Map(\"Map1/Map1.tmx\", 1000, \"hard\");\n for (int i = 0; i <= 2; i++) {\n Map map = maps[i];\n map.createLanes();\n int obstacleCount = map.lanes[0].obstacles.length;\n int powerupCount = map.lanes[0].powerUps.length;\n for (int j = 1; j <= 3; j++) {\n assertEquals(map.lanes[j].obstacles.length, obstacleCount);\n assertEquals(map.lanes[j].powerUps.length, powerupCount);\n }\n }\n }"
] | [
"0.6361611",
"0.6288397",
"0.62452424",
"0.6179455",
"0.6167093",
"0.6084939",
"0.60825646",
"0.6046665",
"0.60323566",
"0.6029023",
"0.60205793",
"0.6017073",
"0.6012406",
"0.60025257",
"0.5972114",
"0.59662724",
"0.59494627",
"0.5914757",
"0.59037817",
"0.5900467",
"0.5862961",
"0.5860929",
"0.58607197",
"0.582796",
"0.5827464",
"0.58163613",
"0.5798119",
"0.57980514",
"0.5798047",
"0.5732502",
"0.5732477",
"0.5710808",
"0.57049453",
"0.57041115",
"0.5682811",
"0.56810933",
"0.56657153",
"0.5665359",
"0.5656031",
"0.5645482",
"0.5636688",
"0.56241876",
"0.56156427",
"0.56143504",
"0.55924",
"0.5582265",
"0.5572547",
"0.556898",
"0.556651",
"0.55653864",
"0.55506176",
"0.55506176",
"0.55440724",
"0.5543559",
"0.5539796",
"0.55369055",
"0.5530093",
"0.55239385",
"0.5522032",
"0.5517013",
"0.549971",
"0.54945487",
"0.5491767",
"0.5490577",
"0.54869694",
"0.54804957",
"0.54634213",
"0.546024",
"0.544026",
"0.54317623",
"0.5420563",
"0.54051536",
"0.5404027",
"0.5403138",
"0.5396288",
"0.53897125",
"0.538854",
"0.53808",
"0.53804773",
"0.53764343",
"0.5375857",
"0.53656614",
"0.53626513",
"0.53624",
"0.53571534",
"0.5356716",
"0.53522086",
"0.5347227",
"0.53454465",
"0.5343054",
"0.5341918",
"0.53399074",
"0.5336461",
"0.53326935",
"0.5327375",
"0.5324776",
"0.53230846",
"0.5322992",
"0.53182656",
"0.5316943"
] | 0.67830676 | 0 |
EFFECTS: kills all enemies currently spawned | public void killAll() {
for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {
if (!!!entry.getValue().isDead()) {
entry.getValue().setHealth(0);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void enemyoff(){\n getWorld().removeObject(this);\n }",
"public void kill()\r\n {\n if(isTouching(TopDownPlayer.class))\r\n {\r\n health(1);\r\n\r\n getWorld().removeObject(player);\r\n //getWorld().addObject (new Test(), 20, 20);\r\n\r\n }\r\n // if(healthCount >= 1)\r\n // {\r\n // World world;\r\n // world = getWorld();\r\n // getWorld().removeObject(player);\r\n // \r\n // getWorld().addObject (new Test(), 20, 20);\r\n // }\r\n }",
"public void act() \n {\n if(timer > 0){\n timer--;\n }else{\n Greenfoot.playSound(\"explosionSound.wav\");\n getWorld().removeObject(this);\n }\n }",
"void kill()\n\t{\n\t\tfor(GameObject G : ObjectList)\n\t\t{\n\t\t\tG.kill();\n\t\t}\n\t}",
"public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }",
"void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }",
"public void damageTargets(List<Slicer> activeEnemies) {\n // Create list of explosives that have been detonated (regardless of they have hit enemies)\n // These explosives will be removed from the map\n List<Explosive> detExp = new ArrayList<>();\n for (int i=0; i<this.explosives.size(); i++) {\n Explosive explosive = this.explosives.get(i);\n if (explosive != null && explosive.getDetTime()>=DET_TIME) {\n numDetonated++;\n detExp.add(explosive);\n // Checks if enemy is in the area\n // Does damage accordingly\n for (Slicer target: activeEnemies) {\n if (explosive.getCenter().distanceTo(target.getCenter()) <= getEffectRadius()) {\n target.reduceHealth(getDamage());\n }\n }\n }\n }\n // Removes all explosives that have detonated\n explosives.removeAll(detExp);\n }",
"public void killedByPlayer() {\r\n\t\tscreen.enemiesKilled++;\r\n\t\tMazeCrawler mc = screen.mazeHandler.mazeCrawler;\r\n\t\tint n = 2; //if enemy is large do movement n+1 times\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tmc.moveDown();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveDown();}\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tmc.moveLeft();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveLeft();}\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tmc.moveRight();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveRight();}\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tmc.moveUp();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveUp();}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tscreen.enemyDeath.play(.5f);\r\n\t\tdestroy();\r\n\t}",
"public void clearEnemies() {\n\t\tIterator<Entity> it = entities.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tEntity e = it.next();\n\t\t\t//Skip playerfish\n\t\t\tif (e instanceof PlayerFish) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Kill and remove the entity\n\t\t\te.kill();\n\t\t\tit.remove();\n\t\t}\n\t\t\n\t\t//Remove all non playerfish from collidables\n\t\tcollidables.removeIf(c -> !(c instanceof PlayerFish));\n\t\tdrawables.removeIf(c -> !(c instanceof PlayerFish));\n\t}",
"public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}",
"@Override\r\n\tpublic void destroy() {\r\n\t\tsuper.destroy();\r\n\t\t// gotta remove cont effects when this ability leaves game...\r\n\r\n\t\tfor (Effect effect : effects) {\r\n\t\t\tref.getGame().getState().getContinuousEffects()\r\n\t\t\t\t\t.remove(effect);\r\n\t\t}\r\n\r\n\t}",
"void deathHandler(Enemy e) {\n\n if (e != null) {\n Explosion rip = new Explosion();\n rip.kaboom.moveToPoint(e.eTank.getX(), e.eTank.getY());\n // println(\"made enemy\");\n rip.kaboom.frontAngle(90);\n rip.kaboom.turn(90);\n explosion.add(rip);\n }\n for (Explosion exp: explosion) {\n if (exp.kaboomCounter > 1) {\n exp.kaboom.display();\n }\n // if (exp.kaboomCounter < 1) {\n // explosion.remove(exp);\n // }\n // else {\n exp.kaboomCounter -= 3;\n // println(exp.kaboomCounter);\n // println(explosion.size());\n // }\n }\n\n}",
"public void cleanupBattle(List<Enemy> defeatedEnemies){\r\n Character character = world.getCharacter();\r\n updateAllies();\r\n\r\n ArrayList<MovingEntity> deadFriendlies = new ArrayList<MovingEntity>();\r\n for (MovingEntity friendly: world.getFriendlyEntities()) {\r\n if (friendly.getCurrHP() <= 0) {\r\n deadFriendlies.add(friendly);\r\n friendly.destroy();\r\n }\r\n }\r\n world.getFriendlyEntities().removeAll(deadFriendlies);\r\n\r\n \r\n //ArrayList<Enemy> defeatedEnemies = battle.getDefeated();\r\n for(Enemy defeatedEnemy : defeatedEnemies) {\r\n killEnemy(defeatedEnemy);\r\n }\r\n\r\n if (character.getCurrHP() <= 0) {\r\n world.setGameStateLose();\r\n }\r\n }",
"public void stop() {\n enemyTimeline.stop();\n }",
"public void dispara()\r\n {\r\n BulletEnemy bala = new BulletEnemy();\r\n getWorld().addObject(bala,getX(),getY()+25);\r\n }",
"private void stopAllMunitions() {\n\t\tfor (EnemyLauncher el : enemyLauncherArr) {\n\t\t\ttry {\n\t\t\t\tif (el.getCurrentMissile() != null) {\n\t\t\t\t\tel.getCurrentMissile().join();\n\t\t\t\t}\n\n\t\t\t\tel.stopRunning();\n\t\t\t\tel.interrupt();\n\t\t\t\tel.join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tfor (LauncherDestructor ld : launcherDestractorArr) {\n\t\t\ttry {\n\t\t\t\tif (ld.getCurrentMissile() != null) {\n\t\t\t\t\tld.getCurrentMissile().join();\n\t\t\t\t}\n\n\t\t\t\tld.stopRunning();\n\t\t\t\tld.interrupt();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tfor (IronDome ironDome : ironDomeArr) {\n\t\t\ttry {\n\t\t\t\tif (ironDome.getCurrentMissile() != null) {\n\t\t\t\t\tironDome.getCurrentMissile().join();\n\t\t\t\t}\n\n\t\t\t\tironDome.stopRunning();\n\t\t\t\tironDome.interrupt();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}",
"public void takeDamage()\n {\n if(getWorld()!= null)\n {\n if(this.isTouching(Enemies.class))\n {\n Life = Life - Enemies.damage;\n if(Life <=0)\n {\n getWorld().removeObject(this);\n Store.wealth += Game.credit;\n }\n }\n }\n }",
"void garbageCollector() {\n Enemy ETR = null;\n Sprite BTR = null;\n Medkit MTR = null;\n for (Enemy e: enemies) {\n if (e.eTank.getX() < -100) {\n ETR = e;\n }\n }\n for (Sprite c: smBullets) {\n if (c.getX() > width + 100) {\n BTR = c;\n }\n if (c.getY() > height + 100) {\n BTR = c;\n }\n if (c.getX() < -100) {\n BTR = c;\n }\n if (c.getY() < -100) {\n BTR = c;\n }\n }\n \n for (Medkit med : health) {\n if (med.timer <= 0) {\n MTR = med;\n }\n }\n //gets rid of bullets that went off-screen\n if (BTR != null) {\n smBullets.remove(BTR);\n println(\"Deleted bullet\");\n }\n if (ETR != null) {\n enemies.remove(ETR);\n }\n //Medkits to despawn\n if (MTR != null) {\n health.remove(MTR);\n }\n}",
"public void endBattle() {\n for (BattleEffect btlEff : effectsToRemove) {\n btlEff.remove();\n }\n playerInCombat.resetHealthAndMana();\n }",
"private void checkExplosionKill() {\n\t\t\n\t\texplosion.expand();\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tif (explosion.detectDownwardCollision(a.getX(), a.getY())) {\n\t\t\t\t\ta.setVisibility(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void killBullet() {\r\n this.dead = true;\r\n }",
"private void checkForDeaths() {\n Iterator<Entity> entityIter = this.entities.iterator();\n\n //geht alle teilnehmer durch\n while ( entityIter.hasNext() ) {\n Entity entity = entityIter.next();\n\n //und entfernt sie wenn sie tot sind aus der liste und der engine\n if ( this.combatMapper.get(entity).curHealth <= 0 ) {\n entityIter.remove();\n\n //alle actions der entity entfernen, können ja nichts machen wenn sie tot sind\n Iterator<IAction> actionIter = this.actions.iterator();\n\n while ( actionIter.hasNext() ) {\n if ( actionIter.next().getOwner().equals(entity) ) {\n actionIter.remove();\n }\n }\n\n this.combatExp += this.combatMapper.get(entity).level * 5; //TODO\n\n EventSystem.getInstance().commitEvent(new Event(EventSystem.EventType.KILL_EVENT, entity));\n\n this.combatSystem.getEngine().removeEntity(entity);\n }\n }\n }",
"public void stopShooting() {\n\t\tgetWeapon().releaseMain();\n\t\tsetShooting(false);\n\t}",
"public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void removeAllSpawn();",
"public void act() \r\n {\r\n Controller world = (Controller) getWorld();\r\n player = world.getPlayer();\r\n if (this.isTouching(Player.class))\r\n {\r\n player.minusHealth(5);\r\n world.removeObject(this);\r\n }\r\n }",
"private void removeDeadEnemies() {\n ArrayList<Entity> deadEnemies = getAllEnemiesDead();\n if (deadEnemies.size() > 0) {\n for (Entity enemy : deadEnemies) {\n enemiesInCombat.remove(enemy);\n }\n }\n isStillInCombat();\n }",
"@Override\n\tpublic void end() {\n\t\tspriteManager.discard();\n\t\teffectHandler.discard();\n\t\tcircle.discard();\n\t}",
"private void updateEnemies()\n\t \n\t {\n\t for(int i = 0; i < EnemyList.size(); i++)\n\t {\n\t \t//get and update enemy for the enemy list\n\t Enemy eh = EnemyList.get(i);\n\t eh.Update();\n\t \n\t //checks for enemy and player crashes \n\t Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight());\n\t Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());\n\t if(playerRectangel.intersects(enemyRectangel)){\n\t \n\t \t//set player health to zero\n\t \tpl.Health = 0;\n\t \n\t // Remove helicopter from the list.\n\t EnemyList.remove(i);\n\t \n\t //creates new explosion coordinates \n\t enExplosionX = eh.xCoord; \n\t enExplosionY = eh.yCoord; \n\t plExplosionX = pl.xCoord+120;\n\t plExplosionY = pl.yCoord;\n\t GameOn = false;\n\t \n\t }\n\t \n\t // Check health.\n\t if(eh.Health <= 0){\n\t \n\t // Increase the number of destroyed enemies and removes a helicopter froma list.\n\t DestroyedEnemies++;\n\t \n\t \n\t if(DestroyedEnemies == 10)\n\t {\n\t \t//WinsState = true; \n\t \t\n\t }\n\t EnemyList.remove(i);\n\t \n\t }\n\t \n\t // If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased.\n\t if(eh.HasLeftScreen())\n\t {\n\t \tEnemyList.remove(i);\n\t RunAwayEnemies++;\n\t }\n\t \n\t if(RunAwayEnemies > 5)\n\t {\n\t \tGameOn = false; \n\t \t\n\t }\n\t }\n\t \n\t }",
"public void kill() {\n // leben abziehen und geister sowie pacman respawnen\n lives--;\n pacman.respawn(level.getRandomPacmanSpawn());\n for (GameEntity entity : entities)\n if (entity instanceof Ghost)\n ((Ghost) entity).respawn(level.getNextGhostSpawn());\n }",
"public void kill() {\n this.hp = 0;\n }",
"public void act() \n {\n //plays animation with a delay between frames\n explosionSound.play();\n i = (i+1)%(frames.length); \n setImage(frames[i]);\n if(i == 0) getWorld().removeObject(this);\n }",
"public static void playerEffectivelyEndsBattlePhase() {\r\n for (int index = 1; index <= 5; index++){\r\n SummonedMonster MonsterCPU = SummonedMonster.getNthSummonedMonster(index, false);\r\n if (MonsterCPU.isExisting) {\r\n MonsterCPU.canStillAttackThisTurn = false;\r\n }\r\n }\r\n endAttack(false);\r\n }",
"public void kill()\n\t{\n\t\tthis.isDead = true;\n\t\tSystem.out.println(name + \" died!\");\n\t\t//GamePanel.player.playerCombatant.awardXP(this.getXP());\n\n\t\t//TODO: Reload last save or Exit\n\t}",
"public void onImpact() {\r\n die();\r\n }",
"public void turnOffAllTheLights() {\r\n for (Light li : lightsArray) {\r\n li.turnOffLight();\r\n }\r\n }",
"public void moveTowards(){\n \n \n \n if(!exploded){\n \n \n move(speed);\n \n if(isTouching(Enemy.class)){\n move(explosionRadius); \n \n inRange = (ArrayList) getObjectsInRange(explosionRadius + 25, Enemy.class);\n for(Enemy e : inRange){\n e.hit(damage);\n }\n \n //explode\n exploded = true;\n \n image = new GreenfootImage(\"50x50 aoe.png\");\n image.scale(explosionRadius*2, explosionRadius*2);\n setImage(image);\n //getWorld().removeObject(this);\n }\n else if (isAtEdge())\n {\n getWorld().removeObject(this);\n }\n else if ( radius < distance) {\n getWorld().removeObject(this); \n }\n }\n else{\n setImage(image);\n image.setTransparency(image.getTransparency() - 5);\n if(image.getTransparency() <= 0) getWorld().removeObject(this);\n }\n }",
"public static void enemy(){\n\t\tenemy = null;\n\t\twhile(enemy == null){\n\t\t spawnEnemy();\n\t\t}\n\t}",
"public void act() \n {\n checkCollision();\n KeyMovements(); \n attackWeapon();\n //stopGame();\n \n }",
"public void popEnemies() {\n\t\t\n\t\tEnemyList.add(orc);\n\t\tEnemyList.add(goblin);\n\t\tEnemyList.add(necromancer);\n\t\tEnemyList.add(troll);\n\t\tEnemyList.add(minotaur);\n\t\tEnemyList.add(hydra);\n\t\tEnemyList.add(zombie);\n\t\tEnemyList.add(thrall);\n\t\tEnemyList.add(demon);\n\t\tEnemyList.add(witch);\n\t\tEnemyList.add(boss);\n\t}",
"@Override\n public void doRemove()\n {\n Player target = p.getServer().getPlayer(targetID);\n if (target == null)\n return;\n\n // teleport them back to their original location\n target.teleport(originalLocation);\n\n // remove flying and immobolize effects\n for (O2EffectType effectType : additionalEffects)\n {\n Ollivanders2API.getPlayers().playerEffects.removeEffect(targetID, effectType);\n }\n }",
"public void explosion(){\n explosionEffect.play(pitch, volume);\n }",
"@Override\n\t\tpublic void stop() {\n\t\t\tsuper.stop();\n\t\t\tAbstractMinutemanEntity.this.setAggressive(false);\n\t\t}",
"private void quitarCorazones(){\n if(ramiro.estadoItem== Ramiro.EstadoItem.NORMAL){\n efectoDamage.play();\n vidas--;\n }\n }",
"void unsetObjectives();",
"public void killPlayer() {\n \tdungeon.removeentity(getX(), getY(), name);\n \t\tdungeon.deleteentity(getX(),getY(),name);\n \t\t//System.out.println(\"YOU LOSE MAMA\");\n \t\t//System.exit(0);\n \t\t\n }",
"public void performAttack(){\r\n // For every zombie\r\n for (int i = 0 ; i < allZombies.getZombies().size(); i++) {\r\n // Variables used to prevent long getter lines\r\n int zombieX = allZombies.getZombies().get(i).getCurrX();\r\n int zombieY = allZombies.getZombies().get(i).getCurrY();\r\n Zombie zombie = allZombies.getZombies().get(i);\r\n // If the zombie is in range and alive:\r\n if(isInRange(zombieX,zombieY) && zombie.isAlive()) {\r\n // kill the zombie and increase score by 1.\r\n allZombies.getZombies().get(i).setAlive(false);\r\n increaseScore();\r\n }\r\n }\r\n }",
"public void act()\n {\n if (health == 0)\n {\n this.remove();\n }\n }",
"private void reset() {\n\n\n spaceShips.clear();\n playerOne = null;\n playerTwo = null;\n friendlyBullets.clear();\n enemyBullets.clear();\n powerUps.clear();\n enemyGenerator.reset();\n difficulty.reset();\n Bullets.BulletType.resetSpeed();\n\n for (int i = 0; i < enemies.size(); i++) {\n enemies.get(i).getEnemyImage().delete();\n }\n enemies.clear();\n }",
"void destroy() {\n\t\tdespawnHitbox();\n\t\tinventory.clear();\n\t\texperience = 0;\n\t\tinvalid = true;\n\t}",
"public void act() \r\n {\r\n // Add your action code here.\r\n espacio esp=(espacio)getWorld();\r\n Actor act=getOneIntersectingObject(nave.class);//Cuando la nave tome el poder \r\n if(act!=null)\r\n {\r\n for(int i=1;i<=10;i++)//incrementa el poder mediante el metodo solo 1s disparos\r\n esp.poder.incrementar();\r\n getWorld().removeObject(this);\r\n Greenfoot.playSound(\"Poder.wav\");\r\n }\r\n \r\n }",
"public void drawEnemies(){\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy) e;\n if (enemy instanceof EnemyPistol) {\n spriteBatch.draw(enemyPistolTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyAwp){\n spriteBatch.draw(enemyAWPTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyStalker){\n spriteBatch.draw(enemyStalkerTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyBoss){\n spriteBatch.draw(enemyBossTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }\n }\n }",
"public void stopElevators(){\n\t\tfor(int liftNum=0;liftNum<NUM_OF_ELEVATORS;liftNum++){\n\t\t\tlift[liftNum].stopElevator();\n\t\t}\n\t}",
"@Override\n\tpublic void destroy() {\n\t\tfor (GameObject go : World.getObjects()) {\n\t\t\tgo.destroy();\n\t\t}\n\n\t}",
"@Override\n\tpublic void onDeath() {\n\t\tsuper.onDeath();\n\n\t\ttentacles.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\t\trespiratorySystems.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\t\tspawns.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\n\t\ttentacles.clear();\n\t\trespiratorySystems.clear();\n\t\tspawns.clear();\n\t}",
"@Override public void takeAction(Player[] players, Enemy[] enemies, char action)\n {\n \n if (action == 'a') //ATTACK!!!!\n {\n if(gun.isEmpty())\n { \n System.out.println(name+\"'s weapon is empty!\");\n gun.reload();\n }\n else\n {\n Enemy target = target(this, enemies, gun.getAccuracy());\n Attack(target);\n }\n } \n else if (action == 'd')//Hold this position!\n {\n this.defend();\n System.out.println(name+\" hunkers down!\");\n }\n else if (action == 'r')//Reloading! Cover me!\n {\n gun.reload();\n }\n else if (action == 'm')//Fall back! There's too many of them!\n {\n run();\n }\n else\n {\n System.out.println(\"Invalid command.\");\n }\n }",
"protected static void stopAllSounds() {\r\n\t\tSoundManager.stopAll(GameSound.effects);\r\n\t\tSoundManager.stopAll(GameSound.music);\r\n\t\tSoundManager.stopAll(GameSound.melodies);\r\n\t}",
"void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}",
"public void endGame(){\n if(character.getHp() > 0 )effectHandler.endGame();\n character.clearBuffs();\n }",
"public void destroyDefense(){\n\t\tif(currentConstruct != null)\n\t\t\tcurrentConstruct.receiveDamage(currentConstruct.getHitpoints());\n\t}",
"public void onImpact() {\n die();\r\n this.getArrow().remove();\r\n }",
"public void terminate(){\n tState.stop();\n tMovement.stop();\n collision.remove(this); \n }",
"public void killAll() {\n distributors.forEach(Person::kill);\n distributors = new ArrayList<>();\n }",
"public void stopShoot(){\n\t\tshoot.set(0);\n\t}",
"private void fadeOutandDetachSprites() {\n\t\t\t\t\tdetachChild(greenTick);\t\n\t\t\t\t\tdetachChild(redx);\n\t\t\t\t\tdetachChild(sprite1);\n\t\t\t\t\tdetachChild(sprite2);\n\t\t\t\t\tdetachChild(sprite3);\n\t\t\t\t\tdetachChild(sprite4);\n\n\t\t\t\t}",
"public void act() \r\n {\r\n Actor hitMC = getOneIntersectingObject(MC.class);\r\n if (hitMC != null) {\r\n ((Hall) getWorld()).player.health++;\r\n getWorld().removeObject(this);\r\n }\r\n }",
"@Override\n public void onLoad() {\n\n new CommandAPICommand(\"killall\")\n .executes((sender, args) -> {\n //Kills all enemies in all worlds\n Bukkit.getWorlds().forEach(w -> w.getLivingEntities().forEach(e -> e.setHealth(0)));\n \t})\n .register();\n }",
"public void die() {\n\t\tsetDead(true);\n\t\tsetHp(0);\n\t\tgetGraphicShapes().get(stats.getBODY()).setLocation((int) getPosition().x(),\n\t\t\t\t(int) getPosition().y() + stats.getHeight() - stats.getWidth());\n\t\tgetGraphicShapes().get(stats.getBODY()).setSize(stats.getHeight(), stats.getWidth());\n\t\tgetPhysicalRectangle().setLocation((int) getPosition().x(),\n\t\t\t\t(int) getPosition().y() + stats.getHeight() - stats.getWidth());\n\t\tgetPhysicalRectangle().setSize(stats.getHeight(), stats.getWidth());\n\t\tgetGraphicShapes().remove(stats.getWEAPON());\n\t}",
"public void stop() {\n \t\tfor (Expirator e : expirators) {\n \t\t\te.stop();\n \t\t}\n \t}",
"public void killBoss() {\n\t\tSystem.out.println(this.name+\"已经击杀一名敌方英雄...\");\n\t}",
"protected void kill() {\n\t\tsetDeathTime(0.6);\n\t}",
"public void Hit()\n {\n this.numLives--;\n //Oscillate visible and not if the number of lives is greater than zero\n if(this.numLives > 0)\n {\n this.damaged = true;\n this.Blink(1);\n\n }\n }",
"private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }",
"@Override\n public void unInvoke() {\n final Environmental item = affected;\n if (item == null)\n return;\n final Room room = CMLib.map().roomLocation(item);\n if ((canBeUninvoked()) && (room != null))\n room.showHappens(CMMsg.MSG_OK_VISUAL, item, L(\"<S-YOUPOSS> flaming sword is consumed!\"));\n super.unInvoke();\n if ((canBeUninvoked()) && (room != null)) {\n room.recoverRoomStats();\n item.destroy();\n }\n }",
"public void kill() {\r\n\t\t\tfor(Guerre war : aggresiveWar) {\r\n\t\t\t\twar.finalize();\r\n\t\t\t}\r\n\t\t\tfor(Guerre war : defensiveWar) {\r\n\t\t\t\twar.finalize();\r\n\t\t\t}\r\n\t\t\tfor(Case c : caseOwned) {\r\n\t\t\t\tc.liberate();\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(nom + \" n'a pas su s'adapter aux nombreux dangers environnants, l'Histoire oublie les faibles.\");\r\n\t\t\t\r\n\t\t\tfor(String str : saveStats()) System.out.println(str);\r\n\t\t\t//finalisation de la mort\r\n\t\t\tthis.die();\r\n\t\t\tSystem.out.println(\"Une civilisation c'est éteinte...\");\r\n\t\t\t//finalize(); //bloque la sauvegarde et case les relations avec les autres (du à la recherche de la civ par id dans l'arraylist\r\n\t\t}",
"public void onKill(EntityDeathEvent evt) {\r\n }",
"public void removeAll () {\n\t\teffects.clear();\n\t}",
"@Override\n public void performEffectOne(List<Object> targets) {\n checkEmptyTargets(targets);\n ArrayList<Player> roomPlayers = ((Square) targets.get(0)).findRoomPlayers();\n for (Player p : roomPlayers) {\n damage(p, 1);\n getDamagedPlayer().add(p);\n }\n effectControlFlow(1);\n }",
"public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }",
"void takeDamage(int points) {\n this.health -= points;\n }",
"public static void stopAllMotors() {\r\n\t\tleftMotorReg.stop(true);\r\n\t\trightMotorReg.stop(true);\r\n\t\tarmMotor1Reg.stop(true);\r\n\t\tarmMotor2Reg.stop(true);\r\n\t}",
"@EventHandler\r\n \tpublic void onEntityExplode(EntityExplodeEvent event) \r\n \t{\n \t\tif (event.getEntityType() == EntityType.PRIMED_TNT) \r\n \t\t{\r\n \t\t\tLocation eventLoc = event.getLocation();\r\n \t\t\tServer server = plugin.getServer();\r\n \t\t\t\r\n \t\t\t// Red towers\r\n \t\t\tif (redBuildings.DestroyBuilding(BuildingType.Tower, eventLoc))\r\n \t\t\t{\r\n \t\t\t\ttowerCounts.put(\"red\", redBuildings.BuildingsCount(BuildingType.Tower));\r\n\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"A \"+ ChatColor.RED + \"RED\" + ChatColor.YELLOW + \" Tower Has Been Destroyed! (\" + towerCounts.get(\"red\") + \" remaining)\");\r\n\r\n\t\t\t\t// Check if all towers are destroyed\r\n \t\t\t\t\r\n \t\t\t\tif (towerCounts.get(\"red\") == 0) \r\n \t\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"All \"+ ChatColor.RED + \"RED\" + ChatColor.YELLOW + \" Towers Are Destroyed! Defend the NEXUS!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// Blue Towers\r\n \t\t\tif (blueBuildings.DestroyBuilding(BuildingType.Tower, eventLoc))\r\n \t\t\t{\r\n \t\t\t\ttowerCounts.put(\"blue\", blueBuildings.BuildingsCount(BuildingType.Tower));\r\n\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"A \"+ ChatColor.BLUE + \"BLUE\" + ChatColor.YELLOW + \" Tower Has Been Destroyed! (\" + towerCounts.get(\"blue\") + \" remaining)\");\r\n \r\n \t\t\t\t// Check if all towers are destroyed\r\n \t\t\t\tif (towerCounts.get(\"blue\") == 0) \r\n \t\t\t\t\tserver.broadcastMessage(ChatColor.YELLOW + \"All \"+ ChatColor.BLUE + \"BLUE\" + ChatColor.YELLOW + \" Towers Are Destroyed! Defend the NEXUS!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// Nexus\r\n \t\t\tif (redBuildings.DestroyBuilding(BuildingType.Nexus, eventLoc))\r\n \t\t\t{\r\n \t\t\t\tserver.broadcastMessage(ChatColor.RED + \"The RED NEXUS Has Been Destroyed!\" + ChatColor.BLUE + \" BLUE WINS!\");\r\n \t\t\t}\r\n \t\t\telse if (blueBuildings.DestroyBuilding(BuildingType.Nexus, eventLoc))\r\n \t\t\t{\r\n \t\t\t\tserver.broadcastMessage(ChatColor.BLUE + \"The BLUE NEXUS Has Been Destroyed!\" + ChatColor.RED + \" RED WINS!\");\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t}",
"void stopAll();",
"public float[] kill(float killFactor);",
"@Override\n\tprotected void killReward() {\n\t\t\n\t}",
"public void attack(int idx)\n {\n CreatureWorld playerWorld = ;\n \n }",
"int defend(Unit unit, Unit enemy);",
"public void dropExplosives() {\n // Updates the time elapsed for each of the explosives\n for (int i=0; i<this.explosives.size(); i++) {\n Explosive dormantExplosive = this.explosives.get(i);\n dormantExplosive.increaseTime();\n }\n // If the Airplane has reached the end, doesn't detect any enemies\n // Isn't deleted straight away as it needs to wait for explosives to detonate\n if (super.outOfBounds()) {return;}\n this.timeElapsedDrop += ShadowDefend.getTimescale()/FPS;\n //Adds a new explosive\n if (this.timeElapsedDrop >= this.dropTime) {\n this.timeElapsedDrop = 0;\n Explosive newExplosive = new Explosive(super.getCenter());\n // Centers the explosive at the airplane's current position\n newExplosive.centerRectAt(super.getCenter());\n this.explosives.add(newExplosive);\n // Generates a new drop time in range\n this.dropTime = generateDropTime();\n this.numDropped++;\n }\n\n }",
"public void removeAllMissiles(){\n\t\tfor (Missile missile : this.missiles){\n\t\t\tif(!missile.isDestroyed() && missile != null){\n\t\t\t\tmissile.setDestroyed(true);\n\t\t\t\tmissile = null;\n\t\t\t}\n\t\t}\n\t\tfor (Missile fMissile : this.friendlyMissiles){\n\t\t\tif(!fMissile.isDestroyed() && fMissile != null){\n\t\t\t\tfMissile.setDestroyed(true);\n\t\t\t\tfMissile = null;\n\t\t\t}\n\t\t}\n\t}",
"private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }",
"@Override\n public void kill() {\n alive = false;\n Board.getInstance().setPoints(points);\n }",
"public void die() {\r\n final Entity e = entity;\r\n final EnchantArrow arrow = this;\r\n Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Storage.zenchantments, () -> {\r\n if (Storage.advancedProjectiles.containsKey(e)) {\r\n if (Storage.advancedProjectiles.get(e).size() == 1) {\r\n Storage.advancedProjectiles.remove(e);\r\n } else {\r\n Storage.advancedProjectiles.get(e).remove(arrow);\r\n }\r\n }\r\n }, 1);\r\n }",
"@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }",
"@Override\n public void unInvoke() {\n if (!(affected instanceof MOB))\n return;\n final MOB mob = (MOB) affected;\n\n super.unInvoke();\n\n if (canBeUninvoked())\n mob.tell(L(\"Your yearning subsides.\"));\n }",
"private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }",
"public void act() \n {\n World w = getWorld();\n int height = w.getHeight();\n \n setLocation(getX(),getY()+1);\n if (getY() <=0 || getY() >= height || getX() <= 0) // off the world\n {\n w.removeObject(this);\n return;\n }\n \n \n SaboWorld thisWorld = (SaboWorld) getWorld();\n Turret turret = thisWorld.getTurret();\n Actor turretActor = getOneIntersectingObject(Turret.class);\n Actor bullet = getOneIntersectingObject(Projectile.class);\n \n if (turretActor!=null && bullet==null) // hit the turret!\n {\n \n turret.bombed(); //Turret loses health\n explode();\n w.removeObject(this);\n } else if (turret==null && bullet!=null) //hit by a bullet!\n {\n explode();\n w.removeObject(this);\n }\n \n }",
"public void buildingEffect(LoopManiaWorld world) {\n\n List<BasicEnemy> enemies = world.getEnemies();\n\n for (BasicEnemy e : enemies) {\n // if the enemy is in radius and is in battle\n if (Math.pow((this.getX() - e.getX()), 2) + Math.pow((this.getY() - e.getY()), 2) < Math.pow(TOWER_RADIUS,\n 2) && e.isInBattle()) {\n int beforeHealth = e.getHealth();\n e.setHealth(beforeHealth - DAMAGE);\n }\n }\n }",
"protected void end() {\n\t\tshooter.stopShooter();\n\t}",
"@Override\n\tpublic void despawn() {\n\t\t\n\t}",
"public void act() \r\n {\r\n if(timeInterval > 0) {\r\n timeInterval--;\r\n }else{\r\n if(currentSprite < 30) {\r\n currentSprite++;\r\n GreenfootImage img = new GreenfootImage(\"explosion_\" + currentSprite + \".png\");\r\n img.scale(img.getWidth() / 2 + 25, img.getHeight() / 2 + 25);\r\n setImage(img);\r\n timeInterval = timeIntervalDef;\r\n }else{\r\n getWorld().removeObject(this);\r\n }\r\n }\r\n }"
] | [
"0.7140298",
"0.68164104",
"0.67301136",
"0.66866076",
"0.6605781",
"0.6588345",
"0.6560742",
"0.6557921",
"0.65125316",
"0.64988357",
"0.64850706",
"0.64612585",
"0.6454234",
"0.64215887",
"0.64086246",
"0.64057624",
"0.6389588",
"0.6352056",
"0.6338028",
"0.632124",
"0.6314136",
"0.6309473",
"0.62662673",
"0.6213387",
"0.6202308",
"0.6171777",
"0.61513734",
"0.6115855",
"0.610856",
"0.6101458",
"0.6091065",
"0.6069383",
"0.6068683",
"0.6061114",
"0.6055729",
"0.60385203",
"0.60260445",
"0.6003056",
"0.5991234",
"0.59838456",
"0.59804064",
"0.5958996",
"0.5947801",
"0.5946721",
"0.5942305",
"0.59389997",
"0.5916496",
"0.59113765",
"0.59064853",
"0.59052366",
"0.590362",
"0.589862",
"0.5891257",
"0.58754426",
"0.5854141",
"0.58492845",
"0.5825277",
"0.58181304",
"0.58049184",
"0.5797636",
"0.5790677",
"0.5783387",
"0.5780997",
"0.57769585",
"0.5776066",
"0.5775534",
"0.5774778",
"0.5769769",
"0.5762906",
"0.57453585",
"0.5739698",
"0.5736517",
"0.5736269",
"0.573116",
"0.5726883",
"0.5723899",
"0.57231975",
"0.5720702",
"0.5719539",
"0.5718051",
"0.57166207",
"0.57155514",
"0.5709846",
"0.57077354",
"0.5706846",
"0.57043475",
"0.57026374",
"0.56998426",
"0.56968427",
"0.5694385",
"0.5694165",
"0.56871706",
"0.56870216",
"0.5674901",
"0.5673569",
"0.5671557",
"0.5663779",
"0.56564367",
"0.5652684",
"0.56454915"
] | 0.72676075 | 0 |
MODIFIES: this EFFECTS: add enemy externally. | public void forceAddEnemy(Enemy enemy) {
enemies.put(enemiesSize, enemy);
enemiesSize++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addEnemySheild() {\n this.enemyShield += 1;\n }",
"public void addEnemy(Enemy enem)\r\n\t{\r\n\t\tenemy.add(new Enemy(enem));\r\n\t}",
"@Override\n\t\t\tpublic void attack(Base enemy) {\n\t\t\t}",
"private void addEnemies() {\n\t\tred_ghost = new Enemy();\r\n\t\tthis.add(red_ghost);\r\n\t\tenemies.add(red_ghost);\r\n\t\t\r\n\t}",
"public void getEnemyBattleEffects(Enemy enemy) {\n try {\n Ability chosenAbility = enemy.getLastUsableAbility().clone();\n ArrayList<Entity> players = new ArrayList<>();\n players.add(playerInCombat);\n addEffect(enemy.parse(chosenAbility,players,true));\n } catch (InsufficientResourceException ignored) {\n ;\n }\n }",
"public static void enemy(){\n\t\tenemy = null;\n\t\twhile(enemy == null){\n\t\t spawnEnemy();\n\t\t}\n\t}",
"protected abstract void defineEnemy();",
"public void enemyoff(){\n getWorld().removeObject(this);\n }",
"private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }",
"void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }",
"public void dispara()\r\n {\r\n BulletEnemy bala = new BulletEnemy();\r\n getWorld().addObject(bala,getX(),getY()+25);\r\n }",
"public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }",
"private void addPlayerSheild() {\n this.playerShield += 1;\n }",
"void useInBattle(PlayerCharacter player, Opponent enemy) {\n\t}",
"private void createEnemyHelicopter()\n\t {\n\t \t\tRandNum = 0 + (int)(Math.random()*700);\n\t\t \t\tint xCoordinate = 1400;\n\t int yCoordinate = RandNum; \n\t eh = new Enemy(xCoordinate,yCoordinate);\n\t \n\t // Add created enemy to the list of enemies.\n\t EnemyList.add(eh);\n\t \n\t }",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"public void attack()\n {\n getWorld().addObject(new RifleBullet(player.getX(), player.getY(), 1, 6, true), getX(), getY()); \n }",
"@Override\n\tpublic void doCollideEnemy(SlowEnemy enemy) {\n\t\t\n\t}",
"public void enemySpawner(){\n\t\tif (spawnFrame >= spawnTime){\n\t\t\tfor(int i =0;i<enemies.size();i++){\n\t\t\t\tif (!enemies.get(i).getInGame()){\n\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy);\n\t\t\t\t\tbreak;\n\t\t\t\t\t/*if (enemies.get(i).getNum()==1){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==2){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==3){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}*/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tspawnFrame=0;\n\t\t} else{\n\t\t\tspawnFrame+=1;\n\t\t}\n\t}",
"private void createEnemy()\n {\n scorpion = new Enemy(\"Giant Scorpion\", 5, 10); \n rusch = new Enemy(\"Mr. Rusch\", 10, 1000);\n skeleton = new Enemy(\"Skeleton\", 10, 50);\n zombie = new Enemy(\"Zombie\", 12, 25);\n ghoul = new Enemy(\"Ghoul\", 15, 45);\n ghost = new Enemy(\"Ghost\", 400, 100);\n cthulu = new Enemy(\"Cthulu\", 10000000, 999999);\n concierge = new Enemy(\"Concierge\", 6, 100);\n wookie = new Enemy(\"Savage Wookie\", 100, 300);\n }",
"@Override\n\tpublic void loadEnemies() {\n\t\t\n\t}",
"public void applyEffectUser(Enemy user) {\n\t\tsuper.applyEffectsUser(user);\n\t\tuser.addEnrage(enrage);\n\t}",
"BossEnemy(){\n super();\n totallyDied = true;\n }",
"void generateEnemy(){\n\t\tEnemy e = new Enemy((int)(Math.random()*\n\t\t\t(cp.getWidthScreen() - (ss.getWidth()/2)))\n\t\t\t,ss.getHeight(), cp.getHieghtScreen());\t\t\t\t//Enemy (int x, int y, int heightScreen)\n\t\tcp.shapes.add(e);\n\t\tenemies.add(e);\n\t}",
"@Override\n\tpublic void attiva(Player player) {\n\n\t}",
"public Enemy(Texture tex) \r\n\t{\r\n\t\tsuper(tex);\r\n\t\tm_type = \"enemy\";\r\n\t\tm_controller = new IAController();\r\n\t\tm_weapon = new AttackEmitter();\r\n\t\t\r\n\t\tm_lifeBar.setScale(new Vector2(0.3f,0.3f));\r\n\t\t\r\n\t\tm_speed = 50;\r\n\t\tm_life = 4;\r\n\t\t\r\n\t}",
"public void hack(Entity e) {\r\n\t\te.modifyHp(10);\r\n\t}",
"public void setEnemy(Enemy enemy){\n this.enemy = enemy;\n enemy.setXGrid(getXGrid());\n enemy.setYGrid(getYGrid());\n setEntity(enemy);\n }",
"private void spawnEnemy() {\n float randomEnemy = (float) Math.random();\n\n if (round == 1) {\n addActorFunction.accept(new SimpleEnemy(tileSet));\n } else {\n float speedMultiplier = 1 + (0.08f * round);\n float healthMultiplier = 1 + (0.01f * round * round);\n\n if (randomEnemy < (round - 1) * 0.1) {\n addActorFunction.accept(new HeavyEnemy(tileSet, speedMultiplier, healthMultiplier));\n } else {\n addActorFunction.accept(new SimpleEnemy(tileSet, speedMultiplier, healthMultiplier));\n }\n }\n }",
"public void takeDamage()\n {\n if(getWorld()!= null)\n {\n if(this.isTouching(Enemies.class))\n {\n Life = Life - Enemies.damage;\n if(Life <=0)\n {\n getWorld().removeObject(this);\n Store.wealth += Game.credit;\n }\n }\n }\n }",
"private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }",
"@Override\n\tprotected void fireAddEnemyMissile(String launcherId, String destination,\n\t\t\tint damage, int flyTime){\n\t\t\n\t}",
"public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void basicEnemyAI(){\n if(enemyMana == enemyManaMax){\n applyCard(enemyPlayCard(), \"enemy\");\n }\n }",
"void setEnemyPos(Point2D pos);",
"private void addEnemy(int e_num){\n\t\tRandom r_gen = new Random();\n\t\t\n\t\tenemy_num = e_num;\n\t\tenemy = new int[enemy_num][3];\n\t\tfor(int i=0;i<enemy_num;i++){\n\t\t\tenemy[i][0] = r_gen.nextInt(1000)+20;\n\t\t\tenemy[i][1] = r_gen.nextInt(750)+20;\n\t\t\n\t\t}\n\t\tenemy_arrows = new int[e_num][30][4];\n\t\tenemy_arrow_num = new int[e_num];\n\t\tfor(int i=0;i<e_num;i++){\n\t\t\tenemy_arrow_num[i] = 0;\n\t\t}\n\t\tenemy_choose_player();\n\t\n\t}",
"int defend(Unit unit, Unit enemy);",
"@Override\n\tpublic int attack( ){\n\t\treturn enemy.attack();\n\t}",
"private void enemyEncounter()\n {\n currentEnemies = currentRoom.getEnemies();\n \n if(currentEnemies.size() > 0)\n {\n for(Enemy e : currentEnemies)\n {\n System.out.println(\"\\n\" + \"A \" + e.getName() + \" stares menacingly!\" + \"\\n\");\n enemyName = e.getName();\n \n }\n enemyPresent = true;\n clearExits();\n }\n else{\n setExits(); \n }\n }",
"private void generateEnemies(){\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tEnemy enemy = new Enemy(coordX,coordY);\n\t\tenemies.put(0, enemy);\n\t\tcoordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tcoordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tenemy = new Enemy(coordX,coordY);\n\t\tenemies.put(1, enemy);\n\t}",
"@Override\r\n public boolean dye() {\r\n if (getX() > 3100 || getX() < 10 || getY() < 10 || getY() > 3100) {\r\n return true;\r\n }\r\n// int pixel = mapRGB.getRGB((int) getX(), (int) getY());\r\n// int red = (pixel >> 16) & 0xff;\r\n// if(red==255){this.handler.getWaves().removeEnemy(); return true;}\r\n int k = collision(velX, velY, this.getX(), this.getY());\r\n if(k!=0) {\r\n this.handler.getWaves().removeEnemy(); \r\n return true;\r\n }\r\n else{\r\n zombie_x = getX(); \r\n zombie_y = getY();\r\n }\r\n //I proiettili hanno una portata limitata o se ha colpito il player o se è uscito dalla mappa o se è andato contro un muro\r\n if ((this.getHealth() == 0) || (handler.getPlayer().getBounds().contains(getX(), getY()))) {\r\n int n = (int) (Math.random() * 10);\r\n if(n>1) n=2;\r\n switch (n) {\r\n case 2:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 3, 200, 25, handler.getPlayer(), this.handler, 30, 60, 60, 5, new Animation(Assets.zombie, 20), new Animation(Assets.zombieAttack, 35), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 0:\r\n this.handler.addSprite(new StandardZombie(zombie_x, zombie_y, 4, 70, 50, handler.getPlayer(), this.handler, 0, 60, 60, 20, new Animation(Assets.zombie2, 15), new Animation(Assets.zombie2Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n case 1:\r\n this.handler.addSprite(new SpittleZombie(zombie_x, zombie_y, 3, 500, 40, handler.getPlayer(), this.handler, 0, 60, 60, 45, new Animation(Assets.zombie3, 15), new Animation(Assets.zombie3Attack, 15), new Sound(Assets.zombieBite), new Sound(Assets.zombieHit)));\r\n break;\r\n }\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"private void updateEnemies()\n\t \n\t {\n\t for(int i = 0; i < EnemyList.size(); i++)\n\t {\n\t \t//get and update enemy for the enemy list\n\t Enemy eh = EnemyList.get(i);\n\t eh.Update();\n\t \n\t //checks for enemy and player crashes \n\t Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight());\n\t Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());\n\t if(playerRectangel.intersects(enemyRectangel)){\n\t \n\t \t//set player health to zero\n\t \tpl.Health = 0;\n\t \n\t // Remove helicopter from the list.\n\t EnemyList.remove(i);\n\t \n\t //creates new explosion coordinates \n\t enExplosionX = eh.xCoord; \n\t enExplosionY = eh.yCoord; \n\t plExplosionX = pl.xCoord+120;\n\t plExplosionY = pl.yCoord;\n\t GameOn = false;\n\t \n\t }\n\t \n\t // Check health.\n\t if(eh.Health <= 0){\n\t \n\t // Increase the number of destroyed enemies and removes a helicopter froma list.\n\t DestroyedEnemies++;\n\t \n\t \n\t if(DestroyedEnemies == 10)\n\t {\n\t \t//WinsState = true; \n\t \t\n\t }\n\t EnemyList.remove(i);\n\t \n\t }\n\t \n\t // If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased.\n\t if(eh.HasLeftScreen())\n\t {\n\t \tEnemyList.remove(i);\n\t RunAwayEnemies++;\n\t }\n\t \n\t if(RunAwayEnemies > 5)\n\t {\n\t \tGameOn = false; \n\t \t\n\t }\n\t }\n\t \n\t }",
"public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}",
"public Enemy() {\n createModel();\n enemyCounter++;\n }",
"private void subtractEnemySheild(int damage) {\n this.enemyShield -= damage;\n }",
"public void drawEnemies(){\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy) e;\n if (enemy instanceof EnemyPistol) {\n spriteBatch.draw(enemyPistolTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyAwp){\n spriteBatch.draw(enemyAWPTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyStalker){\n spriteBatch.draw(enemyStalkerTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyBoss){\n spriteBatch.draw(enemyBossTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }\n }\n }",
"private static void addEnemy( int team_a, int team_b )\r\n\t{\n\t\tENEMY_MAP[team_a-1][team_b-1] = true;\r\n\t\tENEMY_MAP[team_b-1][team_a-1] = true;\r\n\t}",
"public void popEnemies() {\n\t\t\n\t\tEnemyList.add(orc);\n\t\tEnemyList.add(goblin);\n\t\tEnemyList.add(necromancer);\n\t\tEnemyList.add(troll);\n\t\tEnemyList.add(minotaur);\n\t\tEnemyList.add(hydra);\n\t\tEnemyList.add(zombie);\n\t\tEnemyList.add(thrall);\n\t\tEnemyList.add(demon);\n\t\tEnemyList.add(witch);\n\t\tEnemyList.add(boss);\n\t}",
"public void enemyCreator() { // Creates enemies\n \tif(createFrame >= createTime) {\n \t\tfor(int i = 0; i < enemies.length; i++) {\n \t\t\tif(!enemies[i].isAlive) { // If the enemy is no longer alive\n \t\t\t\tenemies[i].Create(0); // Create a new one\n \t\t\t\tbreak;\n \t\t\t} \t\t\t\t\n \t\t}\n \t\tcreateFrame = 0;\n \t}\n \telse\n \t\tcreateFrame += 1;\n \t\n \tif(killCount == 10){ // Every ten enemies\n \t\tkillCount = 0;\n \t\tif(createTime > 700)\n \t\t\tcreateTime -= 275; // Increase spawn rate\n \t\t\n \t\tif(Enemy.moveSpeed > 8)\t\n \t\t\t\tEnemy.moveSpeed -= 2; // Increase enemy movement speed\n \t\tif(killed > 100)\n \t\t\tBlock.healthTime += 25; // Increase enemy health\n \t\telse if(killed > 200)\n \t\t\tBlock.healthTime += 30;\n \t\telse\n \t\t\tBlock.healthTime += 20;\n \t}\n }",
"public void moveTowards(){\n \n \n \n if(!exploded){\n \n \n move(speed);\n \n if(isTouching(Enemy.class)){\n move(explosionRadius); \n \n inRange = (ArrayList) getObjectsInRange(explosionRadius + 25, Enemy.class);\n for(Enemy e : inRange){\n e.hit(damage);\n }\n \n //explode\n exploded = true;\n \n image = new GreenfootImage(\"50x50 aoe.png\");\n image.scale(explosionRadius*2, explosionRadius*2);\n setImage(image);\n //getWorld().removeObject(this);\n }\n else if (isAtEdge())\n {\n getWorld().removeObject(this);\n }\n else if ( radius < distance) {\n getWorld().removeObject(this); \n }\n }\n else{\n setImage(image);\n image.setTransparency(image.getTransparency() - 5);\n if(image.getTransparency() <= 0) getWorld().removeObject(this);\n }\n }",
"public void enemyTurnStart() {\n\r\n\t}",
"void evadeAttack(IUnit attacker, int incomingDamage);",
"public Enemy getEnemy(){\n return enemy;\n }",
"public void setAlive(boolean alive){\n // make sure the enemy can be alive'nt\n this.alive = alive; \n }",
"@Override\n public void attack(Entity e) {\n e.hit(atk);\n }",
"private void createPlayerExplosion() {\n\t\tAsteroidsExplosion explosion = new AsteroidsExplosion(GameObject.ROOT, this, 50, 20.0, 3.0);\n\t\texplosion.translate(player.getPositionVector());\n\t\totherObjects.add(explosion);\n\t}",
"@Override\n public void applyEffect(Player player) {\n\n player.add(mResourcesGains);\n\n }",
"public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }",
"void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);",
"public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}",
"public void addHitListenerToEnemy(HitListener hl) {\r\n for (Enemy e : enemies) {\r\n e.addHitListener(hl);\r\n }\r\n }",
"public void setDmg(int enemyDmg){\r\n this.enemyDmg = enemyDmg;\r\n }",
"private void spawnStuff(PlayScreen screen, float delta) {\n if (stageId!=3 && stageId!=5) {\n isCombatEnabled = true;\n int where;\n boolean spawnRight = true;\n float speed;\n\n\n //Alien Spawn\n if (System.currentTimeMillis() - lastASpawn >= SpawnATimer + extraTimer) {\n speed = (float)(Utils.doRandom(250,400));\n lastASpawn = System.currentTimeMillis();\n int count = 3;\n if (stageId==4) count = 1;\n for (int i = 0; i < count; i++) {\n if (stageId==4){\n speed = (float) (speed*0.75);\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - Alien.width, y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player));\n }else{\n int x = 0 - Alien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + Alien.width*2 , y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player,false));\n }\n }\n }\n //AcidAlien Spawn\n if (System.currentTimeMillis() - lastBSpawn >= SpawnBTimer + extraTimer) {\n speed = 200;\n lastBSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - AcidAlien.width, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player));\n }else{\n int x = 0 - AcidAlien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + AcidAlien.width*2, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player,false));\n }\n }\n //FastAlien Spawn\n if (System.currentTimeMillis() - lastCSpawn >= SpawnCTimer + extraTimer) {\n speed= Utils.doRandom(250,400);\n lastCSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - FastAlien.width, y, FastAlien.width, FastAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images,speed, screen.player));\n }else{\n int x = 0 - FastAlien.width;\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x-FastAlien.width*2,y,FastAlien.width,FastAlien.height))) hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images, speed,screen.player,false));\n }\n\n }\n\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n }else{\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width*2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages,false));\n }\n }\n /*if (System.currentTimeMillis() - lastBombSpawn >= SpawnTimerBomb) {\n lastBombSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - PurpleCapsuleItem.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x,y,PurpleCapsuleItem.width,PurpleCapsuleItem.height))) hits = true;\n }\n }\n screen.items.add(new PurpleCapsuleItem(x, y, 500, screen.itemPurpleImages));\n }*/\n }else{\n if (stageId==3) {\n //SPACE STAGE\n ///SPAWN ENEMY SHIP:\n //TODO\n if (PlayScreen.entities.size() == 1) {\n isCombatEnabled = false;\n //no enemy spawned, so spawn:\n if (spawnIterator >= killCount) {\n //TODO END STAGE\n } else {\n System.out.println(\"SPAWNS SHIP\");\n spawnIterator++;\n screen.entities.add(new EnemyShipOne(new Vector2(0, 0), 100, screen.enemyShipOne, true, screen.player));\n\n }\n }\n //Items:\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule) {\n lastCapsuleSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new BlackBulletItem(x, y, 1000, screen.itemBlackImages));\n\n\n }\n }else{\n if (stageId == 5){\n isCombatEnabled = true;\n float speed;\n boolean spawnRight=true;\n int where=0;\n //TODO FINAL STAGE\n if (!isBossSpawned){\n //TODO\n screen.entities.add(new Boss(new Vector2(PlayScreen.gameViewport.getWorldWidth(),PlayScreen.gameViewport.getWorldHeight()/2 - Boss.height/2),screen.player));\n isBossSpawned=true;\n }\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId == 4) {\n speed = speed / 2;\n where = Utils.doRandom(0, 1);\n if (where < 50) {\n spawnRight = true;\n } else {\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n } else {\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width * 2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages, false));\n }\n }\n //TODO\n }\n }\n }\n\n //run .update(delta) on all objects\n for (int i=0; i<screen.entities.size();i++){\n screen.entities.get(i).update(delta);\n }\n\n for (int i=0; i<screen.items.size();i++){\n screen.items.get(i).update(delta);\n }\n\n //labels set:\n screen.labelHealth.setText(\"Health: \" + screen.player.health + \"/\" + screen.player.maxHealth);\n if (scoreBased) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + scoreGoal);\n }else{\n if (killCount>0){\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + killCount);\n }else{\n if (boss){\n screen.labelInfo.setText(\"Boss: \"+screen.player.score + \"/\" + Boss.bossHealth);\n }else{\n screen.labelInfo.setText(\"\");\n }\n\n }\n }\n if (this.stageId == 999) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score);\n }\n\n\n }",
"void effect(Entity e, BoardPosition bp);",
"public void addEffect(String e) {\n \t\tif (!e.isEmpty())\n \t\t\teffects.add(e);\n \t\t// TODO: process effects to make attributes\n \t}",
"public void attack(int idx)\n {\n CreatureWorld playerWorld = ;\n \n }",
"private void createBasicEnemies() {\n\t\tint xTemp1 = (int) app.random(60, 500);\n\t\tint xTemp2 = (int) app.random(650, 1140);\n\t\tint yTemp = -60;\n\t\t\n\t\t//Contador para crear enemigo cada cierto tiempo\n\t\tapp.frameRate(80);\n\t\t\n\t\t//Agregar enemigos basicos\n\t\tif (app.frameCount%120 == 0) {\n\t\t\tbasicEnemies1.add(new BasicEnemy(app, xTemp1, yTemp));\n\t\t\tbasicEnemies2.add(new BasicEnemy(app, xTemp2, yTemp));\n\t\t}\n\t\t\n\t\t//Agregar enemigos que disparan\t\t\n\t\tif (app.frameCount%250 == 0) {\n\t\t\thardEnemies1.add(new HardEnemy(app, xTemp1, yTemp));\n\t\t\thardEnemies2.add(new HardEnemy(app, xTemp2, yTemp));\n\t\t}\n\t}",
"public void placeAlienBullet() {\r\n\t\tif (alien != null) {\r\n\t\t\t// If the alien is large fires a bullet in a random direction\r\n\t\t\tif (alien.getSize() == 1 && ship != null) {\r\n\r\n\t\t\t\t// Create the alien bullet\r\n\t\t\t\tab = new AlienBullet(alien.getX(), alien.getY());\r\n\r\n\t\t\t\t// give the alien bullet a random direction and the bullet speed velocity,\r\n\t\t\t\t// then add as participant\r\n\t\t\t\tdouble r = (2 * Math.PI) * RANDOM.nextDouble();\r\n\t\t\t\tab.setVelocity(BULLET_SPEED, r);\r\n\t\t\t\taddParticipant(ab);\r\n\r\n\t\t\t\t// Sets the alien bullet to expire when it reaches the bullet duration time\r\n\t\t\t\t// limit\r\n\t\t\t\tnew ParticipantCountdownTimer(ab, \"expire\", BULLET_DURATION);\r\n\t\t\t}\r\n\r\n\t\t\t// If the alien is small fires a bullet aimed directly at the ship\r\n\t\t\tif (alien.getSize() == 0 && ship != null) {\r\n\t\t\t\tab = new AlienBullet(alien.getX(), alien.getY());\r\n\t\t\t\tab.setSpeed(BULLET_SPEED);\r\n\r\n\t\t\t\t// Aims the alien bullet directly at the ship\r\n\t\t\t\tdouble A = ship.getY() - alien.getY();\r\n\t\t\t\tdouble B = ship.getX() - alien.getX();\r\n\t\t\t\tdouble angle = Math.atan2(A, B);\r\n\t\t\t\tab.setVelocity(BULLET_SPEED, angle);\r\n\r\n\t\t\t\t// Add the alien bullet as a participant and then set it to expire when it\r\n\t\t\t\t// reaches the bullet duration time limit\r\n\t\t\t\taddParticipant(ab);\r\n\t\t\t\tnew ParticipantCountdownTimer(ab, \"expire\", BULLET_DURATION);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic void OnUse(Bob bob,float x, float y, float dist) {\n\t\tsuper.OnUse(bob,x, y,dist);\n\t\t\n\t\tif(flag)\n\t\t{\n\t\t\tif(!World.CurrentWorld.UpdateList.contains(this)) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tWorld.CurrentWorld.UpdateList.add(update);\n\t\t\t}\n\t\t\t\n\t\t\tint X = (int)x/Terrain.CurrentTerrain.chunkWidth;\n\t\t\tint Y = (int)y/Terrain.CurrentTerrain.chunkHeight;\n\t\t\tint x2 = (int)x%Terrain.CurrentTerrain.chunkWidth;\n\t\t\tint y2 = (int)x%Terrain.CurrentTerrain.chunkWidth;\n\t\t\t\n\t\t\tif(parentinv.owner.firstUse()) {\n\t\t\t\tif(Terrain.CurrentTerrain.CreateBlock(parentinv.owner,(int)x,(int)y, InvObjID))\n\t\t\t\t\tBob.CurrentBob.inventory.AddToBag(name,-1,true);\n\t\t\t}\n\t\t//Terrain.CurrentTerrain.light.floodStack.add(new Vector3(x,y,0));\n\t\t\n\t\t\n\t\tflag=false;\n\t\t}\n\t}",
"public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }",
"public Enemy(int setX, int setY, int setHealth, int setDamage) {\n\t\tsuper(setHealth, setDamage,16,18,0, 4);\n\t\tenemy.setScaleX(2.5);\n\t\tenemy.setScaleY(2.5);\n\t\tenemy.setLayoutX(setX);\n\t\tenemy.setLayoutY(setY);\n\t\t\n\t\tCore.addSolid(enemy);\n\n\t\tenemy.setId(\"enemy\");\n\t\tenemy.setViewport(enemyport);\n\t}",
"@Override\n public void run() {\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n int rnd_x = rnd.nextInt(Game.WIDTH);\n handler.addObject(new Enemy(getX() + 30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() -30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y+30, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y-30, ID.Trump, 0));\n\n\n }",
"int attack(Unit unit, Unit enemy);",
"public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }",
"@Override\n\tpublic void setEnemyCount(int n) {\n\t\t\n\t}",
"private void loadEnemies(BasicEnemy enemy) {\n String enemyName = enemy.getType().get();\n switch (enemyName) {\n case \"Slug\":\n onLoad((Slug) enemy);\n break;\n case \"Zombie\":\n onLoad((Zombie) enemy);\n break;\n case \"Vampire\":\n onLoad((Vampire) enemy);\n break;\n default:\n System.out.println(\"Should not see this LMWC: {\" + enemyName + \"}\");\n break;\n }\n }",
"private void addAdditionalEffects()\n {\n // make them fly so they do not fall from suspension\n FLYING flying = new FLYING(p, duration + 10, targetID);\n Ollivanders2API.getPlayers().playerEffects.addEffect(flying);\n additionalEffects.add(O2EffectType.FLYING);\n\n // add an immbolize effect with a duration slightly longer than this one so that they cannot move while suspended\n IMMOBILIZE immbobilize = new IMMOBILIZE(p, duration + 10, targetID);\n Ollivanders2API.getPlayers().playerEffects.addEffect(immbobilize);\n additionalEffects.add(O2EffectType.IMMOBILIZE);\n }",
"@Override\n\tprotected void onPlayerDamage(EntityDamageEvent evt, Player p) {\n\t\tsuper.onPlayerDamage(evt, p);\n\t\tif(evt.getCause() == DamageCause.WITHER){\n\t\t\tGUtils.healDamageable(getOwnerPlayer(), evt.getDamage() * 1.5);\n\t\t\tVector v = Utils.CrearVector(getOwnerPlayer().getLocation(), getPlayer().getLocation()).multiply(0.5D);\n\t\t\tdouble max = 7;\n\t\t\tfor (int i = 0; i < max; i++) {\n//\t\t\t\tgetWorld().playEffect(getPlayer().getEyeLocation().add(0, -0.8, 0).add(v.clone().multiply(i/max)),\n//\t\t\t\t\t\tEffect.HEART, 0);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void applyEffect(Battle battle, Cell cell, Account player, int activeTime) {\n /* if (activeTime != -1)\n return;\n ManaItemBuff manaItemBuff = new ManaItemBuff(player, 1);\n manaItemBuff.setTurnCounter(-5);\n manaItemBuff.castBuff();\n player.getOwnBuffs().add(manaItemBuff);*/\n }",
"public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }",
"private void explode()\n\t{\n\t\texplosion.setX(getX());\n\t\texplosion.setY(getY());\n\t\t\n\t\tif(!explosion.isOver())\n\t\t{\n\t\t\texplosion.update();\n\t\t\texplosion.drawObject();\n\t\t}\t\n\t\telse\n\t\t\talive = false;\n\t}",
"public Lunge() {\n super(SkillFactory.LUNGE, \"Lunge\", SkillDescription.lunge, 15, Pokemon.Type.BUG,\n SkillCategory.PHYSICAL, 100, 80, 1, 1.0);\n secondaryEffects.add(new AttackEffect(SecondaryEffect.Target.ENEMY, 1,\n SecondaryEffect.StatDirection.DECREASE));\n makesPhysicalContact = true;\n }",
"private void spawnMediumEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }",
"@Override\n public String getEntLS() {\n return \"Enemies\";\n }",
"private void generateEnemies() {\n for(int i =0; i < currentEnemies.length; i++) {\n Attributes a = genAttributes();\n double[] healthSpeed = genHealthAndSpeed();\n LinkedList<Pathing> paths = map.getPathings();\n this.currentEnemies[i] = new Enemy(determineImage(a, healthSpeed[0]), healthSpeed[0], healthSpeed[1], 10+currentDifficulty/20, a, paths);\n }\n\n }",
"void deathHandler(Enemy e) {\n\n if (e != null) {\n Explosion rip = new Explosion();\n rip.kaboom.moveToPoint(e.eTank.getX(), e.eTank.getY());\n // println(\"made enemy\");\n rip.kaboom.frontAngle(90);\n rip.kaboom.turn(90);\n explosion.add(rip);\n }\n for (Explosion exp: explosion) {\n if (exp.kaboomCounter > 1) {\n exp.kaboom.display();\n }\n // if (exp.kaboomCounter < 1) {\n // explosion.remove(exp);\n // }\n // else {\n exp.kaboomCounter -= 3;\n // println(exp.kaboomCounter);\n // println(explosion.size());\n // }\n }\n\n}",
"public void attack(Entity entity) {\n\t}",
"public void makesHereBack(){this.piece.affect();}",
"public void killedByPlayer() {\r\n\t\tscreen.enemiesKilled++;\r\n\t\tMazeCrawler mc = screen.mazeHandler.mazeCrawler;\r\n\t\tint n = 2; //if enemy is large do movement n+1 times\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tmc.moveDown();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveDown();}\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tmc.moveLeft();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveLeft();}\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tmc.moveRight();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveRight();}\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tmc.moveUp();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveUp();}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tscreen.enemyDeath.play(.5f);\r\n\t\tdestroy();\r\n\t}",
"private void normal(EntityManager manager) {\r\n Shot shot = new Shot(shotTexture, getX() + forwardX, getY() + forwardY, forwardX * 30, forwardY * 30, 800, 0.65f, 1, 0, 1, true, 200, false);\r\n\r\n manager.addEntity(shot);\r\n manager.shotFired(0);\r\n }",
"private void reactToEnemyDefeat(BasicEnemy enemy) {\n // react to character defeating an enemy\n // item rewards\n triggerDropItem(0.5);\n triggerDropPotion(0.1);\n triggerDropTheOneRing(0.002);\n\n // gold & exp rewards\n triggerGainGold(10, 0.2);\n triggerGainExp(5, 1);\n\n // card rewards\n triggerDropCard(0.4); // 0.08 actual, 0.5 for test\n }",
"public void act()\n {\n if(isInWorld == true)\n {\n if(!WorldOne.isTimerOn() && getWorld().getClass() == WorldOne.class && WorldControl.subWave == 1)\n { \n getWorld().addObject(healthMessage, getX() - 30, getY() - 30);\n }\n getWorld().addObject(healthMessage, getX() - 30, getY() - 30);\n move();\n lastX = getX();\n lastY = getY();\n healthMessage.updatePosition(getX() - 30, getY() - 30);\n healthMessage.update(\"HP \" + getHealth(), Color.GREEN, font); \n checkKeys();\n incrementReloadDelayCount();\n //healthMessage.update(\"HP \" + getHealth(), Color.GREEN, font);\n if(!hasHealth())\n {\n removeSelfFromWorld(healthMessage);\n removeSelfFromWorld(this);\n isInWorld = false;\n isRocketAlive = false;\n Greenfoot.playSound(\"Explosion.wav\");\n }\n } \n\n }",
"private void prepareLevel(){\n levelAnimation = true;\n\n // Reset the menace level\n menaceInterval = 1200;\n\n // Here we will initialize all the game objects\n // Make a new player space ship\n defender = new Defender(context, PlayableX, PlayableY, ExcessX);\n\n // Prepare the players bullet\n bullet = new Bullet(context, PlayableX, PlayableY, (float) 1.2);\n\n // Initialize the invadersBullets array\n for(int i = 0; i < invadersBullets.length; i++){\n invadersBullets[i] = new Bullet(context, PlayableX, PlayableY, (float) 0.80);\n }\n\n // Build an army of invaders\n numInvaders = 0;\n for(int column = 0; column < invadersColumn; column ++ ){\n for(int row = 0; row < invadersRow; row ++ ){\n invaders[numInvaders] = new Invader(context, row, column, PlayableX, PlayableY, ExcessX);\n numInvaders ++;\n }\n }\n invadersLeft = numInvaders;\n\n try {\n // Create objects of the 2 required classes\n AssetManager assetManager = context.getAssets();\n explosionEffect = new Bitmap[12];\n for (int i=0; i < 12; i++) {\n explosionEffect[i] = Bitmap.createScaledBitmap(BitmapFactory.decodeStream(assetManager.open(\"explosion/\" + (i + 1) + \".png\")), (int) (invaders[0].getLength()*1.75), (int) (invaders[0].getLength()*1.75), true);\n }\n } catch (IOException e) {\n e.printStackTrace();\n // Print an error message to the console\n Log.e(\"error\", \"failed to load explosion effect image files\");\n }\n\n }",
"public void act() \n {\n if(timer > 0){\n timer--;\n }else{\n Greenfoot.playSound(\"explosionSound.wav\");\n getWorld().removeObject(this);\n }\n }",
"public void explosion(){\n explosionEffect.play(pitch, volume);\n }",
"@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n addToBot(new DamageAction(m, new DamageInfo(p, damage, damageTypeForTurn), AbstractGameAction.AttackEffect.BLUNT_LIGHT));\n int count = 0;\n for (AbstractMonster monster : AbstractDungeon.getMonsters().monsters) {\n if (!monster.isDeadOrEscaped()) {\n count++;\n }\n }\n if (count > 1) {\n addToBot(new DamageAllEnemiesAction(p, multiDamage, damageTypeForTurn, AbstractGameAction.AttackEffect.BLUNT_LIGHT));\n }\n }",
"public void act() \n {\n //plays animation with a delay between frames\n explosionSound.play();\n i = (i+1)%(frames.length); \n setImage(frames[i]);\n if(i == 0) getWorld().removeObject(this);\n }",
"@Override\n public void explode(ArrayList<ScreenObject> level) {\n level.add(new Explosion(position.x, position.y, 100, 100,\n Explosion.expSubtype.YELLOW));\n }",
"private void fire(GameEngine gameEngine) {\n Bullet bullet1 = gameEngine.getBulletEnemy();\n if (bullet1 == null) {\n return;\n }\n bullet1.init(this, positionX + imageWidth/2, positionY, 0);\n gameEngine.addGameObject(bullet1);\n gameEngine.playSound(1);\n }",
"@EventHandler\n\tpublic void attackMobs(EntityDamageByEntityEvent e) {\n\t\tMessages messagesConfig = plugin.getMsgs();\n\n\t\tif (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) { //Just my magic code w(o.o)w\n\t\t\treturn;\n\t\t}else if (e.getDamager() instanceof Player) {\n\t\t\tPlayer p = (Player) e.getDamager();\n\t\t\tItemStack pInv = p.getInventory().getItemInMainHand();\n\n\t\t\tif (!pInv.getType().name().contains(\"SWORD\") && !pInv.getType().name().contains(\"AXE\")) {\n\t\t\t\tif (!(e.getEntity() instanceof Chicken)) {\n\t\t\t\t\te.setCancelled(true);\n\n\t\t\t\t\tif (canSendMessage(p.getUniqueId()))\n\t\t\t\t\t\tp.sendMessage(StringUtil.inColor(messagesConfig.getCantHitWithoutSword()));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.77380407",
"0.677207",
"0.6767409",
"0.67270523",
"0.6701463",
"0.6644148",
"0.66364187",
"0.6629106",
"0.6547814",
"0.6478757",
"0.6474177",
"0.6375186",
"0.6331196",
"0.6316957",
"0.6289465",
"0.6248551",
"0.6239078",
"0.62071395",
"0.6202856",
"0.61530143",
"0.61181563",
"0.60968435",
"0.6059821",
"0.6053245",
"0.6052864",
"0.6048202",
"0.6045231",
"0.6035945",
"0.603217",
"0.60148776",
"0.601228",
"0.6012033",
"0.60115373",
"0.6007009",
"0.6002174",
"0.5998994",
"0.5991092",
"0.5988516",
"0.5977944",
"0.59752494",
"0.5966106",
"0.59608203",
"0.59482276",
"0.59285825",
"0.59241784",
"0.59221154",
"0.5919482",
"0.59097844",
"0.5891076",
"0.5874989",
"0.5870597",
"0.5864297",
"0.58598864",
"0.5854796",
"0.58430785",
"0.58430535",
"0.5836268",
"0.5830273",
"0.5829525",
"0.58071285",
"0.5805829",
"0.58056074",
"0.5796812",
"0.5795392",
"0.57945466",
"0.5783705",
"0.5772331",
"0.5770324",
"0.5768113",
"0.5766482",
"0.5761198",
"0.5759631",
"0.57521975",
"0.5749309",
"0.57484406",
"0.5748234",
"0.5746722",
"0.57367796",
"0.57273155",
"0.5721956",
"0.5709953",
"0.5707792",
"0.5702105",
"0.5699182",
"0.56946796",
"0.5691779",
"0.5682102",
"0.5673979",
"0.5662107",
"0.56619763",
"0.5655886",
"0.56487864",
"0.5638303",
"0.5632532",
"0.562484",
"0.5624132",
"0.5618918",
"0.56181115",
"0.56160367",
"0.561085"
] | 0.63786584 | 11 |
It is a default constructor which describes the class Mouse. | Mouse(){
System.out.println("This is Mouse class.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Mouse() {}",
"public Mouse() {\n\t\tthis(null);\n\t}",
"public MouseHandler()\n {\n // initialise instance variables:\n //INSTANTIATE listeners list:\n _listeners = new ArrayList<IMouseListener>();\n \n }",
"public MousePointer () {\n\t\tthis.loadPointer(MousePointer.DEFAULT_CURSOR);\n\t}",
"public Mouse(Actor concerning) {\n\t\tlastState = new MouseState(false, false, false, false, null);\n\t\tthis.concerning = concerning;\n\t}",
"public SimpleTrackMouse()\n { \n // Set background color and arrange for the panel to listen for mouse events.\n setBackground(Color.WHITE);\n MouseHandler listener = new MouseHandler();\n addMouseListener(listener); // Register mouse listener.\n addMouseMotionListener(listener); // Register mouse motion listener.\n }",
"public MouseInput(IMouseHandler handler) {\n theHandler = handler;\n }",
"public MouseSensor(GameObject gameObject) {\n super(gameObject);\n }",
"public MouseCrosstabShuttleVO()\n {\n // Documented empty block - avoid compiler warning - no super constructor\n }",
"public Mouse getMouse() {\n return mouse;\n }",
"public Mouse getMouse()\r\n\t{\r\n\t\treturn mouse;\r\n\t}",
"T getMouse();",
"public GameCursor() {\n }",
"public GameInput() {\n keyboard = new Keyboard();\n mouse = new Mouse();\n mouseWheel = new MouseWheel();\n }",
"public MouseMotionDemo()\n\t{\n\t\tsetLayout(new FlowLayout());\n\t\t\n\t\tadd(new Label(\"X-Click: \"));\n\t\ttfMouseClickX = new TextField(10);\n\t\ttfMouseClickX.setEditable(false);\n\t\tadd(tfMouseClickX);\n\t\t\n\t\tadd(new Label(\"Y-Click: \"));\n\t\ttfMouseClickY = new TextField(10);\n\t\ttfMouseClickY.setEditable(false);\n\t\tadd(tfMouseClickY);\n\t\t\n\t\tadd(new Label(\"X-Position: \"));\n\t\ttfMousePositionX = new TextField(10);\n\t\ttfMousePositionX.setEditable(false);\n\t\tadd(tfMousePositionX);\n\t\t\n\t\tadd(new Label(\"Y-Position: \"));\n\t\ttfMousePositionY = new TextField(10);\n\t\ttfMousePositionY.setEditable(false);\n\t\tadd(tfMousePositionY);\n\t\t\n\t\taddMouseListener(this);\n\t\taddMouseMotionListener(this);\n\t\t\n\t\tsetTitle(\"Mouse Motion Demo\");\n\t\tsetSize(400, 400);\n\t\tsetVisible(true);\n\t}",
"private void setMousePossition() {\n mouseX = Mouse.getMouseX() / Display.SCALE;\n mouseY = Mouse.getMouseY() / Display.SCALE;\n }",
"public interface MouseEvents {\n\n /**\n * Called when a key is pressed\n * */\n void keyPressed(String code);\n\n /**\n * Called when the mouse button mouse is pressed\n * */\n void mousePressed(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse is released\n * */\n void mouseReleased(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse is clicked\n * */\n void mouseClicked(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse have moved\n * */\n void mouseMoved(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse is dragged\n * */\n void mouseDragged(double x, double y, MouseEvent e );\n}",
"public MouseEvent(int button , double x , double y) {\n\t\t//Call the super constructor\n\t\tsuper(EVENT_NAME , EVENT_DESCRIPTION);\n\t\t//Check what button is pressed and assign it\n\t\tif (button == 0)\n\t\t\tthis.isLeftButton = true;\n\t\telse if (button == 1)\n\t\t\tthis.isRightButton = true;\n\t\telse if (button == 2)\n\t\t\tthis.isMiddleButton = true;\n\t\t//Assign the x and y position\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Shape() { this(X_DEFAULT, Y_DEFAULT); }",
"public MouseCatElephantClientState(){}",
"public interface MouseAll {\n void onMouseUp(WebPlotView pv, ScreenPt spt);\n void onMouseOut(WebPlotView pv);\n void onMouseDown(WebPlotView pv, ScreenPt spt, MouseDownEvent ev);\n void onMouseOver(WebPlotView pv, ScreenPt spt);\n void onMouseMove(WebPlotView pv, ScreenPt spt, MouseMoveEvent ev);\n void onTouchStart(WebPlotView pv, ScreenPt spt, TouchStartEvent ev);\n void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev);\n void onTouchEnd(WebPlotView pv);\n void onClick(WebPlotView pv, ScreenPt spt);\n }",
"public SelectionEvent() {\n }",
"public Jeopardy3() {\n\t\taddMouseListener(this);\n\t}",
"public Point()\n\t{ \n\t\t// Instantiate default properties\n\t\tx = 0;\n\t\ty = 0;\n\t}",
"@Override\n public void init() {\n f = new SampleFrame2(\"Handle Mouse events.\");\n f.setSize(300, 200);\n f.setVisible(true);\n\n // register this object to receive its own mouse events\n addMouseListener(this);\n addMouseMotionListener(this);\n }",
"public CrosshairCursor( JPanel panel ) \n {\n super( panel );\n }",
"public Shape() {\n\t\tthis(DEFAULT_X_POS, DEFAULT_Y_POS, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}",
"public void mousePressed() {\n }",
"public abstract Cursor getMouseCursor();",
"public Platform(){\n\t\txCoord=0;\n\t\tyCoord=0;\n\t\twidth=0;\n\t\theight=0;\n\t\txscroll=0;\n\t\tyscroll=0;\n\t\tplatformHitbox=null;\n\t}",
"public BasicLinePix() {\r\n\t\tsetTitle(\"Basic Line Pix 1.0\");\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tContainer cp = getContentPane();\r\n\t\tcp.setLayout(new BorderLayout());\r\n\t\teh = new EventHandler();\r\n\t\tdrawingPanel = makeDrawingPanel();\r\n\t\tdrawingPanel.addMouseListener(eh);\r\n\t\tdrawingPanel.addMouseMotionListener(eh);\r\n\t\tJPanel statusBar = createStatusBar();\r\n\t\tcp.add(drawingPanel, BorderLayout.CENTER);\r\n\t\tcp.add(statusBar, BorderLayout.SOUTH);\r\n\t\tbuildMenu();\r\n\t\tpack();\r\n\t}",
"public interface MouseController<T> {\n /**\n * Returns the mouse controlled by this controller.\n */\n T getMouse();\n\n /**\n * Moves the mouse an arbitrary amount horizontally and vertically.\n * \n * @param horizontal\n * @param vertical\n */\n void moveMouse(int horizontal, int vertical);\n}",
"public CanvasPanel( )\n {\n // make this canvas panel listen to mouse\n addMouseListener(new PointListener());\n addMouseMotionListener(new PointListener());\n\n setBackground(Color.BLACK);\n }",
"public MyMouseAction(int i, int j) {\n x = i;\n y = j;\n }",
"public abstract void mouseInput();",
"public static MouseState getMouseState() throws SDLException {\n\tint x[] = {0};\n\tint y[] = {0};\n\n\tint buttons = SWIG_SDLEvent.SDL_GetMouseState(x, y);\n\treturn new MouseState(x[0], y[0], buttons);\n }",
"public DistanceMouseMode() {\n this(true);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n }",
"public MouseHandler(TicTacToePanel ticTacToePanel) {\n\t}",
"@Override\n public void addMouseListener(MouseListener l) { }",
"@Override\n public void initiateMouse() {\n\n MouseHandler m = new MouseHandler();\n m.addRunnablePress(1, new SelectNote(this.model, this.view.getGui(), m));\n m.addRunnablePress(3, new SelectNoteToBeAdded(this.model, this.view.getGui(), m));\n m.addRunnableRelease(3, new AddNote(this.model, this.view.getGui(), this.view, m));\n\n this.view.addMouseListener(m);\n\n }",
"DrawingCanvas() {\n super();\n\n // ArrayList to hold all shape objects\n shapes = new ArrayList<>();\n\n // ArrayList to hold all point objects\n points = new ArrayList<>();\n\n // Initialize colour arrays\n lineColours = new ArrayList<>();\n fillColours = new ArrayList<>();\n\n lineColours.add(Color.black);\n fillColours.add(null);\n\n clickStatus = true;\n activeTool = 1;\n this.addMouseListener(this);\n this.addMouseMotionListener(new MouseMotionAdapter() {\n public void mouseDragged(MouseEvent e) {\n endDrag = new Point(e.getX(), e.getY());\n repaint();\n }\n });\n\n // Initialize the WriteVec object, so it can be written to\n writeFile = new WriteVec();\n\n // Initialize the ShapeCreator object\n newShape = new ShapeCreator();\n\n // Set colours\n currentFillColour = null;\n currentPenColour = Color.BLACK;\n }",
"private Default()\n {}",
"public Computer() {\n\t\tparts = new ComputerPart[] { new Mouse(), new Keyboard(), new Monitor() };\n\t}",
"public State(Parent root) {\n\t\tsuper(root);\n\t\t\n\t\tinput = new ArrayList<String>();\n\t\tmouse = new Point2D.Double();\n\t\t\n\t\tthis.setOnKeyPressed(new EventHandler<KeyEvent>() {\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\tString code = e.getCode().toString();\n\t\t\t\t \n // only add once... prevent duplicates\n if ( !input.contains(code) )\n input.add( code );\t\n keyPressed(e);\n\t\t\t}\n\t\t});\n\t\tthis.setOnKeyReleased(new EventHandler<KeyEvent>() {\n\t\t\tpublic void handle(KeyEvent e) {\n String code = e.getCode().toString();\n input.remove( code );\n keyReleased(e);\n\t\t\t}\n\t\t});\n\t\tthis.setOnMouseMoved(new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\tmouse.x = e.getX();\n\t\t\t\tmouse.y = e.getY();\n\t\t\t}\n\t\t});\n\t\tthis.setOnMousePressed(new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\tmouseDown = true;\n\t\t\t\tmousePressed(e);\n\t\t\t}\n\t\t});\n\t\tthis.setOnMouseReleased(new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\tmouseDown = false;\n\t\t\t\tmouseReleased(e);\n\t\t\t}\n\t\t});\n\t}",
"public MouseInfo(int x, int y, boolean left, boolean middle, boolean right) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.left = left;\n\t\tthis.middle = middle;\n\t\tthis.right = right;\n\t}",
"@Override\n public NativeMouseInfo getNativeMouseInfo() {\n return null;\n }",
"public MouseController getMouseController(){\n return _mouseController;\n }",
"public Bomb(int x, int y, Mouse mouse)\r\n\t{\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.mouse = mouse;\r\n\t\tdetonated = false;\r\n\t}",
"public Interaction() {\n }",
"public MouseRotateXZ() {\r\n\t\tsuper(0);\r\n\t}",
"public MousePointerManager(Cursor enabledCursor, Cursor disabledCursor, Cursor waitCursor) {\r\n this.enabledCursor = enabledCursor;\r\n this.disabledCursor = disabledCursor;\r\n this.waitCursor = waitCursor;\r\n }",
"private VecCanvas(){\n MouseAdapter mouse = new CanvasMouse();\n this.addMouseListener(mouse);\n this.addMouseMotionListener(mouse);\n setupKeyBindings();\n }",
"private void makeMouseListener() {\n myMouseListener = new MouseListener() {\n @Override\n public void mouseClicked (MouseEvent e) {\n myController.handleMapClick(e.getLocationOnScreen());\n }\n @Override\n public void mouseEntered (MouseEvent e) {\n }\n @Override\n public void mouseExited (MouseEvent e) {\n }\n @Override\n public void mousePressed (MouseEvent e) {\n }\n @Override\n public void mouseReleased (MouseEvent e) {\n }\n };\n }",
"public int getMouseX(){\n\t\treturn mouseX;\n\t}",
"public void setMousePosition(double mouseX, double mouseY) {\n this.mouseX = (int) mouseX;\n this.mouseY = (int) mouseY;\n }",
"@Override\n\tpublic void mouseLeft() {\n\t\t\n\t}",
"public interface IMouseAware {\n\n public abstract void mouseMotion(final MouseMotionEvent evt);\n\n public abstract void mouseButton(final MouseButtonEvent evt);\n}",
"public MainClass()\r\n\t{\r\n\t\tthis.setPreferredSize(new Dimension(width - 300, height));// This sets the dimensions of the graphic space where cam is drawn\r\n\t\tpanel = new ControlPanel(); // Initialization of various objects incorporated into the main class\r\n\t\twindow = new Window(this, panel);\t\t\t\t//\r\n\t\tdisp = new DispAngleDiagram(stroke);\t\t\t//\r\n\t\trcp = new RenderCamProfile(disp, panel);\t\t//\r\n\t\tinput = new InputHandler(disp);\t\t\t\t\t//\r\n\t\t\r\n\t\tthis.addMouseListener(input);\t\t\t\t\t\r\n\t\tthis.addMouseMotionListener(input);\r\n\t}",
"public Sketch(Mouse m) {\r\n\t\tfor (int i = 0; i < 11; i++) {\r\n\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\tthis.s[i][j] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.s[10][10] = 1;\r\n\t\t\r\n\t\t//mousetraps\r\n\t\tthis.s[0][1] = 2;\r\n\t\tthis.s[0][9] = 2;\r\n\t\tthis.s[2][2] = 2;\r\n\t\tthis.s[2][8] = 2;\r\n\t\tthis.s[3][5] = 2;\r\n\t\tthis.s[3][9] = 2;\r\n\t\tthis.s[4][6] = 2;\r\n\t\tthis.s[5][3] = 2;\r\n\t\tthis.s[5][6] = 2;\r\n\t\tthis.s[5][7] = 2;\r\n\t\tthis.s[6][1] = 2;\r\n\t\tthis.s[7][4] = 2;\r\n\t\tthis.s[7][10] = 2;\r\n\t\tthis.s[8][0] = 2;\r\n\t\tthis.s[9][4] = 2;\r\n\t\tthis.s[9][9] = 2;\r\n\t\tthis.s[10][9] = 2;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tVector v = m.getPos();\r\n\t\t\t//System.out.println(v.toString());\r\n\t\t\tthis.s[v.getX()][v.getY()] = 1;\r\n\t\t\tm.update();\r\n\t\t\t\r\n\t\t} while (!m.atTarget() && m.isAlive());\r\n\t\r\n\t}",
"public PlotDrawer() {\n\n\t}",
"public Rectangle () {\n\t\t\n\t}",
"public Curso() {\r\n }",
"public Student(String userName) {\n loggedUser = userName;\n initComponents();\n Toolkit toolKit = getToolkit();\n Dimension size = toolKit.getScreenSize();\n setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);\n }",
"public void mouseLeft() {\n\n\t}",
"void configureMouseListener();",
"public GUI() {\n }",
"protected MenuTools() {\r\n\t\tthis(null);\r\n\t}",
"public GraphicsFactory() {\n\t\tsuper();\n\t}",
"public Pixel() {\r\n\t\t}",
"public Window() {\n initComponents();\n setTitle(\"Clash of Asteroids 1J\");\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setResizable(false);\n setLocationRelativeTo(null);\n canvas = new Canvas();\n keyBoard = new KeyBoard();\n mouseInput = new MouseInput();\n canvas.setPreferredSize(new Dimension(Constants.WIDTH, Constants.HEIGHT));\n canvas.setMaximumSize(new Dimension(Constants.WIDTH, Constants.HEIGHT));\n canvas.setMinimumSize(new Dimension(Constants.WIDTH, Constants.HEIGHT));\n canvas.setFocusable(true);\n add(canvas);\n canvas.addKeyListener(keyBoard);\n addKeyListener(keyBoard);\n canvas.addMouseListener(mouseInput);\n addMouseListener(mouseInput);\n canvas.addMouseMotionListener(mouseInput);\n addMouseMotionListener(mouseInput);\n setVisible(true);\n }",
"void DefaultConstructor(){}",
"public void mousePressed(MouseEvent arg0) {\n }",
"@Override\n public void mouseMoved(MouseEvent arg0) {\n \n }",
"@Override\n public void mouseMoved(MouseEvent e) {}",
"public abstract void moveMouse(int iPosX, int iPosY);",
"public Platform(int x, int y, int w, int h){\n\t\txscroll=0;\n\t\tyscroll=0;\n\t\txCoord = x;\n\t\tyCoord = y;\n\t\twidth = w;\n\t\theight = h;\n\t\tplatformHitbox = new Rectangle(xCoord,yCoord,width,height);\n\n\t}",
"public MouseHandler(GameLevel l, MyView v, Game g) {\n level = l;\n view = v;\n game = g;\n }",
"public GraphicLayer() {\r\n super();\r\n }",
"public DefaultTip() {}",
"public void mousePressed(MouseEvent e)\n { }",
"public void mousePressed(MouseEvent arg0) {\n\n }",
"public void mousePressed(MouseEvent arg0) {\n\n }",
"protected Shape() {}",
"Constructor() {\r\n\t\t \r\n\t }",
"public SelectMapTool() {\n this.setName(\"select\");\n this.setToolTip(\"Selecting features.\");\n eventListeners = new EventListenerList();\n super.setMapIcon(MapImages.get(\"Select32.png\").orElse(null));\n }",
"public Event() {\n }",
"public Event() {\n }",
"public DriverControl(){\n super(0);\n }",
"public State(GameStateManager gameStateManager){ //constructor\n this.gameStateManager = gameStateManager;\n camera = new OrthographicCamera();\n mouse = new Vector3();\n }",
"protected JoystickInput() {\n }",
"private Driver(){\n }",
"public XYScatterGrapher()\n {\n\n }",
"public MouseJointManager(CGScreenModel model, World world, Camera cam) {\n super(model, world, cam);\n \n this.mouseJointInstalled = model.getScreenPrefs().getDebugDrawPrefs().getInstallMouseJoint();\n }",
"public NewShape() {\r\n\t\tsuper();\r\n\t}",
"public MousePointerManager(int enabledCursor, int disabledCursor, int waitCursor) {\r\n this.enabledCursor = Cursor.getPredefinedCursor(enabledCursor);\r\n this.disabledCursor = Cursor.getPredefinedCursor(disabledCursor);\r\n this.waitCursor = Cursor.getPredefinedCursor(waitCursor);\r\n }",
"ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}",
"public Event() {\r\n\r\n\t}",
"public Selector() {\n }",
"public void mouseEntered (MouseEvent me) { }",
"public Component() {\n }"
] | [
"0.8927167",
"0.88085705",
"0.77284366",
"0.7562726",
"0.7197405",
"0.6973913",
"0.67527264",
"0.66988534",
"0.65822816",
"0.64842916",
"0.64747554",
"0.62979966",
"0.6221716",
"0.61643183",
"0.61335564",
"0.6102602",
"0.60532296",
"0.6051809",
"0.60245126",
"0.602183",
"0.5940806",
"0.5911046",
"0.5900935",
"0.5883945",
"0.5877422",
"0.5862695",
"0.5851228",
"0.58284056",
"0.5826895",
"0.58061373",
"0.57957697",
"0.57870907",
"0.5778571",
"0.5778175",
"0.5771031",
"0.5768759",
"0.5767125",
"0.57440746",
"0.57245886",
"0.57220346",
"0.5703618",
"0.5700398",
"0.5698904",
"0.5690619",
"0.56905544",
"0.56896305",
"0.5670891",
"0.56699044",
"0.5669566",
"0.5664569",
"0.5653013",
"0.5631245",
"0.5627455",
"0.562323",
"0.5621764",
"0.5619662",
"0.55843437",
"0.55764395",
"0.55754185",
"0.55666673",
"0.5563016",
"0.55608964",
"0.5555387",
"0.55456674",
"0.5543645",
"0.5542886",
"0.55401444",
"0.553647",
"0.5532497",
"0.5532242",
"0.5520961",
"0.55208004",
"0.55136764",
"0.5512023",
"0.5509398",
"0.5508254",
"0.5503864",
"0.5500987",
"0.5493777",
"0.5485719",
"0.54851156",
"0.54851156",
"0.54850113",
"0.54668534",
"0.5455198",
"0.54530346",
"0.54530346",
"0.5448441",
"0.54440475",
"0.54435223",
"0.54407674",
"0.54318863",
"0.54305345",
"0.5427123",
"0.54245675",
"0.54239243",
"0.54227096",
"0.5421449",
"0.5410679",
"0.540442"
] | 0.833612 | 2 |
This describes the lifetime of Mouse. | @Override
public void lifeTime() {
System.out.println("Lifetime is around 5 years.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Mouse() {}",
"public Mouse getMouse() {\n return mouse;\n }",
"public long getLifetime() {\n return lifetime;\n }",
"public MouseHandler()\n {\n // initialise instance variables:\n //INSTANTIATE listeners list:\n _listeners = new ArrayList<IMouseListener>();\n \n }",
"public Mouse getMouse()\r\n\t{\r\n\t\treturn mouse;\r\n\t}",
"public Mouse(Actor concerning) {\n\t\tlastState = new MouseState(false, false, false, false, null);\n\t\tthis.concerning = concerning;\n\t}",
"public MousePointer () {\n\t\tthis.loadPointer(MousePointer.DEFAULT_CURSOR);\n\t}",
"public Mouse() {\n\t\tthis(null);\n\t}",
"public int getLifetime() {\n\t\treturn lifetime;\n\t}",
"Mouse(){\n System.out.println(\"This is Mouse class.\");\n }",
"public Lifetime getLifetime() {\n return this.lifetime;\n }",
"T getMouse();",
"@Override\n public NativeMouseInfo getNativeMouseInfo() {\n return null;\n }",
"public MouseCatElephantClientState(){}",
"public abstract Cursor getMouseCursor();",
"public Object getOnmousemove() {\r\n\t\treturn getOnMouseMove();\r\n\t}",
"public MouseController getMouseController(){\n return _mouseController;\n }",
"public Vector2 getMouseSize() {\n \tdimension.set(pointer.width, pointer.height);\n \treturn dimension;\n\t}",
"public Point getLastMousePosition () {\r\n return myLastMousePosition;\r\n }",
"@DISPID(-2147412112)\n @PropGet\n java.lang.Object onmouseover();",
"public DistanceMouseMode(boolean consumeEvents, InformationDelegator id,\n Length units, int lType) {\n super(modeID, consumeEvents);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n infoDelegator = id;\n unit = units;\n lineType = lType;\n }",
"public interface MouseEvents {\n\n /**\n * Called when a key is pressed\n * */\n void keyPressed(String code);\n\n /**\n * Called when the mouse button mouse is pressed\n * */\n void mousePressed(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse is released\n * */\n void mouseReleased(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse is clicked\n * */\n void mouseClicked(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse have moved\n * */\n void mouseMoved(double x, double y, MouseEvent e );\n\n /**\n * Called when the mouse button mouse is dragged\n * */\n void mouseDragged(double x, double y, MouseEvent e );\n}",
"public long getIdle() { return idle; }",
"private void setMousePossition() {\n mouseX = Mouse.getMouseX() / Display.SCALE;\n mouseY = Mouse.getMouseY() / Display.SCALE;\n }",
"public DistanceMouseMode(boolean consumeEvents, InformationDelegator id,\n Length units) {\n super(modeID, consumeEvents);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n infoDelegator = id;\n unit = units;\n }",
"private static void OnMouseLeave(Object sender, MouseEventArgs e)\r\n { \r\n // Un-vanish the cursor on any mouse leave.\r\n _ShowCursor(); \r\n }",
"public static MouseState getMouseState() throws SDLException {\n\tint x[] = {0};\n\tint y[] = {0};\n\n\tint buttons = SWIG_SDLEvent.SDL_GetMouseState(x, y);\n\treturn new MouseState(x[0], y[0], buttons);\n }",
"public boolean acceptsMouse() \n{\n // If hover shape, return false\n if(RMShapeUtils.getHoverShape()==this) return false;\n \n // Return true if there is a URL, Hover or MouseListener\n return getURL()!=null || getHover()!=null || getListenerCount(RMShapeMouseListener.class)>0;\n}",
"public interface MouseAll {\n void onMouseUp(WebPlotView pv, ScreenPt spt);\n void onMouseOut(WebPlotView pv);\n void onMouseDown(WebPlotView pv, ScreenPt spt, MouseDownEvent ev);\n void onMouseOver(WebPlotView pv, ScreenPt spt);\n void onMouseMove(WebPlotView pv, ScreenPt spt, MouseMoveEvent ev);\n void onTouchStart(WebPlotView pv, ScreenPt spt, TouchStartEvent ev);\n void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev);\n void onTouchEnd(WebPlotView pv);\n void onClick(WebPlotView pv, ScreenPt spt);\n }",
"public Double getMouse1()\n {\n return this.mouse1;\n }",
"public int getMouseX(){\n\t\treturn mouseX;\n\t}",
"@Override\n public void mouseReleased(MouseEvent e) \n {\n Poseur singleton = Poseur.getPoseur();\n PoseurStateManager state = singleton.getStateManager();\n state.processMouseReleased(e.getX(), e.getY());\n }",
"public void mouseReleased(MouseEvent e)\n { }",
"@Override\n public void onRelease(MouseEvent e, GraphicsContext g) {\n\n }",
"public Jeopardy3() {\n\t\taddMouseListener(this);\n\t}",
"public DistanceMouseMode(String name, boolean consumeEvents) {\n super(name, consumeEvents);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n }",
"public Double getMouse10()\n {\n return this.mouse10;\n }",
"public boolean isMouseHidden() {\n return mouseHidden.get();\n }",
"private void LexicalMouseReleased(java.awt.event.MouseEvent evt) {\n }",
"@Override\r\n\t\t public void mouseReleased(MouseEvent arg0) {\n\t\t }",
"@Override\n public void mouseReleased(MouseEvent e) {\n }",
"public Double getMouse2()\n {\n return this.mouse2;\n }",
"@Override\r\npublic void mouseReleased(MouseEvent arg0) {\n\t\r\n}",
"@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tnew Terminal();\n\t\t\t\tdispose(); // 해당 프레임만 사라짐\n\t\t\t}",
"public DistanceMouseMode(String name, boolean consumeEvents,\n InformationDelegator id) {\n super(name, consumeEvents);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n infoDelegator = id;\n }",
"@Override\n public void addMouseListener(MouseListener l) { }",
"DrawingArea() {\n setBackground(Color.WHITE);\n MyMouseListener ml = new MyMouseListener();\n addMouseListener(ml);\n addMouseMotionListener(ml);\n addMouseWheelListener(ml);\n\n\n\n }",
"public DistanceMouseMode(boolean consumeEvents) {\n super(modeID, consumeEvents);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n }",
"@Override\n public void onRelease(MouseEvent e, GraphicsContext g) {\n }",
"@DISPID(-2147412111)\n @PropGet\n java.lang.Object onmouseout();",
"public void mouseExited(MouseEvent e)\n { }",
"public String getKeyUpMouseName() {\r\n return keyUpMouseName;\r\n }",
"public MousePointerManager(Cursor enabledCursor, Cursor disabledCursor, Cursor waitCursor) {\r\n this.enabledCursor = enabledCursor;\r\n this.disabledCursor = disabledCursor;\r\n this.waitCursor = waitCursor;\r\n }",
"public void mouseReleased(MouseEvent event) { }",
"public DistanceMouseMode() {\n this(true);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n }",
"public Double getMouse8()\n {\n return this.mouse8;\n }",
"public String getKeyDownMouseName() {\r\n return keyDownMouseName;\r\n }",
"public DistanceMouseMode(boolean consumeEvents, InformationDelegator id) {\n super(modeID, consumeEvents);\n // if you really want to change the cursor shape\n // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));\n infoDelegator = id;\n }",
"public float MouseY() {\n\t\treturn container.getInput().getMouseY(); \n\t}",
"abstract void listDisponibles_mouseClicked(MouseEvent e);",
"public void mouseReleased(MouseEvent e) {}",
"public void mouseReleased(MouseEvent e) {}",
"public void mouseReleased(MouseEvent e) {}",
"public void mouseReleased(MouseEvent e) {\n\n }",
"public void mouseMoved(RMShapeMouseEvent anEvent)\n{\n // If timer, restart\n if(RMShapeUtils.getHoverTimer()!=null && RMShapeUtils.getHoverTimer().getShape()==this)\n RMShapeUtils.getHoverTimer(anEvent);\n \n // Iterate over mouse motion listeners and forward\n for(int i=0, iMax=getListenerCount(RMShapeMouseListener.class); i<iMax; i++)\n getListener(RMShapeMouseListener.class, i).mouseMoved(anEvent);\n}",
"@Override\n\tpublic void mouseExited() {\n\t\t\n\t}",
"public void mouseEntered(RMShapeMouseEvent anEvent)\n{\n // Set cursor\n anEvent.getViewer().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n \n // Iterate over mouse listeners and forward\n for(int i=0, iMax=getListenerCount(RMShapeMouseListener.class); i<iMax; i++)\n getListener(RMShapeMouseListener.class, i).mouseEntered(anEvent);\n \n // If alt is down and name starts with hover, get hover shape\n if(getHover()!=null)\n RMShapeUtils.getHoverTimer(anEvent);\n}",
"public void mouseReleased(MouseEvent e){\n }",
"public Integer getEventGenWindow() {\n return eventGenWindow;\n }",
"public Double getMouse4()\n {\n return this.mouse4;\n }",
"public SimpleTrackMouse()\n { \n // Set background color and arrange for the panel to listen for mouse events.\n setBackground(Color.WHITE);\n MouseHandler listener = new MouseHandler();\n addMouseListener(listener); // Register mouse listener.\n addMouseMotionListener(listener); // Register mouse motion listener.\n }",
"private void resetMouseCursor() {\n GameContainer c = Main.getInstance().getContainer();\n c.setDefaultMouseCursor();\n }",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"@Override\r\n\tpublic void mouseReleased(MouseEvent arg0) {\n\r\n\t}",
"public long hoverTime() {\n\t\treturn hoverStart == 0 ? 0 : Calendar.getInstance().getTimeInMillis() - hoverStart;\n\t}",
"public void mouseReleased(MouseEvent event) {}",
"void mouseReleased() {\n firing = false;\n}",
"@Override\n public void mouseReleased(MouseEvent e) {\n\n }",
"@Override\n public void mouseReleased(MouseEvent e) {\n\n }",
"@Override\n public void mouseReleased(MouseEvent e) {\n\n }",
"@Override\n public void mouseReleased(MouseEvent e) {\n\n }",
"@Override\n\tpublic MouseMotionListener getMouseMotionListener() {\n\t\treturn null;\n\t}",
"public void mouseReleased(MouseEvent arg0) {\n\n }",
"public void mouseReleased(MouseEvent arg0) {\n\n }",
"public void mouseExited(RMShapeMouseEvent anEvent)\n{\n // Clear hover timer and if hover shape present, remove it\n RMShapeUtils.setHoverTimer(null);\n if(RMShapeUtils.getHoverShape()!=null)\n getPageShape().removeChild(RMShapeUtils.getHoverShape());\n \n // Iterate over mouse listeners and forward\n for(int i=0, iMax=getListenerCount(RMShapeMouseListener.class); i<iMax; i++)\n getListener(RMShapeMouseListener.class, i).mouseExited(anEvent);\n}",
"public Double getMouse3()\n {\n return this.mouse3;\n }",
"@Override\n public void mouseReleased(MouseEvent evt) {\n }",
"public void mouseReleased(MouseEvent e) {\n }",
"public long getIdleTime() {\r\n return idleTime;\r\n }",
"@Override\n \tpublic void mouseReleased(MouseEvent me) {\n \t\t\n \t}",
"@Override\r\n public void mouseExited(MouseEvent arg0)\r\n {\n\r\n }",
"@Override\r\n public void mouseReleased(MouseEvent e) {\n }",
"@Override\n public void mouseReleased(MouseEvent e) {\n }",
"@Override\n public void mouseReleased(MouseEvent e) {\n }",
"@Override\n public void mouseReleased(MouseEvent e) {\n }"
] | [
"0.5903759",
"0.57952857",
"0.57940286",
"0.57504696",
"0.5740515",
"0.5705688",
"0.56899846",
"0.56700915",
"0.5659356",
"0.54957974",
"0.54957336",
"0.54064727",
"0.53232706",
"0.52835715",
"0.52540606",
"0.5174148",
"0.51073885",
"0.5062258",
"0.5052465",
"0.5038016",
"0.50276345",
"0.50273293",
"0.50268364",
"0.49957213",
"0.49668065",
"0.49464014",
"0.49160698",
"0.4911413",
"0.49042076",
"0.49018586",
"0.4880338",
"0.48799542",
"0.48766276",
"0.48633748",
"0.4859522",
"0.48494014",
"0.48368654",
"0.48334387",
"0.4827351",
"0.4825936",
"0.4823169",
"0.48077166",
"0.48050964",
"0.48003665",
"0.4799389",
"0.47966298",
"0.47797188",
"0.47758552",
"0.47740883",
"0.47668388",
"0.47649541",
"0.47648665",
"0.4761942",
"0.4757926",
"0.475571",
"0.4752134",
"0.4745625",
"0.47434372",
"0.47369584",
"0.47324097",
"0.47316682",
"0.47316682",
"0.47316682",
"0.47241765",
"0.4718205",
"0.47177932",
"0.47170687",
"0.4714421",
"0.4704949",
"0.47029892",
"0.46999472",
"0.46938446",
"0.46933764",
"0.46933764",
"0.46933764",
"0.46933764",
"0.46933764",
"0.46933764",
"0.46933764",
"0.46933764",
"0.46932968",
"0.46921688",
"0.46887285",
"0.46873263",
"0.46873263",
"0.46873263",
"0.46873263",
"0.46852314",
"0.4684998",
"0.4684998",
"0.46738738",
"0.46696353",
"0.4669324",
"0.46660042",
"0.46643683",
"0.46633774",
"0.4661932",
"0.4658732",
"0.46586913",
"0.46586913",
"0.46586913"
] | 0.0 | -1 |
This describes about the food type(whether they are herbivorous or not). | @Override
public void food(){
System.out.println("They are Herbivorous in nature.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTypeOfFood()\n {\n return typeOfFood;\n }",
"public String getTypeOfFood(){\n return typeOfFood;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"@Override\n public String getFoodType() {\n return foodType;\n }",
"public String getFoodType() {\n return \"Carnivore\";\n }",
"public void setTypeOfFood(String _typeOfFood)\n {\n typeOfFood = _typeOfFood;\n }",
"@Override\n public EFoodType getFoodtype() {\n MessageUtility.logGetter(name,\"getFoodtype\",EFoodType.MEAT);\n return EFoodType.MEAT;\n }",
"public void setTypeOfFood(String foodType){\n typeOfFood = foodType;\n }",
"public void setFoodType(String food);",
"public FoodType getFoodType() {\n\t\treturn FoodType.GRASS;\n\t}",
"@Override\r\n\tpublic String getFood() {\n\t\treturn \"banana\";\r\n\t}",
"public static int showFoods(String cuisin, String type){\r\n int check=0;\r\n for(int i=0;i<foods.size();i++){\r\n if(foods.get(i).getCousin().toLowerCase().equals(cuisin.toLowerCase())\r\n && foods.get(i).getType().toLowerCase().equals(type)){\r\n System.out.println(i+\".-\"+foods.get(i).getName()+\" --> \"+foods.get(i).getDescription()+\" --> \"+foods.get(i).getPrice());\r\n check=1;\r\n }\r\n }\r\n if(check==0)\r\n System.out.println(\"There are not food in this category\");\r\n return check;\r\n }",
"public boolean isFood(){\n\t\treturn foodFlag;\n\t}",
"public boolean isFood() {\n\t\treturn food > 0;\n\t}",
"@Test\n public void categoryFitsTypeTest() {\n final Category cardio = Category.CARDIO;\n final Type endurance = Type.ENDURANCE;\n final Type strength = Type.STRENGTH;\n\n assertEquals(\"Cardio category of Endurance Type\", cardio.getType(), endurance);\n assertNotEquals(\"Cardio category is not of Strength Type\", cardio.getType(), strength);\n }",
"Food getByType(String type);",
"public static String getTypeDescription() {\n\t\tDecimalFormat df = new DecimalFormat(\"#.00\");\n\t\treturn \"Type: \" + type + \"\\nPrice: $\" + df.format(price) + \"\\nDescription: \" + description + \"\\nHappiness: \" + happiness +\n\t\t\t\t\"\\nHealth: \" + health;\n\t}",
"public String getFood() {\n if(food != null)\n return \"食材:\"+food;\n else {\n return content ;\n }\n }",
"public int getFood() {\n\t\treturn food;\n\t}",
"public int getFood(){\r\n\t\treturn food;\r\n\t}",
"public void addIngredient(String type) {\n\t\tBurger fullBurger1 = new Burger(true);\n\t\tBurger fullBurger2 = new Burger(true);\n\n\t\tfullBurger1.removeIngredient(\"Beef\");\n\t\tfullBurger2.removeIngredient(\"Beef\");\n\n\t\tint howManyBeef = this.howMany(\"Beef\");\n\t\tint howManyChicken = this.howMany(\"Chicken\");\n\t\tint howManyVeggie = this.howMany(\"Veggie\");\n\n\t\tif (this.has(\"Beef\")) {\n\t\t\tfor (int i = 0; i < howManyBeef; i++) {\n\t\t\t\tfullBurger1.addPatty();\n\t\t\t\tfullBurger2.addPatty();\n\t\t\t}\n\t\t}\n\t\tif (this.has(\"Chicken\")) {\n\t\t\tfor (int i = 0; i < howManyChicken; i++) {\n\t\t\t\tfullBurger1.addGeneralPatty(\"Chicken\");\n\t\t\t\tfullBurger2.addGeneralPatty(\"Chicken\");\n\t\t\t}\n\t\t}\n\t\tif (this.has(\"Veggie\")) {\n\t\t\tfor (int i = 0; i < howManyVeggie; i++) {\n\t\t\t\tfullBurger1.addGeneralPatty(\"Veggie\");\n\t\t\t\tfullBurger2.addGeneralPatty(\"Veggie\");\n\t\t\t}\n\t\t}\n\t\tmyBurger.push(type);\t\n\t\twhile (myBurger.size() != 0) {\n\t\t\tString top = (String) myBurger.peek();\n\t\t\tfullBurger1.removeIngredient(top);\n\t\t\tthis.removeIngredient(top);\n\t\t}\n\n\t\twhile (fullBurger1.myBurger.size() != 0) {\n\t\t\tString top = (String) fullBurger1.myBurger.peek();\n\t\t\tfullBurger2.removeIngredient(top);\n\t\t\tfullBurger1.removeIngredient(top);\n\t\t}\n\t\tint totalPatties = howManyBeef + howManyChicken + howManyVeggie;\n\t\tmyBurger = fullBurger2.myBurger;\n\t\tpattyCount = pattyCount + totalPatties;\n\t\tif (type.equals(\"Beef\") || type.equals(\"Chicken\") || type.equals(\"Veggie\")) {\n\t\t\tpattyCount++;\n\t\t}\n\t}",
"public Fish(String name, String gender){\n this.name = name;\n this.gender = gender;\n this.value = 10;\n this.eats = whatItEats(new fishFood());\n this.portionSize = 20;\n this.minimumOffspring = 1;\n this.maximumOffspring = 12;\n this.maxAge = 4;\n this.vetCost = 2;\n }",
"public interface IFood {\n double printFood(); // visa hur många gram mat\n String foodsType(); // visa vilken sorts mat\n}",
"@Override\n\tpublic String addFoodType(String ftname) {\n\t\treturn ftb.addFoodType(ftname);\n\t}",
"public String types() { return faker.fakeValuesService().resolve(\"gender.types\", this, faker); }",
"public String getCheese() {\n return this.hold.getType();\n }",
"public void decideNature()\n {\n String nature = new String(\"\");\n Random rand = new Random();\n int i = rand.nextInt(100);\n if(i <= 25)\n {\n nature = \"Very mischievous. Enjoys hiding objects in plain sight\";\n }//ends the if\n else if(i > 25 && i <= 50)\n {\n nature = \"Loves to spend time sleeping on the clouds\";\n }//ends the else if\n else if(i > 50 && i <= 75)\n {\n nature = \"Is very playful\";\n }//ends the else if\n else\n {\n nature = \"Loves to perform dances in the air\";\n }\n \n setNature(nature);\n }",
"public void serveFood() {\r\n System.out.println(\"Serving food from \" + name + \" is a \" + type + \" restaurant\");\r\n }",
"protected int get_food_level()\n {\n return food_level;\n }",
"@Override\n\tpublic void tipoInteligencia() {\n\t\tSystem.out.println(super.getNome() + \" é um animal \" + ((super.isRacional() == true) ? \"racional.\" : \"irracional.\"));\n\t}",
"public boolean hasFood() {\r\n\t\treturn this.food > 0;\r\n\t}",
"public String getFoodName() {\n return foodName;\n }",
"public String getType() {\n /**\n * @return type of Ice Cream\n */\n return type;\n }",
"public boolean animalFood(Entity e, Material item){\r\n\t\t\r\n\t\tif(e instanceof Cow || e instanceof Horse || e instanceof Pig || e instanceof Sheep ){\r\n\t\t\tif(item == Material.HAY_BLOCK){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(e instanceof Chicken){\r\n\t\t\tif(item == Material.SEEDS){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if( e instanceof Wolf){\r\n\t\t\tif(item == Material.ROTTEN_FLESH || item == Material.RAW_BEEF || item == Material.PORK){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(e instanceof Ocelot){\r\n\t\t\tif(item == Material.RAW_FISH){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public void showInfomation()\n\t{\n\t\tSystem.out.println(\"\\nMeal\"+\"\\n\\tnumber: \"+ number +\"\\n\\tdishName: \" + dishName +\"\\n\\tprice : \" + price+\"$\");\n\t}",
"public void addCategory(String type) {\n\t\tif (type.equals(\"Cheese\")) {\n\t\t\taddIngredient(\"Pepperjack\");\n\t\t\taddIngredient(\"Mozzarella\");\n\t\t\taddIngredient(\"Cheddar\");\n\t\t}\n\t\tif (type.equals(\"Sauces\")) {\n\t\t\taddIngredient(\"Mayonnaise\");\n\t\t\taddIngredient(\"Baron Sauce\");\n\t\t\taddIngredient(\"Mustard\"); \n\t\t\taddIngredient(\"Ketchup\");\n\t\t}\n\t\tif (type.equals(\"Veggies\")) {\n\t\t\taddIngredient(\"Pickle\");\n\t\t\taddIngredient(\"Lettuce\");\n\t\t\taddIngredient(\"Tomato\");\n\t\t\taddIngredient(\"Onions\"); \n\t\t\taddIngredient(\"Mushrooms\");\n\t\t}\n\t}",
"public boolean isAnimalFood(Material item){\r\n\t\tif(item == Material.HAY_BLOCK || item == Material.SEEDS || item == Material.ROTTEN_FLESH || item == Material.RAW_BEEF || item == Material.PORK\r\n\t\t\t\t|| item == Material.RAW_FISH){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public void askForType() {\n System.out.println(\"What type of event will this be?\");\n System.out.println(\"1) Normal 2) Multi-Speaker 3) VIP\");\n }",
"public static String getFormalFamilyNameFromType(FamilyType type) {\n switch (type) {\n case ARTIX7:\n return \"Artix7\";\n case ARTIX7L:\n return \"Artix7 Lower Power\";\n case ASPARTAN2E:\n return \"Automotive Spartan2E\";\n case ASPARTAN3:\n return \"Automotive Spartan3\";\n case ASPARTAN3A:\n return \"Automotive Spartan3A\";\n case ASPARTAN3ADSP:\n return \"Automotive Spartan-3A DSP\";\n case ASPARTAN3E:\n return \"Automotive Spartan3E\";\n case ASPARTAN6:\n return \"Automotive Spartan6\";\n case KINTEX7:\n return \"Kintex7\";\n case KINTEX7L:\n return \"Kintex7 Lower Power\";\n case QSPARTAN6:\n return \"Defense-Grade Spartan-6Q\";\n case QSPARTAN6L:\n return \"Defense-Grade Spartan-6Q Lower Power\";\n case QVIRTEX4:\n return \"Defense-Grade Virtex-4Q\";\n case QVIRTEX5:\n return \"Defense-Grade Virtex-5Q\";\n case QVIRTEX6:\n return \"Defense-Grade Virtex-6Q\";\n case QVIRTEX:\n return \"QPro Virtex Hi-Rel\";\n case QRVIRTEX:\n return \"QPro Virtex Rad-Hard\";\n case QVIRTEX2:\n return \"QPro Virtex2 Military\";\n case QRVIRTEX2:\n return \"QPro Virtex2 Rad Tolerant\";\n case QVIRTEX2P:\n return \"QPro Virtex2P Hi-Rel\";\n case QVIRTEXE:\n return \"QPro VirtexE Military\";\n case QRVIRTEX4:\n return \"Space-Grade Virtex-4QV\";\n case SPARTAN2:\n return \"Spartan2\";\n case SPARTAN2E:\n return \"Spartan2E\";\n case SPARTAN3:\n return \"Spartan3\";\n case SPARTAN3A:\n return \"Spartan3A and Spartan3AN\";\n case SPARTAN3ADSP:\n return \"Spartan-3A DSP\";\n case SPARTAN3E:\n return \"Spartan3E\";\n case SPARTAN6:\n return \"Spartan6\";\n case SPARTAN6L:\n return \"Spartan6 Lower Power\";\n case VIRTEX:\n return \"Virtex\";\n case VIRTEX2:\n return \"Virtex2\";\n case VIRTEX2P:\n return \"Virtex2P\";\n case VIRTEX4:\n return \"Virtex4\";\n case VIRTEX5:\n return \"Virtex5\";\n case VIRTEX6:\n return \"Virtex6\";\n case VIRTEX6L:\n return \"Virtex6 Lower Power\";\n case VIRTEX7:\n return \"Virtex7\";\n case VIRTEX7L:\n return \"Virtex7 Lower Power\";\n case VIRTEXE:\n return \"VirtexE\";\n default:\n return null;\n }\n }",
"public String getBreedOrType() { return breedOrType; }",
"public int foodCount() {\r\n\t\treturn this.food;\r\n\t}",
"public String food();",
"public String getHouseType () {\n\t\treturn \"Barn\";\n\t}",
"private String handleFood (String text) {\n\t\tcategories = Categories.MAIN_MENU;\n\t\tString result = \"\";\n\t\tresult = inputToFood.getFoodDetails(text);\n\t\treturn result;\n\t}",
"@Override\n\tpublic List<Food> findFood(int typeid) {\n\t\treturn fb.findFood(typeid);\n\t}",
"@Override\n public String getDescription() {\n\t return \"Mexican Pizza\";\n }",
"@Override\r\n\tpublic String foodName() {\n\t\treturn null;\r\n\t}",
"@Override\n\tprotected Pizza createPizza(String type) {\n\t\tPizza pizza = null;\n\t\tPizzaIngredientFactory pizzaIngredientFactory = new NYPizzaIngredientFactory();\n\t\tif(type.equals(\"cheese\")){\n\t\t\tpizza = new CheesePizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Cheese Pizza\");\n\t\t} else if(type.equals(\"veggie\")){\n\t\t\tpizza = new VeggiePizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Veggie Pizza\");\n\t\t} else if(type.equals(\"clam\")) {\n\t\t\tpizza = new ClamPizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Clam Pizza\");\n\t\t} return pizza;\n\t}",
"public void display() {\r\n String kind;\r\n if (profit == true) {\r\n kind = \"profit\";\r\n }\r\n\r\n else kind = \"non-profit\";\r\n System.out.println(name + \" is a \" + kind + \" organization that has\" + \" \" + revenue + \" dollars in revenue\" );\r\n }",
"private String determinePieceType(Piece p) {\n\t\tif (p.isShield()) {\n\t\t\treturn \"shield\";\n\t\t} else if (p.isBomb()) {\n\t\t\treturn \"bomb\";\n\t\t} else {\n\t\t\treturn \"pawn\";\n\t\t}\n\t}",
"public void createFood() {\n }",
"public Food() {\n super(1, 0, 1, 100, 5, 5, Resources.RICHSOIL, Resources.POORSOIL, \"Food\");\n }",
"@Override\n\tpublic String addFood(String fname, double fprice, int typeid) {\n\t\treturn fb.addFood(fname, fprice, typeid);\n\t}",
"public static String getMostFrequentType() {\n\t\tint cars = 0;\n\t\tint figures = 0;\n\t\t\n\t\tfor (int i = 0; i < toyList.size(); i++) {\n\t\t\tif (toyList.get(i).getType().equals(\"Car\")) {\n\t\t\t\tcars++;\n\t\t\t}\n\t\t\tif (toyList.get(i).getType().equals(\"Action Figure\")) {\n\t\t\t\tfigures++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (cars > figures) {\n\t\t\treturn \"Car\";\n\t\t}\n\t\telse if (figures > cars) {\n\t\t\treturn \"Action Figure\";\n\t\t}\n\t\telse {\n\t\t\treturn \"Equal amounts of actions figures and cars.\";\n\t\t}\n\t}",
"public String getDescription() {\n\t\tif (getType() == SpawnType.APPEARS) {\n\t\t\treturn String.format(\"May be found %s\", (mob.hasActFlag(ActFlag.SENTINEL) ? \"in \" : \"around \"));\n\t\t} else if (getType() == SpawnType.PRODUCED_MOB\n\t\t\t\t|| getType() == SpawnType.PRODUCED_ITEM\n\t\t\t\t|| getType() == SpawnType.PRODUCED_ROOM) {\n\t\t\treturn String.format(\"May be summoned %s by\", getProg().getType().getLabel());\n\t\t} else {\n\t\t\treturn \"Unrelated to\";\n\t\t}\n\t}",
"public static int showFoods(String cuisin){\r\n int check=0;\r\n for(int i=0;i<foods.size();i++){\r\n if(foods.get(i).getCousin().toLowerCase().equals(cuisin.toLowerCase())){\r\n System.out.println(i+\".-\"+foods.get(i).getName()+\" --> \"+foods.get(i).getDescription()+\" --> \"+foods.get(i).getType()+\" --> \"+foods.get(i).getPrice());\r\n check=1;\r\n }\r\n }\r\n if(check==0)\r\n System.out.println(\"There are not food in this category\");\r\n return check;\r\n }",
"public boolean testPredefinedtype(EIfccablecarrierfitting type) throws SdaiException;",
"public String descriere(){\r\n\t\treturn \"Flori\";\r\n\t}",
"public String getDescription()\r\n\t{\r\n\t\treturn motel.getDescription() + \"Food Bar Refill\";\r\n\t}",
"public String categoryDesc() { //to show the description of the category\n String desc = \"\";\n if (category.equals(\"H\")) {\n desc = \"Trump category: Hardness\";\n } else if (category.equals(\"S\")) {\n desc = \"Trump category: Specific Gravity\";\n } else if (category.equals(\"C\")) {\n desc = \"Trump category: Cleavage\";\n } else if (category.equals(\"CA\")) {\n desc = \"Trump category: Crustal Abundance\";\n } else if (category.equals(\"EV\")) {\n desc = \"Trump category: Economic Value\";\n }\n return desc;\n }",
"@Override\n\tpublic String getSpecies() {\n\t\treturn \"homo sapien\";\n\t}",
"@Override\r\npublic String getCelestialClassification() {\n\treturn \"DwarfPlanets\";\r\n}",
"public FursuitType getFursuitType () {\n return fursuitType;\n }",
"public Animal(String type, int poundsOfFoodToEat) {\n\t\tif (type == null) {\n\t\t\tthrow new IllegalArgumentException(\"type must not be null\");\n\t\t}\n\t\tif (type.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"type must not be empty\");\n\t\t}\n\t\tif (poundsOfFoodToEat <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"weight of food must be positive\");\n\t\t}\n\t\tthis.type = type;\n\t\tthis.poundsOfFoodNeeded = poundsOfFoodToEat;\n\t}",
"public ArmyType getArmyType() {\r\n return armyType;\r\n }",
"public abstract AlleleFootprintType getFootprintType();",
"public void settype(String cat) { this.type = cat; }",
"public java.lang.Boolean getIsFoodExist()\n {\n return isFoodExist;\n }",
"AnimalSpecific(String category,String name,String type){\n\t\tsuper(category);\n\t\tanimalName = name;\n\t\tanimalType = type;\n\t}",
"public String getHealthierFood(FoodItem item)\r\n\t{\r\n\t\tString result = \"\";\t\r\n\t\tif(item == null)\t\t\t\r\n\t\t\treturn result = \"No results for Image\";\r\n\t\tFoodSearch actualFood = searchFoodByActualName(item);\r\n\t\tFoodSearch otherSimilarFoods = searchFoodByGeneralName(item);\r\n\t\tNutrientSearch actualFoodsNutrients = null;\r\n\t\tNutrientSearch otherSimilarFoodsNutrients = null;\r\n\t\tOptional<Nutrient> actualFoodsSugar = null;\r\n\t\tOptional<Nutrient> otherSimilarFoodsSugar = null;\r\n\t\tif(actualFood == null)\r\n\t\t{\r\n\t\t\t//TODO: If searchFoodByActualName returns null, then search food by General name, and get first healthier option from there!\r\n\t\t\tresult = \"Food from image uploaded does not exist in database. Kindly try with another food item\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(actualFood == null || actualFood.getList() == null || actualFood.getList().getItem().size() == 0 || actualFood.getList().getItem().get(0) == null)\r\n\t\t\t{\r\n\t\t\t\tresult = \"Data 1 Not Properly Formed for Request. Please Try Again. If Error Persists, use another image\";\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\tif(otherSimilarFoods == null || otherSimilarFoods.getList() == null || otherSimilarFoods.getList().getItem().size() == 0)\r\n\t\t\t{\r\n\t\t\t\tresult = \"Data 2 Not Properly Formed for Request. Please Try Again. If Error Persists, use another image\";\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\tactualFoodsNutrients = searchNutrientByFoodNo(actualFood.getList().getItem().get(0).getNdbno());\r\n\t\t\t//Below line of code finds the first Nutrient object containing \"sugar\". Sugar is the parameter we use to determine healtier option\r\n\t\t\tactualFoodsSugar = actualFoodsNutrients.getReport().getFood().getNutrients().stream().filter(x -> x.getName().toUpperCase().contains(Constants.SUGAR)).findFirst();\r\n\t\t\tif(!actualFoodsSugar.isPresent())\r\n\t\t\t{\r\n\t\t\t\treturn result = \"No results for Image. Sugar content unavailable\";\r\n\t\t\t}\r\n\t\t\tdouble actualFoodSugarNum = Double.valueOf(actualFoodsSugar.get().getValue());\r\n\t\t\tif(actualFoodSugarNum <= 0)\r\n\t\t\t{\r\n\t\t\t\treturn result = \"The image you uploaded is the healthiest kind of \" + item.getGeneralFoodName() + \" there is!\" + \" It has zero sugars.\";\r\n\t\t\t}\r\n\t\t\tfor(Item element: otherSimilarFoods.getList().getItem())\r\n\t\t\t{\r\n\t\t\t\totherSimilarFoodsNutrients = searchNutrientByFoodNo(element.getNdbno());\r\n\t\t\t\totherSimilarFoodsSugar = otherSimilarFoodsNutrients.getReport().getFood().getNutrients().stream().filter(x -> x.getName().toUpperCase().contains(Constants.SUGAR)).findFirst();\r\n\t\t\t\tif(!otherSimilarFoodsSugar.isPresent())\r\n\t\t\t\t\tcontinue;\t\t\t\t\r\n\t\t\t\tdouble otherFoodsSugarNum = Double.valueOf(otherSimilarFoodsSugar.get().getValue());\r\n\t\t\t\tif(otherFoodsSugarNum < actualFoodSugarNum)\r\n\t\t\t\t{\r\n\t\t\t\t\tdouble scale = Math.pow(10, 2);\r\n\t\t\t\t\tdouble percentDiff = ((actualFoodSugarNum - otherFoodsSugarNum)/actualFoodSugarNum) * 100;\r\n\t\t\t\t\tpercentDiff = Math.round(percentDiff * scale) / scale;\r\n\t\t\t\t\tString manufacturer = (element.getManu().equals(\"none\")) ? \"N/A\" : element.getManu();\r\n\t\t\t\t\t//result = element.getName() + \" is a healther option.\" + \"\\n\" + \"Made by: \" + manufacturer + \"\\n\" + \"It has \" + percentDiff + \" percent less sugar\";\r\n\t\t\t\t\t//result = \"Healthier option found \";\r\n\t\t\t\t\tresult = \" A healthier option is: \" + element.getName() + \"\\n\" + \"Made by: \" + manufacturer + \"\\n\" + \"It has \" + percentDiff + \" percent less sugar\";\r\n\t\t\t\t\tresult = Utilities.encodeHtml(result);\r\n\t\t\t\t\tresult = Utilities.encodeJavaScript(result);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(result.isEmpty())\r\n\t\t\t\tresult = \"No healthier option found. Kindly go with the image uploaded\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"void cook(Food food) {\n }",
"public String getType() {\n\t\tif (isValid())\n\t\t\treturn \"FullHouse\";\n\t\treturn \"\";\n\t}",
"public void setOreType() {\n\t\tif (subType.equalsIgnoreCase(\"poor\")) {\n\t\t\tif (type.equalsIgnoreCase(\"nether\") || type.equalsIgnoreCase(\"end\")) {\n\t\t\t\t// Poor Nether/End Ores\n\t\t\t\tif (isDust()) {\n\t\t\t\t\tcrushedItem = getDustTiny();\n\t\t\t\t\tdropType = (dropType == 3 || dropType == 0) ? 5 : 0;\n\t\t\t\t\tsetOreValues(2, 8, 4, 8, 8);\n\t\t\t\t\tsetSmeltingOutput(getDustTiny(smeltAmount));\n\t\t\t\t} else {\n\t\t\t\t\tcrushedItem = getNugget();\n\t\t\t\t\tdropType = (dropType == 2 || dropType == 0) ? 0 : 0;\n\t\t\t\t\tsetOreValues(1, 1, 3, 6, 6);\n\t\t\t\t\tsetSmeltingOutput(getNugget(smeltAmount));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Poor Sand/Gravel/Stone Ores\n\t\t\t\tif (isDust()) {\n\t\t\t\t\tcrushedItem = getDustTiny();\n\t\t\t\t\tdropType = (dropType == 3) ? 5 : 0;\n\t\t\t\t\tsetOreValues(1, 4, 2, 4, 4);\n\t\t\t\t\tsetSmeltingOutput(getDustTiny(smeltAmount));\n\t\t\t\t} else {\n\t\t\t\t\tcrushedItem = getNugget();\n\t\t\t\t\tdropType = (dropType == 2) ? 4 : 0;\n\t\t\t\t\tsetOreValues(1, 2, 1, 2, 2);\n\t\t\t\t\tsetSmeltingOutput(getNugget(smeltAmount));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (subType.equalsIgnoreCase(\"dense\")) {\n\t\t\tif (type.equalsIgnoreCase(\"nether\") || type.equalsIgnoreCase(\"end\")) {\n\t\t\t\t// Dense Nether/End Ores\n\t\t\t\tif (isDust() || dropType == 3) {\n\t\t\t\t\tdropType = 3;\n\t\t\t\t\tsetOreValues(8, 32, 16, 32, 32);\n\t\t\t\t\tsetSmeltingOutput(getDust(smeltAmount));\n\t\t\t\t} else {\n\t\t\t\t\tif (dropType == 2) {\n\t\t\t\t\t\tsetOreValues(6, 16, 8, 16, 16);\n\t\t\t\t\t\tsetSmeltingOutput(getIngot(smeltAmount));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdropType = 0;\n\t\t\t\t\t\tsetOreValues(1, 1, 8, 16, 16);\n\t\t\t\t\t\tclearSmeltingOutput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Dense Sand/Gravel/Stone Ores\n\t\t\t\tif (isDust() || dropType == 3) {\n\t\t\t\t\tdropType = 3;\n\t\t\t\t\tsetOreValues(3, 8, 6, 8, 8);\n\t\t\t\t\tsetSmeltingOutput(getDust(smeltAmount));\n\t\t\t\t} else {\n\t\t\t\t\tif (dropType == 2) {\n\t\t\t\t\t\tsetOreValues(2, 6, 3, 6, 6);\n\t\t\t\t\t\tsetSmeltingOutput(getIngot(smeltAmount));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdropType = 6;\n\t\t\t\t\t\tsetOreValues(3, 3, 3, 6, 6);\n\t\t\t\t\t\tclearSmeltingOutput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (type.equalsIgnoreCase(\"nether\") || type.equalsIgnoreCase(\"end\")) {\n\t\t\t\t// Nether/End Ores\n\t\t\t\tif (isDust() || dropType == 3) {\n\t\t\t\t\tdropType = 3;\n\t\t\t\t\tsetOreValues(3, 2, 8, 16, 16);\n\t\t\t\t\tsetSmeltingOutput(getDust(smeltAmount));\n\t\t\t\t} else {\n\t\t\t\t\tif (dropType == 2) {\n\t\t\t\t\t\tsetOreValues(2, 1, 4, 8, 8);\n\t\t\t\t\t\tsetSmeltingOutput(getIngot(smeltAmount));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdropType = 0;\n\t\t\t\t\t\tsetOreValues(1, 1, 4, 8, 8);\n\t\t\t\t\t\tclearSmeltingOutput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Stone Ores\n\t\t\t\tif (isDust() || dropType == 3) {\n\t\t\t\t\tdropType = 3;\n\t\t\t\t\tsetOreValues(1, 2, 2, 4, 4);\n\t\t\t\t\tsetSmeltingOutput(getDust(smeltAmount));\n\t\t\t\t} else {\n\t\t\t\t\tif (dropType == 2) {\n\t\t\t\t\t\tsetOreValues(1, 1, 1, 2, 2);\n\t\t\t\t\t\tsetSmeltingOutput(getIngot(smeltAmount));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdropType = 0;\n\t\t\t\t\t\tsetOreValues(1, 1, 1, 2, 2);\n\t\t\t\t\t\tsetSmeltingOutput(getIngot(smeltAmount));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public boolean isWood() {\n return this.type == Type.WOOD;\n }",
"@Override\n\tpublic void tipoAnimal() {\n\t\tSystem.out.println(super.getNome() + \" é um gato.\");\n\t}",
"public int getFoodCount()\r\n\t{\r\n\t\treturn foodCount;\r\n\t}",
"public interface Food {\n\n String getItem();\n String getType();\n String getDay();\n\n void setItem(String item);\n void setType(String type);\n void setDay(String day);\n}",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();"
] | [
"0.7787209",
"0.774811",
"0.7612692",
"0.7612692",
"0.74855953",
"0.7224345",
"0.7178439",
"0.71424043",
"0.67441463",
"0.66478765",
"0.64070314",
"0.63955075",
"0.6381514",
"0.6241682",
"0.6240424",
"0.620248",
"0.61778337",
"0.6115762",
"0.5916852",
"0.5891055",
"0.58784735",
"0.58779377",
"0.58675706",
"0.5848504",
"0.5833456",
"0.58328706",
"0.58302605",
"0.582654",
"0.5812298",
"0.58117336",
"0.58046025",
"0.5802978",
"0.5799129",
"0.5763535",
"0.57394236",
"0.5735822",
"0.57311636",
"0.57196724",
"0.56857836",
"0.56469005",
"0.563348",
"0.56286174",
"0.5613249",
"0.5612134",
"0.55927813",
"0.558524",
"0.55743015",
"0.55381966",
"0.55292547",
"0.55202806",
"0.55001724",
"0.5487997",
"0.5470802",
"0.54663134",
"0.5439773",
"0.54304606",
"0.5429733",
"0.5429658",
"0.5424929",
"0.5424635",
"0.54184526",
"0.5413528",
"0.54131186",
"0.5410381",
"0.5406752",
"0.5404597",
"0.5400786",
"0.53995526",
"0.53928256",
"0.5392821",
"0.5392013",
"0.5391553",
"0.5379053",
"0.53790045",
"0.5374742",
"0.5370515",
"0.53459734",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174",
"0.53402174"
] | 0.5522303 | 49 |
This tells us about their habitat. | @Override
public void home() {
System.out.println("They live underground.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ArrayList getHabitant() {\n return habitant;\n }",
"private void meetWithHrForBenefitAndSalryInfo() {\n metWithHr = true;\n }",
"Habit getPassedHabit();",
"HabitEvent getPassedHabitEvent();",
"public void setHabitant(ArrayList habitant) {\n this.habitant = habitant;\n }",
"public HabitList getHabit_list() {\n return this.habit_list;\n }",
"@Override\n public int habitAnimalFit(HashMap<String, Object> habInfo) throws IllegalArgumentException {\n if (this.endangerment == Endangerment.EXTINCT) {\n throw new IllegalStateException(\"Endangered Species cannot live in a habitat.\");\n }\n \n boolean sharing = (boolean) habInfo.get(\"Sharing\");\n int habitatSize = (Integer) habInfo.get(\"HabitatSize\");\n int habitatTemperature = (Integer) habInfo.get(\"Temperature\"); \n List<String> habitatNaturalFeature = (List<String>) habInfo.get(\"NaturalFeature\");\n int naturalFeatureLen = habitatNaturalFeature.size();\n \n if (sharing == true \n & habitatSize > this.sizeMeters\n & habitatNaturalFeature.contains(this.naturalFeature)\n & habitatTemperature >= this.temperatureLow\n & habitatTemperature <= this.temperatureHigh) {\n \n return 0;\n \n } else if (sharing == true\n & habitatSize > this.sizeNumber()\n & naturalFeatureLen < 3\n & habitatTemperature >= this.temperatureLow\n & habitatTemperature <= this.temperatureHigh) {\n \n return 1;\n \n }\n \n \n \n return 2;\n }",
"private void setHabitType() {\n String title = getIntent().getStringExtra(\"ClickedHabitType\");\n habit_type = findHabitType(allHabits, title);\n }",
"public void tip()\r\n\t{\n\t\tSystem.out.println(\"Tipul de organizare: SAT!\");\r\n\t}",
"public void setHabit_list(HabitList habitList) {\n this.habit_list = habitList;\n }",
"public void cheat() {\r\n\t\t\t\tnourriture += population*10;\r\n\t\t\t\tarmee += population/2;\r\n\t\t\t\tpopulation += armee*tailleArmee;\r\n\t\t\t}",
"int addHabitEvent(Habit habit, HabitEvent habitEvent);",
"public void cheat() {\r\n announce( \"cheat\" );\r\n }",
"@Override\r\n public String getInfo(){\r\n String info = \"Temperature\\n\" + temperature.toString();\r\n if (temperature.getValue() <= 36.0){\r\n info += \"\\nAttention! The temperature is off the healthy values, you can enter hypothermia state, please consider seeing a doctor.\";\r\n } else if (temperature.getValue() >= 37.4) {\r\n info += \"\\nAttention! The temperature is off the healthy values, you have a fever, please consider seeing a doctor.\";\r\n } else {\r\n info += \"\\nHealthy!\";\r\n }\r\n return info + \"\\n--------------------------------------------\\n\";\r\n }",
"private boolean checkIfHabitDoneToday() {\n ArrayList<HabitEvent> eventList = habit_type.getHabitEvents();\n Locale locale = new Locale(\"English\", \"Canada\");\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"EEEE',' MMMM d',' yyyy\", locale);\n String currentDate = simpleDateFormat.format(new Date());\n Calendar calendar = Calendar.getInstance();\n int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);\n if (dayOfWeek == 1) {\n dayOfWeek = 8;\n }\n if (!habit_type.getWeeklyPlan()[dayOfWeek - 2]) {\n return true;\n }\n for (HabitEvent event : eventList) {\n if (currentDate.equals(event.getCompletionDateString())) {\n return true;\n }\n }\n return false;\n }",
"public void look()\n {\n System.out.println(currentRoom.getLongDescription());\n }",
"public String transfer(Paddock habitat) {\n if (!habitat.hasCarnivore()){\n location.removeDinosaur(this);\n habitat.introduceDinosaur(this);\n return getName() + \" has been moved to \" + habitat.getName() + \".\";\n } else {\n return \"Carnivore present, moving \" + getName() + \" there would be heartless!\";\n }\n }",
"ArrayList<HabitEvent> getHabitEvents(Habit forHabit);",
"@Override\r\n\tpublic StateBruceDanner meetBetty() {\n\t\treturn CONTAMINED;\r\n\t}",
"public String morningMeeting(){\n return \"accountants have meetings beginning at 9:15 AM and run until 8:45 AM\";\n }",
"@Override\n\tpublic void reservar(Habitacion habitacion) {\n\t\t\n\t}",
"public void look() \n {\n System.out.println(currentRoom.getLongDescription());\n }",
"@Override\n public void onClick(View view) {\n boolean isInserted = app_db.insertHabit(\n app_utils.getCurrentDateInteger(),\n app_utils.getCurrentTimestampForSQLite(),\n \"cigarette\"\n );\n if (isInserted)\n Toast.makeText(MainActivity.this, \"Cigarette Inserted\", Toast.LENGTH_LONG).show();\n else\n Toast.makeText(MainActivity.this, \"Cigarette Not Inserted\", Toast.LENGTH_LONG).show();\n }",
"public HabitEventList getHabit_event_list() {\n return this.habit_event_list;\n }",
"@Override\r\n\tpublic String getDailyStudy() {\n\t\treturn \"Practice Expilliarmus and Work on the patronus charm\";\r\n\t}",
"int addHabit(Habit habit);",
"@Override\n\tpublic void Examinar() {\n\t\tSystem.out.println(\"\\nEsta preguiça emite o som tec tec tec ao ser examinada\\n\");\t\n\t}",
"public void getInfo() {\n System.out.println(\"Content : \" + content);\n System.out.println(\"Name : \" + name);\n System.out.println(\"Location : (\" + locX + \",\" + locY + \")\");\n System.out.println(\"Weight : \" + String.format(\"%.5f\", weight) + \" kg/day\");\n System.out.println(\"Habitat : \" + habitat);\n System.out.println(\"Type : \" + type);\n System.out.println(\"Diet : \" + diet);\n System.out.println(\"Fodder : \" + String.format(\"%.5f\", getFodder()) + \" kg\");\n System.out.println(tamed ? \"Tame : Yes \" : \"Tame : No \");\n System.out.println(\"Number of Legs : \" + legs);\n }",
"@Override\n public String getDailyFortune() {\n return \"tennis coach teach play in tennis\";\n }",
"@Override\n public void eatMeat()\n {\n setEatText(\"nomnomnom oink thx\");\n System.out.println(getEatText());\n }",
"public String look() {\r\n\t\t\tif(this.isLooting() == true) {\r\n\t\t\t\treturn this.getCurrentChest().printContent();\r\n\t\t\t}\r\n\t\t\telse if (this.isTrading()) {\r\n\t\t\t\treturn this.getCurrentTrader().getNpcInventory().printContentWithPrice() + this.getCurrentTrader().printGold();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn \"You are at \" + this.getPlayer().getCurrentLocation().getDescription() + \"\\n\" +\r\n\t\t\t\t\t\t\"You can move in the following directions: \" + this.getPlayer().getCurrentLocation().getPaths().keySet().toString() + \"\\n\" +\r\n\t\t\t\t\t\tthis.getPlayer().getCurrentLocation().printItems() +\r\n\t\t\t\t\t\tthis.getPlayer().getCurrentLocation().printNpcs();\r\n\t\t\t}\r\n\t\t}",
"public String getEtat() {\r\n\t\treturn etat;\r\n\t}",
"@Override\r\n\tpublic String Eat() {\n\t\treturn \"SuperMan I Eat\";\r\n\t}",
"public String getEntrance() {\n\t\treturn entrance;\n\t}",
"public List<Inhabitant> getInhabitants() {\n\t\treturn inhabitants;\n\t}",
"private void showFacts() {\n\t\tSystem.out.println(\"=============================\");\n\t\tSystem.out.println(\"Your lose! Try harder and better luck next time.\");\n\t}",
"public String about() {\n String story = \"\\n\";\n story += \"Admissions Officers appear in the vicinity of Rubik's Cube's prison.\\n\";\n story += \"They serve to prevent entry by any means necessary.\\n\";\n return story;\n }",
"public String getInformation() {\n \treturn \"This is a Maths Assessment\" +\n \t\t\t \"\\nNumber of questions: \" + Integer.toString(numQuestions) + \n \t\t\t \"\\nClosing Date: \" + closingDate;\n }",
"@Override\n public String toString() {\n String toStr = String.format(\"ChiefExecutiveOfHA | %s, leadership %d, medicine %d, experience %d\", isReady() ? \"READY\" : \"DONE\",leadership, medicine, experience);\n return toStr;\n }",
"public void checkAttendance() {\n\t\tRandom random = new Random();\n\t\trandomCheck = random.nextInt(3);\n\t\tif (randomCheck == isFullTimePresent) {\n\t\t\tSystem.out.println(\"Employee is Full Time Present \");\n\t\t\tworkingHrs = 8;\n\t\t} else if (randomCheck == isPartTimePresent) {\n\t\t\tSystem.out.println(\"Employee is Part time Present \");\n\t\t\tworkingHrs = 4;\n\t\t} else {\n\t\t\tSystem.out.println(\"Employee is Absent \");\n\t\t\tworkingHrs = 0;\n\t\t}\n\t}",
"public String getSuit()\r\n { return suit; }",
"public String getAnfitrion() {\r\n\t\treturn anfitrion;\r\n\t}",
"ArrayList<HabitEvent> getHabitEvents();",
"public String about(){\n\treturn \"This subclass of Protagonist, Archer, is one with slightly above average attack and defense, good for balanced gameplay.\";\n }",
"Habit createHabit(Habit habit);",
"public java.lang.String getEtatreception() {\r\n\t\treturn etatreception;\r\n\t}",
"ResultSet searchHabitat(String habitat) {\n \ttry {\n \t\tStatement search = this.conn.createStatement();\n \tString query = \"SELECT * FROM Pokemon AS P, Habitats AS H \"\n \t\t\t+ \"WHERE H.HabitatID = P.HabitatID \"\n \t\t\t+ \"AND H.Name = \" + \"'\" + habitat + \"'\";\n \t\n \treturn search.executeQuery(query);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n }",
"public void expLocation() {\n\t\tif (!death) {\t// Geht nicht wenn Tod!\n\t\t\t\n\t\t\t// Beschreibungen anzeigen und boolean explored auf wahr setzen, außer der Raum wurde bereits untersucht\n\t\t\tif (location[this.currentLocation].isExplored()) { Tuna.setMessage(\"Dieser Raum wurde bereits untersucht!\");\n\t\t\t} else {\n\t\t\t\tTuna.addText(location[this.currentLocation].getDescriptions().getExploreDescription());\n\t\t\t\tlocation[this.currentLocation].setExplored(true);\n\t\t\t}\n\t\t\t\n\t\t\t// Items an Stelle null im Item-Array des Standortes sichtbar machen\n\t\t\tif ((currentLocation > 0 && currentLocation < 7 && currentLocation != 2) || currentLocation == 20) {\n\t\t\t\tlocation[this.currentLocation].getItem(0).setVisible(true);\n\t\t\t\t/* Im Korridor (1) der Kaffeelöscherkasten\n\t\t\t\t * Im Konferenzraum (3) der Ventilationsschacht\n\t\t\t\t * In der Kammer der Leere (4) die Notiz\n\t\t\t\t * Im Ventilationsraum (5) die Notiz\n\t\t\t\t * In der Damentoilette (6) das Skillboook\n\t\t\t\t * Im Fahrstuhlschacht (20) die Kaffeetasse\n\t\t\t\t */\n\t\t\t}\n\t\t\t\n\t\t\t// Items an Stelle eins im Item-Array des Standortes sichtbar machen\n\t\t\tif (currentLocation == 9) {\n\t\t\t\tlocation[this.currentLocation].getItem(1).setVisible(true);\n\t\t\t}\n\t\t} else if (death) {\n\t\t\tTuna.setMessage(\"Du bist tot!\");\n\t\t}\n\t}",
"public DayHourGreeting () {\n Calendar c = Calendar.getInstance();\n int hourOfDay = c.get(Calendar.HOUR_OF_DAY);\n setGreeting(hourOfDay);\n }",
"public static void insertHabits(Context context) {\n SQLiteDatabase database = new HabitTrackerSQLiteOpenHelper(context).getWritableDatabase();\n ContentValues habit1 = new ContentValues();\n habit1.put(HabitEntry.COLUMN_NAME_NAME, \"Run\");\n habit1.put(HabitEntry.COLUMN_NAME_OCCURRENCES, 1);\n habit1.put(HabitEntry.COLUMN_NAME_TYPE, HabitEntry.COLUMN_KEY_TYPE_GOOD);\n habit1.put(HabitEntry.COLUMN_NAME_CREATED_AT, 1451628000); // 2016-01-01T06:00:00Z\n ContentValues habit2 = new ContentValues();\n habit2.put(HabitEntry.COLUMN_NAME_NAME, \"Drink\");\n habit2.put(HabitEntry.COLUMN_NAME_OCCURRENCES, 2);\n habit2.put(HabitEntry.COLUMN_NAME_TYPE, HabitEntry.COLUMN_KEY_TYPE_BAD);\n habit2.put(HabitEntry.COLUMN_NAME_CREATED_AT, 1451671200); // 2016-01-01T18:00:00Z\n try {\n database.insert(HabitEntry.TABLE_NAME, null, habit1);\n database.insert(HabitEntry.TABLE_NAME, null, habit2);\n } catch (Exception exception) {\n exception.printStackTrace();\n } finally {\n database.close();\n }\n }",
"@Override\t\r\n\tpublic String getDailyWorkout() {\n\t\treturn \"practice 30 hrs daily\";\r\n\t}",
"private void look()\n {\n System.out.println(currentRoom.getLongDescription()); \n }",
"public String getSuit()\r\n {\r\n return suit;\r\n }",
"public void reporteIngresosHabitacion(TablaModelo modeloConsumos, TablaModelo modeloAlojamientos,String idHabitacion){\n introducirConsumosHabitacion(modeloConsumos, idHabitacion);\n introducirPagosALojamientoHabitacion(modeloAlojamientos, idHabitacion);\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 abstract boolean isEdible(final Inhabitant inhabitant);",
"public void acheter(){\n\t\t\n\t\t// Achete un billet si il reste des place\n\t\ttry {\n\t\t\tthis.maBilleterie.vendre();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tthis.status.put('B', System.currentTimeMillis());\n\t\tSystem.out.println(\"STATE B - Le festivalier \" + this.numFestivalier + \" a acheté sa place\");\n\t}",
"@Override\r\n\tpublic void science() {\n\t\tSystem.out.println(\"Science class is on every tuesday afternoon\");\r\n\t\t\r\n\t}",
"public String getSuit() {\r\n return suit;\r\n }",
"public String nombreHabitacionMasPopular(){\n return this.habitacionPopular;\n }",
"public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}",
"@Override\n\tpublic void HowtoEat() {\n\t\tSystem.out.println(\"Fırında Ye!!\");\n\t}",
"public String getSuit() {\n return suit;\n }",
"@ScheduledMethod(start= 1, interval =1, priority=5.5)\n\tpublic void meetUp(){\n\t\tif(CFG.MEETUP_VEG()){\n\t\t\tPContext affordanceToRemove =null;\n\t\t\tfor(PContext affordance:getMeatPractice().getAffordances()){\n\t\t\t\tif(affordance.getMyLocation().getClass() == myMeetUpPlace.getClass()) affordanceToRemove = affordance;\n\t\t\t}\n\t\t\t if(affordanceToRemove != null) getMeatPractice().removeAffordance(affordanceToRemove); //After one time it isnt there anymore\n\t\t}\n\t\tif(CFG.isMeetUp() &&!isLocated){\n\t\t\tif(CFG.MEETUP_INVITE()){\n\t\t\t\tif(acceptInvitation(myMeetUpPlace)) diningOutToMeetUp(); //Only if you want to eat Veg you organize a dining party.\n\t\t\t}\n\t\t\telse goTo(myMeetUpPlace); //maar anders ga je er ok heen?!\n\t\t//\tSystem.out.println(\"Agents MEETUP\");\n\t\t}\n\t}",
"public void lookOut() //looking out the window\r\n\t{\r\n\tSystem.out.println(this.weather.description); //prints a description of the weather\r\n\t}",
"@Override\n\tpublic void exams() {\n\t\t\n\t}",
"@Override\n\tpublic void meetRandomEvent(String event) {\n\t\tSystem.out.println(\"You meet \" + event + \"!\");\n\t\tif(event == \"PIRATE\") \n\t\t{\n\t\t\tSystem.out.println(\"You meet a pirates, you should play number games to against pirates\");\n\t\t\tgame.meetPirate();\n\t\t}\n\t\telse if (event == \"UNFORTUNATE WEATHER\"){\n\t\t\tint damage = game.meetUnfortunateWeather();\n\t\t\tSystem.out.println(\"Your ship's health has been reduced by \" + damage + \" because you just meet unfortunate weather\");\n\t\t\tgame.backToMain();\n\t\t}\n\t\telse {\n\t\t\tint reward = game.meetSailorToRescue();\n\t\t\tSystem.out.println(\"Your have been rewarded by sailors you rescued, they gave you \" + reward + \" coin\");\n\t\t\tgame.backToMain();\n\t\t}\n\t}",
"public String getSuit()\r\n\t{\r\n\t\treturn suit;\r\n\t}",
"public String getSuit() {\n return this.suit;\n }",
"public HabitLog getDefaultHabitLog() {\n return defaultHabits;\n }",
"@Override\n public boolean habitatIncludesAboardStarship() {\n return false;\n }",
"public static void getGameSituationTest() {\n\t\tVTicTacToe tempEnvironment = new VTicTacToe();\n\t\tint[] tempTestStates = { 0, 13, 39, 26, 17060 };\n\n\t\tint tempResult;\n\t\tfor (int i = 0; i < tempTestStates.length; i++) {\n\t\t\ttempResult = tempEnvironment.computeGameSituation(tempTestStates[i]);\n\t\t\tSystem.out.println(\"The game situation of \" + tempTestStates[i] + \" is: \" + tempResult);\n\t\t} // Of for i\n\t}",
"static private void TalkTo() {\n if (BSChristiansen.getCurrentRoom() == currentRoom) {\n System.out.println(BSChristiansen.getDescription() + \", yet he still gives you good advice:\\n\");\n System.out.println(BSChristiansen.getDialog(0));\n System.out.println(\"\");\n woundedSurvivor();\n } else if (mysteriousCrab.getCurrentRoom() == currentRoom && inventory.getInventory().containsKey(\"Shroom\")) {\n System.out.println(mysteriousCrab.getDescription() + \"\\n\" + mysteriousCrab.getDialog(0));\n } else {\n System.out.println(\"There is nobody to communicate with in this Room\");\n }\n\n }",
"public String getSuit()\n\t{\n\t\treturn suit;\n\t}",
"public void eat() {\n\t\tSystem.out.println(this.name + \" the \" + this.type + \" ate their rabbit meat.\");\n\t}",
"public String getExcellent() {\n return excellent;\n }",
"@Override\n\tpublic String getDailyWorkout() {\n\t\treturn \"Let's Play Football\";\n\t}",
"public static String about(){\r\n\treturn \"This subclass Goblins is a Monster with higher hit points, while maintaining the same stats for the others. Meant to frustrate the player since it'll take longer to kill.\";\r\n\r\n }",
"public void about()\n\t{\n\t\treadout.setText(\"Thank you for using haste by Beau Bouchard 2013\");\n\t\toutputText(\"\");\n\t}",
"private void meetDepartmentStaff() {\n if(metWithHr) {\n metDeptStaff = true;\n } else {\n System.out.println(\"Sorry, you cannot meet with \"\n + \"department staff until you have met with HR.\");\n }\n }",
"public Personnage attaqueSurPersonnage() {\n\t\tdouble rand = Math.random();\n\t\t\tif (rand >= 0.85){\n\t\t\t\tfrappeMonstre = monstre.getCaracter().getForce() * 2;\n\t\t\t\tjoueur.setDiminutionPV(frappeMonstre);\n\t\t\t\tsetVictimeKO(joueur);\n\t\t\t\tetatAttaque = 'C';\n\t\t\t\treturn joueur;\n\t\t\t}\n\t\t\telse if ((rand < 0.85) && (rand >= 0.15)){\n\t\t\t\tfrappeMonstre = monstre.getCaracter().getForce();\n\t\t\t\tjoueur.setDiminutionPV(frappeMonstre);\n\t\t\t\tsetVictimeKO(joueur);\n\t\t\t\tetatAttaque = 'N';\n\t\t\t\treturn joueur;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tetatAttaque = 'F';\n\t\t\t\tfrappeMonstre = 0;\n\t\t\t\treturn joueur;\n\t\t\t}\n\t\t}",
"@Override\r\n\tpublic void showClassmate() {\n\t\tSystem.out.println(\"你的同学有: \"+classmateRelations);\r\n\t}",
"@Override\n\tpublic String toString() {\n\t\treturn hablar() + \"\\nSexo \" + this.sexo + \" mi edad es de \" + this.edad + \" vuelo a \" + this.velocidadVuelo + \" Km/h\" + \" y peso \" + this.peso + \" Kg\";\n\t}",
"public String getSeat() {\n\t\t\treturn seat;\n\t\t}",
"public int getHabitantes(){\n return habitantes;\n }",
"@Override\n public String toString() {\n return \"\\tMunicipio: \" + municipio + \"\\t\" + \"Habitantes: \" + habitantes + \".\";\n }",
"@Override\n\tpublic String getDailyWorkout() {\n\t\treturn \"Baseball coachtan implement getDailyWorkout\";\n\t}",
"@Test\r\n void testTitForTatWithHistoryDefect() {\r\n TitForTat testStrat = new TitForTat();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 2, payoffs);\r\n game.playGame();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 1, \"tit for tat not returning \"\r\n + \"correctly against defecting opponent\"); \r\n }",
"@Test\r\n void testTitForTatNoHistory() {\r\n TitForTat testStrat = new TitForTat();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 1, payoffs);\r\n game.playGame();\r\n int points = testStrat.getPoints();\r\n assertEquals(points, 0, \"tit for tat not returning c when no history\");\r\n }",
"public static void getBattleChoice() {\n \t\tMainGame.display.disp(\"What do you want to do?:\");\r\n \t\tMainGame.display.Enable(MainGame.display.attack, MainGame.display.defend, MainGame.display.heal);\r\n \t}",
"public String getSuitString()\n {\n switch (suit)\n {\n case SPADES: return \"SPADES\";\n case CLUBS: return \"CLUBS\";\n case DIAMONDS: return \"DIAMONDS\";\n case HEARTS: return \"HEARTS\";\n default: return \"Invalid\";\n }\n \n }",
"public int manhattan() {\n\t\treturn manhattan;\n\t}",
"public static void testFacture(int an, int mois)\r\n\t{\r\n\t\t\r\n\t\tArrayList<Habitation> lesHabitations = AccesData.getLesHabitations();\r\n\t\t//EditionFacturePDF.editionElementfacture(AccesData.getHabitation(\"hab1\"), an, mois);\r\n\t\t\t\r\n\t\t\r\n\t\tif(lesHabitations.size() != 0) \r\n\t\t{\r\n\t\t\tfor(Habitation h : lesHabitations)\r\n\t\t\t{\r\n\t\t\t\t\tEditionFacturePDF.editionElementfacture(h, an, mois);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void setPassedHabit(Habit passedHabit);",
"public String getSuit() {\n\t\treturn suit;\n\t}",
"public String getSuit() {\n\t\treturn suit;\n\t}",
"public String countExpense() throws IOException{ \r\n return \"Expences: \" + getActualSheet().getCellAt(\"B2\").getTextValue() + \"\\n\";\r\n }",
"@Override\n public void onClick(View view) {\n\n String[] facts = {\n \"Ants stretch when they wake up in the morning.\",\n \"Ostriches can run faster than horses.\",\n \"Olympic gold medals are actually made mostly of silver.\",\n \"You are born with 300 bones; by the time you are an adult you will have 200.\",\n \"It takes about 8 minutes for light from the Sun to reach Earth.\",\n \"Some bamboo plants can grow almost a meter in just one day.\",\n \"The state of Florida is bigger than England.\",\n \"Some penguins can leap 2-3 meters out of the water.\",\n \"On average, it takes 56 days to form a new habit.\",\n \"Mammoths still walked the earth when the Great Pyramid was being built.\",\n \"There are more life forms living in your skin than there are people on the planet.\",\n \"Otters sleep holding hands.\",\n \"Caterpillars completely liquify as they transform into moths.\",\n \"An indoor vegetable factory in Japan produces up to 10,000 heads of lettuce per day and uses 1% of the amount of water needed for outdoor fields.\",\n \"When hippos are upset, their sweat turns red.\",\n \"“Facebook Addiction Disorder” is a mental disorder identified by Psychologists.\",\n \"The average woman uses her height in lipstick every 5 years.\",\n \"Human saliva has a boiling point three times that of regular water.\",\n \"During your lifetime, you will produce enough saliva to fill two swimming pools.\",\n \"Bikinis and tampons were invented by men.\",\n \"Heart attacks are more likely to happen on a Monday.\",\n \"Camels have three eyelids to protect themselves from blowing sand.\",\n \"Dolphins sleep with one eye open.\",\n \"Months that begin on a Sunday will always have a ‘Friday the 13th’.\",\n \"Fictional/horror writer Stephen King sleeps with a nearby light on to calm his fear of the dark.\",\n \"Americans travel 1,144,721,000 miles by air every day.\",\n \"38% of American men say they love their cars more than women.\",\n \"The U.S. military operates 234 golf courses.\",\n \"A cat has 32 muscles in each ear.\",\n \"A duck’s quack doesn’t echo, and no one knows why.\",\n \"The average lifespan of an eyelash is five months.\",\n \"A spider has transparent blood.\",\n \"Babies are most likely to be born on Tuesdays.\",\n \"The Minneapolis phone book has 21 pages of Andersons.\",\n \"A horse can look forward with one eye and back with the other.\",\n \"The word Pennsylvania is misspelled on the Liberty Bell.\",\n \"You spend 7 years of your life in the bathroom.\",\n \"Simplistic passwords contribute to over 80% of all computer password break-ins.\",\n \"Dentists have recommended that a toothbrush be kept at least 6 feet away from a toilet to avoid airborne particles resulting from the flush.\",\n \"Most dust particles in your house are made from dead skin.\",\n \"Venus is the only planet that rotates clockwise.\",\n \"Oak trees do not produce acorns until they are fifty years of age or older.\",\n \"The king of hearts is the only king without a mustache.\",\n \"Thirty-five percent of people who use personal ads for dating are already married.\",\n \"One out of 20 people have an extra rib.\",\n \"The longest distance a deepwater lobster has been recorded to travel is 225 miles.\",\n \"Orcas when traveling in groups, breathe in unison.\",\n \"Pucks hit by hockey sticks have reached speeds of up to 150 miles per hour\",\n \"Most lipstick contains fish scales.\",\n \"No piece of paper can be folded in half more than 7 times.\",\n \"More people are killed by donkeys annually than are killed in plane crashes.\",\n \"The fear of peanut butter sticking to the roof of the mouth is called Arachibutyrophobia.\",\n \"Serving ice cream on cherry pie was once illegal in Kansas.\",\n \"Emus cannot walk backwards.\",\n \"Infants spend more time dreaming than adults do.\",\n \"Over 200 varieties of watermelons are grown in the U.S.\",\n \"The most dangerous job in the United States is that of a fisherman, followed by logging and then an airline pilot.\",\n \"The youngest pope was 11 years old.\",\n \"You share your birthday with at least 9 other million people in the world.\",\n \"During the First World War, cigarettes were handed out to soldiers along with their rations.\",\n \"The USA bought Alaska from Russia for 2 cents an acre.\",\n \"Walmart sells more apparel a year than all the other competing department stores combined.\",\n \"Canada has more inland waters and lakes than any other country in the world.\",\n \"Ramses II, a pharaoh of Egypt died in 1225 B.C. At the time of his death, he had fathered 96 sons and 60 daughters.\",\n \"Women are twice as likely to be diagnosed with depression than men in the United States.\",\n \"An average city dog lives approximately three years longer than an average country dog.\",\n \"On average, falling asleep while driving results in 550 accidents per day in the United States.\",\n \"The average life span of a single red blood cell is 120 days.\",\n \"Over 250 million Slinky toys have been sold since its debut in 1946.\",\n \"The last thing Elvis Presley ate before he died was four scoops of ice cream and 6 chocolate chip cookies.\",\n \"Every year, Burger King restaurants prepare over 950,000 pounds of bacon for their breakfast customers.\",\n \"The cosmos is within us, we're made of star stuff. We are a way for the cosmos to know itself.\",\n \"There is a dog museum in St. Louis, Missouri.\",\n \"An average person laughs about 15 times a day.\",\n \"About 10% of the 100,000 thunderstorms that occur in the USA every year are classified as severe.\",\n \"A leech has 32 brains.\",\n \"There are about 6,800 languages in the world.\",\n \"By walking an extra 20 minutes every day, an average person will burn off seven pounds of body fat in an year.\",\n \"A slug has four noses.\",\n \"Camel is considered unclean meat in the Bible.\",\n \"Mosquitoes have teeth.\",\n \"Cats have over one hundred vocal sounds, dogs only have about ten.\",\n \"Lions cannot roar until they reach the age of two.\",\n \"In Las Vegas, casinos do not have any clocks.\",\n };\n\n String fact = \"\";\n\n Random rng = new Random();\n int random = rng.nextInt(facts.length);\n\n fact = facts[random];\n factLabel.setText(fact);\n didY.setText(\"Did you know?\");\n }",
"@Override\n public String toString() {\n String sexString = \"\";\n\n if (this.sex == \"M\") { //The class can always access it's own variables\n sexString = \"He\";\n } else if (this.sex == \"F\") {\n sexString = \"She\";\n }\n\n return \"It's \" + this.name + \" a \" + this.className + \" . \" +\n sexString + \" has \" + this.health + \" hitpoints left.\";\n }",
"private void updateAgilisaurusState() {\n this.age++;\n\n if (this.age == 30 && this.hasCapability(LifeStage.BABY)) {\n // grow up\n this.removeCapability(LifeStage.BABY);\n this.addCapability(LifeStage.ADULT);\n this.displayChar = 'D';\n }\n\n if (this.foodLevel > 0) {\n this.foodLevel--;\n }\n\n if (this.waterLevel > 0) {\n this.waterLevel--;\n }\n\n if (this.foodLevel < 30) {\n this.behaviour = new HungryBehaviour();\n }\n\n if (this.foodLevel > 50) {\n this.behaviour = new BreedBehaviour();\n }\n\n if (this.foodLevel == 0) {\n this.Starving();\n } else {\n this.starvationLevel = 0;\n }\n\n if (this.waterLevel < 30) {\n this.behaviour = new ThirstBehaviour();\n }\n\n if (this.waterLevel == 0) {\n this.Thirsting();\n } else {\n this.thirstLevel = 0;\n }\n }",
"void dailyLife() {\n\t\tString action = inputPrompt.dailyOptions(dailyTime).toLowerCase();\r\n\t\tswitch(action) {\r\n\t\tcase \"exercise\":\tthis.exercise();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"study\":\t\tthis.study();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"rocket\":\t\tthis.buildRocket();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"eat\":\t\t\tthis.eat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"meds\":\t\tthis.getEnergised();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"fun\":\t\t\tthis.haveFun();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tdefault:\t\t\tdailyLife();\r\n\t\t}\t\r\n\t}"
] | [
"0.6210546",
"0.61484355",
"0.5805365",
"0.5794487",
"0.57838225",
"0.57324195",
"0.56804574",
"0.5634892",
"0.55643296",
"0.55642575",
"0.5492533",
"0.546613",
"0.54621905",
"0.5410985",
"0.5375948",
"0.5374336",
"0.53698885",
"0.5364904",
"0.5362774",
"0.535681",
"0.5350109",
"0.53455025",
"0.53018355",
"0.5282549",
"0.5277245",
"0.5261174",
"0.5261117",
"0.5244209",
"0.5242903",
"0.5240552",
"0.523082",
"0.5226768",
"0.5226492",
"0.51908153",
"0.5185281",
"0.51781565",
"0.5165165",
"0.51553065",
"0.5153166",
"0.5147189",
"0.51469564",
"0.5125476",
"0.5117258",
"0.5109182",
"0.5105234",
"0.5096256",
"0.5090747",
"0.50895774",
"0.50754863",
"0.50714743",
"0.50650525",
"0.50609064",
"0.5057668",
"0.5054185",
"0.5049404",
"0.502939",
"0.50276214",
"0.5025751",
"0.50251377",
"0.50162524",
"0.5009628",
"0.50088763",
"0.500368",
"0.5001569",
"0.50000954",
"0.49886984",
"0.4981417",
"0.49785694",
"0.49740323",
"0.49735758",
"0.49704316",
"0.49694934",
"0.49683973",
"0.49612078",
"0.49596083",
"0.4952626",
"0.49503586",
"0.49461183",
"0.4938507",
"0.49367782",
"0.49353853",
"0.49246266",
"0.49236605",
"0.49211752",
"0.4920446",
"0.49196813",
"0.49162695",
"0.4914079",
"0.4912283",
"0.49064124",
"0.49046832",
"0.48988876",
"0.48985967",
"0.48984382",
"0.48924887",
"0.48924887",
"0.48885354",
"0.4888489",
"0.48859236",
"0.48845828",
"0.48834458"
] | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.7246874",
"0.72017205",
"0.71953726",
"0.7177551",
"0.7107639",
"0.7040628",
"0.7038909",
"0.70122313",
"0.7010098",
"0.69809204",
"0.6946122",
"0.6940016",
"0.6934117",
"0.6917838",
"0.6917838",
"0.6891204",
"0.6883838",
"0.6875593",
"0.6874913",
"0.6862368",
"0.6862368",
"0.6862368",
"0.6862368",
"0.68527925",
"0.684758",
"0.68196976",
"0.6817324",
"0.6813345",
"0.68129027",
"0.68129027",
"0.68057096",
"0.68008226",
"0.6797857",
"0.6791331",
"0.6790169",
"0.6788319",
"0.678351",
"0.6759506",
"0.6757522",
"0.6748293",
"0.67441195",
"0.67441195",
"0.6741131",
"0.67401105",
"0.6725893",
"0.67239493",
"0.6722708",
"0.6722708",
"0.67209524",
"0.67124516",
"0.67071265",
"0.67046547",
"0.6699903",
"0.66986626",
"0.6696521",
"0.66949654",
"0.6686405",
"0.6683668",
"0.6683668",
"0.6683436",
"0.66803485",
"0.66796863",
"0.6677369",
"0.6668993",
"0.6668162",
"0.66629726",
"0.6657424",
"0.6657424",
"0.6657424",
"0.6656569",
"0.6654796",
"0.6654796",
"0.6654796",
"0.6652567",
"0.6651887",
"0.66503876",
"0.66491556",
"0.664731",
"0.66468877",
"0.6646478",
"0.6646267",
"0.6645108",
"0.6644973",
"0.66440386",
"0.664294",
"0.6642042",
"0.66392493",
"0.663475",
"0.6633584",
"0.66329664",
"0.6632311",
"0.6632311",
"0.6632311",
"0.66300714",
"0.66283756",
"0.66270864",
"0.6626683",
"0.66246134",
"0.66206646",
"0.6618862",
"0.6618862"
] | 0.0 | -1 |
Brute force solution. O(N^2). | public static int TwoSum_bruteForce(int[] a,int lo, int hi, int x)
{
int count = 0;
for (int i = lo; i < hi; ++i)
{
for (int j = i+1; j < a.length; ++j)
{
if (a[i]+a[j] == x)
{
System.out.println("Pair: (" + a[i] + "," + a[j] + ")");
++count;
}
}
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int solve() {\n FactorizationSieve sieve = new FactorizationSieve(LIMIT + 1);\n int[] abundants = new int[LIMIT + 1];\n int k = 0;\n\n for (int n = 1; n <= LIMIT; n++)\n if (sieve.sigma(1, n) > n + n)\n abundants[k++] = n;\n\n // Sum pair of abundant numbers\n BitSet absums = new BitSet(LIMIT + 1);\n for (int i = 0; i < k; i++) {\n for (int j = i; j < k; j++) {\n int n = abundants[i] + abundants[j];\n if (n > LIMIT)\n break;\n absums.set(n);\n }\n }\n\n // Find all numbers that cannot be written as the sum of two abundant numbers\n int res = 0;\n for (int n = 1; n <= LIMIT; n++)\n if (!absums.get(n))\n res += n;\n return res;\n }",
"private static void findDuplicatesBruteForce(int[] arr) {\n\t\t\n\t\tfor(int i = 0; i< arr.length ; i++)\n\t\t{\n\t\t\tfor ( int j = i+1 ; j < arr.length ; j++)\n\t\t\t{\n\t\t\t\tif(arr[i] == arr[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(arr[i] + \" is duplicate by brute force method\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static void bruteForceSolution(int matrix[][]){\n\t\t\n\t\tint m = matrix.length;\n\t\tint n = matrix[0].length;\n\t\t\n\t\tint aux[][] = new int [m][n];\n\t\t\n\t\tfor(int i = 0;i<m;i++){\n\t\t\tfor(int j = 0;j<n;j++){\n\t\t\t\taux[i][j] = 1;\n\t\t\t}\n\t\t}\n\t\t// if found 0 in main array making row and column in the auxilary row and column as 0\n\t\tfor(int i = 0;i<m;i++){\n\t\t\tfor(int j = 0;j<n;j++){\n\t\t\t\tif(matrix[i][j] == 0){\n\t\t\t\t\t\n\t\t\t\t\tfor(int k = 0;k<m;k++){\n\t\t\t\t\t\taux[k][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tfor(int k = 0;k<n;k++){\n\t\t\t\t\t\taux[i][k] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//copying elements back to main array\n\t\tfor(int i = 0;i<m;i++){\n\t\t\tfor(int j = 0;j<n;j++){\n\t\t\t\tmatrix[i][j] = aux[i][j];\n\t\t\t}\n\t\t}\n\t}",
"boolean bruteForce(int A[], int sum) {\n\n\t\t// Fix the first element as A[i]\n\t\tfor (int i = 0; i < A.length - 2; i++) {\n\n\t\t\t// Fix the second element as A[j]\n\t\t\tfor (int j = i + 1; j < A.length - 1; j++) {\n\n\t\t\t\t// Now look for the third number\n\t\t\t\tfor (int k = j + 1; k < A.length; k++) {\n\t\t\t\t\tif (A[i] + A[j] + A[k] == sum) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If we reach here, then no triplet was found\n\t\treturn false;\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n int q = in.nextInt();\n\n int a[] = new int[n];\n for(int a_i=0; a_i < n; a_i++){\n a[a_i] = in.nextInt();\n }\n\n int fist;\n int last;\n\n //brute force will get timeout\n for(int i = 0; i< k; i++){\n fist = a[0];\n last = a[n-1];\n a[0] = last;\n for (int j = 1; j<n; j++){\n last = a[j];\n a[j] = fist;\n fist = last;\n }\n }\n\n for(int a0 = 0; a0 < q; a0++){\n System.out.println(a[in.nextInt()]);\n }\n\n\n }",
"private int bruteForce(int num, int i, int j) {\n int totalDigits = 0;\n int n = num;\n while (n > 0) {\n n = n / 10;\n totalDigits++;\n }\n if (i > totalDigits || j > totalDigits) return num;\n\n int ans = 0;\n int count = 0;\n int factor = 1;\n int iFactor = 1;\n int jFactor = 1;\n int iDigit = 0;\n int jDigit = 0;\n while (num > 0) {\n int digit = num % 10;\n count++;\n if (totalDigits - count + 1 == j) {\n jDigit = digit;\n jFactor = factor;\n } else if (totalDigits - count + 1 == i) {\n iDigit = digit;\n iFactor = factor;\n } else {\n ans += digit * factor;\n }\n factor *= 10;\n num = num / 10;\n }\n ans += iDigit * jFactor;\n ans += jDigit * iFactor;\n\n return ans;\n }",
"public static void main(String[] args) {\n int[] example1 = {1, 3, 5, 7, 9, 11, 13, 15, 17, 2, 4, 6, 8, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};\n int target1 = 59;\n int[] example2 = {2, 4, 6, 8, 10, 12, 14, 16, 18, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};\n int target2 = 59;\n int[] example3 = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 2, 4, 6, 8, 10, 12, 14, 16, 18};\n int target3 = 34;\n\n int[] result1;\n int[] result2;\n int[] result3;\n\n // 1.Brute Force\n System.out.println(\"Brute Force start\");\n long startBF = System.currentTimeMillis();\n result1 = twoSum_1(example1, target1);\n result2 = twoSum_2(example2, target2);\n result3 = twoSum_3(example3, target3);\n println(\"Brute Force result1 \", result1);\n println(\"Brute Force result2 \", result2);\n println(\"Brute Force result3 \", result3);\n System.out.println(\"Brute Force costs: \" + (System.currentTimeMillis() - startBF));\n\n // 2.Two Pass Hash Table\n System.out.println(\"Two Pass Hash Table start\");\n long startTP = System.currentTimeMillis();\n result1 = twoSum_1(example1, target1);\n result2 = twoSum_2(example2, target2);\n result3 = twoSum_3(example3, target3);\n println(\"Two Pass Hash Table start result1 \", result1);\n println(\"Two Pass Hash Table start result2 \", result2);\n println(\"Two Pass Hash Table start result3 \", result3);\n System.out.println(\"Two Pass Hash Table costs: \" + (System.currentTimeMillis() - startTP));\n\n // 3.One Pass Hash Table\n System.out.println(\"One Pass Hash Table start\");\n long startOP = System.currentTimeMillis();\n result1 = twoSum_1(example1, target1);\n result2 = twoSum_2(example2, target2);\n result3 = twoSum_3(example3, target3);\n println(\"Two Pass Hash Table start result1 \", result1);\n println(\"Two Pass Hash Table start result2 \", result2);\n println(\"Two Pass Hash Table start result3 \", result3);\n System.out.println(\"Two Pass Hash Table costs: \" + (System.currentTimeMillis() - startOP));\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 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\tArrayList<Integer> primelist = sieve(7071);\n\t\tArrayList<Double> second = new ArrayList<Double>();\n\t\tfor(int one : primelist) \n\t\t\tsecond.add(Math.pow(one, 2));\n\t\tArrayList<Double> third = new ArrayList<Double>();\n\t\tprimelist = sieve(368);\n\t\tfor(int one : primelist)\n\t\t\tthird.add(Math.pow(one, 3));\n\t\tArrayList<Double> fourth = new ArrayList<Double>();\n\t\tprimelist = sieve(84);\n\t\tfor(int one : primelist)\n\t\t\tfourth.add(Math.pow(one, 4));\n\n\t\tArrayList<Double> possibilities = new ArrayList<Double>();\n\t\tfor (int k = fourth.size() - 1; k >=0 ; k--) {\n\t\t\tfor (int j = 0; j < third.size(); j++) {\n\t\t\t\tdouble sum = fourth.get(k) + third.get(j);\n\t\t\t\tif (sum > 50000000)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tfor (int i = 0; i < second.size(); i++) {\n\t\t\t\t\t\tdouble nextsum = sum + second.get(i);\n\t\t\t\t\t\tif (nextsum > 50000000)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// I am not sure whether it can be proved that the sum is unique.\n\t\t\t\t\t\t\tif (!possibilities.contains(nextsum))\n\t\t\t\t\t\t\t\tpossibilities.add(nextsum);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint totalcount = possibilities.size();\n\t\tSystem.out.println(totalcount);\n\t}",
"public static int getBruteForce(int n){\n\t\t\n\t\tif(n<=2) \n\t\t\treturn n;\n\t\telse \n\t\t\treturn getBruteForce(n-1) + getBruteForce(n-2);\n\t}",
"private static int betterSolution(int n) {\n return n*n*n;\n }",
"public static int calculate()\n {\n final List<Integer> oneToNine = IntStream.iterate(1, n -> n + 1)\n .limit(9)\n .boxed()\n .collect(toList());\n final List<List<Integer>> permutations = HeapPermutations.of(oneToNine);\n\n // System.out.println(permutations.size());\n //2- for each permutation\n // a. find all breaking 2 points to break\n // b. check first two sections' third is equal to the last section\n // c. if yes, add combintion to result, otherwise skip\n\n return permutations.stream()\n .flatMap(toTriples()) //find all combinations xx X yy = zz\n .filter(isPandigital()) // allow pandigital tripes through\n .map(Triple::getThird) // get the product\n .distinct() // get distinct products only given the problem statement does not allow repetition (see hint)\n .mapToInt(i -> i) // convert to primitive\n .sum(); // and finally get the sum\n }",
"public static void main(String[] args) {\r\n\t\t/** 1.000\r\n\t\t * bruteforceBE Asc runtime: 1072294\r\n\t\t * bruteforceBE Desc runtime: 17835245\r\n\t\t * improvedBE Asc runtime: 3562199\r\n\t\t * improvedBE Desc runtime: 794515\r\n\t\t * linearBE Asc runtime: 1680780\r\n\t\t * linearBE Desc runtime: 1629310\r\n\t\t *\r\n\t\t * 10.000\r\n\t\t * bruteforceBE Asc runtime: 3850878\r\n\t\t * bruteforceBE Desc runtime: 113789179\r\n\t\t * improvedBE Asc runtime: 11800873\r\n\t\t * improvedBE Desc runtime: 8166293\r\n\t\t * linearBE Asc runtime: 14381578\r\n\t\t * linearBE Desc runtime: 5897656\r\n\t\t *\r\n\t\t * 100.000\r\n\t\t * bruteforceBE Asc runtime: 19376301\r\n\t\t * bruteforceBE Desc runtime: 7801237491\r\n\t\t * improvedBE Asc runtime: 52015969\r\n\t\t * improvedBE Desc runtime: 33891001\r\n\t\t * linearBE Asc runtime: 43042990\r\n\t\t * linearBE Desc runtime: 10088763\r\n\t\t *\r\n\t\t * 200.000\r\n\t\t * bruteforceBE Asc runtime: 27567279\r\n\t\t * bruteforceBE Desc runtime: 30705593272\r\n\t\t * improvedBE Asc runtime: 87086775\r\n\t\t * improvedBE Desc runtime: 51012088\r\n\t\t * linearBE Asc runtime: 61726040\r\n\t\t * linearBE Desc runtime: 56062681\r\n\t\t */\r\n\t\tArrayList<Integer> ArrayUnsortAsc = new ArrayList<>();\r\n\t\tArrayList<Integer> ArrayUnsortDesc = new ArrayList<>();\r\n\t\tint n = 1000;\r\n\r\n\t\tfor(int i = 1; i <= n; i++ ) {\r\n\t\t\tArrayUnsortAsc.add(i);\r\n\t\t}\r\n\t\tfor(int j = n; j >= 1; j-- ) {\r\n\t\t\tArrayUnsortDesc.add(j);\r\n\t\t}\r\n\r\n\t\tlong beginning = 0, end = 0;\r\n\t\tlong runtime;\r\n\t\t//1a test\r\n\t\tbeginning = System.nanoTime();\r\n\t\tbruteForceBE(ArrayUnsortAsc,ArrayUnsortAsc.size()/2);\r\n\t\tend = System.nanoTime();\r\n\t\truntime = end - beginning;\r\n\t\tSystem.out.println(\"bruteforceBE Asc runtime: \" + runtime);\r\n\r\n\t\tbeginning = System.nanoTime();\r\n\t\tbruteForceBE(ArrayUnsortDesc,ArrayUnsortDesc.size()/2);\r\n\t\tend = System.nanoTime();\r\n\t\truntime = end - beginning;\r\n\t\tSystem.out.println(\"bruteforceBE Desc runtime: \" + runtime);\r\n\r\n\r\n\t\t//1b test\r\n\t\tbeginning = System.nanoTime();\r\n\t\timprovedBE(ArrayUnsortAsc,ArrayUnsortAsc.size()/2);\r\n\t\tend = System.nanoTime();\r\n\t\truntime = end - beginning;\r\n\t\tSystem.out.println(\"improvedBE Asc runtime: \" + runtime);\r\n\r\n\t\tbeginning = System.nanoTime();\r\n\t\timprovedBE(ArrayUnsortDesc,ArrayUnsortAsc.size()/2);\r\n\t\tend = System.nanoTime();\r\n\t\truntime = end - beginning;\r\n\t\tSystem.out.println(\"improvedBE Desc runtime: \" + runtime);\r\n\r\n\r\n\t\t//1c test\r\n\t\tbeginning = System.nanoTime();\r\n\t\tlinearBE(ArrayUnsortAsc,ArrayUnsortAsc.size()/2);\r\n\t\tend = System.nanoTime();\r\n\t\truntime = end - beginning;\r\n\t\tSystem.out.println(\"linearBE Asc runtime: \" + runtime);\r\n\r\n\t\tbeginning = System.nanoTime();\r\n\t\tlinearBE(ArrayUnsortDesc,ArrayUnsortDesc.size()/2);\r\n\t\tend = System.nanoTime();\r\n\t\truntime = end - beginning;\r\n\t\tSystem.out.println(\"linearBE Desc runtime: \" + runtime);\r\n\r\n\t}",
"public static void main(String[] args) {\n \n int a;\n int b;\n int c;\n int n = 1000;\n \n // Brute force\n \n for (a = 2; a < n; a++) {\n for (b = 2; b < n; b++) {\n for (c = 2; c < n; c++) {\n if (a*a + b*b == c*c && a + b + c == 1000) {\n // 200 375 425\n System.out.println(a*b*c); // 31875000\n System.exit(0);\n }\n }\n }\n }\n }",
"public static void bruteforcer(int input) {\n\t\tfor (int length = 1; length <= input; length++) {\t\n\t\t\tSystem.out.println(\"F(\" + length + \") = \" + PE486.F_brute(length));\n\t\t}\n\n\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"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 void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint a=scan.nextInt();\n\t\tint b=scan.nextInt();\n\t\tint[] nums=new int[N];\n\t\tint[][] weight=new int[N][N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tnums[i]=scan.nextInt();\n\t\t\tweight[i][i]=nums[i];\n\t\t}\n\t\tfor(int i=0;i<N;i++){\n\t\t\tfor(int j=i+1;j<N;j++){\n\t\t\t\tweight[i][j]=weight[i][j-1]+nums[j];\n\t\t\t}\n\t\t}\n\t\tlong[][] dp=new long[N][N];\n\t\tfor(int i=2;i<=N;i++){//dis\n\t\t\tfor(int j=0;j<=N-i;j++){//start\n\t\t\t\tint end=j+i-1;\n\t\t\t\tlong min=Integer.MAX_VALUE;\n\t\t\t\tfor(int k=j;k<end;k++){\n\t\t\t\t\tmin=Math.min(min, dp[j][k]+dp[k+1][end]+weight[j][k]*a+weight[k+1][end]*b);\n\t\t\t\t}\n\t\t\t\tdp[j][end]=min;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dp[0][N-1]);\n\t\tscan.close();\n\t}",
"static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }",
"private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }",
"private static int calculate(int limit) {\n\t\tPrimeGenerator primeGenerator = new PrimeGenerator((int) Math.floor(Math.sqrt(limit)) + 10);\n\n\t\t// BitSet is used to set a given number/index if it can be produced as p1^2 + p2^3 + p4^4\n\t\t// because there are numbers that can be produced more than once\n\t\tBitSet numbers = new BitSet(limit);\n\t\tnumbers.set(0, limit, false);\n\n\t\tList<Integer> list = primeGenerator.getPrimeList();\n\n\t\tfor (int a : list) {\n\t\t\tint powera = a * a;\n\t\t\tsearchB: for (int b : list) {\n\t\t\t\tint powerb = b * b * b;\n\t\t\t\tif (powera + powerb > limit) {\n\t\t\t\t\tbreak searchB;\n\t\t\t\t}\n\n\t\t\t\tsearchC: for (int c : list) {\n\t\t\t\t\tint powerc = c * c * c * c;\n\t\t\t\t\tint sum = powera + powerb + powerc;\n\t\t\t\t\tif (sum > limit) {\n\t\t\t\t\t\tbreak searchC;\n\t\t\t\t\t}\n\t\t\t\t\t// Set the index - the number is passed\n\t\t\t\t\tnumbers.set(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set the number of set bit - the solution\n\t\treturn numbers.cardinality();\n\t}",
"int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"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 void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint t = scanner.nextInt();\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tint n = scanner.nextInt();\n\t\t\tdp = new int [n+1];\n\t\t\tArrays.fill(dp, -1);\n\t\t\tfor (int j = 1; j <= n; j++) {\n\t\t\t\tint v = scanner.nextInt();\n\t\t\t\tfind(1, j, v);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"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 }",
"public int solution(int[] A) {\n ArrayList<Integer> fibonacci = new ArrayList<>();\n\n fibonacci.add(0); // note: f(0) = 0 (as in the quesion)\n fibonacci.add(1);\n // note: using \"while\" is better than \"for\" (avoid errors)\n\n while (true) {\n int temp1 = fibonacci.get(fibonacci.size() - 1);\n int temp2 = fibonacci.get(fibonacci.size() - 2);\n\n fibonacci.add(temp1 + temp2);\n\n // if already bigger than length, then break;\n if (temp1 + temp2 > A.length) {\n break;\n }\n }\n\n // reverse \"List\": from big to small\n Collections.reverse(fibonacci);\n\n // use \"queue\" with \"point\"\n // point(x,y) = point(\"position\", \"number of steps\")\n ArrayList<Point> queue = new ArrayList<>();\n\n queue.add(new Point(-1, 0)); // position:-1, steps:0\n\n // index: the current index for queue element\n int index = 0;\n while (true) {\n // cannot take element from queue anymore\n if (index == queue.size()) {\n return -1;\n }\n\n // take element from queue\n Point current = queue.get(index);\n\n // from big to small\n for (Integer n : fibonacci) {\n int nextPosition = current.x + n;\n\n // case 1: \"reach the other side\"\n if (nextPosition == A.length) {\n // return the number of steps\n return current.y + 1;\n }\n\n // case 2: \"cannot jump\"\n // note: nextPosition < 0 (overflow, be careful)\n else if ((nextPosition > A.length) || (nextPosition < 0) || (A[nextPosition] == 0)) {\n // note: do nothing\n }\n\n // case 3: \"can jump\" (othe cases)\n else {\n // jump to next position, and step+1\n Point temp = new Point(nextPosition, current.y + 1);\n // add to queue\n queue.add(temp);\n\n A[nextPosition] = 0; // key point: for high performance~!!\n }\n }\n\n index++; // take \"next element\" from queue\n }\n }",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint t = sc.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t int n = sc.nextInt();\n\t\t long[] arr = new long[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t {\n\t\t arr[i]=sc.nextLong();\n\t\t sum=sum+arr[i];\n\t\t }\n\t\t int i, k=0;\n\t\t double x=(double)sum/n;\n for(i=0;i<n;i++){\n if(arr[i]==x) \n {\n k=i; \n break;\n \n }\n }\n if(i==n)\n System.out.println(\"Impossible\");\n else \n System.out.println(k+1);\n\t\t}\n\t\t \n\t}",
"public static void main(String[] args) {\n setStandardInput();\n\n Scanner in = new Scanner(System.in);\n\n int N = in.nextInt(); // Denoting the number of balls.\n in.skip(\"\\n\");\n\n int maxN = 100005; // The maximum number of balls.\n int maxV = 10005; // The maximum value written on a ball.\n\n int[] nums = new int[maxN];\n ArrayList<Integer> sortedBalls = new ArrayList<>();\n\n for (int i = 1; i <= N; i++) {\n nums[i] = in.nextInt();\n sortedBalls.add(nums[i]);\n }\n\n Arrays.sort(sortedBalls.toArray());\n\n int[] balls = IntStream.of(nums).distinct().toArray(); // V\n\n HashMap<Integer, Integer> H = new HashMap<>();\n for (int i = 0; i < balls.length; i++) {\n H.put(balls[i], i);\n }\n\n int[] counter = new int[maxN];\n for (int i = 1; i <= N; i++) {\n counter[H.get(nums[i])]++;\n }\n\n long[] powerOfTwo = new long[maxN]; // Maybe I can change to LONG as solution\n powerOfTwo[0] = 1L;\n for (int i = 1; i <= N; i++) {\n powerOfTwo[i] = (powerOfTwo[i - 1] << 1L) % mod;\n }\n\n // Let ways[v] denotes the number of ways modulus 10^9+7 that balls can\n // be drawn from the set, so that their GCD equals the number v.\n int[] ways = new int[maxV];\n\n for (int i = 0; i < balls.length; i++) {\n// balls\n }\n\n for (int i = 0; i < balls.length; i++) {\n\n for (int v = 1; v <= 10000; v++) {\n\n int gcd = gcd(balls[i], v);\n ways[gcd] = add(ways[gcd], (int)((powerOfTwo[counter[i]] - 1) * ways[v]));\n }\n\n ways[balls[i]] = add(ways[balls[i]], (int)powerOfTwo[counter[i]] - 1);\n }\n\n int Q = in.nextInt(); // Representing the number of GCD queries that will have to be performed.\n in.nextLine();\n\n// in.skip(\"\\n\");\n\n for (int queryNum = 1; queryNum <= Q; queryNum++) {\n\n int X = in.nextInt(); // Denoting the GCD.\n\n System.out.println(ways[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 solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }",
"static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }",
"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 void main(String[] args) throws Exception {\n \n Scanner scn = new Scanner(System.in);\n int n = scn.nextInt();\n \n long[] sp = new long[n+1];\n long[] bl = new long[n+1];\n \n sp[1] = 1;\n bl[1] =1;\n \n \n for(int i = 2; i < n+1; i++){\n sp[i] = sp[i-1] + bl[i-1];\n bl[i] = sp[i-1];\n }\n \n long way = sp[n] + bl[n];\n long bothWay = way*way;\n \n System.out.println(bothWay);\n \n }",
"public static void main(String[] arrr){\n\t\tlong mod = 10000000011L;\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i]=sc.nextInt();\n\t\t}\n\t\tlong total=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\ttotal = (total+((long)Math.pow((countBit(arr[i])),(i+1))%mod))%mod;\n\t\t}\n\t\tSystem.out.println(total);\n\t}",
"@Override\n public String solve() {\n int LIMIT = 50 * NumericHelper.ONE_MILLION_INT;\n int[] nCount = new int[LIMIT+1];\n for(long y = 1; y<= LIMIT; y++) {\n for(long d= (y+3)/4; d<y; d++) { // +3 is to make d atleast 1\n long xSq = (y+d) * (y+d);\n long ySq = y * y;\n long zSq = (y-d) * (y-d);\n\n long n = xSq - ySq - zSq;\n\n if(n<0) {\n continue;\n }\n\n if(n>=LIMIT) {\n break;\n }\n\n\n nCount[(int)n]++;\n\n }\n }\n\n int ans = 0;\n for(int i = 1; i<LIMIT; i++) {\n if(nCount[i] == 1) {\n //System.out.print(i +\",\");\n ans++;\n }\n }\n\n return Integer.toString(ans);\n }",
"public static void main(String[] args) throws IOException {\n int max = 100000;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n N = Integer.parseInt(br.readLine());\n\n int arr[] = new int[max+1];\n\n for (int p=2; p<=99999; p++)\n {\n if (arr[p] == 0)\n { arr[p] = 1;\n for (int i=p*2; i<=max; i += p) {\n arr[i]++;\n }\n }\n }\n\n int mat[][] = new int[6][max+1];\n// for (int i = 2; i < arr.length; i++) {\n// mat[arr[i]][i] = 1;\n// }\n\n for (int i = 1; i < 6; i++) {\n for (int j = 2; j < mat[0].length; j++) {\n if(arr[j] == i) {\n mat[i][j] = mat[i][j - 1]+1;\n } else {\n mat[i][j] = mat[i][j - 1];\n }\n }\n }\n\n\n for (int i = 0; i < N; i++) {\n String str[] = br.readLine().split(\" \");\n int a = Integer.parseInt(str[0]);\n int b = Integer.parseInt(str[1]);\n int k = Integer.parseInt(str[2]);\n int ans = mat[k][b]-mat[k][a-1];\n System.out.println(ans);\n }\n }",
"public static void main(String[] args) {\n\t\tint width=35;\n\t\tint length=31;\n\t\tlong[][] dp = new long[width+1][length+1];\n\t\tdp[0][0]=0;\n\t\tfor(int i=1;i<length+1;i++){\n\t\t\tif(badCheck(0,i,0,i-1)){\n\t\t\t\tdp[0][i]=0;\n\t\t\t\tfor(int k=i+1;k<length+1;k++){\n\t\t\t\t\tdp[0][k]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[0][i]=1;\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<width+1;i++){\n\t\t\tif(badCheck(i,0,i-1,0)){\n\t\t\t\tdp[i][0]=0;\n\t\t\t\tfor(int k=i+1;k<width+1;k++){\n\t\t\t\t\tdp[k][0]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[i][0]=1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=1;i<=width;i++){\n\t\t\tfor(int j=1;j<=length;j++){\n\t\t\t\tif(!badCheck(i-1,j,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i-1][j];\n\t\t\t\t}\n\t\t\t\tif(!badCheck(i,j-1,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i][j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(dp[6][6]);\n\t\t//System.out.println(dp[2][2]);\n\t\t//System.out.println(dp[1][1]);\n\t\tSystem.out.println(dp[35][31]);\n\t}",
"void solve() {\n num = new ArrayList<>();\n num.add(BigInteger.valueOf(4));\n for (int len = 2; len <= 100; len++)\n generate(\"4\", 1, len, false);\n Collections.sort(num);\n for (int tc = ii(); tc > 0; tc--) {\n long x = il();\n BigInteger X = BigInteger.valueOf(x);\n for (int i = 0; i < num.size(); i++) {\n if (num.get(i).mod(X).equals(BigInteger.ZERO)) {\n String z = num.get(i).toString();\n int end = z.lastIndexOf('4');\n int len = z.length();\n int a = 2 * (end+1);\n int b = len - end;\n out.println(a + b);\n break;\n }\n }\n }\n }",
"static void solveKTUtil(int x, int y, int movei,\n int sol[][], int xMove[],\n int yMove[], List<int[][]> result) {\n int k, next_x, next_y;\n if (movei == N * N){\n \tresult.add(copy(sol));\n return ;\n }\n\n /* Try all next moves from the current coordinate\n x, y */\n for (k = 0; k < 8; k++) {\n next_x = x + xMove[k];\n next_y = y + yMove[k];\n if (isSafe(next_x, next_y, sol)) {\n sol[next_x][next_y] = movei;\n solveKTUtil(next_x, next_y, movei + 1,\n sol, xMove, yMove, result);\n \n sol[next_x][next_y] = -1;// backtracking\n }\n }\n\n \n }",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"superbull.in\"));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"superbull.out\")));\n //Only in a tree is the winner condition(as stated in problem) satisfied\n int N = Integer.parseInt(br.readLine());\n \n long ret = 0;\n \n int[] nums = new int[N];\n for(int i = 0; i<N; i++) nums[i] = Integer.parseInt(br.readLine());\n int[] prims = new int[N]; //for dense graphs: N edges each. Loop thru edges anyways, so selection sort remove log factor\n Arrays.fill(prims, Integer.MIN_VALUE);\n prims[0] = -1;\n int curr = 0;\n \n for(int i = 0; i<N-1; i++){\n int max = Integer.MIN_VALUE;\n int next = -1;\n for(int j = 0; j<N; j++){\n if(prims[j] == -1) continue;\n \n int xor = nums[curr]^nums[j];\n prims[j] = Math.max(prims[j], xor);\n \n if(prims[j] > max){\n next = j;\n max = prims[j];\n }\n }\n ret += max;\n prims[next] = -1;\n curr = next;\n }\n pw.println(ret);\n pw.close();\n br.close();\n }",
"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}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint T;\r\n\t\tT = sc.nextInt();\r\n\t\tfor (int test_case = 1; test_case <= T; test_case++) {\r\n\t\t\tlong min = Long.MAX_VALUE;\r\n\t\t\tN = sc.nextInt();\r\n\t\t\tmap = new long[N][2];\r\n\t\t\tcombination = new ArrayList<>();\r\n\t\t\tcombination(new boolean[N], 0, N / 2);\r\n\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tmap[i][0] = sc.nextInt();\r\n\t\t\t\tmap[i][1] = sc.nextInt();\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i < combination.size(); i++) {\r\n\t\t\t\tlong x = 0;\r\n\t\t\t\tlong y = 0;\r\n\t\t\t\tboolean[] com = combination.get(i);\r\n\t\t\t\tfor (int j = 0; j < com.length; j++) {\r\n\t\t\t\t\tif (com[j]) {\r\n\t\t\t\t\t\tx += map[j][0];\r\n\t\t\t\t\t\ty += map[j][1];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tx -= map[j][0];\r\n\t\t\t\t\t\ty -= map[j][1];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tmin = Math.min(x * x + y * y, min);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + min);\r\n\t\t}\r\n\r\n\t\tsc.close();\r\n\t}",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n ArrayList<Integer> A = new ArrayList();\n System.out.println(\"Enter the array of size \"+n+\"\\n\");\n for(int i =0;i<n;i++){\n Integer num = scan.nextInt();\n A.add(num);\n }\n Collections.sort(A);\n A.replaceAll(a-> a*a);\n boolean flag = checkPyTriplets(A,n);\n System.out.println(flag);\n }",
"public static void bruteForce(int[][] myArray){\r\n\t\tint countNode = myArray.length;\r\n \t\r\n\t\tList<Integer> path = new ArrayList<Integer>();\r\n\t\t\r\n\t\tint minDistance = getMinDistance(0, countNode -1, myArray, path);\r\n\t\t\r\n\t\tSystem.out.println(\"Brute Force Algorithm:\");\r\n \tSystem.out.println(\"Minimum Cost to go from 1 to \" + countNode + \" is \" + minDistance);\r\n \t\r\n \tStringBuilder sb = new StringBuilder();\r\n \tfor(int i = 0; i < path.size(); i++)\r\n \t{\r\n \t\tsb.append(path.get(i) + 1);\r\n \t\tif(i != path.size() - 1) {\r\n \t\t\tsb.append(\" -> \"); \t\t\t\r\n \t\t}\r\n \t}\r\n \t\r\n \tSystem.out.println(\"Path from 1 to end is \" + sb.toString()); \r\n \tSystem.out.println();\r\n\t}",
"private long solveHelper(BitSet S){\n if(dp.containsKey(S))\n return dp.get(S);\n\n boolean allset = true;\n for(int i=0; i<SLen; ++i)\n allset = allset && S.get(i);\n\n if(allset)\n return 0;\n\n long minflip = INF;\n\n int idx = 0;\n for(; idx<=SLen-K; ++idx)\n if(!S.get(idx))\n break;\n\n if(idx <= SLen-K){\n track.add(S);\n S.flip(idx, idx+K);\n minflip = Math.min(minflip, solveHelper(S) + 1);\n }\n\n /*for(; idx<=SLen-K; ++idx){\n S.flip(idx, idx+K);\n if(!track.contains(S)) {\n\n track.remove(S);\n }\n S.flip(idx, idx+K);\n }*/\n\n dp.put(S, minflip);\n return minflip;\n }",
"private static Optional<Board> calculateBoardForClues(Board inputBoard, List<ClueWithCellIndices> cluesWithCellIndices, int clueIndex) {\n\n if(clueIndex >= cluesWithCellIndices.size())\n return Optional.of(inputBoard);\n\n int blockPermutationCounter = 0;\n int thisClue = cluesWithCellIndices.get(clueIndex).getClue();\n final int[] clueCellIndices = cluesWithCellIndices.get(clueIndex).getCellIndices();\n\n boolean tryNextPermutation;\n do {\n tryNextPermutation = false;\n //start with clear thisBoard\n Board thisBoard = new Board(inputBoard);\n //get block Permutation for thisClue and index = blockPermutationCounter\n List<Integer> blockPermutation = permutations.getPermutationsForClueAtIndex(thisClue, blockPermutationCounter);\n \n if(blockPermutation == null)\n //if does not exist (all Permutations used) return failure\n return Optional.empty();\n\n //check if all thisClue cells are equal to blocks from Permutation or equal 0\n for(int i = 0; i < clueCellIndices.length; i++) {\n if(thisBoard.getCell(clueCellIndices[i]) != blockPermutation.get(i))\n if(thisBoard.getCell(clueCellIndices[i]) == 0)\n //if not but they are == 0 => replace them with blocks from Permutation\n thisBoard.setCell(clueCellIndices[i], blockPermutation.get(i));\n else {\n //if not => try another Permutation\n tryNextPermutation = true;\n break;\n }\n }\n \n if(!tryNextPermutation) {\n //thisBoard is correct for thisClue\n //now try and recalculate thisBoard for next clue\n Optional<Board> opt = calculateBoardForClues(thisBoard, cluesWithCellIndices, clueIndex+1);\n if(opt.isPresent())\n //SUCCESS, calculated board for thisClue and all succesors\n return opt;\n else\n //failed, we need to try next Permutation of blocks for thisCLue\n tryNextPermutation = true;\n }\n blockPermutationCounter ++;\n } while (tryNextPermutation); //until all Permutations where tried or solution is found\n\n //should never get here\n return Optional.empty();\n }",
"public static void main(String[] args) {\n\t\tArrays.fill(arr, 1);\n\t\tlong startTime = System.nanoTime();\n\t\t// Traverse till square root of MAX\n\t\t// Using logic similar to sieve of eratosthenes to\n\t\t// populate factor sum array\n\t\tint limit = (int)Math.sqrt(MAX);\n\t\tfor (int i = 2; i <= limit; ++i) {\n\t\t\tint j = i+i;\n\t\t\tint count = 2;\n\t\t\twhile (j <= MAX){\n\t\t\t\t// As we already add count (j/i) to the factor sum when adding i,\n\t\t\t\t// we don't add when i is equal to or greater than count\n\t\t\t\tif (i < count) {\n\t\t\t\t\t// Adding i and count (j/i) to the factor sum of j\n\t\t\t\t\tarr[j] += i;\n\t\t\t\t\tarr[j] += count;\n\t\t\t\t}\n\t\t\t\tj += i;\n\t\t\t\tcount++;\n\t\t\t} \n\t\t}\n\t\t\n\t\tint count = 0;\n\t\tSystem.out.println(\"The following are amicable numbers\");\n\t\tfor (int i = 2; i <= MAX; ++i) {\n\t\t\tint num = arr[i];\n\t\t\tif (num <= MAX && num > i) {\n\t\t\t\tif (arr[num] == i) {\n\t\t\t\t\tSystem.out.println(count+\": \"+i+\" and \"+num);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong endTime = System.nanoTime();\n\t\tdouble duration = timeInSec(endTime,startTime) ;\n\t\tSystem.out.println(\"Run time \" + duration + \" : secs\");\t\t\n\t}",
"private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }",
"static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}",
"public String solve(long n, long a, long b, long c, long d, long x0, long y0, long m)\n {\n long[] count = new long[9];\n long x = x0;\n long y = y0;\n for (long t = 0; t < n; t++)\n {\n// System.out.println(x + \", \" + y);\n int i = (int) (x % 3) * 3 + (int) (y % 3);\n count[i]++;\n x = (a * x + b) % m;\n y = (c * y + d) % m;\n }\n\n long totalCount = 0;\n for (int i1 = 0; i1 < 9; i1++)\n {\n long count1 = count[i1];\n if (count1 == 0)\n {\n continue;\n }\n count[i1]--;\n for (int i2 = i1; i2 < 9; i2++)\n {\n long count2 = count[i2];\n if (count2 == 0)\n {\n continue;\n }\n count[i2]--;\n int x1 = i1 / 3;\n int y1 = i1 % 3;\n int x2 = i2 / 3;\n int y2 = i2 % 3;\n int x3 = (3 - (x1 + x2) % 3) % 3;\n int y3 = (3 - (y1 + y2) % 3) % 3;\n int i3 = (x3 % 3) * 3 + (y3 % 3);\n long count3 = count[i3];\n if (i3 >= i2 && count3 > 0)\n {\n // either i1==i2==i3 OR i1!=i2!=i3; you can never have only two i's the same.\n if (i1 == i2 && i2 == i3)\n {\n totalCount += calcCombinations(count1);//the first count value is the genuine count for that x,y coordinate.\n }\n else\n {\n totalCount += count1 * count2 * count3;\n }\n }\n count[i2]++;\n }\n count[i1]++;\n }\n\n return String.valueOf(totalCount);\n }",
"private int minJumps(int[] arr) {\n int n = arr.length;\n if (n == 1) {\n return 0;\n }\n\n //map to hold the values in the array and the indexes where they are located in\n Map<Integer, List<Integer>> map = new HashMap<>();\n\n for (int i = 0; i < arr.length; i++) {\n /*\n method checks if arr[i] exists in the map, if so, we add the current index to the list of indexes where\n arr[i] is present, otherwise we make a new entry for arr[i]\n */\n map.computeIfAbsent(arr[i], v -> new ArrayList<>()).add(i);\n }\n\n //Queue to hold the indexes j we can jump to starting from 0\n Queue<Integer> queue = new LinkedList<>();\n queue.add(0); //add the first index into the queue\n int steps = 0;\n\n while (!queue.isEmpty()) {\n steps++;\n int size = queue.size();\n\n for (int i = 0; i < size; i++) {\n int j = queue.remove(); //the current index\n\n //jump to j + 1\n if (j + 1 < n && map.containsKey(arr[j + 1])) {\n if (j + 1 == n - 1) {\n return steps;\n }\n queue.add(j + 1);\n }\n\n //jump to j - 1\n if (j - 1 >= 0 && map.containsKey(arr[j - 1])) {\n queue.add(j - 1);\n }\n\n //jump to index k --> arr[j] == arr[k]\n if (map.containsKey(arr[j])) {\n //search through the list of indexes where arr[j] is present\n for (int k : map.get(arr[j])) {\n if (k != j) {\n //if one of the indexes is the last index, we've gotten to the end, otherwise we add the index to the queue\n if (k == n - 1) {\n return steps;\n }\n queue.add(k);\n }\n }\n }\n //remove the value of arr[j] from the map to avoid overlap\n map.remove(arr[j]);\n }\n }\n return steps;\n }",
"public static void main(String[] args){\n\t\t\n\t\tfor (int i = 0; i<999999;i++) results.add(0);\t\n\n\t\tsetChain(1L);\n\t\tboolean switcher = true;\n\t\t//while switch=true ... and once chain length is added to, switch = false\n \t\tlong best = 0L;\n\t\tint index=0;\n\t\t\t\n\t\tfor (long j = 1L; j < 1000000L; j++) {\n\n\t\t\tsetCur((int)j);\n\n\t\t\tfindChain(j);//} catch(Exception e){System.out.println(\"stackOverFlow :D\");}\n\t\t\tif (getChain() > best) {best = getChain(); index=getCur();}\n\t\t\t//now store results for later use if we come across that number.\n\t\t\tresults.set(getCur()-1, (int)getChain());\t\n\t\t\tsetChain(1L); //reset\n\t\t\t/* \t\n\t\t\tswitcher=true;\n\t\t\tint i = j;\n\t\t\twhile (switcher) {\n\n\t\t\t\tif (i==1) {//results.add(chainLength); \n\t\t\t\t\tif (chainLength > best) { best=chainLength; index = j;}\n\t\t\t \tchainLength=1; switcher=false;}\n\t\n\t\t\t\telse { i=recurse(i); chainLength++; }\t\n\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n//\t\t }\n\t\t}\n\t\tSystem.out.println(index);\n\t}",
"public int solution(int[] A) {\n int res = 1;\n HashMap<Integer> map = HashMap<Integer>();\n for(int i = 0; i < A.length; i++){\n if(!map.contains(A[i])){\n map.put(A[i]);\n }\n }\n while(map.contains(res){\n res++;\n }\n return res;\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int T = scanner.nextInt();\n assert T >=1;\n assert T<=100000;\n long []numArr = new long[T];\n for(int i=0; i<T; i++) {\n numArr[i] = scanner.nextLong ();\n assert numArr[i]>=1;\n assert numArr[i]<=1000000000;\n }\n\n for (long num : numArr) {\n int i=1;\n long sum=0;\n while(i*3<num) {\n sum +=i*3;\n if(i*5<num && i%3!=0)\n sum +=i*5;\n i++;\n }\n System.out.println(sum);\n }\n }",
"public static List<Integer> solution(int n) {\n List<Integer> result = new ArrayList<Integer>();\n for (int i = 0; i < (1 << n); i++) {\n result.add(i ^ (i >> 1));\n }\n return result;\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}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}",
"public static int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }",
"public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }",
"public int solution(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search(l, r, N);\n }",
"public Collection<MatchingPair> matchingPairs(Collection<Integer> values, Integer targetSum)\n {\n HashMap<Integer, Integer> tableCompteur = new HashMap<>();\n LinkedHashMap<Integer, Integer> tablePaire = new LinkedHashMap<Integer, Integer>();\n Collection<MatchingPair> paireSansDuplication = new LinkedList();\n Collection<MatchingPair> solution = new LinkedList();\n\n // On itere sur les valeurs donnee pour savoir le compte de chaque valeur\n for (Integer valeur : values)\n {\n if (tableCompteur.containsKey(valeur))\n {\n // Partie Compteur\n Integer compteur = tableCompteur.get(valeur);\n compteur++;\n tableCompteur.put(valeur, compteur);\n }\n else {\n tableCompteur.put(valeur, 0);\n }\n\n }\n\n // On itere sur les valeurs donnee pour savoir les paires\n for (Integer element : values)\n {\n int temp = targetSum - element;\n if (tablePaire.containsKey(element))\n {\n if (tablePaire.get(element) != null)\n {\n paireSansDuplication.add(new MatchingPair(element, temp));\n }\n // si la table contient l'element on met nul pour ne pas avoir de repetition\n tablePaire.put(temp, null);\n }\n else if (!tablePaire.containsKey(element))\n {\n tablePaire.put(temp, element);\n }\n }\n\n // On trouve le minimum count entre les paire et leur compte pour tenir en compte de toutes les possibilites. Ici le meilleur cas reste O(n) ( pas de paire)\n for (MatchingPair paire : paireSansDuplication)\n {\n if (paire != null) { // verification au debug pr erreur nullpointer\n int a = tableCompteur.get(paire.first);\n int b = tableCompteur.get(paire.second);\n int minCount = Math.min(a+1, b+1);\n for (int i = 0; i < pow(minCount, 2); i++)\n {\n solution.add(new MatchingPair(paire.first, paire.second));\n }\n }\n }\n return solution;\n }",
"public int R_M(){\n\t\tBigInteger nminus1=n.subtract(BigInteger.ONE);\n\t\tdo{\n\t\t\tif(nminus1.mod(two.pow(a)).equals(BigInteger.ZERO)){\n\t\t\t\ttable.add(a);\n\t\t\t}\n\t\t\titerator++;\n\t\t\ta++;\n\t\t}while(!(two.pow(a).compareTo(n)>0));\n\t\t\n\t\ta=table.get(table.size()-1);\n\t\tBigInteger m=nminus1.divide(two.pow(a));\n\t\tint wlen=n.bitLength();\n\t\tBigInteger b;\n\t\tBigInteger z;\n\t\tfor(int i=0;i<iterations;i++){\n\t\t\tint straznik=0;\n\t\t\tint straznik1=0;\n\t\t\tdo{\n\t\t\t b=new BigInteger(wlen,new Random());\n\t\t\t}while(!(b.compareTo(BigInteger.ONE)>0) && !(b.compareTo(nminus1)<0));\n\t\t\tz=b.modPow(m, n);\n\t\t\tif(z.equals(BigInteger.ONE) || z.equals(nminus1)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int j=0;j<a-1;j++){\n\t\t\t\t\tz=z.pow(2).mod(n);\n\t\t\t\t\tif(z.equals(nminus1)){\n\t\t\t\t\t\tstraznik++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(z.equals(BigInteger.ONE)){\n\t\t\t\t\t\tstraznik1++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(straznik==1){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(straznik1==1){\n\t\t\t\t\tgetComposite();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tgetComposite();\n\t\t\treturn 0;\n\t\t}\n\t\tgetProbablyPrime();\n\t\treturn 1;\n\t\t}",
"public static void main(String[] args) {\n\t\tint i,j,z,sumA,sumB,sumPairs;\r\n\r\n\t\tsumPairs = 0;\r\n\r\n\t\tfor (i=1;i<10000;i++){\r\n\t\t sumA = 0;\r\n\t\t for (j=1;j<i;j++){\r\n\t\t if (i%j==0) \r\n\t\t sumA += j;\r\n\t\t }\r\n\r\n\t\t sumB = 0;\r\n\t\t for (z=1;z<sumA;z++){\r\n\t\t if (sumA%z==0)\r\n\t\t sumB += z;\r\n\t\t }\r\n\r\n\t\t if (sumB == i && sumB != sumA)\r\n\t\t sumPairs += i; \r\n\t\t}\r\nSystem.out.println(sumPairs);\r\n\t\t\r\n\t}",
"static long solve(long[] d) {\n int len = d.length;\n long[] dp = new long[len];\n\n Set<Long> set = new HashSet<>();\n\n for (int index1 = len - 1; index1 >= 0; index1--) {\n int count = 0;\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > d[index1]) {\n if( set.contains(d[index2] ) )continue;\n set.add(d[index2]);\n count++;\n }\n }\n set = new HashSet<>();\n dp[index1] = count;\n }\n\n long res = 0;\n Set<Long> distinct = new HashSet<>();\n for (int index1 = 0; index1 < len; index1++) {\n long curr = d[index1];\n if (distinct.contains(curr)) {\n continue;\n } else distinct.add(curr);\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > curr) {\n if (set.contains(d[index2])) continue;\n res += dp[index2];\n set.add(d[index2]);\n }\n }\n set = new HashSet<>();\n }\n\n return res;\n\n }",
"private void PuzzleSolve(int k, ArrayList<Integer> S, ArrayList<Integer> U) {\n // for every integer value in the array passed in U we will add it to the empty array and remove it from the\n // new array made called list.\n for (Integer s : U) {\n ArrayList<Integer> list = new ArrayList<>(U);\n S.add(s);\n list.remove(s);\n // If we have removed all numbers in the list and S is now full, check the evaluation.\n if (k == 1) {\n Equals(S);\n }\n // else we keep calling this method until U is empty.\n else {\n PuzzleSolve(k - 1, S, list);\n }\n // remove the value from s and then add it back to the list to test a new variation at the end.\n S.remove(s);\n list.add(s);\n }\n }",
"public static int Main()\n\t {\n\t\t int x;\n\t\t int j;\n\t\t int[] a = new int[16];\n\t\t x = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t int i = 1;\n\t\t int k = 0;\n\t\t while (x != -1)\n\t\t {\n\t\t\ta[i] = x;\n\t\t\ti++;\n\t\t if (x != 0)\n\t\t {\n\t\t\t k = i;\n\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tint sum = 0;\n\t\t\t for (i = 1;i <= k;i++)\n\t\t\t {\n\t\t\t\t for (j = 1;j <= k ;j++)\n\t\t\t\t {\n\t\t\t\t if (a[i] == 2 * a[j])\n\t\t\t\t {\n\t\t\t\t\t sum++;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\tSystem.out.print((sum - 1));\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\ti = 1;\n\t\t\t }\n\t\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t }\n\t\t\treturn 0;\n\t }",
"public static 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 }",
"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 }",
"public int solution(int[] A) {\n int L = A.length;\n int[] B = new int[L+1];\n for(int i=0; i<L; i++) {\n int t = A[i];\n B[t-1] = t;\n }\n for(int j=0; j<L; j++) {\n if(B[j] == 0) {\n return j+1;\n }\n }\n return 0;\n }",
"static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }",
"public List<Integer> majorityElementBruteForce(int[] nums) {\n List<Integer> result=new ArrayList<Integer>();\n int num=0,count=0;\n for(int i=0;i<nums.length;i++){\n num=nums[i];\n count=0;\n for(int j=0;j<nums.length;j++){\n if(nums[j]==num)count++;\n }\n if(count>nums.length/3 && !result.contains(num)){\n result.add(num);\n }\n }\n return result;\n \n }",
"static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}",
"public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }",
"@Override\n public DRFLPSolution algorithm(DRFLPInstance instance) {\n try {\n List<Future<DRFLPSolution>> futures = new ArrayList<>();\n RandomManager.reinitialize(RandomType.LEGACY, 0, this.n);\n for (int i = 0; i < n; i++) {\n int _i = i;\n futures.add(executor.submit(() -> {\n RandomManager.reset(_i);\n return alg.algorithm(instance);\n }));\n }\n var results = ConcurrencyUtil.awaitAll(futures);\n DRFLPSolution best = null;\n for(var solution: results){\n if(solution.isBetterThan(best)){\n best = solution;\n }\n }\n return best;\n } finally {\n executor.shutdown();\n }\n }",
"public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}",
"private static void findPermutations(int index, List<Integer> nums) {\n\n }",
"public boolean canPartition(int[] nums) {\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n // sum cannot be splitted evenly\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n \n // dp[i][j] represents whether 0~i-1 numbers can reach\n // weight capacity j\n boolean[][] dp = new boolean[n+1][target+1];\n \n for (int i = 1; i <= n; i++) dp[i][0] = true;\n for (int j = 1; j <= target; j++) dp[0][j] = false;\n dp[0][0] = true;\n \n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= target; j++) {\n // if don't pick current number\n dp[i][j] = dp[i-1][j];\n if (j >= nums[i-1]) {\n dp[i][j] = dp[i][j] || dp[i-1][j-nums[i-1]];\n }\n }\n }\n return dp[n][target];\n \n \n // Solution2: optimizing to save space\n // https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation/94996\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n boolean[] dp = new boolean[target+1];\n dp[0] = true;\n for (int num : nums) {\n // here is the trick to save space\n // because we have to update dp[j] based on \n // previous dp[j-num] and dp[j] from previous loop.\n // if we update dp from left to right\n // we first update smaller dp which is dp[j-num]\n // then we won't be able to get original dp[j-num] and dp[j]\n // from previous loop, and eventually we get the wrong\n // answer. But if we update dp from right to left\n // we can assure everything is based on previous state\n for (int j = target; j >= num; j--) {\n // if (j >= num) {\n dp[j] = dp[j] || dp[j-num];\n // }\n }\n }\n return dp[target];\n }",
"public static void main(String[] args) throws java.lang.Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t// System.out.println(br.readLine());\n\t\tint N = Integer.parseInt(br.readLine());\n\t\t// int N = sc.nextInt();\n\t\tlong[] one = new long[N];\n\t\tlong[] two = new long[N];\n\t\tint count = 0, countb = 0;\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tString line = br.readLine();\n\t\t\tif (line.charAt(0) == '1') {\n\t\t\t\tone[count] = Long.parseLong(line.substring(2));\n\t\t\t\tcount++;\n\t\t\t\tsum++;\n\t\t\t} else {\n\t\t\t\ttwo[countb] = Long.parseLong(line.substring(2));\n\t\t\t\tsum = sum + 2;\n\t\t\t\tcountb++;\n\t\t\t}\n\t\t}\n\t\tArrays.sort(one, 0, count);\n\t\tArrays.sort(two, 0, countb);\n\t\tint k = (int) sum;\n\t\tlong[] aans = new long[k + 1];\n\t\taans[0] = 0;\n\t\tint c = count;\n\t\tint d = countb;\n\t\tlong[] oned = Arrays.copyOf(one, c + 1);\n\t\tlong[] twod = Arrays.copyOf(two, d + 1);\n\t\tlong ans = 0;\n\t\tfor (int i = 2; i <= sum; i = i + 2) {\n\t\t\tlong temp = 0, temp1 = 0;\n\t\t\tif (count > 0)\n\t\t\t\ttemp = one[count - 1];\n\t\t\tif (count > 1) {\n\t\t\t\ttemp = one[count - 2] + temp;\n\t\t\t}\n\t\t\tif (countb > 0)\n\t\t\t\ttemp1 = two[countb - 1];\n\t\t\tif (temp < temp1) {\n\t\t\t\tans = ans + temp1;\n\t\t\t\tif (countb > 0) {\n\t\t\t\t\tcountb--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans = ans + temp;\n\t\t\t\tif (count > 1)\n\t\t\t\t\tcount = count - 2;\n\t\t\t\telse if (count > 0)\n\t\t\t\t\tcount--;\n\t\t\t}\n\t\t\taans[i] = ans;\n\t\t}\n\t\tif (c > 0) {\n\t\t\taans[1] = oned[c - 1];\n\t\t\tc--;\n\t\t} else {\n\t\t\taans[1] = 0;\n\t\t}\n\t\tone = oned;\n\t\ttwo = twod;\n\t\tcount = c;\n\t\tcountb = d;\n\t\tans = aans[1];\n\t\tfor (int i = 3; i <= sum; i = i + 2) {\n\t\t\tlong temp = 0, temp1 = 0;\n\t\t\tif (count > 0)\n\t\t\t\ttemp = one[count - 1];\n\t\t\tif (count > 1) {\n\t\t\t\ttemp = one[count - 2] + temp;\n\t\t\t}\n\t\t\tif (countb > 0)\n\t\t\t\ttemp1 = two[countb - 1];\n\t\t\tif (temp < temp1) {\n\t\t\t\tans = ans + temp1;\n\t\t\t\tif (countb > 0) {\n\t\t\t\t\tcountb--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans = ans + temp;\n\t\t\t\tif (count > 1)\n\t\t\t\t\tcount = count - 2;\n\t\t\t\telse if (count > 0)\n\t\t\t\t\tcount--;\n\t\t\t}\n\t\t\taans[i] = ans;\n\t\t}\n\t\tfor (int i = 1; i <= sum; i++) {\n\t\t\tSystem.out.print(aans[i] + \" \");\n\t\t}\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 }",
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int t= scan.nextInt();\n int min[] = new int[10001];\n Arrays.fill(min,89898);\n min[0] = 0;\n int pn[] = new int[10001];\n boolean p[] = new boolean[10001];\n for(int i=2;i<101;++i)\n {\n if(!p[i])\n for(int j=i*i;j<10001;j+=i)\n p[j] = true;\n }\n int index = 0;\n for(int i=2;i<10001;++i)\n if(!p[i])\n pn[index++] = i;\n int last = index-1;\n for(int i=0;i<=last;++i)\n {\n int temp = (int)Math.pow(pn[i], pn[i]);\n if(temp<10001)\n pn[index++] = temp;\n else break;\n }\n pn[index++] = 898989;\n Arrays.sort(pn,0,index);\n for(int i=2;i<10001;++i)\n {\n for(int j=0;pn[j]<=i;++j)\n if(min[i]>1+min[i-pn[j]])\n min[i] = 1+min[i-pn[j]];\n }\n\n StringBuilder sb = new StringBuilder(\"\");\n while(t-->0)\n {\n sb.append(min[scan.nextInt()]+\"\\n\");\n }\n System.out.println(sb);\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 }",
"static long countTriplets(List<Long> arr, long r) {\n\n long triplets = 0;\n\n HashMap<Long, LinkedList<Integer>> powIndexesMap = new HashMap<>();\n for (int i = 0; i < arr.size(); i++) {\n Long number = arr.get(i);\n Long pow = Long.valueOf((long) logb(number, r));\n LinkedList<Integer> indexes;\n if (!powIndexesMap.containsKey(pow)) {\n indexes = new LinkedList<>();\n } else {\n indexes = powIndexesMap.get(pow);\n }\n indexes.add(i);\n powIndexesMap.put(pow, indexes);\n }\n\n for (int i = 0; i < arr.size(); i++) {\n Long number = arr.get(i);\n Long pow = Long.valueOf((long) logb(number, r));\n Long pow2 = pow + 1;\n Long pow3 = pow2 + 1;\n\n if (!powIndexesMap.containsKey(pow2) || !powIndexesMap.containsKey(pow3)) {\n continue;\n }\n Integer countPow2 = powIndexesMap.get(pow2).size();\n Integer countPow3 = powIndexesMap.get(pow3).size();\n\n if (countPow2 > 0 && countPow3 > 0) {\n triplets += (countPow2 * countPow3);\n }\n }\n return triplets;\n }",
"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 bigStraightYahtzee(int... result) {\n\n Arrays.sort(result);\n\n int[] uniqueValues = IntStream.of(result).distinct().sorted().toArray();\n long noUniqVals = IntStream.of(uniqueValues).distinct().count();\n int score = 0;\n\n if (noUniqVals >= 5) {\n ArrayList<int[]> matchArrays = new ArrayList<>();\n matchArrays.add(new int[]{1, 2, 3, 4, 5});\n matchArrays.add(new int[]{2, 3, 4, 5, 6});\n\n ArrayList<int[]> resultSubArrays = new ArrayList<>();\n for (int i = 0; i < noUniqVals - 4; i++) {\n resultSubArrays.add(Arrays.copyOfRange(uniqueValues, i, i + 5));\n }\n\n for (int[] arr : resultSubArrays) {\n for (int[] match : matchArrays) {\n if (Arrays.equals(arr, match)) {\n score = 40;\n }\n\n }\n }\n }\n return score;\n }",
"public List<Integer> BruteForce(int target, int[] numbers) {\n if (target == 0)\n return List.of();\n if (target < 0)\n return null;\n\n List<Integer> minCombinationResult = null;\n\n for (int number : numbers) {\n\n List<Integer> potentialResult = BruteForce(target - number, numbers);\n if (potentialResult != null) {\n\n List<Integer> validResult = new ArrayList<Integer>(potentialResult);\n validResult.add(number);\n\n if (minCombinationResult == null || validResult.size() < minCombinationResult.size())\n minCombinationResult = validResult;\n }\n }\n\n return minCombinationResult;\n }",
"public static long solve(long[] data, long k) {\n int n = data.length;\n\n Buffer<Interval> buffer = new Buffer<>(Interval::new, x -> {}, n * 2);\n\n Randomized.shuffle(data);\n Arrays.sort(data);\n\n List<Interval> lastLevel = new ArrayList<>(n);\n List<Interval> curLevel = new ArrayList<>(n);\n lastLevel.add(newInterval(buffer, 0, n - 1));\n int level = Log2.floorLog(data[n - 1]);\n long mask = 0;\n for (; level >= 0; level--) {\n curLevel.clear();\n for (Interval interval : lastLevel) {\n int l = interval.l;\n int r = interval.r;\n int m = r;\n while (m >= l && Bits.get(data[m], level) == 1) {\n m--;\n }\n interval.m = m;\n }\n long total = 0;\n for (Interval interval : lastLevel) {\n total += (long) (interval.m - interval.l + 1) * (interval.relative.m - interval.relative.l + 1);\n total += (long) (interval.r - interval.m) * (interval.relative.r - interval.relative.m);\n }\n if (total < k) {\n k -= total;\n mask = Bits.set(mask, level, true);\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m && interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.r > interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m >= interval.relative.l) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n } else {\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n a.relative = a;\n curLevel.add(a);\n }\n if (interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = a;\n curLevel.add(a);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.l <= interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m < interval.relative.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n }\n\n for (Interval interval : lastLevel) {\n buffer.release(interval);\n }\n\n List<Interval> tmp = curLevel;\n curLevel = lastLevel;\n lastLevel = tmp;\n }\n\n return mask;\n }",
"public static void main(String[] args) {\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tN = sc.nextInt();\r\n\t\tmap = new int[N+1][N+1];\r\n\t\tvisited = new int[N+1][N+1];\r\n\t\t\r\n\t\tfor(int i=0; i<N; i++) {\r\n\t\t\tfor(int j =0; j<N; j++) {\r\n\t\t\t\t\r\n\t\t\t\tmap[i][j] = sc.nextInt();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\r\n\t\tfor(int i=1; i<N+1; i++) {\r\n\t\t\tfor(int j =1; j<N+1; j++) {\r\n\t\t\t\t\r\n\t\t\t\t\tbfs(i,j);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int[] A = new int[N];\n for(int i = 0; i < N; i++){\n A[i] = sc.nextInt();\n }\n int B = sc.nextInt();\n B = B % N;\n int[] ans = new int[N];\n for (int i = 0; i < N; ++i){\n ans[i] = A[(i - B + N) % N];\n }\n for(int i = 0; i < N; i++){\n System.out.print(ans[i] + \" \");\n }\n System.out.println();\n sc.close();\n }",
"static int yeusOptimized(){\n for(int x=9;x>=0;--x){\tint a=x*100001; //Setting up palindrome. 100001 * 9 = 900009\n for(int y=9;y>=0;--y){\tint b=a+y*10010; //Setting up the inner numbers so 10010*9. 90090 + 900009 = 990099\n for(int z=9;z>=0;--z){\tint n=b+z*1100; //Final inner numbers 9900+990099 = 999999 Palindrome\n for(int i=990;i>99;i-=11){ //Since we start with the largest palindrome, we just need to make sure it is a factor of two 3 digit numbers.\n if(n%i==0){//If there is a remainder, i isn't a factor.\n int t=n/i; //t is the palindrome divided by the factor to get the other factor\n if(t<1000)return n; //make sure that other factor was also a 3 digit number (only one check since we're starting from the maximum possible values)\n }}}}} //And return the palindrome\n return 0;}",
"private static long redelpol(int n, int k, int[][] untried, int startIndex, int endIndex, boolean[][] field)\n {\n if(k == n)\n return 1;\n\n else\n {\n long l = 0;\n\n for(int i = startIndex; i <= endIndex; ++i)\n {\n int x = untried[i][0], y = untried[i][1];\n\n field[x+n-1][y+1] = false;\n\n int cursor = 0;\n boolean a = false, b = false, c = false, d = false;\n\n if(x+1 < n && (field[x+1+n-1][y+1]))\n {\n field[x+1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x+1;\n untried[cursor+endIndex][1] = y;\n a = true;\n }\n\n if(y + 1 < n && (field[x+n-1][y+1+1]))\n {\n field[x+n-1][y+1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y+1;\n b = true;\n }\n\n if(x-1 > -n && (field[x-1+n-1][y+1]))\n {\n field[x-1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x-1;\n untried[cursor+endIndex][1] = y;\n c = true;\n }\n\n if(y-1 >= -1 && (field[x+n-1][y-1+1]))\n {\n field[x+n-1][y-1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y-1;\n d = true;\n }\n\n l += redelpol(n, k+1, untried, i+1, endIndex+cursor, field);\n\n if(a)\n field[x+1+n-1][y+1] = true;\n if(b)\n field[x+n-1][y+1+1] = true;\n if(c)\n field[x-1+n-1][y+1] = true;\n if(d)\n field[x+n-1][y-1+1] = true;\n }\n\n return l;\n }\n }",
"public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> result = new ArrayList<>(nums.length);\n\n // Prepare\n Arrays.sort(nums);\n// int firstPositiveIndex = 0;\n// int negativeLength = 0;\n// List<Integer> numsFiltered = new ArrayList<>();\n// for (int i = 0; i < nums.length; i++) {\n// if (i == 0 || i == 1 || nums[i] == 0 || (nums[i] != nums[i-2])) {\n// numsFiltered.add(nums[i]);\n// if ((nums[i] >= 0) && (firstPositiveIndex == 0)) {\n// firstPositiveIndex = numsFiltered.size() - 1;\n// }\n// if ((nums[i] <= 0)) {\n// negativeLength = numsFiltered.size();\n// }\n// }\n// }\n// nums = numsFiltered.stream().mapToInt(i->i).toArray();\n\n // Func\n\n for(int i=0; (i < nums.length) && (nums[i] <= 0); i++) {\n if (i != 0 && nums[i] == nums[i-1]) {\n continue;\n }\n for(int j=i+1; j<nums.length; j++) {\n if (j != i+1 && nums[j] == nums[j-1]) {\n continue;\n }\n for(int k=nums.length-1; (k>j) && nums[k] >= 0; k--) {\n if (k != nums.length-1 && nums[k] == nums[k+1]) {\n continue;\n }\n int sum = nums[i]+nums[j]+nums[k];\n if (sum > 0) {\n continue;\n } else if (sum < 0) {\n break;\n }\n\n List<Integer> ok = new ArrayList<>();\n ok.add(nums[i]);\n ok.add(nums[j]);\n ok.add(nums[k]);\n result.add(ok);\n break;\n }\n }\n }\n\n// System.out.println(\"Finish time = \" + (System.nanoTime() - start) / 1_000_000);\n// System.out.println(\"result size = \" + result.size());\n\n return result;\n }",
"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 }",
"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 }",
"private static long combination(int n, int r) {\n if (r > n || n <= 0 || r <= 0) {\n throw new IllegalArgumentException(\"r must be smaller than n and both n and r must be positive ints\");\n }\n long result = 1;\n for (int i = r + 1; i <= n; i++) {\n result = result * i;\n }\n long nMinusRFactorial = factorial(n - r);\n result = result / nMinusRFactorial;\n// System.out.println(\"C(\" + n + \", \" + r + \") = \" + result);\n return result;\n }",
"int help(int n, int k, int[][] map) {\n if (n <= 0 || k < 0) return 0;\n if (0 == k) return 1;\n if (1 == k) return n - 1;\n if (map[n][k] > 0) return map[n][k];\n long sum = 0;\n for (int i = 1; i <= k; i ++) {\n for (int j = 0; j < n; j ++) {\n// System.out.println(\"i = \" + i + \", j = \" + j + \", j - i = \" + (j - i) + \", j + i = \" + (j + i) + \", f0 = \" + (n - j + i - 1) + \", f1 = \" + (n - j - i - 1) + \", k - i = \" + (k - i));\n int g = 0, g0 = 0, g1 = 0;\n if (j - i >= 0) {\n g += help(n - j + i - 1, k - i, map);\n sum += g;\n// System.out.println(\"g0 = \" + g0 + \", g1 = \" + g1 + \", g = \" + g + \", sum = \" + sum);\n// System.out.println(\"-\");\n }\n }\n\n }\n// System.out.println(\"sum = \" + sum + \" ----\");\n map[n][k] = (int)sum;\n return (int)sum;\n }",
"public int solution(int[] A) {\n int mid = A.length/2, res =0;\n for (int i = 0, j = mid+1; i < mid ; i++,j++)\n\t\t\t\tres = res ^ (A[i] ^ A[j]);\n\t\treturn res ^ A[mid];\n }",
"public List<List<Integer>> threeSum(int[] nums) {\n Arrays.sort(nums);\n\n Set<List<Integer>> triplets = new HashSet<List<Integer>>();\n\n for (int i = 0; i < nums.length; i++) {\n // we choose the number at index i to pinpoint\n int a = nums[i];\n int deficit = 0 - a;\n\n // initialize our two pointers such that they're at either end of the\n // array and that they're not i\n int b = i == 0 ? 1 : 0;\n int c = i == nums.length - 1 ? nums.length - 2 : nums.length - 1;\n\n while (b < c) {\n // check if b and c add up to the deficit\n if (nums[b] + nums[c] == deficit) {\n // add it to the list\n List<Integer> triplet = new ArrayList<Integer>();\n\n triplet.add(a);\n triplet.add(nums[b]);\n triplet.add(nums[c]);\n\n Collections.sort(triplet);\n if (!triplets.contains(triplet)) {\n triplets.add(triplet);\n }\n\n\n // move pointer up and down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n\n b += 1;\n if (b == i) {\n b += 1;\n }\n } else if (nums[b] + nums[c] > deficit) {\n // if it's too large, bring top pointer down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n } else {\n // if it's too small, bring bottom pointer up\n b += 1;\n if (b == i) {\n b += 1;\n }\n }\n }\n }\n\n List<List<Integer>> last = new ArrayList<List<Integer>>(triplets);\n return last;\n }"
] | [
"0.66043943",
"0.64965016",
"0.6462854",
"0.63918704",
"0.6324118",
"0.6304337",
"0.6226967",
"0.6152146",
"0.6146216",
"0.61075544",
"0.60545206",
"0.6053729",
"0.6051144",
"0.60391474",
"0.60081697",
"0.5972351",
"0.59569865",
"0.59557855",
"0.5953613",
"0.5946184",
"0.5938741",
"0.5895904",
"0.5880611",
"0.5864519",
"0.58182997",
"0.5809431",
"0.5785675",
"0.57837343",
"0.57605433",
"0.57550895",
"0.57392496",
"0.572757",
"0.57265025",
"0.57234806",
"0.5689726",
"0.5678398",
"0.5667446",
"0.5666331",
"0.563977",
"0.5637189",
"0.56371874",
"0.5634371",
"0.5631499",
"0.5626245",
"0.5618711",
"0.5616544",
"0.56062806",
"0.5591778",
"0.5577057",
"0.5576683",
"0.556389",
"0.55585206",
"0.5553325",
"0.5552131",
"0.5551623",
"0.5542735",
"0.55420536",
"0.5537697",
"0.5533876",
"0.5528301",
"0.5522785",
"0.55207974",
"0.55029804",
"0.5494456",
"0.5494125",
"0.5493268",
"0.5491962",
"0.5487488",
"0.5482511",
"0.5480877",
"0.54739535",
"0.547329",
"0.54715246",
"0.54711574",
"0.54633766",
"0.54513764",
"0.54511017",
"0.5441092",
"0.5439647",
"0.5437738",
"0.54358387",
"0.54247385",
"0.54188037",
"0.5416985",
"0.54144126",
"0.5414331",
"0.5402316",
"0.539809",
"0.53974366",
"0.5391587",
"0.5385928",
"0.5382814",
"0.5378348",
"0.5371433",
"0.5370586",
"0.53664476",
"0.5362084",
"0.53588337",
"0.5352723",
"0.53495795"
] | 0.54997 | 63 |
Hash map solution, O(N) but with O(N) space. Find 2 items that sum to x. Store in a map xa[i] is the an a[j] such that a[j] + a[i] = x i.e. a[j] = x a[i] just look up the value. does not have to be sorted. | public static int TwoSum_hashed(int[] a, int x)
{
int count = 0;
HashMap<Integer, Integer> map = new HashMap<Integer,Integer>();
for (int i = 0; i < a.length; ++i)
{
int diff = x-a[i];
if (map.get(a[i]) != null) {
int v2 = map.get(a[i]);
System.out.println("Pair: (" + a[i] + "," + v2 + ")");
++count;
} else {
map.put(diff, a[i]);
}
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String findSum2(int[] a, int x){\n\t\tMap<Integer, Integer> cache = new HashMap<Integer, Integer>();\r\n\t\tint delta;\r\n\t\tfor(int i = 0; i < a.length; i++) {\r\n\t\t\tdelta = x - a[i];\r\n\t\t\tif(cache.get(delta) != null) {\r\n\t\t\t\treturn delta + \" \" + a[i];\r\n\t\t\t}else{\r\n\t\t\t\tcache.put(a[i], delta);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public int hash2(int x)\n {\n return ((a2*(x)+b2)%n);\n }",
"public static void pairSum(int[] input, int x){\n \tint n = input.length;\n\t\tint a, b;\n\t\tfor (int i = 0; i < n - 1; i++) { \n\t\t\tfor (int j = i + 1; j < n; j++) { \n\t\t\t\tif (input[i] + input[j] == x) {\n\t\t\t\t\tif(input[j] < input[i]) {\n\t\t\t\t\t\ta = input[j];\n\t\t\t\t\t\tb = input[i];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ta = input[i];\n\t\t\t\t\t\tb = input[j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(a + \" \" + b); \n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\t\n\t}",
"public static int TwoSum_bruteForce(int[] a,int lo, int hi, int x)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor (int i = lo; i < hi; ++i)\r\n\t\t{\r\n\t\t\tfor (int j = i+1; j < a.length; ++j)\r\n\t\t\t{\r\n\t\t\t\tif (a[i]+a[j] == x)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Pair: (\" + a[i] + \",\" + a[j] + \")\");\r\n\t\t\t\t\t++count;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public Map<Integer, Integer> findPairs( int[] input, Integer sum ) {\n HashSet<Integer> hash = new HashSet<>();\n HashMap<Integer, Integer> map = new HashMap<>();\n\n for (int i:input)\n if (!hash.contains(i)) {\n Integer y = sum - i;\n if (hash.contains(y)) {\n map.put(y, i);\n map.put(i, y);\n }\n hash.add(i);\n }\n\n return map;\n }",
"public int hash1(int x)\n {\n return ((a1*(x)+b1)%n);\n }",
"public static int TwoSum_scan(int[] a, int lo, int hi, int x)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tArrays.sort(a);\r\n\t\tfor (int i = lo, j = hi-1; i < j ; )\r\n\t\t{\r\n\t\t\tif (a[i] + a[j] == x)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Pair: (\" + a[i] + \",\" + a[j] + \")\");\r\n\t\t\t\t++i;\r\n\t\t\t\t--j;\r\n\t\t\t\t++count;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (a[i] + a[j] > x)\r\n\t\t\t{\r\n\t\t\t\t--j;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (a[i] + a[j] < x)\r\n\t\t\t{\r\n\t\t\t\t++i;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public int[] twoSum(int[] numbers, int target) {\n HashMap<Integer,Integer> map = new HashMap<>();\n\n for(int i = 0; i < numbers.length; i++){\n if(map.get(numbers[i]) != null){\n int[] res = {map.get(numbers[i]),i};\n return res;\n }\n map.put(target-numbers[i],i);\n }\n\n int[] res={};\n return res;\n}",
"public ArrayList<ArrayList<Integer>> fourSum_02(ArrayList<Integer> a, int b) {\n\t\t//List to store the result\n\t\tArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n \tint len = a.size();\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = a.get(i) + a.get(j);\n \t\t\tif(h.containsKey(b-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(b-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add( a.get(i));\n\t \t\t\t\tl.add( a.get(j));\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != a.get(i)) && (exJ != a.get(j))) {\n\t \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(a.get(i));\n\t\t \t\t\t\tl.add(a.get(j));\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tboolean flag = true;\n\t\t \t\t\t\t\n\t\t \t\t\t\tfor(ArrayList<Integer> ll : res) {\n\t\t \t\t\t\t\tif(ll.equals(l)) {\n\t\t \t\t\t\t\t\tflag = false;\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\tif(flag == true)\n\t\t \t\t\t\t\tres.add(l);\n\t\t \t\t\t\t\n\t \t\t\t\t}\n \t\t\t\t}\n \t\t\t} else\n \t\t\t\th.put(sum, new Index(a.get(i), a.get(j)));\n \t\t}\n \t}\n \treturn res;\n\t}",
"private static void second(int[] arr, int sum){\n\n Map<Integer,Boolean> map = new Hashtable<>();\n\n for(int i:arr){\n\n if (map.containsKey(sum - i)){\n System.out.println(i + \" , \" + (sum-i));\n }\n else{\n map.put(i, true);\n }\n\n }\n\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}",
"public int[] twoSumOneHash(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n int complement = target - nums[i];\n if (map.containsKey(complement)) {\n return new int[] { map.get(complement), i };\n }\n map.put(nums[i], i);\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"private static int[] twoSumMap(int[] nums, int target){\n Map<Integer, Integer> map = new HashMap<>(); //the size of the map expanded as\n //the input take place\n for (int i = 0; i < nums.length; i++){\n map.put(nums[i], i);\n }\n\n for (int i = 0; i < nums.length; i++){\n int complement = target - nums[i];\n if (map.keySet().contains(complement) && map.get(complement) != i){\n return new int[] {i, map.get(complement)};\n }\n }\n\n throw new IllegalArgumentException(\"No two sum solution\");\n\n }",
"public ArrayList<Integer> twoSum(final List<Integer> A, int B) {\n HashMap<Integer, List<Integer>> hm = new HashMap<>();\n ArrayList<Integer> solution = new ArrayList<Integer>();\n int smallestIndex2 = A.size() - 1;\n int smallestIndex1 = A.size() - 1;\n boolean containsPair = false;\n \n for (int i = 0; i < A.size(); i++) {\n if (hm.containsKey(A.get(i))) {\n List<Integer> entry = hm.get(A.get(i));\n entry.add(i);\n hm.put(A.get(i), entry);\n } else {\n List<Integer> entry = new ArrayList<>();\n entry.add(i);\n hm.put(A.get(i), entry);\n }\n }\n \n for (Map.Entry<Integer, List<Integer>> entry : hm.entrySet()) {\n int number = entry.getKey();\n List<Integer> list = entry.getValue();\n int desiredNum = B - number;\n \n if (hm.containsKey(desiredNum)) {\n List<Integer> desiredList = hm.get(desiredNum);\n Collections.sort(desiredList); // grab minimum indices\n Collections.sort(list);\n \n int desIndex = desiredList.get(0);\n int listIndex = list.get(0);\n \n if (list.size() == 1 && number*2 == B) {\n continue;\n } else {\n if (desIndex == listIndex) { // if both refer to the same index\n desIndex = desiredList.get(1);\n }\n }\n \n if (desIndex > listIndex) {\n if (desIndex < smallestIndex2) {\n smallestIndex2 = desIndex;\n smallestIndex1 = listIndex;\n } else if (desIndex == smallestIndex2) {\n if (listIndex < smallestIndex1) {\n smallestIndex1 = listIndex;\n smallestIndex2 = desIndex;\n }\n }\n } else {\n if (listIndex < smallestIndex2) {\n smallestIndex2 = listIndex;\n smallestIndex1 = desIndex;\n } else if (listIndex == smallestIndex2) {\n if (desIndex < smallestIndex1) {\n smallestIndex1 = desIndex;\n smallestIndex2 = listIndex;\n }\n }\n }\n \n containsPair = true;\n }\n }\n \n if (containsPair) {\n solution.add(smallestIndex1 + 1);\n solution.add(smallestIndex2 + 1);\n }\n \n return solution;\n }",
"public static void main(String[] args) {\n int[] a={11, 15, 6, 8, 9, 10,4};\n int sum =2;\n //SORTING AND FIND PAIRS\n /*Arrays.sort(a);\n \n int i=0,j=a.length-1;\n while(i<j)\n {\n\t if(a[i]+a[j]==sum)\n\t {\n\t\t System.out.println(\"pair is+\"+a[i]+\" \"+a[j]);\n\t\t i++;j++;\n\t\t }\n\t else if(a[i]+a[j]<sum)\n\t {\n\t\t i++;\n\t }\n\t else if(a[i]+a[j]>sum)\n\t {\n\t\t j--;\n\t }\n }*/\n //Arrays.sort(a);\n LinkedHashSet<Integer> m = new LinkedHashSet<Integer>();\n int temp;\n for(int i=0;i<a.length;i++)\n {\n\t temp=sum+a[i];\n\t if(m.contains(temp))\n\t {\n\t\t System.out.println(\"par is:\"+a[i]+\" \"+temp);\n\t }\n\t else\n\t\t m.add(a[i]);\n }\n\n\t}",
"static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}",
"public static int solution2(int[] A) {\n\n HashMap<Integer, Integer> hm = new HashMap<>();\n\n int n = A.length;\n\n // Finding frequency of each number.\n for (int i = 0; i < n; i++) {\n if (hm.containsKey(A[i]))\n hm.put(A[i], hm.get(A[i]) + 1);\n else\n hm.put(A[i], 1);\n }\n int ans = 0;\n\n // Calculating count of pairs with equal values\n for (Map.Entry<Integer, Integer> it : hm.entrySet()) {\n int count = it.getValue();\n ans += (count * (count - 1)) / 2;\n }\n return ans;\n }",
"public static int[] twoSum(int[] numbers, int target) {\n // Start typing your Java solution below\n // DO NOT write main() function\n int[] aux = new int[numbers.length];\n HashMap<Integer, Integer> valueToIndex = new HashMap<Integer, Integer>();\n for (int i = 0; i < numbers.length; i++) {\n valueToIndex.put(numbers[i], i);\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n \n int[] result = new int[2];\n if (aux[i] == aux[j]) { /* Handle duplicates */\n int first = -1, second = -1;\n for (int k = 0; k < numbers.length; k++) {\n if (numbers[k] == aux[i]) {\n if (first == -1) {\n first = k;\n } else if (second == -1) {\n second = k;\n break;\n }\n }\n }\n result[0] = first + 1;\n result[1] = second + 1;\n return result;\n }\n \n \n if (valueToIndex.get(aux[i]) < valueToIndex.get(aux[j])) {\n result[0] = valueToIndex.get(aux[i]) + 1;\n result[1] = valueToIndex.get(aux[j]) + 1;\n } else {\n result[0] = valueToIndex.get(aux[j]) + 1;\n result[1] = valueToIndex.get(aux[i]) + 1;\n }\n return result;\n }",
"public int[] twoSum(int[] numbers, int target) {\n if(numbers.length == 0){\n //empty array\n return new int[0];\n }\n HashMap<Integer,Integer> hashmapHelper = new HashMap<Integer,Integer>();\n for(int i = 0; i < numbers.length; i++){\n hashmapHelper.put(numbers[i],i+1);//put index value into hashtable\n }\n int i = 0;\n while(i<numbers.length){\n if(hashmapHelper.containsKey(target - numbers[i])){\n \n int index1 = i+1;\n int index2 = hashmapHelper.get(target - numbers[i]);\n if(index1 < index2){\n \tint[] index = {index1,index2};\n \treturn index;\n }\n else{\n int[] index = {index2,index1};\n return index;\n }\n }\n i++;\n }\n return new int[0];\n }",
"public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }",
"public int[] twoSum_1(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n int[] result = new int[2];\n for (int i = 0; i < nums.length; i++) {\n if (map.containsKey(target - nums[i])) {\n result[0] = map.get(target - nums[i]);\n result[1] = i;\n return result;\n } else {\n map.put(nums[i], i);\n }\n }\n return result;\n }",
"public int[] twoSum3(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = map.get(key);\n res[1] = i;\n return res;\n }\n map.put(nums[i], i);\n }\n return res;\n }",
"public int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> temp = new HashMap<>();\n int sub;\n //loop the int array\n for(int i=0, len=nums.length; i<len; i++){\n //calculate the sub value\n sub = target - nums[i];\n if(temp.containsKey(sub)){ // if the map contains the sub value, then return the index value into new int array\n return new int[]{temp.get(sub), i};\n }\n //if the map not contains the sub values, then store data into map\n temp.put(nums[i], i);\n }\n return new int[]{};\n }",
"public Collection<MatchingPair> matchingPairs(Collection<Integer> values, Integer targetSum)\n {\n HashMap<Integer, Integer> tableCompteur = new HashMap<>();\n LinkedHashMap<Integer, Integer> tablePaire = new LinkedHashMap<Integer, Integer>();\n Collection<MatchingPair> paireSansDuplication = new LinkedList();\n Collection<MatchingPair> solution = new LinkedList();\n\n // On itere sur les valeurs donnee pour savoir le compte de chaque valeur\n for (Integer valeur : values)\n {\n if (tableCompteur.containsKey(valeur))\n {\n // Partie Compteur\n Integer compteur = tableCompteur.get(valeur);\n compteur++;\n tableCompteur.put(valeur, compteur);\n }\n else {\n tableCompteur.put(valeur, 0);\n }\n\n }\n\n // On itere sur les valeurs donnee pour savoir les paires\n for (Integer element : values)\n {\n int temp = targetSum - element;\n if (tablePaire.containsKey(element))\n {\n if (tablePaire.get(element) != null)\n {\n paireSansDuplication.add(new MatchingPair(element, temp));\n }\n // si la table contient l'element on met nul pour ne pas avoir de repetition\n tablePaire.put(temp, null);\n }\n else if (!tablePaire.containsKey(element))\n {\n tablePaire.put(temp, element);\n }\n }\n\n // On trouve le minimum count entre les paire et leur compte pour tenir en compte de toutes les possibilites. Ici le meilleur cas reste O(n) ( pas de paire)\n for (MatchingPair paire : paireSansDuplication)\n {\n if (paire != null) { // verification au debug pr erreur nullpointer\n int a = tableCompteur.get(paire.first);\n int b = tableCompteur.get(paire.second);\n int minCount = Math.min(a+1, b+1);\n for (int i = 0; i < pow(minCount, 2); i++)\n {\n solution.add(new MatchingPair(paire.first, paire.second));\n }\n }\n }\n return solution;\n }",
"protected int myhash(T x)\r\n\t{\r\n\t\tint hashVal = x.hashCode( );\r\n\t\thashVal %= tableSize;\r\n\t\tif( hashVal < 0 )\r\n\t\t\thashVal += tableSize;\r\n\t\treturn hashVal;\r\n\t}",
"public int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int a = 0; a < nums.length; a++) {\n int other = target - nums[a];\n if (map.containsKey(other)) {\n int[] solution = new int[2];\n solution[0] = map.get(other);\n solution[1] = a;\n return solution;\n }\n else {\n map.put(nums[a], a);\n }\n }\n return new int[2];\n }",
"public static Map<Integer, Integer> findPairWithGivenSum(List<Integer> list, int sum) {\n\t\tSet<Integer> hashSet = new HashSet<>();\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\n\t\tlist.forEach(a -> {\n\t\t\tif (hashSet.contains(sum - a)) {\n\t\t\t\tmap.put(a, sum - a);\n\t\t\t} else {\n\t\t\t\thashSet.add(a);\n\t\t\t}\n\t\t});\n\n\t\tSet<Map.Entry<Integer, Integer>> entrySet = map.entrySet();\n\t\tentrySet.forEach(a -> {\n\t\t\tSystem.out.println(\"key: \" + a.getKey() + \" value: \" + a.getValue());\n\t\t});\n\n\t\treturn map;\n\t}",
"@Override\n\tpublic int hashCode() {\n\t int result = x;\n\t result = 31 * result * result + y;\n\t return result;\n\t}",
"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 hasPairWithSum(int[] input, int sum) {\n\t\tMap<Integer, Integer> map = new Hashtable<>();\n\t\tint occurence = 0;\n\t\tfor (int num : input) {\n\t\t\toccurence = 1;\n\t\t\tif (map.containsKey(num)) {\n\t\t\t\toccurence = map.get(num);\n\t\t\t\toccurence++;\n\t\t\t}\n\t\t\tmap.put(num, occurence);\n\t\t}\n\n\t\tfor (int first : input) {\n\t\t\tint second = sum - first;\n\t\t\tif (map.containsKey(second)) {\n\t\t\t\toccurence = map.get(second);\n\t\t\t\tif (occurence > 0) {\n\t\t\t\t\tif (second == first) {\n\t\t\t\t\t\tif (occurence > 1) {\n\t\t\t\t\t\t\tSystem.out.println(\"[\" + first + \",\" + second + \"]\");\n\t\t\t\t\t\t\toccurence -= 2;\n\t\t\t\t\t\t\tmap.put(first, occurence);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint firstOccurence = map.get(first);\n\t\t\t\t\t\tfirstOccurence--;\n\t\t\t\t\t\tint secondOccurence = map.get(second);\n\t\t\t\t\t\tsecondOccurence--;\n\t\t\t\t\t\tmap.put(first, firstOccurence);\n\t\t\t\t\t\tmap.put(second, secondOccurence);\n\t\t\t\t\t\tSystem.out.println(\"[\" + first + \",\" + second + \"]\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"public static int[] twoSum(int[] nums, int target) {\n HashMap<Integer, Integer> map = new HashMap<>();\n\n //initialize map with first entry of array\n int[] resultPair = {0,0};\n map.put(nums[0], 0);\n int index = 1;\n\n while (index < nums.length) {\n\n int complement = target - nums[index];\n if(map.containsKey(complement)) {\n resultPair[0] = map.get(complement);\n resultPair[1] = index;\n }\n\n map.put(nums[index], index);\n index++;\n }\n return resultPair;\n }",
"public Map<Integer, Integer> getPairs(int[] input, int sum) {\n\t\tMap<Integer, Integer> pairs = new HashMap<Integer, Integer>();\n\t\ttry {\n\t\t\t// validate the input\n\t\t\tif (input == null && input.length == 0) {\n\t\t\t\tthrow new RuntimeException(\" Invalid input \");\n\t\t\t}\n\n\t\t\tint n = input.length;\n\t\t\tint a = 0;\n\n\t\t\t// construct an arraylist from input\n\t\t\tArrayList<Integer> result = new ArrayList<Integer>();\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tresult.add(input[i]);\n\t\t\t}\n\n\t\t\t// check if pairs add to the sum\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\ta = Math.abs(sum - input[i]);\n\t\t\t\tif (result.contains(a)) {\n\t\t\t\t\tpairs.put(input[i], a);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn pairs;\n\t}",
"public static void a2v2(int[] A)\n {\n Map<Integer, List<Integer>> hashMap = new HashMap<>();\n\n insert(hashMap, 0, -1);\n\n int sum = 0;\n\n for (int i = 0; i < A.length; i++)\n {\n sum += A[i];\n\n if (hashMap.containsKey(sum))\n {\n List<Integer> list = hashMap.get(sum);\n\n // find all subarrays with the same sum\n for (Integer value: list)\n {\n System.out.println(\"Subarray [\" + (value + 1) + \"…\" +\n i + \"]\");\n }\n }\n\n // insert (sum so far, current index) pair into the hashmap\n insert(hashMap, sum, i);\n }\n }",
"public int[] twoSum2(int[] nums, int target) {\n int max = nums[0];\n int min = max;\n // get rank\n for (int e : nums) {\n if (e > max) {\n max = e;\n }\n if (e < min) {\n min = e;\n }\n }\n // show up table\n Integer[] showUpMap = new Integer[max - min + 1];\n LinkedList[] indicesMap = new LinkedList[max - min + 1];\n for (int i = 0; i < nums.length; i++) {\n showUpMap[nums[i] - min] = 1;\n if (indicesMap[nums[i] - min] == null) {\n indicesMap[nums[i] - min] = new LinkedList<Integer>();\n }\n indicesMap[nums[i] - min].add(i);\n }\n System.out.println(Arrays.toString(showUpMap));\n System.out.println(Arrays.toString(indicesMap));\n for (int i = 0; i < showUpMap.length; i++) {\n boolean show = showUpMap[i] != null;\n if (show) {\n int a = i + min;\n int need = target - a;\n if (need - min < showUpMap.length &&\n showUpMap[need - min] != null) {\n int ai = (int) indicesMap[i].get(0);\n int bi = (int) indicesMap[need - min].get(0);\n if (ai == bi) {\n bi = (int) indicesMap[need - min].get(1);\n }\n return new int[]{ai, bi};\n }\n }\n }\n return null;\n }",
"public static void main(String[] args) {\n Map<Integer, Integer> map = new HashMap<>();\r\n map.put(1, 1); // first pair\r\n map.put(2, 1); // second pair\r\n map.put(1, 3); // update the value of first pair\r\n\r\n // book - sales\r\n Book b1 = new Book(\"learn js\", 20);\r\n Book b2 = new Book(\"learn java\", 30);\r\n // we want to consider two books with same\r\n // name and same price to be matching\r\n Book b3 = new Book(\"learn css\", 10);\r\n Book b4 = new Book(\"learn css\", 10);\r\n Book b5 = new Book(\"learn csa\", 28);\r\n Map<Book, Integer> bookSales = new HashMap<>();\r\n bookSales.put(b1, 200);\r\n bookSales.put(b2, 400);\r\n bookSales.put(b3, 600);\r\n bookSales.put(b4, 300);\r\n bookSales.put(b5, 900);\r\n // 1. b3 and b4 are consider as different key\r\n // 2. HashMap does not reserve insertion order.(sorted)\r\n System.out.println(bookSales);\r\n\r\n System.out.println(b1.hashCode()); // 1836019240\r\n System.out.println(b2.hashCode()); // 325040804\r\n System.out.println(b3.hashCode() == b4.hashCode()); // false\r\n\r\n System.out.println(calc(b1.hashCode()));\r\n System.out.println(calc(b2.hashCode()));\r\n System.out.println(calc(b3.hashCode()));\r\n System.out.println(calc(b4.hashCode()));\r\n System.out.println(calc(b5.hashCode()));\r\n\r\n System.out.println(hash(b3.hashCode()));\r\n System.out.println(hash(b4.hashCode()));\r\n System.out.println(hash(b5.hashCode()));\r\n\r\n\r\n // keys' hashcode are different, indies may be different or same.\r\n // indies which are calculated are different, keys' hash must be different\r\n\r\n // TreeMap\r\n // sorted map by key\r\n // The key must be Comparable or create map with custom comparator\r\n Comparator<String> comparator = new Comparator<String>() {\r\n @Override\r\n public int compare(String o1, String o2) {\r\n return o2.compareTo(o1);\r\n }\r\n };\r\n Map<String, Integer> scores = new TreeMap<>(comparator);\r\n scores.put(\"bob\", 80);\r\n scores.put(\"alice\", 100);\r\n scores.put(\"zack\", 90);\r\n System.out.println(scores);\r\n\r\n // LinkedHashMap: sorted map by insertion order\r\n\r\n Map<String, Integer> scores1 = new HashMap<>();\r\n scores1.put(\"alice\", 90);\r\n scores1.put(\"bob\", 80);\r\n scores1.put(\"zack\", 100);\r\n // your codes start here\r\n\r\n System.out.println(scores1); // sorted by score1(value)\r\n }",
"public void add(T x) // O(n/M) nel caso medio e peggiore\n {\n // precondizioni\n if (x == null || contains(x)) \n return;\n \n // calcolo della chiave ridotta\n int kr = hash(x);\n \n // inserimento nel bucket di chiave ridotta calcolata\n ListNode n = (ListNode)v[kr]; // nodo header del bucket\n n.setElement(x); // inserimento nel nodo header\n v[kr] = new ListNode(null, n); // nuovo nodo header\n \n // incremento del numero di elementi\n size++; \n }",
"public static void fourSum(int[] data){\n HashMap<Integer,Pair> set = new HashMap<>();//integer = sum, pair are the nums\n for(int i = 0; i < data.length; i++)\n for(int j = i+1; j < data.length; j++) {\n Pair check = set.get(i+j);\n if(check != null) {\n System.out.println(\"fauifa\");\n return;\n }\n set.put(check.a()+check.b(), check);\n }\n System.out.println(\"None found.\");\n }",
"private int funcaoHash(int x) {\n\t\treturn (x % 37);\n\t}",
"@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n int lowerIndex = Math.min(index1, index2);\n int higherIndex = Math.max(index1, index2);\n result = prime * result + lowerIndex;\n result = prime * result + higherIndex;\n return result;\n }",
"int find(HashMap<Integer, Integer> hashmap, int x) {\n if (hashmap.get(x) == x) {\n return x;\n }\n else {\n return find(hashmap, hashmap.get(x));\n }\n }",
"public int[] twoSum2(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n map.put(nums[i], i);\n }\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = i;\n res[1] = map.get(key);\n return res;\n }\n }\n return res;\n }",
"private int hash(T x)\n {\n // calcolo della chiave ridotta - eventualmente negativa\n int h = x.hashCode() % v.length;\n\n // calcolo del valore assoluto\n if (h < 0)\n h = -h;\n \n return h; \n }",
"public static int method2(int temp[]) {\r\n\r\n\t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\r\n\r\n\t\tfor (int i = 0; i < temp.length; i++) {\r\n\t\t\tif (map.containsKey(temp[i])) {\r\n\t\t\t\tmap.put(temp[i], map.get(temp[i]) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tmap.put(temp[i], 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tIterator<Entry<Integer, Integer>> it = map.entrySet().iterator();\r\n\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tEntry<Integer, Integer> entry = it.next();\r\n\t\t\tint key = entry.getKey();\r\n\t\t\tint count = entry.getValue();\r\n\r\n\t\t\tif ((count % 2) != 0) {\r\n\t\t\t\treturn key;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"public static String findSum(int[] a, int x){\r\n\t\tQuickSort.quick_sort(a, 0, a.length -1);\r\n\t\tint delta, binR;\r\n\t\tfor(int i = 0; i < a.length - 1; i++){\r\n\t\t\tdelta = x - a[i];\r\n\t\t\t// we don't want to search from the beginning of the array,\r\n\t\t\t// since we should have found it earlier\r\n\t\t\tbinR = BinarySearch.search(a, delta, i + 1, a.length - 1);\r\n\t\t\tif(binR >= 0) {\r\n\t\t\t\treturn delta + \" \" + a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public int solution(int[] A) {\n Map<Integer, Integer> map = new HashMap<>();\n\n// for (int i = 0; i < A.length; i++) {\n// map.computeIfPresent(A[i], (key, value) -> ++value);\n// map.putIfAbsent(A[i], 1);\n// }\n IntStream.range(0, A.length)\n .forEach(i -> {\n map.computeIfPresent(A[i], (key, value) -> ++value);\n map.putIfAbsent(A[i], 1);\n });\n\n // TODO: case01. entrySet 2021/04/22 2:03 오후\n map.entrySet().stream()\n .filter(key -> (map.get(key.getKey()) % 2) == 1)\n .forEach(entry -> {\n System.out.println(entry.getKey());\n });\n\n // TODO: case02. entrySet 2021/04/22 2:03 오후\n map.entrySet().stream()\n .map(Map.Entry::getKey)\n .filter(key -> map.get(key) % 2 == 1)\n .forEach(System.out::println);\n\n // TODO: case03. keySet 2021/04/22 2:04 오후\n map.keySet().stream()\n .filter(value -> map.get(value) % 2 == 1)\n .forEach(System.out::println);\n\n // TODO: case04. keySet 2021/04/22 2:04 오후\n return map.keySet().stream()\n .filter(value -> map.get(value) % 2 == 1)\n .findFirst()\n .get();\n\n\n// int result = 0;\n// for (Integer i : map.keySet()) {\n// int value = map.get(i);\n//\n// System.out.println(value);\n// if (value % 2 == 1) {\n// result = i;\n// break;\n// }\n// }\n//\n// return result;\n }",
"public int hashCode()\n\t{\n\t\treturn y<<16+x;\n\t}",
"public int[] twoSum2(int[] numbers, int target) {\n HashMap<Integer, Integer> hm = new HashMap<>();\n int[] result = null;\n for (int i = 0; i < numbers.length; i++) {\n if (hm.containsKey(target - numbers[i])) {\n int j = hm.get(target - numbers[i]);\n if (i != j) {\n result = new int[] {j + 1, i + 1};\n return result;\n }\n }\n hm.put(numbers[i], i);\n }\n return result;\n }",
"static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }",
"@Override\n public int hashCode() {\n return Short.toUnsignedInt(x) + (Short.toUnsignedInt(y)<<16);\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tArrayList<Integer> a = new ArrayList<>();\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\ta.add(sc.nextInt());\r\n\t\t}\r\n\t\tint b = sc.nextInt();\r\n\r\n\t\tHashMap<Integer, Integer> d = new HashMap<>();\r\n\t\tfor (int i = 0; i < a.size(); i++) {\r\n\t\t\tint c = b - a.get(i);\r\n\t\t\tif (a.contains(c)) {\r\n\t\t\t\td.put(a.get(i), c);\r\n\t\t\t\ta.remove(i);\r\n\t\t\t\ta.add(i, 0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(d.toString());\r\n\r\n\t}",
"@Override\n public int hashCode() {\n int result = 17;\n result = 31 * result + x + y;\n return result;\n }",
"private int pairContains(HashMap<Integer,HashSet<Integer>> pairs, int k1, int k2){\n\t\t\n\t\t\n\t\t\tif(pairs.containsKey(k1))\n\t\t\t\tif(pairs.get(k1).contains(k2))\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t}",
"public int findLHSWithHashtable(int[] nums) {\n if (nums.length < 2)\n return 0;\n int ans = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n map.put(nums[i], map.getOrDefault(nums[i], 0) + 1);\n }\n for (int key : map.keySet()) {\n if (map.containsKey(key - 1))\n ans = ans < map.get(key) + map.get(key - 1) ? map.get(key) + map.get(key - 1) : ans;\n if (map.containsKey(key + 1))\n ans = ans < map.get(key) + map.get(key + 1) ? map.get(key) + map.get(key + 1) : ans;\n }\n return ans;\n }",
"public int[] twoSum(int[] numbers, int target) {\n\t\tHashMap<Integer, Integer> map = new HashMap<>();\n\t\t\n\t\t//go thru the array\n\t\tfor(int i = 0; i < numbers.length; i++) {\n\t\t\t//if the map contains the other number\n\t\t\tif(map.containsKey(target - numbers[i])) {\n\t\t\t\treturn new int[] { map.get(target-numbers[i]) + 1, i + 1};\n\t\t\t}\n\t\t\t//if not then put\n\t\t\tmap.put(numbers[i], i);\n\t\t}\n\t\t\n\t\tthrow new IllegalArgumentException(\"No two sum solution\");\n\t}",
"public static void main(String[] args) {\n\t\tint i,j,z,sumA,sumB,sumPairs;\r\n\r\n\t\tsumPairs = 0;\r\n\r\n\t\tfor (i=1;i<10000;i++){\r\n\t\t sumA = 0;\r\n\t\t for (j=1;j<i;j++){\r\n\t\t if (i%j==0) \r\n\t\t sumA += j;\r\n\t\t }\r\n\r\n\t\t sumB = 0;\r\n\t\t for (z=1;z<sumA;z++){\r\n\t\t if (sumA%z==0)\r\n\t\t sumB += z;\r\n\t\t }\r\n\r\n\t\t if (sumB == i && sumB != sumA)\r\n\t\t sumPairs += i; \r\n\t\t}\r\nSystem.out.println(sumPairs);\r\n\t\t\r\n\t}",
"@Override\n\tpublic int hashCode() {\n\t\treturn map.hashCode() ^ y() << 16 ^ x();\n\t}",
"public int getHash(int key, int i, int max);",
"public int[] twoSum(int[] nums, int target) {\n // create a hashtable\n HashMap<Integer, Integer> hashMap = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n // add the element plus corresponding index to the hashtable\n hashMap.put(nums[i], i);\n }\n for (int i = 0; i < nums.length; i++) {\n int compl = target - nums[i];\n // check if the complement exists in our hashtable && its value ins't the index corresponding to nums[i] i.e not a repeat of nums[i]\n if (hashMap.containsKey(compl) && hashMap.get(compl) != i) {\n return new int[] {i, hashMap.get(compl)};\n }\n }\n return new int[]{-1, -1};\n }",
"int CalcKey(int g, int x, int n)\r\n {\r\n int rtn = 1;\r\n for(int i = 0; i < x; i++)\r\n rtn = (rtn * g) % n;\r\n return rtn;\r\n }",
"public void add(int x){\n\t\tint[] index = functions(x);// get the indexes by send the value to the hash functions\n\t\tfor(int i=0; i<index.length; i++)\n\t\t\tflags[index[i]] = true; // change the relevant flags to be true\n\t}",
"static void findTwoSum(List<List<Integer>> list, int[] nums, int k) {\n \tint target = 0 - nums[k]; // 7 -> check a + b = 7 (target)\n int fi = 0;\n int la = k - 1;\n\n while (fi < la) {\n if (nums[fi] + nums[la] == target) {\n list.add(Arrays.asList(nums[fi], nums[la], nums[k]));\n while (fi < nums.length - 1 && nums[fi] == nums[fi + 1]) {\n \tfi++;\n }\n fi++;\n }\n else if (nums[fi] + nums[la] < target)\n fi++;\n else\n la--;\n }\n }",
"public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}",
"public static String findSum3(int[] a, int x){\r\n\t\t// scan the array, \r\n\t\tint begin = 0, end = a.length -1, sum;\r\n\t\twhile(begin < a.length -1 && (end >= 0)){\r\n\t\t\tsum = a[begin] + a[end];\r\n\t\t\tif(sum < x){\r\n\t\t\t\tbegin++;\r\n\t\t\t}else if(sum > x){\r\n\t\t\t\tend--;\r\n\t\t\t}else {\r\n\t\t\t\treturn a[begin] + \" \" + a[end];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public static int binSearch(int[] a, int x) {\r\n int l = 0;\r\n int r = a.length;\r\n while (l != r) {\r\n // inv: l <= res <= r\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n r = m;\r\n }\r\n else {\r\n l = m + 1;\r\n }\r\n }\r\n return r;\r\n }",
"private int getSum(int[] freq, int i, int j) {\n int sum = 0;\n for (int x = i; x <= j; x++) {\n sum += freq[x];\n }\n return sum;\n }",
"private int Sum1(int x) {\n int a = ROTR(6, x);\n int b = ROTR(11, x);\n int c = ROTR(25, x);\n int ret = a ^ b ^ c;\n return ret;\n }",
"private static int solution2(int[] A) {\n Map<Integer, Integer> map = new HashMap<>();\n\n for(int i=0; i<A.length; i++){\n if(map.get(A[i]) != null){\n int counter = map.get(A[i]) + 1;\n map.put(A[i], counter);\n } else {\n map.put(A[i], 1);\n }\n }\n\n for (Map.Entry<Integer, Integer> pair : map.entrySet()) {\n if(pair.getValue() % 2 != 0) {\n return pair.getKey();\n }\n }\n\n return -1;\n }",
"public static int getTotalX(List<Integer> a, List<Integer> b) {\n\t List<Integer> num=new ArrayList<>();\n\t for(int ind=a.get(a.size()-1);ind<=b.get(0);ind++){\n\t int count=0;\n\t for(int ind1=0;ind1<a.size();ind1++){\n\t if(ind%a.get(ind1)==0){\n\t count++;\n\t }else{\n\t break;\n\t }\n\t }if(count==a.size()){\n\t num.add(ind);\n\t }\n\t }\n\t for(int ind=0;ind<num.size();ind++){\n\t for(int ind1=0;ind1<b.size();ind1++){\n\t if(b.get(ind1)%num.get(ind)!=0){\n\t num.remove(ind);\n\t break;\n\t }\n\t }\n\t }\n\t System.out.println(num);\n\t return num.size();\n\n\t }",
"public static void main(String[] args) {\n\t\tArrayList<Integer> primelist = sieve(7071);\n\t\tArrayList<Double> second = new ArrayList<Double>();\n\t\tfor(int one : primelist) \n\t\t\tsecond.add(Math.pow(one, 2));\n\t\tArrayList<Double> third = new ArrayList<Double>();\n\t\tprimelist = sieve(368);\n\t\tfor(int one : primelist)\n\t\t\tthird.add(Math.pow(one, 3));\n\t\tArrayList<Double> fourth = new ArrayList<Double>();\n\t\tprimelist = sieve(84);\n\t\tfor(int one : primelist)\n\t\t\tfourth.add(Math.pow(one, 4));\n\n\t\tArrayList<Double> possibilities = new ArrayList<Double>();\n\t\tfor (int k = fourth.size() - 1; k >=0 ; k--) {\n\t\t\tfor (int j = 0; j < third.size(); j++) {\n\t\t\t\tdouble sum = fourth.get(k) + third.get(j);\n\t\t\t\tif (sum > 50000000)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tfor (int i = 0; i < second.size(); i++) {\n\t\t\t\t\t\tdouble nextsum = sum + second.get(i);\n\t\t\t\t\t\tif (nextsum > 50000000)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// I am not sure whether it can be proved that the sum is unique.\n\t\t\t\t\t\t\tif (!possibilities.contains(nextsum))\n\t\t\t\t\t\t\t\tpossibilities.add(nextsum);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint totalcount = possibilities.size();\n\t\tSystem.out.println(totalcount);\n\t}",
"private static int pairwise(int[] input, int target) {\n\n Set<Integer> set = new HashSet<>();\n int indicesSum = 0;\n for(int i = 0; i < input.length; i++) {\n for(int j = i+1; j < input.length; j++) {\n if(isUseful(input, target, set, i, j)) {\n indicesSum += i + j;\n set.add(i);\n set.add(j);\n }\n }\n }\n return indicesSum;\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 }",
"public int[] twoSum(int[] numbers, int target) {\n\t\tif (numbers.length == 0) {\n\t\t\treturn null;\n\t\t}\n\t\tHashtable<Integer, Integer> hash = new Hashtable<Integer, Integer>();\n\t\tint[] result = new int[2];\n\t\tint small = 0;\n\t\tint big = 0;\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\tif (!hash.containsKey(numbers[i])) {\n\t\t\t\thash.put(target - numbers[i], i);\n\t\t\t} else {\n\t\t\t\tsmall = i < hash.get(numbers[i]) ? i : hash.get(numbers[i]);\n\t\t\t\tbig = small == i ? hash.get(numbers[i]) : i;\n\n\t\t\t}\n\t\t}\n\t\tresult[0] = small + 1;\n\t\tresult[1] = big + 1;\n\t\treturn result;\n\n\t}",
"public int GetSum(int a, int b) {\n\t\tint result = 0;\r\n\t\tint number = 0;\r\n\t\t\r\n\t\t//If a is greater than b, I will loop through all the integers between them, starting by b and summing 1 in every step of the loop \r\n\t\tif (a > b) {\r\n\r\n\t\t\tfor (int x = b; x <= a; x++) {\r\n\t\t\t\t//The number variable will be the x step of the loop, starting from b\r\n\t\t\t\tnumber = x;\r\n\t\t\t\tresult += number;\r\n\t\t\t\tnumber++;\r\n\t\t\t}\r\n\t\t//It will be similar if a is greater than b, but starting counting from a\r\n\t\t} else if (a < b) {\r\n\t\t\tfor (int x = a; x <= b; x++) {\r\n\t\t\t\tnumber = x;\r\n\t\t\t\tresult += number;\r\n\t\t\t\tnumber++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t//If the two values are similar, the method just return one of them, ie a:\r\n\t\telse {\r\n\t\t\tresult = a;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t//Finally the method return the result.\r\n\t\treturn result;\r\n\r\n\t}",
"public static void getPairs(int[] input, int sum)\r\n\t{\r\n\t\tjava.util.Arrays.sort(input);\r\n\t\tint start = 0;\r\n\t\tint end = input.length-1;\r\n\r\n\t\twhile(start<end)\r\n\t\t{\r\n\t\t\tint s = input[start]+input[end];\r\n\t\t\tif(s == sum){\r\n\t\t\t\tSystem.out.println(input[start] +\",\"+input[end]);\r\n\t\t\t\tstart++;\r\n\t\t\t\tend--;\r\n\t\t\t}else{ \r\n\t\t\t\tif(s < sum){\r\n\t\t\t start++;\r\n\t\t\t\t}else{\r\n\t\t \t end--;\r\n\t\t }\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}",
"int equalPairOfBits(int n, int m) {\n return ((BinaryOperator<Integer>) (a, b) -> {\n String one = Integer.toBinaryString(a);\n String two = Integer.toBinaryString(b);\n //FUCK YO SHIT, THIS IS STUPID\n int max = Math.max(one.length(), two.length());\n if (max != one.length())\n one = IntStream.range(0, max - one.length())\n .mapToObj(aq -> \"0\")\n .reduce(\"\", (r, c) -> r + c) + one;\n if (max != two.length())\n two = IntStream.range(0, max - two.length())\n .mapToObj(aq -> \"0\")\n .reduce(\"\", (r, c) -> r + c) + two;\n for (int i = max - 1, j = 0; i > -1; --i, j++) {\n if (one.charAt(i) == two.charAt(i))\n return (int) Math.pow(2, j);\n }\n return 0;\n }).apply(n, m);\n }",
"private void createBitStremMap(){\n itemListMap = new HashMap<>();\n \n for (ArrayList<Integer> transactions_set1 : transactions_set) {\n ArrayList curr_tr = (ArrayList) transactions_set1;\n if(curr_tr.size() >= min_itemset_size_K) \n for (Object curr_tr1 : curr_tr) {\n int item = (int) curr_tr1;\n itemListMap.put(item, itemListMap.getOrDefault(item, 0)+1);\n }\n }\n \n // 3. Remove items without minimum support\n itemListMap.values().removeIf(val -> val<min_sup);\n \n // 4. Sort the map to a set of entries\n Set<Map.Entry<Integer, Integer>> set = itemListMap.entrySet();\n frequentItemListSetLenOne = new ArrayList<>(set);\n Collections.sort( frequentItemListSetLenOne, new Comparator<Map.Entry<Integer, Integer>>(){\n @Override\n public int compare( Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2 )\n {\n return (o2.getValue()).compareTo( o1.getValue() );\n }\n });\n\n // 5.\n itemIndex = new HashMap<>();\n for(Map.Entry<Integer, Integer> entry : frequentItemListSetLenOne){\n itemIndex.put(entry.getKey(), itemIndex.size());\n }\n\n // 6.\n bitsetLen = frequentItemListSetLenOne.size();\n }",
"public int solution(int[] A) {\n int res = 1;\n HashMap<Integer> map = HashMap<Integer>();\n for(int i = 0; i < A.length; i++){\n if(!map.contains(A[i])){\n map.put(A[i]);\n }\n }\n while(map.contains(res){\n res++;\n }\n return res;\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 }",
"private static int computeHash(int par0)\n {\n par0 ^= par0 >>> 20 ^ par0 >>> 12;\n return par0 ^ par0 >>> 7 ^ par0 >>> 4;\n }",
"public void search() {\n while (!done) {\n num2 = mNums.get(cntr);\n num1 = mSum - num2;\n\n if (mKeys.contains(num1)) {\n System.out.printf(\"We found our pair!...%d and %d\\n\\n\",num1,num2);\n done = true;\n } //end if\n\n mKeys.add(num2);\n cntr++;\n\n if (cntr > mNums.size()) {\n System.out.println(\"Unable to find a matching pair of Integers. Sorry :(\\n\");\n done = true;\n }\n } //end while\n }",
"private boolean testHash(int a, int b, int n, int k)\n {\n\n int [] testList = new int[n]; // Each value Automatically intialized to 0\n int hashValue;\n\n // Mark values reached by hash function\n for( int i = 0; i < k*n ; i++)\n {\n hashValue = (a*i + b)%n;\n testList[hashValue]++;\n }\n\n // Test if a uniform distribution is found\n for(int i = 0; i < n; i++)\n if(testList[i] != k)\n return false;\n\n return true;\n }",
"private static int[] add(int[] x, int[] y) {\n // If x is shorter, swap the two arrays\n if (x.length < y.length) {\n int[] tmp = x;\n x = y;\n y = tmp;\n }\n\n int xIndex = x.length;\n int yIndex = y.length;\n int result[] = new int[xIndex];\n long sum = 0;\n if (yIndex == 1) {\n sum = (x[--xIndex] & LONG_MASK) + (y[0] & LONG_MASK) ;\n result[xIndex] = (int)sum;\n } else {\n // Add common parts of both numbers\n while (yIndex > 0) {\n sum = (x[--xIndex] & LONG_MASK) +\n (y[--yIndex] & LONG_MASK) + (sum >>> 32);\n result[xIndex] = (int)sum;\n }\n }\n // Copy remainder of longer number while carry propagation is required\n boolean carry = (sum >>> 32 != 0);\n while (xIndex > 0 && carry)\n carry = ((result[--xIndex] = x[xIndex] + 1) == 0);\n\n // Copy remainder of longer number\n while (xIndex > 0)\n result[--xIndex] = x[xIndex];\n\n // Grow result if necessary\n if (carry) {\n int bigger[] = new int[result.length + 1];\n System.arraycopy(result, 0, bigger, 1, result.length);\n bigger[0] = 0x01;\n return bigger;\n }\n return result;\n }",
"public static int[] twoSum3(int[] nums, int target){\n Map<Integer, Integer> map = new HashMap<>();\n\n for (int i = 0; i < nums.length; i++){\n int complement = target - nums[i];\n if (map.containsKey(complement) && map.get(complement) != i){\n return new int[] {map.get(complement), i};\n }\n map.put(nums[i], i);\n }\n\n throw new IllegalArgumentException(\"No two sum solution.\");\n\n }",
"static public int[] twoSum(int[] nums, int target) {\n\n\t\tint[] output=new int[2];\n\t\tArrays.fill(output, -1);\n\n\t\tif(nums.length<=1)\n\t\t\treturn output;\n\n\t\tint n=nums.length;\n\t\tMap<Integer, Integer> map=new HashMap<>();\n\n\n\t\tfor(int i=0; i<n; i++)\n\t\t\tmap.put(nums[i], i);\n\n\t\tfor(int j=0; j<n; j++){\n\t\t\tint a=nums[j];\n\t\t\tif(map.containsKey(target-a)){\n\t\t\t\tif(j != map.get(target-a)){\n\t\t\t\t\toutput[0]=j;\n\t\t\t\t\toutput[1]=map.get(target-a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}",
"static int distributeCandy(int[] score) {\n java.util.TreeMap<Integer,Integer> candcalmap=new java.util.TreeMap<Integer,Integer>();\n int totcand=0,numcan=1;\n /* for(int indx=1;indx<score.length;indx++)\n {\n while(score[indx-1]<(indx<score.length?score[indx]:Integer.MAX_VALUE))\n {\n numcan++;\n indx++;\n totcand+=numcan;\n //System.out.println(numcan+\"-\"+indx+\":\"+totcand);\n if(indx==score.length)\n break;\n }\n numcan=1;\n totcand+=numcan;\n \n }\n*/\tfor(int sc:score)\n {\n candcalmap.put(sc,candcalmap.get(sc)==null?1:candcalmap.get(sc)+1);\n }\n for(Map.Entry<Integer,Integer> e:candcalmap.entrySet())\n {\n totcand+=numcan*e.getValue();\n// System.out.println(e.getValue()+\"-\"+e.getKey()+\":\"+numcan+\" \"+totcand);\n numcan++;\n }\n return totcand;\n }",
"public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n //Create the dictionary of sum and list of pairs of indexes\n HashMap<Integer, ArrayList<ArrayList<Integer>>> dict = new HashMap<>();\n for (int i = 0; i < num.length - 1; i++) {\n for (int j = i + 1; j < num.length; j++) {\n int sum = num[i] + num[j];\n ArrayList<Integer> pair = new ArrayList<>();\n pair.add(i);\n pair.add(j);\n if (!dict.containsKey(sum)) {\n ArrayList<ArrayList<Integer>> value = new ArrayList<ArrayList<Integer>>();\n value.add(pair);\n dict.put(sum, value);\n } else {\n ArrayList<ArrayList<Integer>> value = dict.get(sum);\n value.add(pair);\n }\n }\n }\n //Use HashSet to prevent duplicate result.\n HashSet<ArrayList<Integer>> set = new HashSet<>();\n for (Integer sumA : dict.keySet()) {\n if (dict.containsKey(target - sumA)) {\n \n ArrayList<ArrayList<Integer>> pairsA = dict.get(sumA);\n ArrayList<ArrayList<Integer>> pairsB = dict.get(target - sumA);\n \n \n for (ArrayList<Integer> pair1 : pairsA) {\n for (ArrayList<Integer> pair2 : pairsB) {\n \n //Make sure there is no same element in two pairs.\n if (pair1.contains(pair2.get(0)) || pair1.contains(pair2.get(1)))\n continue;\n \n ArrayList<Integer> tmpResult = new ArrayList<>(4);\n tmpResult.add(num[pair1.get(0)]);\n tmpResult.add(num[pair1.get(1)]);\n tmpResult.add(num[pair2.get(0)]);\n tmpResult.add(num[pair2.get(1)]);\n //Sort the list and add it into the set.\n Collections.sort(tmpResult);\n set.add(tmpResult);\n }\n }\n }\n }\n ArrayList<ArrayList<Integer>> ret = new ArrayList<ArrayList<Integer>>();\n ret.addAll(set); // from hashset to arraylist \n return ret;\n }",
"public int findPairs(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Set<Integer> unique = new HashSet<>();\n Set<Integer> duplicate = new HashSet<>();\n for (int n : nums) {\n if (!unique.add(n)) {\n duplicate.add(n);\n }\n }\n if (k == 0) {\n return duplicate.size();\n }\n int count = 0;\n for (int v : unique) {\n if (unique.contains(v + k)) {\n count += 1;\n }\n }\n return count;\n }",
"private int locate (List<Integer> list, int hash) {\n\t\tif (list.size() == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tint index_a = -1;\n\t\tint index_b = list.size();\n\t\tfloat value_a = (float)list.get(index_a+1);\n\t\tfloat value_b = (float)list.get(index_b-1);\n\t\tfloat hash_float = (float)hash;\n\n\t\tif (hash <= value_a) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (hash > value_b) {\n\t\t\treturn list.size();\n\t\t}\n\n\t\twhile (index_b - index_a > 1) {\n\t\t\tint index_mid = index_a+(int)((float)(index_b-index_a)*(hash_float-value_a)/(value_b-value_a));\n\t\t\tif (index_mid == index_a) {\n\t\t\t\tindex_mid++;\n\t\t\t} else if (index_mid == index_b) {\n\t\t\t\tindex_mid--;\n\t\t\t}\n\t\t\tif (hash >= list.get(index_mid)) {\n\t\t\t\tindex_a = index_mid;\n\t\t\t\tvalue_a = list.get(index_a);\n\t\t\t} else {\n\t\t\t\tindex_b = index_mid;\n\t\t\t\tvalue_b = list.get(index_b);\n\t\t\t}\n\t\t}\n\t\tif (hash == list.get(index_a)) {\n\t\t\treturn index_a;\n\t\t}\n\t\treturn index_b;\n\t}",
"public int binarySearchAlgo(int a[], int x) {\n\t\tint low = 0;\n\t\tint high = a.length - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) / 2;\n\t\t\tif (a[mid] == x) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (x > a[mid]) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else /* if(a[mid] < x) */ {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"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 }",
"public static void twoSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n int z1, int z2) {\n\n if (low >= high)\n return;\n\n if (2 * nums[low] > target || 2 * nums[high] < target)\n return;\n\n int i = low, j = high, sum, x;\n while (i < j) {\n sum = nums[i] + nums[j];\n if (sum == target) {\n fourSumList.add(Arrays.asList(z1, z2, nums[i], nums[j]));\n\n x = nums[i];\n while (++i < j && x == nums[i]) // avoid duplicate\n ;\n x = nums[j];\n while (i < --j && x == nums[j]) // avoid duplicate\n ;\n }\n if (sum < target)\n i++;\n if (sum > target)\n j--;\n }\n return;\n}",
"private int findPos( AnyType x )\n {\n int offset = 1;\n int currentPos = myhash( x );\n \n while( array[ currentPos ] != null &&\n !array[ currentPos ].key.equals( x ) )\n {\n currentPos += offset; // Linear probing.\n if( currentPos >= array.length )\n currentPos -= array.length;\n }\n \n return currentPos;\n }",
"public int solution(int K, int[] A) {\n HashMap<Integer,ArrayList<Integer>> map = new HashMap<Integer,ArrayList<Integer>>();\n \n int dup=0,nonDup=0;\n for (int i=0;i< A.length;i++){\n if(2*A[i]==K){\n if(!map.containsKey(A[i])){\n dup++;\n map.put(A[i],new ArrayList<Integer>());\n }\n continue;\n }\n \n if(!map.containsKey(A[i])){\n \tmap.put(A[i],new ArrayList<Integer>());\n }\n map.get(A[i]).add(i);\n nonDup+=map.get(K-A[i]).size();\n }\n return nonDup*2+dup;\n }",
"public int hash(T input);",
"private static int findPairs(int[] nums, int k) {\n if(nums == null || nums.length == 0 || k < 0)\n return 0;\n\n int count = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i : nums)\n map.put(i, map.getOrDefault(i, 0) + 1);\n\n for(Map.Entry<Integer, Integer> entry : map.entrySet()) {\n if(k == 0) {\n if(entry.getValue() >= 2)\n count++;\n } else {\n if(map.containsKey(entry.getKey() + k))\n count++;\n }\n }\n return count;\n }",
"@Override\r\n\t\t\t\tpublic int hashCode() {\r\n\t\t\t\t\t// Método hashcode aleatório projetado para ser geralmente único\r\n\t\t\t\t\treturn this.x + this.y * 256;\r\n\t\t\t\t}",
"@Override\n\t\tpublic int hashCode() {\n\t\t\treturn (int) (this.sum * 100 + this.index);\n\t\t}",
"public List<List<Integer>> fourSum_LeetCode(int[] nums, int target) {\n \tList<List<Integer>> res = new ArrayList<List<Integer>>();\n \tint len = nums.length;\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = nums[i] + nums[j];\n \t\t\tif(h.containsKey(target-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(target-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add(nums[i]);\n\t \t\t\t\tl.add(nums[j]);\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != nums[i]) && (exJ != nums[j])) {\n\t \t\t\t\t\tList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(nums[i]);\n\t\t \t\t\t\tl.add(nums[j]);\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tfor(List<Integer> ll : res) {\n\t\t \t\t\t\t\tif(!ll.equals(l))\n\t\t \t\t\t\t\t\tres.add(l);\n\t\t \t\t\t\t}\n\t\t \t\t\t\t\n\t \t\t\t\t}\n \t\t\t\t}\n \t\t\t} else\n \t\t\t\th.put(sum, new Index(nums[i], nums[j]));\n \t\t}\n \t}\n \treturn res;\n }",
"public static int[] twoSumBetter(int[] numbers, int target) {\n int[] aux = new int[numbers.length];\n for (int i = 0; i < numbers.length; i++) {\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n int firstTarget = aux[i], secondTarget = aux[j];\n \n int[] result = new int[2];\n boolean foundOne = false;\n int leftOver = -1;\n for (int k = 0; k < numbers.length; k++) {\n \n if (foundOne) {\n if (numbers[k] == leftOver) {\n result[1] = k + 1;\n return result;\n }\n }\n \n if (numbers[k] == firstTarget || numbers[k] == secondTarget) {\n \n foundOne = true;\n leftOver = numbers[k] == firstTarget ? secondTarget : firstTarget;\n result[0] = k + 1;\n }\n }\n \n return result;\n \n }",
"public int getSumLoop(int a, int b) {\n while (b != 0) {\n int temp = a ^ b;\n b = (a & b) << 1;\n a = temp;\n }\n return a;\n }"
] | [
"0.6990336",
"0.6804154",
"0.6765138",
"0.67628163",
"0.6437653",
"0.63341427",
"0.6331134",
"0.62305784",
"0.6067332",
"0.60291183",
"0.60165",
"0.60066897",
"0.6006274",
"0.5961154",
"0.59226733",
"0.58876103",
"0.58835936",
"0.5836343",
"0.5827248",
"0.58133477",
"0.5807412",
"0.5778533",
"0.5772157",
"0.5767223",
"0.57644403",
"0.57427555",
"0.5739345",
"0.57314664",
"0.57255894",
"0.57163054",
"0.5703283",
"0.5702183",
"0.5692299",
"0.56541747",
"0.5653964",
"0.5641819",
"0.56172985",
"0.5590035",
"0.5588496",
"0.5587466",
"0.5586932",
"0.5585423",
"0.5563618",
"0.5561522",
"0.5512708",
"0.5480713",
"0.54615164",
"0.54414946",
"0.5435834",
"0.5430903",
"0.542813",
"0.54277754",
"0.5410197",
"0.5404269",
"0.5381905",
"0.5355429",
"0.53094023",
"0.53079903",
"0.53022254",
"0.5292236",
"0.5283891",
"0.5270839",
"0.5270419",
"0.52689695",
"0.52682674",
"0.5256302",
"0.52558905",
"0.5252911",
"0.5240983",
"0.52248186",
"0.5222654",
"0.522026",
"0.52192813",
"0.5215759",
"0.5212643",
"0.5212277",
"0.5182758",
"0.5175686",
"0.51751995",
"0.51751804",
"0.51745474",
"0.5174127",
"0.51663226",
"0.51538616",
"0.5148112",
"0.51471525",
"0.5147126",
"0.51418185",
"0.513644",
"0.5123643",
"0.51228434",
"0.5122406",
"0.51209855",
"0.51093054",
"0.51074994",
"0.51032317",
"0.5096943",
"0.5084429",
"0.5082087",
"0.507718"
] | 0.80235684 | 0 |
O(N) solution but needs sorting. Sort the input aray. For each item a[i], check the ending element A[j] (j = n1 initially) if a[i] + a[j] == x, this is a solution. if a[i] + a[j] > x, then a[j] is larger, decreemnt j by 1 and try again. if a[i] + a[j] < x, then increment a[i] to increase the sum. | public static int TwoSum_scan(int[] a, int lo, int hi, int x)
{
int count = 0;
Arrays.sort(a);
for (int i = lo, j = hi-1; i < j ; )
{
if (a[i] + a[j] == x)
{
System.out.println("Pair: (" + a[i] + "," + a[j] + ")");
++i;
--j;
++count;
continue;
}
if (a[i] + a[j] > x)
{
--j;
continue;
}
if (a[i] + a[j] < x)
{
++i;
continue;
}
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void pairSum(int[] input, int x){\n \tint n = input.length;\n\t\tint a, b;\n\t\tfor (int i = 0; i < n - 1; i++) { \n\t\t\tfor (int j = i + 1; j < n; j++) { \n\t\t\t\tif (input[i] + input[j] == x) {\n\t\t\t\t\tif(input[j] < input[i]) {\n\t\t\t\t\t\ta = input[j];\n\t\t\t\t\t\tb = input[i];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ta = input[i];\n\t\t\t\t\t\tb = input[j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(a + \" \" + b); \n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\t\n\t}",
"static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}",
"public static String findSum3(int[] a, int x){\r\n\t\t// scan the array, \r\n\t\tint begin = 0, end = a.length -1, sum;\r\n\t\twhile(begin < a.length -1 && (end >= 0)){\r\n\t\t\tsum = a[begin] + a[end];\r\n\t\t\tif(sum < x){\r\n\t\t\t\tbegin++;\r\n\t\t\t}else if(sum > x){\r\n\t\t\t\tend--;\r\n\t\t\t}else {\r\n\t\t\t\treturn a[begin] + \" \" + a[end];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }",
"public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}",
"public int solution(int[] A) {\n int sum = 0;\n int max = 0;\n Map<Integer, Integer> countMap = new HashMap<>();\n for (int i = 0; i < A.length; i++) {\n int val = Math.abs(A[i]);\n sum += val;\n A[i] = val;\n max = Math.max(val, max);\n countMap.put(val, countMap.getOrDefault(val, 0) + 1);\n }\n int[] dp = new int[sum + 1];\n for (int i = 1; i < dp.length; i++) {\n dp[i] = -1;\n }\n int[] count = new int[max + 1];\n for (Map.Entry<Integer, Integer> countMapEntry : countMap.entrySet()) {\n count[countMapEntry.getKey()] = countMapEntry.getValue();\n }\n for (int i = 1; i < max + 1; i++) {\n if (count[i] > 0) {\n for (int j = 0; j < dp.length; j++) {\n if (dp[j] >= 0) {\n dp[j] = count[i];\n } else if (j >= i && dp[j - i] > 0) {\n dp[j] = dp[j - i] - 1;\n }\n }\n }\n }\n int half = sum / 2;\n for (int i = half; i >= 0; i--) {\n if (dp[i] >= 0) {\n return Math.abs((sum - i) - i);\n }\n }\n return -1;\n }",
"public static int solution(int[] A) {\n\n int min = Integer.MAX_VALUE;\n int total = 0;\n int size = A.length;\n int pSum = 0;\n int nSum = 0;\n for (int j : A) {\n total += j;\n }\n\n for (int i = 1; i < size; i++) {\n pSum += A[i-1];\n nSum = total - pSum;\n min = Math.min(min, Math.abs(pSum-nSum));\n }\n return min;\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 int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }",
"public static String findSum(int[] a, int x){\r\n\t\tQuickSort.quick_sort(a, 0, a.length -1);\r\n\t\tint delta, binR;\r\n\t\tfor(int i = 0; i < a.length - 1; i++){\r\n\t\t\tdelta = x - a[i];\r\n\t\t\t// we don't want to search from the beginning of the array,\r\n\t\t\t// since we should have found it earlier\r\n\t\t\tbinR = BinarySearch.search(a, delta, i + 1, a.length - 1);\r\n\t\t\tif(binR >= 0) {\r\n\t\t\t\treturn delta + \" \" + a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public static int jKadaneAlgo(int A[], int n)\n\t{\n\t\t // initialize variables as first value in array\n\t\t int currentMax=A[0]; \n\t\t int maxSubarray=A[0]; \n\t\t for(int i=1; i<n; i++) \n\t\t { \n\t\t\t //compare the first element of array with the sum of first element of array and the iterating value of array\n\t\t\t currentMax=Math.max(A[i],(currentMax+A[i])); \n\t\t\t //keep updating the maxSubarray with highest value by comparing currentMax and maxSubArray\n\t\t\t maxSubarray=Math.max(maxSubarray,currentMax); \n\t\t }\n\t\t return maxSubarray;\n\t}",
"public int solution(int[] A) {\n ArrayList<Integer> fibonacci = new ArrayList<>();\n\n fibonacci.add(0); // note: f(0) = 0 (as in the quesion)\n fibonacci.add(1);\n // note: using \"while\" is better than \"for\" (avoid errors)\n\n while (true) {\n int temp1 = fibonacci.get(fibonacci.size() - 1);\n int temp2 = fibonacci.get(fibonacci.size() - 2);\n\n fibonacci.add(temp1 + temp2);\n\n // if already bigger than length, then break;\n if (temp1 + temp2 > A.length) {\n break;\n }\n }\n\n // reverse \"List\": from big to small\n Collections.reverse(fibonacci);\n\n // use \"queue\" with \"point\"\n // point(x,y) = point(\"position\", \"number of steps\")\n ArrayList<Point> queue = new ArrayList<>();\n\n queue.add(new Point(-1, 0)); // position:-1, steps:0\n\n // index: the current index for queue element\n int index = 0;\n while (true) {\n // cannot take element from queue anymore\n if (index == queue.size()) {\n return -1;\n }\n\n // take element from queue\n Point current = queue.get(index);\n\n // from big to small\n for (Integer n : fibonacci) {\n int nextPosition = current.x + n;\n\n // case 1: \"reach the other side\"\n if (nextPosition == A.length) {\n // return the number of steps\n return current.y + 1;\n }\n\n // case 2: \"cannot jump\"\n // note: nextPosition < 0 (overflow, be careful)\n else if ((nextPosition > A.length) || (nextPosition < 0) || (A[nextPosition] == 0)) {\n // note: do nothing\n }\n\n // case 3: \"can jump\" (othe cases)\n else {\n // jump to next position, and step+1\n Point temp = new Point(nextPosition, current.y + 1);\n // add to queue\n queue.add(temp);\n\n A[nextPosition] = 0; // key point: for high performance~!!\n }\n }\n\n index++; // take \"next element\" from queue\n }\n }",
"public static 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 }",
"public int solution(int[] A) {\n int N = A.length;\r\n int[] s1 = new int[N];\r\n int[] s2 = new int[N];\r\n \r\n for (int i = 1; i < N - 1; i++)\r\n {\r\n s1[i] = Math.max(0, s1[i - 1] + A[i]);\r\n }\r\n \r\n for (int i = N - 2; i > 0; i--)\r\n {\r\n s2[i] = Math.max(0, s2[i + 1] + A[i]);\r\n }\r\n \r\n int max = 0;\r\n \r\n for (int i = 1; i < N - 1; i++)\r\n {\r\n max = Math.max(max, s1[i - 1] + s2[i + 1]);\r\n }\r\n \r\n return max;\r\n }",
"public static int solution(int[] A) {\n if( A.length <= 1){\n return 0;\n }\n int reverseCount = 0;\n int compareElement = 0;\n int sequenceStart = A[0];\n int i = 0;\n while(i < A.length){\n int firstElement = A[i];\n // array has current and next index should be\n if(i == A.length-1)\n compareElement = A[i-1];\n else\n compareElement = A[i+1];\n if(firstElement == compareElement){\n reverseCount++;\n if(firstElement == 1 ) sequenceStart = 0;\n }else if(sequenceStart != firstElement){\n sequenceStart= firstElement;\n reverseCount += 2;\n }\n i+=2;\n }\n return reverseCount;\n }",
"public static int solution(int[] A) {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tString one;\n\t\tfor(int num : A) {\n\t\t\tone = num+\"\";\n\t\t\tint splitedSum = 0;\n\t\t\tfor(String n : one.split(\"\")) {\n\t\t\t\tsplitedSum += Integer.parseInt(n);\n\t\t\t}\n\t\t\tlist.add(splitedSum);\n\t\t}\n\t\t\n\t\tList<Integer> sumList = new ArrayList<>();\n\t\t\n\t\tfor(int i =0; i < list.size(); i++) {\n\t\t\tfor(int j=0; j < list.size(); j++) {\n\t\t\t\tif( i!=j && list.get(i) == list.get(j) ) {\n\t\t\t\t\tsumList.add(A[i] + A[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( sumList.size()==0 ) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn Collections.max(sumList);\n\t\t}\n }",
"public int solution(int[] A) {\n // write your code in Java SE 8\n List<Integer> a = new ArrayList<>();\n for(int i = 0 ; i < A.length ; i++) {\n if(A[i] > 0) a.add(A[i]);\n }\n\n if(a.size() == 0) {\n return 1;\n }\n\n Collections.sort(a);\n int result = 1;\n for(Integer number : a) {\n if(number == result)\n result++;\n }\n return result;\n }",
"public static int pickingNumbers(List<Integer> a) {\n Collections.sort(a);\n List<Integer> result = new ArrayList<>();\n int counter = 0;\n\n for (int i = 0; i < a.size(); i++) {\n for (int j = i; j < a.size(); j++) {\n if(a.get(i)+1 >= a.get(j)){\n counter ++;\n }else{\n result.add(counter);\n counter = 0;\n break;\n }\n }\n result.add(counter);\n counter = 0;\n }\n return Collections.max(result);\n }",
"private static int solution(final int[] A)\n {\n Arrays.sort(A);\n\n for(int i=0; i<A.length - 1; i=i+2)\n {\n if (A[i] != A[i + 1])\n {\n return A[i];\n }\n }\n\n return A[A.length - 1];\n }",
"public int solution(int[] A) {\n\t \n\t int n = A.length;\n\t int N =0;\n\t for(int i=0;i<n;i++){\n\t N += A[i];\n\t }\n\t boolean[][] P = new boolean[N/2+1][n+1];\n\t for(int i=0;i<n;i++){\n\t P[0][i] = true;\n\t }\n\t \n\t for(int i = 1;i<=N/2;i++)\n\t for(int j = 1;j<=n;j++)\n\t if(A[j-1]<=i)\n\t P[i][j] = P[i][j-1] || P[i - A[j - 1]][ j - 1];\n\t else\n\t P[i][j] = P[i][j-1];\n\t if (P[N/2][n] == true)\n\t return 1;\n\t else \n\t return 0;\n\t }",
"public int solution(int[] A) {\n int l = A.length;\r\n int largest = 0;\r\n\r\n //first we sort the array using count sort\r\n //get largest\r\n for (int i : A) {\r\n if (i > largest) {\r\n largest = i;\r\n }\r\n }\r\n //set all elements of c to 0\r\n int c[] = new int[largest + 1];\r\n int b[] = new int[A.length];\r\n for (int i = 0; i < c.length; i++) {\r\n c[i] = 0;\r\n }\r\n printc(c, \"c\");\r\n // set occurences of each element in c\r\n for (int i : A) {\r\n c[i] += 1;\r\n }\r\n printc(c, \"c\");\r\n // add \r\n for (int i = 1; i < c.length; i++) {\r\n c[i] = c[i - 1] + c[i];\r\n }\r\n printc(c, \"c\");\r\n\r\n for (int i = A.length-1; i >= 0; i--) {\r\n int value = A[i];\r\n int cvalue = c[value] - 1;\r\n b[cvalue] = value;\r\n c[value] = cvalue;\r\n }\r\n printc(b, \"b\");\r\n\r\n \r\n \r\n return 0;\r\n }",
"public int solution(int[] A) {\n Set<Integer> set = new HashSet<>();\n\n for(int i=1; i < A.length+1; i++)\n set.add(i);\n\n for(int i=0; i < A.length; i++)\n {\n if(set.contains(A[i]))\n set.remove(A[i]);\n\n else\n set.add(A[i]); \n }\n\n if(set.isEmpty())\n return 1;\n\n return 0;\n }",
"public static int exhaustiveSearchOptimized(final int[] A) {\n\t\tint[] sums = new int[A.length];\n\t\tsums[0] = A[0];\n\t\tfor (int i = 1; i < A.length; i++) {\n\t\t\tsums[i] = sums[i - 1] + A[i];\n\t\t}\n\t\tdouble min = Double.MAX_VALUE;\n\t\tint start = -1;\n\t\tfor (int s = 0; s < A.length - 1; s++) {\n\t\t\tfor (int e = s + 1; e < A.length; e++) {\n\t\t\t\tint sum = s > 0 ? sums[e] - sums[s - 1] : sums[e];\n\t\t\t\tdouble avg = (double) sum / (e - s + 1);\n\t\t\t\tif (avg < min) {\n\t\t\t\t\tmin = avg;\n\t\t\t\t\tstart = s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn start;\n\t}",
"public static int TwoSum_hashed(int[] a, int x)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer,Integer>();\r\n\t\tfor (int i = 0; i < a.length; ++i)\r\n\t\t{\r\n\t\t\tint diff = x-a[i];\r\n\t\t\tif (map.get(a[i]) != null) {\r\n\t\t\t\tint v2 = map.get(a[i]);\r\n\t\t\t\tSystem.out.println(\"Pair: (\" + a[i] + \",\" + v2 + \")\");\r\n\t\t\t\t++count;\r\n\t\t\t} else {\r\n\t\t\t\tmap.put(diff, a[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"private static int maxSubSumN2(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n int thisSum = 0;\n for (int i = first; i < a.length; i++) {\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }",
"public static void main(String[] args) {\n\t\tint[] a = { -2, -3, 4, -1, -2, 1, 5, -3 }; \n\t\t int size = a.length; \n\t int max_so_far = Integer.MIN_VALUE, max_ending_here=0;\n\t for (int i = 0; i < size; i++) { \n\t max_ending_here = max_ending_here + a[i]; \n\t if (max_so_far < max_ending_here) \n\t max_so_far = max_ending_here; \n\t if (max_ending_here < 0) \n\t max_ending_here = 0; \n\t } \n\t // System.out.println(max_so_far);\n\t int product=1,max=0;\n\t for (int i = 0; i < size; i++) {\n\t \t\n\t \tproduct=product*a[i];\n\t \tif(product>max)\n\t \t\tmax=product;\n\t \t if (product < 0) \n\t \t\t product = 1; \n\t \t\n\t }\n\t // System.out.println(max);\n\t \n\t Arrays.sort(a);\n\t int i=0,j=a.length-1;\n\t while(i<a.length &&j<a.length)\n\t {\n\t \t if(a[i]+a[j]==3)\n\t \t {\n\t \t\t System.out.println(a[i]+\" \"+a[j]);\n\t \t\t i++;j--;\n\t \t }\n\t \t else if(a[i]+a[j]>3)\n\t \t\t j--;\n\t \t else if(a[i]+a[j]<3)\n\t \t\t i++;\n\t }\n\t \n\t \n\t }",
"public static int bestSolution(int[] A) {\n int counter = 0, j = 0;\n long[] upper = new long[A.length];\n long[] lower = new long[A.length];\n\n for (int i = 0; i < A.length; i++) {\n lower[i] = (long) i - A[i];\n upper[i] = (long) i + A[i];\n }\n\n Arrays.sort(lower);\n Arrays.sort(upper);\n\n for (int i = 0; i < A.length; i++) {\n while (j < A.length && upper[i] >= lower[j]) {\n counter += j - i;\n j++;\n }\n if (counter > 10000000) return -1;\n }\n\n return counter;\n }",
"public static int maxSum(int[] a, int k) \n {\n PriorityQueue<Integer> pq = new PriorityQueue<>(); \n for (int x : a) \n pq.add(x); \n \n // Do k negations by removing a minimum element k times \n while (k-- > 0) \n { \n // Retrieve and remove min element \n int temp = pq.poll(); \n \n // Modify the minimum element and add back \n // to priority queue \n temp *= -1; \n pq.add(temp); \n } \n \n // Compute sum of all elements in priority queue. \n int sum = 0; \n for (int x : pq) \n sum += x; \n return sum; \n }",
"public int solution(int[] A) {\n int sumRange = 0;\n for (int i = 1; i <= A.length+1; i++){\n sumRange+=i;\n }\n \n int sumArray = 0;\n for(int a : A) {\n sumArray+=a;\n }\n\n\t//Take the total without the missing number, and subtract the total with the missing number\n return sumRange-sumArray;\n }",
"public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }",
"public static int sumOfTwoLargestElements(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n\n\n for (int i = 0; i < a.length; i++) {\n if(firstNum==a[i])continue;\n if (firstNum < a[i]) {\n secondNum = firstNum;\n firstNum = a[i];\n } else if (secondNum < a[i]) {\n secondNum = a[i];\n }\n }\n return firstNum + secondNum;\n }",
"private int go(int a[]) {\n int n = a.length;\n int maxsofar = Integer.MIN_VALUE;\n int minsofar = Integer.MAX_VALUE;\n int curmin = 0, curmax = 0, total = 0;\n int ans = 0;\n\n for (int i = 0; i < n; i++) {\n curmax = Math.max(curmax + a[i], a[i]);\n curmin = Math.min(curmin + a[i], a[i]);\n maxsofar = Math.max(maxsofar, curmax);\n minsofar = Math.min(minsofar, curmin);\n total += a[i];\n }\n\n if (maxsofar > 0) {\n ans = Math.max(maxsofar, total - minsofar);\n } else {\n ans = maxsofar;\n }\n return ans;\n }",
"public static boolean findSum3Bool(int[] a, int x){\r\n\t\tint begin = 0, end = a.length -1, sum;\r\n\t\twhile(begin < a.length -1 && (end >= 0)){\r\n\t\t\tsum = a[begin] + a[end];\r\n\t\t\tif(sum < x){\r\n\t\t\t\tbegin++;\r\n\t\t\t}else if(sum > x){\r\n\t\t\t\tend--;\r\n\t\t\t}else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public int solution(int[] A)\n {\n \n if(A.length == 0 && A.length == 1)\n return 0;\n \n int currentOneSum = 0;\n int totalOneSum = 0;\n int currentZeros = 0;\n \n for (int i = 0; i < A.length; i++)\n \n if(A[i] == 1)\n \n currentOneSum++;\n \n if(A[i] == 0 || i == A.length-1)\n \n totalOneSum += currentZeros * currentOneSum;\n currentOneSum = 0;\n currentZeros++;\n \n return Math.abs(totalOneSum) <= Math.pow(10,9) ? totalOneSum : -1;\n \n }",
"public int solution(int X, int[] A) {\n final boolean[] seen = new boolean[X];\n int progess = 0;\n\n for (int i = 0; i < A.length; i++) {\n int idx = A[i]-1;\n // If already seen element skip, else set bit and increment progress\n if (!seen[idx]) {\n seen[idx] = true;\n progess++;\n if (progess == X) {\n return i;\n }\n }\n }\n\n return -1;\n }",
"private static boolean judge(int[] a) {\n\t\tint st = 1;\r\n\t\tint ed = a.length-2;\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\twhile (st<=ed) {\r\n\t\t\tif(a[st]>a[ed]){\r\n\t\t\t\tsa+=a[st];\r\n\t\t\t\tst++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsa+=a[ed];\r\n\t\t\t\ted--;\r\n\t\t\t}\r\n\t\t\tif(st>ed)break;\r\n\t\t\tif(a[st]>a[ed]){\r\n\t\t\t\tsb+=a[st];\r\n\t\t\t\tst++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsb+=a[ed];\r\n\t\t\t\ted--;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(sa>=sb)return true;\r\n\t\treturn false;\r\n\t}",
"private static int maxSubSumN(int[] a) {\n int maxSum = 0;\n int thisSum = 0;\n\n for (int i = 0; i < a.length; i++) {\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n } else if (thisSum < 0) {\n thisSum = 0;\n }\n }\n\n return maxSum;\n }",
"public ArrayList<Integer> continuousSubarraySum(int[] A) {\n ArrayList<Integer> result = new ArrayList<>();\n\n int temp = A[0];\n for (int i = 0; i<A.length;i++) {\n int val = A[i];\n for (int j = i + 1; j<A.length; j++) {\n val += A[j];\n if (temp < val) {\n result.clear();\n result.add(i);\n result.add(j);\n \n }\n else { continue;}\n temp = val;\n }\n \n }\n return result;\n \n }",
"public static void main(String[] args) {\n int[] a={11, 15, 6, 8, 9, 10,4};\n int sum =2;\n //SORTING AND FIND PAIRS\n /*Arrays.sort(a);\n \n int i=0,j=a.length-1;\n while(i<j)\n {\n\t if(a[i]+a[j]==sum)\n\t {\n\t\t System.out.println(\"pair is+\"+a[i]+\" \"+a[j]);\n\t\t i++;j++;\n\t\t }\n\t else if(a[i]+a[j]<sum)\n\t {\n\t\t i++;\n\t }\n\t else if(a[i]+a[j]>sum)\n\t {\n\t\t j--;\n\t }\n }*/\n //Arrays.sort(a);\n LinkedHashSet<Integer> m = new LinkedHashSet<Integer>();\n int temp;\n for(int i=0;i<a.length;i++)\n {\n\t temp=sum+a[i];\n\t if(m.contains(temp))\n\t {\n\t\t System.out.println(\"par is:\"+a[i]+\" \"+temp);\n\t }\n\t else\n\t\t m.add(a[i]);\n }\n\n\t}",
"public int solution(int[] A) {\n\n\t\tif (A == null || A.length == 1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tint indexResult = -1;\n\t\tdouble minResult = Double.MAX_VALUE, result = 0;\n\n\t\tfor (int i = 0; i < A.length - 1; i++) {\n\t\t\tif(i + 2 < A.length) {\n\t\t\t\tresult = (A[i] + A[i + 1] + A[i + 2]) / 3.0;\n\t\t\t\tif(result < minResult) {\n\t\t\t\t\tminResult = result;\n\t\t\t\t\tindexResult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult = (A[i] + A[i + 1]) / 2.0;\n\t\t\tif(result < minResult) {\n\t\t\t\tminResult = result;\n\t\t\t\tindexResult = i;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn indexResult;\n\t}",
"private static int solve(int[] arr, int length) {\n\tint i =0,j;\n\tint extremum = 0;\n\t\n\tfor(j=i;j<length;){\n\t\tif(arr[i]==arr[j]){\n\t\t\tif((j==length-1) && ((arr[j]>arr[i-1])||(arr[j]<arr[i-1])))\n\t\t\t\textremum++;\n\t\t\tj++;\n\t\t\tcontinue;\n\t\t}\n\t\t\t\n\t\telse if((i==0 && ((arr[j]>arr[i])||(arr[j]<arr[i])))){\n\t\t\textremum ++;\n\t\t}\n\t\t\t\n\t\telse if((arr[i-1]>arr[i])&&(arr[j]>arr[j-1])){\n\t\t\textremum++;\n\t\t}\n\t\t\t\n\t\telse if((arr[i-1]<arr[i])&&(arr[j]<arr[j-1])){\n extremum++;\n\t\t}\n\t\t\n\t i = j;\n\t\t\t\n\t}\n\t\n\treturn extremum;\n}",
"public static void main(String[] args) {\n System.out.println(\"Enter the number of elements in the array\");\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] array = new int[n];\n for (int i = 0; i < n; i++) {\n array[i] = scanner.nextInt();\n }\n System.out.println(\"Enter the sum to be found\");\n int sum = scanner.nextInt();\n\n Arrays.sort(array);\n int forwardPointer = 0;\n int backwardPointer = array.length - 1;\n int tempSum = array[forwardPointer] + array[backwardPointer];\n while (! isEqual(sum, tempSum)) {\n //System.out.println(array[forwardPointer]);\n //System.out.println(array[backwardPointer]);\n if (sum > tempSum) {\n // means we need to add bigger numbers\n forwardPointer++;\n } else {\n // means we have to add smaller numbers\n backwardPointer--;\n }\n\n if (forwardPointer >= backwardPointer) {\n // means we couldnt find anything\n System.out.println(\"Couldnt find the numbers in the given array\");\n break;\n }\n tempSum = array[forwardPointer] + array[backwardPointer];\n }\n\n if (forwardPointer < backwardPointer) {\n System.out.printf(\"The numbers are %d and %d\\n\", array[forwardPointer], array[backwardPointer]);\n }\n\n }",
"public int binarySearchAlgo(int a[], int x) {\n\t\tint low = 0;\n\t\tint high = a.length - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) / 2;\n\t\t\tif (a[mid] == x) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (x > a[mid]) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else /* if(a[mid] < x) */ {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"public static int solution2(int[] A) {\n\n HashMap<Integer, Integer> hm = new HashMap<>();\n\n int n = A.length;\n\n // Finding frequency of each number.\n for (int i = 0; i < n; i++) {\n if (hm.containsKey(A[i]))\n hm.put(A[i], hm.get(A[i]) + 1);\n else\n hm.put(A[i], 1);\n }\n int ans = 0;\n\n // Calculating count of pairs with equal values\n for (Map.Entry<Integer, Integer> it : hm.entrySet()) {\n int count = it.getValue();\n ans += (count * (count - 1)) / 2;\n }\n return ans;\n }",
"public boolean solution(int[] A) {\n int target = 0 ;\n int length = A.length;\n for(int i =0;i< length -1 ; i++){\n if(target == 0){\n target = Integer.compare(A[i],A[i+1]);\n continue;\n }\n if(target > 0){\n if(A[i] < A[i+1]){\n return false;\n }\n }\n if (target < 0){\n if(A[i] >A[i+1]){\n return false;\n }\n }\n }\n return true;\n }",
"public static String findSum2(int[] a, int x){\n\t\tMap<Integer, Integer> cache = new HashMap<Integer, Integer>();\r\n\t\tint delta;\r\n\t\tfor(int i = 0; i < a.length; i++) {\r\n\t\t\tdelta = x - a[i];\r\n\t\t\tif(cache.get(delta) != null) {\r\n\t\t\t\treturn delta + \" \" + a[i];\r\n\t\t\t}else{\r\n\t\t\t\tcache.put(a[i], delta);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public int solution(int[] A) {\n\t\tfinal int N = A.length;\n\t\tassert (N >= 2);\n\t\tfinal double[] minAvg = new double[N - 1];\n\t\tfinal double[] lenMinAvg = new double[N - 1];\n\t\tminAvg[N - 2] = (A[N - 1] + A[N - 2]) / 2;\n\t\tlenMinAvg[N - 2] = 2;\n\t\tfor (int i = N - 3; i >= 0; i--) {\n\t\t\tfinal double a = (minAvg[i + 1] * lenMinAvg[i + 1] + A[i]) / (lenMinAvg[i + 1] + 1);\n\t\t\tfinal double b = ((double) A[i] + (double) A[i + 1]) / 2;\n\t\t\tif (b <= a) {\n\t\t\t\t// crucial: for a==b we need to prioritize the slice with lesser length because it is \"more minimizable\"\n\t\t\t\tminAvg[i] = b;\n\t\t\t\tlenMinAvg[i] = 2;\n\t\t\t} else {\n\t\t\t\tminAvg[i] = a;\n\t\t\t\tlenMinAvg[i] = lenMinAvg[i + 1] + 1;\n\t\t\t}\n\t\t\t//System.out.printf(\"minAvg=[%s], lenMinAvg=[%s]%n\", Arrays.toString(minAvg), Arrays.toString(lenMinAvg));\n\t\t}\n\t\treturn minIndex(minAvg);\n\t}",
"public int solution(int[] A) {\n int sum = sum(A);\n int stackingSum = 0;\n int diff = Integer.MAX_VALUE;\n\n for (int i = 0; i < A.length; i++) {\n stackingSum = stackingSum + A[i];\n sum = sum - A[i];\n System.out.println(Math.abs(stackingSum - sum));\n int expr = Math.abs(stackingSum - sum);\n\n if (diff > expr) {\n diff = expr;\n }\n }\n\n return diff;\n }",
"public static int ombyttinger(int[] a) {\n int count=0;\n for (int i = 0; i < a.length-1; i++) {\n if (a[i] > a[i+1]) {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n count++;\n\n }\n }\n return count;\n }",
"public int solution(int[] A) {\n\t\tif (A.length == 1)\n\t\t\treturn Math.abs(A[0]);\n\n\t\tint result = -1;\n\t\tint left, right;\n\t\tint sumAll = 0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsumAll = sumAll + A[i];\n\t\t}\n\n\t\tfor (int i = 1; i < A.length; i++) {\n\t\t\tleft = 0;\n\t\t\tright = 0;\n\t\t\tfor (int j = 0; j < i; j++) {\n\t\t\t\tleft = left + A[j];\n\t\t\t}\n\t\t\tright = sumAll - left;\n\t\t\tint value = Math.abs(left - right);\n\t\t\tif (result == -1 || value < result)\n\t\t\t\tresult = value;\n\t\t}\n\t\treturn result;\n\t}",
"public static int search(int[] a, int x) {\n int lo = 0;\n int hi = a.length;\n \n while (lo < hi) { // step 1\n // INVARIANT: if a[j]==x then lo <= j < hi; // step 3\n int i = (lo + hi)/2; // step 4\n if (a[i] == x) {\n return i; // step 5\n } else if (a[i] < x) {\n lo = i+1; // step 6\n } else {\n hi = i; // step 7\n }\n }\n return -1; // step 2\n }",
"public int[] solution(int N, int[] A) {\n int maxSum = 0, max = 0;\n int[] resultArr = new int[N];\n for (int a : A) {\n if (1 <= a && a <= N) {\n // 모든 값에 적용 되어야 하는 maxSum 값보다 작으면, maxSum 값이 적용되지 않은 것이다.\n // 이 경우, maxSum 값을 적용 하고, +1 값을 해준다.\n // 그 외의 경우, 현 값에 +1 만 해주면 된다.\n if (resultArr[a - 1] < maxSum) {\n resultArr[a - 1] = (maxSum + 1);\n } else {\n resultArr[a - 1] += 1;\n }\n // 현 resultArr 배열 에서의 최대값 max 를 구한다\n if (max < resultArr[a - 1]) {\n max = resultArr[a - 1];\n }\n } else if (a == N + 1) {\n // 모든 resultArr 에 적용 되어야 하는 maxSum 값으로 적용 시킨다\n maxSum = max;\n }\n }\n // result[i] 가 maxSum 값 미만 이라는 것은, 위에서 해당 index 에 maxSum 값을 반영 해주지 않았음 을 의미(+변화가 없었음)\n // 해당 index 에 maxSum 값을 반영 해주면 된다.\n for (int i = 0; i < resultArr.length; i++) {\n if (resultArr[i] < maxSum) {\n resultArr[i] = maxSum;\n }\n }\n return resultArr;\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 }",
"public int solution(int[] A) {\n if(A.length == 2) return 0;\n\n int minLength2 = A[0] + A[1];\n int min2Index = 0;\n\n int minLength3 = Integer.MAX_VALUE;\n int min3Index = 0;\n\n for (int i = 2; i < A.length; i++) {\n int length2 = A[i-1] + A[i];\n if (length2<minLength2){\n minLength2 = length2;\n min2Index = i-1;\n }\n\n int length3 = length2 + A[i-2];\n if(length3 < minLength3){\n minLength3 = length3;\n min3Index = i-2;\n }\n }\n\n if(minLength2*3 == minLength3*2) return Math.min(min2Index, min3Index);\n else return minLength2*3 < minLength3*2 ? min2Index:min3Index;\n }",
"public int solution(int[] A) {\n int res = 1;\n HashMap<Integer> map = HashMap<Integer>();\n for(int i = 0; i < A.length; i++){\n if(!map.contains(A[i])){\n map.put(A[i]);\n }\n }\n while(map.contains(res){\n res++;\n }\n return res;\n }",
"static boolean hasArrayTwoCandidates(int A[], \n\t\t\t\t\t\tint arr_size, int sum) \n\t{ \n\t\tint l, r; \n\t\n\t\t/* Sort the elements */\n\t\tArrays.sort(A); \n\t\n\t\t/* Now look for the two candidates \n\t\tin the sorted array*/\n\t\tl = 0; \n\t\tr = arr_size-1; \n\t\twhile (l < r) \n\t\t{ \n\t\t\tif(A[l] + A[r] == sum) \n\t\t\t\treturn true; \n\t\t\telse if(A[l] + A[r] < sum) \n\t\t\t\tl++; \n\t\t\telse // A[i] + A[j] > sum \n\t\t\t\tr--; \n\t\t} \n\t\treturn false; \n\t}",
"public List<Integer> findClosestElements(int[] arr, int k, int x) {\r\n\r\n\t\tint n = arr.length;\r\n\r\n\t\tif (n == 0 || k == 0) {\r\n\t\t\treturn new ArrayList<>();\r\n\t\t}\r\n\r\n\t\tif (x <= arr[0]) {\r\n\t\t\treturn copy(arr, 0, k);\r\n\t\t}\r\n\r\n\t\tif (x >= arr[n - 1]) {\r\n\t\t\treturn copy(arr, n - k, k);\r\n\t\t}\r\n\r\n\t\tint idx = Arrays.binarySearch(arr, 0, n - 1, x);\r\n\r\n\t\tif (idx < 0) {\r\n\t\t\tidx = -(idx + 1);\r\n\t\t}\r\n\r\n\t\tint l = idx - 1, r = arr[idx] == x ? idx + 1 : idx;\r\n\t\tLinkedList<Integer> dq = new LinkedList<>();\r\n\r\n\t\tif (arr[idx] == x) {\r\n\t\t\tdq.addLast(x);\r\n\t\t}\r\n\r\n\t\twhile (l >= 0 && l >= idx - k && r <= idx + k && r < n) {\r\n\t\t\tif (dq.size() == k) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (Math.abs(x - arr[l]) <= Math.abs(x - arr[r])) {\r\n\t\t\t\tdq.addFirst(arr[l]);\r\n\t\t\t\tl--;\r\n\t\t\t} else {\r\n\t\t\t\tdq.addLast(arr[r]);\r\n\t\t\t\tr++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (dq.size() != k) {\r\n\t\t\tif (l < 0) {\r\n\t\t\t\tdq.addLast(arr[r++]);\r\n\t\t\t} else {\r\n\t\t\t\tdq.addFirst(arr[l--]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn dq;\r\n\t}",
"public int solution(int[] A) {\n\n\t\tHashSet<Integer> set = new HashSet<>();\n\n\t\tfor (int i = 0; i < A.length; i++)\n\t\t\tset.add(A[i]);\n\n\t\tfor (int i = 1; i < A.length + 1; i++) \n\t\t\tif (!set.contains(i)) return 0;\n\n\t\treturn 1;\n\t}",
"public static int sumOfTwoLargestElements1(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n for (int num : a){\n if(num>firstNum){\n secondNum = firstNum;\n firstNum = num;\n }else if (num>secondNum){\n secondNum = num;\n }\n }\n return firstNum+secondNum;\n }",
"public static int maxSumForConsecutiveElements(int[] array, int k) {\r\n int length = array.length;\r\n\r\n // O(n)\r\n for (int i = 0; i < length - 1; i++) {\r\n array[i + 1] += array[i];\r\n }\r\n\r\n int maxSum = 0;\r\n int startIndex = k - 1;\r\n // O(n)\r\n for (int i = startIndex; i < length; i++) {\r\n int firstElementIndex = i - startIndex;\r\n int currentSum;\r\n\r\n if (firstElementIndex == 0) {\r\n maxSum = array[i];\r\n continue;\r\n } else {\r\n currentSum = array[i] - array[firstElementIndex - 1];\r\n }\r\n\r\n if (currentSum > maxSum) {\r\n maxSum = currentSum;\r\n }\r\n }\r\n\r\n return maxSum;\r\n }",
"public int solution(int[] A) {\n final int N = A.length;\n\n int maxSlice = Integer.MIN_VALUE;\n int maxEnding = 0;\n for (int i = 0; i < N; i++) {\n maxEnding = maxEnding + A[i];\n maxSlice = Math.max(maxSlice, maxEnding);\n if (maxEnding < 0) {\n maxEnding = 0;\n }\n }\n\n return maxSlice;\n }",
"public int solution(int[] A) {\n Arrays.sort(A);\n int hasTriangular = 0;\n // System.out.print(Arrays.toString(A));\n \n if (A.length < 3) {\n hasTriangular = 0;\n }\n else {\n int P = 0;\n int Q = 1;\n int R = 2;\n \n for(int i= 2; i<A.length; i++) {\n if((long) A[P]+ (long) A[Q]> (long)A[R]) {\n hasTriangular = 1;\n break;\n }\n else {\n P++;\n Q++;\n R++;\n } \n }\n }\n \n return hasTriangular;\n }",
"private static int MaxSubarraySum(int[] a) {\n\t\t\n\t\tint max_so_for =Integer.MIN_VALUE;\n\t\tint max_ending_here = 0;;\n\t\t\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tmax_ending_here = max_ending_here + a[i];\n\t\t\t\n\t\t\tif(max_so_for < max_ending_here )\n\t\t\t\tmax_so_for = max_ending_here;\n\t\t\tif(max_ending_here < 0)\n\t\t\t\tmax_ending_here = 0;\n\t\t}\n\t\t\n\t\treturn max_so_for;\n\t}",
"public static int longIncrSubsq(int[] A) {\n int[] L = new int[A.length];\n // init\n for (int i = 0; i < A.length; i++) {\n boolean hasGreaterItem = false;\n for (int j = i + 1; j < A.length; j++) {\n if (A[j] > A[i]) {\n hasGreaterItem = true;\n break;\n }\n }\n if (!hasGreaterItem) {\n L[i] = 1;\n }\n }\n // recursive\n int maxL = 0;\n for (int i = A.length - 1; i >= 0; i--) {\n if (L[i] != 1) {\n int maxGreaterL = 0;\n for (int j = i + 1; j < A.length; j++) {\n if (A[j] > A[i]) {\n if (L[j] > maxGreaterL) {\n maxGreaterL = L[j];\n }\n }\n }\n L[i] = 1 + maxGreaterL;\n }\n if (L[i] > maxL)\n maxL = L[i];\n }\n return maxL;\n }",
"public static int count(int[] a) {\n sort(a);\n int N = a.length;\n // print out the sorted array\n System.out.print(\"Sorted array: \");\n for (int i = 0; i < N; i++) {\n System.out.print(a[i] + \" \");\n }\n System.out.println();\n int count = 0;\n for (int i = 0; i < N; i++) {\n int j = i + 1;\n int k = N - 1;\n while (j < k) {\n if (a[i] + a[j] + a[k] == 0) {\n System.out.println(i + \",\" + j + \",\" + k);\n count++;\n j++;\n } else if (a[i] + a[j] + a[k] > 0) {\n k--;\n } else {\n j++;\n }\n }\n }\n return count;\n }",
"public static 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 int findSubsequencesThatSumUpTo(int[] arr, int neededSum) {\n int total = 0;\n\n Set<Integer> set = new HashSet<>();\n\n int acc = 0;\n for (int i = 0; i < arr.length; i++) {\n acc += arr[i];\n set.add(acc);\n }\n\n for (Integer x: set) {\n if (x == neededSum) {\n total++;\n }\n\n int required = x + neededSum;\n if (set.contains(required)) {\n total++;\n }\n }\n\n return total;\n }",
"public static void main(String[] args) throws Exception {\n int arr[]= {7,9,88,-33,2,12,6,1};\n Arrays.sort(arr);\n /*for(int i=0; i<arr.length; i++)\n \t System.out.print(arr[i]+\", \");\n System.out.println(\"\\n DESC\");\n System.out.print(\"{ \");\n for(int i=arr.length-1; i>=0; i--) {\n \t if(arr[i]==arr[0])\n \t System.out.print(arr[i]);\n \t else \n \t\t System.out.print(arr[i]+\", \");\n }*/\n // System.out.print(\" }\");\n \n int[] ar= {6,2,2,5,2,2,1};\n int startIndex=0;\n int lastIndex=ar.length-1;\n //a is sumRight,b = sumLeft\n int a=0,b=0;\n /* while(true) {\n \t \n \t if(b>a) \n \t\t //1+2+2=+5\n \t\t a+=ar[lastIndex--];\n \t else \n \t\t //6+2+2\n \t\t\t b+=ar[startIndex++];\n \t\tif(startIndex>lastIndex) {\n \t\t\tSystem.out.println(startIndex);\n \t\t\tif(a==b)\n \t\t\t\tbreak;\n \t\t\t else\n \t\t\t throw new Exception(\"not a valid array\");\n \t\t\t\n \t\t}\n \t\t\t \n \t\t\n }\n System.out.println(lastIndex);\n */\n \n \n while(true) {\n \t \n \t if(b>a)\n \t\t a+= ar[lastIndex--];\n \t else\n b+=ar[startIndex++];\n \t if(startIndex>lastIndex) {\n \t\t if(a==b)\n \t\t\t break;\n \t }\n }\n System.out.println(lastIndex);\n\t}",
"public static int exhaustiveSearch(final int[] A) {\n\t\tdouble min = Double.MAX_VALUE;\n\t\tint start = -1;\n\t\tfor (int s = 0; s < A.length - 1; s++) {\n\t\t\tfor (int e = s + 1; e < A.length; e++) {\n\t\t\t\tint sum = MoreInts.sum(A, s, e);\n\t\t\t\tdouble avg = (double) sum / (e - s + 1);\n\t\t\t\tif (avg < min) {\n\t\t\t\t\tmin = avg;\n\t\t\t\t\tstart = s;\n\t\t\t\t}\n\t\t\t\t//System.out.printf(\"s=%s, e=%s, avg=%s, min=%s%n\", s, e, avg, min);\n\t\t\t}\n\t\t}\n\t\treturn start;\n\t}",
"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 solution(int[] A) {\n int[] copy = A.clone();\n Arrays.sort(A);\n int left = A.length;\n int right = 0;\n int strIdx = 0;\n int endIdx = A.length - 1;\n while (left > right && (strIdx != endIdx)) {\n for (int i = 0; i < A.length; i++) {\n if (copy[i] == A[strIdx]) {\n left = i;\n }\n if (copy[i] == A[endIdx]) {\n right = i;\n }\n }\n if (A[strIdx + 1] - A[strIdx] <= A[endIdx] - A[endIdx - 1]) {\n strIdx++;\n } else {\n endIdx--;\n }\n }\n return copy[right] - copy[left];\n }",
"int findElement(int a[], int x) {\n\t\tint low = 0;\n\t\tint high = a.length - 1;\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) / 2;\n\t\t\t//If we found the element simply return the index\n\t\t\tif (a[mid] == x) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\t// Check for the sorted half\n\t\t\telse if (a[mid] < a[high]) {\n\t\t\t\tif (x > a[mid] && x <= a[high]) {\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t} else {\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\t}\n\t\t\t} else if (a[low] < a[mid]) {\n\t\t\t\tif (x >= a[low] && x < a[mid]) {\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\t} else {\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"public int solve(int[][] A) {\n Arrays.sort(A, new Comparator<int[]>() {\n @Override\n // Compare values according to columns\n public int compare(final int[] entry1, final int[] entry2) {\n\n // To sort in descending order revert\n // the '>' Operator\n if (entry1[0] > entry2[0])\n return 1;\n else\n return -1;\n }\n }); // End of f);\n int count = 1;\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n pq.add(A[0][1]);\n for (int i = 1; i < A.length; i++) {\n if (A[i][0] < pq.peek())\n count++;\n else\n pq.poll();\n\n pq.add(A[i][1]);\n }\n return count;\n }",
"public static int binSearch(int[] a, int x) {\r\n int l = 0;\r\n int r = a.length;\r\n while (l != r) {\r\n // inv: l <= res <= r\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n r = m;\r\n }\r\n else {\r\n l = m + 1;\r\n }\r\n }\r\n return r;\r\n }",
"public static int[] solution(int N, int A[])\n\t{\n\n\t\tint temp[] = new int[N];\n\t\tfor (int i = 0; i < temp.length; i++)\n\t\t{\n\t\t\ttemp[i] = 0;\n\t\t}\n\n\t\tint max = 0;\n\n\t\tfor (int i = 0; i < A.length; i++)\n\t\t{\n\n\t\t\tif (A[i] == N + 1)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < temp.length; j++)\n\t\t\t\t{\n\n\t\t\t\t\ttemp[j] = max;\n\t\t\t\t}\n\n\t\t\t} else if (A[i] > 0 && A[i] < N + 1)\n\t\t\t{\n\t\t\t\ttemp[A[i] - 1]++;\n\n\t\t\t\tif (max < temp[A[i] - 1])\n\t\t\t\t{\n\t\t\t\t\tmax = temp[A[i] - 1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn temp;\n\t}",
"public static int solutionN2(int[] A) {\n\n\t\tclass Pair {\n\t\t\tpublic int start;\n\t\t\tpublic int end;\n\n\t\t\tpublic Pair(int start, int end) {\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t}\n\n\t\tPair[] pairs = new Pair[A.length];\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tpairs[i] = new Pair(i - A[i], i + A[i]);\n\t\t}\n\n\t\tArrays.sort(pairs, new Comparator<Pair>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\treturn o1.start - o2.start;\n\t\t\t}\n\t\t});\n\n\t\tint countIntersection = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tPair current = pairs[i];\n\n\t\t\tfor (int j = i + 1; j < A.length; j++) {\n\t\t\t\tPair p = pairs[j];\n\t\t\t\tif (current.end >= p.start) {\n\t\t\t\t\tcountIntersection++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (countIntersection > 10000000)\n\t\t\treturn -1;\n\n\t\treturn countIntersection;\n\t}",
"public static Integer[] sort(Integer[] X)\n\t{RadixSorting z = new RadixSorting(); //Where elements will be stored from array \n\t int place = 0;\n\t//maxIndex is assigned to numberLength function\n\t int maxIndex = numberLength(findMax(X ,0, X.length-1), 1); \n while (!(place > maxIndex))\n { //Inv: elements in X[0..X.length-1] are sorted && place<maxIndex \n \tbucketize(X, z, place);\n \t//Inv: elements in X[0..length-1]-1 are sorted and place>maxIndex\n debucketize(X);\n //Inv:elements in X[0..length-1] are sorted and place>maxIndex\n place = place + 1; \n //Inv: elements in X[0..X.length-1] are sorted && place<maxIndex \n } \n return (X); \n //Termination: place starts at 0. It is looped every time until finally place will be smaller\n //than maxIndex in which it will then terminate. \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 }",
"public int solution(int[] A) {\n int L = A.length;\n int[] B = new int[L+1];\n for(int i=0; i<L; i++) {\n int t = A[i];\n B[t-1] = t;\n }\n for(int j=0; j<L; j++) {\n if(B[j] == 0) {\n return j+1;\n }\n }\n return 0;\n }",
"static int maxSubArraySum(int a[], int size)\n {\n int Cur_Max = a[0];\n int Prev_Max = a[0];\n \n for (int i = 1; i < size; i++)\n {\n //we want to know if the summition is increassing or not\n Prev_Max = Math.max(a[i], Prev_Max+a[i]);\n //Take Decision to change the value of the largest sum or not\n Cur_Max = Math.max(Cur_Max, Prev_Max);\n }\n return Cur_Max;\n }",
"static boolean find3Numbers(int A[], int arr_size, int sum) {\n\t\t// Fix the first element as A[i] \n\t\tfor (int i = 0; i < arr_size - 2; i++) {\n\t\t\t// Find pair in subarray A[i+1..n-1] \n\t\t\t// with sum equal to sum - A[i] \n\t\t\tHashSet<Integer> s = new HashSet<Integer>();\n\t\t\tint curr_sum = sum - A[i];\n\t\t\tfor (int j = i + 1; j < arr_size; j++) {\n\t\t\t\tif (s.contains(curr_sum - A[j])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\ts.add(A[j]);\n\t\t\t}\n\t\t}\n\n\t\t// If we reach here, then no triplet was found \n\t\treturn false;\n\t}",
"public static int solution(int[] A) {\n Set<Integer> numbers = new HashSet<>();\n for (int i : A) {\n numbers.add(i);\n }\n int missingNumber = 1;\n if (!numbers.isEmpty()) {\n for (int i = 1; i < numbers.size() + 2; i++) {\n if (!numbers.contains(i)) {\n missingNumber = i;\n break;\n }\n }\n }\n return missingNumber;\n }",
"public static void main(String[] args) {\n int []a={1,2,1,2,1,2,2,1,2,1,2,2};\r\n int count=1;\r\n Arrays.sort(a); ///1 1 1 2 2 3 3 3 \r\n int n=a.length;\r\n int temp=0,dum=0,countaaa=1;\r\n for(int i=0;i<n-1;i++)\r\n {\r\n\t if(a[i]==a[i+1])\r\n\t {\r\n\t\t count++;//1 ///how many \r\n\t\t temp=a[i];//1///tamil nadu\r\n\t }\r\n\t else\r\n\t { \r\n\t\t if(x>=y)\r\n\t\t {\r\n\t\t\t if(a[i])\r\n\t\tdum=a[i];//1///andhra\r\n\t\tcountaaa=count;//2///how many\r\n\t\tcount=1;\r\n\t\t }\r\n\t }\r\n }\r\n System.out.println(countaaa);\r\n System.out.println(count);\r\n if(countaaa>count)\r\n\t System.out.println(\"A: \"+dum+\" count: \"+countaaa);\r\n else\r\n System.out.println(temp+\" \"+count);\r\n\t}",
"private static int maxSum(int arr[]) {\n int sum = 0;\n Arrays.sort(arr);\n\n // Subtracting a1, a2, a3,....., a(n/2)-1,\n // an/2 twice and adding a(n/2)+1, a(n/2)+2,\n // a(n/2)+3,....., an - 1, an twice.\n for (int i = 0; i < arr.length / 2; i++) {\n sum -= (2 * arr[i]);\n sum += (2 * arr[arr.length - i - 1]);\n }\n\n return sum;\n }",
"public static int pickingNumbers(List<Integer> a) {\n\t \n\t \tCollections.sort(a);\n\t \t\n\t \t//List<List<Integer>> resultList = new ArrayList();\n\t \t\n\t \tint maxValue = Integer.MIN_VALUE;\n\t \t\n\t \t//a.forEach(i -> System.out.print(\" \"+i));\n\t \t\n\t \tfor(int i=0; i<a.size(); i++) {\n\t \t\t\n\t \t\t//List<Integer> possible = new ArrayList<Integer>();\n\t \t\tint count = 0;\n\t \t\t\t \t\t\n\t \t\tfor(int j=i; j<a.size(); j++) {\n\t \t\t\tif(Math.abs(a.get(i)-a.get(j)) > 1) \n\t \t\t\t\tbreak;\n\t \t\t\t\n\t \t\t\tcount++;\n\t \t\t\t//possible.add(a.get(j));\n\t \t\t}\n\t \t\t\n//\t \t\tif(possible.size() > 1)\n//\t \t\t\tresultList.add(possible);\n\t \t\t\n//\t \t\tif(maxValue < possible.size())\n//\t \t\t\tmaxValue = possible.size();\n\t \t\t\n\t \t\tmaxValue = count > maxValue ? count : maxValue;\n\t \t} \t\n\t \t\n\t \t//return resultList.stream().mapToInt(i -> i.size()).max().getAsInt();\n\t \treturn maxValue;\n\n\t }",
"static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }",
"public static void main(String[] args) {\n int a[] = {12,11,10,5,6,2,30};\n // smaller greater approach with 3 passes can be used to find total number of triplet subsequences in array \n int smaller[] = new int[a.length];\n int greater[] = new int[a.length];\n \n for(int i=0;i<a.length;i++) {\n smaller[i] = greater[i] = -1;\n }\n // smaller fill up\n int min = a[0];\n for(int i=1;i<a.length;i++) {\n if (a[i] > min) {\n smaller[i] = 1;\n } else if ( a[i] < min) {\n min = a[i];\n }\n }\n \n int max = a[a.length-1];\n for(int i=a.length-2;i>=0;i--) {\n if (a[i] < max) {\n greater[i] = 1;\n } else if ( a[i] > max) {\n max = a[i];\n }\n }\n \n for(int i=1;i<a.length-1;i++) {\n if (smaller[i] == greater[i] && greater[i] == 1) {\n System.out.println(\"Triplet found, mid is at -> \" + i + \" : \" + a[i]);\n }\n }\n System.out.println(\"Do we have increasing triplet ?? \" + increasingTripletOnePass(a));\n }",
"static ArrayList<Integer> subarraySum(int[] arr, int n, int s) {\n ArrayList<Integer> res = new ArrayList<>();\n int i = 0;\n int j = 1;\n int sum = arr[0];\n while(i < n) {\n if(sum < s && j < n) {\n sum += arr[j++];\n }\n else if(sum == s) {\n res.add(i + 1);\n res.add(j);\n return res;\n }\n else {\n sum -= arr[i++];\n }\n }\n res.add(-1);\n return res;\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for(int arr_i=0; arr_i < n; arr_i++){\n int integer = in.nextInt();\n list.add(new Integer(integer));\n }\n in.close();\n\n\n\n if(k == 1){\n System.out.println(k);\n return;\n }\n\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i) % k;\n list.set(i, x);\n }\n\n int[] kx = new int[k];\n for(int i = 0;i < k;i ++){\n kx[i] = 0;\n }\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i);\n kx[x] ++;\n }\n\n\n int num = 0;\n int A = 0;\n if(k % 2 == 0){\n A = k / 2 - 1;\n }else{\n A = k / 2;\n }\n if(kx[0] != 0){\n num += 2;\n }\n for(int i = 1; i <= A;i ++){\n if(kx[i] >= kx[k - i]){\n num += kx[i];\n }else {\n\n num += kx[k - i];\n }\n\n }\n System.out.println(num);\n }",
"public int lis(final int[] A) {\n int n = A.length;\n int[] dp = new int[n];\n \n for(int i=0; i<n; i++){\n dp[i] = 1;\n }\n \n for(int i=1; i<n; i++){\n for(int j=0; j<i; j++){\n if(A[i] > A[j] && dp[i] <= dp[j])\n dp[i] = dp[j] + 1;\n }\n }\n \n int maxi = -1;\n for(int i=0; i<n; i++)\n maxi = Math.max(maxi,dp[i]);\n \n return maxi;\n }",
"public int[] solution(int N, int[] A) {\n int len = A.length;\n\n int max = 0;\n int[] result = new int[N];\n\n for(int i=0; i<len; i++){\n if(A[i] == N+1){\n Arrays.fill(result,max);\n }else{\n max = Math.max(max,++result[A[i]-1]);\n }\n }\n return result;\n }",
"public static int TwoSum_bruteForce(int[] a,int lo, int hi, int x)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor (int i = lo; i < hi; ++i)\r\n\t\t{\r\n\t\t\tfor (int j = i+1; j < a.length; ++j)\r\n\t\t\t{\r\n\t\t\t\tif (a[i]+a[j] == x)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Pair: (\" + a[i] + \",\" + a[j] + \")\");\r\n\t\t\t\t\t++count;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public static int[] insert(int x, int[] a) {\n Arrays.sort(a);\n a = Arrays.copyOf(a, a.length + 1);\n if (a[a.length - 2] <= x) {\n a[a.length - 1] = x;\n } else {\n int i = a.length - 2;\n while ((i + 1 > 0) && (x < a[i])) {\n a[i+1] = a[i];\n i--;\n }\n a[i+1] = x;\n }\n return a;\n}",
"private static void findNumbers(int[] candidates, int sum,\n List<List<Integer>> res, List<Integer> r, int i) {\n if (sum < 0) {\n return;\n }\n\n // if we get exact answer\n if (sum == 0) {\n List<Integer> r2 = new ArrayList<>(r);\n if (!res.contains(r2)) {\n res.add(r2);\n }\n return;\n }\n\n // Recur for all remaining elements that have value smaller than sum.\n while (i < candidates.length - 1) {\n i++;\n\n // Till every element in the array starting from i which can contribute to the sum\n r.add(candidates[i]); // add them to list\n\n // recur for next numbers\n findNumbers(candidates, sum - candidates[i], res, r, i);\n\n // remove number from list (backtracking)\n r.remove(r.size() - 1);\n }\n }",
"public boolean findComplimentaryPair_O_NlogN(int []a, int k, int[] basket){\n\t\tQuickSort.qSort(a, 0, a.length-1);\n\t\tint i = 0;\t\t//left pointer\n\t\tint j = a.length - 1; // right pointer\n\n\t\twhile( i <= j){\n\t\t int s = a[i] + a[j];\n\t\t if(s < k){\n\t\t ++i;\n\t\t }else if( s > k ){\n\t\t --j;\n\t\t }else{\n\t\t basket[0] = i;\n\t\t basket[1] = j;\n\t\t return true;\n\t\t }\n\t\t }\n\t\t return false;\n\t}",
"public static void main(String args[])\n {\n int n,min= Integer.MAX_VALUE;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n \n int a[] = new int[n];\n for(int i=0;i<n;i++){\n a[i] = sc.nextInt();\n }\n \n for(int i=0;i<n-1;i++){\n min = i;\n for(int j=i+1;j<n;j++){\n \tif(a[j]<a[min]){\n min=j;\n \n }\n \n }\n if(i!=min){\n int tt = a[i];\n a[i] = a[min];\n a[min] = tt;\n }\n }\n \n for(int i=0;i<n;i++)\n System.out.print(a[i] + \" \");\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}",
"private static int maxSubSumN3(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n for (int last = first; last < a.length; last++) {\n int thisSum = 0;\n\n for (int i = first; i <= last; i++)\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }",
"static\nint\npairsInSortedRotated(\nint\narr[], \n\nint\nn, \nint\nx) \n{ \n\n// Find the pivot element. \n\n// Pivot element is largest \n\n// element of array. \n\nint\ni; \n\nfor\n(i = \n0\n; i < n - \n1\n; i++) \n\nif\n(arr[i] > arr[i + \n1\n]) \n\nbreak\n; \n\n\n// l is index of \n\n// smallest element. \n\nint\nl = (i + \n1\n) % n; \n\n\n// r is index of \n\n// largest element. \n\nint\nr = i; \n\n\n// Variable to store \n\n// count of number \n\n// of pairs. \n\nint\ncnt = \n0\n; \n\n\n// Find sum of pair \n\n// formed by arr[l] \n\n// and arr[r] and \n\n// update l, r and \n\n// cnt accordingly. \n\nwhile\n(l != r) \n\n{ \n\n// If we find a pair with \n\n// sum x, then increment \n\n// cnt, move l and r to \n\n// next element. \n\nif\n(arr[l] + arr[r] == x) \n\n{ \n\ncnt++; \n\n\n// This condition is required \n\n// to be checked, otherwise \n\n// l and r will cross each \n\n// other and loop will never \n\n// terminate. \n\nif\n(l == (r - \n1\n+ n) % n) \n\n{ \n\nreturn\ncnt; \n\n} \n\n\nl = (l + \n1\n) % n; \n\nr = (r - \n1\n+ n) % n; \n\n} \n\n\n// If current pair sum \n\n// is less, move to \n\n// the higher sum side. \n\nelse\nif\n(arr[l] + arr[r] < x) \n\nl = (l + \n1\n) % n; \n\n\n// If current pair sum \n\n// is greater, move \n\n// to the lower sum side. \n\nelse\n\nr = (n + r - \n1\n) % n; \n\n} \n\n\nreturn\ncnt; \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 }"
] | [
"0.68279594",
"0.6675751",
"0.6644415",
"0.64335376",
"0.6419214",
"0.64130944",
"0.64076656",
"0.63990206",
"0.638475",
"0.6353726",
"0.63054144",
"0.62820214",
"0.6278798",
"0.6273713",
"0.62396866",
"0.6212821",
"0.62107474",
"0.61962384",
"0.61811936",
"0.616409",
"0.6132591",
"0.61239636",
"0.6080668",
"0.60774577",
"0.60684305",
"0.6067809",
"0.60641396",
"0.6061257",
"0.6058667",
"0.6055472",
"0.60393703",
"0.60337925",
"0.6031287",
"0.60206765",
"0.6003059",
"0.5997741",
"0.59972733",
"0.5988763",
"0.5985151",
"0.5966378",
"0.5961308",
"0.5956599",
"0.5942503",
"0.59376884",
"0.5928235",
"0.5924583",
"0.59238803",
"0.59089386",
"0.5907698",
"0.59051216",
"0.58944607",
"0.5885672",
"0.58834",
"0.58816946",
"0.5860785",
"0.58225924",
"0.5809254",
"0.580274",
"0.57993567",
"0.579131",
"0.5787414",
"0.5786311",
"0.5779724",
"0.577665",
"0.5775705",
"0.5772677",
"0.576802",
"0.5763528",
"0.57608175",
"0.57543176",
"0.5745096",
"0.57447827",
"0.57418823",
"0.57412827",
"0.5741012",
"0.5740319",
"0.57267296",
"0.57218516",
"0.57216626",
"0.5717287",
"0.5717083",
"0.5703437",
"0.5702798",
"0.57008165",
"0.5700523",
"0.56933993",
"0.5682291",
"0.5681037",
"0.56795645",
"0.56761986",
"0.5674597",
"0.5669374",
"0.56679404",
"0.56636363",
"0.56544757",
"0.56502086",
"0.5647201",
"0.5644093",
"0.5642027",
"0.56407726"
] | 0.61335826 | 20 |
Find if an array has elements that sum to 0. This algorithm takes cubic time. | public static void ThreeSum_cubic(int[] a)
{
for (int i = 0; i < a.length; ++i)
{
for (int j = i+1; j < a.length; ++j)
{
for (int k = j + 1; k < a.length; ++k)
{
if (a[i] + a[j] + a[k] == 0)
System.out.println("[" + a[i] + "," + a[j] + "," + a[k] + "]");
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static boolean checkZero(int[] count) {\n\t\tfor (int i = 0; i < count.length; i++) {\n\t\t\tif (count[i] != 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isZero()\r\n {\r\n boolean is = true;\r\n for (int i = 0; i < SIZE; i++)\r\n {\r\n if ( this.myArray[i] != 0)\r\n {\r\n is = false;\r\n }\r\n }\r\n return is;\r\n }",
"public static boolean isZero (int []n) {\n\t\tfor (int i = 0; i < n.length; i++) {\n\t\t\tif (n[i] != 0) { return false; }\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"static void findTripletSumZero(int[] data) {\n\t\tboolean found = false;\n\t\tArrays.sort(data);\n\t\tfor (int x = 0; x < data.length - 1; x++) {\n\t\t\tint maxIndex = data.length - 1;\n\t\t\tint minIndex = x + 1;\n\t\t\twhile (minIndex < maxIndex) {\n\t\t\t\tint sum = data[x] + data[maxIndex] + data[minIndex];\n\t\t\t\tif (sum == 0) {\n\t\t\t\t\tSystem.out.println(\"Tripplets are \" + data[x] + \", \" + data[maxIndex] + \", \" + data[minIndex]);\n\t\t\t\t\t--maxIndex;\n\t\t\t\t\t++minIndex;\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tif (sum > 0) {\n\t\t\t\t\t--maxIndex;\n\t\t\t\t}\n\t\t\t\tif (sum < 0) {\n\t\t\t\t\t++minIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!found)\n\t\t\tSystem.out.println(\"No tripplets found\");\n\t}",
"static int findMissingUsingSummation(int[] arr) {\n\t\tint expectedSum = (arr.length + 1) * (arr.length + 1 + 1) / 2;\n\t\tint actualSum = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tactualSum = actualSum + arr[i];\n\t\t}\n\n\t\treturn expectedSum - actualSum;\n\t}",
"boolean isEmpty(int[] array) {\n return array.length == 0;\n }",
"private static boolean isZeroMatrix(@NonNull RealMatrix a) {\n for (int i = 0; i < a.getRowDimension(); i++) {\n for (int j = 0; j < a.getRowDimension(); j++) {\n if (a.getEntry(i, j) != 0) {\n return false;\n }\n }\n }\n return true;\n }",
"private static boolean tripletWithSumExistsNoExtraSpace(int[] arr, int expectedSum){\n Arrays.sort(arr);\n int size = arr.length;\n for(int i=0; i<size-2; ++i){\n int complement = expectedSum - arr[i];\n int lidx = i+1, ridx = size-1;\n while (lidx < ridx){\n if(arr[lidx]+arr[ridx] == complement)\n return true;\n else if(arr[lidx]+arr[ridx] < complement)\n ++lidx;\n else\n --ridx;\n }\n }\n return false;\n }",
"private static int sizeArr(int[] arr) {\n int count = 0;\n for (int i = 0; i < arr.length; i++) {\n if (arr[i] != 0) count++;\n }\n return count;\n }",
"@Override\n\tpublic boolean\n\tisZero()\n\t{\n\t\treturn( data[0] == 0 && data[1] == 0 && data[2] == 0 );\n\t}",
"private void findZeros() {\n\t\t\n\t\tif (realFinal == 0) {\n\t\t\thasZeroR = true;\n\t\t} if (imagFinal == 0) {\n\t\t\thasZeroI = true;\n\t\t}\n\t\t\n\t}",
"private static boolean tripletWithSumExists(int[] arr, int expectedSum){\n Set<Integer> observedElems = new HashSet<>();\n int size = arr.length;\n\n observedElems.add(arr[0]);\n\n for(int i=1; i<size-1; ++i){\n for(int j=i+1; j<size; ++j){\n int complement = expectedSum - (arr[i] + arr[j]);\n if(observedElems.contains(complement))\n return true;\n }\n observedElems.add(arr[i]);\n }\n return false;\n }",
"public boolean existSum(int[] array, int target) {\n Set<Integer> set = new HashSet<>();\n for (int num : array) {\n \tif (set.contains(target - num)) {\n \treturn true;\n }\n set.add(num);\n }\n return false;\n }",
"boolean hasComputeSum();",
"static boolean isFilled (int[][] G){\n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (G[i][j]==0) {\n return false;\n }\n }\n }\n return true;\n }",
"public boolean isZero() {\r\n for (int i = 0; i < this.getDimension(); i++) {\r\n if (this.getComponent(i) != 0)\r\n return false;\r\n }\r\n return true;\r\n }",
"public double negativeElementsSum(double[] arr) {\n return 0;\n }",
"static boolean sumChecker( int[] arrayOfNumbers) {\n\t\tint intArraySum = 0; \n\t\tfor (int i : arrayOfNumbers) { \n\t\t\tintArraySum += arrayOfNumbers[i];\n\t\t}\n\t\tif (intArraySum >= 100) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t\t \n\t\t}\n\t}",
"public Boolean isZERO(Ring ring) {\r\n return (re.isZero(ring) && im.isZero(ring));\r\n }",
"static int findMissingPositive(int arr[], int size)\n {\n int i;\n for(i = 0; i < size; i++)\n {\n if(Math.abs(arr[i]) - 1 < size && arr[Math.abs(arr[i]) - 1] > 0)\n arr[Math.abs(arr[i]) - 1] = -arr[Math.abs(arr[i]) - 1];\n }\n // Return the first index value at which is positive \n for(i = 0; i < size; i++)\n if (arr[i] > 0)// 1 is added because indexes start from 0 \n return i+1;\n return size+1;\n }",
"static int findTheFirstMissingPositiveEntry(int array[]) {\n for (int i = 0; i < array.length; i++) {\n while ((array[i] > 0) && (array[i] != i + 1)) {\n int elem = array[i];\n if (array[elem - 1] == elem) break;\n\n Utilities.swap(array, i, elem - 1);\n }\n }\n\n for (int i = 0; i < array.length; i++) {\n if (array[i] != i + 1) return i + 1;\n }\n\n return 0;\n }",
"public static boolean canThreePartsEqualSum(int[] arr) {\n int sum=0;\n int cumulative[]=new int[arr.length];\n for(int i=0;i<arr.length;i++){\n sum+=arr[i];\n cumulative[i]=sum;\n }\n for(int i=0;i<cumulative.length;i++){\n for(int j=i+1;j<cumulative.length;j++){\n if(cumulative[i]==cumulative[j]-cumulative[i]){\n if(cumulative[i]==cumulative[cumulative.length-1]-cumulative[j] && (cumulative.length-1) !=j){\n return true;\n }\n }\n }\n }\n return false;\n}",
"public int[] ZeroOutNegs(int[] arr) {\r\n for (int x = 0; x < arr.length; x++) {\r\n if (arr[x] < 0) {\r\n arr[x] = 0;\r\n }\r\n }\r\n return arr;\r\n }",
"public boolean checkSubarraySum(int[] nums, int k) {\n\n if (nums == null) {\n return false;\n }\n\n Map<Integer, Integer> sums = new HashMap<>();\n\n int runningSum = 0;\n\n // sums.put(0, -1);\n for (int i = 0; i < nums.length; i++) {\n int n = nums[i];\n runningSum += n;\n if (k != 0) {\n runningSum %= k;\n }\n\n\n // if a number is followed by 6 or 0, the next modulo does not change, which is okay\n // however, if there are several 0s in sequence, it is still fine to have consecutive zeroes and the solution should still work\n // e.g. consider 5, 2, 4 and k = 6. The moduloes look like 5, 1, 5 and there need to be atleast 2 numbers processed between both moduloes\n // in the case of 0, 0 and k = 0, the moduloes are 0,0 but the solution is still valid, even though the indexes are next to each other. so we add 0,-1 to fix this condition\n sums.put(0, -1);\n if (sums.containsKey(runningSum)) {\n\n // the modulo numbers cannot be adjacent to each other, so difference in indexes must be at least 2.\n // special conditions are 6 and 0/\n if (i - sums.get(runningSum) >= 2) {\n return true;\n }\n } else {\n sums.put(runningSum, i);\n }\n }\n\n return false;\n }",
"public boolean solution(int[] bits) {\n int length = bits.length ;\n if(bits[length - 1] == 1){\n return false;\n }\n int index =0;\n boolean flag = true;\n while(index < length){\n if(bits[index] == 0){\n index +=1 ;\n flag = true;\n }else{\n index +=2 ;\n flag = false;\n }\n }\n return flag;\n }",
"public boolean isZero(int count) {\n\t\treturn count == 0;\n\t}",
"protected boolean arrayIsEmpty(Object arr[]) {\n boolean empty = true;\n \n for (Object obj : arr) {\n \tif (obj != null) {\n \t\tempty = false;\n \t\tbreak;\n \t}\n }\n \treturn empty;\n }",
"public boolean isZero() {\n\t\treturn x == 0.0 && y == 0.0 && z == 0.0;\n\t}",
"public boolean isFull(int[][] grid) {\n for (int row = 0; row < 9; row++){\n for (int col = 0; col < 9; col++) {\n if (grid[row][col] == 0) return false;\n }\n }\n return true;\n }",
"public boolean isEmpty() {\r\n\tfor (int i = 0; i < this.size; i++) {\r\n\t if (this.territory[0][i] != 0 || this.territory[1][i] != 0) {\r\n\t\treturn false;\r\n\t }\r\n\t}\r\n\r\n\treturn true;\r\n }",
"public boolean isZero() {\r\n return (this.getReal() == 0 && this.getImag() == 0) ? true : false;\r\n }",
"public boolean almostZero(Coordinates a);",
"private static boolean isFilled(int[][] sudoku) {\r\n for (int i = 0; i < 16; i++) {\r\n for (int j = 0; j < 16; j++) {\r\n if (sudoku[i][j] == -1) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }",
"private static int findMissing(int[] arr, int totalCount) {\n int nSum = totalCount * (totalCount + 1) / 2;\n int actualSum = Arrays.stream(arr).sum();\n return nSum - actualSum;\n }",
"public static Boolean settingValuesToZero(){\n resultsMap.replaceAll((k, v) -> v = 0);\n Integer sum = 0;\n for (Integer v : resultsMap.values()) {\n sum += v;\n if (sum == 0) {\n return true;\n }\n\n }\n return false;\n }",
"boolean getComputeSumNull();",
"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 }",
"static boolean allSame(int freq[], int N)\n {\n int same = 0;\n\n // get first non-zero element\n int i;\n for (i = 0; i < N; i++) {\n if (freq[i] > 0) {\n same = freq[i];\n break;\n }\n }\n\n // check equality of each element with variable same\n for (int j = i + 1; j < N; j++)\n if (freq[j] > 0 && freq[j] != same)\n return false;\n\n return true;\n }",
"boolean isZero();",
"@Override\n public boolean isEmpty() {\n\t/*\n\t * Sum per-segment modCounts to avoid mis-reporting when\n\t * elements are concurrently added and removed in one segment\n\t * while checking another, in which case the table was never\n\t * actually empty at any point. (The sum ensures accuracy up\n\t * through at least 1<<31 per-segment modifications before\n\t * recheck.) Methods size() and containsValue() use similar\n\t * constructions for stability checks.\n\t */\n\tlong sum = 0L;\n\tfinal Segment<K, V>[] segments = this.segments;\n\tfor (int j = 0; j < segments.length; ++j) {\n\t Segment<K, V> seg = segmentAt(segments, j);\n\t if (seg != null) {\n\t\tif (seg.count != 0) {\n\t\t return false;\n\t\t}\n\t\tsum += seg.modCount;\n\t }\n\t}\n\tif (sum != 0L) { // recheck unless no modifications\n\t for (int j = 0; j < segments.length; ++j) {\n\t\tSegment<K, V> seg = segmentAt(segments, j);\n\t\tif (seg != null) {\n\t\t if (seg.count != 0) {\n\t\t\treturn false;\n\t\t }\n\t\t sum -= seg.modCount;\n\t\t}\n\t }\n\t if (sum != 0L) {\n\t\treturn false;\n\t }\n\t}\n\treturn true;\n }",
"static int findMissing(int arr[], int size)\n {\n \n //0 -10 1 3 -20\n int p1 = 0;\n int p2 = size-1;\n while (p1<p2) {\n if (arr[p1] > 0) {\n p1++;\n } else {\n int temp = arr[p2];\n arr[p2] = arr[p1];\n arr[p1] = temp;\n p2--;\n }\n }\n //1 3 0 -10 -20\n for (int i=0; i<=p1; i++) {\n int x = Math.abs(arr[i])-1;\n int y = arr[x];\n if (y>0 && y <= size) {\n arr[x] = y*-1;\n }\n }\n for (int i=0; i<size; i++) {\n if (arr[i] > 0) {\n return i+1;\n }\n }\n \n return p1+2;\n }",
"public int solution(int[] A) {\n // write your code in Java SE 8\n List<Integer> a = new ArrayList<>();\n for(int i = 0 ; i < A.length ; i++) {\n if(A[i] > 0) a.add(A[i]);\n }\n\n if(a.size() == 0) {\n return 1;\n }\n\n Collections.sort(a);\n int result = 1;\n for(Integer number : a) {\n if(number == result)\n result++;\n }\n return result;\n }",
"public static int countZeros(int numElements, int[] vals) {\r\n\t\t\r\n\t\tint numOfZeros = 0; // declaring needed variable\r\n\t\t\r\n\t\tfor(int i = 0; i < numElements; i++) {\r\n\t\t\t\r\n\t\t\tif(vals[i] == 0) {\r\n\t\t\t\t\r\n\t\t\t\tnumOfZeros++; // iterating through each index and determine if the element value contains a zero. If contains zero, increment variable by one.\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\t\r\n\t\treturn numOfZeros; // return value to main\r\n\t}",
"boolean isNilScansArray(int i);",
"public boolean isEmpty(int[][] grid) {\n for (int row = 0; row < 9; row++){\n for (int col = 0; col < 9; col++) {\n if (grid[row][col] != 0) return false;\n }\n }\n return true;\n }",
"public int firstMissingPositive(int[] nums) {\n int len = nums.length;\n if (len == 0) {\n return 1;\n }\n boolean[] orderBools = new boolean[len + 2];\n for (int num: nums) {\n if (num < 0 || num > len + 1) {\n continue;\n }\n orderBools[num] = true;\n }\n\n for (int i = 1; i < len + 2 ; i++) {\n if (!orderBools[i]) {\n return i;\n }\n }\n\n return 1;\n }",
"public boolean checkIfExist(int[] arr) {\n int len = arr.length;\n\n Set<Integer> set = new HashSet<>();\n for (int num : arr) {\n if (set.contains(num*2) || (num%2==0 && set.contains(num/2))) return true;\n set.add(num);\n }\n\n return false;\n }",
"public boolean isZero() {\r\n Vector3 veucl3 = this.getEuclidVector3();\r\n return (veucl3 == null) ? false : veucl3.isZero();\r\n }",
"public boolean isZero() {\n\t\treturn ((get() >> 7) & 1) == 1;\n\t}",
"public boolean quotientIsZero(int[] input) {\n\t\tboolean isZero = false;\n\t\tfor(int i = 0; i < input.length; i+=2) {\n\t\t\tint generator = input[i];\n\t\t\tif( (getRelations().get(generator) != null) && (input[i+1] >= getRelations().get(generator)) ) {\n\t\t\t\tisZero = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn isZero;\n\t}",
"public boolean isEmpty(){\n\t\treturn (howMany==0);\n\t}",
"public boolean checkSubarraySum(int[] nums, int k){\n\t\tif(nums == null || nums.length == 0)\n\t\t\treturn false;\n\t\tint sum = 0;\n\t\tHashMap<Integer, Integer> map = new HashMap<>();\n\t\tmap.put(0,-1);\n\t\tfor( int i = 0; i<nums.length; i++){\n\t\t\tsum+=nums[i];\n\t\t\tif(k!=0)\n\t\t\t\tsum = sum % k;\n\t\t\tif(map.containsKey(sum)){\n\t\t\t\tif(i - map.get(sum) > 1)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmap.put(sum,i);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isZero() {\n\n return realPart == 0d && imaginaryPart == 0d;\n }",
"public boolean almostZero(double a);",
"public boolean zeroFinder()\n {\n return zeroFinder(0);\n }",
"public boolean isZero()\r\n\t{\r\n\t\tif(this.get_coefficient()==0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"static boolean find3Numbers(int A[], int arr_size, int sum) {\n\t\t// Fix the first element as A[i] \n\t\tfor (int i = 0; i < arr_size - 2; i++) {\n\t\t\t// Find pair in subarray A[i+1..n-1] \n\t\t\t// with sum equal to sum - A[i] \n\t\t\tHashSet<Integer> s = new HashSet<Integer>();\n\t\t\tint curr_sum = sum - A[i];\n\t\t\tfor (int j = i + 1; j < arr_size; j++) {\n\t\t\t\tif (s.contains(curr_sum - A[j])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\ts.add(A[j]);\n\t\t\t}\n\t\t}\n\n\t\t// If we reach here, then no triplet was found \n\t\treturn false;\n\t}",
"public boolean isEmpty() {\n\t\treturn (N == 0);\t\n\t}",
"protected int checkAllCardsAppliedHaveZeroBalance() {\r\n boolean allCardsValuesAreZero = true;\r\n Iterator giftCardIterator = getGiftCardList().iterator();\r\n GiftCard tempGiftCard = null;\r\n int numBlankCards = 0;\r\n \r\n while (giftCardIterator.hasNext()) {\r\n tempGiftCard = (GiftCard) giftCardIterator.next();\r\n if (!tempGiftCard.getIsBlank() && tempGiftCard.getAmountAvailable() != 0.0d) {\r\n return NO_ERRORS;\r\n }\r\n if (tempGiftCard.getIsBlank()) {\r\n numBlankCards++;\r\n }\r\n }\r\n \r\n if (numBlankCards == getMaxNumGiftCards() || numBlankCards == getGiftCardList().size()) {\r\n return NO_ERRORS;\r\n }\r\n \r\n return ALL_CARDS_ARE_ZERO;\r\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 }",
"boolean checkTie(){\n for (int aGameBoard : gameBoard){\n if (aGameBoard == 0)\n return false;\n }\n return true;\n }",
"public int solution(int[] A) {\n\n\t\tHashSet<Integer> set = new HashSet<>();\n\n\t\tfor (int i = 0; i < A.length; i++)\n\t\t\tset.add(A[i]);\n\n\t\tfor (int i = 1; i < A.length + 1; i++) \n\t\t\tif (!set.contains(i)) return 0;\n\n\t\treturn 1;\n\t}",
"private static boolean doesFirstRowContainZero(int[][] matrix,MatrixSize matrixSize){\n boolean rowFlag=false;\n for(int i=0;i<matrixSize.numberOfColumns;i++)\n {\n if(matrix[0][i]==0){\n rowFlag=true;\n break;\n }\n }\n return rowFlag;\n }",
"static int solution(int[] c) {\n \n int count = 0, i = 0;\n \n while (i < c.length - 1) {\n if (c[i] == 0) {\n if (i + 2 < c.length && c[i + 2] == 0) {\n count++;\n i = i + 2;\n } else if (c[i + 1] == 0) {\n count++;\n i = i + 1;\n }\n }\n }\n return count;\n }",
"public int[] isEverywhere(int[] nums, int val) {\n\n\t\tfor (int i=0; i<nums.length-1; i++) {\n\t\t\tif (nums[i] != val && nums[i+1] != val) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public static Boolean isSumGtrThan100(int array[])\n\t{\n\t\tint sum = 0;\n\t\t\n\t\t// Sum array\n\t\tfor (int i = 0; i < array.length; i++)\n\t\t\tsum += array[i];\n\t\t\n\t\t// Check if more than 100\n\t\treturn sum > 100;\n\t}",
"public static boolean allElmtRowIs0(Matriks m, int idx) {\n boolean is0 = true;\n int j=0;\n while (j<m.kolom && is0) {\n is0 = m.ELMT[idx][j] == 0;\n j++;\n }\n return is0;\n }",
"public boolean completado(int[][] solar) {\n\t\tboolean exito = true;\n\t\tfor (int f = 0; f < solar.length; f++) {\n\t\t\tfor (int c = 0; c < solar.length; c++) {\n\t\t\t\tif (solar[f][c] == 0) {\n\t\t\t\t\texito = false;\n\t\t\t\t\tc = f = solar.length;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn exito;\n\t}",
"public int solution(int[] A)\n {\n \n if(A.length == 0 && A.length == 1)\n return 0;\n \n int currentOneSum = 0;\n int totalOneSum = 0;\n int currentZeros = 0;\n \n for (int i = 0; i < A.length; i++)\n \n if(A[i] == 1)\n \n currentOneSum++;\n \n if(A[i] == 0 || i == A.length-1)\n \n totalOneSum += currentZeros * currentOneSum;\n currentOneSum = 0;\n currentZeros++;\n \n return Math.abs(totalOneSum) <= Math.pow(10,9) ? totalOneSum : -1;\n \n }",
"public int firstMissingPositive(int[] A) {\n if (A.length == 0) {\n\t\t\treturn 1;\n\t\t}\n int max = 0;\n for (int i = 0; i < A.length; i++) {\n\t\t\tmax = Math.max(max, A[i]);\n\t\t}\n int[] array = new int[max];\n for (int i = 0; i < A.length; i++) {\n\t\t\tif (A[i] > 0) {\n\t\t\t\tarray[A[i] - 1] = 1;\n\t\t\t}\n\t\t}\n for (int i = 0; i < max; i++) {\n\t\t\tif (array[i] == 0) {\n\t\t\t\treturn i+1;\n\t\t\t}\n\t\t}\n return max + 1;\n }",
"private static int findMissingNumber(int[] nums) {\n int n = nums.length;\n int sum = n;\n for (int i = 0; i < n; i++) {\n sum += i - nums[i];\n }\n return sum;\n }",
"public Boolean check(int[] ints, int target) {\n\n\t\t//store seen sums less than target\n\t\tLinkedHashSet<Integer> seenSums = new LinkedHashSet<>();\n\n\t\tfor (int anInt : ints) { //O(n)\n\n\t\t\t//suppose that target in array fits requirements\n\t\t\tif(anInt == target) return true;\n\n\t\t\t//obviously all ints that larger than target won't work\n\t\t\tif(anInt > target) continue;\n\n\t\t\t//\n\t\t\tint addAnIntToTarget = target - anInt;\n\n\t\t\tif(seenSums.contains(addAnIntToTarget)) //O(1)\n\t\t\t\treturn true;\n\n\t\t\tLinkedHashSet<Integer> newSeenSums = new LinkedHashSet<>();\n\t\t\tnewSeenSums.add(anInt);\n\t\t\tfor (Integer seenSum : seenSums) { //O(n)\n\t\t\t\tInteger newSeenSum = seenSum + anInt;\n\n\t\t\t\tif(!newSeenSums.contains(newSeenSum))\n\t\t\t\t\tnewSeenSums.add(newSeenSum);\n\t\t\t}\n\t\t\tseenSums = newSeenSums;\n\t\t}\n\n\t\treturn false;\n\t}",
"public boolean isEmpty()\r\n { return N == 0; }",
"public boolean checkSubarraySum(int[] nums, int k) {\n int N = nums.length;\n if (N == 0)\n return false;\n Map<Integer, Integer> m = new HashMap();\n int sum = 0;\n m.put(0, -1);\n for (int i = 0; i < N; i++) {\n sum += nums[i];\n if (k != 0 )\n sum %= k;\n if (m.containsKey(sum)) {\n if (i - m.get(sum) >= 2)\n return true;\n } else {\n m.put(sum, i);\n }\n }\n return false;\n }",
"public boolean isEmpty() {\n return elements == 0;\n }",
"@Requires(\"c != null\")\n protected static boolean cigarHasZeroSizeElement(final Cigar c) {\n for (final CigarElement ce : c.getCigarElements()) {\n if (ce.getLength() == 0)\n return true;\n }\n return false;\n }",
"private static boolean tilesAreNotFilled(int[][] grid) {\n\t\tfor(int i = 0; i < BOUNDARY; i++) {\n\t\t\tfor(int j = 0; j < BOUNDARY; j++) {\n\t\t\t\tif(grid[i][j] == 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isEmpty() {\n\t\treturn elements == 0;\n\t}",
"public static void main(String[] args) {\n\tint[] a={0,1,2,-3,-2,3,4,5,-3,2};\r\n\tint zerosum=0; \r\n\tfindZeroSum(a,zerosum);\r\n\t}",
"public static int sum_negative(int[] array) {\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (array[i] < 0) {\n\t\t\t\tsum += array[i];\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}",
"public boolean isEmpty() {\n\t\treturn array.isEmpty();\n\t}",
"public void removeZeros(ArrayList<Integer> arr) {\n\t\tfor (int i = arr.size() -1; i > -1; i--) {\n\t\t\tif(arr.get(i) == 0){\n\t\t\t\tarr.remove(i);\n\t\t\t}\n\t\t}\n\t}",
"private static boolean check(int[] data) {\n int a[]=new int[8];\n a[0]=data[0]+data[1]+data[2];\n a[1]=data[3]+data[4]+data[5];\n a[2]=data[8]+data[7]+data[6];\n a[3]=data[0]+data[3]+data[6];\n a[4]=data[1]+data[4]+data[7];\n a[5]=data[2]+data[5]+data[8];\n a[6]=data[0]+data[4]+data[8];\n a[7]=data[2]+data[4]+data[6];\n for (int i = 0; i <a.length ; i++) {\n for (int j = i+1; j <a.length; j++) {\n if (a[i]==a[j]){\n return false;\n }\n }\n }\n return true;\n }",
"boolean SubArraySum( int arr[] , int n , int sum ){\n HashSet<Integer> s = new HashSet<Integer>();\n int pre_sum = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n pre_sum += arr[i];\n if( pre_sum == sum ) // Corner case if pre-sum is equal to sum.\n return true;\n if( s.contains(pre_sum - sum))\n return true;\n s.add(pre_sum);\n }\n return false;\n }",
"public boolean isZero() {return false;}",
"public static void sumZero(int n) {\n\t\tScanner input = new Scanner(System.in);\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr.add(input.nextInt());\n\t\t}\n\t\tfor (int i = 0; i < arr.size(); i++) {\n\t\t\tfor (int j = i + 1; j < arr.size(); j++) {\n\t\t\t\tif (arr.get(j) + arr.get(i) == 0) {\n\t\t\t\t\tSystem.out.println(arr.get(i) + \" \" + arr.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int[] countRowZeroes()\n\t{\n\t\tint[] zeros = new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tzeros[i]=0;\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tif(cost[i][j]==0)\n\t\t\t\t{\n\t\t\t\t\tzeros[i]++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn zeros;\n\t}",
"public int firstMissingPositive(int[] A) {\n int len = A.length;\n for (int i = 0; i < len; i++) {\n int x = A[i];\n while (x <= len && x > 0 && A[x - 1] != x) {\n int tmp = A[x - 1];\n A[x - 1] = x;\n x = tmp;\n }\n }\n for (int i = 0; i < len; i++) {\n if (A[i] != i + 1) {\n return i + 1;\n }\n }\n return len + 1;\n }",
"public int solution(int[] A) {\n int L = A.length;\n int[] B = new int[L+1];\n for(int i=0; i<L; i++) {\n int t = A[i];\n B[t-1] = t;\n }\n for(int j=0; j<L; j++) {\n if(B[j] == 0) {\n return j+1;\n }\n }\n return 0;\n }",
"private boolean isZeroRow(int myRow)\n\t{\n\t\tfor(int i = 0; i < cols; i++)\n\t\t{\n\t\t\tif(A[myRow][i] != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isGoal() {\n boolean result = false; \n for (int i = 0; i < this.N; i++) {\n for (int j = 0; j < this.N; j++) {\n int idx = (i * this.N) + (j + 1);\n if (idx != N * N - 1 && tiles[i][j] != idx) {\n return false;\n } \n if (idx == N * N - 1) {\n if (tiles[N - 1][N - 1] == 0) return true;\n return false;\n }\n }\n }\n return result;\n }",
"boolean bruteForce(int A[], int sum) {\n\n\t\t// Fix the first element as A[i]\n\t\tfor (int i = 0; i < A.length - 2; i++) {\n\n\t\t\t// Fix the second element as A[j]\n\t\t\tfor (int j = i + 1; j < A.length - 1; j++) {\n\n\t\t\t\t// Now look for the third number\n\t\t\t\tfor (int k = j + 1; k < A.length; k++) {\n\t\t\t\t\tif (A[i] + A[j] + A[k] == sum) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If we reach here, then no triplet was found\n\t\treturn false;\n\t}",
"public static boolean findSum3Bool(int[] a, int x){\r\n\t\tint begin = 0, end = a.length -1, sum;\r\n\t\twhile(begin < a.length -1 && (end >= 0)){\r\n\t\t\tsum = a[begin] + a[end];\r\n\t\t\tif(sum < x){\r\n\t\t\t\tbegin++;\r\n\t\t\t}else if(sum > x){\r\n\t\t\t\tend--;\r\n\t\t\t}else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean isEmpty() {\r\n\t\tfor (double d : values) {\r\n\t\t\tif (!Double.isNaN(d)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public boolean isEmpty() {\r\n return N == 0;\r\n }",
"public boolean isEmpty() {\n return N == 0;\n }",
"boolean hasArray();",
"public static void findTriplets(int[] arr,int n)\n {\n boolean found = false;\n for (int i=0;i<n-2;i++)\n {\n for (int j=i+1; j<n-1; j++)\n {\n for(int k=j+1; k<n;k++)\n {\n if(arr[i]+arr[j]+arr[k] == 0)\n {\n System.out.println(arr[i]);\n System.out.println(\" \");\n System.out.println(arr[j]);\n System.out.println(\" \");\n System.out.println(arr[k]);\n System.out.println(\"\\n\");\n found = true;\n }\n }\n }\n }\n //if no triplet with 0 sum found in arrat\n if(found == false)\n System.out.println(\"not exist\");\n }",
"public boolean isEmpty() {\n return b < 0;\n }",
"public boolean isZero()\n {\n return Native.fpaIsNumeralZero(getContext().nCtx(), getNativeObject());\n }",
"public static boolean findNumbers(double Array[], int arraySize, double sum) {\n //outter loop keeps first number unless it has to change\n for (int i = 0; i < arraySize - 2; i++) {\n //middle loop keeps second number unless it has to change \n for (int j = i + 1; j < arraySize - 1; j++) {\n //changes the every time and will break function if sum is found\n for (int k = j + 1; k < arraySize; k++) {\n //conditional staement if found print and return true \n if (Array[i] + Array[j] + Array[k] == sum) {\n System.out.print(\"Triplet is \" + Array[i] + \" ,\" + Array[j] + \" ,\" + Array[k]);\n return true;\n }\n }\n }\n }\n\n // If we reach here then nothing was found \n return false;\n }"
] | [
"0.73357826",
"0.7171955",
"0.70769614",
"0.6724334",
"0.6608179",
"0.6487638",
"0.6461739",
"0.6429311",
"0.64239866",
"0.6412211",
"0.64004177",
"0.6337407",
"0.6329434",
"0.62532806",
"0.6208304",
"0.6206468",
"0.62060815",
"0.6150434",
"0.60990816",
"0.60741186",
"0.60463196",
"0.6044115",
"0.6043692",
"0.6034842",
"0.6031752",
"0.60287225",
"0.5987333",
"0.5975951",
"0.5963387",
"0.5961228",
"0.5959742",
"0.5957997",
"0.5956053",
"0.59457666",
"0.5936636",
"0.5916178",
"0.59160054",
"0.5902654",
"0.589643",
"0.5886143",
"0.5880967",
"0.5865442",
"0.5864252",
"0.58633614",
"0.5859835",
"0.5858097",
"0.5856442",
"0.5822161",
"0.58077633",
"0.5798869",
"0.57983804",
"0.57836074",
"0.57742727",
"0.5766495",
"0.5763603",
"0.5762069",
"0.5761234",
"0.5756035",
"0.57535374",
"0.57524604",
"0.57501507",
"0.5749834",
"0.57459974",
"0.5741468",
"0.5739952",
"0.5713973",
"0.56991106",
"0.56982386",
"0.5695381",
"0.5695104",
"0.56878453",
"0.5687735",
"0.5683956",
"0.5683073",
"0.5674922",
"0.5665305",
"0.5657676",
"0.5657166",
"0.56436694",
"0.56417525",
"0.5641254",
"0.56359446",
"0.5631569",
"0.5629729",
"0.5628829",
"0.5618112",
"0.56129164",
"0.5610424",
"0.5608686",
"0.5607038",
"0.5602245",
"0.5598907",
"0.55937415",
"0.5590327",
"0.55853146",
"0.5583897",
"0.5579631",
"0.5574169",
"0.55701596",
"0.55655867",
"0.55581814"
] | 0.0 | -1 |
a N^2logn solution. sort the array at cost nlogn then for each tuple do a binary search for k. | public static void ThreeSum_binsearch(int[] a, int k)
{
// sort the array
Arrays.sort(a);
for (int i = 0; i < a.length; ++i)
{
for (int j = i+1; j < a.length; ++j)
{
int diff = k - (a[i] + a[j]);
int idx = Arrays.binarySearch(a, j+1, a.length, diff);
if (idx > 0)
{
System.out.println("[" + a[i] + "," + a[j] + "," + a[idx] + "]");
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean findComplimentaryPair_O_NlogN(int []a, int k, int[] basket){\n\t\tQuickSort.qSort(a, 0, a.length-1);\n\t\tint i = 0;\t\t//left pointer\n\t\tint j = a.length - 1; // right pointer\n\n\t\twhile( i <= j){\n\t\t int s = a[i] + a[j];\n\t\t if(s < k){\n\t\t ++i;\n\t\t }else if( s > k ){\n\t\t --j;\n\t\t }else{\n\t\t basket[0] = i;\n\t\t basket[1] = j;\n\t\t return true;\n\t\t }\n\t\t }\n\t\t return false;\n\t}",
"private static int[] topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int n: nums){\n map.put(n, map.getOrDefault(n, 0) + 1);\n }\n\n // Step2: Build max heap.\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n for (int value: map.values()){\n pq.add(value);\n if (pq.size() > k){\n pq.poll();\n }\n }\n\n // Step3: Build result list.\n ArrayList<Integer> retList = new ArrayList<>();\n for (int n: pq){\n for (Map.Entry<Integer, Integer> entry: map.entrySet()){\n if (n == entry.getValue()){\n retList.add(entry.getKey());\n }\n }\n }\n\n return retList.stream().distinct().mapToInt(x -> x).toArray();\n }",
"public static void findKComplemenentaryPairs(int[] values, int k) {\n\t\t\n\t\t// first of all, we need to divide to conquer, let's build a binary tree\n\t\t// I will set root as K. This way, for each new value 'i' I will know which side of the tree\n\t\t// I should find 'j' \n\t\t\n\t\tLeaf root = new Leaf(k);\n\t\tcountIterations = 0;\n\t\tfor (int i = 0; i < values.length; i++) {\n\t\t\taddLeaf(root, values[i]);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.print(\"Tree built: \");\n\t\tprintTree(root); \t\t\t\t\t// this is just for debugging and will not be included in asymptotic analysis\n\t\tSystem.out.println(\"\\nTotal of \" + countIterations + \" iterations to build a tree for an array of \" + values.length + \" elements\");\n\t\t\n\t\tStringBuffer report = new StringBuffer();\n\t\t\n\t\tSystem.out.println(\"\\nPairs:\");\n\t\t// Trespass array and find value j that satisfies A[i] + A[j] = k\n\t\t\n\t\tint countTotal = 0;\n\t\tfor (int i = 0; i < values.length; i++) {\n\t\t\tcountIterations = 0;\n\t\t\tint val = values[i];\n\t\t\tint wanted = k - val;\n\t\t\tif (hasValue(root, wanted)) { \n\t\t\t\tSystem.out.println(\"- A[i,j] = [\" + val + \",\" + wanted + \"]\");\n\t\t\t}\n\t\t\treport.append(\"Iteration \" + i + \" took \" + countIterations + \" operations to search in the tree\\n\");\n\t\t\tcountTotal += countIterations;\n\t\t}\n\t\t\n\t\tSystem.out.println(report.toString());\n\t\tSystem.out.println(\"Total of operations for n=\" + values.length + \" was \" + countTotal + \" operations\");\n\t\t\n\t}",
"public static long solve(long[] data, long k) {\n int n = data.length;\n\n Buffer<Interval> buffer = new Buffer<>(Interval::new, x -> {}, n * 2);\n\n Randomized.shuffle(data);\n Arrays.sort(data);\n\n List<Interval> lastLevel = new ArrayList<>(n);\n List<Interval> curLevel = new ArrayList<>(n);\n lastLevel.add(newInterval(buffer, 0, n - 1));\n int level = Log2.floorLog(data[n - 1]);\n long mask = 0;\n for (; level >= 0; level--) {\n curLevel.clear();\n for (Interval interval : lastLevel) {\n int l = interval.l;\n int r = interval.r;\n int m = r;\n while (m >= l && Bits.get(data[m], level) == 1) {\n m--;\n }\n interval.m = m;\n }\n long total = 0;\n for (Interval interval : lastLevel) {\n total += (long) (interval.m - interval.l + 1) * (interval.relative.m - interval.relative.l + 1);\n total += (long) (interval.r - interval.m) * (interval.relative.r - interval.relative.m);\n }\n if (total < k) {\n k -= total;\n mask = Bits.set(mask, level, true);\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m && interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.r > interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m >= interval.relative.l) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n } else {\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n a.relative = a;\n curLevel.add(a);\n }\n if (interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = a;\n curLevel.add(a);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.l <= interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m < interval.relative.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n }\n\n for (Interval interval : lastLevel) {\n buffer.release(interval);\n }\n\n List<Interval> tmp = curLevel;\n curLevel = lastLevel;\n lastLevel = tmp;\n }\n\n return mask;\n }",
"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 }",
"public int findPairsTwoPointers(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Arrays.sort(nums); // O(N*logN)\n\n int i = 0;\n int j = 1;\n int count = 0;\n while (j < nums.length) { // O(N)\n if (i == j || nums[j] - nums[i] < k) {\n j++;\n } else if (nums[j] - nums[i] > k) {\n i++;\n } else {\n count += 1;\n j++;\n while (j < nums.length && nums[j] == nums[j - 1]) {\n j++;\n }\n }\n }\n return count;\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}",
"private static int solution2( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length );\n\t\t\n\t\tfor ( int i = 1; i <= k; ++i ) {\n\t\t\tfor ( int j = 0; j < a.length - i; ++j ) {\n\t\t\t\tif ( a[j] > a[j+1] ) {\n\t\t\t\t\tint tmp = a[j];\n\t\t\t\t\ta[j] = a[j+1];\n\t\t\t\t\ta[j+1] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//displayArray(a);\n\t\t}\n\t\t\n\t\treturn a[a.length-k];\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}",
"static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}",
"public static int findPairs(int[] nums, int k) {\n \tif(k<0){\n \t\treturn 0;\n \t}\n \t\n int re=0;\n Map<Integer, Integer> map=new HashMap<Integer, Integer>();\n for(int num: nums){\n \tif(map.containsKey(num)){\n \t\tif(k==0&&map.get(num)==1){\n \t\t\tre++;\n \t\t\tmap.put(num, 0);\n \t\t}\n \t\tcontinue;\n \t}\n \tif(map.containsKey(num+k)){\n \t\tre++;\n \t}\n \tif(map.containsKey(num-k)){\n \t\tre++;\n \t}\n \tmap.put(num, 1);\n }\n return re;\n }",
"public int kSum(int[] A, int k, int target) {\n\t\tint res=0;\r\n\t\t//考虑k=1的情况\r\n//\t\tif (k==1) {\r\n//\t\t\tfor(int i=0;i<A.length;i++) {\r\n//\t\t\t\tif (A[i]==target) {\r\n//\t\t\t\t\tres++;\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n//\t\t\treturn res;\r\n//\t\t}\r\n//\t\tint sum_k_1=0;\r\n//\t\tint sum=target-sum_k_1;\r\n//\t\tif (k>1 && k<A.length) {\r\n//\t\t\tfor(int i=0;i<A.length-1;i++) {\r\n//\t\t\t\tfor(int j=i+1;j<A.length;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//动态规划\r\n\t\tint n=A.length;\r\n\t\tint[][][] f=new int[n+1][k+1][target+1];\r\n\t\tfor(int i=0;i<n+1;i++) {\r\n\t\t\tf[i][0][0]=1;\r\n\t\t}\r\n\t\tfor(int i=1;i<=n;i++) {\r\n\t\t\tfor(int j=1;j<=k && j<=i;j++) {\r\n\t\t\t\tfor(int t=1;t<=target;t++) {\r\n\t\t\t\t\tf[i][j][t]=0;\r\n\t\t\t\t\tif (t>=A[i-1]) {\r\n\t\t\t\t\t\tf[i][j][t]=f[i-1][j-1][t-A[i-1]];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tf[i][j][t]+=f[i-1][j][t];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn f[n][k][target];\r\n }",
"private static void findKClosestNumbers(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Integer> pq;\n\t\tint max = findMaxInArr(arr);\n\t\tint min = findMinInArr(arr);\n\n\t\tint maxDiff = Math.abs(key - max);\n\t\tint minDiff = Math.abs(key - min);\n\n\t\tif (maxDiff <= minDiff) {\n\t\t\tpq = new PriorityQueue<>(Collections.reverseOrder());\n\t\t} else {\n\t\t\tpq = new PriorityQueue<>();\n\t\t}\n\n\t\tfor (int e : arr) {\n\t\t\tpq.add(e);\n\t\t}\n\n\t\tint c = 0;\n\n\t\twhile (c < k) {\n\t\t\tSystem.out.println(pq.remove());\n\t\t\tc++;\n\t\t}\n\n\t}",
"public int solution2(int[] nums, int k) {\n PriorityQueue<Integer> pq = new PriorityQueue<Integer>();\n \n for (int i : nums) {\n pq.offer(i);\n \n if (pq.size() > k) {\n pq.poll();\n }\n }\n \n \n return pq.peek();\n }",
"private static int findPairs(int[] nums, int k) {\n if(nums == null || nums.length == 0 || k < 0)\n return 0;\n\n int count = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i : nums)\n map.put(i, map.getOrDefault(i, 0) + 1);\n\n for(Map.Entry<Integer, Integer> entry : map.entrySet()) {\n if(k == 0) {\n if(entry.getValue() >= 2)\n count++;\n } else {\n if(map.containsKey(entry.getKey() + k))\n count++;\n }\n }\n return count;\n }",
"private static void findKClosestNumbersOtherApproach(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Pair<Integer, Integer>> pq = new PriorityQueue<>();\n\t\tint len = arr.length;\n\t\tint absDiff[] = new int[len];\n\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tabsDiff[i] = Math.abs(arr[i] - key);\n\t\t\tPair p = new Pair<>(absDiff[i], arr[i]);\n\t\t\tpq.add(p);\n\n\t\t}\n\n\t\tint c = 0;\n\t\tSystem.out.println(\"closest numbers\");\n\t\twhile (!pq.isEmpty() && c < k) {\n\t\t\tint k1 = (int) pq.peek().getValue(0);\n\t\t\tint v = (int) pq.peek().getValue(1);\n\n\t\t\tpq.remove();\n\t\t\tc++;\n\t\t\tSystem.out.println( v);\n\t\t}\n\n\t}",
"private static int search(int[] arr, int n, int x, int k) {\n\t\tint i = 0;\n\t\twhile (i < n) {\n\n\t\t\t// If x is found at index i\n\t\t\tif (arr[i] == x)\n\t\t\t\treturn i;\n\n\t\t\t// Jump the difference between\n\t\t\t// current array element and x\n\t\t\t// divided by k We use max here\n\t\t\t// to make sure that i moves\n\t\t\t// at-least one step ahead.\n\t\t\ti = i + Math.max(1, Math.abs(arr[i] - x) / k);\n\n\t\t}\n\n\t\tSystem.out.println(\"number is not\" + \" present!\");\n\n\t\treturn -1;\n\t}",
"static int numOfSubsets(int[] arr, int n, int k) {\n List<Integer> vect1 = new ArrayList<Integer>(); \n List<Integer> vect2 = new ArrayList<Integer>(); \n List<Integer> subset1 = new ArrayList<Integer>(); \n List<Integer> subset2 = new ArrayList<Integer>(); \n \n // ignore element greater than k and divide\n // array into 2 halves\n for (int i = 0; i < n; i++) {\n \n // ignore element if greater than k\n if (arr[i] > k)\n continue;\n if (i <= n / 2)\n vect1.add(arr[i]);\n else\n vect2.add(arr[i]);\n }\n \n // generate all subsets for 1st half (vect1)\n for (int i = 0; i < (1 << vect1.size()); i++) {\n int value = 1;\n for (int j = 0; j < vect1.size(); j++) {\n if (i & (1 << j))\n value *= vect1[j];\n }\n \n // add only in case subset product is less\n // than equal to k\n if (value <= k)\n subset1.add(value);\n }\n \n // generate all subsets for 2nd half (vect2)\n for (int i = 0; i < (1 << vect2.size()); i++) {\n int value = 1;\n for (int j = 0; j < vect2.size(); j++) {\n if (i & (1 << j))\n value *= vect2[j];\n }\n \n // add only in case subset product is\n // less than equal to k\n if (value <= k)\n subset2.add(value);\n }\n \n // sort subset2\n sort(subset2.begin(), subset2.end());\n \n int count = 0;\n for (int i = 0; i < subset1.size(); i++)\n count += upper_bound(subset2.begin(), subset2.end(),\n (k / subset1[i]))\n - subset2.begin();\n \n // for null subset decrement the value of count\n count--;\n \n // return count\n return count;\n }",
"public int kthSum(int[] A, int[] B, int k) {\n // Best First Search, need a minHeap on the value of each Pair\n PriorityQueue<Pair> minHeap = new PriorityQueue<>(k, new MyComparator());\n // all the generated cells will be marked true to avoid being generated more than once\n boolean[][] visited = new boolean[A.length][B.length];\n minHeap.offer(new Pair(A, 0, B, 0));\n visited[0][0] = true;\n // iterate k - 1 rounds, and Best First Search the smallest k - 1 values\n for (int q = 0; q < k - 1; q++) {\n Pair cur = minHeap.poll();\n // the neighbor Pair will be inserted into the minHeap only if\n // 1. it is not out of boundary\n // 2. it has not been generated before\n if (cur.row + 1 < A.length && !visited[cur.row + 1][cur.col]) {\n minHeap.offer(new Pair(A, cur.row + 1, B, cur.col));\n visited[cur.row + 1][cur.col] = true;\n }\n if (cur.col + 1 < B.length && !visited[cur.row][cur.col + 1]) {\n minHeap.offer(new Pair(A, cur.row, B, cur.col + 1));\n visited[cur.row][cur.col + 1] = true;\n }\n }\n return minHeap.peek().value;\n }",
"public static int[] mostCompetitive(int[] nums, int k) {\n int[] copy = Arrays.copyOf(nums, nums.length); // 复制一个数组\n Arrays.sort(copy); // 排序\n for (int value : copy) { // 挨个顺序作为最小竞争子序列的头元素\n for (int j = 0; j < nums.length; j++) {\n if (nums[j] == value) {\n // 判断后续元素个数可够k长度\n if(k == 1){\n int[] ret = new int[1];\n ret[0] = nums[j];\n return ret;\n }\n if (j + k > nums.length) break;\n else if (j + k == nums.length) return Arrays.copyOfRange(nums, j, nums.length);\n else {\n int[] child = Arrays.copyOfRange(nums, j + 1, nums.length);\n int[] childMost = mostCompetitive(child, k - 1);\n System.out.println(Arrays.toString(childMost));\n // 取前k-1即为最优解\n int[] ret = new int[k];\n ret[0] = nums[j];\n System.arraycopy(childMost, 0, ret, 1, k - 1);\n System.out.println(Arrays.toString(ret));\n return ret;\n }\n }\n }\n }\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n /* 2\n 4 3 3 5 4 9 6 3\n 3\n 3 5 4 9 6 3\n 2\n 5 4 9 6\n 1\n */\n return Arrays.copyOf(nums, k); // 这步不会执行\n }",
"static int printpairs(int arr[],int k)\n {\n\t\tint count = 0; // Initialize count\n\t\tint size = arr.length;\n\t\t // Declares and initializes the whole array as false\n boolean[] binmap = new boolean[MAX];\n\n // Insert array elements to hashmap\n for(int i=0; i<size; i++)\n \t binmap[arr[i]] = true;\n \n for(int i=0; i<size; i++)\n {\n \t int temp = arr[i]- k;\n \t\n \t if (temp >= 0 && binmap[temp])\n \t {\n \t\t System.out.println(\"Pair with given diff \" + k + \" is (\" + arr[i] + \", \"+temp+\")\");\n \t\t count++;\n \t }\n \n \t temp = arr[i]+ k;\n if (temp < MAX && binmap[temp])\n {\n \t\t System.out.println(\"Pair with given diff \" + k + \" is (\" + arr[i] + \", \"+temp+\")\");\n \t\t count++;\n \t }\n binmap[temp] = false;\n }\n \n return count++;\n }",
"private static int solution( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint res = -1;\n\t\t\n\t\treturn res;\n\t\t\n\t}",
"private static int solution1(int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length );\n\t\tdisplayArray(a);\n\t\tArrays.sort(a);\n\t\tdisplayArray(a);\n\t\t\n\t\treturn a[a.length - k];\n\t}",
"private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }",
"private static List<Integer> getTopKFrequentElementsBestCase(int[] nums, int k) {\n if(k > nums.length) {\n return new ArrayList<>();\n }\n\n Map<Integer, Integer> numToCount = new HashMap<>();\n int max = 0;\n for(int i = 0; i < nums.length; i++) {\n numToCount.put(nums[i], numToCount.getOrDefault(nums[i], 0) + 1);\n max = Math.max(max, numToCount.get(nums[i]));\n }\n\n List<Integer>[] numsPerFrequency = new ArrayList[max + 1];\n for(int i = 1; i <= max; i++) {\n numsPerFrequency[i] = new ArrayList<>();\n }\n\n for(Map.Entry<Integer, Integer> entry : numToCount.entrySet()) {\n numsPerFrequency[entry.getValue()].add(entry.getKey());\n }\n\n List<Integer> result = new ArrayList<>();\n\n for(int i = max; i >= 0; i--) {\n List<Integer> numsWithThisFreq = numsPerFrequency[i];\n\n for(int num : numsWithThisFreq) {\n result.add(num);\n if(result.size() == k) {\n return result;\n }\n }\n }\n\n return new ArrayList<>();\n }",
"private int findKth(int A[], int B[], int i, int j, int k) {\n\n if (i >= A.length) {\n return B[k - 1];\n }\n\n if (j >= B.length) {\n return A[k - 1];\n }\n\n if (k == 1) {\n return A[i] < B[j] ? A[i] : B[j];\n }\n\n int l = k / 2;\n int r = k - l;\n\n if (A.length - i < l) {\n l = A.length - i;\n r = k - l;\n } else if (B.length - j < r) {\n r = B.length - j;\n l = k - r;\n }\n\n if (A[i + l - 1] == B[j + r - 1]) {\n return A[i + l - 1];\n } else if (A[i + l - 1] > B[j + r - 1]) {\n return findKth(A, B, i, j + r, k - r);\n } else {\n return findKth(A, B, i + l, j, k - l);\n }\n }",
"public int findPairs(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Set<Integer> unique = new HashSet<>();\n Set<Integer> duplicate = new HashSet<>();\n for (int n : nums) {\n if (!unique.add(n)) {\n duplicate.add(n);\n }\n }\n if (k == 0) {\n return duplicate.size();\n }\n int count = 0;\n for (int v : unique) {\n if (unique.contains(v + k)) {\n count += 1;\n }\n }\n return count;\n }",
"public int solution1(int[] nums, int k) {\n final int N = nums.length;\n Arrays.sort(nums);\n \n return nums[N-k];\n }",
"private static void find_coins(int[] d, int k, int n) {\n\t\t\n\t}",
"private static int optimalBinary(int[][] costMatrix, int[] key, int[] values, int[][] nodeMatrix) {\n\t\tint min=0;\n\t\tint n= values.length;\n\t\tint r;\n\t\tint currentSum=0;\n\t\t\n\t\tfor(int size=1;size<=n; size++){\n\t\t\t////System.out.println(\"size \"+size);\n\t\t\tfor(int l=1;l<=n-size+1;l++){\n\t\t\t\tcurrentSum=0;\n\t\t\t\tr=l+size-1;\n\t\t\t\tmin = costMatrix[l][r];\n\t\t\t\t////System.out.println(\"\"+l+r);\n\t\t\t\tint sum1=0;\n\t\t\t\tfor(int k=l;k<=r;k++){\n\t\t\t\t\tsum1+=values[k-1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(l==r){\n\t\t\t\t\tmin=values[l-1];\n\t\t\t\t}else{\n\t\t\t\t\tfor(int k=l;k<=r;k++){\n\t\t\t\t\t\t////System.out.println(\" :::: K which is root \" +k+ \" : \" +l+ \" \" +(k-1)+ \" \"+ (k+1)+\" \"+ r +\" : \");\n\t\t\t\t\t\tcurrentSum = sum1 + costMatrix[l][k-1]+ ( (k+1 <= n) ? costMatrix[k+1][r] : 0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(currentSum<min){ \n\t\t\t\t\t\t\tmin=currentSum;\n\t\t\t\t\t\t\tnodeMatrix[l][r]=k;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcostMatrix[l][r]= min;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn min;\n\t}",
"public int[] topKFrequent(int[] nums, int k) {\n Map<Integer, Integer> map = new HashMap();\n for(int num : nums) {\n map.put(num, map.getOrDefault(num, 0) + 1);\n }\n\n /*\n * List<int[]> list\n * List of int[]\n\n * List<Integer>[] array\n * Array of List<Integer>\n */\n List<Integer>[] bucket = new ArrayList[nums.length + 1];\n for(int key : map.keySet()) {\n int freq = map.get(key);\n\n if(bucket[freq] == null) {\n List<Integer> list = new ArrayList();\n list.add(key);\n\n bucket[freq] = list;\n } else {\n bucket[freq].add(key);\n }\n }\n\n int[] result = new int[k];\n int index = 0;\n for(int i = bucket.length - 1; i >= 0; i--) {\n if(bucket[i] != null) {\n for(int num : bucket[i]) {\n result[index] = num;\n index++;\n\n if(index == k) {\n return result;\n }\n }\n }\n }\n\n return result;\n }",
"void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }",
"public static int[] sortInNk(int[] input, int k) {\r\n int length = input.length;\r\n int[] map = new int[k];\r\n int[] output = new int[length];\r\n\r\n // get min O(n)\r\n // this block can be replaced with\r\n // min = input[0];\r\n // it will reduce time complexity but\r\n // than the size of the map would have to be increased\r\n int min = Integer.MAX_VALUE;\r\n for (int currentValue : input) {\r\n if (currentValue < min) {\r\n min = currentValue;\r\n }\r\n }\r\n\r\n // create map O(n)\r\n for (int currentValue : input) {\r\n map[currentValue - min]++;\r\n }\r\n\r\n // map to output O(n)\r\n int mapIter = 0;\r\n for (int i = 0; i < length; i++) {\r\n while (map[mapIter] == 0) {\r\n mapIter++;\r\n if (mapIter == length) {\r\n break;\r\n }\r\n }\r\n // FIXME can this block be done better?\r\n while (map[mapIter] > 0) {\r\n output[i] = min + mapIter;\r\n map[mapIter]--;\r\n if (map[mapIter] > 0) {\r\n i++;\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n }",
"public List<Integer> topKFrequent(int[] nums, int k) {\n\n\tList<Integer>[] bucket = new List[nums.length + 1];\n\tMap<Integer, Integer> frequencyMap = new HashMap<Integer, Integer>();\n\n\tfor (int n : nums) {\n\t\tfrequencyMap.put(n, frequencyMap.getOrDefault(n, 0) + 1);\n\t}\n\n\t// assgin elements in bucket and frequency will serve as bucket index\n\tfor (int key : frequencyMap.keySet()) {\n\t\tint frequency = frequencyMap.get(key);\n\t\tif (bucket[frequency] == null) {\n\t\t\tbucket[frequency] = new ArrayList<>(); // imp step\n\t\t}\n\t\tbucket[frequency].add(key);\n\t}\n\n\tList<Integer> res = new ArrayList<>();\n\n\tfor (int pos = bucket.length - 1; pos >= 0 && res.size() < k; pos--) {\n\t\tif (bucket[pos] != null) {\n\t\t\tres.addAll(bucket[pos]);\n\t\t}\n\t}\n\treturn res;\n}",
"public List<Integer> findClosestElements2(int[] arr, int k, int x) {\r\n List<Integer> res = new LinkedList<>();\r\n int i=0, j=arr.length-k;\r\n while (i<j){\r\n int m = i + (j-i)/2;\r\n if (x-arr[m]>arr[m+k]-x){\r\n i=m+1;\r\n }\r\n else j=m;\r\n }\r\n // System.out.println(i);\r\n while (k>0){\r\n res.add(arr[i++]);\r\n k--;\r\n }\r\n return res;\r\n }",
"private static boolean kthSmallesElementFound(int[] list1, int[] list2, int nElementsList1, int nElementsList2) {\n if(nElementsList2 < 1) {\n return true;\n }\n\n if(list1[nElementsList1-1] == list2[nElementsList2-1]) {\n return true;\n }\n\n if(nElementsList1 == list1.length) {\n return list1[nElementsList1-1] <= list2[nElementsList2];\n }\n\n if(nElementsList2 == list2.length) {\n return list2[nElementsList2-1] <= list1[nElementsList1];\n }\n\n return list1[nElementsList1-1] <= list2[nElementsList2] && list2[nElementsList2-1] <= list1[nElementsList1];\n }",
"public static int findIdxOfGreatestValueLesserThanOrEqualToN(long[] a, long n) {\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\t// int loops = 0;\n\t\twhile (lo <= hi) {\n\t\t\t// ++loops;\n\t\t\t// Key is in a[lo..hi] or not present.\n\t\t\tint mid = lo + (hi - lo) / 2;\n\t\t\tif (n < a[mid]) hi = mid - 1;\n\t\t\telse if (n > a[mid]) lo = mid + 1;\n\t\t\telse return mid; // Equality Match!\n\t\t}\n\t\t// System.err.println(\"k: \" + n + \", loops: \" + loops);\n\t\tif (hi < 0) return -1; // Less than lowest\n\t\telse if (lo >= a.length) return a.length - 1; // Greater than highest\n\t\telse return hi; // Greatest lower element\n\t}",
"public boolean containsNearbyDuplicate2(int[] nums, int k) {\n if (nums == null || nums.length == 0)\n return false;\n\n Map<Integer, Integer> numByIndex = new HashMap<>();\n for(int i = 0; i< nums.length; i++){\n if(numByIndex.containsKey(nums[i])){\n final Integer pos1 = numByIndex.get(nums[i]);\n if (Math.abs(pos1-i)<=k) {\n return true;\n }\n }\n numByIndex.put(nums[i], i);\n }\n return false;\n\n }",
"public List<Integer> topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int num : nums) {\n map.put(num, map.getOrDefault(num, 0) + 1);\n }\n\n List<Integer>[] bucket = new List[nums.length + 1];\n for (int num : map.keySet()) {\n int freq = map.get(num);\n if (bucket[freq] == null) {\n bucket[freq] = new ArrayList<>();\n }\n bucket[freq].add(num);\n }\n List<Integer> res = new ArrayList<>();\n for (int i = bucket.length - 1; i >= 0 && res.size() < k; i--) {\n if (bucket[i] != null) {\n res.addAll(bucket[i]);\n }\n }\n return res;\n }",
"static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }",
"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 }",
"static void findTwoSum(List<List<Integer>> list, int[] nums, int k) {\n \tint target = 0 - nums[k]; // 7 -> check a + b = 7 (target)\n int fi = 0;\n int la = k - 1;\n\n while (fi < la) {\n if (nums[fi] + nums[la] == target) {\n list.add(Arrays.asList(nums[fi], nums[la], nums[k]));\n while (fi < nums.length - 1 && nums[fi] == nums[fi + 1]) {\n \tfi++;\n }\n fi++;\n }\n else if (nums[fi] + nums[la] < target)\n fi++;\n else\n la--;\n }\n }",
"public List<Integer> findClosestElements(int[] arr, int k, int x) {\r\n\r\n\t\tint n = arr.length;\r\n\r\n\t\tif (n == 0 || k == 0) {\r\n\t\t\treturn new ArrayList<>();\r\n\t\t}\r\n\r\n\t\tif (x <= arr[0]) {\r\n\t\t\treturn copy(arr, 0, k);\r\n\t\t}\r\n\r\n\t\tif (x >= arr[n - 1]) {\r\n\t\t\treturn copy(arr, n - k, k);\r\n\t\t}\r\n\r\n\t\tint idx = Arrays.binarySearch(arr, 0, n - 1, x);\r\n\r\n\t\tif (idx < 0) {\r\n\t\t\tidx = -(idx + 1);\r\n\t\t}\r\n\r\n\t\tint l = idx - 1, r = arr[idx] == x ? idx + 1 : idx;\r\n\t\tLinkedList<Integer> dq = new LinkedList<>();\r\n\r\n\t\tif (arr[idx] == x) {\r\n\t\t\tdq.addLast(x);\r\n\t\t}\r\n\r\n\t\twhile (l >= 0 && l >= idx - k && r <= idx + k && r < n) {\r\n\t\t\tif (dq.size() == k) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (Math.abs(x - arr[l]) <= Math.abs(x - arr[r])) {\r\n\t\t\t\tdq.addFirst(arr[l]);\r\n\t\t\t\tl--;\r\n\t\t\t} else {\r\n\t\t\t\tdq.addLast(arr[r]);\r\n\t\t\t\tr++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (dq.size() != k) {\r\n\t\t\tif (l < 0) {\r\n\t\t\t\tdq.addLast(arr[r++]);\r\n\t\t\t} else {\r\n\t\t\t\tdq.addFirst(arr[l--]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn dq;\r\n\t}",
"public int[] getLeastNumbers2(int[] arr, int k) {\n if (k == 0) {\n return new int[0];\n }\n PriorityQueue<Integer> queue = new PriorityQueue<>((n1, n2) -> n2 - n1);\n for (int i = 0; i < k; i++) {\n queue.add(arr[i]);\n }\n for (int i = k; i < arr.length; i++) {\n if (arr[i] < queue.peek()) {\n queue.poll();\n queue.add(arr[i]);\n }\n }\n int[] results = new int[k];\n int i = 0;\n while (!queue.isEmpty()) {\n results[i++] = queue.poll();\n }\n return results;\n }",
"private static int solution4( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tMaxHeapTree heap = new MaxHeapTree(arr);\n\t\tSystem.out.printf(\"Time complexity: construct = %d\", heap.count);\n\t\t\n\t\tint res = Integer.MIN_VALUE;\n\t\t\n\t\tfor ( int i = 0; i < k; ++i ) {\n\t\t\tres = heap.getMax();\n\t\t}\n\t\tSystem.out.printf(\", total = %d\\n\", heap.count);\n\t\t\n\t\t\n\t\treturn res;\n\t}",
"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 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 static int getSmallerThanOrEqualToKCount(int[] a, int k){\n int left=0, right=a.length-1;\n while(left<right){\n int mid=left+(right+1-left)/2;\n if(a[mid]>k){\n right=mid-1;\n } else{\n left=mid;\n }\n }\n return left-0+1;\n }",
"static int getMinimumCost(int k, Integer[] c) {\n\tArrays.sort(c, Collections.reverseOrder());\n\tint[] num = new int[k];\n\tint total = 0;\n\tfor (int ind = 0; ind < c.length; ind++) {\n\t int v = ind % k;\n\t total += (num[v]++ + 1) * c[ind];\n\t}\n\n\treturn total;\n }",
"public int maxFrequency2(int[] nums, int k) {\n Arrays.sort(nums);\n int i = 0;\n int j = 0;\n long sum = k;\n for (int n = nums.length; j < n; j++) {\n sum += nums[j];\n if (sum < (long)nums[j] * (j - i + 1)) {\n sum -= nums[i++];\n }\n }\n return j - i;\n }",
"public static long maximumSubarraySum_bf(int[] nums, int k) {\n int len = nums.length;\n\n long ans = 0;\n for (int i = 0; i <= len - k; i++) {\n long sum = 0;\n Set<Integer> set = new HashSet<>();\n for (int j = 0; j < k; j++) {\n if (set.contains(nums[i + j])) {\n sum = 0;\n break;\n }\n\n set.add(nums[i + j]);\n sum += nums[i + j];\n }\n\n ans = Math.max(ans, sum);\n }\n\n return ans;\n }",
"public boolean checkSubarraySum(int[] nums, int k) {\n int N = nums.length;\n if (N == 0)\n return false;\n Map<Integer, Integer> m = new HashMap();\n int sum = 0;\n m.put(0, -1);\n for (int i = 0; i < N; i++) {\n sum += nums[i];\n if (k != 0 )\n sum %= k;\n if (m.containsKey(sum)) {\n if (i - m.get(sum) >= 2)\n return true;\n } else {\n m.put(sum, i);\n }\n }\n return false;\n }",
"int help(int n, int k, int[][] map) {\n if (n <= 0 || k < 0) return 0;\n if (0 == k) return 1;\n if (1 == k) return n - 1;\n if (map[n][k] > 0) return map[n][k];\n long sum = 0;\n for (int i = 1; i <= k; i ++) {\n for (int j = 0; j < n; j ++) {\n// System.out.println(\"i = \" + i + \", j = \" + j + \", j - i = \" + (j - i) + \", j + i = \" + (j + i) + \", f0 = \" + (n - j + i - 1) + \", f1 = \" + (n - j - i - 1) + \", k - i = \" + (k - i));\n int g = 0, g0 = 0, g1 = 0;\n if (j - i >= 0) {\n g += help(n - j + i - 1, k - i, map);\n sum += g;\n// System.out.println(\"g0 = \" + g0 + \", g1 = \" + g1 + \", g = \" + g + \", sum = \" + sum);\n// System.out.println(\"-\");\n }\n }\n\n }\n// System.out.println(\"sum = \" + sum + \" ----\");\n map[n][k] = (int)sum;\n return (int)sum;\n }",
"public List<Integer> topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map=new HashMap<Integer, Integer>();\n for(int num:nums)\n {\n if(map.containsKey(num))\n map.put(num, map.get(num)+1);\n else\n map.put(num,1);\n }\n\t\t//make min heap\n PriorityQueue<Node> pq=new PriorityQueue<Node>(new Comparator<Node>(){\n public int compare(Node a, Node b)\n {\n return a.count-b.count;\n }\n });\n for(int key:map.keySet())\n {\n Node n=new Node(key, map.get(key));\n pq.offer(n);\n if(pq.size()>k)\n pq.poll();\n }\n List<Integer> list=new ArrayList<Integer>();\n while(!pq.isEmpty())\n {\n list.add(pq.poll().n);\n }\n \n return list;\n }",
"public static void main(String[] args) throws java.lang.Exception {\n\n Scanner scn = new Scanner(System.in);\n\n int t = scn.nextInt();\n\n while (t != 0) {\n int n = scn.nextInt();\n\n int arr[] = new int[n];\n\n for (int i = 0; i < n; i++) {\n\n arr[i] = scn.nextInt();\n\n }\n int pos = scn.nextInt();\n long element = arr[pos-1];\n\n Arrays.sort(arr);\n \n for(int i=0;i<n;i++)\n System.out.print(arr[i]+\" \");\n \n System.out.println();\n System.out.println(bsearch(arr, element) +1 );\n t--;\n }\n\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 }",
"static int binSearch(int []arr,int key) {\n\t\tint start=0;\n\t\tint end=arr.length-1;\n\t\tdo {\n\t\t\tint pc=(start+end)/2;\n\t\t\tif(arr[pc]==key) {\n\t\t\t\treturn pc;\n\t\t\t}else if(arr[pc]<key) {\n\t\t\t\tstart=pc+1;\n\t\t\t}else\n\t\t\t\tend=pc-1;\n\t\t}while(start<=end);\n\t\t\n\t\treturn -1;\n\t}",
"public boolean containsNearbyAlmostDuplicate1(int[] nums, int k, int t) {\n if (nums.length < 2 || k <= 0 || t < 0) {\n return false;\n }\n Map<Long, Long> map = new HashMap<>();\n long w = t + 1;\n for (int i = 0; i < nums.length; i++) {\n long m = convert((long) nums[i], w);\n if (map.containsKey(m)) {\n return true;\n }\n if (map.containsKey(m - 1) && Math.abs((long) nums[i] - map.get(m - 1)) <= t) {\n return true;\n }\n if (map.containsKey(m + 1) && Math.abs((long) nums[i] - map.get(m + 1)) <= t) {\n return true;\n }\n map.put(m, (long) nums[i]);\n if (i >= k) {\n map.remove(convert((long) nums[i - k], w));\n }\n }\n return false;\n }",
"private static int solution3( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\t// Store the first k elements in a temporary array\n\t\tint[] tmp = Arrays.copyOfRange( arr, 0, k);\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length);\n\t\tint res = Integer.MAX_VALUE;\n\t\t\n\t\t\n\t\t// Loop for n-k times: each times for element in a[k] to a[n-1], find the largest to switch with tmp[j] for j = 0 to k-1\n\t\tfor ( int i = 0; i < k; ++i ) {\n\t\t\tint max = tmp[i];\n\t\t\tint index = i;\n\t\t\t\n\t\t\tfor ( int j = k; j < a.length; ++j ) {\n\t\t\t\tif ( a[j] > max ) {\n\t\t\t\t\tmax = a[j];\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( index != i ) {\n\t\t\t\ta[index] = tmp[i];\n\t\t\t\ttmp[i] = max;\n\t\t\t}\n\t\t\t\n\t\t\tres = Math.min(res, tmp[i]);\n\t\t}\n\t\t\n\t\t\n\t\treturn res;\n\t}",
"static int minSwap (int arr[], int n, int k) {\n int c=0;\n for(int i=0;i<n;i++)\n {\n if(arr[i]<=k)\n ++c;\n }\n int c1=0;\n int start=0,end=c;\n for(int j=0;j<end;j++)\n {\n if(arr[j]>k)\n ++c1;\n }\n int minans=c1;\n while(end<n)\n {\n if(arr[start]>k)\n --c1;\n if(arr[end]>k){\n ++c1;\n }\n minans=Math.min(minans,c1);\n start++;\n end++;\n }\n return minans;\n //Complete the function\n }",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public static void main(String[] args) {\n int[] array_1 = { 2, 1, 5, 1, 3, 2 };\n int k_1 = 3;\n\n int[] array_2 = { 2, 3, 4, 1, 5 };\n int k_2 = 2;\n\n// System.out.println(findMaxSumSubArray(array_1, k_1));\n// System.out.println(findMaxSumSubArray(array_2, k_2));\n\n int[] array3 = { 2, 1, 5, 2, 3, 2 };\n System.out.println(findMinSubArray(7, array3));\n }",
"public static void getLeastNumbers_2(int[] input, int[] output) {\n int start = 0;\n int end = input.length - 1;\n int k = output.length;\n int index = partition(input, start, end);\n while(index != k - 1) {\n if(index > k - 1) {\n end = index - 1;\n index = partition(input, start, end);\n }\n else {\n start = index + 1;\n index = partition(input, start, end);\n }\n }\n \n for(int i = 0; i < k; ++i)\n output[i] = input[i];\n }",
"public static void main(String[] args){\n int n;int k;\n Scanner sc=new Scanner(System.in);\n n=sc.nextInt();\n k=sc.nextInt();\n int[] a=new int[n];\n int[] reMain=new int[k];\n int num=0;\n for(int i=0;i<k;i++){\n reMain[i]=0;\n }\n for(int i=0;i<n;i++){\n int d=sc.nextInt()%k;\n reMain[d]++;\n }\n int p=0;\n if(k%2==0)\n p=k/2;\n else p=(k+1)/2;\n for(int i=1;i<p;i++){\n if(reMain[i]>reMain[k-i])\n num+=reMain[i];\n else\n num+=reMain[k-i];\n \n }\n if(reMain[p]%2==1 && k%2==0)\n num++;\n if(k==2)\n num=reMain[1];\n \n \n System.out.println(num);\n\t}",
"private static int findKthSmallestElementUsingQuickSelect(int[] a, int low, int high, int k) {\n\n //CHECKS\n //In your original method check if array is null or empty\n //k is from 1 to n\n\n //If k is smaller than number of elements in array\n if (k > 0 && k <= a.length) {\n\n int pi = partition(a, low, high);\n\n if (pi == k - 1) {\n return a[pi];\n }\n if (pi > k - 1) {\n return findKthSmallestElementUsingQuickSelect(a, low, pi - 1, k);\n } else {\n return findKthSmallestElementUsingQuickSelect(a, pi + 1, high, k);\n }\n }\n return Integer.MAX_VALUE;\n }",
"public int subarraySumLeetCode(int[] nums, int k) {\n int count = 0;\n for (int start = 0; start < nums.length; start++) {\n for (int end = start + 1; end <= nums.length; end++) {\n int sum = 0;\n for (int i = start; i < end; i++) {\n sum += nums[i];\n }\n if (sum == k) {\n count++;\n }\n }\n }\n return count;\n }",
"public static double binSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n Arrays.sort(a);\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n Arrays.binarySearch(a, searchVar);\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tint T = sc.nextInt();\r\n\t\t\r\n\t\tfor (int z = 1; z <= T; z++) {\r\n\t\t\tint N = sc.nextInt();\r\n\t\t\tint[] input = new int[N+1];\r\n\t\t\t\r\n\t\t\tfor (int j = 1; j <= N; j++) {\r\n\t\t\t\tinput[j] = sc.nextInt();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint[] weight = new int[N+1];\r\n\t\t\tint[] memWeight = new int[N+1];\r\n\t\t\t\r\n\t\t\tint cnt = 1;\r\n\t\t\tweight[1] = 1;\r\n\t\t\tmemWeight[1] = input[1]; \r\n\t\t\tfor (int j = 2; j <= N; j++) {\r\n\t\t\t\tfor (int k = cnt; k >= 1 ; k--) {\r\n\t\t\t\t\tif(input[j] > memWeight[k] && k == cnt) {\r\n\t\t\t\t\t\tmemWeight[++cnt] = input[j];\r\n\t\t\t\t\t\tweight[j] = cnt;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(input[j] > memWeight[k] && k < cnt) {\r\n\t\t\t\t\t\tmemWeight[k+1] = input[j];\r\n\t\t\t\t\t\tweight[j] = cnt;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(k == 1) {\r\n\t\t\t\t\t\tmemWeight[k] = input[j] < memWeight[k] ? input[j] : memWeight[k];\r\n\t\t\t\t\t\tweight[j] = cnt;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// result\r\n\t\t\tint maxV = -1;\r\n\t\t\tfor (int i = 1; i <= N; i++) {\r\n\t\t\t\tif(maxV < weight[i]) {\r\n\t\t\t\t\tmaxV = weight[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"#\"+z+\" \"+maxV);\r\n\t\t}\r\n\t\t\r\n\t\tsc.close();\r\n\t}",
"public static int orderStatistics(int[] array, int k){\r\n\t\tk = k - 1; // since array index starts with 0\r\n\t\treturn kSmall(array, 0, array.length - 1, k);\r\n\t}",
"public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n\n if(nums==null||nums.length<2||k<0||t<0)\n return false;\n\n TreeSet<Long> sortedElems = new TreeSet<>();\n\n for(int i = 0; i< nums.length; i++){\n\n final long num = (long)nums[i];\n\n final long left = num - t;\n final long right = num + t+1;\n final SortedSet<Long> foundElems = sortedElems.subSet(left, right);\n if(!foundElems.isEmpty()){\n return true;\n }\n sortedElems.add(num);\n\n if(i>=k){\n sortedElems.remove((long)nums[i-k]);\n }\n\n }\n return false;\n\n\n }",
"public boolean containsNearbyDuplicate(int[] nums, int k) {\n \tint len=nums.length;\n \tif(len<2){\n \t\treturn false;\n \t}\n \tHashMap<Integer,Integer> map=new HashMap<Integer,Integer>();\n \tfor(int i=0; i<len; i++){\n \t\tif(!map.containsKey(nums[i])){\n \t\t\tmap.put(nums[i], i);\n \t\t}else{\n \t\t\tif((i-map.get(nums[i])<=k)){\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tmap.put(nums[i], i);\n \t\t}\n \t}\t\n \treturn false; \n }",
"private static <Key extends Comparable<Key> > void sink(Key [] a,int k, int n){\n while(2*k<=n){\n int max=2*k;\n if(max<n &&less(a, max, max+1)) max++;\n if(!less(a,k,max)) break; \n exch(a,max,k);\n k=max;\n }\n }",
"ArrayList <Integer> nearlySorted(int arr[], int num, int k)\n {\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n ArrayList<Integer> res = new ArrayList<>();\n for(int i=0;i<k+1;i++){\n pq.add(arr[i]);\n }\n \n for(int i=k+1;i<num;i++){\n res.add(pq.remove());\n pq.add(arr[i]);\n }\n \n while(pq.size()>0){\n res.add(pq.remove());\n }\n \n return res;\n }",
"private static void task2(int nUMS, BinarySearchTree<Integer> t) {\n\t\tSystem.out.println(\"Binary Search Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\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 List<int[]> kSmallestPairs(int[] nums1, int[] nums2, int k) {\n return null;\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 cntDisPairs(int arr[], int N, int K) {\n\t\t// Stores count of distinct pairs\n\t\t// whose sum equal to K\n\t\tint cntPairs = 0;\n\n\t\t// Sort the array\n\t\tArrays.sort(arr);\n\n\t\t// Stores index of\n\t\t// the left pointer\n\t\tint i = 0;\n\n\t\t// Stores index of\n\t\t// the right pointer\n\t\tint j = N - 1;\n\n\t\t// Calculate count of distinct\n\t\t// pairs whose sum equal to K\n\t\twhile (i < j) {\n\n\t\t\t// If sum of current pair\n\t\t\t// is equal to K\n\t\t\tif (arr[i] + arr[j] == K) {\n\n\t\t\t\t// Remove consecutive duplicate\n\t\t\t\t// array elements\n\t\t\t\twhile (i < j && arr[i] == arr[i + 1]) {\n\n\t\t\t\t\t// Update i\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\t// Remove consecutive duplicate\n\t\t\t\t// array elements\n\t\t\t\twhile (i < j && arr[j] == arr[j - 1]) {\n\n\t\t\t\t\t// Update j\n\t\t\t\t\tj--;\n\t\t\t\t}\n\n\t\t\t\t// Update cntPairs\n\t\t\t\tcntPairs += 1;\n\n\t\t\t\t// Update i\n\t\t\t\ti++;\n\n\t\t\t\t// Update j\n\t\t\t\tj--;\n\t\t\t}\n\n\t\t\t// if sum of current pair\n\t\t\t// less than K\n\t\t\telse if (arr[i] + arr[j] < K) {\n\n\t\t\t\t// Update i\n\t\t\t\ti++;\n\t\t\t} else {\n\n\t\t\t\t// Update j\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\treturn cntPairs;\n\t}",
"public static void main(String[] args) {\n String res = \"1\";\r\n for (int i = 0; i < 100; i++) res += '0';\r\n MAX = new BigInteger(res);\r\n generate(\"1\", 1, 1);\r\n generate(\"2\", 1, 4);\r\n generate(\"3\", 1, 9);\r\n Arrays.sort(values);\r\n// System.out.println(count);\r\n\r\n// for (int i = 0; i < 100; i++) {\r\n// System.out.println(values[i]);\r\n// }\r\n\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n try {\r\n String line = br.readLine();\r\n int K = Integer.parseInt(line);\r\n for (int i = 1; i <= K; i++) {\r\n String[] v = br.readLine().split(\" \");\r\n BigInteger A = new BigInteger(v[0]);\r\n BigInteger B = new BigInteger(v[1]);\r\n\r\n int p1 = Arrays.binarySearch(values, A);\r\n if (p1 < 0) {\r\n p1 = -p1 - 1;\r\n }\r\n int p2 = Arrays.binarySearch(values, B);\r\n if (p2 < 0) {\r\n p2 = -p2 - 1;\r\n } else {\r\n p2++;\r\n }\r\n int result = p2 - p1;\r\n //System.out.println(p1 + \" \" + p2);\r\n System.out.println(\"Case #\" + i + \": \" + result);\r\n\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\r\n }\r\n }",
"private static int select (int[] arr, int p, int n, int k){\n //threshold of 17\n if(n < 17 ){\n insertionSort(arr, p, p+n-1);\n return arr[p + n - k];\n }else{\n int q = randomizedPartition(arr,p,p+n-1);\n int left = q-p;\n int right = n - left - 1;\n if(right >= k)\n return select(arr,q+1,right,k);\n else if(right + 1 == k )\n return arr[q];\n else\n return select(arr,p,left,k-right-1);\n }\n }",
"private Double find_kth_element(Object arr[], int left, int right, int k) {\n\t\t\n\t\tif (k >= 0 && k <= right - left + 1) {\n\t\t\tint pos = random_partition(arr, left, right), offset = pos - left;\n\t\t\tif (offset == k - 1)\n\t\t\t\treturn (Double)arr[pos];\n\t\t\telse if (offset > k - 1)\n\t\t\t\treturn find_kth_element(arr, left, pos - 1, k);\n\t\t\treturn find_kth_element(arr, pos + 1, right, k - pos + left - 1);\n\t\t}\n\t\treturn null; // return null when k is invalid\n\t}",
"public boolean containsNearbyDuplicate(int[] nums, int k) {\n if (nums.length == 0) {\n return false;\n }\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n Integer index = map.get(nums[i]);\n if (index != null && i - index <= k) {\n return true;\n } else {\n map.put(nums[i], i);\n }\n }\n\n return false;\n }",
"private static int bSearch(int[] elements, int key) {\n int left = 0, right = elements.length - 1, mid = 0;\n while (left <= right) {\n mid = (left + right) / 2;\n\n if (key < elements[mid]) {\n right = mid - 1;\n } else if (key == elements[mid]) {\n return mid;\n } else {\n left = mid + 1;\n }\n }\n return -1;\n }",
"public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }",
"private static void p347() {\n int[] nums1 = {5, 5, 5, 3, 1, 1};\n int k1 = 2;\n int[] ret1 = topKFrequent(nums1, k1);\n System.out.println(Arrays.toString(ret1));\n// int[] nums2 = {1, 2};\n// int k2 = 2;\n// int[] ret2 = topKFrequent(nums2, k2);\n// System.out.println(Arrays.toString(ret2));\n int[] nums3 = {5, 5, 5, 5, 2, 2, 2, 4, 4, 1};\n int k3 = 2;\n int[] ret3 = topKFrequentOptimize(nums3, k3);\n System.out.println(Arrays.toString(ret3));\n\n int[] nums4 = {5, 5, 5, 5, 2, 2, 2, 4, 4, 4, 1};\n int k4 = 2;\n int[] ret4 = topKFrequentUsingBucket(nums4, k4);\n System.out.println(Arrays.toString(ret4));\n\n// int[] nums5 = {1};\n// int k5 = 1;\n// int[] ret5 = topKFrequentUsingBucket(nums5, k5);\n// System.out.println(Arrays.toString(ret5));\n }",
"public int subarraySumLeetcode3(int[] nums, int k) {\n int count = 0, sum = 0;\n HashMap<Integer, Integer> map = new HashMap<>();\n map.put(0, 1);\n for (int i = 0; i < nums.length; i++) {\n sum += nums[i];\n if (map.containsKey(sum - k)) {\n count += map.get(sum - k);\n }\n map.put(sum, map.getOrDefault(sum, 0) + 1);\n }\n return count;\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for(int arr_i=0; arr_i < n; arr_i++){\n int integer = in.nextInt();\n list.add(new Integer(integer));\n }\n in.close();\n\n\n\n if(k == 1){\n System.out.println(k);\n return;\n }\n\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i) % k;\n list.set(i, x);\n }\n\n int[] kx = new int[k];\n for(int i = 0;i < k;i ++){\n kx[i] = 0;\n }\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i);\n kx[x] ++;\n }\n\n\n int num = 0;\n int A = 0;\n if(k % 2 == 0){\n A = k / 2 - 1;\n }else{\n A = k / 2;\n }\n if(kx[0] != 0){\n num += 2;\n }\n for(int i = 1; i <= A;i ++){\n if(kx[i] >= kx[k - i]){\n num += kx[i];\n }else {\n\n num += kx[k - i];\n }\n\n }\n System.out.println(num);\n }",
"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 }",
"static int workbook(int n, int k, int[] arr) {\n int specialProblems = 0;\n int page = 1;\n for (int i = 0; i < n; i++) {\n for (int j = 1; j <= arr[i]; j++) {\n if (j == page)\n specialProblems++;\n if (j % k == 0)\n page++;\n }\n if (arr[i] % k != 0) page++;\n }\n return specialProblems;\n }",
"public static int findKth(int k, int [] A, int aStart, int[] B, int bStart) {\n if (aStart >= A.length) {\n return B[bStart + k - 1];\n }\n if (bStart >= B.length) {\n return A[aStart + k - 1];\n }\n if (k == 1)\n return Math.min(A[aStart], B[bStart]);\n\n int aMid = aStart + k / 2 - 1;\n int bMid = bStart + k / 2 - 1;\n\n int aValue = aMid < A.length ? A[aMid] : Integer.MAX_VALUE;\n int bValue = bMid < B.length ? B[bMid] : Integer.MAX_VALUE;\n\n if (aValue < bValue) {\n return findKth(k - k / 2, A, aMid + 1, B, bStart);\n } else {\n return findKth(k - k / 2, A, aStart, B, bMid + 1);\n }\n }",
"public List<Integer> findClosestElements(int[] arr, int k, int x) {\n int low = 0;\n int high = arr.length - 1;\n while (high - low >= k) {\n if (Math.abs(arr[low] - x) > Math.abs(arr[high] - x)) {\n low++;\n } else {\n high--;\n }\n }\n List<Integer> res = new ArrayList<>();\n for (int i = low; i <= high; i++) {\n res.add(arr[i]);\n }\n return res;\n }",
"private static ArrayList<Integer> mergKsort(int[][] arr) {\n\t\tArrayList<Integer> rv = new ArrayList<>();\r\n\t\tPriorityQueue<Pair> pq= new PriorityQueue<>();\r\n\t\t\t\t\r\n\t\tfor (int i=0;i<arr.length;i++) {\r\n\t\tPair p = new Pair(i,0,arr[i][0]);\r\n\t\t\tpq.add(p);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\twhile(pq.size()>0) {\r\n\t\t\tPair p=pq.remove();\r\n\t\t\trv.add(p.val);\r\n\t\t\tp.di++;\r\n\t\t\tif(p.di<arr[p.li].length) {\r\n\t\t\t\tp.val=arr[p.li][p.di];\r\n\t\t\t\tpq.add(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rv;\r\n\r\n\t}",
"public static List<Integer> topKFrequent(int[] nums, int k) {\n \tMap<Integer, Integer> map=new HashMap<Integer, Integer>();\n \tfor(int i=0; i<nums.length; i++){\n \t\tif(!map.containsKey(nums[i])){\n \t\t\tmap.put(nums[i], 1);\n \t\t}else{\n \t\t\tmap.put(nums[i], 1+map.get(nums[i]));\n \t\t}\n \t}\n \tList<Map.Entry<Integer, Integer>> list=new ArrayList<Map.Entry<Integer, Integer>>(map.entrySet());\n \tCollections.sort(list, new Comparator<Map.Entry<Integer, Integer>>(){\n \t\tpublic int compare( Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2){\n \t\t\treturn o2.getValue().compareTo(o1.getValue());\n \t\t}\n \t});\n \tList<Integer> re=new ArrayList<Integer>();\n \tfor(int i=0; i<k; i++){\n \t\tre.add(list.get(i).getKey());\n \t}\n \treturn re;\n }",
"public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int sum = sc.nextInt();\n int N = sc.nextInt();\n sc.nextLine();\n int [][] arr = new int[N][2];\n for(int i = 0;i<N;i++)\n {\n arr[i][0] = sc.nextInt();\n arr[i][1] = sc.nextInt();\n sc.nextLine();\n }\n //Arrays.sort(arr, new Comparator<int[]>() {\n // @Override\n // public int compare(int[] o1, int[] o2) {\n // return o1[1]-o2[1]; //按第二列价值排个序。\n // }\n //});\n int [][] dp = new int[N+1][sum+1];\n int [][] path = new int[N+1][sum+1];\n for(int i = 1;i<=N;i++)\n {\n for(int j = 1;j<=sum;j++)\n {\n if(j<arr[i-1][0])\n dp[i][j] = dp[i-1][j];\n else\n {\n if(dp[i-1][j]<dp[i-1][j-arr[i-1][0]]+arr[i-1][1])\n path[i][j] = 1;\n dp[i][j] = Math.max(dp[i-1][j],dp[i-1][j-arr[i-1][0]]+arr[i-1][1]);\n }\n }\n }\n System.out.println(dp[N][sum]);\n\n int i = N;\n int j = sum;\n while (i>0&&j>0)\n {\n if(path[i][j]==1)\n {\n System.out.print(1+\" \");\n j -=arr[i-1][0];\n }\n else\n {\n i--;\n System.out.print(0+\" \");\n }\n }\n\n\n // 改进版。只使用一维数组。\n // int [] f = new int[sum+1];\n // for(int i = 0;i<N;i++)\n // {\n // for (int j = sum;j>=0;j--)\n // {\n // if(j>=arr[i][0])\n // f[j] = Math.max(f[j], f[j-arr[i][0]]+arr[i][1]);\n // }\n // }\n // System.out.println(f[sum]);\n\n }",
"public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }",
"public List<List<Integer>> kSmallestPairs(int[] num1, int[] num2, int k) {\n LinkedList<List<Integer>> result = new LinkedList<>();\n if(num1 == null || num2 == null || num1.length == 0 || num2.length == 0 || k == 0) { return result; }\n \n PriorityQueue<Node> queue = new PriorityQueue<Node>((e1, e2) -> e1.sum - e2.sum);\n for(int id = 0; id < num1.length; id++) {\n queue.offer(new Node(num1[id], num2[0], 0));\n }\n \n \n while(k-- > 0 && !queue.isEmpty()) {\n Node tmp = queue.poll();\n result.add(Arrays.asList(tmp.f1, tmp.f2));\n if(tmp.index == num2.length - 1) { continue; }\n queue.offer(new Node(tmp.f1, num2[tmp.index + 1], tmp.index + 1));\n }\n \n return result;\n }",
"public static int[] topKFrequent(int[] nums, int k) {\n int[] a = new int[k];\n Map<Integer, Integer> map = new HashMap<Integer, Integer>();\n for (int i = 0; i < nums.length; i++) {\n if (map.containsKey(nums[i])) {\n map.put(nums[i], map.get(nums[i]) + 1);\n } else {\n map.put(nums[i], 1);\n }\n }\n\n PriorityQueue<Map.Entry<Integer, Integer>> maxHeap = new PriorityQueue<Map.Entry<Integer, Integer>>(k, Map.Entry.<Integer, Integer>comparingByValue().reversed());\n for (Map.Entry<Integer, Integer> e : map.entrySet()) {\n maxHeap.offer(e);\n }\n\n while (k > 0) {\n a[--k] = maxHeap.poll().getKey();\n }\n\n return a;\n }",
"public List<Integer> topKFrequent3(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int num : nums) {\n map.put(num, map.getOrDefault(num, 0) + 1);\n }\n\n TreeMap<Integer, List<Integer>> freqMap = new TreeMap<>();\n for (int num : map.keySet()) {\n int freq = map.get(num);\n if (freqMap.containsKey(freq)) {\n freqMap.get(freq).add(num);\n } else {\n freqMap.put(freq, new LinkedList<>());\n freqMap.get(freq).add(num);\n }\n }\n\n List<Integer> res = new ArrayList<>();\n while (res.size() < k) {\n Map.Entry<Integer, List<Integer>> entry = freqMap.pollLastEntry();\n res.addAll(entry.getValue());\n }\n return res;\n }",
"public static int cmpCost(int arr[][]) {\n\n\t\t//storage\n\t\tint f[][] = new int[arr.length][arr[0].length];\n\n\t\t//traverse and (define problem could have been done earlier\n\t\tfor (int i = arr.length - 1; i >= 0; i--) {\n\t\t\tfor (int j = arr[0].length - 1; j >= 0; j--) {\n\t\t\t\t//define smaller problem\n\t\t\t\tif (i == arr.length - 1 && j == arr[0].length - 1) {\n\t\t\t\t\tf[i][j] = arr[i][j];\n\t\t\t\t} else if (i == arr.length - 1) {\n\t\t\t\t\tf[i][j] = f[i][j + 1] + arr[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if (j == arr[0].length - 1) {\n\t\t\t\t\tf[i][j] = f[i + 1][j] + arr[i][j];\n\t\t\t\t} else {\n\t\t\t\t\tf[i][j] = Math.min(f[i + 1][j], f[i][j + 1]) + arr[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//result\n\t\treturn f[0][0];\n\t}",
"public int maxFrequency(int[] nums, int k) {\n Arrays.sort(nums);\n int n = nums.length;\n int res = 1;\n for (int i = 0, j = 1, cost = 0; j < n; ) {\n int nextCost = cost + (nums[j] - nums[j - 1]) * (j - i);\n if (nextCost <= k) {\n res = Math.max(res, ++j - i);\n cost = nextCost;\n } else {\n cost -= nums[j - 1] - nums[i++];\n }\n }\n return res;\n }"
] | [
"0.707936",
"0.64795977",
"0.6476309",
"0.646474",
"0.6462907",
"0.6391287",
"0.638839",
"0.6359801",
"0.62504834",
"0.62182754",
"0.6215921",
"0.6206116",
"0.6177642",
"0.6164281",
"0.6153437",
"0.6139607",
"0.6131052",
"0.61085945",
"0.6095488",
"0.60938084",
"0.608563",
"0.6075872",
"0.6074649",
"0.6059188",
"0.6056943",
"0.60473406",
"0.60448176",
"0.6019471",
"0.6018749",
"0.6017219",
"0.60161597",
"0.6014123",
"0.59940785",
"0.5989126",
"0.59823376",
"0.59699917",
"0.5966528",
"0.5960492",
"0.5951664",
"0.5951221",
"0.59488374",
"0.5930969",
"0.59237325",
"0.591123",
"0.5907847",
"0.59020513",
"0.5896293",
"0.5883422",
"0.58831894",
"0.5878979",
"0.5877715",
"0.58765954",
"0.5869303",
"0.5867402",
"0.5849347",
"0.5848975",
"0.58299047",
"0.5827146",
"0.58263797",
"0.582101",
"0.58128244",
"0.5805487",
"0.58038574",
"0.57974935",
"0.57972443",
"0.57861847",
"0.57855594",
"0.57786816",
"0.5778416",
"0.5777753",
"0.5774718",
"0.57725626",
"0.5770105",
"0.5761063",
"0.57596034",
"0.575149",
"0.5748497",
"0.57481986",
"0.5746812",
"0.57435495",
"0.574243",
"0.57417774",
"0.5734946",
"0.5733516",
"0.57314825",
"0.5728949",
"0.57274264",
"0.57265025",
"0.5718278",
"0.5703795",
"0.570231",
"0.5694842",
"0.5694148",
"0.5690517",
"0.56846076",
"0.5682078",
"0.5680085",
"0.56798494",
"0.5664382",
"0.56582487"
] | 0.6456618 | 5 |
Clamps the elapsed time from the game loop / Without this, objects can possibly be led tunneling through other objects or getting out of bounds | public static int clamp(int var, int min, int max) {
// Clamping means literally in this instance.
//// it's used to restrict a value to a given range
if (var >= max) {
return var = max;
} else if (var <= min) {
return var = min;
} else {
return var;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setTime(){\n gTime += ((float)millis()/1000 - millisOld)*(gSpeed/4);\n if(gTime >= 4) gTime = 0;\n millisOld = (float)millis()/1000;\n }",
"@Override\n public void timerTicked() {\n //subtracts one second from the timer of the current team\n if(state.getCurrentTeamsTurn() == Team.RED_TEAM) {\n state.setRedTeamSeconds(state.getRedTeamSeconds() - 1);\n } else {\n state.setBlueTeamSeconds(state.getBlueTeamSeconds() - 1);\n }\n }",
"public void pipeTimer() {\n float amountOfSecondsBetweenSpawns = 3;\n if (getRenderTimer() < amountOfSecondsBetweenSpawns) {\n setRenderTimer(getRenderTimer() + elapsedTime);\n return;\n }\n setRenderTimer(0);\n createPipes();\n }",
"public void tick() {\n\t\tfor(GameObject object : gameObject) {\n\t\t\tif(object instanceof Opponents) {\n\t\t\t\t((Opponents) object).move(tickTime);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Game has advanced by \" + tickTime + \" ms = \" + tickTime/1000 + \" ticks.\");\n\t}",
"public void resetTime() {\n\t\ttime_passed = 0l;\n\t}",
"@Override\r\n\tpublic void gameLoopLogic(double time) {\n\r\n\t}",
"public static void speedup(){\n\t\tif(bossair.periodairinit > Framework.nanosecond){\n\t\t\t\tbossair.periodair-=Framework.nanosecond/18; \n\t\t\t\tbossair.xmoving-=0.03; \n\t\t}\n\t\t\t\n\t}",
"private void setTimeLeft() {\n\t\tif (timeLeft == 1)\n\t\t\ttimer.cancel();\n\t\ttimeLeft--;\n\t}",
"protected void updateTime(float deltaTime) {\n }",
"public void step(double timeStep){\n\t\t\n\t\t//Base case of the recursive implementation --> end if we've basically reached negligible\n\t\t//amounts of time\n\t\tif(timeStep < TIME_EPSILON){\n\t\t\treturn;\n\t\t}\n\t\t\n//\t\t//Modify the velocities of all of the balls according to gravity and friction\n//\t\tfor(Ball ball : balls){\n//\t\t\tdouble vY = ball.getVel().y();\n//\t\t\tdouble vX = ball.getVel().x();\n//\t\t double newVY = vY + GRAVITY * timeStep;\n//\t\t double newVX = vX * (1 - MU_1 * timeStep - MU_2 * Math.abs(vX) * timeStep);\n//\t\t newVY = newVY * (1 - MU_1 * timeStep - MU_2 * Math.abs(newVY) * timeStep);\n//\t\t \n//\t\t ball.setVel(new Vect(newVX, newVY));\n//\t\t}\n\t\t\n\t\tBall collisionBall1 = null;\n\t\tBall collisionBall2 = null;\n\t\tBall collisionBall3 = null;\n\t\tGadget collisionGadget = null;\n\t\t\n\t\t//With the current velocities and positions determine the time for the next ball-ball\n\t\t//collision as well as the balls that actually collide\n\t\tdouble minTimeUntilBallBallCollision = Double.POSITIVE_INFINITY;\n\t\t\n\t\tif(balls.size() > 1){\n\t\t\tcollisionBall1 = balls.get(0);\n\t\t\tcollisionBall2 = balls.get(1);\n\t\t\tfor(int i = 0; i < balls.size() - 1; i++){\n\t\t\t\tfor(int j = i + 1; j < balls.size(); j++){\n\t\t\t\t\tBall ball1 = balls.get(i);\n\t\t\t\t\tBall ball2 = balls.get(j);\n\t\t\t\t\tif(!ball1.getInAbsorber() && !ball2.getInAbsorber()){\t\n\t\t\t\t\t\tdouble timeUntilCollision = ball1.impactCalc(ball2)[0];\n\t\t\t\t\t\tif (timeUntilCollision < minTimeUntilBallBallCollision){\n\t\t\t\t\t\t\tminTimeUntilBallBallCollision = timeUntilCollision;\n\t\t\t\t\t\t\tcollisionBall1 = ball1;\n\t\t\t\t\t\t\tcollisionBall2 = ball2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//With the current velocities and positions determine the time for the next ball-gadget\n\t\t//collision and determine the objects involved in that collision\n\t\tdouble minTimeUntilBallGadgetCollision = Double.POSITIVE_INFINITY;\n\t\tif(balls.size() > 0 && gadgets.size() > 0){\n\t\t\tcollisionBall3 = balls.get(0);\n\t\t\tcollisionGadget = gadgets.get(0);\n\t\t\tfor(Ball b : balls){\n\t\t\t\tif(!b.getInAbsorber()){\n\t\t\t\t\tfor(Gadget g : gadgets){\n\t\t\t\t\t\tdouble timeUntilCollision = ((BoardObject) g).impactCalc(b)[0];\n\t\t\t\t\t\t//System.out.println(g.getID() + \" \" +timeUntilCollision);\n\t\t\t\t\t\tif (timeUntilCollision < minTimeUntilBallGadgetCollision){\n\t\t\t\t\t\t\tminTimeUntilBallGadgetCollision = timeUntilCollision;\n\t\t\t\t\t\t\tcollisionBall3 = b;\n\t\t\t\t\t\t\tcollisionGadget = g;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t\t\n\t\t//Trivially progress the board if the next determined collision of any kind doesn't happen\n\t\t//within the time step\n\t\tif(Math.min(minTimeUntilBallBallCollision, minTimeUntilBallGadgetCollision) > timeStep){\n\t\t\tprogress(timeStep - TIME_EPSILON);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//If a ball-ball collision happens within the time step, progress the board trivially until\n\t\t//just before the collision, modify the ball velocities accordingly and recursively call the\n\t\t//step function passing the remaining time as the argument for step()\n\t\tif(minTimeUntilBallBallCollision < minTimeUntilBallGadgetCollision){\n\t\t\tprogress(minTimeUntilBallBallCollision - TIME_EPSILON);\n\t\t\t\n\t\t\tVect ball1Vel = new Vect(collisionBall2.impactCalc(collisionBall1)[1], collisionBall2.impactCalc(collisionBall1)[2]);\n\t\t\tVect ball2Vel = new Vect(collisionBall1.impactCalc(collisionBall2)[1], collisionBall1.impactCalc(collisionBall2)[2]);\n\t\t\t\n\t\t\tcollisionBall1.setVel(ball1Vel);\n\t\t\tcollisionBall2.setVel(ball2Vel);\n\t\t\t\n\t\t\tstep(timeStep - minTimeUntilBallBallCollision);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//In the final case, a ball-gadget collision occurs within the time step. In this case we\n\t\t//progress the board trivially until just before the collision, modify the ball velocity\n\t\t//and trigger the gadget. Then recursively call the step function passing the remaining time \n\t\t//as the argument for step()\n\t\t\n\t\tprogress(minTimeUntilBallGadgetCollision - TIME_EPSILON);\n\t\t\n\t\tVect ball3Vel = new Vect(((BoardObject)collisionGadget).impactCalc(collisionBall3)[1], ((BoardObject)collisionGadget).impactCalc(collisionBall3)[2]);\n\t\t\n\t\tif(collisionGadget instanceof Absorber){\n\t\t\tcollisionBall3.setVel(new Vect(0,0));\n\t\t\tVect newPos = new Vect(collisionGadget.getX() + collisionGadget.getWidth() - 0.25, collisionGadget.getY() + collisionGadget.getHeight() - 0.25);\n\t\t\tcollisionBall3.setPos(newPos);\n\t\t\tcollisionBall3.setInAbsorber(true);\n\t\t\t((Absorber) collisionGadget).addBallToAbsorber(collisionBall3);\n\t } else if(!(collisionGadget instanceof OuterWall) || ((OuterWall)collisionGadget).getConnectedBoard() == this && ((OuterWall)collisionGadget).getConnectedWall().equals(collisionGadget.getID())){\n\t\t\tcollisionBall3.setVel(ball3Vel);\n\t\t} else{\n\t\t\t//TODO @DANA, this has to do with the client/server ball passing stuff\n\t\t}\n\t\t\n\t\n\t\tcollisionGadget.trigger();\n\n\t\t\n\t\tstep(timeStep - minTimeUntilBallBallCollision);\n\t\treturn;\t\n\t}",
"public void tick() {\n if (ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL) {\n --this.attackTime;\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n ShulkerEntity.this.getLookController().setLookPositionWithEntity(livingentity, 180.0F, 180.0F);\n double d0 = ShulkerEntity.this.getDistanceSq(livingentity);\n if (d0 < 400.0D) {\n if (this.attackTime <= 0) {\n this.attackTime = 20 + ShulkerEntity.this.rand.nextInt(10) * 20 / 2;\n ShulkerEntity.this.world.addEntity(new ShulkerBulletEntity(ShulkerEntity.this.world, ShulkerEntity.this, livingentity, ShulkerEntity.this.getAttachmentFacing().getAxis()));\n ShulkerEntity.this.playSound(SoundEvents.ENTITY_SHULKER_SHOOT, 2.0F, (ShulkerEntity.this.rand.nextFloat() - ShulkerEntity.this.rand.nextFloat()) * 0.2F + 1.0F);\n }\n } else {\n ShulkerEntity.this.setAttackTarget((LivingEntity)null);\n }\n\n super.tick();\n }\n }",
"public void onUpdate(float pSecondsElapsed){\n\t\t\t\ttimer -= pSecondsElapsed;\n\t\t\t\tif(timer <= 0){\n\t\t\t\t\tshoot();\n\t\t\t\t\ttimer = 0.5f;\n\t\t\t\t}\n\t\t\t}",
"public void onUpdate(float pSecondsElapsed){\n\t\t\t\ttimer -= pSecondsElapsed;\n\t\t\t\tif(timer <= 0){\n\t\t\t\t\tshoot();\n\t\t\t\t\ttimer = 0.5f;\n\t\t\t\t}\n\t\t\t}",
"public void onUpdate(float pSecondsElapsed){\n\t\t\t\ttimer -= pSecondsElapsed;\n\t\t\t\tif(timer <= 0){\n\t\t\t\t\tshoot();\n\t\t\t\t\ttimer = 0.5f;\n\t\t\t\t}\n\t\t\t}",
"public void timeToRunDec()\n\t{\n\t\tthis.time_to_run -- ;\n\t}",
"public void Update(double elapsedTime){\n }",
"private void worldTimerDecrementer() {\n worldTimer--;\n }",
"public static void decreaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker < 70)\r\n\t\t\tEnemy._timerTicker += 3;\r\n\t\tif (Player._timerTicker > 4)\r\n\t\t\tPlayer._timerTicker -= 2;\r\n\t}",
"@Override\n public void tick() { mob.fallDistance = 0.0F; }",
"public void timePassed() {\n this.moveOneStep();\n }",
"public void HowMuchTimeLeft() {\n\t\tTimeLeft = Count.HowMuchTimeLeft();\n\t}",
"public void decreaseSpeed(int time) {\n\t\tvelocity -= acceleration;\r\n\t}",
"public void idle(double deltaTime) {\n\n\n float distance = distanceCalc();\n if (distance < 10000) {\n homing();\n } else {\n idleMovement -= deltaTime;\n\n Random rand = new Random();\n int directionNum = rand.nextInt((4 - 1) + 1) + 1;\n\n if (directionNum == 1) {\n yPos -= speed * deltaTime;\n idleMovement = idleRate;\n }\n if (directionNum == 2) {\n yPos += speed * deltaTime;\n idleMovement = idleRate;\n }\n if (directionNum == 3) {\n xPos -= speed * deltaTime;\n idleMovement = idleRate;\n }\n if (directionNum == 4) {\n xPos += speed * deltaTime;\n idleMovement = idleRate;\n }\n }\n }",
"public void kickTimer() {\n delayTime = System.currentTimeMillis() + shutdownDelay;\n// System.out.println(\"Time at which the loop should kick: \" + delayTime);\n }",
"public static void increaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker > 5)\r\n\t\t\tEnemy._timerTicker -= 2;\r\n\t\tif (Player._timerTicker < 100)\r\n\t\t\tPlayer._timerTicker += 2;\r\n\t}",
"public void stop(){\n\t\tthis.timer.stop();\n\t\t//whenever we stop the entire game, also calculate the endTime\n\t\tthis.endTime = System.nanoTime();\n\t\tthis.time = this.startTime - this.endTime;\t//calculate the time difference\n\t\t\n\t\tthis.stop = true;\n\t}",
"public void timePassed() {\n if (keyboard.isPressed(KeyboardSensor.LEFT_KEY) && keyboard.isPressed(KeyboardSensor.RIGHT_KEY)) {\n return;\n } else if (keyboard.isPressed(KeyboardSensor.LEFT_KEY)) {\n moveLeft();\n\n } else if (keyboard.isPressed(KeyboardSensor.RIGHT_KEY)) {\n moveRight();\n }\n }",
"@Override\n void slowDown() {\n if (this.speed>0){\n this.speed=this.speed-1;\n }\n }",
"public void update(float delta) {\n\t\ttimer += delta;\n\t\tgetObjects();\n\t\t\n\t\t//Update camera shake\n\t\tGameScreen.cam.updateShake(delta);\n\t\t\n\t\t//Regenerate ammo & bomb power\n\t\tearth.addAmmo(3f*delta);\n\t\tearth.addBombPower(delta);\n\t\t\n\t\t//Clear meteors if bomb has been triggered from input\n\t\tif(clearField) {\n\t\t\tclearField = false;\n\t\t\t\n\t\t\t//Trigger camera shake\n\t\t\tGameScreen.cam.shake(0.01f, Gdx.graphics.getHeight()/25);\n\t\t\t\n\t\t\t//Update screen flash\n\t\t\tgo.getScreenFlash().setOpacity(1);\n\t\t\t\n\t\t\t//Remove all meteors and add explosions where they were\n\t \tIterator<Meteor> iterMe = meteors.iterator();\n\t\t\twhile(iterMe.hasNext()){\n\t\t\t Meteor m = iterMe.next();\n\t\t\t Explosion exp = explosionPool.obtain();\n\t\t\t exp.init(m.getX() - m.getWidth()/2, m.getY() - m.getHeight()/2, m.getWidth() * 2);\n\t\t\t explosions.add(exp);\n\t\t\t \t\n\t\t\t iterMe.remove();\n\t\t\t meteorPool.free(m);\n\t\t\t \t\n\t\t\t earth.addScore(10);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add explosions while screenFlash is still running\n\t\tif(go.getScreenFlash().getOpacity() > 0.6) {\n\t\t\tExplosion exp = explosionPool.obtain();\n\t\t exp.init(Gdx.graphics.getWidth() * rand.nextFloat() - Gdx.graphics.getHeight()/8 , Gdx.graphics.getHeight() * rand.nextFloat() - Gdx.graphics.getHeight()/8, Gdx.graphics.getHeight()/2 * rand.nextFloat() + 1);\n\t\t explosions.add(exp);\n\t \t\n\t \t//Play explosion sound\n\t\t if(soundOn)\n\t\t \texploSound.play(0.5f, rand.nextFloat() * 0.5f + 0.75f ,0);\n\t\t}\n\t\t\n\t\tsecTimer += delta;\n\t\t//Called once a second\n\t\tif(secTimer >= 1) {\n\t\t\tsecTimer = 0;\n\t\t\t\n\t\t\t//Update spawn interval and meteor speed\n\t\t\tif(meteorSpeed < Gdx.graphics.getHeight()/10) {\n\t\t\t\tmeteorSpeed += (float)Gdx.graphics.getHeight()/5000;\n\t\t\t\tGdx.app.log(\"MeteorSpeed\", Float.toString(meteorSpeed));\n\t\t\t}\n\t\t\t\n\t\t\tif(spawnInterval > 0.5) {\n\t\t\t\tspawnInterval -= 0.015f;\n\t\t\t\tGdx.app.log(\"SpawnInterval\", Float.toString(spawnInterval));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add meteors\n\t\tif(meteorSpawn && timer > spawnInterval) {\n\t\t\ttimer = 0;\n\t\t\tMeteor meteor = meteorPool.obtain();\n\t \tmeteor.init(meteorSpeed);\n\t \tmeteors.add(meteor);\n\t\t}\n\t\t\n\t\t//Update explosion animations\n\t\tIterator<Explosion> iterE = explosions.iterator();\n\t\twhile(iterE.hasNext()){\n\t\t Explosion e = iterE.next();\n\t\t if(e.update(delta)) {\n\t\t \titerE.remove();\n\t\t \texplosionPool.free(e);\n\t\t }\n\t\t}\n\t\t\n\t\t//Update targets\n\t\tfor(Sprite t : targets)\n\t\t\tt.rotate(30*delta);\n\t\t\n\t\t//Update rockets position\n\t\tfor(Rocket r : rockets)\n\t\t\tr.move(delta);\n\t\t\n\t\t//Check if rocket has reached destination\n\t\tIterator<Rocket> iterR = rockets.iterator();\n\t\twhile(iterR.hasNext()){\n\t\t Rocket r = iterR.next();\n\t\t \n\t\t Sprite cross = go.getRocketCrossMap().get(r);\n\t\t crossRect.width = cross.getWidth()/4;\n\t\t crossRect.height = cross.getHeight()/4;\n\t\t crossRect.x = cross.getX() + crossRect.width;\n\t\t crossRect.y = cross.getY() + crossRect.height;\n\t\t \n\t\t if(Intersector.overlaps(r.getBoundingRectangle(), crossRect)) {\n\t\t \t\n\t\t \tSprite target = go.getCrossTargetMap().get(cross);\n\n\t\t \t//Remove cross\n\t\t \tcrosses.remove(cross);\n\t\t \t\n\t\t \t//Remove target\n\t\t \ttargets.remove(target);\n\t\t \t\n\t\t \t//Remove rocket\n\t\t \titerR.remove();\n\t\t \t\n\t\t \t//Add explosion\n\t\t \tExplosion exp = explosionPool.obtain();\n\t\t \texp.init(cross.getX() - (target.getWidth() * target.getScaleX()/2) + cross.getWidth()/2, cross.getY() - (target.getHeight() * target.getScaleX()/2) + cross.getWidth()/2, target.getWidth() * target.getScaleX());\n\t\t \texplosions.add(exp);\n\t\t \t\n\t\t \t//Play explosion sound\n\t\t \tif(soundOn)\n\t\t \t\texploSound.play(0.5f, rand.nextFloat() * 0.5f + 0.75f ,0);\n\t\t \t\n\t\t \t//Check for asteroids in explosion radius, remove and add explosion if found\n\t\t \texploCircle.setRadius(target.getWidth() * target.getScaleX()/2);\n\t\t \texploCircle.setPosition(cross.getX() + cross.getWidth()/2, cross.getY() + cross.getHeight()/2);\n\t\t \t\n\t\t \tIterator<Meteor> iterMe = meteors.iterator();\n\t\t\t\twhile(iterMe.hasNext()){\n\t\t\t\t Meteor m = iterMe.next();\n\t\t\t\t meteorCircle.setPosition(m.getX()+m.getWidth()/2, m.getY()+m.getHeight()/2);\n\t\t\t\t meteorCircle.setRadius(m.getWidth()/2);\n\t\t\t\t if(Intersector.overlaps(exploCircle, meteorCircle)) {\n\t\t\t\t \texp = explosionPool.obtain();\n\t\t\t\t \texp.init(m.getX(), m.getY(), m.getWidth());\n\t\t\t\t \texplosions.add(exp);\n\t\t\t\t \t\n\t\t\t\t \titerMe.remove();\n\t\t\t\t \tmeteorPool.free(m);\n\t\t\t\t \t\n\t\t\t\t \tearth.addScore(10);\n\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\n\t\tearthCircle = go.getEarth().getCollisionCircle();\n\t\t\n\t\t//Move each meteor, and check if it collides with the earth. Remove if it does\n\t\tIterator<Meteor> iterM = meteors.iterator();\n\t\twhile(iterM.hasNext()){\n\t\t Meteor m = iterM.next();\n\t\t m.move(delta);\n\t\t meteorCircle.setPosition(m.getX()+m.getWidth()/2, m.getY()+m.getHeight()/2);\n\t\t meteorCircle.setRadius(m.getWidth()/3);\n\t\t if(Intersector.overlaps(earthCircle, meteorCircle)) {\n\t\t \tExplosion exp = explosionPool.obtain();\n\t\t \texp.init(m.getX(), m.getY(), m.getWidth());\n\t\t \texplosions.add(exp);\n\t\t \t\n\t\t \titerM.remove();\n\t\t \tmeteorPool.free(m);\n\t\t \t\n\t\t \t//Trigger camera shake\n\t\t \tif(!GameScreen.gameOver)\n\t\t \t\tGameScreen.cam.shake(0.01f, Gdx.graphics.getHeight()/25);\n\t\t \t\n\t\t \tearth.damage(1);\n\t\t }\n\t\t}\n\t\t\n\t\tsaveObjects();\n\t}",
"private void countTime()\n {\n time--;\n showTime();\n if (time == 0)\n {\n showEndMessage();\n Greenfoot.stop();\n }\n }",
"public final synchronized void resetTime() {\n this.last = System.nanoTime();\n }",
"private void update()\n{\n // Get seconds elapsed\n int elapsedTime = (int)(System.currentTimeMillis() - _startTime);\n \n // Get play start time\n int playStartTime = getPlayStartTime()>=0? getPlayStartTime() : 0;\n\n // Increment time by time elapsed\n setTime(playStartTime + elapsedTime);\n \n // If not looping and time is beyond max, stop animator\n if(!getLoops() && (getPlayStartTime() + elapsedTime >= getMaxTime()))\n stop();\n}",
"public void resetTimeLimit();",
"public long getLoopTime();",
"private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }",
"public void doTimeStep() {\r\n\t\twalk(getRandomInt(8));\r\n\t\tif (getEnergy() < 6 * Params.min_reproduce_energy && getEnergy() > Params.min_reproduce_energy) {\r\n\t\t\tCritter1 child = new Critter1();\r\n\t\t\treproduce(child, getRandomInt(8));\r\n\t\t\tnumberSpawned += 1;\r\n\t\t}else if(getEnergy() < Params.min_reproduce_energy) {\r\n\t\t\treturn;\r\n\t\t}else {\r\n\t\t\tCritter1 child1 = new Critter1();\r\n\t\t\treproduce(child1, getRandomInt(8));\r\n\t\t\tCritter1 child2 = new Critter1();\r\n\t\t\treproduce(child2, getRandomInt(8));\r\n\t\t\tnumberSpawned += 2;\r\n\t\t}\t\r\n\t}",
"public void setFinishTime() {\r\n\t\t\tthis.finishTime = RNG.MAXINT;\r\n\t\t}",
"@Override\r\n public void timePassed(double dt) {\r\n return;\r\n }",
"public void faster() {\n myTimer.setDelay((int) (myTimer.getDelay() * SPEED_FACTOR));\n }",
"@Override\n public void run() {\n ElapsedTime time = new ElapsedTime();\n time.reset();\n sleep(3000);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n //sh.pivotStop.setPosition(.55);\n sh.hitRing();\n sleep(500);\n //sh.pivotDown();\n sh.hitRing();\n sleep(500);\n sh.withdraw();\n sh.lift.setPower(0);\n sh.lift.setPower(0);\n wobble.wobbleUp();\n sh.pivotStop.setPosition(1);\n loop.end();\n\n\n }",
"@Override\n public void timePassed() {\n moveOneStep();\n }",
"public void setTime()\n \t{\n \t\tif( !paused )\n \t\t{\n\t \t\tlong playingTime = System.currentTimeMillis() - startTime;\n\t \t\tlong timeLeft = 180000 - playingTime;\n\t \t\tlong min = timeLeft / 60000;\n\t \t\tlong sec = ( timeLeft - ( min * 60000 ) ) / 1000L;\n\t \t\t\n\t \t\tif( timeLeft < 0 )\n\t \t\t{\n\t \t\t\t//Game over!\n\t \t\t\tgameOver();\n\t \t\t\treturn;\n\t \t\t}\n\t \t\t\n\t \t\tString s = \"Time: \";\n\t \t\ts += Integer.toString( (int)min ) + \":\";\n\t \t\tif( sec >= 10 )\n\t \t\t\ts += Integer.toString( (int)sec );\n\t \t\telse\n\t \t\t\ts += \"0\" + Integer.toString( (int)sec );\n\t \t\t\n\t \t\ttimerLabel.setText( s );\n \t\t}\n \t}",
"public static void resetTime() {\n\t\ttime = TimeUtils.millis();\n\t}",
"public void setTime(long elapseTime) {\r\n\t\tsecond = (elapseTime / 1000) % 60;\r\n\t\tminute = (elapseTime / 1000) / 60 % 60;\r\n\t\thour = ((elapseTime / 1000) / 3600) % 24;\t\r\n\t}",
"public void setTime(int aTime)\n{\n // If we loop, mod the time, otherwise, clamp time\n if(getLoops() && aTime>getMaxTime())\n aTime = aTime%getMaxTime();\n else aTime = SnapMath.clamp(aTime, 0, getMaxTime());\n \n // If already at given time, just return\n if(_time==aTime) return;\n\n // Set new value and fire property change\n firePropertyChange(\"Time\", _time, _time = aTime, -1);\n \n // Reset time of owner children\n for(int i=0, iMax=getOwner().getChildCount(); i<iMax; i++)\n getOwner().getChild(i).setTime(_time);\n \n // Send did update notification\n for(int i=0, iMax=getListenerCount(Listener.class); i<iMax; i++)\n getListener(Listener.class, i).animatorUpdated(this);\n \n // Clear new born list\n _newBorns.clear();\n}",
"public synchronized void reset()\n\t{\n\t\tm_elapsed = 0;\n\t}",
"private void updateTimer()\r\n {\n if (timeLeft > 0)\r\n {\r\n frameCounter++;\r\n \r\n // if a second has passed\r\n if (frameCounter >= frameRate)\r\n {\r\n // reset the frame counter\r\n frameCounter = 0;\r\n \r\n // update the secondsElapsed var\r\n totalSecondsElapsed++;\r\n \r\n // subtract a second from the timer\r\n timeLeft--;\r\n \r\n // change the time into mins & seconds\r\n int minsLeft = timeLeft / 60;\r\n int secondsLeft = timeLeft % 60;\r\n \r\n // update the time display (min:sec)\r\n String timerDisplay = minsLeft + \":\" + getLeadingZero(secondsLeft, 10) + secondsLeft;\r\n timerText.text = timerDisplay;\r\n timerText.updateText();\r\n }\r\n }\r\n else\r\n {\r\n endGame();\r\n }\r\n }",
"public float timeBeforeDestruction(){\n\t\tif(destroyTime < Float.MAX_VALUE){\n\t\t\treturn destroyTime - Main.time;\n\t\t}else{\n\t\t\treturn Float.MAX_VALUE;\n\t\t}\n\t}",
"private void step() {\n // Set up the times\n loopTime += calcFreq;\n t += dt*speedSlider.getValue();\n simDate.setTime(loopTime);\n \n if (loopTime % 250 == 0) {\n timeField.setValue(simDate);\n }\n \n mainPanel.repaint();\n \n // Check for collisions\n ArrayList<Body> toBeRemoved = new ArrayList<>();\n for (Body b1 : bodies) {\n for (Body b2 : bodies) {\n if (b1 != b2 && areTouching(b1, b2)) {\n Body big = b1.mass > b2.mass ? b1 : b2;\n Body small = b1 == big ? b2 : b1;\n \n if (toBeRemoved.contains(small)) {\n continue;\n } else {\n toBeRemoved.add(small);\n }\n \n double newvx = (big.state.vx*big.mass+small.state.vx*small.mass)/(big.mass+small.mass);\n double newvy = (big.state.vy*big.mass+small.state.vy*small.mass)/(big.mass+small.mass);\n double newvz = (big.state.vz*big.mass+small.state.vz*small.mass)/(big.mass+small.mass);\n double newden = (big.DENSITY*big.mass+small.DENSITY*small.mass)/(big.mass+small.mass);\n big.mass += small.mass;\n big.DENSITY = newden;\n big.setRadiusFromMass();\n big.state.vx = newvx;\n big.state.vy = newvy;\n big.state.vz = newvz;\n }\n }\n \n // Check for out of bounds\n if (!toBeRemoved.contains(b1)) {\n if (Math.abs(b1.state.x) > cubeL || Math.abs(b1.state.y) > cubeL\n || Math.abs(b1.state.z) > cubeL/2) {\n toBeRemoved.add(b1);\n }\n }\n }\n \n // Remove all that need to be removed\n for (Body b : toBeRemoved) {\n bodies.remove(b);\n totalBodiesCounter.setText(\"\"+bodies.size());\n bodiesComboBox.removeItem(b.name);\n }\n \n // Calculate the next position\n for (Body b : bodies) {\n if (b.moveable) {\n b.nextState.x = b.state.x;\n b.nextState.y = b.state.y;\n b.nextState.z = b.state.z;\n b.nextState.vx = b.state.vx;\n b.nextState.vy = b.state.vy;\n b.nextState.vz = b.state.vz;\n \n b.updateBody(t, dt*speedSlider.getValue());\n if (pathsComboBox.getSelectedItem().equals(\"Lines\") && loopTime % 20 == 0) {\n b.addPos();\n } else if (pathsComboBox.getSelectedItem().equals(\"Dots\") && loopTime % 100 == 0) {\n b.addPos();\n }\n }\n }\n \n // Set each next position\n for (Body b : bodies) {\n if (b.moveable) {\n b.state.x = b.nextState.x;\n b.state.y = b.nextState.y;\n b.state.z = b.nextState.z;\n b.state.vx = b.nextState.vx;\n b.state.vy = b.nextState.vy;\n b.state.vz = b.nextState.vz;\n }\n }\n \n // Update the edit window\n Body bufferedBody = selectedBody;\n if (bufferedBody != null) {\n if (loopTime % 50 == 0) {\n xFieldEdit.setValue(bufferedBody.state.x);\n yFieldEdit.setValue(bufferedBody.state.y);\n zFieldEdit.setValue(bufferedBody.state.z);\n vxFieldEdit.setValue(bufferedBody.state.vx);\n vyFieldEdit.setValue(bufferedBody.state.vy);\n vzFieldEdit.setValue(bufferedBody.state.vz);\n massFieldEdit.setValue(bufferedBody.mass);\n radiusFieldEdit.setValue(bufferedBody.r);\n }\n \n // Follow the body\n if (followBodyButton.isSelected()) {\n setWindowToBody(bufferedBody);\n }\n }\n }",
"private void gameLoop() {\n\n looping = true;\n long lastTime = System.currentTimeMillis();\n while (looping) {\n long delta = System.currentTimeMillis() - lastTime;\n if (delta >= 1000/60d) {\n view.render();\n game.update(delta);\n lastTime = System.currentTimeMillis();\n }\n }\n }",
"abstract public double timeUntilCollision(Ball ball);",
"private void updateTime() {\n timer.update();\n frametime = timer.getTimePerFrame();\n }",
"public void act() \n {\n if(timer > 0){\n timer--;\n }else{\n Greenfoot.playSound(\"explosionSound.wav\");\n getWorld().removeObject(this);\n }\n }",
"public void frameForward()\n{\n stop();\n setTime(getTime() + getInterval());\n}",
"public void trackTime()\n {\n frames += 1;\n\n // Every second (roughly) reduce the time left\n if (frames % 60 == 0)\n {\n time += 1;\n showTime();\n }\n }",
"public void setMaxTimeSeconds(float aTime) { setMaxTime(Math.round(aTime*1000)); }",
"public void tick() {\n if (this.entity.hurtResistantTime == 19) {\n this.entity.resetActiveHand();\n }\n LivingEntity target = this.entity.getAttackTarget();\n if (target != null) {\n boolean isSee = this.entity.getEntitySenses().canSee(target);\n boolean isSeeTimeFound = this.seeTime > 0;\n if (isSee != isSeeTimeFound) {\n this.seeTime = 0;\n }\n\n if (isSee) {\n ++this.seeTime;\n } else {\n --this.seeTime;\n }\n\n this.entity.getLookController().setLookPositionWithEntity(target, 30.0F, 30.0F);\n\n if (this.entity.isHandActive()) {\n if (!isSee && this.seeTime < -10) {\n this.entity.resetActiveHand();\n } else if (isSee) {\n int i = this.entity.getItemInUseMaxCount();\n if (i >= 20) {\n this.entity.resetActiveHand();\n this.entity.attackEntityWithRangedAttack(target, BowItem.getArrowVelocity(i));\n this.attackTime = this.attackCooldown;\n }\n }\n } else if (--this.attackTime <= 0 && this.seeTime >= -10) {\n this.entity.setActiveHand(ProjectileHelper.getHandWith(this.entity, Items.BOW));\n }\n\n }\n }",
"private static float tock(){\n\t\treturn (System.currentTimeMillis() - startTime);\n\t}",
"public void update (float dt){\n if(tryb ==1) {\n timeCount += dt;\n if (timeCount >= 1) {\n worldTimer--;\n countdownLabel.setText(String.format(\"%03d\", worldTimer));\n timeCount = 0;\n }\n }\n if(tryb == 2){\n if( worldTimer > 0){\n updateScore(5);\n worldTimer --;\n countdownLabel.setText(String.format(\"%03d\", worldTimer));\n }\n if( worldTimer < 0){\n updateScore(-5);\n worldTimer ++;\n countdownLabel.setText(String.format(\"%03d\", worldTimer));\n }\n\n }\n }",
"public void timePassed(double dt) {\r\n moveOneStep(dt);\r\n }",
"public synchronized static void resetTime() {\n\t\ttime = 0;\n\t}",
"public void setElapsedTime(Long elapsedTime) {\n this.elapsedTime = elapsedTime;\n }",
"private void updateTime(){\n currentTime = System.currentTimeMillis();\n float tp = previousTime;\n previousTime = (float)(currentTime - startingTime);\n dt = previousTime - tp;\n fps = 1000f/dt;\n }",
"public void update()\n {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n if(elapsed>100)\n {\n hard += 20; // increase difficulty\n score = Dynamics.getPosition();\n startTime = System.nanoTime();\n }\n dx = (int)Dynamics.getVelocityX();\n\n animation.update();\n x += dx;\n if(x < 0){\n x = 0;\n } else if (x+width > GamePanel.WIDTH){\n x = GamePanel.WIDTH-width;\n }\n\n }",
"public void advanceTimeStep(double timestep) {\n\t\t\n\t\tif (getDeathTime() > 0) return;\n\t\t\n\t\tList<List<List<Object>>> collisions = getCollisions();\n\t\tif ((noObjectMovementBlocking(collisions.get(0).get(0)) && !(collisions.get(0).get(1).contains(Feature.ground)) && (getVx() < 0))\n\t\t\t|| ((noObjectMovementBlocking(collisions.get(2).get(0)) && !(collisions.get(2).get(1).contains(Feature.ground)) && (getVx() > 0)))) \n\t\t\t\tadvanceX(timestep);\n\t\t\n\t\tsetVx(advanceVx(timestep));\n\t\t\n\t\tcollisions = getCollisions();\n\t\tif (noObjectMovementBlocking(collisions.get(3).get(0)) && !(collisions.get(3).get(1).contains(Feature.ground)) && (getVy() < 0))\n\t\t\tadvanceY(timestep);\n\t\telse if (getVy() > 0) {\n\t\t\tboolean should_advance = true;\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tif (!noObjectMovementBlocking(collisions.get(i).get(0)) || collisions.get(i).get(1).contains(Feature.ground))\n\t\t\t\t\tshould_advance = false;\n\t\t\t}\n\t\t\tif (should_advance) advanceY(timestep);\n\t\t}\n\n\t\tadvanceVy(timestep);\n\t\tsetAy(advanceAy());\n\n\t\tcollisions = getCollisions();\n\t\tif ((this instanceof Mazub) && !(getJustJumped()) &&\n\t\t\t\t((collisions.get(3).get(0).size() != 0) || (collisions.get(3).get(1).contains(Feature.ground)))) {\n\t\t\t((Mazub) this).setJumping(false);\n\t\t}\n\t\t\n\t\tsetTimeInvincible(advanceTimeInvincible(timestep));\n\t}",
"private void stopCountTime() {\n\t\tendTimer();\n\t\tif(this.gameTimeThread != null) {\n try {\n this.gameTimeThread.join();\n } catch (InterruptedException ignored) {\n }\n }\n\t}",
"public void updateTime(int time)\n\t{\n\t\tshotsRemaining = rateOfFire;\n\t}",
"public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) {\n\n final int START_ZOOM_TIME = 3000;\n if (totalTime < START_ZOOM_TIME) {\n final float x = totalTime/(float)START_ZOOM_TIME;\n final float s = 1f-(float)Math.pow(x-1, 4);\n setScaleX(s); setScaleY(s);\n } else {\n setScaleX(1.0f); setScaleY(1.0f);\n }\n\n if (mManeuveringThrusters) {\n if (mSpeedScale > MANEUVERING_THRUST_SCALE) {\n mSpeedScale -= (2*deltaTime/1000f);\n }\n if (mSpeedScale < MANEUVERING_THRUST_SCALE) {\n mSpeedScale = MANEUVERING_THRUST_SCALE;\n }\n } else {\n if (mSpeedScale < 1.0f) {\n mSpeedScale += (deltaTime/1000f);\n }\n if (mSpeedScale > 1.0f) {\n mSpeedScale = 1.0f;\n }\n }\n\n for (int i=0; i<getChildCount(); i++) {\n View v = getChildAt(i);\n if (!(v instanceof FlyingIcon)) continue;\n FlyingIcon nv = (FlyingIcon) v;\n nv.update(deltaTime / 1000f * mSpeedScale);\n final float scaledWidth = nv.getWidth() * nv.getScaleX();\n final float scaledHeight = nv.getHeight() * nv.getScaleY();\n if ( nv.getX() + scaledWidth < 0\n || nv.getX() - scaledWidth > getWidth()\n || nv.getY() + scaledHeight < 0 \n || nv.getY() - scaledHeight > getHeight())\n {\n nv.reset();\n }\n }\n }",
"public void tick() {\n if (alpha > life ){\n alpha -= (life - 0.0001f);\n }else {\n handler.removeObject(this);\n }\n }",
"public void setMaxTime(int aMaxTime)\n{\n // Set max time\n _maxTime = aMaxTime;\n \n // If time is greater than max-time, reset time to max time\n if(getTime()>_maxTime)\n setTime(_maxTime);\n}",
"public void move(long timePassed) {\n\t\tif (x < -100) {\r\n\t\t\tthis.destroy();\r\n\t\t}\r\n\r\n\t\tsuper.move(timePassed);\r\n\t}",
"public void timePassed(double dt) {\r\n this.moveOneStep(dt);\r\n }",
"public Time (long elapseTime) {\r\n\t\tsetTime(elapseTime);\r\n\t}",
"public void update(float deltaTime) { //deltaTime = temps passé entre deux frames\n if (deltaTime == 0) return; // Si rien ne s'est passé on sort\n if(deltaTime > 0.1f) deltaTime = 0.1f; // Pour garder le jeu fluide\n runTime += deltaTime;\n \n resetForNextLoop();\n prepareNextMove();\n \n // Instanceof pour éviter de créer pleins de fois des objets alors que deplacement est déjà définit\n if(MINER_MOVING && !MV_DYNAMIC) {// Si on est dans déplacement dit de type fluide et que le mineur n'est pas en train de jumping\n wasMoving = true;\n MV_DYNAMIC = true;\n MV_BRAKING = false;\n } else if(!MINER_MOVING && wasMoving && !MV_BRAKING && state.equals(State.MOVING)){ // Sinon c'est un amortissement\n MV_BRAKING = true;\n MV_DYNAMIC = false;\n } \n \n playSound();\n }",
"private void gameLoop() {\n\n\t\tlong elapsedTime = 0;\n\t\tlong newTime;\n\t\tlong oldTime = System.nanoTime();\n\t\tlong expectedTime = 1000000000 / 60;\n\t\tdouble delta;\n\n\t\tint frames = 0;\n\t\tlong frameTimer = 0;\n\n\t\twhile (!Display.isCloseRequested() && !gameOver) {\n\n\t\t\t// get new time, find elapsed time, determine delta\n\t\t\tnewTime = System.nanoTime();\n\t\t\telapsedTime = newTime - oldTime;\n\t\t\tdelta = (double)elapsedTime / (double)expectedTime;\n\t\t\toldTime = newTime;\n\n\t\t\t// update frame count\n\t\t\tframes++;\n\t\t\tframeTimer += elapsedTime;\n\n\t\t\t// if a second has passed, print the fps\n\t\t\tif (frameTimer >= 1000000000) {\n\t\t\t\tSystem.out.println(\"FPS: \" + frames);\n\t\t\t\tSystem.out.println(delta);\n\t\t\t\tframeTimer = Math.max(0, frameTimer - 1000000000);\n\t\t\t\tframes = 0;\n\t\t\t}\n\n\t\t\t// update game state\n\t\t\tsoundManager.update();\n\t\t\tstateManager.update(delta);\n\t\t\tstateManager.render();\n\t\t\tgui.update();\n\t\t\tDisplay.update();\t\n\n\t\t\t// sleep until 1/60 of a second has passed\n\t\t\tif (newTime - oldTime < expectedTime) {\n\n\t\t\t\twhile (newTime - oldTime < expectedTime) {\n\n\t\t\t\t\tnewTime = System.nanoTime();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(0);\n\t\t\t\t\t} catch (InterruptedException e) { } \n\n\t\t\t\t} \n\t\t\t}\n\t\t\telse {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(0);\n\t\t\t\t} catch (InterruptedException e) { }\n\t\t\t}\n\n\t\t}\n\t}",
"public synchronized void resetTime() {\n }",
"@Override\n\tpublic void render(float delta) {\n\t\trunTime += delta;\n\t\tgameStage.draw();\n\t\tgameStage.act();\n\t\tgameStage.addAction(Actions.moveBy(-.8f, 0));;\n\t\tmanager.checkCollisions();\n\t\t\n\t}",
"public void time(){\n\t\tif(paused){\n\t\t\tpaused = false;\n\t\t\tmusic.play();\n\t\t\tstart = System.nanoTime();\n\t\t} else {\n\t\t\telasped += System.nanoTime() - start;\n\t\t\tstart = System.nanoTime();\n\t\t}\n\t\ttime = (double) elasped/ (double) 1000000000l;\n\t\t//System.out.println(time);\n\t}",
"public void tick() {\n\t\tmFrameCount++;\n\t\t\n\t\tif (mStopwatch.getElapsedTime() > 1000) {\n\t\t\tmFramesPerSecond = mFrameCount;\n\t\t\tmFrameCount = 0;\n\t\t\t\n\t\t\tmStopwatch.restart();\n\t\t}\n\t}",
"public void unleash() {\n\t\tlocked = false;\n\t\tfloat percent = framesAccelerated/60.0f;\n\t\tif (percent > 1) percent = 2 - percent;\n\t\tif (percent < 0) percent = 0;\n\t\t\n\t\tif (player.aiControlled()) {\n\t\t\tpercent = AIcontroller.randomStartBoost();\n\t\t}\n\t\t\n\t\tspeed = MAX_SPEED * percent;\n\t}",
"public void pause() {\n long currentTime = System.currentTimeMillis();\n ms = originalms - currentTime;\n }",
"public void act() \r\n {\r\n if(timeInterval > 0) {\r\n timeInterval--;\r\n }else{\r\n if(currentSprite < 30) {\r\n currentSprite++;\r\n GreenfootImage img = new GreenfootImage(\"explosion_\" + currentSprite + \".png\");\r\n img.scale(img.getWidth() / 2 + 25, img.getHeight() / 2 + 25);\r\n setImage(img);\r\n timeInterval = timeIntervalDef;\r\n }else{\r\n getWorld().removeObject(this);\r\n }\r\n }\r\n }",
"private void resetForNextTurn() {\n\t\tremove(ball);\n\t\tdrawBall();\n\t\tsetInitialBallVelocity();\n\t\tpaddleCollisionCount = 0;\n\t\tpause(2000); \t\t\t\t\n }",
"@Override\n\tpublic void render(float delta) \n\t{\n\t\tif (state_Game==GAME_READY) \n\t\t{\n\t\t\t/*Si esta en Ready Decrementa el tiempo hasta que el tiempo se igual a 0*/\n\t\t\ttiempo=60-(int) (stateTime/2);\n\t\t\tif(tiempo==0)\n\t\t\t{\n\t\t\t\t/*Si es igual a 0 entonces muestra la pantalla de gameover*/\n\t\t\t\tSettings.addScore(Score.getScore());\n\t\t\t\tgame.setScreen(new PantallaGameOver(game));\n\t\t\t}\n\t\t\tupdate(delta);\n\t\t}\n\t\tif (state_Game==GAME_PAUSED) \n\t\t{\n\t\t\t/*Si el estado del juego es Pausa muestra la ventana de Pausa*/\n\t\t\tpauseGame(delta);\n\t\t}\n\t\t\n\t}",
"public void run() {\n\t \tif(ScorePanel.getScore() == 100){\r\n\t \t\ttimer.cancel();\r\n\t \t}\r\n\t \t//se o Tempo se esgotar, é game over!!!\r\n\t \telse if (tempo == 0){\r\n\t \t timer.cancel();\r\n \t\tAvatar.noMotion();\r\n \t\t//System.exit(0);\r\n\t }\r\n\t \t//Senão, vai contando\r\n\t \telse{\r\n\t \tlbltimer.setText(\"Tempo: \"+ --tempo);\r\n\t }\r\n\t }",
"public void cycle(){\r\n \r\n \r\n if(collision()){\r\n endtime = 1;\r\n animator.stop();\r\n }else{\r\n if(max_h == false)\r\n ch.v--;\r\n if(ch.v == 150)\r\n max_h = true;\r\n\r\n if(max_h == true & ch.v <= 330){\r\n ch.v++;\r\n if(ch.v == 330){\r\n done = true;\r\n \r\n }\r\n }\r\n }\r\n }",
"@Override\n public void executeFrameWithDeltaTime(float timeInterval, PhysicsObject physicsObject) {\n applyLimits();\n if (this.minPoint.x == this.target.getTranslationX() && physicsObject.velocity.x < 0.0)\n {\n float vx = -physicsObject.velocity.x * this.bounce;\n float vy = physicsObject.velocity.y;\n physicsObject.velocity = new PointF(vx, vy);\n doHaptic();\n }\n if (this.minPoint.y == this.target.getTranslationY() && physicsObject.velocity.y < 0.0)\n {\n float vx = physicsObject.velocity.x;\n float vy = -physicsObject.velocity.y * this.bounce;\n physicsObject.velocity = new PointF(vx, vy);\n doHaptic();\n }\n if (this.maxPoint.x == this.target.getTranslationX() && physicsObject.velocity.x > 0.0)\n {\n float vx = -physicsObject.velocity.x * this.bounce;\n float vy = physicsObject.velocity.y;\n physicsObject.velocity = new PointF(vx, vy);\n doHaptic();\n }\n if (this.maxPoint.y == this.target.getTranslationY() && physicsObject.velocity.y > 0.0)\n {\n float vx = physicsObject.velocity.x;\n float vy = -physicsObject.velocity.y * this.bounce;\n physicsObject.velocity = new PointF(vx, vy);\n doHaptic();\n }\n }",
"private void startCountTime() {\n\t\tRunnable timerRunnable = () -> {\n\t\t\tinitTimer();\n\t\t\tlong millisWaitTime = 1000/CALCULATIONS_PER_SECOND;\n\t\t\tlong currT, nextT;\n\t\t\t//previous time\n\t\t\tlong prevT = System.nanoTime();\n\t\t\twhile (this.keepRunning) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(millisWaitTime);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\tcurrT = System.nanoTime();\n\t\t\t\tthis.time = (double)(currT - prevT) * 0.000000001;\n\t\t\t\tprevT = currT;\n\t\t\t\tnextT = prevT + 1000000000 / CALCULATIONS_PER_SECOND;\n\t\t\t\tthis.gameLogic.updateGame(time);\n\t\t\t\t// stop the timer game if the player lose\n\t\t\t\tif(this.gameLogic.playerLose()) {\n\t\t\t\t\tthis.stopCountTime();\n\t\t\t\t}\n\t\t\t\tlong timeWait = Math.max(nextT - System.nanoTime(),0);\n\t\t\t\ttimeWait += INCREASE_WAIT;\n\t\t\t\tmillisWaitTime = timeWait / 1000000;\n\t\t\t}\n\t\t};\n\t\tgameTimeThread = new Thread(timerRunnable);\n\t\tgameTimeThread.start();\n\t}",
"@Override\n\tpublic void update(double dt) {\n\t\tcurrentSurvivalTime += dt;\n\t\texplosionCurrentSize = currentSurvivalTime * explosionFinalSize / survivalTime;\n\t\tif (explosionCurrentSize > explosionFinalSize) {\n\t\t\trules.deleteObject(this);\n\t\t}\n\t}",
"public void startTiming() {\n elapsedTime = 0;\n startTime = System.currentTimeMillis();\n }",
"public void SetTimeRemaining(int value) {\n Timer = value;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }",
"public void decreaseTimescale() {\n\t\ttimeScaler = timeScaler<=1 ? 1 : timeScaler - TIMESCLALER_FACTOR;\n\t}",
"public void crunch(){\n cpuBurstTime--;\n rem--;\n }",
"public void setDelay(float time)\n\t{\n\t\tdelayMax=time;\n\t}",
"public void updateGameTime() {\n\t\tGameTime = Timer.getMatchTime();\n\t}",
"@Override\n\tpublic void SimulaSe(int DiffTime) {\n\n\t\tX+=velx*DiffTime/1000.0f;\n\t\tY+=vely*DiffTime/1000.0f;\n\t\ttimerColisaoMeteoro+=DiffTime;\n\t//\tSystem.out.println(+this.dx+\" \"+this.dy+\" \"+Y+\" \"+X);\n\t\t boolean aux=false;\n\t\t \n\t\t\tif (typ==1) { //tiro da nave\n\t\t\t\t\n\t\t\t\tfor (int i =0;i<CanvasGame.listadeagentes.size();i++) {\n\t\t\t\t\tInimigo ag = (Inimigo)CanvasGame.listadeagentes.get(i);\n\t\t\t\tif (Constantes.colidecircular(X, Y, sizeX, ag.X+ag.sizeX/2, ag.Y+ag.sizeY/2, ag.sizeY/2)) {\n\t\t\t\t\t\taux=true;\n\t\t\t\t\t\tCanvasGame.listadeagentes.get(i).vida-=2*Constantes.DANO_TIRO;\n\t\t\t\t\t\tCanvasGame.gerenciadorEfeitos.ganhouXp( (int)X, (int)Y,Constantes.DANO_TIRO);\n\t\t\t\t\t\t//GamePanel.minhaNave.evoluiu();\n\t\t\t\t\t\tCanvasGame.minhaNave.gerenciaXP();\n//\t\t\t\t\t\tCanvasGame.gerenciadorEfeitos.explosao(ag.X+ag.sizeX/4,ag.Y+ag.sizeY/4,-velx,vely);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tfor (int i =0;i<CanvasGame.listadeMeteoro.size();i++) {\n\t\t\t\t\tMeteoro ag = (Meteoro)CanvasGame.listadeMeteoro.get(i);\n\t\t\t\tif (Constantes.colidecircular(X-sizeX/2, Y-sizeY/2, sizeX/2, ag.X+ag.sizeX/2, ag.Y+ag.sizeY/2, ag.sizeY/2)) {\n\t\t\t\t\t\taux=true;\n\t\t\t\t\t\tag.colidiu(this);\n\t\n\t\t\t\t\t\tCanvasGame.gerenciadorEfeitos.ganhouXp( (int)X, (int)Y,ag.XP);\n\t\t\t\t\t\tCanvasGame.minhaNave.gerenciaXP();\n\t\t\t\t\t\t//GamePanel.minhaNave.evoluiu();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (typ==2) { //tiro dos inimigos\n\t\t\t\t\n//\t\t\t\tfor (int i =0;i<GamePanel.listadeagentes.size();i++) {\n//\t\t\t\t\tMeuAgente ag = (MeuAgente)GamePanel.listadeagentes.get(i);\n\t\t\t\tif (Constantes.colidecircular(X-sizeX/2, Y-sizeY/2, sizeX/2, CanvasGame.minhaNave.X+CanvasGame.minhaNave.sizeX/2, CanvasGame.minhaNave.Y+CanvasGame.minhaNave.sizeY/2, 10)) {\n\t\t\t\t\t\taux=true;\n\t\t\t\t\t\tCanvasGame.minhaNave.life-=Constantes.DANO_TIRO;\n\t\t\t\t\t}\n\t\t\t\tfor (int i =0;i<CanvasGame.listadeMeteoro.size();i++) {\n\t\t\t\t\tMeteoro ag = (Meteoro)CanvasGame.listadeMeteoro.get(i);\n\t\t\t\tif (!bateuMeteoro&&Constantes.colidecircular(X, Y, sizeX/2, ag.X, ag.Y, ag.sizeX/2)) {\n\t\t\t\t\t\n\t\t\t\t\t\tag.colidiu(this);\n\n\t\t\t\t\t\t//GamePanel.minhaNave.evoluiu();\n\t\t\t\t\t\tbateuMeteoro=true;\n\t\t\t\t\t\ttimerColisaoMeteoro=0;\n\t\t//\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\n\t\t\t\t}\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\tif (X>GamePanel.PWIDTH+GamePanel.PWIDTH/8||X<-GamePanel.PWIDTH/8||Y<-GamePanel.PHEIGHT/8||Y>GamePanel.PHEIGHT+GamePanel.PWIDTH/8) \n\t\t\tvivo=false;\t\n\t\t\n\t\t\n\t\tif (aux) EXPLODIU=true;\n\t\t\n\t\tif(EXPLODIU){\n\t\t\tParticula part;\n\t\t\t\tfor(int B = 0; B < 100;B++){\n\t\t\t\t\tint modv = -GamePanel.rnd.nextInt(200)+50;\n\t\t\t\t\t\n\t\t\t\t\tint pvx = 0;\n\t\t\t\t\tint pvy = 0;\n\t\t\t\t\n\t\t\t\t\t\tpvx = velx + modv;\n\t\t\t\t\t\tpvy = vely - modv;\n\n\t\t\t\t\t\n\t\t\t\t\tpvx = (int)(pvx*(0.4+0.25*GamePanel.rnd.nextFloat()));\n\t\t\t\t\tpvy = (int)(pvy*(0.4+0.25*GamePanel.rnd.nextFloat()));\n\t\t\t\t\t\n\t\t\t\t\tif(B%2==0){\n\t\t\t\t\t\tcor = Color.red;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tcor = Color.cyan;\n\t\t\t\t\t}\n//\t\t\t\t\tif (B%4==0) {\n\t\t\t\t\t\tpart = (Particula)new Faisca(X,Y,pvx/4,pvy/4,GamePanel.rnd.nextInt(300)+100,cor);\n//\t\t\t\t\t}else {\n//\t\t\t\t\t\tpart = (Particula)new Faisca(X,Y,-pvx/4,-pvy/4,GamePanel.rnd.nextInt(400)+100,cor);\n//\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCanvasGame.particulas.add(part);\n\t\t\t\t\tvivo = false;\n\t\t\t\t}\n\t\n\t\t\n\t\t}\n\n\n\t}",
"public void resetLoop(){\n\t\tloopTime = 0;\n\t}",
"public void run() {\n isRunningTime = true;\n\n coolDownTime.put(target, coolDownTime.get(target) - 1);\n\n if(coolDownTime.get(target) <= 0) {\n coolDownTime.remove(target);\n\n target.sendMessage(DwD + ChatColor.GOLD + \"Your Dark Cloud cooldown has expired.\");\n\n isRunningTime = false;\n\n taskCoolDownToCancel.cancel();\n }\n }",
"public float getSecondsElapsed() { return _startTime==0? 0 : (System.currentTimeMillis() - _startTime)/1000f; }",
"public void tick(){\n\t\tfor(int i=0;i<object.size(); i++){\n\t\t\ttempObject = object.get(i);\n\t\t\ttempObject.tick(object);\n\t\t\tif(tempObject.getId() == ObjectId.Player){\n\t\t\t\tif(tempObject.position.x == MouseInput.exitPosition.x&&\n\t\t\t\t tempObject.position.y == MouseInput.exitPosition.y){\n\t\t\t\t\tgame.score += game.timeLeft;\n\t\t\t\t\tSystem.out.println(\"exited\");\n\t\t\t\t\tgame.levelCompleted=true;\n\t\t\t\t}\n\t\t\t\tif(game.player.health <= 0){\n\t\t\t\t\tobject.clear();\n\t\t\t\t\tgame.gameLoop=1;\n\t\t\t\t\tgame.State=STATE.GAMEOVER;\n\t\t\t}\n\t\t}\n\t\t// bomb is null when exploded\t\t\n\t\tif(Bomb.exploded(bomb, object)){\n\t\t\tbomb=null;\t\t\t\n\t\t}\n\t\t\n\t\tif(System.currentTimeMillis()-Player.tHit < 3000){\n\t\t\tPlayer.invincible = true;\n\t\t}\n\t\telse{\n\t\t\tPlayer.invincible = false;\n\t\t}\n\t\t\n\t\tif(Power.consumed(power, object)) {\n\t\t\tpower=null;\n\t\t}\n\t\t}\n\t\t\n\t}",
"public static void worldTimeStep() {\n\t\t//System.out.println(\"Time Step: \" + count);\n\t\tcount = count + 1;\n\t for (Critter A : Critter.population){\n\t if(A.energy<=0){\n\t\t\t\tA.isAlive = false;\n }\n else if(A.energy>0){\n\t A.isAlive=true;\n A.doTimeStep();\n if(A.energy<0){\n\t\t\t\t\tA.isAlive = false;\n\t\t\t\t}\n }\n\n }\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\n encounters2();\n\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\n\t\tmapCheck();\n\t\t// we have add reproduction\n\n\t\t// we have to add algae\n\t\tfor (int i = 0; i < Params.refresh_algae_count; i = i + 1){\n\t\t\t//Algae child = new Algae();\n\t\t\t//child.setEnergy(Params.start_energy);\n\t\t\t//makecritter takes care of anything\n\t\t\ttry{\n\t\t\t\tmakeCritter(\"Algae\");\n\t\t\t}\n\t\t\tcatch(InvalidCritterException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t//deduct rest energy\n\t\tfor (Critter A : Critter.population){\n\t\t\tA.energy = A.getEnergy() - Params.rest_energy_cost;\n\t\t\tif(A.getEnergy()<=0){\n\t\t\t\tA.isAlive=false;\n\t\t\t}\n\t\t}\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\t\t//babies add\n\t\tfor(Critter b: babies){\n\t\t\tb.isAlive=true;\n\t\t\tpopulation.add(b);\n\t\t}\n\t\t//not sure if this removes everything\n\t\tbabies.clear();\n\t}"
] | [
"0.635507",
"0.61443275",
"0.6093528",
"0.603941",
"0.6018446",
"0.5987115",
"0.59154755",
"0.58732",
"0.58526516",
"0.58471936",
"0.5826568",
"0.582041",
"0.582041",
"0.582041",
"0.58132815",
"0.57842946",
"0.5746964",
"0.5732054",
"0.5728086",
"0.572084",
"0.5717954",
"0.57134706",
"0.56864774",
"0.56845635",
"0.56815225",
"0.56800383",
"0.56779766",
"0.567272",
"0.56720525",
"0.56675714",
"0.5661022",
"0.566099",
"0.5660322",
"0.56598336",
"0.56506044",
"0.56492656",
"0.5644546",
"0.56436586",
"0.5643472",
"0.5641887",
"0.5634965",
"0.56298745",
"0.56251276",
"0.5623647",
"0.5608681",
"0.56069356",
"0.55992264",
"0.5588372",
"0.5584076",
"0.5583822",
"0.5579956",
"0.557901",
"0.55645436",
"0.55630225",
"0.5561323",
"0.5543773",
"0.5539164",
"0.552958",
"0.55243915",
"0.5523491",
"0.5522258",
"0.5512698",
"0.55106395",
"0.55077815",
"0.55058527",
"0.5504424",
"0.548719",
"0.5475297",
"0.546576",
"0.54654974",
"0.54601747",
"0.54601026",
"0.5446956",
"0.5445386",
"0.5444462",
"0.54411924",
"0.5435575",
"0.5427974",
"0.5425054",
"0.54246694",
"0.5421615",
"0.5413419",
"0.54128176",
"0.5410756",
"0.54095227",
"0.54058075",
"0.53925794",
"0.53922606",
"0.5390438",
"0.5383425",
"0.5383096",
"0.5381945",
"0.5379011",
"0.5377588",
"0.5376428",
"0.5371529",
"0.5368632",
"0.5366751",
"0.53639174",
"0.5362224",
"0.5361572"
] | 0.0 | -1 |
halts threads, ends the app | public synchronized void stop() {
try {
thread.join();
running = false;
} catch (InterruptedException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t\n\t\t\t while ( !bFinished ) {\n\t\t\t \ttry {\n\t\t\t\t\t\t\tThread.sleep(200);\n\t\t\t\t\t\t} catch (InterruptedException 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 }\n\t\t\t System.exit(0);\n\t\t\t\t}",
"private void terminateWorkerThreads() {\n log.info(\"Terminating worker threads..\");\n try {\n this.periodicReportingService.stopPeriodicTasks();\n this.running.set(false);\n this.logWriter.join();\n this.join();\n } catch (Exception e) {\n log.error(\"Error shutting down \", port);\n }\n }",
"private void closeThread() {\n running = false;\n }",
"public void stop() {\n\t\trunning = false;\n\t\tfor (ArionumHasher hasher : hashers) {\n\t\t\thasher.setForceStop(true);\n\t\t}\n\n\t\tthreadCollection.clear();\n\t\thashers.clear();\n\t}",
"public void finishThread() {\n\t\tstopBlinking();\n\t\tpin1.low();\n\t\tpin2.low();\n\t\tpin3.low();\n\t}",
"public void terminate () {\n for (int i=0; i<threads; i++) {\n servers[i].terminate ();\n }\n }",
"private void runExit() {\n new Thread(new Runnable() {\n public void run() {\n System.exit(0);\n }\n }).start();\n }",
"public void stopThread() \n {\n \tthis.exit = true;\n \t//ctr.getMemory().programmcounter = 65536;\n }",
"private void stop() {\r\n\t\tif (!running)\r\n\t\t\treturn;\r\n\t\trunning = false;\r\n\t\ttry {\r\n\t\t\tthread.join();//ends thread to close program correctly\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(0);//closes canvas\r\n\t\t}\r\n\t}",
"private void exit() {\n this.isRunning = false;\n }",
"@Override\n\tpublic void run() {\n\t\twhile (!term) {\n\t\t\t// do something with 5 second intervals in between\n\t\t\ttry {\n\t\t\t\tThread.sleep(Settings.getActivityInterval());\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tlog.info(\"received an interrupt, system is shutting down\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!term) {\n\t\t\t\t// log.debug(\"doing activity\");\n\t\t\t\tterm = doActivity();\n\t\t\t}\n\n\t\t}\n\t\tlog.info(\"closing \" + connections.size() + \" connections\");\n\t\t// clean up\n\t\tfor (Connection connection : connections) {\n\t\t\tconnection.closeCon();\n\t\t}\n\t\tfor (Connection connection : loadConnections) {\n\t\t\tconnection.closeCon();\n\t\t}\n\t\tfor (Connection connection : broadConnections) {\n\t\t\tconnection.closeCon();\n\t\t}\n\t\tlistener.setTerm(true);\n\t}",
"public void exit() {\n try {\n synchronized (this.mSync) {\n if (this.mRunning) {\n this.mRunning = false;\n this.mSync.wait();\n }\n }\n } catch (Throwable ex) {\n /**NON BLOCK**/\n }\n }",
"private void exitApp()\n {\n if(spider.isCrawling())\n {\n stopCrawler();\n showTransition(1000);\n Timer task = new Timer(1000, (ActionEvent e)->\n {\n System.exit(0);\n });\n\n task.setRepeats(false);\n task.start();\n }\n \n else System.exit(0);\n }",
"public void cleanDeadThreads()\n {\n\t\tSystem.gc();\n }",
"public void run() {\n Launcher.destroyAll();\n }",
"protected void end()\n\t{\n\t\tstop();\n\t}",
"@Override\r\n\t\tpublic void run() {\n\t\t\twhile(bLinked &&!isExit()){\r\n\t\t\t\tLog.d(\"123\", \"set heart beat threadid:\"+Thread.currentThread().getId());\r\n\t\t\t\tjni.talkSetHeartBeat();\r\n\t\t\t\tif(jni.talkGetRegisterState()!=1 ){\r\n\t\t\t\t\tLog.e(\"123\", \"心跳停止了\");\r\n\t\t\t\t\tbLinked = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbLinked = true;\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(interval*1000);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!bLinked){\r\n\t\t\t\thandler.sendEmptyMessage(MSG_NOT_LINK);\r\n\t\t\t}\r\n\t\t\theartThread = null;\r\n\t\t\tsuper.run();\r\n\t\t}",
"public synchronized void quit() {\n\t\tif(alive) {\n\t\t\talive = false;\n\t\t\t// thread might be waiting for commands so give it an interrupt.\n\t\t\tthread.interrupt();\n\t\t}\n\t}",
"private synchronized void stopThreads() {\n if (myGameThread != null) {\n myGameThread.requestStop();\n }\n if (myTumbleweedThread != null) {\n myTumbleweedThread.requestStop();\n }\n if (myMusicMaker != null) {\n myMusicMaker.requestStop();\n }\n myGameThread = null;\n myTumbleweedThread = null;\n myMusicMaker = null;\n }",
"public void quit() {\r\n\t\trunning = false;\r\n\t\tt= null;\r\n\t}",
"@Override\n public void run() {\n \tfinish();\n }",
"public void terminate() {\r\n running = false;\r\n }",
"@Override\n protected void onStop() {\n \tsuper.onStop();\n \tthread.setThreadExit(true);\n \tthread = null;\n \t\n }",
"private synchronized void endWashing() {\n washingMachineState = WashingMachineState.ENABLE;\n LOGGER.info(\"{}:Washing complete.\", Thread.currentThread().getId());\n }",
"private static void exit(){\n\t\t\n\t\tMain.run=false;\n\t\t\n\t}",
"public void halt ( )\n\t{\n\t\tthis.running = false;\n\t}",
"protected void cleanup() {\n finished = true;\n thread = null;\n }",
"protected void onExit() {\r\n\t\tnew DelayAsyncTask(this, 500).execute();\r\n\t}",
"public void killAndFinish()\n\t{\n\t\tif (isKilled()) return;\n\t\tupdate(Float.MAX_VALUE);\n\t}",
"public void Stop() {\r\n\t\t\r\n\t\tthread = null;\r\n\t}",
"public void terminate() {\n\t\trunning = false;\n\t}",
"@Override\n\t\t\tpublic void doTimeOutWork() {\n\t\t\t\tthis.exit();\n\t\t\t}",
"@Override\n\t\t\tpublic void doTimeOutWork() {\n\t\t\t\tthis.exit();\n\t\t\t}",
"public void shutdown() {\n\t\tfinal List<Runnable> tasks = updater.shutdownNow();\n\t\tif (null == tasks) return;\n\t\tfor (final Runnable t : tasks)\n\t\t\tt.run();\n\t}",
"@Override\n public void bailOut() {\n debug.println(\"bailOut: called\");\n\n UpdateThread upt = getUpdateThread();\n if (upt != null) upt.endLoop();\n\n // When we are stealing a previous RtDisplay's connection, we don't\n // want to shut it down. The makeRtDisplay() \"steal\" version handles\n // setting this to null.\n if (ss != null)\n ss.close();\n\n timeThread.kill();\n if (audioThread != null)\n audioThread.kill();\n\n setVisible(false);\n\n // inform all the children window that the parent has died (plots/lists)\n for (RtStatusListener i : watchers) {\n i.sourceDied();\n }\n\n // kill the parent frame\n if (parentFrame != null)\n parentFrame.dispose();\n\n // notify the RTDManager that we're dead\n manager.removeDisplay(this);\n }",
"protected void end() {\n Robot.wedge.stop();\r\n Robot.driveTrain.stop();\r\n Robot.ballIntake.stop();\r\n }",
"protected void end() {\n \tlift.stop();\n }",
"@Override\n\t\t\t\t public void run() {\n\t\t\t\t \tsplashActivity.get().finish();\n\t\t\t\t \tsplashActivity = null;\n\t\t\t\t }",
"public void terminate(){\n running = false;\n }",
"public void shutdown() {\n\t\tthreadPool.shutdown();\n\t}",
"public void exit() {\n\t\tJWebSocketTokenClient lClient;\n\t\tfor (int lIdx = 0; lIdx < mFinished; lIdx++) {\n\t\t\tlClient = mClients[lIdx];\n\t\t\tlClient.removeTokenClientListener(this);\n\t\t\ttry {\n\t\t\t\tmLog(\"Closing client #\" + lIdx + \" on thread: \" + Thread.currentThread().hashCode() + \"...\");\n\t\t\t\tlClient.close();\n\t\t\t\tThread.sleep(20);\n\t\t\t} catch (Exception lEx) {\n\t\t\t\tmLog(\"Exception: \" + lEx.getMessage() + \". Closing client #\" + lIdx + \"...\");\n\t\t\t}\n\t\t}\n\t}",
"public void terminate()\n\t{\n\t\tsynchronized (this) { this.running = false; }\n\t}",
"public void stop() {\r\n\t\t//If the program has an error this will stop the program\r\n\t\ttry {\r\n\t\t\trunning = false;\r\n\t\t\tg.dispose();\r\n\t\t\tthread.join();\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void endGame()\n\t{\n\t\tbuttonPanel.endGameButton.setEnabled(false);\n\t\tstopThreads();\n\t\tsendScore();\n\t}",
"@Override\n public void run() {\n exit_int=0;\n }",
"private void closeMainStage(){\r\n serialConnection.closeSerialConnection();//zamkniecie polaczenai serialowego i wyczyszczenie zasobow\r\n controlThreadRunFlag = false;//zastopowanie wątku kontrolnego\r\n closeAllAutomaticSendThreads(automaticSendThreadArraylist);//zamkniecie wszystkich watkow automatycznej wiadomości\r\n System.gc();//poinformowanie maszyny wirtualnej o usunieciu referencji na nieuzywane obiekty\r\n Platform.exit();//zamkniecie apliakcji - DO ZMIANY !!!!!!!!!!!!!!!!\r\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (((LBSManager)PushServiceManager.getService(ServiceType.LBS_MANAGER))\n\t\t\t\t\t\t.isLBS()) {\n\t\t\t\t\t((LBSManager)PushServiceManager.getService(ServiceType.LBS_MANAGER))\n\t\t\t\t\t.closeLBSPush();\n\t\t\t\t\tSystem.out.println(\"关闭LBS服务: …………&&***((\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(2000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public void shutdown() {\n /**\n * Make this thread instance null.\n */\n THREAD_INSTANCE = null;\n\n /**\n * Destroy Keep Alive Thread.\n */\n KEEP_ALIVE_THREAD.pause();\n KEEP_ALIVE_THREAD.stop();\n KEEP_ALIVE_THREAD = null;\n }",
"@Override\n\tpublic void run() {\n\t\tsynchronized(Main.lck) {\n\t\t\tSystem.out.println(this.t.getName());\t\n\t\t\ttry {\n\t\t\t\tMain.lck.wait();\n\t\t\t\tSystem.out.println(\"Terminating thread \"+this.t.getName());\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}\n\t\t\n\t}",
"public synchronized void stop() {\n\t\tif(!isRunning) return; //If the game is stopped, exit method\n\t\tisRunning = false; //Set boolean to false to show that the game is no longer running\n\t\t//Attempt to join thread (close the threads, prevent memory leaks)\n\t\ttry {\n\t\t\tthread.join();\n\t\t}\n\t\t//If there is an error, print the stack trace for debugging\n\t\tcatch(InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void shutdown() {\n\t\trunning = false;\n\t\texecutor.shutdown();\n\t\tlog.info(\"### All threads shutdown requested ###\");\n\t\t\n\t\ttry {\n\t\t\tfor (int i = 0; !executor.awaitTermination(10, TimeUnit.SECONDS); i++) {\n\t\t\t\tlog.info(\"### Awaiting for pending task pool termination... ({}) ###\", i);\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\tlog.warn(\"### Exception awaiting for pending task pool termination: {} ###\", e.getMessage());\n\t\t}\n\t\t\n\t\tlog.info(\"### All threads have finished ###\");\n\t}",
"public void Shutdown()\n {\n eventLoopGroup.shutdownGracefully();\n }",
"public void run() {\n try {\n Thread.sleep(2000);\n }\n catch (InterruptedException ex) { }\n // system is still running, so force an exit\n System.exit(0);\n }",
"public void run() {\n try {\n Thread.sleep(10000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n mainThread.interrupt();\n }",
"public synchronized void stop() {\n try {\n if (isRunning) {\n isRunning = false;\n thread.join();\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.exit(0);\n }",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tisExit=false;\n\t\t\t\t}",
"void terminate() {\r\n\t\t\t\tif (done.compareAndSet(false, true)) {\r\n\t\t\t\t\tlatch.countDown();\r\n\t\t\t\t}\r\n\t\t\t}",
"void terminate() {\r\n\t\t\t\tif (done.compareAndSet(false, true)) {\r\n\t\t\t\t\tlatch.countDown();\r\n\t\t\t\t}\r\n\t\t\t}",
"void terminate() {\r\n\t\t\t\tif (done.compareAndSet(false, true)) {\r\n\t\t\t\t\tlatch.countDown();\r\n\t\t\t\t}\r\n\t\t\t}",
"void terminate() {\r\n\t\t\t\tif (done.compareAndSet(false, true)) {\r\n\t\t\t\t\tlatch.countDown();\r\n\t\t\t\t}\r\n\t\t\t}",
"public synchronized void stop() {\n\t\tif (!isStart) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tfor (LoopThread l : thread) {\n\t\t\tl.finnish();\n\t\t}\n\t\tint activeCount;\n\t\tdo{\n\t\t\tactiveCount = 0;\n\t\t\tfor(LoopThread l : thread){\n\t\t\t\tif(l.isAlive()){\n\t\t\t\t\tactiveCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (activeCount > 0);\n\t\t\n\t}",
"public synchronized void close() {\n \t\trecallThreads();\n \n \t\tsetSize(0, 0);\n \t\t/* Notify everyone waiting for a thread */\n \t\tnotifyAll();\n \n \t\t// destroy the threadgroup, will never go away otherwise\n \t\ttry {\n \t\t\t// Need to set it to a daemon first otherwise it will not be destroyed\n \t\t\tsetDaemon(true);\n \t\t\tdestroy();\n \t\t} catch (Exception e) {\n \t\t\t// TODO: consider logging\n \t\t}\n \t}",
"public void stopPollingThread() {\n pool.shutdown();\n }",
"@Override\n public void run() {\n final long runtime = (System.currentTimeMillis() - mTimeStarted) / 1000;\n Log.d(TAG, \"Terminating beacon burst after \" + runtime + \" seconds.\");\n\n // clear message queue\n mHandler.removeCallbacksAndMessages(null);\n\n // update state\n mWifiBeaconingState = WifiBeaconingState.DISABLING;\n //TODO mBtBeaconingState = BtBeaconingState.DISABLING;\n\n // stop sending beacons\n mBeaconingManager.stopBeaconSenders();\n\n // if there are no locks, restore network to previous state\n if (!mBeaconingManager.isInternetLocked() && !mBeaconingManager.isWifiConnectionLocked()) {\n restoreNetworks();\n }\n\n // quit looper\n mHandler.getLooper().quit();\n mHandler = null;\n\n // notify internet callbacks\n mBeaconingManager.notifyInternetCallbacks();\n\n if (!aborted) {\n // we are finishing the beaconing period normally, notify BeaconingManager\n mBeaconingManager.onBeaconingIntervalFinished(mBeaconingId);\n }\n }",
"public void terminateAllCalls();",
"protected void end() {\n \tRobot._frontClimber.stop();\n }",
"protected void end() {\n \tdrivemotors.stop();\n }",
"public void e() {\n if (this.b != null) {\n this.b.getLooper().quit();\n this.b = null;\n }\n }",
"@Override\n public void run() {\n try {\n init();\n gameLoop();\n } catch (LWJGLException lwjgle) {\n lwjgle.printStackTrace();\n } finally {\n cleanup();\n }\n\n System.exit(0);\n }",
"public abstract void stopThreadsAtSafePoint();",
"private void ending() {\n\t\tstartView.ending();\n\t\tSystem.exit(-1);\n\t}",
"void endTask();",
"public void shutdown() {\r\n ThreadLocalEventLoop.INSTANCE.resetEventLoop$kotlinx_coroutines_core();\r\n this.isCompleted = true;\r\n closeQueue();\r\n do {\r\n } while (processNextEvent() <= 0);\r\n rescheduleAllDelayed();\r\n }",
"@Override\n public void stopThread() {\n Log.d(TAG, \"Stopping \" + getName() + \" thread!\");\n running = false;\n doStopAction();\n boolean retry = true;\n while (retry) {\n try {\n join();\n retry = false;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }",
"protected void end() {\n \tRobot.vision_.stopGearLiftTracker();\n }",
"@Override\n\tpublic void run() {\n\n\t\twhile (running.get()) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Shutting down thread\");\n\t}",
"public void shutdown() {\n\t\t\tfirebaseLooper.quit() ;\n\t\t}",
"private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public void run() {\n finish();\n }",
"public void shutDown()\n\t{\n\t\tthis.threadPool.shutdown();\n\t}",
"void shutdown()\n {\n run = false;\n try\n {\n join();\n }\n catch (InterruptedException ex)\n {\n Activator.getLogger().log(Level.WARNING, \"JCACommandThread shutdown\", ex);\n }\n Activator.getLogger().log(Level.FINE, \"JCACommandThread queue reached up to {0} entries\", max_size_reached);\n }",
"public void stop() {\n clockThread = null;\n }",
"protected void end() {\n \t//claw.close();\n }",
"public void stop() {\n thread = null;\n }",
"private static void exit() {\n dvm.exit();\n stop = true;\n }",
"private void shutdown() {\n LOG.info(\"shutting down QlikLoad\");\n\n // pause briefly to allow things to drain\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n LOG.trace(\"shutdown() timer\");\n }\n\n if ((baos.size() != 0)) {\n LOG.warn(\"shutdown(): Thread {} baos HAS NOT been drained. Size: {}\",\n threadName, baos.size());\n } else {\n LOG.info(\"shutdown(): Thread {} baos has been drained. Size: {}\",\n threadName, baos.size());\n }\n\n\n qlikSocket.shutdown();\n }",
"public void stop() {\n done=true;\n bridges.forEach(Bridge::stop);\n bridges.clear();\n }",
"public void run() \n \t {\n \t \tCloseActivity();\n \t }",
"public void run() {\n\t\t\t\ttry {\n\t\t\t\t\tsleep(5000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tfinally{ finish(); }\n\t\t\t}",
"public void exit() {\n loader.getApplet().stop();\n loader.getApplet().destroy();\n }",
"public void shutdown() {\n this.runnable.stop = true;\n LockSupport.unpark(this);\n }",
"public void quit() {\n Looper looper = this.mLooper;\n if (looper != null) {\n looper.quitSafely();\n this.mLooper = null;\n }\n }",
"protected void end() {\n \tRobot.conveyor.stop();\n }",
"public void stopThreads() {\n int i;\n Thread[] thGroup;\n Thread t;\n\n thGroup = new Thread[Thread.activeCount()];\n Thread.enumerate(thGroup);\n\n for (i = 0; i < thGroup.length; i++) {\n t = thGroup[i];\n if (t != null) {\n if (t != Thread.currentThread()) {\n if (t.getName().startsWith(\"Thread\"))\n t.stop();\n else if (t.getName().startsWith(\"AWT-EventQueue\"))\n t.stop();\n }\n }\n }\n\n thGroup = null;\n\n System.gc();\n }",
"private void shutdownThreads() {\n\t\tif (backupHeartbeatBroadcaster != null) {\n\t\t\tbackupHeartbeatBroadcaster.cancel();\n\t\t}\n\t\tif (activeHeartbeatTimer != null) {\n\t\t\tactiveHeartbeatTimer.cancel();\n\t\t}\n\t\tif (serverLatencyProcessorTimer != null) {\n\t\t\tserverLatencyProcessorTimer.cancel();\n\t\t}\n\t\tif (backupHeartbeatTimer != null) {\n\t\t\tbackupHeartbeatTimer.cancel();\n\t\t}\n\t\tif (reElectionTimer != null) {\n\t\t\treElectionTimer.cancel();\n\t\t}\n\t\tif (preElectionTimeoutTimer != null) {\n\t\t\tpreElectionTimeoutTimer.cancel();\n\t\t}\n\t}",
"public void mo64174b() {\n HandlerThread handlerThread = this.f41221b;\n if (handlerThread != null) {\n handlerThread.quitSafely();\n this.f41221b = null;\n this.f41223d = null;\n }\n }",
"@Override\n public boolean queueIdle() {\n mThread.getLooper().quit();\n nativeOnLooperStopped(nativeThread);\n return false;\n }",
"public void shutdown()\n {\n this.running = false;\n }",
"void join() {\n join(this.workerThread);\n join(this.cacheFlusher);\n join(this.compactSplitThread);\n join(this.logRoller);\n }",
"public void halt();",
"@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\tIterator<Future<Integer>> iter = runningThreadsList.iterator();\n\t\t\tif (iter.hasNext()) {\n\t\t\t\tFuture<Integer> future = (Future<Integer>) iter.next();\n\t\t\t\tif (future.isDone()) {\n\t\t\t\t\trunningThreadsList.remove(future);\n\t\t\t\t\t\n\t\t\t\t\tif (allocator.getInventory().isEmpty()) {\n\t\t\t\t\t\tallocator.shutdown();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tThread.yield();\n\t\t}\n\t\t\t\n\t\t\n\t}"
] | [
"0.68404603",
"0.6688826",
"0.66159827",
"0.6559145",
"0.65109694",
"0.65019923",
"0.6470515",
"0.6463122",
"0.64492166",
"0.6448488",
"0.6445716",
"0.64182687",
"0.6410067",
"0.6396583",
"0.6389255",
"0.63674235",
"0.63615966",
"0.63591737",
"0.63509357",
"0.6348777",
"0.6310324",
"0.6302613",
"0.63004774",
"0.62939423",
"0.6247936",
"0.6247811",
"0.62430125",
"0.6242115",
"0.6237466",
"0.6231041",
"0.6229364",
"0.6203024",
"0.6203024",
"0.6196839",
"0.6194843",
"0.6193121",
"0.61895674",
"0.6180704",
"0.61797035",
"0.61742574",
"0.6170266",
"0.6168065",
"0.61644876",
"0.61326855",
"0.61304075",
"0.6117118",
"0.6108432",
"0.6099925",
"0.6098151",
"0.60956204",
"0.6089704",
"0.6084551",
"0.6082993",
"0.6077614",
"0.60758317",
"0.6070737",
"0.606958",
"0.606958",
"0.606958",
"0.606958",
"0.6066503",
"0.6056092",
"0.6035619",
"0.60317457",
"0.60296327",
"0.6022903",
"0.6021688",
"0.60190475",
"0.60159683",
"0.60119015",
"0.60069513",
"0.60064214",
"0.60026014",
"0.60003114",
"0.5996458",
"0.5988472",
"0.5986356",
"0.5975852",
"0.5974281",
"0.597194",
"0.59716845",
"0.59631085",
"0.5961393",
"0.5960651",
"0.59586424",
"0.59547156",
"0.5954144",
"0.5953477",
"0.5942807",
"0.5942218",
"0.5937434",
"0.593366",
"0.59281486",
"0.5925508",
"0.5919185",
"0.59148246",
"0.5914525",
"0.5910346",
"0.59099066",
"0.59027445",
"0.5898984"
] | 0.0 | -1 |
/ fps for the game that loops over the code research part: renders game as fast as it can resolves large amount of collisions per frame, dragging the performance. calls tick() at a steady frequency to make the game stable improvement: avoid using System.currentTimeMillis() it is susceptible to changing the system clock research other or create game loops that offer variable time step but doesn't wreck game physics computations | public void run() {
this.requestFocus();
long lastTime = System.nanoTime();
double amountOfTicks = 60.0;
double ns = 1000000000 / amountOfTicks;
double delta = 0;
long timer = System.currentTimeMillis();
int frames = 0;
while (running) {
long now = System.nanoTime();
delta += (now - lastTime) / ns;
lastTime = now;
while (delta >= 1) {
tick();
delta--;
}
if (running) {
render();
}
frames++;
if (System.currentTimeMillis() - timer > 1000) {
timer += 1000;
System.out.println("FPS: " + frames);
frames = 0;
}
}
stop();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void run() {\n\t\tlong lastLoopTime = System.nanoTime();\n\t\tfinal int TARGET_FPS = 60;\n\t\tfinal long OPTIMAL_TIME = 1000000000 / TARGET_FPS;\n\n\t\t// keep looping round til the game ends\n\t\twhile (true) {\n\t\t\t// work out how long its been since the last update, this\n\t\t\t// will be used to calculate how far the entities should\n\t\t\t// move this loop\n\t\t\tlong now = System.nanoTime();\n\t\t\tlong updateLength = now - lastLoopTime;\n\t\t\tlastLoopTime = now;\n\n\t\t\t// update the frame counter\n\t\t\tlastFpsTime += updateLength;\n\t\t\tfps++;\n\n\t\t\t// update our FPS counter if a second has passed since\n\t\t\t// we last recorded\n\t\t\tif (lastFpsTime >= 1000000000) {\n\t\t\t\tSystem.out.println(\"(FPS: \" + fps + \")\");\n\t\t\t\tlastFpsTime = 0;\n\t\t\t\tfps = 0;\n\t\t\t}\n\n\t\t\t// update the game logic\n\t\t\ttick();\n\n\t\t\t// render\n\t\t\tglWindow.display();\n\n\t\t\t// sleep the current thread for the appropriate amount of time\n\t\t\ttry {\n\t\t\t\tThread.sleep(Math.max(0, (lastLoopTime - System.nanoTime() + OPTIMAL_TIME) / 1000000));\n\t\t\t}\n\t\t\tcatch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void run()\n\t{\n\t\tfloat oneFrame = 1000000000.0f / gameFPS;\n\t\t//same but for animation frames\n\t\tfloat oneAnimFrame = 1000000000.0f / animFPS;\n\t\t//current time in nanoseconds\n\t\tlong now = 0;\n\t\t//holds time of last iteration of game loop\n\t\tlong last = System.nanoTime();\n\t\t//how many frames have passed (can be a fraction)\n\t\tfloat delta = 0;\n\t\t//same but for anim frames\n\t\tfloat animDelta = 0;\n\t\t\n\t\t//for counting and displaying only \n\t\tint countFrames = 0;\n\t\tlong lastMilli = System.currentTimeMillis();\n\t\t\n\t\trequestFocus();\n\t\t//game loop\n\t\twhile (playing)\n\t\t{\n\t\t\t\n\t\t\tnow = System.nanoTime();\n\t\t\t//(now - last) time elapsed, divided by oneFrame gives\n\t\t\t//what fraction of a frame has passed\n\t\t\tdelta += (now - last) / oneFrame;\n\t\t\tanimDelta += (now - last) / oneAnimFrame;\n\t\t\tlast = now;\n\t\t\t//keep calling tick for as many frames have passed\n\t\t\t//if it's at least 1\n\t\t\tif (delta >= 1.0f)\n\t\t\t{\n\t\t\t\tcountFrames++;\n\t\t\t\twhile (delta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (animDelta >= 1.0f)\n\t\t\t{\n\t\t\t\twhile (animDelta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tanimTick();\n\t\t\t\t\tanimDelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\trender();\n\t\t\tcountFrames++;\n\t\t\tif (Math.abs(System.currentTimeMillis() - lastMilli) >= 1000)\n\t\t\t{\n\t\t\t\tFPS = countFrames;\n\t\t\t\tcountFrames = 0;\n\t\t\t\tlastMilli = System.currentTimeMillis();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void run() {\n long previousTime = System.currentTimeMillis();\n long timeSinceLastTick = 0L;\n long timeSinceLastDisplayFrame = 0L;\n\n final double millisecondsPerDisplayFrame = 1000.0 / DISPLAY_FPS;\n\n while (this.game.isRunning() && !this.game.isGameOver()) {\n long currentTime = System.currentTimeMillis();\n long elapsedTime = currentTime - previousTime;\n timeSinceLastTick += elapsedTime;\n timeSinceLastDisplayFrame += elapsedTime;\n\n if (timeSinceLastTick >= MILLISECONDS_PER_TICK) { // Check if enough time has passed to update the physics.\n this.updatePhysics(); // Perform one 'step' in the game.\n timeSinceLastTick = 0L;\n }\n if (timeSinceLastDisplayFrame >= millisecondsPerDisplayFrame) { // Check if enough time has passed to refresh the display.\n this.game.notifyListeners(timeSinceLastTick); // Tell the asteroids panel that it should refresh.\n timeSinceLastDisplayFrame = 0L;\n }\n\n previousTime = currentTime;\n }\n }",
"@Override\n /**\n * Runs the game loop\n */\n public final void run() {\n initialize();\n\n // Timing variables\n long accumulator = 0L;\n long lastTime = System.nanoTime();\n long startTime;\n\n // Main game loop\n while(isRunning) {\n // Get times\n startTime = System.nanoTime();\n accumulator += startTime - lastTime;\n lastTime = startTime;\n\n // Update while the elapsed time is greater than the time interval\n while(accumulator >= NS_PER_UPDATE) {\n accumulator -= NS_PER_UPDATE;\n updateGame();\n }\n\n // Render to the screen\n renderer.beginRender();\n renderGame();\n renderer.endRender();\n }\n\n // Clean up the game components here\n terminate();\n }",
"public void run(){\n\t\tdouble target = 60.0;\n double nsPerTick = 1000000000.0 / target;\n long lastTime = System.nanoTime();\n long timer = System.currentTimeMillis();\n double unprocessed = 0.0;\n int fps = 0;\n int tps = 0;\n boolean canRender = false;\n \n while (running) {\n long now = System.nanoTime();\n unprocessed += (now - lastTime) / nsPerTick;\n lastTime = now;\n \n if(unprocessed >= 1.0){\n tick();\n unprocessed--;\n tps++;\n canRender = true;\n }else canRender = false;\n \n try {\n Thread.sleep(1);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n \n if(canRender){\n //render\n \trender();\n fps++;\n }\n \n if(System.currentTimeMillis() - 1000 > timer){\n timer += 1000;\n System.out.printf(\"FPS: %d | TPS: %d\\n\", fps, tps);\n fps = 0;\n tps = 0;\n }\n \n }\n \n System.exit(0);\n\t}",
"public void start(){\n isRunning = true;\n\n // This is where the magic happens\n Thread loop = new Thread(){\n\t\t\tpublic void run(){\n\t\t final double targetHertz = 30; // target updates per second\n\t\t final double updateTime = 1e9 / targetHertz; // target time between updates\n\t\t final int maxUpdates = 5; // max updates before a render is forced\n\t\t \n\t\t final double targetFps = 60; // target frames per second (fps)\n\t\t final double renderTime = 1e9 / targetFps; // target time between renders\n\t\t \n\t\t double lastUpdate = System.nanoTime();\n\t\t double lastRender = System.nanoTime();\n\n\t\t while (isRunning){\n\t\t \tdouble now = System.nanoTime();\n\t\t \t\n\t\t \tint updates = 0;\n\t\t \twhile (now - lastUpdate > updateTime && updates < maxUpdates){ // Update the game as much as possible before drawing\n\t\t \t\tgamePanel.update();\n\t\t \t\tlastUpdate += updateTime;\n\t\t \t\tupdates++;\n\t\t \t}\n\t\t \t\n\t\t \tif (now - lastUpdate > updateTime){ // Compensate for really long updates\n\t\t \t\tlastUpdate = now - updateTime;\n\t\t \t}\n\t\t \t\n\t\t \t// Draw the game\n\t\t \tgamePanel.repaint();\n\t\t \tlastRender = now;\n\t\t \t\n\t\t \t// kill some time until next draw\n\t\t \t\n\t\t \twhile (now - lastRender < renderTime && now - lastUpdate < updateTime){\n\t\t \t\tThread.yield();\n\t\t \t\t\n\t\t \t\ttry { Thread.sleep(1);} catch (Exception e) { }\n\t\t \t\t\n\t\t \t\tnow = System.nanoTime();\n\t\t \t}\n\t\t }\n\t\t\t}\n\t\t};\n\t\tloop.start();\n }",
"private void gameLoop() {\n\n\t\tlong elapsedTime = 0;\n\t\tlong newTime;\n\t\tlong oldTime = System.nanoTime();\n\t\tlong expectedTime = 1000000000 / 60;\n\t\tdouble delta;\n\n\t\tint frames = 0;\n\t\tlong frameTimer = 0;\n\n\t\twhile (!Display.isCloseRequested() && !gameOver) {\n\n\t\t\t// get new time, find elapsed time, determine delta\n\t\t\tnewTime = System.nanoTime();\n\t\t\telapsedTime = newTime - oldTime;\n\t\t\tdelta = (double)elapsedTime / (double)expectedTime;\n\t\t\toldTime = newTime;\n\n\t\t\t// update frame count\n\t\t\tframes++;\n\t\t\tframeTimer += elapsedTime;\n\n\t\t\t// if a second has passed, print the fps\n\t\t\tif (frameTimer >= 1000000000) {\n\t\t\t\tSystem.out.println(\"FPS: \" + frames);\n\t\t\t\tSystem.out.println(delta);\n\t\t\t\tframeTimer = Math.max(0, frameTimer - 1000000000);\n\t\t\t\tframes = 0;\n\t\t\t}\n\n\t\t\t// update game state\n\t\t\tsoundManager.update();\n\t\t\tstateManager.update(delta);\n\t\t\tstateManager.render();\n\t\t\tgui.update();\n\t\t\tDisplay.update();\t\n\n\t\t\t// sleep until 1/60 of a second has passed\n\t\t\tif (newTime - oldTime < expectedTime) {\n\n\t\t\t\twhile (newTime - oldTime < expectedTime) {\n\n\t\t\t\t\tnewTime = System.nanoTime();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(0);\n\t\t\t\t\t} catch (InterruptedException e) { } \n\n\t\t\t\t} \n\t\t\t}\n\t\t\telse {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(0);\n\t\t\t\t} catch (InterruptedException e) { }\n\t\t\t}\n\n\t\t}\n\t}",
"@Override\n\tpublic void run() {\n\t\tLog.d(\"Engine\", \"Engine.run start\");\n\n\t\tListIterator<Sprite> iter = null, iterA = null, iterB = null;\n\n\t\tTimer frameTimer = new Timer();\n\t\tint frameCount = 0;\n\t\tint frameRate = 0;\n\t\tlong startTime = 0;\n\t\tlong timeDiff = 0;\n\n\t\twhile (p_running) {\n\t\t\t// Process frame only if not paused\n\t\t\tif (p_paused)\n\t\t\t\tcontinue;\n\n\t\t\t// Calculate frame rate\n\t\t\tframeCount++;\n\t\t\tstartTime = frameTimer.getElapsed();\n\t\t\tif (frameTimer.stopwatch(1000)) {\n\t\t\t\tframeRate = frameCount;\n\t\t\t\tframeCount = 0;\n\n\t\t\t\t// reset touch input count\n\t\t\t\tp_numPoints = 0;\n\t\t\t}\n\n\t\t\t// Call abstract update method in sub-class\n\t\t\tupdate();\n\n\t\t\t/**\n\t\t\t * Test for collisions in the sprite group. Note that this takes\n\t\t\t * place outside of rendering.\n\t\t\t */\n\t\t\titerA = p_group.listIterator();\n\t\t\twhile (iterA.hasNext()) {\n\t\t\t\tSprite sprA = (Sprite) iterA.next();\n\t\t\t\tif (!sprA.getAlive())\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!sprA.getCollidable())\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/*\n\t\t\t\t * Improvement to prevent double collision testing\n\t\t\t\t */\n\t\t\t\tif (sprA.getCollided())\n\t\t\t\t\tcontinue; // skip to next iterator\n\n\t\t\t\t// iterate the list again\n\t\t\t\titerB = p_group.listIterator();\n\t\t\t\twhile (iterB.hasNext()) {\n\t\t\t\t\tSprite sprB = (Sprite) iterB.next();\n\t\t\t\t\tif (!sprB.getAlive())\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (!sprB.getCollidable())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Improvement to prevent double collision testing\n\t\t\t\t\t */\n\t\t\t\t\tif (sprB.getCollided())\n\t\t\t\t\t\tcontinue; // skip to next iterator\n\n\t\t\t\t\t// do not collide with itself\n\t\t\t\t\tif (sprA == sprB)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Ignore sprites with the same ID? This is an important\n\t\t\t\t\t * consideration. Decide if your game requires it or not.\n\t\t\t\t\t */\n\t\t\t\t\tif (sprA.getIdentifier() == sprB.getIdentifier())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (collisionCheck(sprA, sprB)) {\n\t\t\t\t\t\tsprA.setCollided(true);\n\t\t\t\t\t\tsprA.setOffender(sprB);\n\t\t\t\t\t\tsprB.setCollided(true);\n\t\t\t\t\t\tsprB.setOffender(sprA);\n\t\t\t\t\t\tbreak; // exit while\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// begin drawing\n\t\t\tif (beginDrawing()) {\n\n\t\t\t\t// Call abstract draw method in sub-class\n\t\t\t\tdraw();\n\n\t\t\t\t/**\n\t\t\t\t * Draw the group entities with transforms\n\t\t\t\t */\n\t\t\t\titer = p_group.listIterator();\n\t\t\t\twhile (iter.hasNext()) {\n\t\t\t\t\tSprite spr = (Sprite) iter.next();\n\t\t\t\t\tif (spr.getAlive()) {\n\t\t\t\t\t\tspr.animate();\n\t\t\t\t\t\tspr.draw();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Print some engine debug info.\n\t\t\t\t */\n\t\t\t\tint x = p_canvas.getWidth() - 150;\n\t\t\t\tp_canvas.drawText(\"ENGINE\", x, 20, p_paintFont);\n\t\t\t\tp_canvas.drawText(toString(frameRate) + \" FPS\", x, 40,\n\t\t\t\t\t\tp_paintFont);\n\t\t\t\tp_canvas.drawText(\"Pauses: \" + toString(p_pauseCount), x, 60,\n\t\t\t\t\t\tp_paintFont);\n\n\t\t\t\t// done drawing\n\t\t\t\tendDrawing();\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Do some cleanup: collision notification, removing 'dead' sprites\n\t\t\t * from the list.\n\t\t\t */\n\t\t\titer = p_group.listIterator();\n\t\t\tSprite spr = null;\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tspr = (Sprite) iter.next();\n\n\t\t\t\t// remove from list if flagged\n\t\t\t\tif (!spr.getAlive()) {\n\t\t\t\t\titer.remove();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// is collision enabled for this sprite?\n\t\t\t\tif (spr.getCollidable()) {\n\n\t\t\t\t\t// has this sprite collided with anything?\n\t\t\t\t\tif (spr.getCollided()) {\n\n\t\t\t\t\t\t// is the target a valid object?\n\t\t\t\t\t\tif (spr.getOffender() != null) {\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * External func call: notify game of collision\n\t\t\t\t\t\t\t * (with validated offender)\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tcollision(spr);\n\n\t\t\t\t\t\t\t// reset offender\n\t\t\t\t\t\t\tspr.setOffender(null);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// reset collided state\n\t\t\t\t\t\tspr.setCollided(false);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Calculate frame update time and sleep if necessary\n\t\t\ttimeDiff = frameTimer.getElapsed() - startTime;\n\t\t\tlong updatePeriod = p_sleepTime - timeDiff;\n\t\t\tif (updatePeriod > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(updatePeriod);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t}\n\n\t\t}// while\n\t\tLog.d(\"Engine\", \"Engine.run end\");\n\t\tSystem.exit(RESULT_OK);\n\t}",
"public void run() {\r\n\t\tint frames = 0;\r\n\t\tdouble unprocessedSeconds = 0;\r\n\t\tlong previousTime = System.nanoTime();\r\n\t\tdouble secondsPerTick = 1 / 60.0;\r\n\t\tint tickCount = 0;\r\n\t\tboolean ticked = false;\r\n\t\t\r\n\t\twhile (running) {\r\n\t\t\tlong currentTime = System.nanoTime();\r\n\t\t\tlong passedTime = currentTime - previousTime;\r\n\t\t\tpreviousTime = currentTime;\r\n\t\t\tunprocessedSeconds += passedTime / 1000000000.0;\r\n\t\t\trequestFocus();//has the window selected when program is lanched\r\n\r\n\t\t\twhile (unprocessedSeconds > secondsPerTick) {\r\n\t\t\t\tunprocessedSeconds -= secondsPerTick;\r\n\t\t\t\tticked = true;\r\n\t\t\t\ttickCount++;\r\n\t\t\t\tif (tickCount % 3 == 0) {//calls on tick 20x/second\r\n\t\t\t\t\ttick();\r\n\t\t\t\t\tnumberOfTicks++;\r\n\t\t\t\t}\r\n\t\t\t\tif (tickCount % 60 == 0) {\r\n\t\t\t\t\t//System.out.println(frames + \"fps\");\r\n\t\t\t\t\tfps = frames;\r\n\t\t\t\t\tpreviousTime += 1000;\r\n\t\t\t\t\tframes = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\trender();\r\n\t\t\tframes++;\r\n\t\t}\r\n\t}",
"public static void run()\r\n\t{\r\n\t\tlong lastTime = System.nanoTime();\r\n\t\tdouble nsPerTick = 1000000000D / 30D;\r\n\t\t\r\n\t\tlong lastTimer = System.currentTimeMillis();\r\n\t\tdouble delta = 0; \r\n\r\n\t\twhile(isRunning)\r\n\t\t{\r\n\t\t\tlong now = System.nanoTime();\r\n\t\t\tdelta += (now - lastTime) / nsPerTick;\r\n\t\t\tlastTime = now;\r\n\t\t\t\r\n\t\t\twhile(delta >= 1)\r\n\t\t\t{\r\n\t\t\t\tdisplay.update();\r\n\t\t\t\tdisplay.render();\r\n\t\t\t\tdelta -= 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(System.currentTimeMillis() - lastTimer > 1000)\r\n\t\t\t{\r\n\t\t\t\tlastTimer += 1000;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void gameLoop() {\n\n looping = true;\n long lastTime = System.currentTimeMillis();\n while (looping) {\n long delta = System.currentTimeMillis() - lastTime;\n if (delta >= 1000/60d) {\n view.render();\n game.update(delta);\n lastTime = System.currentTimeMillis();\n }\n }\n }",
"public void run() {\n gameLogic = new GameLogic(drawManager.getGameFrame());\n long lastLoopTime = System.nanoTime();\n final int TARGET_FPS = 60;\n final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;\n loop(lastLoopTime, OPTIMAL_TIME);\n }",
"private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }",
"@Override\n\tpublic void run() {\n\t\trequestFocus(); //So window is selected when it opens\n\t\tfps = 0; //Counts current fps\n\t\ttimer = System.currentTimeMillis(); //Keep track of current time in milliseconds, used to display FPS\n\t\tlastTime = System.nanoTime(); //Keep track of the last time the method was called\n\t\ttargetTick = FPS; //Set desired FPS\n\t\td = 0; //Varible used to keep track if it is running at desired FPS/used to compensate\n\t\tinterval = 1000000000/targetTick; //Interval between ticks\n\n\t\twhile(isRunning) {\n\t\t\tnow = System.nanoTime(); //Capture the time now\n\t\t\td += (now - lastTime)/interval; //Calculate d\n\t\t\tlastTime = now; //Update lastTime\n\n\t\t\t//If d is >= 1 we need to render to stay on fps target\n\t\t\twhile(d >= 1) {\n\t\t\t\ttick(); //Call tick method\n\t\t\t\trender(); //Call render method\n\t\t\t\tfps++; //Increment fps\n\t\t\t\td--; //Decrement d\n\t\t\t}\n\n\t\t\t//If the difference between the current system time is greater than 1 second than last time check, print the fps, reset fps to 0, and increase timer by 1 second\n\t\t\tif(System.currentTimeMillis() - timer >= 1000) {\n\t\t\t\tfps = 0; //Set fps to 0\n\t\t\t\ttimer+=1000; //Increase timer by 1 second\n\t\t\t}\n\t\t}\n\t\tstop(); //Stop the game\n\t}",
"public void run() {\n\t\tlong lastTime = System.nanoTime();\n\t\tlong timer = System.currentTimeMillis();\n\t\tfinal double ns = 1000000000.0/60;\n\t\tdouble delta = 0;\n\t\tint frames = 0;\n\t\tint updates = 0;\n\t\trequestFocus();\n\t\twhile(running){\n\t\t\tlong now = System.nanoTime();\n\t\t\tdelta += (now-lastTime) /ns;\n\t\t\tlastTime = now;\n\t\t\twhile(delta >= 1){//60 times per sec\n\t\t\t\ttick();\n\t\t\t\tupdates++;\n\t\t\t\tdelta--;\n\t\t\t}\n\t\t\trender();//as fast as i can\n\t\t\tframes ++;\n\t\t\tif(System.currentTimeMillis() -timer > 1000){\n\t\t\t\ttimer += 1000;\n\t\t\t\tSystem.out.println(\"Fps:\"+frames+\" Updates:\"+updates);\n\t\t\t\tupdates = 0;\n\t\t\t\tframes = 0;\n\t\t\t\tthis.seconds++;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void run(){\n\t\twhile(game_running){\n\t\t\tif(singleplayer){\n\t\t\t\tcomputeDelta(); //Zeit für vorausgehenden Schleifendurchlauf wird errechnet\n\t\t\t\t//Erst Methoden abarbeiten, wenn Spiel gestartet ist\n\t\t\t\tif(isStarted()){\n\t\t\t\t\t\n\t\t\t\t\tcheckKeys(); //Tastaturabfrage\n\t\t\t\t\tdoLogic(); //Ausführung der Logik\n\t\t\t\t\tmoveObjects(); //Bewegen von Objekten\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\trepaint();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}catch (InterruptedException e){}\n\t\t\t} else{\n\t\t\t\tif(serverMode){\n\t\t\t\t\t //Zeit für vorausgehenden Schleifendurchlauf wird errechnet\n\t\t\t\t\t//Erst Methoden abarbeiten, wenn Spiel gestartet ist\n\t\t\t\t\tcomputeDelta();\n\t\t\t\t\tif(isStarted()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckKeys(); //Tastaturabfrage\n\t\t\t\t\t\tdoLogic(); //Ausführung der Logik\n\t\t\t\t\t\tmoveObjects(); //Bewegen von Objekten\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\trepaint();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(System.nanoTime() - last);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(!isStarted()){\n\t\t\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\t}else if(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n//\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n//\t\t\t\t\t\t}\n\t\t\t\t\t}catch (InterruptedException e){}\n\t\t\t\t}else if(clientMode){\n\t\t\t\t\tcomputeDelta();\n\t\t\t\t\tif(isStarted()){\n\t\t\t\t\t\tcheckKeys();\n\t\t\t\t\t\tdoLogic();\n\t\t\t\t\t\tmoveObjects();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\trepaint();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(System.nanoTime() - last);\n\t\t\t\t\ttry{\n\t\t\t\t\t\t//Thread.sleep(20);\n\t\t\t\t\t\tif(!isStarted()){\n\t\t\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\t}else if(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n//\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n//\t\t\t\t\t\t}\n\t\t\t\t\t}catch (InterruptedException e){}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\t\n\t}",
"public void runAnimation() {\n int fps = 0;\n int frames = 0;\n long totalTime = 0;\n long curTime = System.currentTimeMillis();\n long lastTime = curTime;\n // Start the loop.\n while (true) {\n try {\n // Calculations for FPS.\n lastTime = curTime;\n curTime = System.currentTimeMillis();\n totalTime += curTime - lastTime;\n if (totalTime > 1000) {\n totalTime -= 1000;\n fps = frames;\n frames = 0;\n }\n ++frames;\n // clear back buffer...\n g2d = buffer.createGraphics();\n g2d.setColor(Color.WHITE);\n g2d.fillRect(0, 0, X, Y);\n // Draw entities\n ArrayList<Spawn> living = new ArrayList<Spawn>();\n if (engine != null) {\n living.addAll(engine.getFullState().living);\n }\n for (int i = 0; i < living.size(); i++) {\n g2d.setColor(Color.BLACK);\n Spawn s = living.get(i);\n g2d.fill(new Ellipse2D.Double(s.getX(), s.getY(), s.getRadius() * 2, s.getRadius() * 2));\n }\n for (int i = 0; i < living.size(); i++) {\n g2d.setColor(Color.RED);\n Spawn s = living.get(i);\n g2d.drawLine((int) (s.getCenterX()), (int) (s.getCenterY()), (int) (s.getCenterX() + s.vx()), (int) (s.getCenterY() + s.vy()));\n }\n // display frames per second...\n g2d.setFont(new Font(\"Courier New\", Font.PLAIN, 12));\n g2d.setColor(Color.GREEN);\n g2d.drawString(String.format(\"FPS: %s\", fps), 20, 20);\n // Blit image and flip...\n graphics = b.getDrawGraphics();\n graphics.drawImage(buffer, 0, 0, null);\n if (!b.contentsLost())\n b.show();\n // Let the OS have a little time...\n Thread.sleep(15);\n } catch (InterruptedException e) {\n } finally {\n // release resources\n if (graphics != null)\n graphics.dispose();\n if (g2d != null)\n g2d.dispose();\n }\n }\n }",
"@Override\r\n\tpublic void gameLoopLogic(double time) {\n\r\n\t}",
"public void update()\n {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n if(elapsed>100)\n {\n hard += 20; // increase difficulty\n score = Dynamics.getPosition();\n startTime = System.nanoTime();\n }\n dx = (int)Dynamics.getVelocityX();\n\n animation.update();\n x += dx;\n if(x < 0){\n x = 0;\n } else if (x+width > GamePanel.WIDTH){\n x = GamePanel.WIDTH-width;\n }\n\n }",
"public void run(){\n this.requestFocus();\n long lastTime = System.nanoTime();\n double amountOfTicks = 60.0;\n double ns = 1000000000 / amountOfTicks;\n double delta = 0;\n long timer = System.currentTimeMillis();\n int frames = 0;\n\n while(isRunning){\n long now = System.nanoTime();\n delta += (now - lastTime) / ns;\n lastTime = now;\n while(delta >= 1){\n tick();\n delta--;\n }\n render();\n frames++;\n\n if(System.currentTimeMillis() - timer > 1000){\n timer += 1000;\n frames = 0;\n }\n }\n stop();\n }",
"protected void gameLoop() {\r\n init();\r\n recalculateViewport();\r\n\r\n long lastTime, lastFPS;\r\n lastTime = lastFPS = System.nanoTime();\r\n currentFramesPerSecond = 0;\r\n\r\n while(!Display.isCloseRequested()) {\r\n long deltaTime = System.nanoTime() - lastTime;\r\n lastTime += deltaTime;\r\n\r\n if(Display.wasResized())\r\n recalculateViewport();\r\n EventManager.getEventManager().processEventQueue();\r\n InputManager.getInputManager().update();\r\n update(deltaTime / 1e9);\r\n\r\n render();\r\n Display.update();\r\n\r\n currentFramesPerSecond++;\r\n if(System.nanoTime() - lastFPS >= 1e9) {\r\n lastFPS += 1e9;\r\n if(displayFPS){\r\n System.out.println(currentFramesPerSecond);\r\n }\r\n context.fps = currentFramesPerSecond;\r\n currentFramesPerSecond = 0;\r\n }//End if\r\n Display.sync(fps);\r\n }//End while\r\n System.exit(0);\r\n }",
"public void run() {\n long lasTime = System.nanoTime();//pega o tempo atual do nosso computador em nano segundos, isso da mais precisão nos fps de maneira profissional\n double amountOfTicks = 60.0;//local onde seta o FPS.\n double ns = 1000000000 / amountOfTicks;//calculo para saber o momento certo de atualizar a tela do jogo\n double delta = 0;\n int frames = 0;\n double timer = System.currentTimeMillis();//retorna o tempo do computador, usamos isso para contagem do fps, mas é opcional.\n requestFocus();//Método que foca a tela automaticamente\n while(isRunning){\n long now = System.nanoTime();\n delta+= (now - lasTime) / ns;\n lasTime = now;\n if(delta >= 1) {\n tick();//atualização da tela.\n render();//renderização da tela.\n frames++;\n delta--;\n }\n\n if(System.currentTimeMillis() - timer >= 1000){\n System.out.println(\"FPS: \" + frames);\n frames = 0;\n timer+= 1000;\n }\n\n }\n\n stop();\n }",
"public synchronized void updateGameDataAtFastRate() {\n scheduleGameUpdate(fastUpdateSpeed);\n }",
"private void loop() {\r\n\t\tfloat elapsed;\r\n\t\tfloat accumulated = 0f;\r\n\t\tfloat interval = 1f / TARGET_UPS;\r\n\t\tdouble time;\r\n\t\tdouble lastCall = System.nanoTime();\r\n\t\t\r\n\t\trunning = true;\r\n\t\t//loop while running and the window hasn't received a close command\r\n\t\twhile (running) {\r\n\t\t\ttime = System.nanoTime();\r\n\t\t\t\r\n\t\t\telapsed = (float) ((time-lastCall) / 1e9);\r\n\t\t\tlastCall = time;\r\n\t\t\t\r\n\t\t\taccumulated += elapsed;\r\n\t\t\t\r\n\t\t\twhile (accumulated >= interval) {\r\n\t\t\t\tupdate();\r\n\t\t\t\taccumulated -= interval;\r\n\t\t\t}\r\n\t\t\t//render once per loop, then wait until the render time slot is over before restarting\r\n\t\t\tgame.render();\r\n\t\t\tsync(lastCall/1e9);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"private void fps(Graphics2D g2d) {\n\n long currentRender = System.currentTimeMillis();\n if (lastRender > 0) {\n fpsHistory.add(1000.0f / (currentRender - lastRender));\n if (fpsHistory.size() > 100) {\n fpsHistory.remove(0); // remove oldest\n }\n float avg = 0.0f;\n for (float fps : fpsHistory) {\n avg += fps;\n }\n avg /= fpsHistory.size();\n String str = String.format(\"Average FPS = %.1f , Last Interval = %d ms\",\n avg, (currentRender - lastRender));\n g2d.setColor(Color.CYAN);\n g2d.setFont(g2d.getFont().deriveFont(18.0f));\n int strWidth = g2d.getFontMetrics().stringWidth(str);\n int strHeight = g2d.getFontMetrics().getHeight();\n g2d.drawString(str, (GAME_WIDTH - strWidth) / 2, strHeight + 50);\n }\n lastRender = currentRender;\n\n numOfBulletObject.paintCannonBullet(g2d);\n numOfBulletObject.paintMachineGunBullet(g2d);\n numOfBulletObject.paintHealth(g2d);\n numOfBulletObject.paintLife(g2d);\n }",
"public void render(int gameSpeed){\n counterFrames++;\n if (counterFrames*gameSpeed*1000 >= (60 * (delay))){\n setDone();\n }\n }",
"public void run() {\n\t\tinitialise();\n\t\tlong beforeTime, afterTime, deltaTime = 0;\n\t\tlong counter = System.nanoTime() + 1000000000;\n\t\tint maxFPS = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes()[0]\n\t\t\t\t.getRefreshRate();\n\t\tif (maxFPS == 0) {\n\t\t\tmaxFPS = 60;\n\t\t}\n\t\tint fps = 0;\n\t\tlong minFrameTime = 1000000000l / maxFPS;\n\t\tdeltaTime = 1;\n\t\tupdate(0);\n\t\twhile (running) {\n\t\t\tbeforeTime = System.nanoTime();\n\t\t\tdraw();\n\t\t\tupdate(deltaTime / 1000000000f);\n\t\t\tafterTime = System.nanoTime();\n\t\t\tdeltaTime = afterTime - beforeTime;\n\t\t\tfps++;\n\t\t\tif (deltaTime < minFrameTime) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep((minFrameTime - deltaTime) / 1000000l);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (System.nanoTime() > counter) {\n\t\t\t\tcounter += 1000000000;\n\t\t\t\tSystem.out.println(fps);\n\t\t\t\tfps = 0;\n\t\t\t}\n\t\t}\n\t\tclose();\n\t}",
"public void tick() {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n\n if(elapsed>delay) {\n currentFrame++;\n startTime = System.nanoTime();\n }\n if(currentFrame == images.length){\n currentFrame = 0;\n }\n }",
"private void updateTime(){\n currentTime = System.currentTimeMillis();\n float tp = previousTime;\n previousTime = (float)(currentTime - startingTime);\n dt = previousTime - tp;\n fps = 1000f/dt;\n }",
"@Override\n public void startGame() {\n timer.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n update();\n }\n }, 0, 2);\n }",
"public void run() {\n // Used to keep track of time used to draw and update the game\n // This is used to limit the framerate later on\n long startTime;\n long deltaTime;\n\n preSetup();\n\n // the main game loop section\n // game will end if you set done = false;\n boolean done = false;\n while (!done) {\n // determines when we started so we can keep a framerate\n startTime = System.currentTimeMillis();\n\n // all your game rules and move is done in here\n // GAME LOGIC STARTS HERE\n \n // PLAYER 1 CONTROLS\n if(right1){\n maxDX = 3;\n }else if(left1){\n maxDX = -3;\n }else{\n maxDX = 0;\n }\n \n if(up1){\n maxDY = 3;\n }else if(down1){\n maxDY = -3;\n }else{\n maxDY = 0;\n }\n \n // PLAYER 2 CONTROLS\n if(right2){\n tobyDX = 3;\n }else if(left2){\n tobyDX = -3;\n }else{\n tobyDX = 0;\n }\n \n if(up2){\n tobyDY = 3;\n }else if(down2){\n tobyDY = -3;\n }else{\n tobyDY = 0;\n }\n \n \n \n // jump\n //if(onGround && jump){\n // do something about jumping\n // big negative to start moving\n // playerDY = -15;\n // not on ground anymore \n // onGround = false;\n // }\n \n // apply gravity\n //playerDY = playerDY + gravity;\n \n // update the player 1\n max.x = max.x + maxDX;\n max.y = max.y + maxDY;\n \n // update the player 2\n toby.x = toby.x + tobyDX;\n toby.y = toby.y + tobyDY;\n \n // assume not standing on anything\n //onGround = false;\n // check for collisions\n // go through every block and check with loop\n \n // Player 1 Collision\n for(int i = 0; i < blocks.length; i++){\n //did the player hit a block?\n if(max.intersects(blocks[i])){\n int cHeight = Math.min(blocks[i].y + blocks[i].height, max.y + max.height) - Math.max(blocks[i].y, max.y);\n int cWidth = Math.min(blocks[i].x + blocks[i].width, max.x + max.width) - Math.max(blocks[i].x, max.x);\n \n // determine the smaller one to find\n if(cWidth < cHeight){\n // fix the width\n // player on left side\n if(max.x < blocks[i].x){\n max.x = max.x - cWidth;\n }else{\n max.x = max.x + cWidth;\n }\n // stop the player moving sideways\n maxDX = 0;\n }else{\n // above the block\n if(max.y < blocks[i].y){\n max.y = max.y - cHeight;\n \n // moving up or down?\n if(maxDY >= 0){\n // stop the down motion\n maxDY = 0;\n // standing on ground\n //onGround = true;\n }\n \n }else{\n // below the block\n max.y = max.y + cHeight;\n }\n }\n }\n }\n \n // Player 1 flag collision\n for(int i = 0; i < flag.length; i++){\n //did the player hit a block?\n if(max.intersects(flag[i])){\n maxScore++;\n flag[0] = new Rectangle((int)(Math.random()*((WIDTH - 40) - 40 + 1)) + 40, (int)(Math.random()*((HEIGHT - 40) - 40 + 1)) + 40, 35, 26);\n flagPole[0] = new Rectangle(flag[0].x, flag[0].y, 4, 45);\n flagLogo[0] = new Rectangle(flag[0].x + 15, flag[0].y + (13/2), 20, 15);\n }\n }\n \n \n // Player 2 collison\n for(int i = 0; i < blocks.length; i++){\n //did the player hit a block?\n if(toby.intersects(blocks[i])){\n int cHeight = Math.min(blocks[i].y + blocks[i].height, toby.y + toby.height) - Math.max(blocks[i].y, toby.y);\n int cWidth = Math.min(blocks[i].x + blocks[i].width, toby.x + toby.width) - Math.max(blocks[i].x, toby.x);\n \n // determine the smaller one to find\n if(cWidth < cHeight){\n // fix the width\n // player on left side\n if(toby.x < blocks[i].x){\n toby.x = toby.x - cWidth;\n }else{\n toby.x = toby.x + cWidth;\n }\n // stop the player moving sideways\n tobyDX = 0;\n }else{\n // above the block\n if(toby.y < blocks[i].y){\n toby.y = toby.y - cHeight;\n \n // moving up or down?\n if(tobyDY >= 0){\n // stop the down motion\n tobyDY = 0;\n // standing on ground\n //onGround = true;\n }\n \n }else{\n // below the block\n toby.y = toby.y + cHeight;\n }\n }\n }\n }\n \n // Player 2 flag collision\n for(int i = 0; i < flag.length; i++){\n //did the player hit a block?\n if(toby.intersects(flag[i])){\n tobyScore++;\n flag[0] = new Rectangle((int)(Math.random()*((WIDTH - 40) - 40 + 1)) + 40, (int)(Math.random()*((HEIGHT - 40) - 40 + 1)) + 40, 35, 26);\n flagPole[0] = new Rectangle(flag[0].x, flag[0].y, 4, 45);\n flagLogo[0] = new Rectangle(flag[0].x + 15, flag[0].y + (13/2), 20, 15);\n }\n }\n \n if(maxScore == 20){\n done = true;\n maxWin = true;\n }\n if(tobyScore == 20 ){\n done = true;\n tobyWin = true;\n }\n \n // GAME LOGIC ENDS HERE \n // update the drawing (calls paintComponent)\n repaint();\n\n // SLOWS DOWN THE GAME BASED ON THE FRAMERATE ABOVE\n // USING SOME SIMPLE MATH\n deltaTime = System.currentTimeMillis() - startTime;\n try {\n if (deltaTime > desiredTime) {\n //took too much time, don't wait\n Thread.sleep(1);\n } else {\n // sleep to make up the extra time\n Thread.sleep(desiredTime - deltaTime);\n }\n } catch (Exception e) {\n };\n }\n }",
"@Override\n\tpublic void render () \n\t{\t\t\n\t\t\n\t\tfloat deltaTime = Gdx.graphics.getDeltaTime();\n\t\t\n\t\t\n\t\t// TODO make a world component and consider design implications\n \n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);\n\t\tfor(Entity operableEntity : mamaDukes)\n\t\t{\n\t\t\toperableEntity.Update(deltaTime);\n\t\t}\n\t\t \n\t\tIntrigueGraphicSys.flush();\n\t\t\n\t\tstage.act(deltaTime);\n\t\ttext.setText(\"FPS: \" + Gdx.graphics.getFramesPerSecond());\n\t\tstage.draw();\n\t}",
"private void gameLoop() {\n float elapsedTime;\n float accumulator = 0f;\n float interval = 1.0f/TARGET_UPS;\n\n while(!window.shouldClose()) {\n elapsedTime = Math.min(0.25f, updateTimer.getElapsedTimeAndUpdate());\n accumulator += elapsedTime;\n\n //Get any input\n\n //Calculate updates in the scene\n while(accumulator >= interval) {\n update();\n accumulator -= interval;\n }\n\n interpolationFactor = accumulator/interval;\n render();\n\n if (!window.optionIsTurnedOn(Window.Options.ENABLE_VSYNC)) {\n sync();\n }\n }\n }",
"public void tick()\n\t{\n\t\tgameTime++;\n\t\tif(gameTime == 1)\n\t\t\taddPlayerShip();\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif (current instanceof Imovable)\n\t\t\t\t((MovableObject)current).move(fps);\n\t\t\tif (current instanceof SpaceStation)\n\t\t\t\t((SpaceStation)current).checkBlink(gameTime);\n\t\t\tif(current instanceof Missile)\n\t\t\t\tif(((Missile) current).getFuel() <= 0)\n\t\t\t\t\titer.remove();\n\t\t}\n\t\t\n\t\t//Identify collision\n\t\titer = gameObj.getIterator();\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tICollider curObj = (ICollider)iter.getNext();\n\t\t\t\n\t\t\tIIterator iter2 = gameObj.getIterator();\n\t\t\twhile(iter2.hasNext())\n\t\t\t{\n\t\t\t\tICollider otherObj = (ICollider)iter2.getNext();\n\t\t\t\tif(otherObj != curObj)\n\t\t\t\t\tif(curObj.collidesWith(otherObj))\n\t\t\t\t\t\tif (curObj instanceof PlayerShip)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcollisionVectorPS.add(curObj);\n\t\t\t\t\t\t\tcollisionVectorPS.add(otherObj);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(curObj instanceof NonPlayerShip)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcollisionVectorNPS.add(curObj);\n\t\t\t\t\t\t\tcollisionVectorNPS.add(otherObj);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(curObj instanceof Asteroid)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(collisionVectorAsteroid.isEmpty())\n\t\t\t\t\t\t\t\tcollisionVectorAsteroid.add(curObj);\n\t\t\t\t\t\t\tcollisionVectorAsteroid.add(otherObj);\t\t\t\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Handle Collisions for playership\n\t\tif(!collisionVectorPS.isEmpty())\n\t\t{\n\t\t\t//return iterator for collion vector\n\t\t\tIterator<ICollider> psIterator = collisionVectorPS.iterator();\n\t\t\tICollider ship = collisionVectorPS.elementAt(0);\n\t\t\twhile(psIterator.hasNext())\n\t\t\t{\n\t\t\t\tICollider curObj = psIterator.next();\n\t\t\t\tif(curObj != ship)\n\t\t\t\t\tship.handleCollision(curObj);\n\t\t\t\t\n\t\t\t\t//if an asteroid is detected\n\t\t\t\tif(curObj instanceof Asteroid)\n\t\t\t\t\tcrashAsteroidPS(psIterator,curObj,ship);\n\t\t\t\t\n\t\t\t\t//if an enemy missile is detected\n\t\t\t\telse if(curObj instanceof Missile && ((Missile)curObj).isEnemy())\n\t\t\t\t\tPSShot(psIterator,curObj,ship);\n\t\t\t\t\n\t\t\t\t//if a non player ship is detected\n\t\t\t\telse if(curObj instanceof NonPlayerShip)\n\t\t\t\t\tthis.crashNPS(psIterator,curObj,ship);\n\t\t\t\t\n\t\t\t\telse if(curObj instanceof SpaceStation)\n\t\t\t\t\tthis.refillMissiles(psIterator,curObj,ship);\n\t\t\t}\n\t\t\t//clear the collision vector and spawn a new ship\n\t\t\tcollisionVectorPS.clear();\n\t\t\t\n\t\t}\n\t\tif(!collisionVectorNPS.isEmpty())\n\t\t{\n\t\t\t//return iterator for collion vector\n\t\t\tIterator<ICollider> npsIterator = collisionVectorNPS.iterator();\n\t\t\tICollider nps = collisionVectorNPS.elementAt(0);\n\t\t\twhile(npsIterator.hasNext())\n\t\t\t{\n\t\t\t\tICollider curObj = npsIterator.next();\n\t\t\t\tif(curObj != nps)\n\t\t\t\t\tnps.handleCollision(curObj);\n\t\t\t\tif(curObj instanceof Missile && !((Missile)curObj).isEnemy())\n\t\t\t\t\tthis.NPSShot(npsIterator,curObj,nps);\n\t\t\t\telse if(curObj instanceof Asteroid)\n\t\t\t\t\tthis.crashAsteroidNPS(npsIterator,curObj,nps);\n\t\t\t\telse if(curObj instanceof SpaceStation)\n\t\t\t\t\tthis.refillMissiles(npsIterator,curObj,nps);\n\t\t\t}\n\t\t\tcollisionVectorNPS.clear();\n\t\t}\n\t\tif(!collisionVectorAsteroid.isEmpty())\n\t\t{\n\t\t\tIterator<ICollider> astIterator = collisionVectorAsteroid.iterator();\n\t\t\tICollider ast = collisionVectorAsteroid.elementAt(0);\n\t\t\twhile(astIterator.hasNext())\n\t\t\t{\n\t\t\t\tICollider curObj = astIterator.next();\n\t\t\t\tif(curObj != ast)\n\t\t\t\t\tast.handleCollision(curObj);\n\t\t\t\tif(curObj instanceof Missile && !((Missile)curObj).isEnemy())\n\t\t\t\t\tthis.asteroidShot(astIterator,curObj,ast);\n\t\t\t\telse if(curObj instanceof Asteroid && curObj != ast)\n\t\t\t\t\tthis.asteroidCol(astIterator,curObj,ast);\n\t\t\t}\n\t\t\tcollisionVectorAsteroid.clear();\n\t\t}\n\t\t//delete collided objects\n\t\tIterator<ICollider> trashIterator = trash.iterator();\n\t\twhile (trashIterator.hasNext())\n\t\t{\n\t\t\tICollider curObj = trashIterator.next();\n\t\t\tremove(curObj);\n\t\t}\n\t\tnotifyObservers();\n\t}",
"public abstract void update(GameContainer gc, float dt);",
"@Override\n\tpublic void tick() {\n\t\tif(levelOver) {\n\t\t\tif(this.getY()+this.getHeight() > flag.getY() + flag.getBounds().getHeight() - 60) {\n\t\t\t\tthis.setVelY(0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ty += velY;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(y > Window.HEIGHT + 2000) {\n\t\t\tif(!played) {\n\t\t\t\tAudioHandler.getMusic(\"theme\").pause();\n\t\t\t\tAudioHandler.getSound(\"died\").play();\n\t\t\t\tplayed = true;\n\t\t\t}\n\t\t\tDrawingCanvas.gameState = GameState.End;\n\t\t\treturn;\n\t\t}\n\n\t\tif(!died) {\n\t\t\t\n\t\t\tif(velX > 0 || KeyBoard.cameraVelX < 0) {\n\t\t\t\tcountRight += 0.5;\n\t\t\t\tif(countRight >= 6) countRight = 0;\n\t\t\t\tfacingRight = true;\n\t\t\t\tfacingLeft = false;\n\t\t\t} else if(velX < 0 || KeyBoard.cameraVelX > 0) {\n\t\t\t\tcountLeft += 0.5;\n\t\t\t\tif(countLeft >= 6) countLeft = 0;\n\t\t\t\tfacingRight = false;\n\t\t\t\tfacingLeft = true;\n\t\t\t} \n\t\t\t\n\t\t//\tSystem.out.println(\"dPressed: \"+KeyBoard.dPressed+\" aPressed: \"+KeyBoard.aPressed);\n\t\t\t\n\t\t\t\n\t\t\tx += velX;\n\t\t\ty += velY;\n\t\t\t\n\t\t\t/*if(!collideCheck()) {\n\t\t\t\tvelY -= accY;\n\t\t\t\t\n\t\t\t}*/\n\t\t\t\n\t\t\tvelY+=accY;\n\t\t\tcollideCheck();\n\t\t\t\n\t\t\t//if(jumping) velY += accY;\n\t//\t\tif(velX > 0) velX += accX;\n\t//\t\telse if(velX < 0) velX -= accX;\n\t\t\t\n\t\t\tvelY = Window.clamp(80, -30, velY);\n\t\t} else if(died) {\n\t\t\ty += velY;\n\t\t\tvelY += accY;\n\t\t}\n\t\t\n\t}",
"public void tick() {\n\t\tmFrameCount++;\n\t\t\n\t\tif (mStopwatch.getElapsedTime() > 1000) {\n\t\t\tmFramesPerSecond = mFrameCount;\n\t\t\tmFrameCount = 0;\n\t\t\t\n\t\t\tmStopwatch.restart();\n\t\t}\n\t}",
"public void initFPS() {\n FPS = 60;\n targetTime = 1000 / FPS;\n\n gameClock = new NanoClock();\n }",
"private void doGameCycle() {\n update();\n repaint();\n }",
"public void run()\r\n {\n long lastTime = System.nanoTime();\r\n long timer = System.currentTimeMillis();\r\n // create quotient\r\n final double ns = 1000000000.0 / 60.0;\r\n // difference between start time and current time\r\n double delta = 0;\r\n // counter for frames per second\r\n int frames = 0;\r\n // counter for updates per second\r\n int updates = 0;\r\n\r\n while (running)\r\n {\r\n long now = System.nanoTime();\r\n // add up the times of every loop run and get the value in seconds /\r\n // 60 (basically increase by 1/60th of a second every loop)\r\n delta += (now - lastTime) / ns;\r\n lastTime = now;\r\n // gets called 60 times per second because of delta calculation\r\n while (delta >= 1)\r\n {\r\n update();\r\n updates++;\r\n delta--;\r\n }\r\n\r\n view.render();\r\n frames++;\r\n\r\n // gets called every second\r\n if (System.currentTimeMillis() - timer > 1000)\r\n {\r\n // \"reset\" timer variable\r\n timer += 1000;\r\n System.out.println(updates + \" ups, \" + frames + \" fps\");\r\n view.setTitle(\"| \" + updates + \" ups, \" + frames + \" fps\" + \" |\");\r\n // reset frames and updates variables to start counting from 0\r\n // at the start of every second\r\n frames = 0;\r\n updates = 0;\r\n }\r\n }\r\n }",
"@Override\n protected void update(Engine engine) {\n\t\trs = (GL4RenderSystem) engine.getRenderSystem();\n\t\t\n\t\telapsTime += engine.getElapsedTimeMillis();\n\t\telapsTimeSec = Math.round(elapsTime/1000.0f);\n\t\telapsTimeStr = Integer.toString(elapsTimeSec);\n\t\t\n\t\t//player.update(elapsTimeSec);\n\t\tSceneNode dragon = engine.getSceneManager().getSceneNode(\"dragonNPCNode\");\n\t\t\n\t\tdIter++;\n\t\t//if(dIter == 200)\n\t\t//{\n\t\t\t//dir = dir*-1;\n\t\t\t//dIter = 0;\n\t\t//}\n\t\tif(dIter <= 200)\n\t\tdragon.moveBackward(dir);\n\t\t\n\t\tif(dIter > 200 && dIter <= 400 )\n\t\t\tdragon.moveLeft(dir);\n\t\t\n\t\tif(dIter > 400 && dIter <= 600 )\n\t\t\tdragon.moveForward(dir);\n\t\t\n\t\tif(dIter > 600 && dIter <= 800 )\n\t\t\tdragon.moveRight(dir);\n\t\t\n\t\tif(dIter == 800 )\n\t\t\tdIter = 0;\n\t\t//SkeletalEntity dragonSE =\n\t\t\t\t//(SkeletalEntity) engine.getSceneManager().getEntity(\"dragonSkeleton\");\n\t\t//dragonSE.update();\n\t\t\n\t\tfloat time = engine.getElapsedTimeMillis();\n\t\t\n\t\tfloat playerFloat[] = player.getNode().getLocalTransform().toFloatArray();\n\t\t//playerFloat[7] = player.getNode().getLocalPosition().y();\n\t\tdouble playerMat[] = toDoubleArray(playerFloat);\n\t\tMatrix4 mat3;\n\t\tmat3 = Matrix4f.createFrom(toFloatArray(player.getNode().getPhysicsObject().getTransform()));\n\t\t//player.getNode().setLocalPosition(playerFloat[3],mat3.value(1,3), playerFloat[11]);\n\t\t//double playerMat[] = toDoubleArray(player.getNode().getLocalTransform().toFloatArray());\n\t\tplayerFloat = player.getNode().getLocalTransform().toFloatArray();\n\t\t//playerFloat[7] = player.getNode().getLocalPosition().y();\n\t\tplayerFloat[7] = mat3.value(1,3);//set y coordinate to physics world\n\t\tplayerMat = toDoubleArray(playerFloat);\n\t\tSystem.out.println(\"player.getNode().getLocalTransform(): \" + player.getNode().getLocalTransform());\n\t player.getNode().getPhysicsObject().setTransform(playerMat);\n\t \n\t player.update(elapsTimeSec);\n\t SkeletalEntity manSE =\n \t\t(SkeletalEntity) engine.getSceneManager().getEntity(\"knightSkeleton\");\n \t\tmanSE.update();\n\n\t \n\t\tif (running)\n\t\t{ \n\t\t\tMatrix4 mat;\n\t\t\tphysicsEng.update(time);\n\t\t\tfor (SceneNode s : engine.getSceneManager().getSceneNodes())\n\t\t\t{ \n\t\t\t\t//if (s.getPhysicsObject() != null && s.getName() != player.getNode().getName())\n\t\t\t\t//if (s.getPhysicsObject() != null /*&& s.getName() != player.getNode().getName()*/)\n\t\t\t\t{ \n\t\t\t\t\tmat = Matrix4f.createFrom(toFloatArray(s.getPhysicsObject().getTransform()));\n\t\t\t\t\ts.setLocalPosition(mat.value(0,3),mat.value(1,3), mat.value(2,3));\n\t\t\t\t} \n\t\t\t} \n\t\t}\n\n\t\tdispStr=\"Time = \" + elapsTimeStr + \" Score: \"+player.getScore();\n\t\trs.setHUD(dispStr, 15, 15);\n\t\tif(player.isBoostActive()) dispStr+=\" Boost Active!\";\n\t\tim.update(elapsTime);\n\t\tprocessNetworking(elapsTime);\n\t\t\n\t\tcheckForCollisions();\n\t\t//player.update(elapsTimeSec);\n\t\tSystem.out.println(\"ball transform: \" + ball2Node.getLocalTransform() );\n\t\tSystem.out.println(\"ball physycs object transform: \" + ball2Node.getPhysicsObject().getTransform()[0] + ',' \n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[1] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[2] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[3] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[4] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[5] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[6] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[7] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[8] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[9] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[10] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[11] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[12] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[13] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[14] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[15] + ',');\n\t\tSystem.out.println(\"ball linear velocity: \" + ball2Node.getPhysicsObject().getLinearVelocity());\n\t\tif(distanceTo(player.getNode().getLocalPosition(),ball2Node.getLocalPosition()) <= 4)\n\t\t{\n\t\t\tball2Node.setLocalPosition(0,10,0);\n\t\t\tfloat velocityArray[] = { 0, 5, 0};\n\t\t\tball2Node.getPhysicsObject().setLinearVelocity(velocityArray);\n\t\t\tfloat floTemp[] = ball2Node.getLocalTransform().toFloatArray();\n\t\t\tdouble dubTemp[] = {(double)floTemp[0], (double)floTemp[1], (double)floTemp[2], (double)floTemp[3], (double)floTemp[4],\n\t\t\t\t\t(double)floTemp[5],(double)floTemp[6],(double)floTemp[7], (double)floTemp[8], (double)floTemp[9], (double)floTemp[10], (double)floTemp[11]\n\t\t\t\t\t\t\t, (double)floTemp[12], (double)floTemp[13], (double)floTemp[14], (double)floTemp[15] };\n\t\t\t\n\t\t\tdouble dubTemp2[] = toDoubleArray(floTemp);\n\n\n\t\t\t Matrix4 mat2;\n\t\t\tball2Node.getPhysicsObject().setTransform(dubTemp2);\n\t\t\t\n\t\t\t//mat2 = Matrix4f.createFrom(toDoubleArray( ball2Node.getLocalTransform().toFloatArray()))\n\t\t\t//ball2Node.getPhysicsObject().setTransform(dubTemp2);\n\t\t\t//ball2Node.setPhysicsObject(ball2PhysObj);\n\t\t\t//ball2Node.getPhysicsObject().getTransform().\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t//player.playWalkAnimation();\n\t\t\n\t\t\n\t\t\n\t\t/*ball2Node.getPhysicsObject().setTransform(ball2Node.getLocalTransform());\n\t\t//ball2PhysObj.set\n\t\tphysicsEng.\n\t\ttemptf = toDoubleArray(ball1Node.getLocalTransform().toFloatArray());\n \tball1PhysObj = physicsEng.addSphereObject(physicsEng.nextUID(),\n \tmass, temptf, 2.0f);\n \tball1PhysObj.setBounciness(1.0f);\n \tball1Node.setPhysicsObject(ball1PhysObj);*/\n\t\t\n\t\t/* check if player jumped*/\n\t\t\n\t}",
"@Override\n public void run() {\n try {\n this.init();\n } catch (IOException e) {\n e.printStackTrace();\n }\n int fps = Const.FPS;\n double ticksPerFrame = 1_000_000_000 / fps;\n double delta = 0;\n long now;\n long lastTimeTicked = System.nanoTime();\n\n\n while (isRunning) {\n now = System.nanoTime();\n delta += (now - lastTimeTicked) / ticksPerFrame;\n lastTimeTicked = now;\n if (delta > 0) {\n tick();\n try {\n render();\n } catch (IOException e) {\n e.printStackTrace();\n }\n delta--;\n\n }\n }\n //Calls the stop method to stop everything\n this.stop();\n }",
"public void update(long fps) {\n rect.left = rect.left + ((float)xVelocity / fps);\n rect.top = rect.top + ((float)yVelocity / fps);\n rect.right = rect.left + width;\n rect.bottom = rect.top + height;\n }",
"public void run()\n {\n // Used to keep track of time used to draw and update the game\n // This is used to limit the framerate later on\n long startTime;\n long deltaTime;\n \n // set up the pipes\n int pipeX = 600;\n Random randGen = new Random();\n for(int i = 0; i < topPipes.length; i++){\n // generating a random y position\n int pipeY = randGen.nextInt(HEIGHT - 2*minDistance) + minDistance;\n bottomPipes[i] = new Rectangle(pipeX, pipeY, pipeWidth, pipeHeight);\n topPipes[i] = new Rectangle(pipeX, pipeY - pipeGap - pipeHeight, pipeWidth, pipeHeight);\n // move the pipeX value over\n pipeX = pipeX + pipeWidth + pipeSpacing;\n }\n \n \n \n \n // the main game loop section\n // game will end if you set done = false;\n boolean done = false; \n while(!done)\n {\n // determines when we started so we can keep a framerate\n startTime = System.currentTimeMillis();\n \n // all your game rules and move is done in here\n // GAME LOGIC STARTS HERE \n \n // get the pipes moving\n if (start){\n if (!dead){\n \n \n for(int i = 0; i < topPipes.length; i++){\n topPipes[i].x = topPipes[i].x - speed;\n bottomPipes[i].x = bottomPipes[i].x - speed;\n // check if a pipe is off the screen\n if(topPipes[i].x + pipeWidth < 0){\n // move the pipe\n setPipe(i);\n }\n }\n }\n // get the bird to fall\n // apply gravity\n dy = dy + gravity;\n // apply the change in y to the bird\n if(jump && !lastjump){\n dy = jumpVelocity;\n }\n lastjump = jump;\n bird.y = bird.y + dy;\n if (bird.y<0||bird.y+bird.height > HEIGHT){\n done =true;\n }\n for (int i = 0; i <topPipes.length;i++){\n if(bird.intersects(topPipes[i])){\n done = true;\n }else if (bird.intersects(bottomPipes[i])){\n done =true;\n }\n }\n }\n // GAME LOGIC ENDS HERE \n \n // update the drawing (calls paintComponent)\n repaint();\n \n \n \n // SLOWS DOWN THE GAME BASED ON THE FRAMERATE ABOVE\n // USING SOME SIMPLE MATH\n deltaTime = System.currentTimeMillis() - startTime;\n try\n {\n if(deltaTime > desiredTime)\n {\n //took too much time, don't wait\n Thread.sleep(1);\n }else{\n // sleep to make up the extra time\n Thread.sleep(desiredTime - deltaTime);\n }\n }catch(Exception e){};\n }\n }",
"void tick();",
"void tick();",
"@Override\n\tpublic void run()\n\t{\n\t\t\n\t\tCanvas canvas;\n\t\t\t\t\n\t\t//The gameloop\n\t\twhile(_running)\n\t\t{\n\t\t\t\n\t\t\tlong startTime = System.currentTimeMillis();\n\n\t\t\t_playField.update();\n\t\t\t\n\t\t\tcanvas = _playField.getHolder().lockCanvas();\n\t\t\t\n\t\t\t_playField.draw(canvas);\n\t\t\t\n\t\t\t_playField.getHolder().unlockCanvasAndPost(canvas);\n\t\t\t\n\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\tint gameLoopTime = (int)(endTime - startTime);\n\t\t\t\n\t\t\tif(gameLoopTime < _desiredFramerateTime)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong sleepTime = _desiredFramerateTime - gameLoopTime;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsleep(sleepTime); //Wait till this frame took 1/30 of a second\n\t\t\t\t}\n\t\t\t\tcatch(Exception e)\n\t\t\t\t{\n\t\t\t\t\tLog.d(GameThread.class.getSimpleName(), e.toString());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t}",
"public void update(){\n if(player.getPlaying()) {\n // update player animation.\n player.update();\n // update background animation.\n bg.update();\n // checks if skater has finished falling animation to end the game.\n if (player.animate instanceof FallAnimate && player.animate.getDone()) {\n player.setPlaying(false);\n player.setFall(false);\n System.out.println(\"End \" + player.getPlaying());\n }\n // checks if player has reached required points.\n if(player.getScore() > TARGETSCORE){\n player.setPlaying(false);\n levelCompleted = true;\n levelReset = System.nanoTime();\n }\n // increment jumpcounter while crouched.\n if (player.animate instanceof CrouchingAnimate && (jumpCounter <= 25)) {\n jumpCounter++;\n }\n // Creating Bananas:\n long bananaElapsed = (System.nanoTime() - bananaStartTime) / 1000000;\n if(bananaElapsed > 10500 && MainActivity.difficulty != 0){\n bananas.add(new Banana(BitmapFactory.decodeResource(getResources(),\n R.drawable.bigbanana), WIDTH + 10, (int) (HEIGHT * 0.85), 40, 40, 1));\n bananaStartTime = System.nanoTime();\n }\n //collision detection:\n for (int i = 0; i < bananas.size(); i++) {\n bananas.get(i).update();\n if (collision(bananas.get(i), player)) {\n bananas.remove(i);\n player.setFall(true);\n player.setPlaying(false);\n break;\n }\n // removing bananas when off screen\n if (bananas.get(i).getX() < -100) {\n bananas.remove(i);\n break;\n }\n }\n // Creating Cones:\n long coneElapsed = (System.nanoTime() - coneStartTime) / 1000000;\n if (coneElapsed > 5000) {\n cones.add(new TallBricks(BitmapFactory.decodeResource(getResources(),\n R.drawable.tallbricks), WIDTH + 10, (int) (HEIGHT * 0.59), 100, 161, 1));\n coneStartTime = System.nanoTime();\n }\n // update and check collisions.\n for (int i = 0; i < cones.size(); i++) {\n\n cones.get(i).update();\n if (collision(cones.get(i), player) && MainActivity.difficulty == 0) {\n cones.remove(i);\n player.forceSetScore(-500);\n break;\n }\n\n if (collision(cones.get(i), player) && MainActivity.difficulty != 0) {\n cones.remove(i);\n player.setFall(true);\n break;\n }\n // removing cones when off screen\n if (cones.get(i).getX() < -100) {\n cones.remove(i);\n break;\n }\n\n if((cones.get(i).getX() < player.getX() -15) ){\n cones.remove(i);\n player.setPendingPoints(1000);\n break;\n }\n }\n }\n else if(player.getPlaying() == false && levelCompleted){\n long resetElapsed = (System.nanoTime()-levelReset)/1000000;\n if(resetElapsed > 4000) {\n Intent resultIntent = new Intent();\n resultIntent.putExtra(\"result\",true);\n ((Activity)context).setResult(Activity.RESULT_OK,resultIntent);\n ((Activity)context).finish();\n }\n }\n else if(player.getPlaying() == false && !levelCompleted){\n if(!reset){\n newGameCreated = false;\n startReset = System.nanoTime();\n reset = true;\n }\n\n long resetElapsed = (System.nanoTime()-startReset)/1000000;\n\n if(resetElapsed > 2500 && !newGameCreated){\n newGame();\n }\n else if(resetElapsed < 2500 && started){\n player.update();\n }\n }\n }",
"private void tick() {\n keyManager.tick();\n if (keyManager.pause == false) {\n if (gameOver) {\n\n // advancing player with colision\n player.tick();\n //if there's a shot.\n\n int alienBombIndex = (int) (Math.random() * aliens.size());\n for (int i = 0; i < aliens.size(); i++) {\n Alien alien = aliens.get(i);\n alien.tick();\n if (shotVisible && shot.intersectAlien(alien)) {\n Assets.hitSound.play();\n alien.setDying(true);\n alien.setDeadCounter(6);\n shotVisible = false;\n }\n \n if(alien.isDead()){\n aliens.remove(i);\n if (aliens.size() == 0) {\n gameOver = false;\n }\n }\n\n alien.act(direction);\n }\n\n //Controlar el movimiento de los aliens\n for (Alien alien : aliens) {\n int x = alien.getX();\n if (x >= getWidth() - 30 && direction != -1) {\n direction = -1;\n alien.setDirection(-1);\n Iterator i1 = aliens.iterator();\n while (i1.hasNext()) {\n Alien a2 = (Alien) i1.next();\n a2.setY(a2.getY() + 15);\n }\n }\n if (x <= 5 && direction != 1) {\n direction = 1;\n alien.setDirection(1);\n Iterator i2 = aliens.iterator();\n while (i2.hasNext()) {\n Alien a = (Alien) i2.next();\n a.setY(a.getY() + 15);\n }\n }\n }\n\n //Controlar el spawning de las bombas\n Random generator = new Random();\n for (Alien alien : aliens) {\n int num = generator.nextInt(15);\n Bomb b = alien.getBomb();\n\n if (num == CHANCE && b.isDestroyed()) {\n b.setDestroyed(false);\n b.setX(alien.getX());\n b.setY(alien.getY());\n }\n\n b.tick();\n if (b.intersecta(player)) {\n Assets.deathSound.play();\n player.die();\n gameOver = false;\n }\n\n }\n\n if (shotVisible) {\n shot.tick();\n }\n if (!player.isDead() && keyManager.spacebar) {\n shoot();\n Assets.shotSound.play();\n }\n for (int i = 0; i < aliens.size(); i++) {\n if (aliens.get(i).getY() > 500) {\n gameOver = false;\n }\n }\n\n }\n }\n /// Save game in file\n if (keyManager.save) {\n try {\n\n vec.add(player);\n vec.add(shot);\n if(keyManager.pause){\n vec.add(new String(\"Pause\")); \n } else if (!gameOver){\n vec.add(new String(\"Game Over\"));\n } else {\n vec.add(new String(\"Active\"));\n }\n for (Alien alien : aliens) {\n vec.add(alien);\n }\n //Graba el vector en el archivo.\n grabaArchivo();\n } catch (IOException e) {\n System.out.println(\"Error\");\n }\n }\n /// Load game\n if (keyManager.load == true) {\n try {\n //Graba el vector en el archivo.\n leeArchivo();\n } catch (IOException e) {\n System.out.println(\"Error en cargar\");\n }\n }\n\n }",
"public void update(float deltaTime) {\n if (creationPoint.y != (int)(GameView.instance.groundLevel - height*3/4) || creationPoint.x != x+width/2){\n creationPoint.x = x+width/2-width/4;\n creationPoint.y = (int)(GameView.instance.groundLevel - height/2)+height/8;\n }\n\n\n if(isStanding) {\n\n /*System.out.println(creationPoint.x);\n System.out.println(GameView.instance.player.position.x);\n System.out.println(GameView.instance.player.position.x-creationPoint.x);\n System.out.println(GameView.instance.cameraSize*attackRange);*/\n\n tax();\n\n\n //=======================================================================================//\n\n //Buildings\n\n //=======================================================================================//\n\n\n grow();\n\n\n // = ======== == ==\n // = = == == ==\n // ===== == ====\n // = = == == ===\n\n if (inRange() && !surrender) {\n countdown+=GameView.instance.fixedDeltaTime;\n //System.out.println(countdown);\n float shootSpeed=4-lv;\n if (countdown > 1000*shootSpeed) {\n\n if (countdown > 1200*shootSpeed && attack == 0) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1400*shootSpeed && attack == 1) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1600*shootSpeed && attack == 2) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown >= 1800*shootSpeed) {\n countdown = 0;\n attack = 0;\n }\n }\n }\n if ((Scene.instance.timeOfDay) / (Scene.instance.dayLength) > 0.6) {\n spawnedNPC = false;\n }\n if(!spawnedNPC) {\n //spawning thief\n if ((townFear > 20 && lv != 0 && (currentGold < maxGold / 2)) || (goldRate < 200 && lv != 0) && Scene.instance.day > 2) {\n GameView.instance.npc_pool.spawnThiefs(x, (int) GameView.instance.groundLevel, 1, this);\n }\n if(!surrender) {\n //spawning dragonslayer\n if (townFear > 30 && lv != 0) {\n GameView.instance.npc_pool.spawnDragonLayers(x, (int) GameView.instance.groundLevel, this);\n }\n\n //spawning wizard\n if (townFear > 35 && lv == 2 && !summonedWizard) {\n GameView.instance.npc_pool.spawnFarmers(x, (int) GameView.instance.groundLevel, this);\n summonedWizard = true;\n }\n }\n spawnedNPC = true;\n }\n\n if(!surrender) {\n if (townFear > surrenderFear) {\n surrender = true;\n flag.setSurrender(surrender);\n SoundEffects.instance.play(SoundEffects.TRIBUTE);\n }\n }\n else {\n if(townFear < surrenderFear/2) {\n surrender = false;\n flag.setSurrender(surrender);\n\n }\n }\n\n\n\n Flagposition(deltaTime);\n }\n else {\n buildingImage = SpriteManager.instance.getBuildingSprite(\"FortressRuin\");\n\n if(beenEmptied == false){\n GoldPool.instance.spawnGold(collider.centerX(), collider.centerY(),Math.min(currentGold,100*(lv+1)) );\n beenEmptied = true;\n }\n townFear = 0;\n }\n\n //==== ===== ===== = == ==== ============================\n //= = == = = = = == = = ============================\n //==== == ===== ===== == ==== ============================\n //= == ===== = = = == = == ============================\n repair(deltaTime);\n\n for(int i = 0; i < currentBuildingsLeft.size(); i++){\n currentBuildingsLeft.get(i).update(deltaTime);\n }\n\n for(int i = 0; i < currentBuildingsRight.size(); i++){\n currentBuildingsRight.get(i).update(deltaTime);\n }\n super.update(deltaTime);\n\n }",
"private void updatePhysics() {\n long now = System.currentTimeMillis();\n // Do nothing if mLastTime is in the future.\n // This allows the game-start to delay the start of the physics\n // by 100ms or whatever.\n if (mLastTime > now) return;\n int n = particles.length;\n tree.clear();\n for (int i = 0; i < n; i++) {\n tree.insert(particles[i]);\n }\n // Determine if there are any collisions\n // http://www.kirupa.com/developer/actionscript/multiple_collision2.htm\n for (int i = 0; i < n; i++) {\n \tparticles[i].update(now);\n \tparticles[i].disappearsFromEdge(canvasWidth, canvasHeight);\n\t\t\tSet<Particle> nearBy = tree.retrieve(particles[i]);\n\t\t\tfor (Particle particle : nearBy) {\n\t\t\t\tif (particle != particles[i])\n\t\t\t\t\tparticles[i].collidesWith(particle);\n\t\t\t}\n }\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 tick(){\n\t\ttimer += System.currentTimeMillis() - lastTime;\n\t\tif(timer > speed){\n\t\t\tcurrent = image.next();\n\t\t\ttimer = 0;\n\t\t}\n\t\tlastTime = System.currentTimeMillis();\n\t}",
"public void tick() {\n\r\n\t\tdouble angle = Math.atan2(getY()-y, getX()-x);\r\n\t\tif(seeking||Math.sqrt(((getX()-x)/1000)*((getX()-x)/1000)+((getY()-y)/1000)*((getY()-y)/1000))*1000>range[stage]){\r\n\r\n\t\t\tx += (int)(speed *Math.cos(angle));\r\n\t\t\ty += (int)(speed *Math.sin(angle));\t\t\r\n\t\t}else if(stage==0){\r\n\t\t\tstage=1;\r\n\t\t}\r\n\t\telse seeking = true;\r\n\t\tif(health<=0)\r\n\t\t{\r\n\t\t\tHandler.removeObject(this);\r\n\t\t\trage = rage + 1;\r\n\r\n\t\t}\r\n\t}",
"public void tick() {\n\n\t\tIterator<GameObject> sceneIterator = scene.values().iterator();\n\n\t\twhile (sceneIterator.hasNext()) {\n\t\t\tGameObject gameObject = sceneIterator.next();\n\t\t\tif (gameObject instanceof Movable)\n\t\t\t\t((Movable) gameObject).step();\n\t\t\t// Removing the bullets that are out of the scene\n\t\t\tif (gameObject instanceof Bullet && ((Bullet) gameObject).isOutOfBounds(20))\n\t\t\t\tscene.remove(gameObject.GAME_OBJECT_ID);\n\t\t}\n\t\t// Player\n\t\tfor (Player player : playerMap.values()) {\n\t\t\t// The events are generated within the player class on step and collision\n\t\t\tplayer.step();\n\t\t\tplayer.isHit(scene.values());\n\t\t}\n\t}",
"public void tick(){\n if(healthPoints <= 0){\n sprite.setVisible(false);\n }\n if(isInvulnerable){\n invulnTimer++;\n }\n if(invulnTimer >= invulnTicks){\n setInvulnerable(false);\n invulnTimer = 0;\n }\n //System.out.println(stuckCounter);\n //System.out.println(isStuck);\n\n if(isStuck){\n stuckCounter++;\n }\n else{\n stuckCounter = 0;\n }\n\n x += dx;\n\n y += dy;\n sprite.setY((int) y);\n sprite.setX((int) x);\n }",
"private void updateSimulation(double frameRate) {\n\n GraphicsContext g = canvas.getGraphicsContext2D();\n double w = canvas.getWidth();\n double h = canvas.getHeight();\n double x = w / 2;\n double y = h - 10;\n\n // Clear the canvas\n g.setGlobalAlpha(1.0);\n g.setGlobalBlendMode(BlendMode.SRC_OVER);\n g.setFill(Color.BLACK);\n g.fillRect(0, 0, w, h);\n\n // Generate new particles and them the collection to be drawn.\n particles.addAll(emitter.emit(x, y));\n\n // (Re)draw the particles.\n for (Iterator<Particle> it = particles.iterator(); it.hasNext();) {\n Particle p = it.next();\n\n // Update the particle's position, color and age.\n p.update(frameRate);\n\n // Remove expired particles.\n if (!p.isAlive()) {\n it.remove();\n continue;\n }\n // Draw\n p.render(g);\n }\n fpsLabel.setText(String.format(\"Current frame rate: %.3f\", frameRate));\n countLabel.setText(String.format(\"Particle count: %d\", particles.size()));\n\n }",
"public static void updateFPS() {\n if (getTime() - lastFPS > 1000) {\n Display.setTitle(\"FPS: \" + fps + \" \");\n fps = 0;\n lastFPS += 1000;\n }\n fps++;\n\n }",
"@Override\n \tpublic void update(double ticksPassed) {\n \t\tdouble dx = this.velocity.getX() * ticksPassed;\n \t\tdouble dy = this.velocity.getY() * ticksPassed;\n \t\t//check boundaries first\n \t\tif ((this.position.getX() + dx) < 0) { //off left\n \t\t\tdx = this.position.getX();\n \t\t\tthis.velocity.setX(0);\n \t\t}\n \t\telse if ((this.position.getX() + dx > App.WIDTH)) { //off right\n \t\t\tdx = (App.WIDTH - this.position.getX());\n \t\t\tthis.velocity.setX(0);\n \t\t}\n \t\tif ((this.position.getY() + dy) < 0) { //off top\n \t\t\tdy = this.position.getY();\n \t\t\tthis.velocity.setY(0);\n \t\t}\n \t\telse if ((this.position.getY() + dy) > App.HEIGHT) { //off bottom\n \t\t\tdy = (App.HEIGHT - this.position.getY());\n \t\t\tthis.velocity.setY(0);\n \t\t}\n \t\tthis.position.setX(this.position.getX() + dx);\n \t\tthis.position.setY(this.position.getY() + dy);\n \t\t//move the hitbox too\n \t\tthis.hitBox.move(dx, dy);\n \t\t//slow velocity due to drag\n \t\tdouble xDrag = this.drag * ticksPassed *\n \t\t\tMath.abs(this.direction.getX());\n \t\tdouble yDrag = this.drag * ticksPassed *\n \t\t\tMath.abs(this.direction.getY());\n \t\tdx = (this.velocity.getX() > 0) ?\n \t\t\t-Math.min(xDrag, this.velocity.getX()) :\n \t\t\tMath.min(xDrag, -this.velocity.getX());\n \t\tdy = (this.velocity.getY() > 0) ?\n \t\t\t-Math.min(yDrag, this.velocity.getY()) :\n \t\t\tMath.min(yDrag, -this.velocity.getY());\n \t\tthis.velocity.setX(this.velocity.getX() + dx);\n \t\tthis.velocity.setY(this.velocity.getY() + dy);\n \t\t//try to face the player\n \t\tDoubleVec2D toPlayer =\n \t\t\tthis.player.getPosition().subtract(this.position);\n \t\tDoubleVec2D toPlayerNorm = toPlayer.normalized();\n\t\t//perpdot = sin_theta, dot = cos_theta, negative y is up\n\t\tdouble angleBetween = -Math.atan2(toPlayerNorm.perpDot(this.direction),\n\t\t\t\ttoPlayerNorm.dot(this.direction));\n \t\tdouble rot = (angleBetween > 0) ? \n \t\t\t\tMath.min(this.maxRot, angleBetween) * ticksPassed:\n \t\t\t\tMath.max(-this.maxRot, angleBetween) * ticksPassed;\n \t\tdouble cosTheta = Math.cos(rot);\n \t\tdouble sinTheta = Math.sin(rot);\n \t\tdouble xPrime = (this.direction.getX() * cosTheta) - \n \t\t\t(this.direction.getY() * sinTheta);\n \t\tdouble yPrime = (this.direction.getX() * sinTheta) + \n \t\t\t(this.direction.getY() * cosTheta);\n \t\tthis.direction = new DoubleVec2D(xPrime, yPrime);\n \t\t//modify velocity for controls\n \t\t//TODO maybe modify for angle from player\n \t\tdx = this.direction.getX() * this.acceleration * ticksPassed;\n \t\tdy = this.direction.getY() * this.acceleration * ticksPassed;\n \t\tif (toPlayer.magnitude() > 1.0) {\n \t\t\tthis.velocity.setX(this.velocity.getX() + dx);\n \t\t\tthis.velocity.setY(this.velocity.getY() + dy);\n \t\t}\n \t\t//spawn bullet, considering cooldown\n \t\t//only shoot when facing the player and near the player\n \t\tthis.ticksSinceBullet += ticksPassed;\n \t\tif ((Math.abs(angleBetween) < this.maxAngleToFire) &&\n \t\t\t\t(Math.abs(toPlayer.magnitude()) < this.maxDistanceToFire) &&\n \t\t\t\t(this.ticksSinceBullet >= this.bulletCooldown)) {\n \t\t\tDoubleVec2D position = new DoubleVec2D(this.position.getX(),\n \t\t\t\t\tthis.position.getY());\n \t\t\tDoubleVec2D direction = new DoubleVec2D(this.direction.getX(),\n \t\t\t\t\tthis.direction.getY());\n \t\t\tthis.firedBullet = new Bullet(position, direction, false);\n \t\t\tthis.ticksSinceBullet = 0;\n \t\t}\n \t}",
"@Override\n\tpublic void run() {\n\t\tif (state != 3) {\n\t\t\tthis.requestFocus();\n\t\t\tlong lastTime = System.nanoTime();\n\t\t\tdouble amountOfTicks = 60.0;\n\t\t\tdouble ns = 1000000000 / amountOfTicks;\n\t\t\tdouble delta = 0;\n\t\t\tlong timer = System.currentTimeMillis();\n\t\t\tint frames = 0;\n\t\t\twhile (isRunning) {\n\n\t\t\t\tlong now = System.nanoTime();\n\n\t\t\t\tdelta += (now - lastTime) / ns;\n\t\t\t\tlastTime = now;\n\n\t\t\t\twhile (delta >= 1) {\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t\trender();\n\t\t\t\tframes++;\n\n\t\t\t\tif (System.currentTimeMillis() - timer > 1000) {\n\t\t\t\t\ttimer += 1000;\n\t\t\t\t\tframes = 0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tstop();\n\n\t\t}\n\n\t}",
"public void tick() {\r\n //2d array gameBoard is being copied to 2d array update\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n update[i] = gameBoard[i].clone();\r\n }\r\n\r\n //For the entire board, go through every tile\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n for (int j = 0; j < gameBoard[0].length; j++) {\r\n //Counting neighbours\r\n int count = 0;\r\n\r\n //For the current tile, go through all the neighbouring tiles\r\n for (int y = -1; y <= 1; y++) {\r\n for (int x = -1; x <= 1; x++) {\r\n if (x == 0 && y == 0) {\r\n } else {\r\n try {\r\n if (gameBoard[y + i][x + j] > 0) {\r\n count++;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Automation Rules (check)\r\n if (count < 2 || count >= 4) {\r\n update[i][j] = -1;\r\n } else if (count == 3) {\r\n update[i][j] = 1;\r\n }\r\n\r\n }\r\n }\r\n\r\n //Once board, neighbours, and automation are completed\r\n //2d array update is copied back to the original 2d array gameBoard\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n gameBoard[i] = update[i].clone();\r\n }\r\n }",
"private void physicsTickAlive() {\n\t\t// Physics stuff\n\t\tsetThrusts();\n\t\tmoveEverything(deltaTimeAlive);\n\t\tageScoreMarkers(deltaTimeAlive);\n\t\tshootBullets();\n\t\t\n\t\tcollideTankToWall();\n\t\tcollideTankToTank();\n\t\tcollideBulletToWall();\n\t\tcollideBulletToTank();\n\t}",
"public synchronized void start() {\n // For max accuracy, reset oldTime to really reflect how much\n // time will have passed since we wanted to start the updating\n oldTime = System.nanoTime();\n updateGameDataAtSlowRate();\n }",
"void tick() {\n\t\tif (playing) {\n\t\t\t// Advance the paddle and ball in their current direction.\n\t\t\tpaddle.move();\n\t\t\tball.move();\n\t\t\t\n\t\t\t//Ball intersects Paddle \n\t\t\tif (ball.intersects(paddle) != 0) {\n\t\t\t\tball.hitObj(paddle, ball.intersects(paddle));\n\t\t\t}\n\t\t\t//Ball intersects Brick. If Intersects then set Brick DNE accordingly \n\t\t\tbrickArray = bricks.getBricksArray();\n\t\t\tfor (int x = 0; x < Bricks.getColumns(); x++) {\n\t\t\t\tfor (int y = 0; y < Bricks.getRows(); y++) {\n\t\t\t\t\tbrick = brickArray[x][y];\n\t\t\t\t\tif (ball.intersects(brick) != 0 && brick.exists()) {\n\t\t\t\t\t\tball.hitObj(brick, ball.intersects(brick));\n\t\t\t\t\t\tbrick.setDNE();\n\t\t\t\t\t\t/*if (!brick.containsPowerUp()) {\n\t\t\t\t\t\t\tpowerUp = PowerUps.createPowerUp();\n\t\t\t\t\t\t\tpowerUp.move();\n\t\t\t\t\t\t}*/ // Setting up the framework for PowerUps \n\t\t\t\t\t\tcurrScoreVal++; // Incrementing Score by 1\n\t\t\t\t\t\tyourScore.setText(\"Your Score: \" + currScoreVal.toString());\n\t\t\t\t\t\tstatus.setText(\"Good job!\");\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tball.hitWall();\n\n\t\t\t\t// check for the round end/lose a life conditions\n\t\t\t\tif (livesLeft != 0) {\n\t\t\t\t\tif (ball.getPy() >= COURT_HEIGHT - 10) {\n\t\t\t\t\t\tplaying = true;\n\t\t\t\t\t\tstatus.setText(\"You lost a life! Get Ready!\");\n\t\t\t\t\t\trepaint();\n\t\t\t\t\t\tlivesLeft--;\n\t\t\t\t\t\tint timedelay = 2000;\n\t\t\t\t\t\tif (livesLeft == 0) {\n\t\t\t\t\t\t\ttimedelay = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlives.setText(\" Lives: \" + livesLeft.toString() + \"| \");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(timedelay);\n\t\t\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tball.setPx(250);\n\t\t\t\t\t\tball.setPy(170);\n\t\t\t\t\t\tball.setVx(-2);\n\t\t\t\t\t\tball.setVy(-3);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Finish Game Conditions\n\t\t\t\tif (livesLeft == 0 || currScoreVal == Bricks.getBlocksCreated()) {\n\t\t\t\t\tplaying = false;\n\t\t\t\t\tif (currScoreVal < Bricks.getBlocksCreated()){\n\t\t\t\t\tstatus.setText(\"You lose!\");\n\t\t\t\t\t}\n\t\t\t\t\tif (currScoreVal == Bricks.getBlocksCreated()){\n\t\t\t\t\tstatus.setText(\"You Win!\");\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[] options = { \"Yes\", \"No\", \"Save Score\" };\n\t\t\t\t\tint response = JOptionPane.showOptionDialog(null,\n\t\t\t\t\t\t\t\"Your Final Score:\" + currScoreVal + \"\\n\" + \"Start New Game?\\n\", \"Game Over\",\n\t\t\t\t\t\t\tJOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);\n\n\t\t\t\t\tif (response == 0) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t\telse if (response == 1) {\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t//Handling the Highscores. Only the Top 5 are Printed \n\t\t\t\t\telse if (response == 2) {\n\t\t\t\t\t\tString name = JOptionPane.showInputDialog(\"Enter your name?\");\n\t\t\t\t\t\tHighscores.addNewScore(currScoreVal,name);\n\t\t\t\t\t\tHighscores.writeFile();\n\t\t\t\t\t\tJDialog highScoreDialog = new JDialog();\n\t\t\t\t\t\tJPanel highscores = new JPanel();\n\t\t\t\t\t\thighscores.setLayout(new BoxLayout(highscores, BoxLayout.PAGE_AXIS));\n\t\t\t\t\t\tArrayList<String> entries = Highscores.topFiveEntries();\n\t\t\t\t\t\tJLabel highScore1 = new JLabel(\" 1: \" + entries.get(0));\n\t\t\t\t\t\tJLabel highScore2 = new JLabel(\" 2: \" + entries.get(1));\n\t\t\t\t\t\tJLabel highScore3 = new JLabel(\" 3: \" + entries.get(2));\n\t\t\t\t\t\tJLabel highScore4 = new JLabel(\" 4: \" + entries.get(3));\n\t\t\t\t\t\tJLabel highScore5 = new JLabel(\" 5: \" + entries.get(4));\n\t\t\t\t\t\tJLabel highscoreTitle = new JLabel(\" ~~~~~~TOP 5 HIGHSCORES~~~~~\");\n\t\t\t\t\t\thighscores.add(highscoreTitle);\n\t\t\t\t\t\thighscores.add(highScore1);\n\t\t\t\t\t\thighscores.add(highScore2);\n\t\t\t\t\t\thighscores.add(highScore3);\n\t\t\t\t\t\thighscores.add(highScore4);\n\t\t\t\t\t\thighscores.add(highScore5);\n\t\t\t\t\t\thighScoreDialog.add(highscores);\n\t\t\t\t\t\thighScoreDialog.pack();\n\t\t\t\t\t\thighScoreDialog.setSize(300, 300);\n\t\t\t\t\t\thighscores.setVisible(true);\n\t\t\t\t\t\thighScoreDialog.setLocationRelativeTo(null);\n\t\t\t\t\t\thighScoreDialog.setVisible(true);\n\t\t\t\t\t\tcurrScoreVal = 0;\n\t\t\t\t\t\tlivesLeft = 3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update the display\n\t\t\t\trepaint();\n\t\t\t}\n\t\t}\n\t}",
"public void update()\n\t{\n\t\t// Place this GameCanvas at the proper location and size\n\t\tthis.setBounds(0, 0, game.getWindow().getWidth(), game.getWindow().getHeight());\n\t\t\n\t\tif (timeCount > game.getFps())\n\t\t\ttimeCount = 0;\n\t\t\n\t\ttimeCount++;\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\twhile(true){\n\t\t\t\t\t\n\t\t\t\t\tlong time = System.currentTimeMillis();\n\t\t\t\t\tgameLoop();\n\t\t\t\t\t\n\t\t\t\t\tlong waitTime = 100 - time;\n\t\t\t\t\t\n\t\t\t\t\tif(waitTime < 10){\n\t\t\t\t\t\t\n\t\t\t\t\t\twaitTime = 10;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(waitTime);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"private void tick() {\n\n if (state == STATE.PAUSE) {\n return;\n }\n\n if (state == STATE.MENU || state == STATE.INSTRUCTIONS) {\n return;\n }\n\n if (spaceShips.size() == 0) {\n reset();\n state = STATE.MENU;\n return;\n }\n\n if (versus && spaceShips.size() == 1) {\n reset();\n state = STATE.MENU;\n versus = false;\n return;\n }\n\n if (!versus) {\n\n enemyGenerator.tick();\n powerUpGenerator.tick();\n score.tick();\n difficulty.tick();\n collision();\n }\n collisionVS();\n }",
"private void loop() {\n\t\tGL.createCapabilities();\n\n\t\t// Run the rendering loop until the user has attempted to close\n\t\t// the window or has pressed the ESCAPE key.\n\t\tlong lastTime = System.nanoTime();\n\t\tdouble delta = 0.0f;\n\t\tdouble ns = 1000000000.0 / 60;\n\t\tlong timer = System.currentTimeMillis();\n\t\tint updates = 0;\n\t\tint frames = 0;\n\t\twhile ( !glfwWindowShouldClose(window) ) {\n\t\t\tlong now = System.nanoTime();\n\t\t\tdelta += (now - lastTime)/ns;\n\t\t\tlastTime = now;\n\t\t\tif(delta >= 1.0) {\n\t\t\tupdate();\n\t\t\tupdates++;\n\t\t\t\n\t\t\t}\n\t\t\trender();\n\t\t\tframes++;\n\t\t\tif(System.currentTimeMillis()-timer > 1000) {\n\t\t\t\ttimer += 1000;\n\t\t\t\tSystem.out.println(updates + \"ups, \" + frames + \" fps\");\n\t\t\t\tupdates =0;\n\t\t\t\tframes=0;\n\n\t\t\t}\n\t\t}\n\t}",
"public void gameUpdate() {\n\t\t\n\t\t// Remember our homeTilePosition at the first frame\n\t\tif (bwapi.getFrameCount() == 1) {\n\t\t\tint cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Terran_Command_Center.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Zerg_Hatchery.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Protoss_Nexus.ordinal(), 0, 0);\n\t\t\thomePositionX = bwapi.getUnit(cc).getX();\n\t\t\thomePositionY = bwapi.getUnit(cc).getY();\n\t\t\n\t\t\tResourceManager.getInstance().gameStart(bwapi.getMyUnits());\n\t\t}\n\t\t\n\t\t/*\n\t\tif(ResourceManager.getInstance().numWorkers() == 10 && ScoutManager.getInstance().numScouts() == 0) {\n\t\t\tbwapi.printText(\"Assigning a scout\");\n\t\t\tneedsScout();\n\t\t}\n\t\t*/\n\t\t\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.gameUpdate();\n\t\t\n\t\t// Draw debug information on screen\n\t\tdrawDebugInfo();\n\n\t\t\n\t\t// Call the act() method every 30 frames\n\t\tif (bwapi.getFrameCount() % 30 == 0) {\n\t\t\tact();\n\t\t}\n\t}",
"public abstract void update(float time);",
"@Override\n public void update() {\n update(Pong.STANDARD_FRAMETIME);\n }",
"private void emitTicks() {\n if (gameModel == null || lastTickTime == 0) return; // the game is paused\n\n while (lastTickTime < System.currentTimeMillis()) {\n lastTickTime += 1000f / gameModel.ticksPerSecond();\n ;\n for (Entity go : gameModel.entities) go.tick();\n }\n }",
"public void run() \r\n {\r\n // get the instance of the graphics object\r\n Graphics g = getGraphics();\r\n\r\n // The main game loop\r\n while(true) \r\n {\r\n GameUpdate(); // update game\r\n GameDraw(g); // draw game\r\n } \r\n }",
"private void tick() {\n handler.tick();\n if (gameStart == GAME_STATE.Game) {\n hud.tick();\n menu.tick();\n\n // determines player lives + game over\n if (HUD.LIVES <= 0) {\n HUD.LIVES = 5;\n gameStart = GAME_STATE.GameOver;\n } else if (gameStart == GAME_STATE.Menu || gameStart == GAME_STATE.GameOver || gameStart == GAME_STATE.GameVictory) {\n menu.tick();\n }\n }\n }",
"public void tick() {\n \t\t// Iterate over objects in the world.\n \t\tIterator<PhysicalObject> itr = myObjects.iterator();\n \t\n \t\tList<PhysicalObject> children = new LinkedList<PhysicalObject>();\n \t\t\n \t\twhile (itr.hasNext()) {\n \t\t\tCollidableObject obj = itr.next();\n \n \t\t\t// Apply forces\n \t\t\tfor (Force force : myForces) {\n \t\t\t\tforce.applyForceTo((PhysicalObject) obj);\n \t\t\t}\n \t\t\t\n \t\t\t// Update the object's state.\n \t\t\tobj.updateState(1f / UPDATE_RATE);\n \t\t\t\n \t\t\t// Spawn new objects?\n \t\t\tList<PhysicalObject> newChildren =\n \t\t\t\t((PhysicalObject) obj).spawnChildren(1f / UPDATE_RATE);\n \t\t\t\n \t\t\tif (newChildren != null) {\n \t\t\t\tchildren.addAll(newChildren);\n \t\t\t}\n \t\t}\n \t\t\n \t\t/*\n \t\t In the \"tick\" method of your application, rather than call the old form of \n \t\t resolveCollisions to completely handle a collision, you can now:\n \t\t \n \t\t \t1.Directly call CollisionDetector.calculateCollisions to receive an\n \t\t\t ArrayList<CollisionInfo> object.\n \t\t\t2.If the list is empty, then there is no collision between the pair\n \t\t\t of objects and nothing further need be done.\n \t\t\t3.If the list is not empty, then a collision has occurred and you can\n \t\t\t check whether the objects involved necessitate a transmission or a standard\n \t\t\t collision resolution (a.k.a. bounce).\n \t\t\t4.If a standard collision resolution is called for, use the new form of\n \t\t\t resolveCollisions to pass in the ArrayList<CollisionInfo> object.\n \t\t\t \n \t\t The goal of this change is to prevent the computationally expensive \n \t\t collision detection algorithm from being executed twice when objects collide.\n \t\t */\n \n \t\tfor (int i = 0; i < myObjects.size() - 1; i++) {\n \t\t\tfor (int j = i + 1; j < myObjects.size(); j++) {\n \t\t\t\tArrayList<CollisionInfo> collisions = \n \t\t\t\t\tCollisionDetector.calculateCollisions(myObjects.get(i), myObjects.get(j));\n \t\t\t\t\n \t\t\t\tif (collisions.size() > 0) {\n \t\t\t\t\tHalfSpace hs = null;\n \t\t\t\t\tPhysicalObject o = null;\n \t\t\t\t\t\n \t\t\t\t\tif (myObjects.get(i) instanceof HalfSpace) {\n \t\t\t\t\t\t// If i is a halfspace, j must be an object\n \t\t\t\t\t\ths = (HalfSpace) myObjects.get(i);\n \t\t\t\t\t\to = myObjects.get(j);\n \t\t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t} else if (myObjects.get(j) instanceof HalfSpace) {\n \t\t\t\t\t\t// If j is a halfspace, i must be an object\n \t\t\t\t\t\ths = (HalfSpace) myObjects.get(j);\n \t\t\t\t\t\to = myObjects.get(i);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Was there a halfspace involved? If so, was it a side?\n\t\t\t\t\tif (hs != null && hs.normal.y != 1 && hs.normal.y != -1 && myPeer.getPeerSize() > 0) {\n \t\t\t\t\t\t// Side collision, is there a peer?\n \t\t\t\t\t\tPeerInformation peer = myPeer.getPeerInDirection(o.getVelocity().x, -o.getVelocity().z);\n \t\t\t\t\t\t\n \t\t\t\t\t\tif (peer != null) {\n \t\t\t\t\t\t\to.switchX();\n \t\t\t\t\t\t\to.switchZ();\n \t\t\t\t\t\t\tmyPeer.sendPayloadToPeer(peer, o);\n \t\t\t\t\t\t\to.detach();\n \t\t\t\t\t\t\tmyObjects.remove(o);\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Moving on\n \t\t\t\t\t\t\tcontinue;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Collision as usual...\n \t\t\t\t\tmyObjects.get(i).resolveCollisions(myObjects.get(j), collisions);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\t// Add new children to the world.\n \t\tfor (PhysicalObject obj : children) {\n \t\t\tmyScene.addChild(obj.getGroup());\n \t\t}\n \t\t\n \t\tmyObjects.addAll(children);\n \t}",
"public void update(){\n\t\ttime += System.currentTimeMillis() - lastTime;\n\t\tlastTime = System.currentTimeMillis();\n\t\t\n\t\t/*fin quando il tempo Ŕ maggiore della velocita incrementa gli indici*/\n\t\tif(time > velocity){\n\t\t\tindex++;\n\t\t\ttime = 0;\n\t\t\tif(index >= animation_frame.length)\n\t\t\t\t{\n\t\t\t\t\tindex = 0;\n\t\t\t\t}\n\t\t}\n\t}",
"public synchronized void updateGameDataAtSlowRate() {\n scheduleGameUpdate(slowUpdateSpeed);\n }",
"public void onUpdateTimerTick() {\r\n\t\tx = x+dx;\r\n\t\ty = y+dy;\r\n\t\tgame.updateWorld();\r\n\r\n\t}",
"private void updateTime() {\n timer.update();\n frametime = timer.getTimePerFrame();\n }",
"private void calculateAndDisplayFps() {\n if (fpsTimer.secondHasPassed()) {\n fpsTimer.getElapsedTimeAndUpdate();\n if (window.optionIsTurnedOn(Window.Options.DISPLAY_FPS)) {\n window.setTitle(gameTitle + \" - \" + fps + \" FPS\");\n }\n fps = 0;\n }\n fps++;\n }",
"public void tick(){\r\n if(timer != 0)\r\n timer++;\r\n }",
"@Override\n\tpublic void render(float delta) {\n\t\tif(paused) {\n\t\t\tif (Gdx.input.isKeyPressed(Keys.P)) {\n\t\t\t\tpaused = false;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(150);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\n\t\t//Clear the screen\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\t\n\n\t\t//Controlled ball\n\t\tcontrol.color = Color.CYAN;\n\t\tcontrol.update();\n\t\tshape.begin(ShapeRenderer.ShapeType.Filled);\n\t\tcontrol.draw(shape);\n\t\tshape.end(); \t\t\n\t\t\n\t\t\n\t\t\n\t\t//Create bouncing balls\n\t\tfor (Ball ball : balls) {\n\t\t\t\n\t\t\tball.update();\n\t\t\tshape.begin(ShapeRenderer.ShapeType.Filled);\n\t\t\tball.draw(shape);\n\t\t\tshape.end();\n\t\t\t\n\t\t\t//When ball and controller collide make collision sound effect and flash to Red\n\t\t\tif (control.overlaps(ball) == true) {\n\t\t\t\tif (Options.isFxOn == true)\n\t\t\t\t\tcollideSound.render();\n\t\t\t\tcontrol.color = Color.RED;\n\t\t\t\tshape.begin(ShapeRenderer.ShapeType.Filled);\n\t\t\t\tcontrol.draw(shape);\n\t\t\t\tshape.end();\n\t\t\t\thasCollided = 1;\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (control.overlaps(ball) == false && hasCollided == 1) {\n\t\t\t\thealthcounter++;\n\t\t\t\thasCollided = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\t//Drawing the timer\n\t\tbatch.begin();\n\t\ttime.drawTime(batch);\n\t\tbatch.end();\n\t\t\n\t\t//Adding Balls Every 30 seconds\n\t\tif (time.thirtySecPassed() == true && hasThirty == 0) {\n\t\t\t\n\t\t\tballs.add(new Ball(gen.nextInt(100) + size, gen.nextInt(100) + size, \n\t\t\t\t\tgen.nextInt(25) + 5, gen.nextInt(15) + 1, gen.nextInt(15) + 1));\n\t\t\t\n\t\t\thasThirty = 1;\n\t\t}\n\t\t\n\t\tif ((int)time.dt % 30 != 0)\n\t\t\thasThirty = 0;\n\t\t\n\t\t//Setting T or F Var for Ball Spawn\n\t\tif (time.tenSecPrior())\n\t\t\ttenPrior = 1;\n\t\t\n\t\tif (time.thirtySecPassed())\n\t\t\ttenPrior = 0;\n\t\t\n\t\t//Setting T or F Var for speed and size change\n\t\tif (time.fiveSecPrior())\n\t\t\tfivePrior = 1;\n\t\t\n\t\tif (time.fifteenSecPassed())\n\t\t\tfivePrior = 0;\n\t\t\n\t\tif (tenPrior == 1) {\n\t\t\t\n\t\t\tbatch.begin();\n\t\t\talert.showAlertTwenty(batch);\t\t\t\t\n\t\t\tbatch.end();\n\t\t\t\n\t\t}\n\t\t\n\t\tif (fivePrior == 1) {\n\t\t\t\n\t\t\tbatch.begin();\n\t\t\talert.showAlertTen(batch);\t\t\t\t\n\t\t\tbatch.end();\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//Draw the healthbar\n\t\tbatch.begin();\n\t\tHealthbar.health.get(healthcounter).setSize(180f, 30f);\n\t\tHealthbar.health.get(healthcounter).setPosition(2, 450);\n\t\tHealthbar.health.get(healthcounter).draw(batch);;\n\t\tbatch.end();\n\t\t\n\t\tif (healthcounter >= 4) {\n\t\t\t\n\t\t\tscore = time.dt;\n\t\t\tactualScore = df.format(score);\n\t\t\tSystem.out.println(actualScore);\n\t\t\tdispose();\n\t\t\tgoToEndScreen();\t\t\t\n\t\t}\n\n\t\t}\n\t\t\n\t}",
"public void tick();",
"public void tick();",
"public void tick();",
"public void tick() {\n\t\tif (mainRef.player().getPos()[1] <= lastEnd.getPos()[1] + 2000)\r\n\t\t\tloadNextMap();\r\n\r\n\t\tfor (GameObject go : gameObjects)\r\n\t\t\tgo.tick();\r\n\r\n\t\t// Check Player Collision\r\n\t\t// Top-Left\r\n\t\tPointColObj cTL = new PointColObj(mainRef.player().getPos()[0] + mainRef.player().getCol()[2],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3]);\r\n\t\t// Top-Right\r\n\t\tPointColObj cTR = new PointColObj(mainRef.player().getPos()[0] + mainRef.player().getCol()[2],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3] + mainRef.player().getCol()[1]);\r\n\t\t// Bottom-Left\r\n\t\tPointColObj cBL = new PointColObj(\r\n\t\t\t\tmainRef.player().getPos()[0] + mainRef.player().getCol()[2] + mainRef.player().getCol()[0],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3]);\r\n\t\t// Bottom-Right\r\n\t\tPointColObj cBR = new PointColObj(\r\n\t\t\t\tmainRef.player().getPos()[0] + mainRef.player().getCol()[2] + mainRef.player().getCol()[0],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3] + mainRef.player().getCol()[1]);\r\n\r\n\t\t// Inverse Collision, no part of the player's ColBox should be not\r\n\t\t// colliding...\r\n\t\tif (checkCollisionWith(cTL).size() == 0 || checkCollisionWith(cTR).size() == 0\r\n\t\t\t\t|| checkCollisionWith(cBL).size() == 0 || checkCollisionWith(cBR).size() == 0) {\r\n\t\t\t// If it would have left the bounding box of the floor, reverse the\r\n\t\t\t// player's posiiton\r\n\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t} else\r\n\t\t\tmainRef.player().setMoveBack(false);\r\n\r\n\t\t// Check General Collision\r\n\t\tArrayList<GameObject> allCol = checkCollisionWith(mainRef.player());\r\n\t\tfor (GameObject go : allCol) {\r\n\t\t\tif (go instanceof Tile) {\r\n\t\t\t\tTile gameTile = (Tile) go;\r\n\t\t\t\tif (gameTile.getType() == GameObjectRegistry.TILE_WALL\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_BASE\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_DOOR\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_SEWER\r\n\t\t\t\t\t\t|| (gameTile.getType() == GameObjectRegistry.TILE_WATERFALL && gameTile.getVar() == 0)) {\r\n\t\t\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} else if (go instanceof LineColObjHor || go instanceof LineColObjVert) {\r\n\t\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t\t\tbreak;\r\n\t\t\t} else if (go instanceof SkillDrop) {\r\n\t\t\t\tSkillDrop d = (SkillDrop) go;\r\n\t\t\t\tmainRef.player().getInv()[d.getVariation()]++;\r\n\t\t\t\tremoveGameObject(go);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public abstract float getSecondsPerUpdate();",
"public void tick(){\n camera.tick(player);\n handler.tick();\n }",
"@Override\r\n\tpublic void run() {\n\t\tif (mGame == null) {\r\n\t\t\tmGame = new GameOfLife();\r\n\t\t\tmGame.createGame();\r\n\t\t}\r\n\r\n\t\t// Constantly loop the game.\r\n\t\twhile (true) {\r\n\t\t\tmGame.repaint();\r\n\t\t\t// Sleep method to artificially slow down the games looping.\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(mDelayTime);\r\n\t\t\t} catch (InterruptedException 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\r\n\t\t\t// Update game.\r\n\t\t\tmGame.update();\r\n\t\t}\r\n\r\n\t}",
"public static void speedup(){\n\t\tif(bossair.periodairinit > Framework.nanosecond){\n\t\t\t\tbossair.periodair-=Framework.nanosecond/18; \n\t\t\t\tbossair.xmoving-=0.03; \n\t\t}\n\t\t\t\n\t}",
"public void tick(){\n\t\tinput.tick();\n\t\t\n\t\tif(!this.gameOver){\n\t\t\tthis.updateGame();\n\t\t}else{\n\t\t\tif(input.down){\n\t\t\t\tbird.x = 80;\n\t\t\t\tbird.y = (HEIGHT-50)/2;\n\t\t\t\tthis.numGoals = 0;\n\t\t\t\tthis.obstacles.clear();\n\t\t\t\tthis.goals.clear();\n\t\t\t\tthis.gameOver = false;\n\t\t\t\tthis.begin = true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"@Override\n\tpublic void update(float delta) {\n\t\tupdateMotion();\n\n\t\t// set position of sprite and update frames\n\t\tsetPosition(body.getWorldCenter().x - getWidth() / 2, body.getWorldCenter().y - 25 / SonicBoom.PPM);\n\t\tsetRegion(getFrame(delta));\n\t\tstateTimer += delta;\n\n\t\t// update ring losing\n\t\tif (loseRing && tempRing > 0) {\n\t\t\tgame.gameObjects.spawnRing(body.getWorldCenter().add(-8 / SonicBoom.PPM, 70 / SonicBoom.PPM),\n\t\t\t\t\tr.nextInt(5) - 2, 3);\n\t\t\ttempRing--;\n\n\t\t\tif (tempRing <= 0) {\n\t\t\t\tloseRing = false;\n\t\t\t}\n\n\t\t\tgame.manager.get(\"Sound/Lose Rings.wav\", Sound.class).play();\n\t\t}\n\n\t\t// hurting time update\n\t\tif (hurt) {\n\t\t\thurtTime -= delta;\n\n\t\t\tif (hurtTime <= 0) {\n\t\t\t\thurt = false;\n\t\t\t}\n\t\t}\n\n\t\t// after dead update\n\t\tif (dead) {\n\t\t\tdeadTime -= delta;\n\n\t\t\tif (deadTime <= 0) {\n\t\t\t\tgame.setUpdateCam(false);\n\t\t\t}\n\t\t}\n\n\t\t// update contactAngle\n\t\tVector2 p1 = contactPoint;\n\t\tVector2 p2 = body.getWorldCenter();\n\n\t\tcontactAngle = (float) (Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI) - 90;\n\n\t\t// update rotation\n\t\tif (onLoop) {\n\t\t\trotation = contactAngle;\n\t\t\tsetRotation(rotation);\n\n\t\t\tdeLoopTime = delta;\n\t\t} else if (!onLoop && deLoopTime > 0) {\n\t\t\tdeLoopTime -= delta;\n\t\t}\n\t\tif (rotation > 0) {\n\t\t\trotation = rotation < 9.81f ? 0 : rotation - 9.81f;\n\t\t}\n\t\tif (rotation < 0) {\n\t\t\trotation = rotation > -9.81f ? 0 : rotation + 9.81f;\n\t\t}\n\t\tsetRotation(rotation);\n\n\t\t// update wrapper body\n\t\twrapperBody.setTransform(body.getWorldCenter(), (float) Math.toRadians(rotation));\n\n\t}",
"@Override\n public void run() {\n gameFinished = false;\n state.loadMap();\n\n //Timing Stuff\n double previous = System.currentTimeMillis();\n double current;\n double elapsed;\n double lag = 0.0D;\n\n if (Map.map != null)\n GAME_LOOP:while (!gameFinished || !keyPressed) {\n\n current = System.currentTimeMillis();\n elapsed = current - previous;\n previous = current;\n lag += elapsed;\n\n //Updating Client\n if (CoOpManager.isClient())\n Map.map = CoOpManager.get();\n\n while (lag >= MS_PER_UPDATE) {\n state.update();\n lag -= MS_PER_UPDATE;\n }\n\n //Syncing Client and server\n if (CoOpManager.isClient())\n CoOpManager.send(state.currentMap);\n if (CoOpManager.isServer()) {\n CoOpManager.send(state.currentMap);\n Map.map = CoOpManager.get();\n }\n\n gameFrame.render(state);\n\n try {\n Thread.sleep((long) (Math.max(0, MAX_FPS_TIME - (System.currentTimeMillis() - previous))));\n } catch (InterruptedException e) {\n System.err.println(\"Unexpected Occasion.Game will Terminate\");\n break;\n }\n\n if (paused) {\n gameFrame.render(state);\n //Show Paused Dialogue\n switch (JOptionPane.showOptionDialog(gameFrame\n , \"Game Paused !\", \"Paused\"\n , JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE\n , null, new Object[]{\"Continue\", \"Save And Quit\", \"Quit\"}, \"Continue\")) {\n case JOptionPane.CLOSED_OPTION:\n case JOptionPane.YES_OPTION:\n System.out.println(\"Game continues\");\n paused = false;\n previous = System.currentTimeMillis();\n continue;\n case JOptionPane.NO_OPTION:\n System.out.println(\"Save and Quits\");\n Map.map.mapLives = GameState.lives;//Saving lives of player\n Map.saveMap(state.currentMap);\n break GAME_LOOP;\n case JOptionPane.CANCEL_OPTION:\n\n System.out.println(\"Game Quits\");\n break GAME_LOOP;\n default:\n System.out.println(\"Unexpected\");\n break;\n }\n }\n\n gameFinished = state.gameOver || state.gameCompleted;\n\n if (!gameFinished)\n keyPressed = false;\n\n }\n\n if (gameFinished) {\n gameFrame.render(state);\n gameFrame.setPanel(MainMenu.panel);\n } else {\n //when player quits by pausing\n paused = false;\n gameFrame.setPanel(MainMenu.panel);\n }\n\n\n //Game is Finished Here\n if (CoOpManager.isServer() || CoOpManager.isClient())\n CoOpManager.disconnect();\n Map.map = null;//Delete current Game Progress\n state.gameOver = false;//Game is On ;)\n state.gameCompleted = false;\n keyPressed = false;\n\n }",
"public abstract void update(float deltaTime);",
"public abstract void update(float deltaTime);",
"public abstract void update(float deltaTime);",
"private void sync() {\n float loopSlot = 1.0f/TARGET_FPS;\n double endTime = updateTimer.getLastRecordedTime() + loopSlot;\n while(updateTimer.getTime() < endTime) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException ie) {\n ie.printStackTrace();\n Thread.currentThread().interrupt();\n }\n }\n }",
"public void tick() {\n\t\tfor(GameObject object : gameObject) {\n\t\t\tif(object instanceof Opponents) {\n\t\t\t\t((Opponents) object).move(tickTime);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Game has advanced by \" + tickTime + \" ms = \" + tickTime/1000 + \" ticks.\");\n\t}",
"public void tick()\n\t{\n\t\tif (level == 0)\n\t\t\tcamera.followingPlayer = false;\n\t\telse\n\t\t\tcamera.followingPlayer = true;\n\t\t\n\t\tif (true)\n\t\t{\n\t\t\tgameObjectHandler.tick();\n\t\t\t//System.out.println(\"-all ticks done\");\n\t\t\tphysics.applyGravity();\n\t\t\t//System.out.println(\"-Grav done\");\n\t\t\tcollisionHandler.checkCollisions();\n\t\t\t//System.out.println(\"-collisions checked\");\n\t\t\tcamera.tick();\n\t\t\t//System.out.println(\"-camera ticked\");\n\t\t}\n\t\tif (currTransition != null)\n\t\t{\n\t\t\tif (currTransition.isDone())\n\t\t\t\tcurrTransition = null;\n\t\t\telse\n\t\t\t\tcurrTransition.tick();\n\t\t}\n\t\t\n\t\t\t\n\t\n\t\t\n\t}",
"protected void tick() {\n\t\tentities.updateEntities();\n\t\tentities.lateUpdateEntities();\n\t\tentities.killUpdateEntities();\n\t\tif(Game.isServer) entities.updateRespawnEntities();\n\t}"
] | [
"0.73956114",
"0.71801716",
"0.7173075",
"0.7169436",
"0.71178067",
"0.70849466",
"0.70401657",
"0.70386857",
"0.69815797",
"0.6976942",
"0.6959786",
"0.6956818",
"0.6920461",
"0.6902019",
"0.6894856",
"0.688098",
"0.6821375",
"0.6798946",
"0.67979634",
"0.6760368",
"0.6732398",
"0.6697315",
"0.6678409",
"0.66372466",
"0.66102666",
"0.6602251",
"0.6585001",
"0.6577065",
"0.6572232",
"0.65668845",
"0.6561428",
"0.6551545",
"0.65326244",
"0.65269214",
"0.65146106",
"0.6504553",
"0.6504006",
"0.649135",
"0.6489416",
"0.6482747",
"0.6479989",
"0.6470241",
"0.646791",
"0.6460415",
"0.64507973",
"0.64507973",
"0.64434725",
"0.6362722",
"0.6342601",
"0.6316983",
"0.6313268",
"0.6309734",
"0.62817043",
"0.6275417",
"0.6271264",
"0.6264473",
"0.6257",
"0.6239317",
"0.6238981",
"0.62324643",
"0.62292475",
"0.62239236",
"0.6208731",
"0.6188338",
"0.61882377",
"0.61796397",
"0.6177691",
"0.61724246",
"0.6153712",
"0.614503",
"0.614463",
"0.61444694",
"0.61263245",
"0.61254185",
"0.6116611",
"0.61165076",
"0.61119354",
"0.61088604",
"0.61051124",
"0.610496",
"0.6103961",
"0.6103546",
"0.608127",
"0.608127",
"0.608127",
"0.60776424",
"0.6075823",
"0.6075269",
"0.60747916",
"0.6064483",
"0.6060197",
"0.60572565",
"0.6057166",
"0.60534054",
"0.60534054",
"0.60534054",
"0.6049259",
"0.6045459",
"0.6040552",
"0.6034107"
] | 0.6715751 | 21 |
updates the game at the rate specified in function run() | private void tick() {
handler.tick();
if (gameStart == GAME_STATE.Game) {
hud.tick();
menu.tick();
// determines player lives + game over
if (HUD.LIVES <= 0) {
HUD.LIVES = 5;
gameStart = GAME_STATE.GameOver;
} else if (gameStart == GAME_STATE.Menu || gameStart == GAME_STATE.GameOver || gameStart == GAME_STATE.GameVictory) {
menu.tick();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void startGame() {\n timer.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n update();\n }\n }, 0, 2);\n }",
"public void run() {\n\t\tlong lastLoopTime = System.nanoTime();\n\t\tfinal int TARGET_FPS = 60;\n\t\tfinal long OPTIMAL_TIME = 1000000000 / TARGET_FPS;\n\n\t\t// keep looping round til the game ends\n\t\twhile (true) {\n\t\t\t// work out how long its been since the last update, this\n\t\t\t// will be used to calculate how far the entities should\n\t\t\t// move this loop\n\t\t\tlong now = System.nanoTime();\n\t\t\tlong updateLength = now - lastLoopTime;\n\t\t\tlastLoopTime = now;\n\n\t\t\t// update the frame counter\n\t\t\tlastFpsTime += updateLength;\n\t\t\tfps++;\n\n\t\t\t// update our FPS counter if a second has passed since\n\t\t\t// we last recorded\n\t\t\tif (lastFpsTime >= 1000000000) {\n\t\t\t\tSystem.out.println(\"(FPS: \" + fps + \")\");\n\t\t\t\tlastFpsTime = 0;\n\t\t\t\tfps = 0;\n\t\t\t}\n\n\t\t\t// update the game logic\n\t\t\ttick();\n\n\t\t\t// render\n\t\t\tglWindow.display();\n\n\t\t\t// sleep the current thread for the appropriate amount of time\n\t\t\ttry {\n\t\t\t\tThread.sleep(Math.max(0, (lastLoopTime - System.nanoTime() + OPTIMAL_TIME) / 1000000));\n\t\t\t}\n\t\t\tcatch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void run() {\n\t\tinitialise();\n\t\tlong beforeTime, afterTime, deltaTime = 0;\n\t\tlong counter = System.nanoTime() + 1000000000;\n\t\tint maxFPS = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes()[0]\n\t\t\t\t.getRefreshRate();\n\t\tif (maxFPS == 0) {\n\t\t\tmaxFPS = 60;\n\t\t}\n\t\tint fps = 0;\n\t\tlong minFrameTime = 1000000000l / maxFPS;\n\t\tdeltaTime = 1;\n\t\tupdate(0);\n\t\twhile (running) {\n\t\t\tbeforeTime = System.nanoTime();\n\t\t\tdraw();\n\t\t\tupdate(deltaTime / 1000000000f);\n\t\t\tafterTime = System.nanoTime();\n\t\t\tdeltaTime = afterTime - beforeTime;\n\t\t\tfps++;\n\t\t\tif (deltaTime < minFrameTime) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep((minFrameTime - deltaTime) / 1000000l);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (System.nanoTime() > counter) {\n\t\t\t\tcounter += 1000000000;\n\t\t\t\tSystem.out.println(fps);\n\t\t\t\tfps = 0;\n\t\t\t}\n\t\t}\n\t\tclose();\n\t}",
"@Override\r\n\tpublic void run() {\n\t\twhile (running) {\r\n\t\t\ttry {\r\n\t\t\tThread.sleep(INTERVAL);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\tLog.e(\"Jogo\", \"GameLoop Finalizado!\");\r\n\t\t\t}\r\n\t\t\tupdate();\r\n\t\t\t}\r\n\t\t\r\n\t}",
"@Override\n\tpublic void run() {\n\t\trequestFocus(); //So window is selected when it opens\n\t\tfps = 0; //Counts current fps\n\t\ttimer = System.currentTimeMillis(); //Keep track of current time in milliseconds, used to display FPS\n\t\tlastTime = System.nanoTime(); //Keep track of the last time the method was called\n\t\ttargetTick = FPS; //Set desired FPS\n\t\td = 0; //Varible used to keep track if it is running at desired FPS/used to compensate\n\t\tinterval = 1000000000/targetTick; //Interval between ticks\n\n\t\twhile(isRunning) {\n\t\t\tnow = System.nanoTime(); //Capture the time now\n\t\t\td += (now - lastTime)/interval; //Calculate d\n\t\t\tlastTime = now; //Update lastTime\n\n\t\t\t//If d is >= 1 we need to render to stay on fps target\n\t\t\twhile(d >= 1) {\n\t\t\t\ttick(); //Call tick method\n\t\t\t\trender(); //Call render method\n\t\t\t\tfps++; //Increment fps\n\t\t\t\td--; //Decrement d\n\t\t\t}\n\n\t\t\t//If the difference between the current system time is greater than 1 second than last time check, print the fps, reset fps to 0, and increase timer by 1 second\n\t\t\tif(System.currentTimeMillis() - timer >= 1000) {\n\t\t\t\tfps = 0; //Set fps to 0\n\t\t\t\ttimer+=1000; //Increase timer by 1 second\n\t\t\t}\n\t\t}\n\t\tstop(); //Stop the game\n\t}",
"@Override\r\n public void run() {\r\n while (playState.mPlaying) {\r\n if (!playState.mPaused) {\r\n // Update 10 times a second\r\n if (updateRequired()) {\r\n update();\r\n }\r\n }\r\n\r\n draw();\r\n }\r\n }",
"public void run()\r\n {\n long lastTime = System.nanoTime();\r\n long timer = System.currentTimeMillis();\r\n // create quotient\r\n final double ns = 1000000000.0 / 60.0;\r\n // difference between start time and current time\r\n double delta = 0;\r\n // counter for frames per second\r\n int frames = 0;\r\n // counter for updates per second\r\n int updates = 0;\r\n\r\n while (running)\r\n {\r\n long now = System.nanoTime();\r\n // add up the times of every loop run and get the value in seconds /\r\n // 60 (basically increase by 1/60th of a second every loop)\r\n delta += (now - lastTime) / ns;\r\n lastTime = now;\r\n // gets called 60 times per second because of delta calculation\r\n while (delta >= 1)\r\n {\r\n update();\r\n updates++;\r\n delta--;\r\n }\r\n\r\n view.render();\r\n frames++;\r\n\r\n // gets called every second\r\n if (System.currentTimeMillis() - timer > 1000)\r\n {\r\n // \"reset\" timer variable\r\n timer += 1000;\r\n System.out.println(updates + \" ups, \" + frames + \" fps\");\r\n view.setTitle(\"| \" + updates + \" ups, \" + frames + \" fps\" + \" |\");\r\n // reset frames and updates variables to start counting from 0\r\n // at the start of every second\r\n frames = 0;\r\n updates = 0;\r\n }\r\n }\r\n }",
"@Override\n public void run() {\n long previousTime = System.currentTimeMillis();\n long timeSinceLastTick = 0L;\n long timeSinceLastDisplayFrame = 0L;\n\n final double millisecondsPerDisplayFrame = 1000.0 / DISPLAY_FPS;\n\n while (this.game.isRunning() && !this.game.isGameOver()) {\n long currentTime = System.currentTimeMillis();\n long elapsedTime = currentTime - previousTime;\n timeSinceLastTick += elapsedTime;\n timeSinceLastDisplayFrame += elapsedTime;\n\n if (timeSinceLastTick >= MILLISECONDS_PER_TICK) { // Check if enough time has passed to update the physics.\n this.updatePhysics(); // Perform one 'step' in the game.\n timeSinceLastTick = 0L;\n }\n if (timeSinceLastDisplayFrame >= millisecondsPerDisplayFrame) { // Check if enough time has passed to refresh the display.\n this.game.notifyListeners(timeSinceLastTick); // Tell the asteroids panel that it should refresh.\n timeSinceLastDisplayFrame = 0L;\n }\n\n previousTime = currentTime;\n }\n }",
"@Override\n public void run() {\n long delay = Config.UPDATE_DELAY;\n\n while (true) {\n gameStateManager.update(delay / 1000.0);\n gamePanel.repaint();\n\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n\n }\n }\n }",
"public void run() {\n gameLogic = new GameLogic(drawManager.getGameFrame());\n long lastLoopTime = System.nanoTime();\n final int TARGET_FPS = 60;\n final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;\n loop(lastLoopTime, OPTIMAL_TIME);\n }",
"@Override\n public void run()\n {\n while (playing)\n {\n // Get the user inputs and update the game data\n update();\n // Draw it to the screen\n draw();\n // control the FPS\n control();\n\n }\n }",
"public synchronized void updateGameDataAtFastRate() {\n scheduleGameUpdate(fastUpdateSpeed);\n }",
"public void run() {\n\t\tlong lastTime = System.nanoTime();\n\t\tlong timer = System.currentTimeMillis();\n\t\tfinal double ns = 1000000000.0/60;\n\t\tdouble delta = 0;\n\t\tint frames = 0;\n\t\tint updates = 0;\n\t\trequestFocus();\n\t\twhile(running){\n\t\t\tlong now = System.nanoTime();\n\t\t\tdelta += (now-lastTime) /ns;\n\t\t\tlastTime = now;\n\t\t\twhile(delta >= 1){//60 times per sec\n\t\t\t\ttick();\n\t\t\t\tupdates++;\n\t\t\t\tdelta--;\n\t\t\t}\n\t\t\trender();//as fast as i can\n\t\t\tframes ++;\n\t\t\tif(System.currentTimeMillis() -timer > 1000){\n\t\t\t\ttimer += 1000;\n\t\t\t\tSystem.out.println(\"Fps:\"+frames+\" Updates:\"+updates);\n\t\t\t\tupdates = 0;\n\t\t\t\tframes = 0;\n\t\t\t\tthis.seconds++;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\twhile(true){\n\t\t\t\t\t\n\t\t\t\t\tlong time = System.currentTimeMillis();\n\t\t\t\t\tgameLoop();\n\t\t\t\t\t\n\t\t\t\t\tlong waitTime = 100 - time;\n\t\t\t\t\t\n\t\t\t\t\tif(waitTime < 10){\n\t\t\t\t\t\t\n\t\t\t\t\t\twaitTime = 10;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(waitTime);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public void run()\n\t{\n\t\tfloat oneFrame = 1000000000.0f / gameFPS;\n\t\t//same but for animation frames\n\t\tfloat oneAnimFrame = 1000000000.0f / animFPS;\n\t\t//current time in nanoseconds\n\t\tlong now = 0;\n\t\t//holds time of last iteration of game loop\n\t\tlong last = System.nanoTime();\n\t\t//how many frames have passed (can be a fraction)\n\t\tfloat delta = 0;\n\t\t//same but for anim frames\n\t\tfloat animDelta = 0;\n\t\t\n\t\t//for counting and displaying only \n\t\tint countFrames = 0;\n\t\tlong lastMilli = System.currentTimeMillis();\n\t\t\n\t\trequestFocus();\n\t\t//game loop\n\t\twhile (playing)\n\t\t{\n\t\t\t\n\t\t\tnow = System.nanoTime();\n\t\t\t//(now - last) time elapsed, divided by oneFrame gives\n\t\t\t//what fraction of a frame has passed\n\t\t\tdelta += (now - last) / oneFrame;\n\t\t\tanimDelta += (now - last) / oneAnimFrame;\n\t\t\tlast = now;\n\t\t\t//keep calling tick for as many frames have passed\n\t\t\t//if it's at least 1\n\t\t\tif (delta >= 1.0f)\n\t\t\t{\n\t\t\t\tcountFrames++;\n\t\t\t\twhile (delta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (animDelta >= 1.0f)\n\t\t\t{\n\t\t\t\twhile (animDelta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tanimTick();\n\t\t\t\t\tanimDelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\trender();\n\t\t\tcountFrames++;\n\t\t\tif (Math.abs(System.currentTimeMillis() - lastMilli) >= 1000)\n\t\t\t{\n\t\t\t\tFPS = countFrames;\n\t\t\t\tcountFrames = 0;\n\t\t\t\tlastMilli = System.currentTimeMillis();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void run() {\n while (running) {\n performStep();\n try {\n Thread.sleep(getGameSpeed());\n } catch (InterruptedException ignored) {\n }\n }\n\n }",
"@Override\n /**\n * Runs the game loop\n */\n public final void run() {\n initialize();\n\n // Timing variables\n long accumulator = 0L;\n long lastTime = System.nanoTime();\n long startTime;\n\n // Main game loop\n while(isRunning) {\n // Get times\n startTime = System.nanoTime();\n accumulator += startTime - lastTime;\n lastTime = startTime;\n\n // Update while the elapsed time is greater than the time interval\n while(accumulator >= NS_PER_UPDATE) {\n accumulator -= NS_PER_UPDATE;\n updateGame();\n }\n\n // Render to the screen\n renderer.beginRender();\n renderGame();\n renderer.endRender();\n }\n\n // Clean up the game components here\n terminate();\n }",
"public void update(){\n if(player.getPlaying()) {\n // update player animation.\n player.update();\n // update background animation.\n bg.update();\n // checks if skater has finished falling animation to end the game.\n if (player.animate instanceof FallAnimate && player.animate.getDone()) {\n player.setPlaying(false);\n player.setFall(false);\n System.out.println(\"End \" + player.getPlaying());\n }\n // checks if player has reached required points.\n if(player.getScore() > TARGETSCORE){\n player.setPlaying(false);\n levelCompleted = true;\n levelReset = System.nanoTime();\n }\n // increment jumpcounter while crouched.\n if (player.animate instanceof CrouchingAnimate && (jumpCounter <= 25)) {\n jumpCounter++;\n }\n // Creating Bananas:\n long bananaElapsed = (System.nanoTime() - bananaStartTime) / 1000000;\n if(bananaElapsed > 10500 && MainActivity.difficulty != 0){\n bananas.add(new Banana(BitmapFactory.decodeResource(getResources(),\n R.drawable.bigbanana), WIDTH + 10, (int) (HEIGHT * 0.85), 40, 40, 1));\n bananaStartTime = System.nanoTime();\n }\n //collision detection:\n for (int i = 0; i < bananas.size(); i++) {\n bananas.get(i).update();\n if (collision(bananas.get(i), player)) {\n bananas.remove(i);\n player.setFall(true);\n player.setPlaying(false);\n break;\n }\n // removing bananas when off screen\n if (bananas.get(i).getX() < -100) {\n bananas.remove(i);\n break;\n }\n }\n // Creating Cones:\n long coneElapsed = (System.nanoTime() - coneStartTime) / 1000000;\n if (coneElapsed > 5000) {\n cones.add(new TallBricks(BitmapFactory.decodeResource(getResources(),\n R.drawable.tallbricks), WIDTH + 10, (int) (HEIGHT * 0.59), 100, 161, 1));\n coneStartTime = System.nanoTime();\n }\n // update and check collisions.\n for (int i = 0; i < cones.size(); i++) {\n\n cones.get(i).update();\n if (collision(cones.get(i), player) && MainActivity.difficulty == 0) {\n cones.remove(i);\n player.forceSetScore(-500);\n break;\n }\n\n if (collision(cones.get(i), player) && MainActivity.difficulty != 0) {\n cones.remove(i);\n player.setFall(true);\n break;\n }\n // removing cones when off screen\n if (cones.get(i).getX() < -100) {\n cones.remove(i);\n break;\n }\n\n if((cones.get(i).getX() < player.getX() -15) ){\n cones.remove(i);\n player.setPendingPoints(1000);\n break;\n }\n }\n }\n else if(player.getPlaying() == false && levelCompleted){\n long resetElapsed = (System.nanoTime()-levelReset)/1000000;\n if(resetElapsed > 4000) {\n Intent resultIntent = new Intent();\n resultIntent.putExtra(\"result\",true);\n ((Activity)context).setResult(Activity.RESULT_OK,resultIntent);\n ((Activity)context).finish();\n }\n }\n else if(player.getPlaying() == false && !levelCompleted){\n if(!reset){\n newGameCreated = false;\n startReset = System.nanoTime();\n reset = true;\n }\n\n long resetElapsed = (System.nanoTime()-startReset)/1000000;\n\n if(resetElapsed > 2500 && !newGameCreated){\n newGame();\n }\n else if(resetElapsed < 2500 && started){\n player.update();\n }\n }\n }",
"public void run() {\r\n\t\tint frames = 0;\r\n\t\tdouble unprocessedSeconds = 0;\r\n\t\tlong previousTime = System.nanoTime();\r\n\t\tdouble secondsPerTick = 1 / 60.0;\r\n\t\tint tickCount = 0;\r\n\t\tboolean ticked = false;\r\n\t\t\r\n\t\twhile (running) {\r\n\t\t\tlong currentTime = System.nanoTime();\r\n\t\t\tlong passedTime = currentTime - previousTime;\r\n\t\t\tpreviousTime = currentTime;\r\n\t\t\tunprocessedSeconds += passedTime / 1000000000.0;\r\n\t\t\trequestFocus();//has the window selected when program is lanched\r\n\r\n\t\t\twhile (unprocessedSeconds > secondsPerTick) {\r\n\t\t\t\tunprocessedSeconds -= secondsPerTick;\r\n\t\t\t\tticked = true;\r\n\t\t\t\ttickCount++;\r\n\t\t\t\tif (tickCount % 3 == 0) {//calls on tick 20x/second\r\n\t\t\t\t\ttick();\r\n\t\t\t\t\tnumberOfTicks++;\r\n\t\t\t\t}\r\n\t\t\t\tif (tickCount % 60 == 0) {\r\n\t\t\t\t\t//System.out.println(frames + \"fps\");\r\n\t\t\t\t\tfps = frames;\r\n\t\t\t\t\tpreviousTime += 1000;\r\n\t\t\t\t\tframes = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\trender();\r\n\t\t\tframes++;\r\n\t\t}\r\n\t}",
"public void start(){\n isRunning = true;\n\n // This is where the magic happens\n Thread loop = new Thread(){\n\t\t\tpublic void run(){\n\t\t final double targetHertz = 30; // target updates per second\n\t\t final double updateTime = 1e9 / targetHertz; // target time between updates\n\t\t final int maxUpdates = 5; // max updates before a render is forced\n\t\t \n\t\t final double targetFps = 60; // target frames per second (fps)\n\t\t final double renderTime = 1e9 / targetFps; // target time between renders\n\t\t \n\t\t double lastUpdate = System.nanoTime();\n\t\t double lastRender = System.nanoTime();\n\n\t\t while (isRunning){\n\t\t \tdouble now = System.nanoTime();\n\t\t \t\n\t\t \tint updates = 0;\n\t\t \twhile (now - lastUpdate > updateTime && updates < maxUpdates){ // Update the game as much as possible before drawing\n\t\t \t\tgamePanel.update();\n\t\t \t\tlastUpdate += updateTime;\n\t\t \t\tupdates++;\n\t\t \t}\n\t\t \t\n\t\t \tif (now - lastUpdate > updateTime){ // Compensate for really long updates\n\t\t \t\tlastUpdate = now - updateTime;\n\t\t \t}\n\t\t \t\n\t\t \t// Draw the game\n\t\t \tgamePanel.repaint();\n\t\t \tlastRender = now;\n\t\t \t\n\t\t \t// kill some time until next draw\n\t\t \t\n\t\t \twhile (now - lastRender < renderTime && now - lastUpdate < updateTime){\n\t\t \t\tThread.yield();\n\t\t \t\t\n\t\t \t\ttry { Thread.sleep(1);} catch (Exception e) { }\n\t\t \t\t\n\t\t \t\tnow = System.nanoTime();\n\t\t \t}\n\t\t }\n\t\t\t}\n\t\t};\n\t\tloop.start();\n }",
"@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tThread.sleep(100);\n\t\t}\n\t\tcatch(InterruptedException e){\n\t\t\t\n\t\t}\n\t\t\n\t\t//run the game loop\n\t\twhile(true){\n\t\t\t//allows for smooth motion of the game\n\t\t\ttry{\n\t\t\t\tThread.sleep(8);\n\t\t\t}\n\t\t\tcatch(InterruptedException e){\n\t\t\t\t\n\t\t\t}\n\t\t\tmoveBall();\n\t\t\tmovePlayer(1);\n\t\t\tmovePlayer(2);\n\t\t}\n\t}",
"@Override\n\tpublic void update() {\n\n\t\ttimer++;\n\t\tupdatePlayer();\n\t\tupdateScreen();\n\t\tupdateLives();\n\n\t}",
"@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(100);\n\t\t\t} catch (InterruptedException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t//making the timer and notifying the observers.\n\t\t\twhile (time > 0 && gameRunning == true) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\tif (gameRunning) {\n\t\t\t\t\ttime--;\n\t\t\t\t}\n\t\t\t\tsetChanged();\n\t\t\t\tnotifyObservers(time);\n\n\t\t\t}\n\t\t}\n\n\t}",
"public void run(){\n\t\tdouble target = 60.0;\n double nsPerTick = 1000000000.0 / target;\n long lastTime = System.nanoTime();\n long timer = System.currentTimeMillis();\n double unprocessed = 0.0;\n int fps = 0;\n int tps = 0;\n boolean canRender = false;\n \n while (running) {\n long now = System.nanoTime();\n unprocessed += (now - lastTime) / nsPerTick;\n lastTime = now;\n \n if(unprocessed >= 1.0){\n tick();\n unprocessed--;\n tps++;\n canRender = true;\n }else canRender = false;\n \n try {\n Thread.sleep(1);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n \n if(canRender){\n //render\n \trender();\n fps++;\n }\n \n if(System.currentTimeMillis() - 1000 > timer){\n timer += 1000;\n System.out.printf(\"FPS: %d | TPS: %d\\n\", fps, tps);\n fps = 0;\n tps = 0;\n }\n \n }\n \n System.exit(0);\n\t}",
"@Override\n\tpublic void run() {\n\t\tgameImpl.render();\n\t\tgameImpl.update();\n\t}",
"public void run() { //this is the running method\n\t\twhile (running) {\n\t\t\t//System.out.println(\"Running...\"); //this is to show in the console that the game is running\n\t\t\t/**\n\t\t\t * use tick(); or update(); this just \n\t\t\t */\n\t\t\t\n\t\t\tupdate();\n\t\t\trender();\n\t\t}\n\t}",
"public static void run()\r\n\t{\r\n\t\tlong lastTime = System.nanoTime();\r\n\t\tdouble nsPerTick = 1000000000D / 30D;\r\n\t\t\r\n\t\tlong lastTimer = System.currentTimeMillis();\r\n\t\tdouble delta = 0; \r\n\r\n\t\twhile(isRunning)\r\n\t\t{\r\n\t\t\tlong now = System.nanoTime();\r\n\t\t\tdelta += (now - lastTime) / nsPerTick;\r\n\t\t\tlastTime = now;\r\n\t\t\t\r\n\t\t\twhile(delta >= 1)\r\n\t\t\t{\r\n\t\t\t\tdisplay.update();\r\n\t\t\t\tdisplay.render();\r\n\t\t\t\tdelta -= 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(System.currentTimeMillis() - lastTimer > 1000)\r\n\t\t\t{\r\n\t\t\t\tlastTimer += 1000;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public synchronized void updateGameDataAtSlowRate() {\n scheduleGameUpdate(slowUpdateSpeed);\n }",
"@Override\n public void run() {\n while (playing) {\n //update the frame\n update();\n //increment every frame\n Constants.FRAME_COUNT++;\n //draw objects on the frame\n draw();\n //control\n control();\n }\n }",
"public void run(){\n\t\twhile(game_running){\n\t\t\tif(singleplayer){\n\t\t\t\tcomputeDelta(); //Zeit für vorausgehenden Schleifendurchlauf wird errechnet\n\t\t\t\t//Erst Methoden abarbeiten, wenn Spiel gestartet ist\n\t\t\t\tif(isStarted()){\n\t\t\t\t\t\n\t\t\t\t\tcheckKeys(); //Tastaturabfrage\n\t\t\t\t\tdoLogic(); //Ausführung der Logik\n\t\t\t\t\tmoveObjects(); //Bewegen von Objekten\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\trepaint();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}catch (InterruptedException e){}\n\t\t\t} else{\n\t\t\t\tif(serverMode){\n\t\t\t\t\t //Zeit für vorausgehenden Schleifendurchlauf wird errechnet\n\t\t\t\t\t//Erst Methoden abarbeiten, wenn Spiel gestartet ist\n\t\t\t\t\tcomputeDelta();\n\t\t\t\t\tif(isStarted()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckKeys(); //Tastaturabfrage\n\t\t\t\t\t\tdoLogic(); //Ausführung der Logik\n\t\t\t\t\t\tmoveObjects(); //Bewegen von Objekten\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\trepaint();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(System.nanoTime() - last);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(!isStarted()){\n\t\t\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\t}else if(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n//\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n//\t\t\t\t\t\t}\n\t\t\t\t\t}catch (InterruptedException e){}\n\t\t\t\t}else if(clientMode){\n\t\t\t\t\tcomputeDelta();\n\t\t\t\t\tif(isStarted()){\n\t\t\t\t\t\tcheckKeys();\n\t\t\t\t\t\tdoLogic();\n\t\t\t\t\t\tmoveObjects();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\trepaint();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(System.nanoTime() - last);\n\t\t\t\t\ttry{\n\t\t\t\t\t\t//Thread.sleep(20);\n\t\t\t\t\t\tif(!isStarted()){\n\t\t\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\t}else if(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n//\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n//\t\t\t\t\t\t}\n\t\t\t\t\t}catch (InterruptedException e){}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\t\n\t}",
"@Override\r\n\tpublic void run() {\n\t\tif (mGame == null) {\r\n\t\t\tmGame = new GameOfLife();\r\n\t\t\tmGame.createGame();\r\n\t\t}\r\n\r\n\t\t// Constantly loop the game.\r\n\t\twhile (true) {\r\n\t\t\tmGame.repaint();\r\n\t\t\t// Sleep method to artificially slow down the games looping.\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(mDelayTime);\r\n\t\t\t} catch (InterruptedException 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\r\n\t\t\t// Update game.\r\n\t\t\tmGame.update();\r\n\t\t}\r\n\r\n\t}",
"private void loop() {\r\n\t\tfloat elapsed;\r\n\t\tfloat accumulated = 0f;\r\n\t\tfloat interval = 1f / TARGET_UPS;\r\n\t\tdouble time;\r\n\t\tdouble lastCall = System.nanoTime();\r\n\t\t\r\n\t\trunning = true;\r\n\t\t//loop while running and the window hasn't received a close command\r\n\t\twhile (running) {\r\n\t\t\ttime = System.nanoTime();\r\n\t\t\t\r\n\t\t\telapsed = (float) ((time-lastCall) / 1e9);\r\n\t\t\tlastCall = time;\r\n\t\t\t\r\n\t\t\taccumulated += elapsed;\r\n\t\t\t\r\n\t\t\twhile (accumulated >= interval) {\r\n\t\t\t\tupdate();\r\n\t\t\t\taccumulated -= interval;\r\n\t\t\t}\r\n\t\t\t//render once per loop, then wait until the render time slot is over before restarting\r\n\t\t\tgame.render();\r\n\t\t\tsync(lastCall/1e9);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void run()\n\t{\n\t\t\n\t\tCanvas canvas;\n\t\t\t\t\n\t\t//The gameloop\n\t\twhile(_running)\n\t\t{\n\t\t\t\n\t\t\tlong startTime = System.currentTimeMillis();\n\n\t\t\t_playField.update();\n\t\t\t\n\t\t\tcanvas = _playField.getHolder().lockCanvas();\n\t\t\t\n\t\t\t_playField.draw(canvas);\n\t\t\t\n\t\t\t_playField.getHolder().unlockCanvasAndPost(canvas);\n\t\t\t\n\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\tint gameLoopTime = (int)(endTime - startTime);\n\t\t\t\n\t\t\tif(gameLoopTime < _desiredFramerateTime)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong sleepTime = _desiredFramerateTime - gameLoopTime;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsleep(sleepTime); //Wait till this frame took 1/30 of a second\n\t\t\t\t}\n\t\t\t\tcatch(Exception e)\n\t\t\t\t{\n\t\t\t\t\tLog.d(GameThread.class.getSimpleName(), e.toString());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t}",
"public void update(int time);",
"public void run() {\n\n if (players.isEmpty()) {\n timer.cancel();\n }\n HeightMapUpdate m;\n peons.step(seconds);\n houses.step(seconds);\n m = heightMap.GetUpdate();\n if (m != null) {\n sendAllPlayers(m);\n }\n \n RockUpdate ru;\n ru= heightMap.updateRocks(seconds);\n if(ru!=null)\n sendAllPlayers(ru);\n \n for (Effect e : effects.values()) {\n e.execute(this);\n }\n synchronized (effects) {\n effects.putAll(newEffects);\n effects.keySet().removeAll(deletedEffects);\n if (newEffects.size() + deletedEffects.size() > 0) {\n EffectUpdate eu = new EffectUpdate(newEffects, deletedEffects);\n sendAllPlayers(eu);\n newEffects.clear();\n deletedEffects.clear();\n }\n }\n if (frame % 8 == 0) {\n sendAllPlayers(new PlayerUpdate(players));\n }\n frame++;\n }",
"public void run() \n\t{\n\t\tif(isRunning == true)\n\t\t{\n\t\t\tsimulation.tick();\n\t\t\tthis.updateStats();\n\t\t}\n\t}",
"private static void updateGame()\n {\n GameView.gameStatus.setText(\"Score: \" + computerScore + \"-\" + playerScore);\n if (computerScore + playerScore == NUM_CARDS_PER_HAND) {\n if (computerScore > playerScore) {\n GameView.gameText.setText(\"Computer Wins!\");\n Timer.stop = true;\n }\n else if (playerScore > computerScore) {\n GameView.gameText.setText(\"You win!\");\n Timer.stop = true;\n }\n else {\n GameView.gameText.setText(\"Tie game!\"); \n Timer.stop = true;\n }\n }\n }",
"private void gameLoop() {\n\n looping = true;\n long lastTime = System.currentTimeMillis();\n while (looping) {\n long delta = System.currentTimeMillis() - lastTime;\n if (delta >= 1000/60d) {\n view.render();\n game.update(delta);\n lastTime = System.currentTimeMillis();\n }\n }\n }",
"public void run() \r\n {\r\n // get the instance of the graphics object\r\n Graphics g = getGraphics();\r\n\r\n // The main game loop\r\n while(true) \r\n {\r\n GameUpdate(); // update game\r\n GameDraw(g); // draw game\r\n } \r\n }",
"@Override\n //Runs the game. Contains the overall game loop\n public void run() {\n Pool.initializePool();\n //Initialize the game\n initializeGame();\n \n //Main game loop\n while (true) {\n //Sequence of evaluating for each bird its coordinate as well as the\n //next tube's, updates the game by detecting collisions and if the bird\n //should flap, and learns by determining the fitness of the best bird. \n eval();\n update();\n learn();\n\n //Redraws the game\n repaint();\n \n //Adjusts the speed of the game by reducing the sleeptime. Adjusted if \n //user clicks mouse button\n try {\n if(!speedUp)\n Thread.sleep(20L);\n else\n Thread.sleep(2L);\n } catch (final InterruptedException e) {\n }\n }\n }",
"void update(int seconds);",
"@Override\n public void run() {\n updateMovement();\n }",
"public void run() {\n long lasTime = System.nanoTime();//pega o tempo atual do nosso computador em nano segundos, isso da mais precisão nos fps de maneira profissional\n double amountOfTicks = 60.0;//local onde seta o FPS.\n double ns = 1000000000 / amountOfTicks;//calculo para saber o momento certo de atualizar a tela do jogo\n double delta = 0;\n int frames = 0;\n double timer = System.currentTimeMillis();//retorna o tempo do computador, usamos isso para contagem do fps, mas é opcional.\n requestFocus();//Método que foca a tela automaticamente\n while(isRunning){\n long now = System.nanoTime();\n delta+= (now - lasTime) / ns;\n lasTime = now;\n if(delta >= 1) {\n tick();//atualização da tela.\n render();//renderização da tela.\n frames++;\n delta--;\n }\n\n if(System.currentTimeMillis() - timer >= 1000){\n System.out.println(\"FPS: \" + frames);\n frames = 0;\n timer+= 1000;\n }\n\n }\n\n stop();\n }",
"@Override\n\tpublic void update(Game game) {\n\t\t\n\t}",
"private void doGameCycle() {\n update();\n repaint();\n }",
"public void run() //Called by the Timer when scheduled.\n {\n timeElapsed++;\n if (timeElapsed > 999) //999 is the highest 3 digit integer, the highest number that can\n {\t\t\t\t\t\t\t //be shown on the displays. Beyond that, the player automatically loses.\n endGame(false);\n return;\n }\n repaint();\n }",
"@Override\n\tpublic void run() {\n\t\t\n\t\t\n\t\twhile (running) {\n\t\t\tupdate();\n\t\t\ttry {\n\t\t\t\tthread.sleep(1);\n\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\trender();\n\t\t}\n\t\t\n\t}",
"private void gameLoop() {\n\n\t\tlong elapsedTime = 0;\n\t\tlong newTime;\n\t\tlong oldTime = System.nanoTime();\n\t\tlong expectedTime = 1000000000 / 60;\n\t\tdouble delta;\n\n\t\tint frames = 0;\n\t\tlong frameTimer = 0;\n\n\t\twhile (!Display.isCloseRequested() && !gameOver) {\n\n\t\t\t// get new time, find elapsed time, determine delta\n\t\t\tnewTime = System.nanoTime();\n\t\t\telapsedTime = newTime - oldTime;\n\t\t\tdelta = (double)elapsedTime / (double)expectedTime;\n\t\t\toldTime = newTime;\n\n\t\t\t// update frame count\n\t\t\tframes++;\n\t\t\tframeTimer += elapsedTime;\n\n\t\t\t// if a second has passed, print the fps\n\t\t\tif (frameTimer >= 1000000000) {\n\t\t\t\tSystem.out.println(\"FPS: \" + frames);\n\t\t\t\tSystem.out.println(delta);\n\t\t\t\tframeTimer = Math.max(0, frameTimer - 1000000000);\n\t\t\t\tframes = 0;\n\t\t\t}\n\n\t\t\t// update game state\n\t\t\tsoundManager.update();\n\t\t\tstateManager.update(delta);\n\t\t\tstateManager.render();\n\t\t\tgui.update();\n\t\t\tDisplay.update();\t\n\n\t\t\t// sleep until 1/60 of a second has passed\n\t\t\tif (newTime - oldTime < expectedTime) {\n\n\t\t\t\twhile (newTime - oldTime < expectedTime) {\n\n\t\t\t\t\tnewTime = System.nanoTime();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(0);\n\t\t\t\t\t} catch (InterruptedException e) { } \n\n\t\t\t\t} \n\t\t\t}\n\t\t\telse {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(0);\n\t\t\t\t} catch (InterruptedException e) { }\n\t\t\t}\n\n\t\t}\n\t}",
"public void run()\r\n/* 201: */ {\r\n/* 202:161 */ while (this.active) {\r\n/* 203:162 */ synchronized (this)\r\n/* 204: */ {\r\n/* 205:163 */ ConsoleAI.this.game.updateSimFrame();\r\n/* 206: */ }\r\n/* 207: */ }\r\n/* 208: */ }",
"public void run() {\n this.requestFocus();\n long lastTime = System.nanoTime();\n double amountOfTicks = 60.0;\n double ns = 1000000000 / amountOfTicks;\n double delta = 0;\n long timer = System.currentTimeMillis();\n int frames = 0;\n while (running) {\n long now = System.nanoTime();\n delta += (now - lastTime) / ns;\n lastTime = now;\n while (delta >= 1) {\n tick();\n delta--;\n }\n if (running) {\n render();\n }\n frames++;\n if (System.currentTimeMillis() - timer > 1000) {\n timer += 1000;\n System.out.println(\"FPS: \" + frames);\n\n frames = 0;\n }\n }\n stop();\n }",
"public abstract void update(float time);",
"@Override\r\n\tpublic void run() {\n\t\tstartFlag = true;\r\n\t\twhile (startFlag) {\r\n \t\ttry {\r\n \t\t\tThread.sleep(updateRate);\r\n \t\t} catch (InterruptedException e) {\r\n \t\t\tSystem.out.println(e.getMessage());\r\n \t\t}catch (RuntimeException e) {\r\n\t\t\t\t//System.out.print(e.getMessage());\r\n\t\t\t}\r\n \t} \t\t\r\n\t}",
"@Override\n\tpublic void run() {\n\t\tLog.d(\"Engine\", \"Engine.run start\");\n\n\t\tListIterator<Sprite> iter = null, iterA = null, iterB = null;\n\n\t\tTimer frameTimer = new Timer();\n\t\tint frameCount = 0;\n\t\tint frameRate = 0;\n\t\tlong startTime = 0;\n\t\tlong timeDiff = 0;\n\n\t\twhile (p_running) {\n\t\t\t// Process frame only if not paused\n\t\t\tif (p_paused)\n\t\t\t\tcontinue;\n\n\t\t\t// Calculate frame rate\n\t\t\tframeCount++;\n\t\t\tstartTime = frameTimer.getElapsed();\n\t\t\tif (frameTimer.stopwatch(1000)) {\n\t\t\t\tframeRate = frameCount;\n\t\t\t\tframeCount = 0;\n\n\t\t\t\t// reset touch input count\n\t\t\t\tp_numPoints = 0;\n\t\t\t}\n\n\t\t\t// Call abstract update method in sub-class\n\t\t\tupdate();\n\n\t\t\t/**\n\t\t\t * Test for collisions in the sprite group. Note that this takes\n\t\t\t * place outside of rendering.\n\t\t\t */\n\t\t\titerA = p_group.listIterator();\n\t\t\twhile (iterA.hasNext()) {\n\t\t\t\tSprite sprA = (Sprite) iterA.next();\n\t\t\t\tif (!sprA.getAlive())\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!sprA.getCollidable())\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/*\n\t\t\t\t * Improvement to prevent double collision testing\n\t\t\t\t */\n\t\t\t\tif (sprA.getCollided())\n\t\t\t\t\tcontinue; // skip to next iterator\n\n\t\t\t\t// iterate the list again\n\t\t\t\titerB = p_group.listIterator();\n\t\t\t\twhile (iterB.hasNext()) {\n\t\t\t\t\tSprite sprB = (Sprite) iterB.next();\n\t\t\t\t\tif (!sprB.getAlive())\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (!sprB.getCollidable())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Improvement to prevent double collision testing\n\t\t\t\t\t */\n\t\t\t\t\tif (sprB.getCollided())\n\t\t\t\t\t\tcontinue; // skip to next iterator\n\n\t\t\t\t\t// do not collide with itself\n\t\t\t\t\tif (sprA == sprB)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Ignore sprites with the same ID? This is an important\n\t\t\t\t\t * consideration. Decide if your game requires it or not.\n\t\t\t\t\t */\n\t\t\t\t\tif (sprA.getIdentifier() == sprB.getIdentifier())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (collisionCheck(sprA, sprB)) {\n\t\t\t\t\t\tsprA.setCollided(true);\n\t\t\t\t\t\tsprA.setOffender(sprB);\n\t\t\t\t\t\tsprB.setCollided(true);\n\t\t\t\t\t\tsprB.setOffender(sprA);\n\t\t\t\t\t\tbreak; // exit while\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// begin drawing\n\t\t\tif (beginDrawing()) {\n\n\t\t\t\t// Call abstract draw method in sub-class\n\t\t\t\tdraw();\n\n\t\t\t\t/**\n\t\t\t\t * Draw the group entities with transforms\n\t\t\t\t */\n\t\t\t\titer = p_group.listIterator();\n\t\t\t\twhile (iter.hasNext()) {\n\t\t\t\t\tSprite spr = (Sprite) iter.next();\n\t\t\t\t\tif (spr.getAlive()) {\n\t\t\t\t\t\tspr.animate();\n\t\t\t\t\t\tspr.draw();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Print some engine debug info.\n\t\t\t\t */\n\t\t\t\tint x = p_canvas.getWidth() - 150;\n\t\t\t\tp_canvas.drawText(\"ENGINE\", x, 20, p_paintFont);\n\t\t\t\tp_canvas.drawText(toString(frameRate) + \" FPS\", x, 40,\n\t\t\t\t\t\tp_paintFont);\n\t\t\t\tp_canvas.drawText(\"Pauses: \" + toString(p_pauseCount), x, 60,\n\t\t\t\t\t\tp_paintFont);\n\n\t\t\t\t// done drawing\n\t\t\t\tendDrawing();\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Do some cleanup: collision notification, removing 'dead' sprites\n\t\t\t * from the list.\n\t\t\t */\n\t\t\titer = p_group.listIterator();\n\t\t\tSprite spr = null;\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tspr = (Sprite) iter.next();\n\n\t\t\t\t// remove from list if flagged\n\t\t\t\tif (!spr.getAlive()) {\n\t\t\t\t\titer.remove();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// is collision enabled for this sprite?\n\t\t\t\tif (spr.getCollidable()) {\n\n\t\t\t\t\t// has this sprite collided with anything?\n\t\t\t\t\tif (spr.getCollided()) {\n\n\t\t\t\t\t\t// is the target a valid object?\n\t\t\t\t\t\tif (spr.getOffender() != null) {\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * External func call: notify game of collision\n\t\t\t\t\t\t\t * (with validated offender)\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tcollision(spr);\n\n\t\t\t\t\t\t\t// reset offender\n\t\t\t\t\t\t\tspr.setOffender(null);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// reset collided state\n\t\t\t\t\t\tspr.setCollided(false);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Calculate frame update time and sleep if necessary\n\t\t\ttimeDiff = frameTimer.getElapsed() - startTime;\n\t\t\tlong updatePeriod = p_sleepTime - timeDiff;\n\t\t\tif (updatePeriod > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(updatePeriod);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t}\n\n\t\t}// while\n\t\tLog.d(\"Engine\", \"Engine.run end\");\n\t\tSystem.exit(RESULT_OK);\n\t}",
"public void run() {\r\n this.createBallsOnTopOfPaddle();\r\n this.running = true;\r\n this.runner.run(new CountdownAnimation(2, 3, sprites));\r\n this.runner.run(this);\r\n }",
"public void run() {\n\n while (true) {\n System.out.println(this);\n // updateGraph takes in seconds and this.TIMEBETWEENFRAMES is given in milliseconds.\n this.updateBoard(this.TIMEBETWEENFRAMES / 1000);\n try {\n Thread.sleep((long) (this.TIMEBETWEENFRAMES));\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n checkRep();\n }\n }",
"public void run() //call game over method \r\n {\r\n gui.display(\"The time limit has been reached. The game is now over!\");\r\n \r\n try { //try catch for Thread.sleep in gameOver()\r\n gameOver();\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"private void gameLoop() {\n float elapsedTime;\n float accumulator = 0f;\n float interval = 1.0f/TARGET_UPS;\n\n while(!window.shouldClose()) {\n elapsedTime = Math.min(0.25f, updateTimer.getElapsedTimeAndUpdate());\n accumulator += elapsedTime;\n\n //Get any input\n\n //Calculate updates in the scene\n while(accumulator >= interval) {\n update();\n accumulator -= interval;\n }\n\n interpolationFactor = accumulator/interval;\n render();\n\n if (!window.optionIsTurnedOn(Window.Options.ENABLE_VSYNC)) {\n sync();\n }\n }\n }",
"public void gameUpdate() {\n\t\t\n\t\t// Remember our homeTilePosition at the first frame\n\t\tif (bwapi.getFrameCount() == 1) {\n\t\t\tint cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Terran_Command_Center.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Zerg_Hatchery.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Protoss_Nexus.ordinal(), 0, 0);\n\t\t\thomePositionX = bwapi.getUnit(cc).getX();\n\t\t\thomePositionY = bwapi.getUnit(cc).getY();\n\t\t\n\t\t\tResourceManager.getInstance().gameStart(bwapi.getMyUnits());\n\t\t}\n\t\t\n\t\t/*\n\t\tif(ResourceManager.getInstance().numWorkers() == 10 && ScoutManager.getInstance().numScouts() == 0) {\n\t\t\tbwapi.printText(\"Assigning a scout\");\n\t\t\tneedsScout();\n\t\t}\n\t\t*/\n\t\t\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.gameUpdate();\n\t\t\n\t\t// Draw debug information on screen\n\t\tdrawDebugInfo();\n\n\t\t\n\t\t// Call the act() method every 30 frames\n\t\tif (bwapi.getFrameCount() % 30 == 0) {\n\t\t\tact();\n\t\t}\n\t}",
"public void run() {\n \twhile(true) {\n \t \tsetupGame();\n \tplayGame();\n \t}\n }",
"@Override\n public void run() {\n while (true) {\n long currentTime = System.nanoTime();\n\n draw();\n check(currentTime);\n }\n }",
"public void run() { \n while(true) {\n if(!isFirst && health > 0 && state == STATE.GAME) {\n \tmanager.physic(); // Calculates the targeting and shooting of towers\n \tenemyCreator(); // Creates enemies\n \tfor(int i= 0; i < enemies.length; i++) {\n \t\tif(enemies[i].isAlive) {\n \t\t\tenemies[i].move(); // Moves the enemies if alive\n \t\t}\n \t}\n }\n else if(health < 1) { // If the user lost\n \tfor(int i = 0; i < enemies.length; i++)\n \t\tenemies[i].deleteEnemy(); // Deletes all enemies on the screen\n \t\n \tif(isFirstAfterLoss){\n \t\tCheckScore();// Checks if there is a high score\n \t\tisFirstAfterLoss = false;\n \t\tsave.writeHighScore(); // Writes high score info to text file\n \t}\n \tstate = STATE.POSTGAME; // Sets the state to postgame \t\n }\n \t\n \n repaint();// Calls the paint method\n \n try {\n Thread.sleep(1);// Delay\n } \n catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }\n }",
"public void run() {\r\n\t\tboolean repeat = true;\r\n\t\tint count = 0;\r\n\t\twhile(repeat){\r\n\t\t\tcount ++;\r\n\t\t\t//updates currency rates every hour (count>60)\r\n\t\t\tif(count > 60){\r\n\t\t\t\tcurrencies.updateRates();\r\n\t\t\t\tcount = 1;\r\n\t\t\t}\r\n\t\t\tprintStatus();\r\n\t\t\ttry{\r\n\t\t\t\tThread.sleep(60000);\r\n\t\t\t}catch(InterruptedException ex){\r\n\t\t\t\trepeat = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void update() {\n if(!Constants.GAME_OVER) {\n deltaTime = (int) (System.currentTimeMillis() - startTime);\n startTime = System.currentTimeMillis();\n elapsedTime = (int) (System.currentTimeMillis() - initTime)/1000;\n Constants.ELAPSED_TIME = elapsedTime;\n //Log.d(\"FRAMES \", \"\"+ Constants.FRAME_COUNT);\n //call update on every object\n player.update();\n enemyManager.update(player);\n starManager.update(player.getSpeed());\n asteroidManager.update(player);\n } else {\n playing = false;\n sound.stopBg();\n for(int i = 0; i < highScore.length; i++) {\n if (Constants.SCORE > highScore[i]) {\n final int endI = i;\n highScore[i] = Constants.SCORE;\n // Log.d(\"SCORE \", \"\" + highScore[i]);\n break;\n }\n }\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n for(int i = 0; i < highScore.length; i++) {\n int index = i + 1;\n editor.putInt(\"score\" + index, highScore[i]);\n }\n editor.apply();\n }\n }",
"public void run(){\n this.requestFocus();\n long lastTime = System.nanoTime();\n double amountOfTicks = 60.0;\n double ns = 1000000000 / amountOfTicks;\n double delta = 0;\n long timer = System.currentTimeMillis();\n int frames = 0;\n\n while(isRunning){\n long now = System.nanoTime();\n delta += (now - lastTime) / ns;\n lastTime = now;\n while(delta >= 1){\n tick();\n delta--;\n }\n render();\n frames++;\n\n if(System.currentTimeMillis() - timer > 1000){\n timer += 1000;\n frames = 0;\n }\n }\n stop();\n }",
"public void update()\n\t{\n\t\tmyTimer = new Timer(10, new ActionListener()\n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tremove(countDown);\n\t\t\t\ttimeElapsed = timeElapsed + 0.01;\n\t\t\t\tif(completed == myTokens.size())\n\t\t\t\t{\n\t\t\t\t\tmyTimer.stop();\n\t\t\t\t\tcountDown.setText(\"Thank you for playing!\");\n\t\t\t\t\tadd(countDown);\n\t\t\t\t}\n\t\t\t\ttime.setText(\"time: \" + String.format(\"%.2f\", timeElapsed));\n\t\t\t\tscore.setText(\"score: \" + userScore);\n\t\t\t\trepaint();\n\t\t\t}\n\t\t});\n\t\tmyTimer.setInitialDelay(5000);\n\t\tmyTimer.start();\n\t}",
"public void update() {\n\t\tupdate(1);\n\t}",
"@Override\n public void update() {\n update(Pong.STANDARD_FRAMETIME);\n }",
"@Override\n public void run() {\n try {\n this.init();\n } catch (IOException e) {\n e.printStackTrace();\n }\n int fps = Const.FPS;\n double ticksPerFrame = 1_000_000_000 / fps;\n double delta = 0;\n long now;\n long lastTimeTicked = System.nanoTime();\n\n\n while (isRunning) {\n now = System.nanoTime();\n delta += (now - lastTimeTicked) / ticksPerFrame;\n lastTimeTicked = now;\n if (delta > 0) {\n tick();\n try {\n render();\n } catch (IOException e) {\n e.printStackTrace();\n }\n delta--;\n\n }\n }\n //Calls the stop method to stop everything\n this.stop();\n }",
"public void render(int gameSpeed){\n counterFrames++;\n if (counterFrames*gameSpeed*1000 >= (60 * (delay))){\n setDone();\n }\n }",
"@Override\n\tpublic void run() {\n\t\tif (isStopped()) {\n\t\t\tthrow new IllegalStateException(\"This GameRunnable has already been stopped!\");\n\t\t} else if (stop) {\n\t\t\tdone = true;\n\t\t\t\n\t\t\t//We are now in the state STOPPED\n\t\t\tstateProperty.set(GameState.STOPPED);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//We are now in the state RUNNING\n\t\tstateProperty.set(GameState.RUNNING);\n\t\t\n\t\ttry {\n\t\t\tlong start, end;\n\t\t\tdouble waitTime = 1000.0 / GAME_TPS;\n\t\t\t\n\t\t\twhile (!stop) {\n\t\t\t\tstart = System.currentTimeMillis();\n\n\t\t\t\tgameTick();\n\t\t\t\t\n\t\t\t\tend = System.currentTimeMillis();\n\t\t\t\t\n\t\t\t\t//Sleep if we have time to spare.\n\t\t\t\tlong dur = end - start;\n\t\t\t\tif (dur < waitTime) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(Math.round(waitTime - dur));\n\t\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\t\tLog.getLogger().log(LogLevel.DEBUG, \"[GameThread] Exception while sleeping until next cycle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\t//Reset stopping\n\t\t\tdone = true;\n\t\t\t\n\t\t\t//We are now in the state STOPPED\n\t\t\tstateProperty.set(GameState.STOPPED);\n\t\t}\n\t}",
"@Override\n\tpublic void run() {\n\t\tif (state != 3) {\n\t\t\tthis.requestFocus();\n\t\t\tlong lastTime = System.nanoTime();\n\t\t\tdouble amountOfTicks = 60.0;\n\t\t\tdouble ns = 1000000000 / amountOfTicks;\n\t\t\tdouble delta = 0;\n\t\t\tlong timer = System.currentTimeMillis();\n\t\t\tint frames = 0;\n\t\t\twhile (isRunning) {\n\n\t\t\t\tlong now = System.nanoTime();\n\n\t\t\t\tdelta += (now - lastTime) / ns;\n\t\t\t\tlastTime = now;\n\n\t\t\t\twhile (delta >= 1) {\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t\trender();\n\t\t\t\tframes++;\n\n\t\t\t\tif (System.currentTimeMillis() - timer > 1000) {\n\t\t\t\t\ttimer += 1000;\n\t\t\t\t\tframes = 0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tstop();\n\n\t\t}\n\n\t}",
"@Override\n public void run() {\n\n secs++;\n if (secs == 10) {\n tens++;\n secs = 0;\n }\n if (tens == 6) {\n mins++;\n tens = 0;\n secs = 0;\n }\n time = mins + \":\" + tens + \"\" + secs;\n timePlayed.setText(\"Time: \" + time);\n }",
"public void update()\n\t{\n\t\t// Place this GameCanvas at the proper location and size\n\t\tthis.setBounds(0, 0, game.getWindow().getWidth(), game.getWindow().getHeight());\n\t\t\n\t\tif (timeCount > game.getFps())\n\t\t\ttimeCount = 0;\n\t\t\n\t\ttimeCount++;\n\t}",
"public void updateGameTime() {\n\t\tGameTime = Timer.getMatchTime();\n\t}",
"private void startGame() {\n\t\ttimer = new Timer();\n\t\ttimer.scheduleAtFixedRate(new ScheduleTask(), 5, BreakoutBall.BALLSPEED);\n\t}",
"@Override\r\n\tpublic void gameLoopLogic(double time) {\n\r\n\t}",
"public void run() {\n initialize();\n float currentTime = System.nanoTime();\n float previousTime = currentTime;\n float dt = 0.0f;\n while (!exit) {\n currentTime = System.nanoTime();\n dt = Math.max((currentTime - previousTime) / 1000000.0f, 20.0f);\n input(win.getInputHandler(), dt);\n update(dt);\n render(dt);\n waitFPS();\n previousTime = currentTime;\n postOperation();\n }\n dispose();\n }",
"private synchronized void scheduleGameUpdate(int updateSpeedInMilliseconds) {\n updateTask.cancel();\n // Create the update task which will simply call updateData\n updateTask = new TimerTask() {\n @Override\n public void run() {\n updateData();\n }\n };\n updateTimer.scheduleAtFixedRate(updateTask, 0,\n updateSpeedInMilliseconds);\n }",
"public void playOneTurn() {\r\n //the number of balls in the game\r\n this.ballCounter = new Counter(this.levelInformation.numberOfBalls());\r\n Sleeper sleeper = new Sleeper();\r\n\r\n this.runner = new AnimationRunner(gui, 60, sleeper);\r\n this.paddle.getRectangle().setUpperLeft(new Point(WIDTH_SCREEN / 2 - (this.levelInformation.paddleWidth() / 2),\r\n HI_SCREEN - 40));\r\n //initialize the balls\r\n initializeBall();\r\n\r\n //start the game by counting down\r\n if (this.sprites != null) {\r\n this.runner.run(new CountdownAnimation(2, 4, this.sprites));\r\n }\r\n //run the game\r\n this.running = true;\r\n this.runner.run(this);\r\n\r\n }",
"private void simulateUpdate(int input) {\n gameState += input * 1.25;\n gameState %= 20;\n }",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twhile(true){\r\n\t\t\t\t\tdraw();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}",
"public void run()\n\t{\n\t\t// Keep looping\n\t\tfor (;;)\n\t\t{\n\t\t\t// Put the timer to sleep\n\t\t\ttry\n\t\t\t{ \n\t\t\t\tThread.sleep(m_rate);\n\t\t\t}\n\t\t\tcatch (InterruptedException ioe) \n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Use 'synchronized' to prevent conflicts\n\t\t\tsynchronized ( this )\n\t\t\t{\n\t\t\t\t// Increment time remaining\n\t\t\t\tm_elapsed += m_rate;\n\n\t\t\t\t// Check to see if the time has been exceeded\n\t\t\t\tif (m_elapsed > m_length)\n\t\t\t\t{\n\t\t\t\t\t// Trigger a timeout\n\t\t\t\t\ttimeout();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}",
"@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\twhile ((System.nanoTime() - startTime) / 1000000000 < Server.START_DELAY) {\r\n\r\n\t\t\t\t\t\t\t// Cancel the timer if the number of players ready\r\n\t\t\t\t\t\t\t// changes\r\n\t\t\t\t\t\t\tif (Server.this.playersReady == 0\r\n\t\t\t\t\t\t\t\t\t|| Server.this.playersReady != Server.this.players\r\n\t\t\t\t\t\t\t\t\t\t\t.size()\r\n\t\t\t\t\t\t\t\t\t|| this.value != Server.this.currentTimerNo) {\r\n\t\t\t\t\t\t\t\tServer.this.println(\"Cancelled timer\");\r\n\t\t\t\t\t\t\t\tServer.this.lobbyTimerActive = false;\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tThread.sleep(10);\r\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tServer.this.startGame();\r\n\t\t\t\t\t}",
"public void update(){\n\t\tsetChanged();\n\t\trender();\n\t\tprintTimer();\n\t}",
"public void run(){\n try{\n while (true) {\n if (Running && step==1) {\n if (pause_before) {\n Thread.sleep(speed);\n pause_before = false;\n }\n handler1.sendEmptyMessage(1);\n setStep(2);\n Thread.sleep(750);//time pause for 0.75s, allow the screen to stay in no mole for 0.75s\n\n }\n if (Running && step==2) {\n if (pause_before) {\n Thread.sleep(750);\n pause_before = false;\n }\n next = (int) (Math.random() * 9) + 1;\n handler2.sendEmptyMessage(1);\n if (random)\n speed = (int) (Math.random() * 751) + 250;\n setStep(1);\n Thread.sleep(speed);//time pause for 0.75s, by default, allow the screen to stay in mole for 0.75s\n next = 0;\n }\n }\n }\n catch(Exception e){\n e.printStackTrace();\n }\n\n }",
"private void playGame() {\n drawBricks();\n for (int i = 1; i <= NTURNS; i++) {\n setBallSpeed();\n GOval ball = drawBall();\n paddle = drawPaddle();\n showLabel(\"ROUND \" + i, Color.ORANGE);\n waitForClick();\n playRound(ball);\n }\n showLabel(\"GAME OVER\", Color.BLACK);\n }",
"protected void gameLoop() {\r\n init();\r\n recalculateViewport();\r\n\r\n long lastTime, lastFPS;\r\n lastTime = lastFPS = System.nanoTime();\r\n currentFramesPerSecond = 0;\r\n\r\n while(!Display.isCloseRequested()) {\r\n long deltaTime = System.nanoTime() - lastTime;\r\n lastTime += deltaTime;\r\n\r\n if(Display.wasResized())\r\n recalculateViewport();\r\n EventManager.getEventManager().processEventQueue();\r\n InputManager.getInputManager().update();\r\n update(deltaTime / 1e9);\r\n\r\n render();\r\n Display.update();\r\n\r\n currentFramesPerSecond++;\r\n if(System.nanoTime() - lastFPS >= 1e9) {\r\n lastFPS += 1e9;\r\n if(displayFPS){\r\n System.out.println(currentFramesPerSecond);\r\n }\r\n context.fps = currentFramesPerSecond;\r\n currentFramesPerSecond = 0;\r\n }//End if\r\n Display.sync(fps);\r\n }//End while\r\n System.exit(0);\r\n }",
"public void run() {\n\t\t\n\t\t//* Initializing starting variables ** //\n\t\t\n\t\tturns = NTURNS;\n\t\tstartturn = true; \n\t\tgameover = false;\n\t\t\t\t\n\t\t//* setup game board** //\n\t\t\n\t\tturns--;\n\t\tsetupBricks();\n\t\tsetupPaddle();\n\t\tsetupScoreboard();\n\n\t\t\n\t\n\t\t//* play game** //\n\t\t\t\t\n\t\t\n\t\twhile (turns >= 0) {\n\t\t\t\n\t\t\tif (startturn == true) {\n\t\t\t\t// starttext = new GLabel(\"Click mouse to start turn\", WIDTH / 2, HEIGHT / 2);\n\t\t\t\t// add(starttext);\n\t\t\t\tupdateScoreboard();\n\t\t\t\tplayBall();\n\t\t\t\twaitForClick();\n\t\t\t\tstartturn = false;\n\t\t\t}\n\t\t\t\n\t\t\tcheckWalls();\n\t\t\tcheckCollision();\n\t\t\tmoveBall();\n\t\t\tcheckWin();\n\n\t\t}\n\t\tshowLose();\n\t\t\n\t}",
"public void update() {\n if(mGame.getState() != Game.States.PLAYING) return;\n\n if(mMap.getX() >= next) {\n generate(rand.nextInt(3) + 1);\n }\n }",
"public synchronized void run() {\n\t\t\twhile(keepGoing){\n\t\t\t\ttick++;\n\t\t\t\t//starting user input at beginning of tick so that it doesn't change while updating\n\t\t\t\tinput();\n\t\t\t\tString instruction = currentLevel.levelUpdate(tick);\n\t\t\t\tswitch(instruction) {\n\t\t\t\t\tcase \"syllabus\":\n\t\t\t\t\t\t//syllabus.buttonSprites.get(levelNumber).setImage(syllabus.platformTileSheet[0][levelNumber]);\n\t\t\t\t\t\tlevelChanger(syllabus);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"booleanLevel\":\n\t\t\t\t\t\tcontainer.remove(booleanLevel);\n\t\t\t\t\t\tbooleanLevel = new LogicBooleanLevel(\"booleanLevel\", 0);\n\t\t\t\t\t\tlevelChanger(booleanLevel);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//No match\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tSystem.out.println(\"Updater Thread Died\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n\tpublic void run() {\n\t\t\n\t\twhile(isItOk==true){\n\t\t\t\n\t\t\tif(!holder.getSurface().isValid())\n\t\t\t\tcontinue;\n\t\t\tfor(i=0;i<increment;i++)\n\t\t\t\t{draw(pos);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tpos++;\n if(pos==17)\n pos=1;}\n\t\t\t\t\n\t\t\tfor( i=0;i<15;i++)\n\t\t\t\t{\n\t\t\t\tdraw(pos);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(200);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tdraw(0);\n\t\t\t\t}\n\t\t\t\n\t\t\n\t\tif(pos%4==1)\n\t\t\tpuzzleNo=1;\n\t\telse if(pos%4==2)\n\t\t\tpuzzleNo=2;\n\t\telse if(pos%4==3)\n\t\t\tpuzzleNo=3;\n\t\telse if(pos%4==0)\n\t\t\tpuzzleNo=4;\n\t\t\n\t\t\t\n\t\t\tIntent myIntent = new Intent(Levelintro.this,Game.class);\n\t\t\tmyIntent.putExtra(\"puzzleNo\", puzzleNo);\n\t\t\tstartActivity(myIntent);\n\t\t \n\t\t}\n\t\t\t/*try {\n\t\t\t\tThread.sleep(time);\n\t\t\t\t\n\t\t\tcnt++;\n\t\t\t\t\n\t\t\t\tif(time==50)\n\t\t\t\t\ttime=1400;\n\t\t\t\tif(cnt==1)\n\t\t\t\t\t{time=time-20;\n\t\t\t\t\tcnt=0;}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\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\tif(Math.abs(x1-x)<80 && Math.abs(y- y1)<80)\n\t\t\t\tscore++;\n\t\t\telse\n\t\t\t\t{ \n\t\t\t\t\tMAX=score;\n\t\t\t\t\tscore=0;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(200);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tBundle b = new Bundle();\n\t\t\t\tb.putString(\"score\", MAX+\"\");\n\t\t\t\tIntent i = new Intent(Surfaces.this,GameOver.class);\n\t\t\t\ti.putExtras(b);\n\t\t\t\tstartActivity(i);\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t*/\n\t\t\n\t}",
"public synchronized void start() {\n // For max accuracy, reset oldTime to really reflect how much\n // time will have passed since we wanted to start the updating\n oldTime = System.nanoTime();\n updateGameDataAtSlowRate();\n }",
"@Override\r\n public void run() {\n if (start == true && player.getX() > 0) {\r\n //Updates objects\r\n for (Terrain t: terrain) {\r\n t.update();\r\n }\r\n for (Barrier b: barriers) {\r\n b.update();\r\n }\r\n for (Platform p: platforms) {\r\n p.update();\r\n }\r\n for (Bird bi: birds) {\r\n bi.update();\r\n }\r\n for (Bomb bo: bombs) {\r\n bo.update();\r\n bo.grav();\r\n }\r\n player.grav();\r\n playerTwo.grav();\r\n playerTwo.update();\r\n \r\n //Controls when bombs drop\r\n if (bombAct % 150 == 0 && score > 2500) {\r\n bombs.add(new Bomb((int) (Math.random() * 1000), (int) (Math.random() * 100)));\r\n }\r\n \r\n //Sets pace of the game\r\n if (tempo % 1500 == 0) {\r\n for (Terrain t: terrain) {\r\n t.setDX(t.getDX() + 1);\r\n }\r\n for (Barrier b: barriers) {\r\n b.setDX(b.getDX() + 1);\r\n }\r\n for (Platform p: platforms) {\r\n p.setDX(p.getDX() + 1);\r\n }\r\n for (Bird bi: birds) {\r\n bi.setDX(bi.getDX() - 1);\r\n }\r\n }\r\n \r\n //Timers\r\n tempo++;\r\n bombAct++;\r\n score++;\r\n }\r\n\r\n //Always runs\r\n player.update();\r\n \r\n \r\n collision(player);\r\n collision(playerTwo);\r\n borderCollision(player);\r\n borderCollision(playerTwo);\r\n \r\n repaint();\r\n }",
"public void run() {\r\n\t\tnotifyViews();\r\n\t\tfor (int i = 0; i < 100000; i++) {\r\n\t\t\ttick();\r\n\t\t}\r\n\t}",
"public void run() {\n Timeline timeline = new Timeline(new KeyFrame(Duration.millis(17),\n t -> this.draw()));\n\n timeline.setCycleCount(Timeline.INDEFINITE);\n timeline.play();\n }",
"public void play(){\n\t\tif(timer == null){ return; }\n\t\t//1000ms in a second, so divided by frames per second gives ms interval \n\t\ttimer.setDelay(1000/fps);\n\t\ttimer.start();\n\t}",
"@Override\n\tpublic void run() {\n\t\tticks = 0;\n\t\twhile (running) {\n\t\t\tticks++;\n\t\t\texec.update(ticks);\n\t\t\tscreen.repaint();\n\t\t\ttry {\n\t\t\t\tThread.sleep(15);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tscreen.getFrame().dispose();\n\t\texec.stop();\n\t\tSystem.exit(0);\n\t}",
"public void playGame() {\n\t\t\r\n\t\t\r\n\t\twhile (!theModel.isGameOver()) {\r\n\t\t\tplayRoundOne();\r\n\t\t}\r\n\t\t\r\n\t}",
"public void play() {\n\t\tif (happiness + 10 > 100) {\n\t\t\thappiness = 100;\n\t\t} else {\n\t\t\thappiness += 10;\n\t\t}\n\t}",
"@Override\n public void update() {\n App.updateScore();\n App.updateRocketsCount();\n checkLevel();\n\n if(pickupSpawnCooldown > 0){\n pickupSpawnCooldown--;\n }\n\n player.setSpeed(new Point2D(player.getSpeed().getX()*0.98,player.getSpeed().getY()*0.98));\n int rand = random.nextInt(100);\n if(rand == 0 && asteroidsNumber<asteroidsMaxNumber){\n createAsteroid();\n asteroidsNumber++;\n }\n rand = random.nextInt(500);\n if(rand == 0 && astronautsNumber<astronautsMaxNumber){\n createAstronaut();\n astronautsNumber++;\n }\n }",
"public void run() {\n\t\t\t while (!stopnow) {\n\t\t\t\t if (!stopnow) {\n\t\t\t\t\t ArrayList<Cell> ng = gol.evolve(gridPane.getSeed());\n\t\t\t\t\t gridPane.setSeed(ng);\n\t\t\t\t\t tickCount++;\n\t\t\t\t\t genCountLabel.setText(\"Generation: \"+tickCount); //Update Counter \n\t\t\t\t\t try \n\t\t\t\t\t {\n\t\t\t\t\t Thread.sleep(TIMER_DELAY);\n\t\t\t\t\t } \n\t\t\t\t\t catch(InterruptedException ex) \n\t\t\t\t\t {\n\t\t\t\t\t Thread.currentThread().interrupt();\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }"
] | [
"0.7722066",
"0.75045604",
"0.74930716",
"0.7491604",
"0.74515057",
"0.7433561",
"0.7369644",
"0.73596275",
"0.73313606",
"0.7319628",
"0.727864",
"0.72474337",
"0.7218437",
"0.71916753",
"0.71853805",
"0.7165349",
"0.712031",
"0.71158886",
"0.7099844",
"0.70953476",
"0.7090198",
"0.7087212",
"0.7086234",
"0.7068563",
"0.7048942",
"0.70356274",
"0.7013153",
"0.6998103",
"0.6994864",
"0.6990845",
"0.69788027",
"0.69764614",
"0.6971791",
"0.69696754",
"0.6955571",
"0.6893762",
"0.68662804",
"0.68591034",
"0.685802",
"0.6845025",
"0.68390566",
"0.6811277",
"0.67874384",
"0.6765779",
"0.6757351",
"0.6748255",
"0.6744671",
"0.6740284",
"0.672623",
"0.6725591",
"0.6712663",
"0.66975933",
"0.66954136",
"0.6678389",
"0.66656774",
"0.6659902",
"0.6651427",
"0.66274804",
"0.6625383",
"0.6617467",
"0.66136014",
"0.6612228",
"0.66006005",
"0.65993726",
"0.6571128",
"0.65705556",
"0.6564261",
"0.6552377",
"0.65378493",
"0.65362865",
"0.65348375",
"0.65210503",
"0.65186113",
"0.65093064",
"0.64951575",
"0.6492743",
"0.6482501",
"0.6481645",
"0.6469537",
"0.646537",
"0.646268",
"0.64605016",
"0.6457742",
"0.6456332",
"0.64458203",
"0.644197",
"0.6440513",
"0.64313316",
"0.6430976",
"0.6429082",
"0.64242566",
"0.64237314",
"0.6407276",
"0.63966614",
"0.63880676",
"0.63828945",
"0.6376695",
"0.63747185",
"0.63699615",
"0.6362369",
"0.6362282"
] | 0.0 | -1 |
renders background, game state | private void render() {
final int numBuffers = 3;
BufferStrategy bs = this.getBufferStrategy(); // starts value at null
if (bs == null) {
this.createBufferStrategy(numBuffers); // 3: buffer creations
return;
}
Graphics g = bs.getDrawGraphics();
g.setColor(Color.black); // stops flashing background
g.fillRect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
handler.render(g);
if (gameStart == GAME_STATE.Game) {
hud.render(g);
} else if (gameStart == GAME_STATE.Menu || gameStart == GAME_STATE.Help || gameStart == GAME_STATE.GameOver || gameStart == GAME_STATE.GameVictory) {
menu.render(g);
}
g.dispose();
bs.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void render() {\n\t\t// Call update before anything gets drawn\n\t\tupdate();\n\n\t\t// Begin drawing operations - set projection matrix, grab frames, etc\n\t\tmBatch.setProjectionMatrix(mCamera.combined);\n\n\t\tGdx.gl.glClearColor(0, 0, 0.2f, 1);\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\tmBatch.begin();\n // Draw the background first, regardless of state\n mBatch.draw(mGameBackgrounds[mCastleDamageStage], 0f, 0f);\n\n\t\tswitch (mGameState) {\n\t\t\tcase STATE_PRE_GAME:\n\t\t\t\tmFont.draw(mBatch, mGameTitle, 125, 375);\n\t\t\t\tmButtons[0].draw(mFont, mBatch);\n\t\t\t\tmButtons[1].draw(mFont, mBatch);\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_START:\n\t\t\t\tmFont.draw(mBatch, mRoundText, 360, 440);\n\t\t\t\tmButtons[2].draw(mFont, mBatch);\n\t\t\t\tmButtons[3].draw(mFont, mBatch);\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_PLAY:\n\t\t\t\t// Draw text on top of the background in the sky\n\t\t\t\tmFont.draw(mBatch, mHealthText, 600, 440);\n\t\t\t\tmFont.draw(mBatch, mRoundScoreText, 50, 440);\n\t\t\t\tmFont.draw(mBatch, mRoundText, 360, 440);\n\t\t\t\t// Draw attackers if the game isn't paused\n\t\t\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\t\t\tAttacker a = mAttackers[i];\n\t\t\t\t\tif (a.isAlive()) {\n\t\t\t\t\t\tmBatch.draw(a.getCurrentFrame(), a.getX(), a.getY());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmButtons[2].draw(mFont, mBatch);\n\t\t\t\tmButtons[3].draw(mFont, mBatch);\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_OVER:\n\t\t\t\tmFont.draw(mBatch, mHealthText, 600, 440);\n\t\t\t\tmFont.draw(mBatch, mRoundScoreText, 50, 440);\n\t\t\t\tmFont.draw(mBatch, mTotalScoreText, 50, 400);\n\t\t\t\tmButtons[4].draw(mFont, mBatch);\n\t\t\t\tmButtons[5].draw(mFont, mBatch);\n\t\t\t\tmButtons[6].draw(mFont, mBatch);\n\t\t\t\tif(mRoundSaved) {\n\t\t\t\t\tmFont.draw(mBatch, mGameSavedText, 350, 125);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase STATE_GAME_OVER:\n\t\t\t\tmButtons[0].draw(mFont, mBatch);\n\n\t\t\t\tbreak;\n\t\t}\n\n if(mPaused)\n mFont.draw(mBatch, \"Paused\", 380, 400);\n\n\t\tmBatch.end();\n\t}",
"@Override\n public void render() {\n GUI.clearScreen();\n if (assetManager.update()) {\n switch (gameState) {\n case MENU:\n GUI.menuLoop();\n break;\n case PAUSE:\n case GAME:\n gameLoop();\n break;\n case LOAD:\n World.load();\n gameState = GameState.GAME;\n break;\n }\n } else {\n GUI.splashScreen(assetManager.getProgress());\n }\n DrawManager.end();\n }",
"public void render() {\n\t\tscreen.background(255);\n\t\thandler.render();\n\t}",
"public void render() {\n backGraphics.drawImage(background, backgroundX, backgroundY, null);\n\n GameObject.renderAll(backGraphics);\n\n //2. Call repaint\n repaint();\n }",
"@Override\r\n\tpublic void renderBackground() {\n\r\n\t}",
"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 \n \n if(!gameover){\n player.render(g);\n borrego.render(g);\n rayo.render(g);\n \n for (Enemy brick : enemies) {\n brick.render(g);\n //bomba.render(g);\n }\n \n for (Fortaleza fortaleza : fortalezas) {\n fortaleza.render(g);\n }\n \n for (Bomba bomba: bombas){\n bomba.render(g);\n }\n \n drawScore(g);\n drawLives(g,vidas);\n }else if(gameover){\n drawGameOver(g);\n }\n \n\n if (lost && !gameover){\n drawLost(g);\n }\n if (pause && !lost && !gameover){\n drawPause(g);\n }\n if(win && !lost && !pause && !lost &&!gameover){\n \n drawWin(g);\n }\n \n bs.show();\n g.dispose();\n }\n }",
"public void draw() {\n switch(state) {\n case MENU:\n background(0, 0, 0);\n startMenu();\n break;\n case CREATE_PLAYER:\n frameRate(20);\n createPlayer();\n break;\n case PLAY_GAME:\n frameRate(framerate);\n playGame();\n break;\n }\n}",
"@Override\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(Game.background, 0, 0, 5200, 700, null);\n\t}",
"private void render() {\n if (game.isEnded()) {\n if (endGui == null) {\n drawEndScreen();\n }\n\n return;\n }\n\n drawScore();\n drawSnake();\n drawFood();\n }",
"@Override\n public void renderGameObject() {\n Gdx.gl.glClearColor(1, 1, 1, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n //this is where we can actually display stuff on the screen\n batch.begin();\n\n batch.draw(new TextureRegion(background),100,100,100,100,200,200,1,1,0);\n\n batch.end();\n\n }",
"@Override\n public void render(Painter g) {\n g.drawImage(this.getMenuBackground(),this.getxPos(), this.getyPos());\n resumeButton.render(g);\n restartButton.render(g);\n instructionsButton.render(g);\n saveGameButton.render(g);\n quitButton.render(g);\n if(SettingsState.getCurrentLanguage() == \"English\" && instructionsScreen){\n g.drawImage(Assets.howToPlayBackground, 0, 0);\n backArrowButton.render(g);\n } else if(SettingsState.getCurrentLanguage() == \"Polish\" && instructionsScreen){\n g.drawImage(Assets.howToPlayBackground_Polish,0,0);\n backArrowButton.render(g);\n }\n\n }",
"public void render() {\n\t\tcam.update();\n\t\tcam.apply(Gdx.gl10);\n\n\t\t// TODO: encapsulate in the background class\n\t\t/*\n\t\t * float gravColour = (WorldGravity.G - WorldGravity.gravMin) /\n\t\t * (WorldGravity.gravMax - WorldGravity.gravMin);\n\t\t * \n\t\t * float red = gravColour; float blue = (1 - gravColour);\n\t\t * \n\t\t * Gdx.graphics.getGL10().glClearColor(red, 0f, blue, 1f);\n\t\t */\n\n\t\tGdx.graphics.getGL10().glClearColor(0.3f, 0f, 0.4f, 1f);\n\t\tGdx.graphics.getGL10().glClear(\n\t\t\t\tGL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);\n\n\t\t// spriteBatch has its own camera so the code below sets its projection\n\t\t// matrix to that of the camera\n\t\tspriteBatch.setProjectionMatrix(cam.combined);\n\t\t\n\t\t// all drawing using spriteBatch needs to be surrounded with begin() and\n\t\t// end()\n\t\tspriteBatch.begin();\n\t\t// put all the drawing methods here\n\t\t// *************************************\n\t\tdrawBackground();\n\t\t\n\t\tdrawButtons();\n\t\t\n\t\tdrawMenu();\n\n\t\tspriteBatch.end();\n\t}",
"private void render() {\n\n StateManager.getState().render();\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 }",
"private void render() {\n\n if (state == STATE.PAUSE) {\n\n return;\n }\n\n\n if (state == STATE.MENU) {\n\n menu.draw();\n arrow.render();\n return;\n\n }\n\n if (state == STATE.INSTRUCTIONS) {\n instructions.draw();\n return;\n }\n\n for (int i = 0; i < spaceShips.size(); i++) {\n spaceShips.get(i).render();\n }\n\n\n for (Enemy enemy : enemies) {\n enemy.render();\n }\n\n for (int i = 0; i < powerUps.size(); i++) {\n\n powerUps.get(i).render();\n }\n\n for (int i = 0; i < enemyBullets.size(); i++) {\n\n enemyBullets.get(i).render();\n }\n\n for (int i = 0; i < friendlyBullets.size(); i++) {\n\n friendlyBullets.get(i).render();\n }\n\n topBar.render();\n bottomBar.render();\n fps.render();\n score.render();\n\n\n }",
"private void drawBackground() {\r\n\r\n\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tthis.mc.renderEngine.bindTexture(BACKGROUND_RESOURCE);\r\n\t\tString text = \"Nitro Teleport Waypoints\";\r\n\t\tint posX = (width - SIZE_X) / 2;\r\n\t\tint posY = (height - SIZE_Y) / 2;\r\n\t\tint strWidth = this.fontRendererObj.getStringWidth(text);\r\n\r\n\t\tthis.drawTexturedModalRect(posX, posY, 0, 0, SIZE_X, SIZE_Y);\r\n\t\tthis.drawCenteredString(this.fontRendererObj, text, width / 2, posY - 17, 0xFFFFFF);\r\n\t}",
"@Override\r\n\tpublic void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {\r\n g.drawImage(background, 0, 0);\r\n g.drawString(winner + \" Wins!\", 275, 150);\r\n g.drawImage(menu.i, menu.x, menu.y);\r\n g.drawImage(again.i, again.x, again.y);\r\n \r\n\t}",
"@Override\n\tpublic void render() {\n\t\tif(!paused){\n\t\t\t//Update the game world with time since last rendered frame\n\t\t\tworldController.update(Gdx.graphics.getDeltaTime());\n\t\t}\n\t\t\n\t\t//Set ClearColor to default color\n\t\tGdx.gl20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);\n\t\t\n\t\t//Clear the screen\n\t\tGdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\t\n\t\t//Render the game world to the screen\n\t\tworldRenderer.render();\n\t}",
"@Override\r\n\tpublic void render() {\r\n\r\n\t\tsb.setProjectionMatrix(cam.combined);\r\n\r\n\t\t// draw background\r\n\t\tbg.render(sb);\r\n\r\n\t\t// draw button\r\n\t\tlevel1.render(sb);\r\n\t\tlevel2.render(sb);\r\n\t\tlevel3.render(sb);\r\n\t\t\r\n\t\tif (gameMode == 1){\r\n\t\t\tplayer1press.render(sb);\r\n\t\t\tplayer2press.render(sb);\r\n\t\t}\r\n\t\telse \r\n\t\t\tplayerpress.render(sb);\r\n\t\t\r\n\t\t\r\n\t selectTheLevel.render(sb);\r\n\t\t\r\n\t\tmainMenuB.render(sb);\r\n\r\n\t\t// debug draw box2d\r\n\t\tif(debug) {\r\n\t\t\tcam.setToOrtho(false, Game.V_WIDTH / 100, Game.V_HEIGHT / 100);\r\n\t\t\tb2dRenderer.render(world, cam.combined);\r\n\t\t\tcam.setToOrtho(false, Game.V_WIDTH, Game.V_HEIGHT);\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic void render(float delta) {\n\t\tbatch.begin();\n\t\tbatch.draw(background, 0, 0);\n\t\tbatch.end();\n\t\t\n\t\tstage.act(delta);\n\t\tstage.draw();\n\t\t\n\t}",
"public void render()\n\t{\n\t\t// Get or create the BufferStrategy to plan rendering\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the graphics that can be drawn to\n\t\tg = bs.getDrawGraphics();\n\t\t\n\t\t// Set the Graphics2D\n\t\tg2d = (Graphics2D)g;\n\t\t\n\t\t// Create a black rectangle to fill the canvas as a base background\n\t\tg.setColor(Color.black);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\tif (screenLoaded)\n\t\t{\n\t\t\t// Draw the static background\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawStaticBackground(g);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(game.getCamera().getxPos(), \n\t\t\t\t\t\t \t game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the background layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawBackground(g);\n\t\t\t\n\t\t\t// Render all of the Tiles\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesWorld())\n\t\t\t\tgame.getWorldHandler().renderTiles(g);\n\t\t\t\n\t\t\t// Render all of the GameObjects\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesGameObjects())\n\t\t\t\tgame.getObjectHandler().renderGameObjects(g);\n\t\t\t\n\t\t\t// Draw the foreground layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawForeground(g);\n\t\t\t\n\t\t\t// Draw the lighting\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesLighting())\n\t\t\tg.drawImage(game.getLightHandler().getLightmap(), -1500, -3100, null);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(-game.getCamera().getxPos(), \n\t\t\t\t\t\t \t -game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the gui layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawGui(g);\n\t\t\t\n\t\t\t// Draw the debug layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null\n\t\t\t\t&& game.getDebugScreen() != null\n\t\t\t\t&& game.isDebugShown())\n\t\t\t\tgame.getDebugScreen().showDebug(g);\n\t\t\t\n\t\t\t// Draw the loading \"curtain\" if the screen is still loading\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null &&\n\t\t\t\t!screenLoaded)\n\t\t\t{\n\t\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dispose of all graphics\n\t\t\tg.dispose();\n\t\t\t// Show all graphics prepared on the BufferStrategy\n\t\t\tbs.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tGraphics2D g2 = (Graphics2D)g;\n\t\t\tg2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\t\n\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Dispose of all graphics\n\t\tg.dispose();\n\t\t// Show all graphics prepared on the BufferStrategy\n\t\tbs.show();\n\t}",
"static public void display(){\n\n elapsedTime = TimerManager.getTime() - startTime;\n\n if (!isDone){\n\n //Animate\n if (TimerManager.getTime()-animTimer > animSpeed){\n animTimer = TimerManager.getTime();\n frame++;\n }\n if (frame > 27){\n frame = 27;\n }\n \n switch (state){\n case 1:\n //Fade in\n alpha = 300 - (int)(elapsedTime/3);\n if (alpha <= 0){\n alpha = 0;\n state = 2;\n startTime = TimerManager.getTime();\n }\n break;\n case 2:\n //Wait a bit\n if (elapsedTime > 2000){\n state = 3;\n startTime = TimerManager.getTime();\n }\n break;\n case 3:\n //Fade out\n alpha = (int)(elapsedTime/4);\n if (alpha >= 255){\n alpha = 255;\n state = 4;\n startTime = TimerManager.getTime();\n isDone = true;\n }\n break;\n }\n \n //Display our sprites\n\n Shapes.begin(Renderer.cameraUI);\n Shapes.setColor(255,255,255,255);\n Shapes.drawBox(0,0,(float)Display.getWidth(),(float)Display.getHeight());\n Shapes.end();\n\n Renderer.startUI();\n\n Renderer.setColor(Color.BLACK);\n Text.draw(0,0,\"State: \"+state);\n Renderer.setColor(Color.WHITE);\n\n Renderer.draw(splashTextures[frame % 28].getRegion(),(float) Display.getWidth()/2 - 128, (float)Display.getHeight()/2-128,256,256);\n\n Renderer.endUI();\n\n Shapes.begin(Renderer.cameraUI);\n Shapes.setColor(0,0,0,Math.min(255,alpha));\n Shapes.drawBox(0,0,(float)Display.getWidth(),(float)Display.getHeight());\n Shapes.end();\n\n }\n }",
"@Override\n public void render(float delta) {\n super.render(delta);\n stateTime += delta;\n loadingImage.setDrawable(loadingAnim.getKeyFrame(stateTime,true));\n switch (GameController.getInstance().getCurrentState()) {\n case PLAYING:\n //Game started\n xlpooLsionClient.setScreen(new ControlsScreen(xlpooLsionClient));\n break;\n case SERVER_FULL:\n xlpooLsionClient.setScreen(new ServerFullScreen(xlpooLsionClient));\n break;\n case LOST_CONNECTION:\n xlpooLsionClient.setScreen(new LostConnectionScreen(xlpooLsionClient));\n break;\n }\n }",
"@Override\n\tpublic void render(GameContainer gc, Graphics g) throws SlickException\n\t{\n\t\tswitch(GameMaster.getState()){\n\t\tcase 1:\n\t\t\tgui.drawContent(g);\n\t\t\tbreak;\n\t\tcase 2:\t\t\t\n\t\t\tgui.drawEndScene(g);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tgui.drawStartScene(g);\n\t\t\tbreak;\n\t\t}\n\t}",
"public void render(){\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.screen.renderBackground();\n\t\t\n\t\t\n\t\tfor(int i=0;i<this.obstacles.size();i++){\n\t\t\tobstacles.get(i).render(screen);\n\t\t}\n\t\t\n\t\tthis.screen.renderGround();\n\t\t\n\t\t\n\t\tthis.bird.render(screen);\n\n\t\tscreen.renderLeftLim();\n\t\t\n\t\tfor(int i= 0;i<this.pixels.length;i++){\n\t\t\tthis.pixels[i] = this.screen.getPixel(i);\n\t\t}\n\t\n\n\t\t\n\t\tGraphics g = bs.getDrawGraphics();\n\t\tg.drawImage(image,0,0,getWidth(),getHeight(),null);\n\t\tg.setColor(Color.WHITE);\n\t\tg.setFont(new Font(\"Verdana\",0,30));\n\t\tg.drawString(\"\"+this.numGoals, 300, 60);\n\t\tif(this.gameOver){\n\t\t\tif(this.begin){\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,50));\n\t\t\t\tg.drawString(GAMEOVER_MESSAGE, (WIDTH-300)/2, 200);\n\t\t\t\t\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,20));\n\t\t\t\tg.drawString(\"press down key to restart\", (WIDTH-250)/2, 300);\n\t\t\t\tg.drawString(\"Best score:\"+this.bestScore, (WIDTH-135)/2, 350);\n\t\t\t}else{\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,50));\n\t\t\t\tg.drawString(\"OPEN BIRD\", (WIDTH-270)/2, 200);\n\t\t\t\t\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,20));\n\t\t\t\tg.drawString(\"press down key to start\", (WIDTH-250)/2, 300);\n\t\t\t}\n\t\t}\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"@Override\n\tpublic void render()\n\t{\n\t\tbackground.color().set(grid.backgroundColor());\n\t\tsuper.render();\n\t\tfade.render();\n\t}",
"private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}",
"public void display_game_screen() {\n\n myScreen.screenMode = myScreen.DISPLAY_GAME_SCREEN;\n\n pushMatrix();\n\n calc_screen_translation();\n\n imageMode(CORNER);\n image(backgroundImage, 0, 0);\n\n // draw_grid();\n\n draw_game_assets();\n\n pacman.update(isPacmanUp, isPacmanDown, isPacmanLeft, isPacmanRight);\n ghost.update(isGhostUp, isGhostDown, isGhostLeft, isGhostRight);\n\n pacman.display();\n ghost.display();\n\n score.run(pacman.xTile, pacman.yTile, ghost.xTile, ghost.yTile);\n\n popMatrix();\n }",
"@Override\n public void render(Painter g) {\n g.setColor(Color.rgb(53, 156, 253));\n g.fillRect(0, 0, GameMainActivity.GAME_WIDTH, GameMainActivity.GAME_HEIGHT);\n g.setColor(Color.WHITE);\n g.setFont(Typeface.DEFAULT_BOLD, 50);\n g.drawString(\"The ALL-Time High Score\", 120, 175);\n g.setFont(Typeface.DEFAULT_BOLD, 70);\n g.drawString(\"\"+LoadPlayState.getEXP(), 370, 260);\n g.setFont(Typeface.DEFAULT_BOLD, 50);\n g.drawString(\"Touch the screen\", 220, 350);\n }",
"private void drawGame(){\n drawBackGroundImage();\n drawWalls();\n drawPowerups();\n drawBullet();\n }",
"@Override\r\n\tpublic void render(GameContainer gc, StateBasedGame sbgame, Graphics g)\r\n\t\t\tthrows SlickException {\r\n\t\tbackground.draw(0, 0);\r\n\t\tg.setColor(Color.black);\r\n\t\tg.fillRect(45, 65, 645, 500);\r\n\t\tg.setColor(Color.white);\r\n\t\tg.drawString(\"War Vessels Instructions\", 55, 70);\r\n\t\tg.drawString(\"On the main menu select 'New Game' to start a new game of War Vessels.\", 55, 100);\r\n\t\tg.drawString(\"From this screen you, the player, must strategically place your ships\", 55, 125);\r\n\t\tg.drawString(\"in order to elude your enemies attacks.\", 55, 140);\r\n\t\tg.drawString(\"Once all of your ships have been placed from here you must make a\", 55, 170);\r\n\t\tg.drawString(\"decision. Should you play against a regular opponent or take on the\", 55, 185);\r\n\t\tg.drawString(\"challenge of a smarter one? You make this decision by selecting\", 55, 200);\r\n\t\tg.drawString(\"the start button for either opponent.\", 55, 215);\r\n\t\tg.drawString(\"At this point the game enters the battle phase and you may make\", 55, 245);\r\n\t\tg.drawString(\"your first move by slecting a space to attack on the radar screen,\", 55, 260);\r\n\t\tg.drawString(\"the grid on the right. The game will respond with a hit or a miss\", 55, 275);\r\n\t\tg.drawString(\"for each space and your opponent will then take a shot at your ships.\", 55, 290);\r\n\t\tg.drawString(\"As the game progresses ships will be hit, once the ship is sunk\", 55, 320);\r\n\t\tg.drawString(\"it will be marked in the tray with a large red X\", 55, 335);\r\n\t\tg.drawString(\"The game continues until either you or your opponent has\", 55, 350);\r\n\t\tg.drawString(\"destroyed all of the opposing ships.\", 55, 365);\r\n\t\tg.drawString(\"Once the game is over the opposing player's grid will be shown\", 55, 395);\r\n\t\tg.drawString(\"and statistics will be displayed. You may then go back to the\", 55, 410);\r\n\t\tg.drawString(\"main menu and play another game.\", 55, 425);\r\n\t\tmainMenuButton.draw(MENUX, MENUY);\r\n\t\t\r\n\t}",
"@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(0.8f, 0.3f, 0.3f, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n bgViewPort.apply();\n batch.setProjectionMatrix(bgViewPort.getCamera().combined);\n batch.begin();\n batch.draw(background,0,0);\n batch.end();\n\n stage.getViewport().apply();\n stage.draw();\n }",
"public void run (){\n\t\t\t\t\t\t\t\t\tgame.setScreen(game.ui);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}",
"@Override\n protected void paintBackground(Graphics2D g) {\n super.paintBackground(g);\n if (Game.level == 0) {\n g.drawImage(bg, 0, 0, this);\n } else if (Game.level == 1) {\n g.drawImage(bg, 0, 0, this);\n } else if (Game.level == 2) {\n g.drawImage(bg2, 0, 0, this);\n } else if (Game.level == 3) {\n g.drawImage(bg3, 0, 0, this);\n }\n\n }",
"private void settingsScreenRender() {\n overlay.draw(batch, 0.5f);\n uiFont.draw(batch, scoreTxt, 0, HEIGHT - (scoreLayout.height));\n uiFont.draw(batch, healthTxt, WIDTH / 2, HEIGHT - (healthLayout.height));\n musicOn.draw(batch, 1);\n musicOff.draw(batch, 1);\n resume.draw(batch, 1);\n settingStage.draw();\n }",
"public void render()\n\t{\n\t\t//double buffering is cool\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(2);\n\t\t\tbs = getBufferStrategy();\n\t\t}\n\t\t\t\n\t\tGraphics2D g2 = (Graphics2D)bs.getDrawGraphics();\n\t\n\t\t\n\t\t\n\t\tif (true)\t\n\t\t{\n\t\t\tif (level != 0)\n\t\t\t{\n\t\t\t\tg2.setColor(Color.black);\n\t\t\t\tg2.fillRect(0, 0, width, height);\t\t\t\n\t\t\t}\n\t\t\tgameObjectHandler.render(g2,false);\n\t\t}\n\t\tif(currTransition != null)\n\t\t{\n\t\t\tcurrTransition.render(g2);\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tbs.show();\n\t\tg2.dispose();\n\t\n\t}",
"public void render(Graphics g) {\n\t\t// Tile the background image\n\t\tfor (int i = 0; i < App.SCREEN_WIDTH; i += background.getWidth()) {\n\t\t\tfor (int j = -background.getHeight() + (int)backgroundOffset; j < App.SCREEN_HEIGHT; j += background.getHeight()) {\n\t\t\t\tbackground.draw(i, j);\n\t\t\t}\n\t\t}\n\t\t// Draw all sprites\n\t\tfor (Sprite sprite : sprites) {\n\t\t\tsprite.render();\n\t\t}\n\t\tg.drawString(\"Score: \" + score, 20, App.SCREEN_HEIGHT - 30);\n\t\tfor (int i = 1; i <= lives; ++i) {\n\t\t\tlivesImage.draw(20 + 40 * (i - 1), App.SCREEN_HEIGHT - 72);\n\t\t}\n\t}",
"public void render () \n\t{ \n\t\trenderWorld(batch);\n\t\trenderGui(batch);\n\t}",
"public void displayCurrentState(State game);",
"void onRenderBackground(RenderArguments arguments);",
"@Override\n\tpublic void render() {\n\t\tGdx.gl.glClearColor(0, 0, 0, 0);\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\tworld.step(1f / 60f, 6, 2);\n\n\t\tgame.act();\n\t\tgame.render();\n\n\t}",
"@Override\n\tpublic void render () {\n\t\tGdx.gl.glClearColor(1, 0, 0, 1);\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\tbatch.begin();\n\t\tif (gameOver) {\n\t\t\tbatch.draw(textureGameOver, 0, 0);\n\t\t\tbatch.draw(textureRematch, (WIDTH/2) - (textureRematch.getWidth()/2), 128);\n\n\t\t\tif (player1.character.getHitPoints() <= 0)\n\t\t\t{\n\t\t\t\tbatch.draw(texture2wins, (WIDTH/2) - (texture2wins.getWidth()/2), 416);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbatch.draw(texture1wins,(WIDTH/2) - (texture1wins.getWidth()/2),416);\n\t\t\t}\n\t\t\tbatch.end();\n\n\t\t\tKeyboard masterKey = new Keyboard();\n\t\t\tif (masterKey.isEnterPressed())\n\t\t\t{\n\t\t\t\tgameOver = false;\n\t\t\t\tcreate();\n\t\t\t}\n\t\t}\n\t\t\t/*\n\t\t\tString str;\n\t\t\tif (player1.character.getHitPoints() <= 0)\n\t\t\t\tstr = \"Two\";\n\t\t\telse\n\t\t\t\tstr = \"One\";\n\t\t\tswitch (PopUpQuestion.TwoOptions(null, \"Play again!\", \"Exit\", \"Player \" + str + \" Wins!\", \" \"))\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\tdispose();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tdispose();*/\n\t\telse if (!paused) {\n\t\t\tdrawRefresh();\n\t\t\tball.render();\n\t\t\tplayer1.render();\n\t\t\tplayer2.render();\n\t\t\tcheckForHits();\n\t\t}\n\t\telse// if (paused)\n\t\t{\n\t\t\tbatch.draw(backgroundImage, 0, 0);\n\t\t\tbatch.draw(textureShade, 0, 0);\n\t\t\tbatch.draw(texturePause, (WIDTH / 2) - (texturePause.getWidth() / 2), (HEIGHT / 2) - (texturePause.getHeight() / 2) + 50);\n\t\t\tbatch.draw(textureControls, 0, 0);\n\t\t\tbatch.end();\n\t\t\tif (player1.doUnpause() || player2.doUnpause())\n\t\t\t\tpause(false);\n\t\t}\n\t}",
"private void render() {\n\t\t// clear the screen and depth buffer\n\t\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\t\t\n\t\t// draws the background\n\t\tdrawScreen(sprite.get(\"background\"));\n\t\t\n\t\t// drawing player\n\t\tif (!stopDrawingPlayer)\n\t\t\tdrawEntity(player);\n\t\t// drawing bullets\n\t\tdrawListEntity(bullet);\n\t\t// drawing enemy bullets\n\t\tdrawListEntity(enemy_bullet);\n\t\t// drawing enemies\n\t\tdrawListEntity(enemy);\n\t\t// drawing powerups\n\t\tdrawListEntity(powerup);\n\t\t// drawing explosions\n\t\tdrawListEntity(explosion);\n\t\t\n\t\t// draw health\n\t\tdefaultFont.drawString(10, 10, \"Health: \" + player.getHP() + \"/1000\");\n\t\t// draw cash\n\t\tdefaultFont.drawString(10, 40, \"Cash: $\" + cash);\n\t\t// draw shop prompt\n\t\tdefaultFont.drawString(displayWidth - 280, displayHeight - 40, \"Press F to enter shop\");\n\t\t\n\t\tif (stopDrawingPlayer) {\n\t\t\t// draw Game Over\n\t\t\tgameOverFont.drawString(displayWidth / 2 - gameOverFont.getWidth(\"Game Over!\") / 2, displayHeight\n\t\t\t\t\t/ 2 - gameOverFont.getHeight(\"Game Over!\") / 2 - 50, \"Game Over!\");\n\t\t\t\n\t\t\t// draw the score\n\t\t\tscoreFont.drawString(displayWidth / 2 - scoreFont.getWidth(\"Score: \" + totalCash) / 2, displayHeight\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Game Over!\")\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Score: \" + totalCash)\n\t\t\t\t\t/ 2 + 10 - 50, \"Score: \" + totalCash);\n\t\t}\n\t}",
"@Override\n\tpublic void render(GameContainer container, StateBasedGame game, Graphics g)\n\t\t\tthrows SlickException {\n\t\tbackground.draw(0, 0, container.getWidth(), container.getHeight());\n\t\tg.drawString(\"Appuyer sur une touche\", 300, 300);\n\t}",
"public void gameLoop() {\n Gdx.gl.glClearColor(Constants.BACKGROUND_COLOR_R,\n Constants.BACKGROUND_COLOR_G,\n Constants.BACKGROUND_COLOR_B,\n 1.0f);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n this.moveToken();\n\n this.mStage.draw();\n }",
"@Override\r\n\tpublic void render(float delta) {\n\t\tif(game.getScreen().getClass().getName().equals(\"by.aleks.christmasboard.screens.SplashScreen\")){\r\n\t\t\tGdx.gl.glClearColor(0f, 0f, 0f, 1);\r\n\t\t} else Gdx.gl.glClearColor(BACKGROUND_COLOR.r, BACKGROUND_COLOR.g, BACKGROUND_COLOR.b, BACKGROUND_COLOR.a);\r\n\t\t\r\n\t\tGdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r\n\r\n\t\tstage.act(delta);\r\n\t\tstage.draw();\r\n\t}",
"@Override\n public void render() {\n if (!gameOver && !youWin) this.update();\n\n //Dibujamos\n this.draw();\n }",
"public void render(){\n\t\tstage.act();\n\t\tstage.draw();\n\t}",
"@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(0f, 0f, 0f, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n // tell our stage to do actions and draw itself\n stage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f));\n\n stage.getBatch().begin();\n backSprite.draw(stage.getBatch());\n stage.getBatch().end();\n\n stage.draw();\n\n\n }",
"@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(0,0,0,1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n batch.begin();\n background.draw(batch);\n batch.end();\n\n renderer.setView(camera);\n renderer.render();\n\n }",
"@Override\n public void render(float delta) {\n update();\n\n Gdx.gl.glClearColor(0, 0, 0, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n //Idk what this does still\n //camera.update();\n //Supposedly makes it so that any quality screen works\n game.batch.setProjectionMatrix(camera.combined);\n\n\n game.batch.begin();\n //menuBackground.render();\n game.font.draw(game.batch, \"Escape Room\", MyGdxGame.SCREEN_WIDTH/2 - 350/2, MyGdxGame.SCREEN_HEIGHT-250);\n game.batch.end();\n //Renders HUD\n menuHUD.stage.draw();\n }",
"@Override\n public void render(float v) {\n game.batch.begin();\n game.batch.draw(game.backgroundImg,0,0,viewport.getWorldWidth(), viewport.getWorldHeight());\n game.batch.end();\n\n stage.act();\n stage.draw();\n\n }",
"@Override\n\tpublic void update() {\n\t\tticks++;\n\t\tswitch (state) {\n\t\tcase MENU:\n\t\tcase INTRO:\n\t\t\tupdateBackground();\n\t\t\tbreak;\n\n\t\tcase PLAYING:\n\t\t\tbreak;\n\t\tcase GAMEOVER:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\n\t\t}\n\n\t\tWorld.update();\n\t\tScreen.update();\n\n\t}",
"public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"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(Graphics g){\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawImage(dBackground,0, 0, GameSystem.ABSWIDTH+10, GameSystem.ABSHEIGHT+10,null);\n\t\tg.setFont(new Font(\"arial\",Font.BOLD,45));\n\t\tg.setColor(Color.BLACK);\n\t\tg.drawImage(dText, GameSystem.ABSWIDTH-GameSystem.ABSWIDTH/3-110, 100,null);\n\t\tg.setFont(new Font(\"arial\",Font.ITALIC,30));\n\t\tg.drawString(\"Restart Level\",GameSystem.ABSWIDTH/2+100,300);\n\t\tg.drawString(\"Back to Menu\",GameSystem.ABSWIDTH/2+100,400);\n\t\trenderSelected(g);\n\t}",
"@Override\r\n\tpublic void render(float delta) {\n\t\tGdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1);\r\n\t\tGdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r\n\r\n\t\tif(!affSideMenu.isPaused()){\r\n\t\t\tcontrol.update(delta);\r\n\t\t\t\r\n\t\t\ttirs.update(delta);\r\n\t\t\tepee.update(delta);\r\n\t\t\tanimaux.update(delta);\r\n\t\t}\r\n\t\taffMonde.render();\r\n\t\taffSideMenu.render();\r\n\t}",
"@Override\n\tpublic void render () {\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);\n\n\t\tvalidarPontos();\n\t\tverificarEstadoJogo();\n\t\tdesenharTexturas();\n\t\tdetectarColisoes();\n\n\t}",
"@Override\n\tpublic void render(float delta) {\n\t\tbatch.begin();\n\t\tif(tutorial1){\n\t\t\tGdx.gl.glClearColor(0, 0, 0, 0);\n\t\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\t\tfont.setColor(Color.WHITE);\n\t\t\tfont.setScale(1,1);\n\t\t\tbatch.draw(tut1,0,0, screenWidth, screenHeight);\n\t\t\tfont.draw(batch, \"Press, 'ESC' to return to menu\", 0f, screenHeight);\t\t\n\t\t} \n\t\telse if(tutorial2){\n//\t\t\tGdx.gl.glClearColor(0, 0, 0, 0);\n//\t\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n//\t\t\tfont.setColor(Color.WHITE);\n//\t\t\tfont.setScale(1,1);\n\t\t\tbatch.draw(tut2,0,0, screenWidth, screenHeight);\n\t\t\tfont.draw(batch, \"Press, 'ESC' to return to menu\", 0f, screenHeight);\t\t\n\t\t} \n\t\telse if((!win) && !tutorial1 && !tutorial2){\n\t\t\tstage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 60f));\n\t\t\tGdx.gl.glClearColor(1, 1, 1, 1);\n\t\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\t\tbatch.draw(background, 0, 0, screenWidth, screenHeight);\n\t\t\t\n//\t\t\tDrawing and Game Maintenance, while game is being played\n\t\t\tupdatePlayerXPos();\n\t\t\tupdateAngle();\t\n\t\t\tdrawEssentialComponents();\n\t\t\tdrawAngleInfo();\n\t\t\tif(ballShoot){\n\t\t\t\tsetBallInitial();\n\t\t\t\tactiveBall = true;\n\t\t\t\tballCount = 1;\n\t\t\t}\n\t\t\tif(activeBall){\n\t\t\t\tballManagement();\n\t\t\t\tballBoxCollision();\t\n\t\t\t\twin = areAllAnswersCollect();\n\t\t\t}\n\t\t} else {\n\t\t\tGdx.gl.glClearColor(0, 0, 0, 0);\n\t\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\t\tfont.setColor(Color.WHITE);\n\t\t\tfont.draw(batch,\"You got the correct answer\", (screenWidth / 2), (screenHeight / 2) );\n\t\t\tif(!isEndTime){\n\t\t\t\tendTime = System.currentTimeMillis();\n\t\t\t\tisEndTime = true;\n\t\t\t}\n\t\t\tif(displayTimeCount){\n//\t\t\t\tSystem.out.println(\"The time to complete the level is \" + duration(startTime,endTime) + \" seconds.\" );\n\t\t\t\tdisplayTimeCount = false;\n\t\t\t}\n\t\t\tif(moveDistanceCount){\n//\t\t\t\tSystem.out.println(\"The distance traveled is \" + moveDistance);\n\t\t\t\tmoveDistanceCount = false;\n\t\t\t}\n\t\t\tif(guessCounter){\n//\t\t\tSystem.out.println(\"The number of incorrect guesses is \" + incorrectGuesses);\n\t\t\tguessCounter = false;\n\t\t\t}\n\t\t\t\n\t\t\t\n//\t\t\tSystem.out.println(\"The start time is \" + startTime);\n//\t\t\tSystem.out.println(\"The end time is \" + endTime);\n\t\t\t\n/*\n * Next lines are for end of level and passing certain parameters to the score class\n */\n\t\t\tint duration = duration(startTime,endTime);\n\t\t\t\n//\t\t\tScore score = new Score(game, right, incorrectGuesses,duration, moveDistance);\n//\t\t\tScore score = new Score(game,correctA.size(), incorrectGuesses, duration(startTime, endTime),moveDistance);\n//\t\t\tscore.create();\n//\t\t\tgame.current = new Score(game,correctA.size(), incorrectGuesses, duration(startTime, endTime),moveDistance);\n//\t\t\t((Score) current).create();\n//\t\t\tgame.setting = current;\n\t\t\t\n\t\t\tinitializeScoringVariables();\n\t\t\t\n\t\t\tgame.switchScreens(8);\n\t\t}\n\t\tbatch.end();\n\t\t\n\t}",
"public void preGameMode(){\n\n ImageIcon icon = new ImageIcon(getClass().getResource(\"/title.jpg\"));\n Image image=icon.getImage();\n background = new PBackground(image);\n this.repaint();\n background.setLayout(null);\n this.add(background);\n\n\n // Prepare the body container\n container = new PanelContainer();\n container.setBounds(230,170, 700, 400);\n background.add(container);\n\n this.setVisible(true);\n }",
"@Override\n public void run(){\n Initialize();\n // Load game files (images, sounds, ...)\n LoadContent();\n \n Framework.gameState = Framework.GameState.PLAYING;\n }",
"@Override\n public void run(){\n Initialize();\n // Load game files (images, sounds, ...)\n LoadContent();\n \n Framework.gameState = Framework.GameState.PLAYING;\n }",
"public void updateScene() {\n\t\tthis.background.draw();\n\t\tthis.errorScene.draw();\n\t}",
"@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(0.4f, 0.737f, 0.929f, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n checkForBack();\n\n stage.act();\n stage.draw();\n }",
"public void render(Graphics2D g){\n if(game.gameState == Game.AppState.MENU){\n Font fnt0 = new Font(\"Serif\", Font.BOLD,45);\n Font fnt1 = new Font(\"Serif\", Font.BOLD,25);\n\n g.setFont(fnt0);\n g.setColor(Color.BLACK);\n g.drawString(\"DYNA BLASTER\", 122, 100);\n\n g.setFont(fnt1);\n g.fillRect(190,200,220,54);\n g.setColor(Color.cyan);\n g.drawString(\"PLAY\", 268, 235);\n\n g.setColor(Color.BLACK);\n g.fillRect(190,300,220,54);\n g.setColor(Color.cyan);\n g.drawString(\"BEST RESULTS\", 205, 335);\n\n g.setColor(Color.BLACK);\n g.fillRect(190,400,220,54);\n g.setColor(Color.cyan);\n g.drawString(\"HELP\", 268, 435);\n\n g.setColor(Color.BLACK);\n g.fillRect(190,500,220,54);\n g.setColor(Color.cyan);\n g.drawString(\"EXIT\", 272, 535);\n }\n else if(game.gameState == Game.AppState.RESULTS){\n Font fnt0 = new Font(\"Serif\", Font.BOLD, 35);\n Font fnt1 = new Font(\"Serif\", Font.BOLD, 25);\n Font fnt2 = new Font(\"Serif\", Font.BOLD, 20);\n\n g.setFont(fnt0);\n g.setColor(Color.BLACK);\n g.drawString(\"LIST\", 255, 80);\n g.setFont(fnt2);\n g.drawString(\"Place Nick Score\", 70, 120);\n for(int i=0;i<10;i++) {\n g.drawString(i+1+\" \"+handler.scores.getScores(i), 90, 150+30*i);\n }\n g.setFont(fnt1);\n g.setColor(Color.BLACK);\n g.fillRect(190,500,220,54);\n g.setColor(Color.cyan);\n g.drawString(\"BACK\", 265, 535);\n }\n else if(game.gameState == Game.AppState.HELP){\n Font fnt0 = new Font(\"Serif\", Font.BOLD, 35);\n Font fnt1 = new Font(\"Serif\", Font.BOLD, 25);\n Font fnt2 = new Font(\"Serif\", Font.BOLD, 20);\n Font fnt3 = new Font(\"Serif\", Font.PLAIN, 16);\n\n g.setFont(fnt0);\n g.setColor(Color.BLACK);\n g.drawString(\"HELP\", 255, 100);\n String []command=helpconfig.gethelpstring();\n g.setFont(fnt2);\n g.drawString(command[0], 70, 150);\n g.setFont(fnt3);\n g.drawString(command[1], 70, 170);\n g.drawString(command[2], 70, 190);\n g.setFont(fnt2);\n g.drawString(command[3], 70, 230);\n g.setFont(fnt3);\n for(int i=4;i<helpconfig.get_length_of_commands();i++) {\n g.drawString(command[i], 70, 250+(i-4)*20);\n\n }\n g.setFont(fnt1);\n g.setColor(Color.BLACK);\n g.fillRect(190,500,220,54);\n g.setColor(Color.cyan);\n g.drawString(\"BACK\", 265, 535);\n }\n }",
"@Override\n\tpublic void run() {\n\t\tgameImpl.render();\n\t\tgameImpl.update();\n\t}",
"@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 public void render() {\n sortEntities(Entity.getEntities());\n renderBackground();\n renderBattleState();\n if(selectedPc != null){\n MyGL2dRenderer.drawLabel(getSelectedPc().getCollisionBox().left - 4 * GameView.density() + cameraX,\n getSelectedPc().getCollisionBox().bottom - getSelectedPc().getCollisionBox().width() / 5 + cameraY,\n getSelectedPc().getCollisionBox().width() + 8 * GameView.density(),\n getSelectedPc().getCollisionBox().width() * 2 / 5,\n TextureData.selected_character_visual, 255);\n }\n if(!win){\n renderSpells();\n renderGold();\n }\n }",
"public void render(Graphics2D g, GameState state) {\n if(!active)\n if(Math.abs(state.locX - (locX + state.xTransfer)) <200 && Math.abs(state.locY - (locY + state.yTransfer)) < 200) {\n Sound sound1 = new Sound(\"./Sounds/mine.wav\" , 0);\n sound1.doInBackground();\n active = true;\n }\n if(active)\n g.drawImage(mineImage, locX + state.xTransfer , locY + state.yTransfer ,null );\n }",
"private void drawBackground(Graphics g){\r\n g.setColor(Colors.ColorAlpha(Colors.blacks,a1));\r\n g.fillRect(0,0,w,h);\r\n if(moving){\r\n g.drawImage(Assets.burst.get((int)((game.counter%8)*0.625)),(int)(w*0.472),(int)(h*0.455),null);\r\n g.drawImage(Assets.sparks.get(((game.counter%20)/2)),(int)(w*0.465),(int)(h*0.345),null);\r\n }\r\n drawWires(g);\r\n }",
"protected void drawGUI() {\n batch.draw(background, 0, 0);\n }",
"@Override\r\n public void render(){\r\n\r\n Gdx.gl.glClearColor(1,1,1,1);\r\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\r\n stage.act(Gdx.graphics.getDeltaTime());\r\n stage.draw();\r\n }",
"private void render() {\n\t\tBufferStrategy bufferStrategy = getBufferStrategy(); //Create BufferStrategy object\n\n\t\t//If the Buffer Strategy doesn't exist, create one\n\t\tif(bufferStrategy == null) {\n\t\t\tcreateBufferStrategy(3); //Triple buffer\n\t\t\treturn; //Return\n\t\t}\n\n\t\tGraphics g = bufferStrategy.getDrawGraphics(); //Create Graphics object\n\t\tg.setColor(Color.black); //Set the colour of the object to black\n\t\tg.fillRect(0, 0, Game.WIDTH, Game.HEIGHT); //Fill the window\n\n\t\t//Start screen\n\t\tif(!startScreen.start && !player.dead && !player.win) {\n\t\t\tstartScreen.render(g); //Render the start screen\n\t\t\t//If the user presses enter\n\t\t\tif(enter) {\n\t\t\t\tstartScreen.start = true; //Game has started\n\t\t\t}\n\t\t}\n\n\t\t//Playing screen\n\t\tif(!player.dead && !player.win && startScreen.start) {\n\t\t\tlevel.render(g); //Render the level\n\t\t\tplayer.render(g); //Render the player to the graphics object\n\t\t\thp(g); //Render the hit points\n\t\t\tif(paused) {\n\t\t\t\tpauseScreen.render(g);\n\t\t\t}\n\t\t}\n\n\t\t//Dead screen\n\t\tif(player.dead){\n\t\t\tdeadScreen.render(g); //Render the dead screen\n\t\t}\n\n\t\t//Win screen\n\t\tif(player.win) {\n\t\t\twinScreen.render(g); //Render the win screen\n\t\t}\n\t\tg.dispose(); //Dispose of the object\n\t\tbufferStrategy.show(); //Show it\n\t}",
"public void enter(GameContainer container, StateBasedGame game) {\n\n\n\t\ttry {\n\t\t\tpause_menu_background = new Image(container.getWidth(),\n\t\t\t\t\tcontainer.getHeight());\n\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tGraphics g = container.getGraphics();\n\t\t/** Don't continue prints the FPS counter*/\n\t\tcontainer.setShowFPS(false);\n\t\tg.copyArea(pause_menu_background, 0, 0);\t\t\n\t}",
"@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}",
"private void renderMenu() {\n StdDraw.setCanvasSize(START_WIDTH * TILE_SIZE, START_HEIGHT * TILE_SIZE);\n Font font = new Font(\"Monaco\", Font.BOLD, 20);\n StdDraw.setFont(font);\n StdDraw.setXscale(0, START_WIDTH );\n StdDraw.setYscale(0, START_HEIGHT );\n StdDraw.clear(Color.BLACK);\n StdDraw.setPenColor(Color.WHITE);\n StdDraw.enableDoubleBuffering();\n StdDraw.text(START_WIDTH / 2, START_HEIGHT * 2 / 3, \"CS61B The Game\");\n StdDraw.text(START_WIDTH / 2, START_HEIGHT / 2 + 2, \"New Game (N)\");\n StdDraw.text(START_WIDTH / 2, START_HEIGHT / 2, \"Load Game (L)\");\n StdDraw.text(START_WIDTH / 2, START_HEIGHT / 2 - 2 , \"Quit (Q)\");\n StdDraw.show();\n }",
"public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }",
"@Override\n\tpublic void render(float delta) \n\t{\n\t\tif (state_Game==GAME_READY) \n\t\t{\n\t\t\t/*Si esta en Ready Decrementa el tiempo hasta que el tiempo se igual a 0*/\n\t\t\ttiempo=60-(int) (stateTime/2);\n\t\t\tif(tiempo==0)\n\t\t\t{\n\t\t\t\t/*Si es igual a 0 entonces muestra la pantalla de gameover*/\n\t\t\t\tSettings.addScore(Score.getScore());\n\t\t\t\tgame.setScreen(new PantallaGameOver(game));\n\t\t\t}\n\t\t\tupdate(delta);\n\t\t}\n\t\tif (state_Game==GAME_PAUSED) \n\t\t{\n\t\t\t/*Si el estado del juego es Pausa muestra la ventana de Pausa*/\n\t\t\tpauseGame(delta);\n\t\t}\n\t\t\n\t}",
"@Override\n\tpublic void render(float delta) {\n\t\tupdate(delta);\n\n\t\t//Clear the game screen with Black\n\t\tGdx.gl.glClearColor(0, 0, 0, 1);\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n\t\t//render our game map\n\t\trenderer.render();\n\n\t\t//renderer our Box2DDebugLines\n\t\t//b2dr.render(world, gamecam.combined);\n\t\tbatch.setProjectionMatrix(gamecam.combined);\n\t\tbatch.begin();\n\t\tfor (Enemy enemy : creator.getEnemies())\n\t\t\tenemy.draw(batch);\n\t\tbatch.end();\n\t\trHandler.render();\n\t\tbatch.begin();\n\t\tfor (Souls soul : creator.getSouls())\n\t\t\tsoul.draw(batch);\n\t\tplayer.draw(batch);\n\t\t//Assets.instance.fonts.gameTime.draw(batch, \"Hello World\", 200, 200);\n\t\tbatch.end();\n\n\t\t//Set our batch to now draw what the Hud camera sees.\n\t\tbatch.setProjectionMatrix(hud.stage.getCamera().combined);\n\t\thud.stage.draw();\n\n\t\tif(gameOver()){\n\t\t\tgame.setScreen(new GameOverScreen(game));\n\t\t\tdispose();\n\t\t}\n\n\t}",
"@Override\n\tpublic void render(float delta) {\n\t\tGdx.gl.glClearColor(0, 0, 0.2f, 1);\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\tGdx.gl.glEnable(GL20.GL_TEXTURE_2D);\n\n\t\tcamera.update();\n\t\tgame.batch.setProjectionMatrix(camera.combined);\n\n\t\tgame.batch.begin();\n\t\tgame.batch.draw(Assets.menuBackground, 0, 0);\n\t\tgame.batch.draw(Assets.exitRegion, 80, 34, 150, 150);\n\t\tgame.batch.draw(Assets.settingsRegion, 80, 194, 150, 150);\n\t\tgame.batch.draw(Assets.storeRegion, 80, 344, 150, 150);\n\t\tgame.batch.draw(Assets.playRegion, 80, 494, 150, 150);\n\t\tgame.batch.end();\n\n\n\t\tif (Gdx.input.isKeyJustPressed(Input.Keys.BACK)) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tif(Gdx.input.justTouched()) {\n\t\t\tcamera.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(),\n\t\t\t\t\t0));\n\t\t\tif(OverlapTester.pointInRectangle(playBounds, touchPoint.x,touchPoint.y))\n\t\t\t\ttry {\n\t\t\t\t\tgame.setScreen(new GameScreen(game));\n\t\t\t\t} catch (OutOfBoundingException 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\tthis.dispose();\n\t\t\t\n\t\t\tif(OverlapTester.pointInRectangle(exitBounds, touchPoint.x, touchPoint.y)){\n\t\t\t\tSystem.exit(0);\n\t\t\t\tthis.dispose();\n\t\t\t\t}\t\n\t\t\t\n\t\t\tif(OverlapTester.pointInRectangle(storeBounds, touchPoint.x, touchPoint.y)){\n\t\t\t\t//game.setScreen(new StoreScreen(game, camera, player)); //Because it doesn't work how it must!\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}\n\n\t}",
"private void updateAndRender(long deltaMillis) {\n currentState.update(deltaMillis / 1000f); \r\n //Double Buffering (reduce tearing)\r\n prepareGameImage();\r\n currentState.render(gameImage.getGraphics(), this.getWidth(), this.getHeight());\r\n renderGameImage(getGraphics());\r\n }",
"@Override\r\n\tpublic void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {\n\t\tg.setColor(Color.white);\r\n\t\tg.drawString(\"Play the Game\", 450, 170);\r\n\t\tg.drawString(\"Playground\", 450, 220);\r\n\t\tg.drawString(\"License: MIT\", 780, 450);\r\n\t\tg.drawString(\"Back\", 30, 430);\r\n\t}",
"@Override\n\tpublic void LoadContent()\n\t{\n\t\tspriteBatch = new SpriteBatch(getGraphicsDevice());\n\t\t\n\t\tbackground = Texture2D.FromStream(getGraphicsDevice(), TitleContainer.OpenStream(\"test.png\"));\n\t\t\n\t\t//background = Content.Load(\"test.png\");\n\t\t\n\t\t// TODO: use this.Content to load your game content here\n\t}",
"public void paintComponent(Graphics g) {\n \n \n \t\tsuper.paintComponent(g);\n \n \n \t\t// The background.\n \t\tg.drawImage(sprites.get(\"grass\"), 0, 0, getWidth(), getHeight(), null);\n \n \t\tif (isOver) {\n \t\t\tdrawGameOverScreen(g);\n \t\t\treturn;\n \t\t}\n \n \t\tif (!isStarted) {\n \t\t\tdrawTitleScreen(g);\n \t\t}\n \n \t\tsynchronized (lock) {\n \t\t\tfor (GameObject h : objects) {\n \t\t\t\tPoint2D.Double p = h.getPosition();\n \t\t\t\tBufferedImage s;\n \t\t\t\tif ((s = sprites.get(h.getSprite())) != null) {\n \t\t\t\t\tg.drawImage(sprites.get(h.getSprite()), (int) p.x, (int) p.y, null);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t}",
"protected void paint(Graphics g) {\n\n switch (gameStatus) {\n\t case notInitialized: {\n\t gBuffer.setColor(0xffffff);gBuffer.fillRect(0, 0, scrwidth,scrheight);\n\t\t gBuffer.setColor(0x00000); // drawin' flyin' text\n\t\t\t Font f = Font.getDefaultFont();\n\t\t\t gBuffer.setFont(Font.getFont(Font.FACE_MONOSPACE, Font.STYLE_BOLD, Font.SIZE_SMALL));\n\t gBuffer.drawString(loadString/*\"Loading ...[\"+LoadingNow+\"/\"+LoadingTotal+\"]\"*/ ,scrwidth>>1, (scrheight>>1)-13,Graphics.TOP|Graphics.HCENTER);\n//\t gBuffer.drawString(\"Loading ...[\"+Runtime.getRuntime().freeMemory()+\"/\"+Runtime.getRuntime().totalMemory()+\"]\" ,scrwidth>>1, (scrheight>>1)-14,Graphics.TOP|Graphics.HCENTER);\n\t gBuffer.drawRect((scrwidth-40)>>1,((scrheight-15)>>1)+10, 40,6);\n\t gBuffer.fillRect((scrwidth-40)>>1,((scrheight-15)>>1)+10, 40*LoadingNow/Math.max(1,LoadingTotal),6);\n\t\t\t gBuffer.setFont(f);\n\t\t g.drawImage(Buffer,0,0,Graphics.TOP|Graphics.LEFT);\n\n\t } break;\n\n case titleStatus : g.setColor(0xffffff);g.fillRect(0, 0, scrwidth,scrheight);\n\t g.drawImage(Title,scrwidth>>1,scrheight>>1,Graphics.HCENTER|Graphics.VCENTER);\n\t\t\t g.drawImage(MenuIcon,scrwidth-2,scrheight-1, Graphics.BOTTOM|Graphics.RIGHT);\n\t\t\t break;\n\n\t case Finished: //if (LostWon == null) LostWon = pngresource.getImage(pngresource.IMG_WON);\n\t case gameOver: //if (LostWon == null) LostWon = pngresource.getImage(pngresource.IMG_LOST);\n\t\t\t if (ticks>FINAL_PICTURE_OBSERVING_TIME) {\n\t\t\t\tg.setColor(0xffffff);g.fillRect(0, 0, scrwidth,scrheight);\n\t\t\t\tg.setColor(0x00000); // drawin' flyin' text\n\t\t\t Font f = Font.getDefaultFont();\n\t\t\t g.setFont(Font.getFont(Font.FACE_PROPORTIONAL , Font.STYLE_BOLD, Font.SIZE_SMALL));\n\t\t\t\tg.drawString(YourScore+client_sb.getGameStateRecord().getPlayerScores() ,scrwidth>>1, scrheight>>1,Graphics.TOP|Graphics.HCENTER);\n \t } else {\n\t\t \tg.setColor(0xffffff);g.fillRect(0, 0, scrwidth,scrheight);\n\t \tg.drawImage((gameStatus==gameOver?Lost:Won),scrwidth>>1,scrheight>>1,Graphics.HCENTER|Graphics.VCENTER);\n\t \tg.drawImage(MenuIcon,scrwidth-2,scrheight-1, Graphics.BOTTOM|Graphics.RIGHT);\n\t\t\t } break;\n\n\t //case demoPlay:\n default : if (this.isDoubleBuffered())\n\t\t\t {\n\t\t DoubleBuffer(g);\n\t\t\t }\n\t\t\t else {\n\t\t DoubleBuffer(gBuffer);\n\t\t g.drawImage(Buffer,0,0,Graphics.TOP|Graphics.LEFT); break;\n\t\t\t }\n\t\t\t g.drawImage(MenuIcon,scrwidth-2,scrheight-1, Graphics.BOTTOM|Graphics.RIGHT);\n }\n }",
"public void render(Graphics g) {\n if (showTutorial) {\n g.drawImage(Assets.level1tutorial, 0, 0, getGame().getWidth(), getGame().getHeight(), null);\n backButton.render(g);\n } else {\n g.drawImage(Assets.menuBackground, 0, 0, getGame().getWidth(), getGame().getHeight(), null);\n startButton.render(g);\n highscoreButton.render(g);\n tutorialButton.render(g);\n g.drawImage(titleAnimation.getCurrentFrame(), 30,70, 550, 120, null);\n }\n }",
"private void render() {\n\n\tbs=display.getCanvas().getBufferStrategy();\t\n\t\n\tif(bs==null) \n\t {\t\n\t\tdisplay.getCanvas().createBufferStrategy(3);\n\t\treturn ;\n\t }\n\t\n\tg=bs.getDrawGraphics();\n\n\t//Clear Screen\n\tg.clearRect(0, 0, width, height);\n\t\n\tif(State.getState()!=null )\n\t\tState.getState().render(g);\n\t\n\t//End Drawing!\n\tbs.show();\n\tg.dispose();\n\t\n\t}",
"@Override\n public void render(float delta) {\n // Faire clignoter le texte\n if (frame_count == 0) {\n sign = 1;\n } else if (frame_count == 60) {\n sign = -1;\n }\n frame_count += sign;\n layout.setText(font, \"Appuyez sur une touche pour commencer !\", new Color(1f, 1f, 1f, frame_count / 60f), layout.width, 0, false);\n\n batch.begin();\n // J'affiche le background\n batch.draw(background, 0, 0, background_width, background_height);\n //batch.end();\n\n // J'affiche soit le texte d'accueil, soit les boutons\n if (!triggered) {\n // J'affiche le texte centré\n font.draw(batch, layout, background_width * 0.5f - layout.width * 0.5f, 100);\n batch.end();\n }\n else {\n batch.end();\n // J'affiche la table de boutons\n //stage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f));\n stage.draw();\n\n }\n\n }",
"@Override\r\n\tpublic void render(){\n\t\tGdx.gl.glClearColor( 0f, 1f, 0f, 1f );\r\n\t\tGdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );\r\n\r\n\t\t// output the current FPS\r\n\t\tfpsLogger.log();\r\n\t}",
"public GameScreen() {\n\n\t\tint midPointY = (int) (Const.GAME_HEIGHT / 2);\n\n\t\tworld = new GameWorld(midPointY);\n\t\trenderer = new GameRenderer(world);\n\n\t\tGdx.input.setInputProcessor(new InputHandler(world.getVentilatorUp(), world.getVentilatorDown()));\n\t\t// Gdx.input.setInputProcessor(new\n\t\t// InputHandler(world.getVentilatorTwo()));\n\t}",
"public void render() {\n renderHud();\n }",
"@Override\n\tprotected void Draw(GameTime gameTime)\n\t{\n\t\tgetGraphicsDevice().Clear(Color.CornflowerBlue);\n\t\t\n\t\tspriteBatch.Begin();\n\t\tspriteBatch.Draw(background, new Vector2(0,0), Color.White);\n\t\tspriteBatch.End();\n\t\t\n\t\t// TODO: Add your drawing code here\n\t\t\n\t\tsuper.Draw(gameTime);\n\t}",
"@Override\n\tpublic void render() {\n\t\tScreen.render();\n\t}",
"@Override\n public void startState() {\n Spell.clear();\n initGoldRenderers();\n initBackground();\n startBattleState();\n isOver = false;\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}",
"private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }",
"public GameOverStandalone() {\n initComponents();\n \n ranks = new LinkedList<String>();\n \n FadingEffect fader = new FadingEffect();\n fader.Fade(this);\n \n// mainActivity=this;\n// \n// Thread fading = new Thread(new Runnable() {\n// @Override\n// public void run() {\n// while (true) {\n// int x=java.awt.MouseInfo.getPointerInfo().getLocation().x;\n// int y=java.awt.MouseInfo.getPointerInfo().getLocation().y;\n// if (x>mainActivity.getX()&&x<(mainActivity.getX()+mainActivity.getWidth())&&y>mainActivity.getY()&&y<(mainActivity.getY()+mainActivity.getHeight())) {\n// mainActivity.setOpacity(1.0f);\n// }\n// else {\n// mainActivity.setOpacity(0.75f);\n// }\n// try {\n// Thread.sleep(100);\n// } catch (Exception e) {\n// \n// }\n// }\n// }\n// });\n// fading.start();\n }",
"public StartScreen()\n { \n // Create a new world with 1111x602 cells with a cell size of 1x1 pixels.\n super(1111, 602, 1); \n prepare();\n background.playLoop();\n }",
"@Override\n public void render() {\n Gdx.gl.glClearColor(0f, 0f, 0f, 1f);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n Gdx.gl.glDisable(GL20.GL_BLEND);\n }",
"@Override\n\tpublic void show() {\n\t worldRenderer = new WorldRenderer(game);\n\t\tGdx.input.setCatchBackKey(true);\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}"
] | [
"0.75116986",
"0.7268553",
"0.72322595",
"0.7218686",
"0.7193849",
"0.71841717",
"0.71206886",
"0.7092217",
"0.7071911",
"0.7065334",
"0.7017937",
"0.70060897",
"0.6968182",
"0.69574803",
"0.6917063",
"0.68869984",
"0.6847646",
"0.68429697",
"0.6833158",
"0.68299764",
"0.68085855",
"0.6803565",
"0.67962897",
"0.67852086",
"0.6757259",
"0.67404246",
"0.6718709",
"0.6716464",
"0.66946495",
"0.66896987",
"0.6681472",
"0.66614026",
"0.66432774",
"0.6636189",
"0.6609193",
"0.6590609",
"0.65871483",
"0.65834117",
"0.65819436",
"0.6572338",
"0.65651625",
"0.65619093",
"0.6556239",
"0.6548153",
"0.6547345",
"0.65426624",
"0.6531001",
"0.65295655",
"0.6520326",
"0.6514769",
"0.65066177",
"0.6505084",
"0.6505017",
"0.6503608",
"0.6494008",
"0.64873147",
"0.64833313",
"0.6473838",
"0.6458302",
"0.6450251",
"0.64434594",
"0.64434594",
"0.6439125",
"0.64382833",
"0.6435403",
"0.643356",
"0.6424372",
"0.64241207",
"0.6418813",
"0.64058286",
"0.64035594",
"0.64010334",
"0.6399311",
"0.6394314",
"0.63909805",
"0.63808745",
"0.63795084",
"0.6361405",
"0.6359231",
"0.6358388",
"0.63572276",
"0.63457775",
"0.6341205",
"0.6325202",
"0.6325014",
"0.632273",
"0.6309465",
"0.6304843",
"0.63046503",
"0.62876713",
"0.6266676",
"0.6265135",
"0.62613165",
"0.626033",
"0.6259564",
"0.6258108",
"0.6254706",
"0.6247619",
"0.62439454",
"0.6243751"
] | 0.7013495 | 11 |
LET PLAYER PICK PLAYER CHARACTER | public Character pickPlayer()
{
System.out.println("\tChoose your fighter!\n");
for(int i = 0; i < characterList.size(); i++)
{
Character chara = characterList.get(i);
System.out.println("\t" + (i + 1) + ") " + chara.getFullName());
}
System.out.print("\n>>> ");
player = characterList.get(keyboard.nextInt() - 1);
characterList.remove(player);
return player;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Player getSelectedPlayer();",
"private void autoCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new MachinePlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }",
"private void manualCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new HumanPlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }",
"public void generatePlayer()\n {\n board.getTile(8,0).insertPlayer(this.player);\n }",
"void chooseStarterPlayer() {\n\t\tSystem.out.println(\"\\nWer beginnt?\");\n\t\tSystem.out.println(\"1 - Computer\");\n\t\tSystem.out.println(\"2 - Human\");\n\t}",
"public static void kickPlayer(){\n\t\t// remove player\n\t\tplayers.get(curr).kick();\n\t\t// decrement number of players\n\t\tnumPlayers--;\n\t\t// update players on the board\n\t\tboard.updatePlayers(players);\n\t\tSystem.out.println(\"Kicked \"+players.get(curr).getColorName()+\" player.\");\n\t}",
"private Player selectPlayer (int which) {\n System.out.println();\n int choice = readPlayerChoice(which);\n String name = readPlayerName();\n if (choice == TIMID)\n return new TimidPlayer(name);\n else if (choice == GREEDY)\n return new GreedyPlayer(name);\n else if (choice == CLEVER)\n return new CleverPlayer(name);\n else\n return new InteractivePlayer(name);\n }",
"public void createStartingPlayers(CFrame frame) {\r\n\t\tSet<String> passableActions = new HashSet<String>();\r\n\t\tint playerNumber = Integer.parseInt(frame.getSidePanel().getButtons().getButton(\"start\", null));\r\n\t\tString name =\"\", charr;\r\n\t\tMap<String, String> pc = new HashMap<String, String>();\r\n\t\t\r\n\t\tframe.getSidePanel().getText().setText(\"Please select a character\\nand enter your name\\n\");\r\n\t\tfor(int i =0;i<playerNumber;i++){\r\n\t\t\tString test = frame.getSidePanel().getButtons().getButton(\"characterSelect\", passableActions);\r\n\r\n\t\t\tString Playercharacter[] = test.split(\",\");\r\n\t\t\tname= Playercharacter[0];\r\n\t\t\tcharr= Playercharacter[1];\r\n\t\t\tpassableActions.add(charr);\r\n\t\t\t\r\n\t\t\tpc.put(charr, name);\r\n\r\n\t\t\tSystem.out.println(\"Output: \" + name+\" : \"+charr);\r\n\t\t}\r\n\t\t\r\n\t\tfor(BoardObject object: boardObjects){\r\n\t\t\tSystem.out.println(object.getName() +\" \"+passableActions);\r\n\t\t\tif(object instanceof Character && passableActions.contains(object.getName())){\r\n\t\t\t\tSystem.out.println(object.getName());\r\n\t\t\t\t((Character) object).setAsPlayer(true);\r\n\t\t\t\t((Character) object).setPlayerName(pc.get(object.getName()));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdeck.deal(players(), players().size());\r\n\r\n\t\t//Testing allocation\r\n\t\tfor(Character c: players())\r\n\t\t\tSystem.out.println(c.getName() + \": \" + c.playerName());\r\n\t}",
"@Override\n\tpublic Player selectPlayer(List<Player> selectable) {\n\t JSONObject message = new JSONObject();\n\t message.put(\"function\", \"select\");\n\t message.put(\"type\", \"player\");\n JSONArray jArray = new JSONArray();\n selectable.forEach(s->jArray.add(s.getNickname()));\n\t message.put(\"list\", jArray);\n\t this.sendInstruction(message);\n\n\t String selected = this.getResponse();\n\n\t\tif (selected == null || selected.isEmpty()) return null;\n\t\treturn selectable.stream().filter(p->p.getNickname().equals(selected))\n .collect(Collectors.toList()).get(0);\n\t}",
"String getPlayer();",
"public void presentPlayer( CoinFlipper theHandle, String theName );",
"public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }",
"public void pickUp(Player player) {\n player.setBox(this);\n }",
"static void setCurrentPlayer()\n {\n System.out.println(\"Name yourself, primary player of this humble game (or type \\\"I suck in life\\\") to quit: \");\n\n String text = input.nextLine();\n\n if (text.equalsIgnoreCase(\"I suck in life\"))\n quit();\n else\n Player.current.name = text;\n }",
"public void autoCommand(Piece p) {\r\n _playing = false;\r\n _players[p.ordinal()] = new MachinePlayer(p, this);\r\n }",
"public void actionPerformed(ActionEvent e) {\n\t\tplayerSelectNum++;\n\t\tfor (int i = 0; i<charButtons.size(); i++){\n\t\t\tif (e.getSource() == charButtons.get(i)){\n\t\t\t\tcharButtons.get(i).setEnabled(false);\n\t\t\t\tselection = new PlayerInfo(name, characters.get(i));\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\tif (playerSelectNum == 1){\n\t\t\tCLOGameClient c = new CLOGameClient(selection);\n\t\t\tdispose();\n\t\t}\n\t}",
"Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}",
"public void selectResponse(String response , Player player);",
"public String callPlayer() {\n\t\treturn \"OVER HERE!!\";\n\t}",
"String getNewPlayerName();",
"private void selectRandomPlayer() {\n Random rand = new Random();\n // Restrict random number range to available indexes in the players list.\n // - 1 to offset zero-based index numbering.\n int random = rand.nextInt(players.size());\n activePlayer = players.get(random);\n }",
"void selectPlayers(){\n\t\tframe.repaintAll();\n\t\tint numPlayers = inputNumPlayers();\n\t\t\n\t\t// let each player choose a character\n\t\tfor(int i=0; i<numPlayers; i++){\n\t\t\tJPanel panel = new JPanel(new GridLayout(0, 1));\n\t\t\t\n\t\t\t// determine which characters are available\n\t\t\tList<String> playerNames = new ArrayList<String>();\n\t\t\tfor(Player p : game.getPlayers()){\n\t\t\t\tplayerNames.add(p.getCharacter());\n\t\t\t}\n\t\t\t\n\t\t\t// create buttons\n\t ButtonGroup bg = new ButtonGroup();\n\t\t\tJRadioButton greenBtn = new JRadioButton(GameOfCluedo.GREEN);\n\t\t\tJRadioButton mustardBtn = new JRadioButton(GameOfCluedo.MUSTARD);\n\t\t\tJRadioButton peacockBtn = new JRadioButton(GameOfCluedo.PEACOCK); \n\t\t\tJRadioButton plumBtn = new JRadioButton(GameOfCluedo.PLUM); \n\t\t\tJRadioButton scarlettBtn = new JRadioButton(GameOfCluedo.SCARLETT); \n\t JRadioButton whiteBtn = new JRadioButton(GameOfCluedo.WHITE); \n\t \n\t String playerName = getPlayerName();\n\t \n\t panel.add(new JLabel(\"Who will \"+playerName+\" play as?\"));\n\t addAvailableCharacterOptions(panel, playerNames, bg, greenBtn,\n\t\t\t\t\tmustardBtn, peacockBtn, plumBtn, scarlettBtn, whiteBtn);\n\t\t\tJOptionPane.showMessageDialog(frame, panel, \"Character select\", JOptionPane.QUESTION_MESSAGE);\n\t\t\tgeneratePlayerFromInput(panel, playerName, greenBtn, mustardBtn, peacockBtn,\n\t\t\t\t\tplumBtn, scarlettBtn, whiteBtn);\n\t\t\t\n\t frame.repaintAll();\n\t\t}\n\t}",
"public static char playerInput(String player) {\r\n\t System.out.println(\"Enter the input to begin the game: X | O: \");\r\n\t char inputChar = value.next().charAt(0);\r\n\r\n\t return inputChar;\r\n\t }",
"public Pawn(String player){\r\n this.player=player;\r\n\r\n }",
"boolean setPlayer(String player);",
"public void setPlayer(String player) {\r\n this.player = player;\r\n }",
"void createPlayer(Player player);",
"private void chooseStartPlayer() throws IOExceptionFromController {\n try {\n game.setActivePlayer(playerControllers.get(0).getClient().chooseStartingPlayer(players));\n } catch (IOException | InterruptedException e) {\n throw new IOExceptionFromController(e, playerControllers.get(0));\n }\n }",
"public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\n }",
"public static String checkPlayFirst() {\r\n\t int randomNumber = (int) Math.floor(Math.random() * 10) % 2;\r\n\t String player = \"\";\r\n\t if ( randomNumber == 0)\r\n\t player = \"Computer\";\r\n\t else\r\n\t player = \"User\";\r\n\r\n\t return player;\r\n\t }",
"private void sendPlayerChat1(String s) {\n\t\tc.getPA().sendFrame200(969, 591);\n\t\tc.getPA().sendFrame126(c.playerName, 970);\n\t\tc.getPA().sendFrame126(s, 971);\n\t\tc.getPA().sendFrame185(969);\n\t\tc.getPA().sendFrame164(968);\n\t}",
"private char playSingleGame() {\n this.resetGame();\n System.out.println(\"\\n---------- NEW GAME ----------\\n\");\n System.out.println(this);\n int turn = (int) (2 * Math.random());\n char res;\n do {\n Move move = this.players[turn].pickMove();\n if (move == null) {\n return 'Q';\n }\n this.executeMove(move, this.players[turn].getSymbol());\n System.out.println(this);\n if (turn == 0) { // changes turns from one player to the other\n turn = 1;\n } else turn = 0;\n res = this.getGameStatus();\n switch (res) {\n case 'O':\n res = 'C';\n break;\n case 'X':\n res = 'H';\n }\n } while (res == '?');\n return res;\n }",
"private void setPlayer(BoardSquaresState player){\n\t\tif(player == BoardSquaresState.CROSS){\n\t\t\tselectedPlayer = BoardSquaresState.CROSS;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Cross\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"You go first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.cross_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\t\telse{\n\t\t\tselectedPlayer = BoardSquaresState.NOUGHT;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Nought\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"Computer goes first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.nought_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\n\t}",
"public void AskName(){\r\n\t\tSystem.out.println(\"Player 2, please enter your name: \\nPredictable Computer\");\r\n\t\tplayerName = \"Predictable Computer\";\r\n\t}",
"Player createPlayer();",
"public void talk() throws IOException, InterruptedException{\n\t\ttoServer.println(\"PICKUP\");\n\t\ttoServer.println(\"HELLO\");\n\t\ttoServer.println(\"LOOK\");\n\t\twhile (!gameOver){\n\t\t\tThread.sleep(500);\n\t\t\ttoServer.println(queue.take());\n\t\t\ttoServer.println(\"LOOK\");\n\t\t}\n\t}",
"public Character pickOpponent()\n {\n int oppIndex = random.nextInt(characterList.size());\n opponent = characterList.get(oppIndex);\n return opponent;\n }",
"public void manualCommand(Piece p) {\r\n _playing = false;\r\n _players[p.ordinal()] = new HumanPlayer(p, this);\r\n }",
"public void welcomePlayer(Player p);",
"void makePlay(int player) {\n }",
"public ComputerPlayer1(char marker) {\n this.marker = marker;\n }",
"public void handlePawnPicked(MouseEvent event) {\n if (event.getSource() == blackPawn) {\n sender.sendInput(\"use family pawn black\");\n }\n if (event.getSource() == whitePawn) {\n sender.sendInput(\"use family pawn white\");\n }\n if (event.getSource() == orangePawn) {\n sender.sendInput(\"use family pawn orange\");\n }\n if (event.getSource() == neutralPawn) {\n sender.sendInput(\"use family pawn neutral\");\n }\n\n }",
"public FirstPlayerPickCommand(int sender, int target, List<Player> connectedPlayers) {\n super(sender, target);\n players = toCompatPlayerArray(connectedPlayers);\n picked = -1;\n }",
"Player currentPlayer();",
"public char getPlayer() {\n return player;\n }",
"private void generatePlayerFromInput(JPanel panel, String playerName, JRadioButton greenBtn,\n\t\t\tJRadioButton mustardBtn, JRadioButton peacockBtn,\n\t\t\tJRadioButton plumBtn, JRadioButton scarlettBtn,\n\t\t\tJRadioButton whiteBtn) {\n\t\tif(greenBtn.isSelected()){\n\t\t\tgame.addPlayer(new Player(GameOfCluedo.GREEN, playerName));\n\t\t} else if(mustardBtn.isSelected()){\n\t\t\tgame.addPlayer(new Player(GameOfCluedo.MUSTARD, playerName));\n\t\t} else if(peacockBtn.isSelected()){\n\t\t\tgame.addPlayer(new Player(GameOfCluedo.PEACOCK, playerName));\n\t\t} else if(plumBtn.isSelected()){\n\t\t\tgame.addPlayer(new Player(GameOfCluedo.PLUM, playerName));\n\t\t} else if(scarlettBtn.isSelected()){\n\t\t\tgame.addPlayer(new Player(GameOfCluedo.SCARLETT, playerName));\n\t\t} else if(whiteBtn.isSelected()){\n\t\t\tgame.addPlayer(new Player(GameOfCluedo.WHITE, playerName));\n\t\t} else {\n\t\t\t// the player hasn't selected an option\n\t\t\tJOptionPane.showMessageDialog(frame, panel);\n\t\t\tgeneratePlayerFromInput(panel, playerName, greenBtn, mustardBtn, peacockBtn,\n\t\t\t\t\tplumBtn, scarlettBtn, whiteBtn);\n\t\t}\n\t}",
"Player getCurrentPlayer();",
"Player getCurrentPlayer();",
"public void addCharToName(char c) {\n \t\tif (state == 4) {\n \t\t\t/*\n \t\t\t * if (playerName.equals(\"PLAYER\")) { playerName = \"\"; }\n \t\t\t */\n \t\t\tif (playerName.length() < 16) {\n \t\t\t\tplayerName = playerName + c;\n \t\t\t}\n \t\t}\n \n \t}",
"void joinGame(String playeruuid);",
"boolean addPlayer(String player);",
"@FXML\n\tprivate void emoji1selected(MouseEvent event) {\n\t\tString message=\"\\u2615\";\n\t\tclient.sendMessageToGroup(message);\n\t\tappend(message+\"\\n\", client.username);\n\t}",
"Player(String playerName) {\n this.playerName = playerName;\n }",
"private void spawnPlayer() {\n\t\tplayer.show(true);\n\t\tplayer.resetPosition();\n\t\tplayerDead = false;\n\t\tplayerDeadTimeLeft = 0.0;\n\t}",
"public PlayerAsker(int player) {\r\n initComponents();\r\n choice=0;\r\n text.setText(\"What do you want player \" + (player+1) + \" to be ?:\");\r\n \r\n }",
"public PlayerChoicePick getNextPlayerChoicePick();",
"private void ReplacePlayer()\n {\n String oldPlayer = GetPlayerString(mTeamsComboBox.getSelectedItem().toString(),\n mPositionComboBox.getSelectedItem().toString());\n if( oldPlayer == null )\n return;\n\n String newPlayer = GetPlayerString_UI();\n String team = mTeamsComboBox.getModel().getElementAt(mTeamsComboBox.getSelectedIndex()).toString();\n ReplacePlayer(team, oldPlayer, newPlayer);\n }",
"private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}",
"public static void playerInput() \n\t{\n\t\t\n\t\tscanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Choose the character x or o\");\n\t\tplayerInput = scanner.next().charAt(0);\n\t\tif (playerInput == 'x' || playerInput == 'o') \n\t\t{\n\t\t\tif (playerInput == 'x') \n\t\t\t{\n\t\t\t\tcomputerInput = 'o';\n\t\t\t\tSystem.out.println(\"Player chooses x & o is assigned to computer.\\n\");\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tcomputerInput = 'x';\n\t\t\t\tSystem.out.println(\"Player chooses o & x is assigned to computer.\\n\");\n\t\t\t\t//computerMove();\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{\n\t\t\tSystem.out.println(\"Invalid Input ! Try again.\\n\");\n\t\t\tplayerInput();\n\t\t}\n\t\ttossWhoIsFirst();\n\t}",
"public abstract void accept(Player player, String component);",
"void fireShellAtOpponent(int playerNr);",
"public void chasePlayer() {\r\n\t\tif(!playerNear().equals(\"n\")) {\r\n\t\t\tif(playerNear().equals(\"left\")) {\r\n\t\t\t\tspeed = -1;\r\n\t\t\t}\r\n\t\t\telse if(playerNear().equals(\"right\")) {\r\n\t\t\t\tspeed = 1;\r\n\t\t\t}\r\n\t\t\tx += speed; setLocation(x,y); repaint();\r\n\t\t}\r\n\t\telse {\r\n\t\t\trandomMove();\r\n\t\t}\r\n\t\tif(speed > 0) {\r\n\t\t\tsetIcon(rightImage);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsetIcon(leftImage);\r\n\t\t}\r\n\r\n\t}",
"public void kickPlayer ( String message ) {\n\t\texecute ( handle -> handle.kickPlayer ( message ) );\n\t}",
"public static void ChooseNextPlayer () {\n do {\r\n\r\n // MOVE TO THE NEXT PLAYER\r\n next_player++;\r\n\r\n // IF WE MOVED TOO FAR, WRAP AROUND TO ZERO\r\n if (next_player >= player_count)\r\n next_player = 0;\r\n\r\n } while (player[next_player].lost);\r\n\r\n }",
"public void notifyPlayerVictory(Player p);",
"private String getPlayerName(int i) {\n\t\tSystem.out.println(\"\\nEnter Player \"+i+\"'s Name:\");\n\t\treturn GetInput.getInstance().aString();\n\t}",
"private void buyPlayer(FootballPlayer player, String playerName, int num) {\n\t\tint valid = game.addPlayer(playerName);\n\t\tif(valid==0) {\n\t\t\tplayerNameArray[num].setText(playerName);\n\t\t\timageArray[num].setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[num].setText(\"X\");\n\t\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \" RGG\");\n\t\t\t\n\t\t} else if (valid==1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You have already selected this player for your team\");\n\t\t} else if (valid==-1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You don´t have enough budget too buy \" + playerName);\n\t\t}\n\t}",
"private void play(Player p){\r\n\t\tSystem.out.println(\"What pet would you like to play with?\");\r\n\t\tint c = 1;\r\n\t\tArrayList<Toy> toys = p.getToys();\r\n\r\n\t\tfor(Pet pet : p.getPets()){\r\n\t\t\tSystem.out.println(c + \". \" + pet.getPetname());\r\n\t\t\tc++;\r\n\t\t}\r\n\t\tint selectedpetindex = getNumber(1, p.getPets().size());\r\n\t\tPet selectedpet = p.getPets().get(selectedpetindex - 1);\r\n\t\tSystem.out.println(\"What toy do you want to use to play with \" + selectedpet.getPetname());\r\n\r\n\t\tc = 1;\r\n\t\tfor(Toy t : toys){\r\n\t\t\tSystem.out.println(c + \". \" + t.getName());\r\n\t\t\tc++;\r\n\t\t}\r\n\t\tint toyindex = getNumber(1, toys.size());\r\n\t\tToy selectedtoy = toys.get(toyindex);\r\n\r\n\t\tselectedpet.play(selectedtoy);\r\n\t\tselectedtoy.setDurability(selectedtoy.getDurability() - selectedpet.getRoughness());\r\n\r\n\t\tif(selectedtoy.getDurability() < 1){\r\n\t\t\ttoys.remove(toyindex);\r\n\t\t}else{\r\n\t\t\ttoys.set(toyindex, selectedtoy);\r\n\t\t}\r\n\r\n\t\tp.setToys(toys);\r\n\t\tp.setActions(p.getActions() - 1);\r\n\t}",
"public void sendJoiningPlayer() {\r\n Player p = nui.getPlayerOne();\r\n XferJoinPlayer xfer = new XferJoinPlayer(p);\r\n nui.notifyJoinConnected();\r\n networkPlayer.sendOutput(xfer);\r\n }",
"public static Character newPlayer(int nbPlayer) {\n\n\n\n int characterClass, level, strength, agility, intelligence, health;\n System.out.println(\"Création du personnage du Joueur \" + nbPlayer);\n characterClass = Character.askAction(\"Veuillez choisir la classe de votre personnage (1 : Guerrier, 2 : Rôdeur, 3 : Mage)\", 1, 3);\n\n do {\n level = Character.askAction(\"Niveau du personnage ?\", 1, 100);\n health = 5 * level;\n System.out.println(\"Votre personnage possède \" + health + \" points de vie\");\n System.out.println(\"Il vous reste \" + level + \" point(s) restant à allouer aux caractéristiques de votre personnage\");\n strength = Character.askAction(\"Force du personnage ?\", 0);\n\n while (level <= 0 || level > 100){\n System.out.println(\"Recommencez : Votre choix n'est pas bon!\");\n level = Character.askAction(\"Niveau du personnage ?\", 0);\n }\n while (strength < 0 || strength > level) {\n System.out.println(\"Recommencez : Votre choix n'est pas bon!\");\n strength = Character.askAction(\"Force du personnage ?\", 0);\n }\n\n int levelMinusStrength = level - strength;\n System.out.println(\"Il vous reste \" + levelMinusStrength + \" point(s) restant à allouer aux caractéristiques de votre personnage\");\n agility = Character.askAction(\"Agilité du personnage ?\", 0);\n while (agility <0 || agility > level - strength) {\n System.out.println(\"Recommencez : Votre choix n'est pas bon!\");\n strength = Character.askAction(\"Agilité du personnage ?\", 0);\n }\n\n\n\n int levelMinusStrengthMinusAgility = level - strength - agility;\n System.out.println(\"Il vous reste \" + levelMinusStrengthMinusAgility + \" point(s) restant à allouer aux caractéristiques de votre personnage\");\n intelligence = Character.askAction(\"Intelligence du personnage ?\", 0);\n while (intelligence <0 || intelligence > level - strength - agility) {\n System.out.println(\"Recommencez : Votre choix n'est pas bon!\");\n strength = Character.askAction(\"Intelligence du personnage ?\", 0);\n }\n\n\n if (strength + agility + intelligence != level) {\n System.out.println(\"Attention le total 'force + agilité + intelligence' doit être égal au niveau du joueur !\");\n }\n }while (strength + agility + intelligence != level);\n\n Character player;\n switch (characterClass) {\n case 1:\n player = new Warrior(nbPlayer, strength, agility, intelligence);\n break;\n case 2:\n player = new Prowler(nbPlayer, strength, agility, intelligence);\n break;\n default:\n player = new Wizard(nbPlayer, strength, agility, intelligence);\n break;\n }\n return player;\n }",
"public static void SetPlayerNames () {\n for (int i = 0; i < player_count; i++) {\r\n\r\n // PROMPT THE USER\r\n System.out.print(\"Player \" + (i+1) + \", enter your name: \");\r\n\r\n // INSTANTIATE A NEW PLAYER USING THE NAME THAT'S PROVIDED\r\n player[i] = new Player(input.nextLine());\r\n\r\n // IF THE PLAYER DOESN'T ENTER A NAME, CALL THEM \"BIG BRAIN\"\r\n if (player[i].name.length() == 0) {\r\n player[i].name = \"Big Brain\";\r\n System.out.println(\"Uh, OK...\");\r\n }\r\n\r\n }\r\n\r\n // MAKE SOME SPACE...\r\n System.out.println();\r\n }",
"private void switchPlayer() {\n Player player;\n playerManager.switchPlayer();\n\n if(playerManager.getCurrentPlayer() == 1)\n player = playerManager.getPlayer(1);\n else if(playerManager.getCurrentPlayer() == 2)\n player = playerManager.getPlayer(2);\n else\n player = new Player(\"No Player exists\");\n\n updateLiveComment(\"Turn : \" + player.getName());\n }",
"private String getPlayerName() {\n\t\tString[] options = {\"OK\"};\n\t\tJPanel namePanel = new JPanel(new GridLayout(0, 1));\n\t\tJLabel lbl = new JLabel(\"Next player, what is your name?\");\n\t\tJTextField txt = new JTextField(10);\n\t\tnamePanel.add(lbl);\n\t\tnamePanel.add(txt);\n\t\t\n\t\t// show dialog box\n\t\tJOptionPane.showOptionDialog(frame, namePanel, \"Player name\",\n\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);\n\t\tString playerName = txt.getText();\n\t\twhile(playerName.length() < 1){\n\t\t\tlbl.setText(\"Name must be at least one character long.\");\n\t\t\tJOptionPane.showOptionDialog(frame, namePanel, \"Player name\",\n\t\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options , options[0]);\n\t\t\tplayerName = txt.getText();\n\t\t}\n\t\treturn playerName;\n\t}",
"public void startGame() {\n Scanner in = new Scanner(System.in);\n Player player = Player.getInstance();\n setPlayer(player);\n\n try {\n\n System.out.println(\"\\t\\u2680\\t\\u2681\\t\\u2682\\t\\u2683\\t\\u2684\\t\\u2685\" +\n \"\\nWelcome to the World Series of Craps!\\n\" +\n \"Please enter your name\");\n\n player.setName(in.nextLine());\n\n }\n catch(NoSuchElementException e){\n System.out.println(\"Exiting system, thank you for playing\");\n System.exit(0);\n }\n catch (Exception e) {\n e.printStackTrace();\n setExit(true);\n }\n System.out.println(\"Welcome \" + player.getName() + \"\\n\");\n }",
"String getPlayerName();",
"static void pickup(Player player, String what) {\n if (player.getLocation().contains(what)) {\n Thing thing = player.pickup(what);\n if (thing != null) {\n System.out.println(\"You now have \" + thing);\n }\n else {\n System.out.println(\"You can't carry that. You may need to drop something first.\");\n }\n }\n else {\n System.out.println(\"I don't see a \" + what);\n }\n }",
"Player(String name){\n\t\tthis.name = name;\n\t}",
"void win(Player player);",
"@Override\n\tpublic Entity interact(Player p) {\n\t\tif(p.getCarryOns() == null) {\n\t\t\tp.setCarryOns(this);\n\t\t\tp.getDungeon().removeEntity(this);\n\t\t\tSystem.out.println(\"CARRIED KEY WITH ID = \" +this.id);\n\t\t\tString musicFile = \"./sounds/Key.wav\";\n\t\t\tMedia sound = new Media(new File(musicFile).toURI().toString());\n\t\t\tMediaPlayer mediaPlayer = new MediaPlayer(sound);\n\t\t\tmediaPlayer.play();\n\t\t\treturn this;\n\t\t} else {\n\t\t\tSystem.out.println(\"Cannot pick up key, already carrying something\");\n\t\t\treturn null;\n\t\t}\n\t}",
"private void displayPlayerMenu () {\n System.out.println();\n System.out.println(\"Player Selection Menu:\");\n System.out.println(\n \"Timid player...........\" + TIMID);\n System.out.println(\n \"Greedy player..........\" + GREEDY);\n System.out.println(\n \"Clever player..........\" + CLEVER);\n System.out.println(\n \"Interactive player.....\" + INTERACTIVE);\n }",
"public abstract void use(PlayerCharacter character);",
"public void AskName(String input){\r\n\t\tplayerName = input;\r\n\t}",
"public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}",
"public Player_ex1(String playerName){\n this.name = playerName;\n winner = false;\n }",
"@Override\r\n\tpublic char play(char lastPlayed) {\n\t\tString inputStr;\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Next character: \");\r\n\t\tinputStr = input.nextLine();\r\n\t\twhile (inputStr.length() > 1) {\r\n\t\t\tSystem.out.print(\"Next character: \");\r\n\t\t\tinputStr = input.nextLine();\r\n\t\t}\r\n\t\treturn inputStr.charAt(0);\r\n\t}",
"public void sendPlayerName(String s) {\n try {\n dOut.writeUTF(s);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send player name\");\n e.printStackTrace();\n }\n }",
"public void kick(Player presser,Player kicked)\r\n\t{\r\n\t\tclientQueue.offer(new Action(getLobby().getID(),presser,kicked,Action.KICK));\r\n\t}",
"public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }",
"private static void chooseLetter()\n {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Choose a letter :: X or O : \");\n userLetter = scanner.next().toUpperCase().charAt(0);\n computerLetter = (userLetter == 'X') ? 'O' : 'X';\n }",
"public static char playerChoice(){\n String str1; //temp string to hold players choice.\n char choice; //return value of players choice after parsing.\n \n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\");\n while(str1.length() == 0){\n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\");\n }\n \n choice = str1.charAt(0);\n choice = Character.toLowerCase(choice);\n while( choice != 'r' && choice != 'p' && choice != 's' && choice != 'l' && choice != 'x'){\n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\"); \n \n while(str1.length() == 0){\n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\");\n }\n choice = str1.charAt(0);\n choice = Character.toLowerCase(choice); \n }\n\n \n return choice;\n }",
"private void giveClientName()\n\t{\n\t\trandomClientId = new Random().nextInt();\n\t\tif ( randomClientId < 0 )\n\t\t\trandomClientId = -randomClientId;\n\t\t\n\t\tthis.playerName += Integer.toString(randomClientId);\n\t}",
"public void getPlayerChoice(CommandOption[] cmdOps) {\r\n\t\timplementCommand(player.makeChoice(cmdOps));\r\n\t}",
"private void promptPlayerTurn(Player player) {\r\n JOptionPane.showMessageDialog(\r\n null,\r\n player.getName() + \", it's your turn!\",\r\n \"Player Confirmation\",\r\n JOptionPane.INFORMATION_MESSAGE);\r\n }",
"public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}",
"void sendPacketToPlayer(Player player, Object packet);",
"public void hitButtonClicked()\r\n {\r\n Card hit = game.hit(\"Player\");\r\n playerCardList.get(nextPlayerIndex).setImage(hit.toGraphic());\r\n nextPlayerIndex++;\r\n if(game.checkLose())\r\n {\r\n playerLost();\r\n }\r\n }",
"public final static void play()\n\t{\n\t\tDatabase.resetForNewGame();\n\n\n\t\tclearConsole();\n\t\tint playerOnePoints = 0, playerTwoPoints = 0, matrixSize=0, userChoise=0;\n\t\tString playerOneName, playerTwoName;\n\t\tchar controller;\n\n\n\t\tSystem.out.println(\"LET THE GAME BEGIN!\");\n\t\tSystem.out.println(\"Please type players' names: \");\n\n\t\t/**\n\t\t * Asks for player's names and Galaxy size.\n\t\t * */\n\t\tdo\n\t\t{\n\t\t\tSystem.out.println(\"Player One: \");\n\t\t\tplayerOneName=Global.sc.next(\"\\\\w+\");\n\t\t\tSystem.out.println(\"Player Two: \");\n\t\t\tplayerTwoName=Global.sc.next(\"\\\\w+\");\n\t\t\tif ((!checkNames(playerOneName, playerTwoName)))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Error. Please enter names with no marks and spaces, different first letter or less length.: \");\n\t\t\t}\n\t\t} while(!checkNames(playerOneName, playerTwoName));\n\t\tclearConsole();\n\t\tSystem.out.println(\"Please choose galaxy size: \");\n\t\tSystem.out.println(\"[1] Small\");\n\t\tSystem.out.println(\"[2] Large\");\n\t\tuserChoise=Global.sc.nextInt();\n\t\twhile(userChoise!=1&&userChoise!=2)\n\t\t{\n\t\t\tSystem.out.println(\"Wrong number. Please enter again: \");\n\t\t\tuserChoise=Global.sc.nextInt();\n\t\t}\n\t\tif (userChoise==1) {\n\t\t\tmatrixSize=GameConstants.smallMatrixSize;\n\t\t}\n\t\telse \n\t\t{\n\t\t\tmatrixSize=GameConstants.largeMatrixSize;\n\t\t}\n\n\t\t/**\n\t\t * Creates the Galaxy and player's coordinates.\n\t\t * */\n\t\tGalaxy galaxy = new Galaxy(matrixSize);\n\t\tPlayerOne playerOneCol=new PlayerOne();\n\t\tPlayerOne playerOneRow=new PlayerOne();\n\t\tPlayerTwo playerTwoRow=new PlayerTwo(matrixSize);\n\t\tPlayerTwo playerTwoCol=new PlayerTwo(matrixSize);\n\t\t/**\n\t\t * Creates TemporaryChar which will hold a potential symbol ('8'/'+'/'*') of a question.\n\t\t * */\n\t\tTemporaryChar temp = new TemporaryChar();\n\t\tgalaxy.putStars(matrixSize);\n\t\tgalaxy.putPlayers(playerOneName, playerTwoName, matrixSize);\n\n\n\t\t//GAME BEGINS\n\n\n\n\t\tdo\n\t\t{\n\t\t\t//First player\n\n\n\t\t\tclearConsole();\n\t\t\tdisplayPlayerInfo(playerOneName, playerOnePoints, playerTwoName, playerTwoPoints);\n\t\t\tgalaxy.printMatrix(matrixSize);\n\t\t\tSystem.out.print(playerOneName);\n\t\t\tSystem.out.print(\", please make a move: \");\n\n\t\t\tcontroller=Global.sc.next(\".\").charAt(0);\n\n\t\t\tmovePlayer(galaxy,temp, controller, playerOneRow, playerOneCol);\n\n\t\t\t//Throws exception if player has tried to move on the other player's position.\n\t\t\tif (playerOneRow.coordinate == playerTwoRow.coordinate&&playerOneCol.coordinate ==playerTwoCol.coordinate)\n\t\t\t{\n\t\t\t\tthrow new ArrayIndexOutOfBoundsException();\t\n\t\t\t}\n\t\t\tplayerOnePoints+=pointsToAdd(temp);\n\t\t\tclearConsole();\n\t\t\tdisplayPlayerInfo(playerOneName, playerOnePoints, playerTwoName, playerTwoPoints);\n\t\t\tgalaxy.printMatrix(matrixSize);\n\n\t\t\t//Checks if there are any stars.\n\t\t\tif(!galaxy.checkForRemainingStars(matrixSize)) break;\n\n\n\n\n\n\t\t\t//Second player\n\n\n\t\t\tclearConsole();\n\t\t\tdisplayPlayerInfo(playerOneName, playerOnePoints, playerTwoName, playerTwoPoints);\n\t\t\tgalaxy.printMatrix(matrixSize);\n\t\t\tSystem.out.print(playerTwoName);\n\t\t\tSystem.out.print(\", please make a move: \");\n\n\t\t\tcontroller=Global.sc.next(\".\").charAt(0);\n\n\t\t\tmovePlayer(galaxy,temp, controller, playerTwoRow, playerTwoCol);\n\n\t\t\tif (playerOneRow.coordinate == playerTwoRow.coordinate&&playerOneCol.coordinate ==playerTwoCol.coordinate)\n\t\t\t{\n\t\t\t\tthrow new ArrayIndexOutOfBoundsException();\t\n\t\t\t}\n\t\t\tplayerTwoPoints+=pointsToAdd(temp);\n\t\t\tclearConsole();\n\t\t\tdisplayPlayerInfo(playerOneName, playerOnePoints, playerTwoName, playerTwoPoints);\n\t\t\tgalaxy.printMatrix(matrixSize);\n\t\t} while (galaxy.checkForRemainingStars(matrixSize));\n\n\n\n\n\t\tif (playerOnePoints > playerTwoPoints)\n\t\t{\n\t\t\tSystem.out.print(playerOneName);\n\t\t\tSystem.out.println(\" wins!\");\n\t\t}\n\t\telse if (playerOnePoints < playerTwoPoints)\n\t\t{\n\t\t\tSystem.out.print(playerTwoName);\n\t\t\tSystem.out.println(\" wins!\");\n\t\t}\n\t\telse System.out.println(\"It's a draw!\");\n\n\t\tpressAnyKeyToContinue();\n\t\tshowMenu();\n\n\n\t}",
"private void networkClient(java.awt.event.MouseEvent evt) {\n\t\tgameChoice = 'c';\n\t\twindowComplete = true;\n\t}",
"public void executeJoiningPlayer(Player player) {\r\n nui.setupNetworkPlayer(player);\r\n }",
"public void addPlayer(String p) {\n this.playersNames.add(p);\n }"
] | [
"0.682831",
"0.66388404",
"0.6572943",
"0.6377947",
"0.63494664",
"0.6347147",
"0.6284241",
"0.6238599",
"0.62268037",
"0.6168311",
"0.6161462",
"0.61359906",
"0.61206114",
"0.6113751",
"0.6098877",
"0.60913503",
"0.6080318",
"0.60690975",
"0.605454",
"0.6054275",
"0.6041663",
"0.60339403",
"0.59855735",
"0.59845865",
"0.596714",
"0.5964682",
"0.5954003",
"0.5930167",
"0.5921585",
"0.5908171",
"0.5901505",
"0.5901423",
"0.58991206",
"0.5891825",
"0.58898157",
"0.58893615",
"0.5888483",
"0.58801657",
"0.58748806",
"0.5872394",
"0.58522147",
"0.58488894",
"0.584798",
"0.58458203",
"0.58381647",
"0.5834568",
"0.5827811",
"0.5827811",
"0.58206475",
"0.5811391",
"0.5809629",
"0.58089817",
"0.5797645",
"0.57969946",
"0.5796136",
"0.57947266",
"0.5792011",
"0.5790144",
"0.57690966",
"0.5768776",
"0.57679534",
"0.57665706",
"0.57638705",
"0.5760973",
"0.5760871",
"0.5760113",
"0.57579297",
"0.5746725",
"0.574541",
"0.573077",
"0.5727663",
"0.5713795",
"0.5710803",
"0.57106394",
"0.570834",
"0.57074136",
"0.57004607",
"0.5695993",
"0.5690627",
"0.5683001",
"0.5673766",
"0.5670273",
"0.5670218",
"0.5669912",
"0.56490445",
"0.56351215",
"0.5622135",
"0.5620868",
"0.5618672",
"0.56114423",
"0.5611276",
"0.560785",
"0.5607743",
"0.5606694",
"0.56019145",
"0.5597395",
"0.5590394",
"0.55870414",
"0.5583522",
"0.55828846"
] | 0.6952759 | 0 |
RANDOMLY PICK OPPONENT FROM REMAINING CHARACTERS | public Character pickOpponent()
{
int oppIndex = random.nextInt(characterList.size());
opponent = characterList.get(oppIndex);
return opponent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int getCombo() {\n return generator.nextInt(COMBOS) + 1;\n }",
"private int generatePiece()\n\t{\n\t\tint toReturn = 0;\n\t\tint max = 1;\n\t\tint min = -1;\n\t\t\n\t\twhile(toReturn == 0)\n\t\t{\n\t\t\ttoReturn = r.nextInt((max - min) + 1) + min;\n\t\t}\n\t\tSystem.out.println(toReturn);\n\t\treturn toReturn;\n\t}",
"public char compChoice ()\n {\n\tint num = (int) (Math.random () * 5) + 1;\n\tif (num == 1)\n\t return 's';\n\telse if (num == 2)\n\t return 'd';\n\telse if (num == 3)\n\t return 'p';\n\telse if (num == 4)\n\t return 'h';\n\telse\n\t return 'w';\n }",
"private char getRandomCharacter() {\n int min = 0;\n int max = ALPHABET.length-1;\n int randomPos;\n\n // Could possibly have used ASCII numbers 61-95\n randomPos = min + (int)(Math.random() * ((max - min) + 1));\n\n return ALPHABET[randomPos];\n }",
"public static void main(String[] args) {\n //The letters are randomly chosen through this block of code with use of ASCII code.\n char let1 = (char) ((int)(Math.random() * 26 + 65));\n char let2 = (char) ((int)(Math.random() * 26 + 65));\n char let3 = (char) ((int)(Math.random() * 26 + 65));\n \n //This generates a number of four digits to follow the letters. \n int num = (int)(Math.random() * 9000 + 999);\n \n //The combination is now printed to the screen through this. \n System.out.println(\"The plate number is \" + let1 + let2 +let3 + num); \n }",
"public char compChoice ()\n {\n\tint num = (int) (Math.random () * 3) + 1;\n\tif (num == 1)\n\t return 'F';\n\telse if (num == 2)\n\t return 'W';\n\telse\n\t return 'G';\n }",
"public String digit(String digit);",
"private static char[] initNum() {\n\t\tchar[] values = {'0', '1', '2', '3', '4', '5',\n\t\t\t\t'6', '7', '8', '9'};\n\t\tchar[] answer = new char[4];\n\t\t\n\t\tint countReady = 0;\n\t\t\n\t\twhile(countReady != 4) {\n\t\t\tint tempChar = rndChar();\n\t\t\tif(values[tempChar] != 'x') {\n\t\t\t\tanswer[countReady] = values[tempChar];\n\t\t\t\tvalues[tempChar] = 'x';\n\t\t\t\tcountReady++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn answer;\n\t}",
"public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}",
"public static char getDigitCharacter(){\n\t\treturn getRandomCharacter('0','9');\n\t}",
"private static char rndChar() {\n\t\tRandom rnd = new Random();\n\t\treturn (char)rnd.nextInt(10);\n\t}",
"public String nextTurn() {\n\t\tString turn = \"\";\n\t\tnum ++;\n\t\tif (num==100 && letter!='Z') {\n\t\t\tletter += 1;\n\t\t\tnum = 0;\n\t\t\tturn = letter+\"0\"+String.valueOf(num);\n\t\t}\n\t\telse if (num==100 && letter=='Z') {\n\t\t\tletter = 'A';\n\t\t\tnum = 0;\n\t\t\tturn = letter+\"0\"+String.valueOf(num);\n\t\t}\n\t\telse if (num>10) {\n\t\t\tturn = letter+String.valueOf(num);\n\t\t}\n\t\telse {\n\t\t\tturn = letter+\"0\"+String.valueOf(num);\n\t\t}\n\t\treturn turn;\n\t}",
"private static void chooseLetter()\n {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Choose a letter :: X or O : \");\n userLetter = scanner.next().toUpperCase().charAt(0);\n computerLetter = (userLetter == 'X') ? 'O' : 'X';\n }",
"public static String randChar(){\n int n = rand.nextInt(52);\n return String.valueOf(KEYBOARD.charAt(n));\n }",
"char permute(char p) {\n return _alphabet.toChar(permute(_alphabet.toInt(p)));\n }",
"public static char casillaRandom() {\r\n char pool[] = {'b', 'p', 's', 'd'};\r\n\r\n int indiceRandom = (int) (Math.random() * 4);\r\n\r\n char selected = pool[indiceRandom];\r\n\r\n return selected;\r\n }",
"public static char playerChoice(){\n String str1; //temp string to hold players choice.\n char choice; //return value of players choice after parsing.\n \n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\");\n while(str1.length() == 0){\n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\");\n }\n \n choice = str1.charAt(0);\n choice = Character.toLowerCase(choice);\n while( choice != 'r' && choice != 'p' && choice != 's' && choice != 'l' && choice != 'x'){\n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\"); \n \n while(str1.length() == 0){\n str1 = JOptionPane.showInputDialog(\"Choose one of the following: (R)Rock, (P)Paper, (S)Scissors,\"+\n \"\\n(L)Lizard, (X)Spock\");\n }\n choice = str1.charAt(0);\n choice = Character.toLowerCase(choice); \n }\n\n \n return choice;\n }",
"public static String randChar(int l) {\n char [] replacement = {'&','#','%','!','@','?'};\n String out=\"\";\n var r=new Random();\n for(int i = 0; i <l;i++) {\n out+= replacement[r.nextInt(replacement.length)];\n }\n return out;\n }",
"void askForNumber(String spieler,String playerChoices) throws IOException;",
"private void shuffle(char[] digits, int i) {\n char d = digits[i];\n do {\n digits[i] = (char)(rand.nextInt(10) + '0');\n } while (d == digits[i]);\n }",
"private String generateInput() {\n Random rdm = new Random();\n int r, r_m, r_M, c = 0, c_max;\n String input = \"\";\n char ops[] = {'+', '-', '*', '/'};\n\n //r_m = 1;\n //r_M = 100;\n //c_max = rdm.nextInt(r_M - r_m + 1) + r_m;\n c_max = 4;\n\n if(c_max%2 == 0)\n c_max += 1;\n\n while(c < c_max){\n if(c%2 == 0){\n r_m = 0;\n //r_M = 1000;\n r_M = 9;\n r = rdm.nextInt(r_M - r_m + 1) + r_m;\n input += Integer.toString(r);\n } else {\n /* 4 operators [0-3] */\n r_m = 0;\n r_M = 3;\n /* get a random operation */\n r = rdm.nextInt(r_M - r_m + 1) + r_m;\n input += ops[r];\n }\n c++;\n }\n return input;\n }",
"public static char playRound() {\n\n String playerChoice = playerChoice();\n System.out.println(\"You chose: \" + playerChoice);\n\n Random rand = new Random();\n int compRand = rand.nextInt(3);\n String compChoice = new String();\n\n switch (compRand) {\n case 0:\n compChoice = \"rock\";\n break;\n case 1:\n compChoice = \"paper\";\n break;\n case 2:\n compChoice = \"scissors\";\n break;\n }\n\n char result = 'l';\n String resAnoun = \"Player loses!\";\n\n System.out.println(\"Player choice: \" + playerChoice + \" VS Computer Choice: \" + compChoice);\n\n if (playerChoice.equals(compChoice)) {\n result = 't';\n resAnoun = \"Draw!\";\n } else if (playerChoice.equals(\"rock\")) {\n if (compChoice.equals(\"scissors\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n } else if (playerChoice.equals(\"paper\")) {\n if (compChoice.equals(\"rock\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n } else if (playerChoice.equals(\"scissors\")) {\n if (compChoice.equals(\"paper\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n }\n System.out.println(resAnoun);\n\n return result;\n }",
"public static String randSym(){\n int n = rand.nextInt(rand.nextInt(83 - 52 + 1) + 52);\n return String.valueOf(KEYBOARD.charAt(n));\n }",
"char cipher(int charToCipher);",
"private void permutateDigits(){\r\n List<Integer> digits = new ArrayList<Integer>();\r\n for (int dig = 1; dig < 10; dig++)\r\n digits.add(dig);\r\n Collections.shuffle(digits);\r\n for (int row = 0; row < 9; row++)\r\n for (int col = 0; col < 9; col++)\r\n solution[row][col] = digits.get(solution[row][col]-1);\r\n }",
"public static String chooseCardsFromCollection() {\n System.out.println(\"Please select the pokemons you want. By their number and separated by a - (a dash).\");\n System.out.println(\"Ex : 1-6-23-3-87-34...\");\n System.out.println(\"NB: Only 60 ! No more, no less ;) \");\n return keyboardChoice.nextLine();\n }",
"private char generateRandomCharacter(){\n String alphabets = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n Random rand = new Random();\n int randomNumber = rand.nextInt(26);\n return alphabets.charAt(randomNumber);\n }",
"public int drawpseudocard(){\n Random random = new Random();\n return random.nextInt(9)+1;\n }",
"private static void convertNumericToRandomAlpha(StringBuffer buf)\n {\n byte byteLetter = 0;\n byte randomByte = 0;\n\n for (int letter = 0; letter < buf.length(); letter++)\n {\n\n // get the byte value of the number\n byteLetter = (byte) (buf.charAt(letter) - 48);\n if (byteLetter == 0)\n {\n byteLetter = 10;\n\n // generate a random number between 1 and 3 such that the number multiplied\n // by the byteLetter does not exceed 26. byteLetter of 0 is treated as 10.\n }\n randomByte = (byte) ((Math.round(Math.random() * 100)\n % ((byteLetter > 6) ? 2 : 3)));\n byteLetter = (byte) (byteLetter + (randomByte * 10));\n buf.setCharAt(letter, (char) (byteLetter + 96));\n }\n }",
"public static String randLower(){\n int n = rand.nextInt(26)*2 + 1;\n return String.valueOf(KEYBOARD.charAt(n));\n }",
"public static String randAlnumSym(){\n int n;\n String result = null;\n switch (CAPS){\n case 0:\n n = rand.nextInt(94);\n if (n>83){\n result = String.valueOf(n-84);\n }else {\n result = String.valueOf(KEYBOARD.charAt(rand.nextInt(84))); //both\n }\n break;\n case 1:\n n = rand.nextInt(68);\n if (n>57){\n result = String.valueOf(n-58);\n }else if (n > 25){\n result = randSym();\n }else {\n result = randLower();\n }\n break;\n case 2:\n n = rand.nextInt(68);\n if (n>57){\n result = String.valueOf(n-58);\n }else if (n > 25){\n result = randSym();\n }else {\n result = randUpper();\n }\n break;\n }\n return result;\n }",
"private int aleatorizarNumero() {\n\t\tint aux;\n\t\taux = r.getIntRand(13) + 1;\n\t\treturn aux;\n\t}",
"public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}",
"String selectRandomSecretWord();",
"private String getByAsc(int index) {\n int asc = 0;\n for (int i = 7; i >= 0; i--) {\n int tempInt = this.code[++index] - 48;\n asc += tempInt * Math.pow(2, i);\n }\n char ret = (char) asc;\n return String.valueOf(ret);\n }",
"public int getGroup(char letter);",
"private static int createSelectedKey(int bBit) {\r\n\t\tRandom random = new Random();\r\n\t\tint maxKey = (int) Math.pow(2, bBit);\r\n\t\tint randomKey = random.nextInt((maxKey - 1) + 1) + 1;\t\r\n\t\treturn randomKey;\r\n\t}",
"int recuperar(int c);",
"public void digitPressed(int n) {\r\n if (this.entered.length() < 4) {\r\n this.entered += Integer.toString(n);\r\n //If it is the first digit entered, start ticking.\r\n if (this.entered.length() == 1) {\r\n this.ticks = 0;\r\n this.ticking = true;\r\n }\r\n\r\n else if (this.entered.length() == 4) {\r\n this.ticking = false;\r\n }\r\n }\r\n\r\n //Update the display.\r\n this.lockGui.setDisplay(this.entered);\r\n }",
"public static char playerInput(String player) {\r\n\t System.out.println(\"Enter the input to begin the game: X | O: \");\r\n\t char inputChar = value.next().charAt(0);\r\n\r\n\t return inputChar;\r\n\t }",
"public static int getChoiceFromFirstLetter(String fullChoice)\n {\n int choice = 0;\n if(fullChoice.length() > 0)\n {\n String firstLetter = fullChoice.substring(0, 1).toLowerCase();\n switch (firstLetter)\n {\n case \"r\":\n return Rock;\n\n case \"p\":\n return Paper;\n\n case \"s\":\n return Scissors;\n\n default:\n return 0;\n\n }\n }\n\n return choice;\n }",
"public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }",
"public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}",
"Rule Digit() {\n // No effect on value stack\n return CharRange('0', '9');\n }",
"private int convertCharNumtoNum(char charIn){\n\t\tint number = -1;\n\t\tint convertedNum = Character.getNumericValue(charIn);\n\t\t\n\t\tfor(int i: Seats.SEAT_NUMS){\n\t\t\tif(i == convertedNum){\n\t\t\t\tnumber = convertedNum; \n\t\t\t}\n\t\t}\n\t\treturn number;\n\t}",
"public static void main(String args[]) {\n Scanner s=new Scanner(System.in);\n char c=s.next().charAt(0);\n int k=s.nextInt();\n if(c=='c')\n {\n //char m='z';\n System.out.print(\"z \");\n return;\n }\n else if (c>='a' && c<='z')\n {\n int o=c+'a';\n o=(o-k)%26;\n c=(char)(o+'a');\n }\n else if(c>='A' && c<='Z')\n {\n int o=c+'A';\n o=(o-k)%26;\n c=(char)(o+'A');\n }\n System.out.print(c);\n }",
"private String shiftAlphabet(int key) {\n return ALPHABET.substring(key) + ALPHABET.substring(0, key);\n }",
"void circulardecode()\n{\nfor(i=0;i<s.length();i++)\n{\nc=s.charAt(i);\nk=(int)c;\nif(k==90)\nk1=65;\nelse\nif(k==122)\nk1=97;\nelse\nk1=k+1;\nc1=caseconverter(k,k1);\nSystem.out.print(c1);\n}\n}",
"private static int getX(char chr) {\n \t\tswitch (chr) {\n \t\tcase '1':\n \t\tcase '!':\n \t\tcase '~':\n \t\tcase '`':\n \t\tcase 'q':\n \t\tcase 'a':\n \t\tcase 'z':\n \t\t\treturn 0;\n \t\tcase '2':\n \t\tcase 'w':\n \t\tcase 's':\n \t\tcase 'x':\n \t\t\treturn 1;\n \t\tcase '#':\n \t\tcase '3':\n \t\tcase 'e':\n \t\tcase 'd':\n \t\tcase 'c':\n \t\t\treturn 3;\n \t\tcase '4':\n \t\tcase 'r':\n \t\tcase 'f':\n \t\tcase 'v':\n \t\t\treturn 4;\n \t\tcase '5':\n \t\tcase 't':\n \t\tcase 'g':\n \t\tcase 'b':\n \t\t\treturn 5;\n \t\tcase '6':\n \t\tcase 'y':\n \t\tcase 'h':\n \t\tcase 'n':\n \t\t\treturn 6;\n \t\tcase '7':\n \t\tcase 'u':\n \t\tcase 'j':\n \t\tcase 'm':\n \t\t\treturn 7;\n \t\tcase '8':\n \t\tcase 'i':\n \t\tcase 'k':\n \t\tcase ',':\n \t\t\treturn 8;\n \t\tcase '9':\n \t\tcase 'o':\n \t\tcase 'l':\n \t\tcase '.':\n \t\t\treturn 9;\n \t\tcase '-':\n \t\tcase '_':\n \t\tcase '+':\n \t\tcase '=':\n \t\tcase 'p':\n \t\tcase '/':\n \t\t\treturn 10;\n \t\tdefault:\n \t\t\treturn 11;\n \t\t}\n \t}",
"public static void NumeroCapicua(){\n\t\tint numero,resto,falta,invertido;\n\t\tString tomar;\n\t\tScanner reader = new Scanner(System.in);\n\t\tSystem.out.println(\"Ingrese un numero\");\n\t\tnumero=reader.nextInt();\n\t\tfalta=numero;\n\t\tinvertido=0;\n\t\tresto=0;\n\t\twhile(falta!=0){\n\t\t\tresto=(falta%10);\n\t\t\tinvertido=(invertido*10)+resto;\n\t\t\tfalta=(int)(falta/10);\n\t\t}\n\t\tif(invertido==numero){\n\t\t\tSystem.out.println(\"Es Capicua\");\n\t\t}else{\n\t\t\tSystem.out.println(\"No es Capicua\");\n\t\t}\n\t\tSystem.out.println(\"Desea regresar al menu anterior?\");\n\t\treader.nextLine();\n\t\ttomar=reader.nextLine();\n\t\tif(tomar.equals(\"si\")){\n\t\t\trepetidor=true;\n\t\t}else{\n\t\t\trepetidor=false;\n\t\t}\n\t}",
"public InputAction makeChoice() {\n int choice = (int) Math.floor(Math.random() * 12);\n if(choice < 6) {\n return new InputAction(player, InputAction.ActionType.WORK, null);\n } else {\n DirectionType direction = directionByNumber.get(choice);\n return new InputAction(player, InputAction.ActionType.EXPLORE, direction);\n }\n }",
"@Override\n\t\t\t\t\t\tpublic void actionPerformed( final ActionEvent e )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( strNumber.length() > 1 )\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\trestartTimer();\n\t\t\t\t\t\t\tstrNumber += \"\" + signChar;\n\t\t\t\t\t\t}",
"@Override\n public PlayingCard chooseCard() throws InterruptedException {\n\n boolean validInput = false;\n int max = hand.getSize();\n String inputStr;\n int inputInt = 0; // not ideal; but compiler is happier\n Scanner sc = new Scanner(System.in);\n\n while (!validInput) {\n this.hand.showCards();\n System.out.println(\"Choose a card from the above\");\n\n inputStr = Game.cleanStringInput(sc.nextLine());\n\n // only supports 0 ~ 9\n if (inputStr.matches(\"\\\\d\")) {\n\n if (inputStr.matches(\"0\")) {\n surrender(sc);\n inputStr = \"1\"; // to throw away last card\n }\n\n // - 1 is to allow usage of 1 - 9 for card selection instead\n // of 0 - 8...this converts card \"1\" into index 0.\n inputInt = (Integer.parseInt(inputStr)) - 1;\n\n // must be LESS than max...if size = 1, then \"max index\" == 0\n if (inputInt < max && inputInt >= 0) {\n validInput = true;\n } else {\n System.out.println(\"OOPS! Enter between 1 and \"\n + (max) + \"!\"); // \"between 1 and 1\" is acceptable\n Thread.sleep(1000);\n\n } // end check for acceptable index\n } else {\n System.out.println(\"OOPS! Enter a single digit ONLY!\");\n Thread.sleep(1000);\n } // end check for digit entered\n } // end \"while-loop\" check for valid input\n\n // if we're here, we can safely return the selected card\n return (PlayingCard) hand.removeCard(inputInt);\n }",
"private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }",
"public static char getKeyCharacter()\n {\n \n //Prompts and reads the key character in String\n final int MINIMUM_LENGTH = 0, MAXIMUM_LENGTH = 1;\n Scanner key = new Scanner(System.in);\n System.out.print(\"Please enter a single character to act as a key: \");\n String fh = key.nextLine();\n \n //Checks for key character length and loops for proper input\n while (fh.length() == MINIMUM_LENGTH|| fh.length() > MAXIMUM_LENGTH)\n {\t\n System.out.print(\"Please enter a single character to act as a key: \");\n fh = key.nextLine();\n }\n \n //Converts String to char\n char gKC = fh.charAt(0);\n return gKC;\n }",
"public static String getRandomAplhaNumeric(String characters) {\n\t\tSecureRandom secureRnd = new SecureRandom();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tsb.append(characters.charAt(secureRnd.nextInt(characters.length())));\n\t\treturn sb.toString();\n\t}",
"private char getRandomCharacter() {\n Random r = new Random();\n char c = (char)(r.nextInt(26) + 'A');\n if(characters.contains(c)) {\n return getRandomCharacter();\n } else {\n return c;\n }\n }",
"public static EnumCardNumber pickRandom() {\r\n\t\treturn values()[Tools.Numbers.randomInt(0, values().length - 1)];\r\n\t}",
"public void makeGuess() {\n columnGuess = ((int) (Math.random() * 100000)) % 10;\n\n int number = ((int) (Math.random() * 100000)) % 10;\n rowGuess = (char) (number + 65);\n }",
"java.lang.String getNum2();",
"private String symbol() {\n switch (this.suit) {\n case 1:\n return \"♣\";\n case 2:\n return \"♦\";\n case 3:\n return \"♥\";\n case 4:\n return \"♠\";\n default:\n throw new IllegalArgumentException(\"Invalid Suit\");\n }\n }",
"int getCap();",
"@Override\n public String apply(Integer i) {\n List<Character> list = new ArrayList<>();\n RandomStrings rnd = new RandomStrings();\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < i ; j++) {\n list.add((char)rnd.generateNumberAscii());\n }\n for (Character character : list) {\n sb.append(character);\n }\n return sb.toString();\n }",
"public String getLowestChromKey();",
"public static void main(String args[]) {\n \nScanner sc = new Scanner(System.in);\n\nint n = sc.nextInt();\n\nint i=1; int j=0;\nchar p;\nwhile (i<=n) {\n j=1;\n p = (char) ('A' + i - 1);\n while (j<=n) {\n \n System.out.print(p);\n p=(char)(p+1);\n j=j+1;\n\n }\nSystem.out.println();\ni=i+1;\n}\nsc.close();\n}",
"private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}",
"private static int letterToNumber(String str) {\n return (\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".indexOf(str))%26+1;\n }",
"public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }",
"void overflowDigits() {\n for (int i = 0; i < preDigits.length(); i++) {\n char digit = preDigits.charAt(i);\n // This could be implemented with a modulo, but compared to the main\n // loop this code is too quick to measure.\n if (digit == '9') {\n preDigits.setCharAt(i, '0');\n } else {\n preDigits.setCharAt(i, (char)(digit + 1));\n }\n }\n }",
"private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}",
"public static String randomSelection() {\n int min = 1;\n int max = 3;\n String randomSelection;\n Random random = new Random(System.currentTimeMillis());\n int randomNumber = random.nextInt((max - min) +1) +min;\n if(randomNumber == 1) {\n randomSelection = \"rock\";\n } else if (randomNumber == 2) {\n randomSelection = \"paper\";\n } else {\n randomSelection = \"scissors\";\n }\n return randomSelection;\n }",
"private static String makeLatinName(int len, Random r) {\n final String lc = \"abcdefghijklmnopqrstuvwxyz\";\n final String alphabet = lc + lc.toUpperCase();\n final String start = \"$_\" + alphabet;\n final String part = start + \"0123456789\";\n\n StringBuffer sb = new StringBuffer();\n sb.append(start.charAt(r.nextInt(start.length())));\n while (sb.length() < len)\n sb.append(part.charAt(r.nextInt(part.length())));\n return sb.toString();\n }",
"private void scanTicket(){\r\n\t\ttext = numberField.getText();\r\n\t\t//Number field text is converted into char \r\n\t\tstringToChar(text);\r\n\t\tif(executed == false){\r\n\t\t\trandom();\r\n\t\t}\r\n\t}",
"private void repeatingCharacter(String input) {\n\t\tMap<Character,Integer> map = new HashMap<Character,Integer>();\n\t\t//O[n]\n\t\tfor (int i = 0; i < input.length(); i++) {\n\t\t\tmap.put(input.charAt(i),map.getOrDefault(input.charAt(i), 0)+1);\n\t\t}\n\t\t//o[n]\n\t\tint max = Collections.max(map.values());\n\t\tint secondMax = 0;\n\t\tchar output = 0;\n\t\t//o[n]\n\t\tfor(Map.Entry<Character, Integer> a : map.entrySet()) {\n\t\t\tif(a.getValue()<max && a.getValue()>secondMax) {\n\t\t\t\tsecondMax = a.getValue();\n\t\t\t\toutput = a.getKey();\n\t\t\t}\n\t\t}\n\t\tif(!(secondMax == max)) {\n\t\t\tSystem.out.println(output);\n\t\t}else {\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"private static String bigIntegerNChooseRModP(int N, int R, int P) {\n if (R == 0) return \"1\";\n BigInteger num = BigInteger.ONE;\n BigInteger den = BigInteger.ONE;\n while (R > 0) {\n num = num.multiply(BigInteger.valueOf(N));\n den = den.multiply(BigInteger.valueOf(R));\n BigInteger gcd = num.gcd(den);\n num = num.divide(gcd);\n den = den.divide(gcd);\n N--;\n R--;\n }\n num = num.divide(den);\n num = num.mod(BigInteger.valueOf(P));\n return num.toString();\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.d(\"vggg\", \"bjbjb\");\r\n\t\t\t\tgetnumber_Fourgroup6_xuan_clear();\r\n\t\t\t\tgetrand();\r\n\t\t\t\tfor (int i = 0; i < 2; i++) {\r\n\t\t\t\t\tint xuan = rand[i];\r\n\t\t\t\t\tswitch (xuan) {\r\n\t\t\t\t\tcase 0:\r\n\r\n\t\t\t\t\t\tselectxuan0();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tselectxuan1();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tselectxuan2();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tselectxuan3();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\tselectxuan4();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\tselectxuan5();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\tselectxuan6();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\tselectxuan7();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\tselectxuan8();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 9:\r\n\t\t\t\t\t\tselectxuan9();\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}",
"private String getToken() {\n\t\tString numbers = \"0123456789\";\n\t\tRandom rndm_method = new Random();\n String OTP = \"\";\n for (int i = 0; i < 4; i++)\n {\n \tOTP = OTP+numbers.charAt(rndm_method.nextInt(numbers.length()));\n \n }\n return OTP;\n\t}",
"public static void main(String[] args) {\r\n long randomNumber = System.currentTimeMillis();\r\n // Get number less than 26\r\n randomNumber = randomNumber % 26;\r\n \r\n // add 65 to the number\r\n randomNumber += 65;\r\n System.out.println((char) randomNumber);\r\n }",
"private char readChar() \n {\n \n String uInput = null;//user input\n do//do while loop to wait for a charater\n {\n try//collect user input\n {\n uInput = br.readLine();\n }\n catch(IOException ioe)//catch IOE\n {\n System.out.println(\"IO error trying to read number. Exiting now\");\n System.exit(1);\n }\n if(uInput.charAt(0)=='?')//special case for ? symbol\n {\n return uInput.charAt(0);\n }\n if(!Character.isLetter(uInput.charAt(0)))//check for charater\n {\n System.out.println(\"Invalid input, use ? for a list of commands\");\n System.out.printf(\"=> \");\n }\n }\n while(!Character.isLetter(uInput.charAt(0)));\n\n return uInput.charAt(0);//return character input\n \n }",
"public char crypt(char letter){\n\n char l = conns[alphabet.indexOf(letter)];\n\n return l;\n }",
"private static String digitarNombre() {\n\t\tString nombre;\n\t\tSystem.out.println(\"Digite el nombre del socio: \");\n\t\tnombre = teclado.next();\n\t\treturn nombre;\n\t}",
"public static int f_number_user(){\n Scanner keyboard=new Scanner(System.in);\r\n int digits;\r\n System.out.println(\"input the entire number \");\r\n digits=keyboard.nextInt();\r\n return digits;\r\n }",
"protected char randomChar(int length) {\n\n int randomLetter = (int) (Math.random() * length);\n char letter = this.alphabet[randomLetter];\n return letter;\n }",
"private int getChoice() {\n\t\tif (vsComputer) {\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Enter choice: \");\n\t\t\t\tint ch;\n\t\t\t\ttry {\n\t\t\t\t\tch = sc.nextInt();\n\t\t\t\t} catch (InputMismatchException e) {\n\t\t\t\t\tSystem.out.println(\"Invalid Choice\\n\");\n\t\t\t\t\tsc.nextLine();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 1, 2, 3 -> {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\treturn ch-1;\n\t\t\t\t\t}\n\t\t\t\t\tdefault -> System.out.println(\"Invalid Choice\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn random.nextInt(3);\n\t\t}\n\t}",
"@Override\n public String generateRoshambo(String input) {\n\n return \"Rock\";\n\n }",
"private static Set<Integer> getRadix(String number) {\n Set<Integer> result = new HashSet<>();\n for(int i=2;i<=36;i++) {\n try {\n String poly = (new BigInteger(number)).toString(i);\n String polyLeft = poly.substring(0, (poly.length() + 1) / 2);\n String polyRight = poly.substring((poly.length() ) / 2 );\n //System.out.println(i+\":\"+poly+\" \"+polyLeft+\"=\"+polyRight);\n if (polyLeft.equalsIgnoreCase((new StringBuffer(polyRight)).reverse().toString())) {\n result.add(i);\n }\n } catch (Exception e) {};\n }\n return result;\n }",
"private int randomPiece() {\n return (int)(Math.random()*N_PIECES);\n }",
"public static char randomLetter(){\n\t\t//char A-Z\n\t\tint r1 = (int) (Math.random()*26+65);\n\n\t\t//char a-z\n\t\tint r2 = (int) (Math.random()*26+97);\n\n\t\t//choose one of the two\n\t\tif(Math.random() < 0.5)\n\t\t\treturn (char) r1;\n\t\treturn (char) r2;\n\t}",
"public static char toSymbol(int value) {\n char symbol;\n if (value < 10 && value > 1) {\n symbol = (char)(value + '0');\n } else if (value == 10) {\n symbol = 'T';\n } else if (value == 11) {\n symbol = 'J';\n } else if (value == 12) {\n symbol = 'Q';\n } else if (value == 13) {\n symbol = 'K';\n } else if (value == 14) {\n symbol = 'A';\n } else {\n System.err.println(\"Error: invalid value\");\n symbol = 'X';\n }\n \n return symbol;\n }",
"void insertDigit(int digit);",
"public static char promptForChar(String prompt, char min, char max) {\n\n char charmander = '-';\n boolean invalidInput = false;\n String input = null;\n int minChar = (int) min, maxChar = (int) max, inputChar = 0;\n\n if(minChar > maxChar) throw new IllegalArgumentException(\"min cannot be greater than max.\");\n if(prompt == null) throw new IllegalArgumentException(\"prompt cannot be null.\");\n do{\n input = receiveInput(prompt + String.format(\"(%s-%s)\", min, max));\n invalidInput = input.length() != 1;\n if (invalidInput) {\n System.out.println(\"Please Enter only one character\");\n } else {\n charmander = input.charAt(0);\n inputChar = charmander;\n invalidInput = inputChar < minChar || inputChar > maxChar;\n if (invalidInput) {\n System.out.println(\"Please Enter a Character that value is between \" + min + \" and \" + max);\n }\n }\n }while (invalidInput);\n return charmander;\n }",
"private char getSampledBaseForPosition(int pos) {\n double[] freq=pwm[pos];\n double chosen=Math.random();\n if (chosen==0) chosen=1.0; // a value of 0 is not allowed here but a value of 1 is\n double sum=0;\n for (int i=0;i<freq.length;i++) {\n sum+=freq[i];\n if (chosen<=sum) return bases[i];\n }\n return 'N'; // this should not happen! (unless all bases have frequency=0)\n }",
"private static String accountNumberGenerator() {\n char[] chars = new char[10];\n for (int i = 0; i < 10; i++) {\n chars[i] = Character.forDigit(rnd.nextInt(10), 10);\n }\n return new String(chars);\n }",
"public char randomChar() {\n\t\tRandom r = new Random();\n\t\tint threshold = r.nextInt(total);\n\t\tint current = 0;\n\t\t\n\t\tfor (char c : letters.keySet()) {\n\t\t\tcurrent += letters.get(c);\n\t\t\tif (current > threshold) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ' ';\n\t}",
"private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}",
"public static void luckyNumber() {\n System.out.println(\"What is your lucky number? \");\n int luckyNum = sc.nextInt(); \n }",
"private int pickPurpleChampion(String cN) {\n\t\tif (bannedChamps.contains(cN) || bluePicks.contains(cN) || purplePicks.contains(cN)) {\n\t\t\treturn -1;\n\t\t}\n\t\tURL url = getClass().getResource(\".coredata/championicons/\" + cN + \"Square.png\");\n\t\tImageIcon champIcon = new ImageIcon(Toolkit.getDefaultToolkit().getImage(url));\n\t\tJLabel champLabel = new JLabel();\n\t\tchampLabel.setIcon(champIcon);\n\t\trightPanel.add(champLabel, new Integer(2));\n\t\tint i = numPurplePicks;\n\t\tchampLabel.setBounds(118, 22 + 99*i, 64, 64);\n\t\tpurplePicks.add(cN);\n\t\tnumPurplePicks += 1;\n\t\treturn 0;\n\t}",
"public char getSymbol() {\n switch (player) {\n case 0:\n return 'O';\n case 1:\n return 'X';\n default:\n return '+';\n }\n }",
"short digits();",
"public List<String> letterCombinations(String digits) {\n\t \n\t recurse(digits, \"\");\n\t return ans; \n\t}",
"private char getBestBaseForPosition(int pos) {\n double[] freq=pwm[pos];\n double best=0;\n for (int i=0;i<freq.length;i++) if (freq[i]>best) best=freq[i];\n int count=0; // number of bases with this frequency\n for (int i=0;i<freq.length;i++) if (freq[i]==best) count++;\n // now select one of these at random\n int chosen=(int)(Math.random()*count); // chosen is now 0,1,2 or 3 (with max value depending on how many had the highest frequency)\n count=0;\n for (int i=0;i<freq.length;i++) {\n if (freq[i]==best) count++;\n if (count>chosen) return bases[i];\n }\n return 'N'; // this should not happen!\n }"
] | [
"0.5993484",
"0.57976913",
"0.57699513",
"0.5724601",
"0.5689949",
"0.56746066",
"0.565439",
"0.5636447",
"0.55990744",
"0.55891544",
"0.5581645",
"0.55457187",
"0.55179805",
"0.5498342",
"0.5494366",
"0.54646814",
"0.54584974",
"0.54532",
"0.54369056",
"0.540364",
"0.5383497",
"0.53366446",
"0.53298235",
"0.5319159",
"0.5318079",
"0.5313816",
"0.531178",
"0.53013784",
"0.52495533",
"0.523849",
"0.5225724",
"0.5220164",
"0.52092195",
"0.5205566",
"0.52020967",
"0.5201749",
"0.51949227",
"0.516051",
"0.51549697",
"0.5131694",
"0.5125545",
"0.51193714",
"0.51160204",
"0.5108949",
"0.5105939",
"0.50986075",
"0.5090394",
"0.50792754",
"0.5078718",
"0.50654715",
"0.5063455",
"0.50567067",
"0.50559974",
"0.5046576",
"0.5045221",
"0.5039426",
"0.5034302",
"0.50279",
"0.5025164",
"0.50176305",
"0.501492",
"0.49995723",
"0.49977946",
"0.49974328",
"0.49745324",
"0.49735972",
"0.4971703",
"0.49713734",
"0.49708155",
"0.49703294",
"0.49673563",
"0.49670815",
"0.49669716",
"0.4957188",
"0.49554706",
"0.49500492",
"0.4947745",
"0.49451354",
"0.49428967",
"0.49403358",
"0.49316576",
"0.4930526",
"0.49270087",
"0.4912224",
"0.491154",
"0.49100766",
"0.49017718",
"0.48986897",
"0.4888203",
"0.48875284",
"0.48772642",
"0.48767483",
"0.48721465",
"0.48720482",
"0.4870542",
"0.48681182",
"0.48666844",
"0.486018",
"0.4858172",
"0.48558903",
"0.48543578"
] | 0.0 | -1 |
int number = 0; | public void optionsListMenu(int number) {
switch (number) {
case 1:
showFilterByMake();
break;
case 2:
showFilterByModel();
break;
case 3:
showFilterByBudget();
break;
case 4:
backToPreviousMenu();
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int number() {\n return number;\n }",
"int getNumber () { return number; }",
"public void setNumber(int number)\n {\n Number = number;\n }",
"public int getNumber(){\n\treturn number;\n }",
"void setNumber(int num) {\r\n\t\tnumber = num;\r\n\t}",
"public int getNumber(){\n\t\treturn number;\n\t}",
"public int getNumber(){return number;}",
"public void setNumber(int number) {\r\n\t\tthis.num = number;\r\n\t}",
"public void setNumber(int number)\n {\n this.number = number;\n }",
"public int getDefault(){\n return number;\n }",
"public int getNumber(){\r\n return num;\r\n }",
"public void setNumber(int number) {\n this.number = number;\n }",
"public int getNumber()\n {\n return number;\n}",
"public int getNumber() {\n return number;\n }",
"public int getNumber() {\r\n return number;\r\n }",
"public void setNumber(int number) {\r\n\t\tthis.number = number;\r\n\t}",
"public int getNumberValue() {\r\n return number;\r\n }",
"public void setNumber(int number) {\n\t\tthis.number = number;\n\t}",
"public void setNumber(int number) {\n\t\tthis.number = number;\n\t}",
"public void setNumber(int number) {\n\t\tthis.number = number;\n\t}",
"public int getValue(){\n return number;\n }",
"public Number number() {\n return number;\n }",
"public void setNumber(Integer number) {\r\n this.number = number;\r\n }",
"public long getNumber(){\n return number;\r\n }",
"private\tNum(int num) { value = num; }",
"public void setNumber(Integer number) {\n this.number = number;\n }",
"public int getNumber() {\r\n\t\treturn number;\r\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber()\n {\n return this.number;\n }",
"public int getNumber()\n\t{\n\t\treturn myNumber;\n\t}",
"public int getNumber() {\n return this.number;\n }",
"private static int getNumber() {\n LOG.info(\"Generating Value\");\n return 1 / 0;\n }",
"public final int getNumber() {\n return number;\n }",
"public int getNumber() {\r\n return Number;\r\n }",
"public int getNumber() {\n return this.number;\n }",
"public Integer getNumber() {\n return number;\n }",
"protected void setNumbertoZero() {\n\t\tnumber = 0;\n\t}",
"public int getNumber() {\n\t\t\n\t\treturn number;\n\t}",
"public Integer getNumber() {\r\n return number;\r\n }",
"public void setCounter(int number){\n this.counter = number;\n }",
"public Numbers(int number) {\r\n\t\tthis.number = number;\r\n\t}",
"public int n(){\n return n;\n }",
"public Integer getNumber() {\n\t\treturn number;\n\t}",
"public Happy_Number()\r\n\t{\r\n\t\tnumberHolder = new int[20];\r\n\t\tfor(int ii = 0; ii < numberHolder.length; ii++)\r\n\t\t{\r\n\t\t\tnumberHolder[ii] = 0;\r\n\t\t}\r\n\t}",
"public int getNum()\n {\n return num;\n }",
"public int getNum()\n {\n return num;\n }",
"int promptNumber();",
"public int getCurrentNumber()\r\n\t{\r\n\t\treturn currentNumber;\r\n\t}",
"public int getNum() { return Num;}",
"int getFirstNumber();",
"public Number(int n) \n {\n nn = n; // initailize with the inputed value\n }",
"private int getNumero() {\n\t\treturn numero;\n\t}",
"public int getNumber() {\n\t\treturn i;\r\n\t}",
"public int get_num_p(){ return num_p; }",
"public int getNum() {\r\n return num;\r\n }",
"int getN();",
"public int getNumber() {\n\t\treturn 666;\n\t}",
"public void setNum(int num) {\r\n this.num = num;\r\n }",
"private final int initializeInt() {\n\t\treturn 0;\r\n\t}",
"public void setNumber(String number) {\n this.number = number;\n }",
"public String number() {\n return number;\n }",
"public String getNumber(){return number;}",
"public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}",
"public static int setStudentNumber(){\n countNumbers++;//1 2 3\n return countNumbers;\n\n }",
"public String getNumber(){\r\n return number;\r\n }",
"public void setNumber(String number) {\r\n\t\tthis.number = number;\r\n\t}",
"public String getNumber() {\n return number;\n }",
"public String getNumber() {\n return number;\n }",
"public String getNumber() {\n return number;\n }",
"public String getNumber() {\n return number;\n }",
"public static int nextInt() {\n\treturn 0;\r\n}",
"private static String findNumber() {\n\t\treturn null;\r\n\t}",
"public int getNumPeople(){\r\n int num = 0;\r\n return num;\r\n }",
"public void setNum(Integer num) {\n this.num = num;\n }",
"public void setNum(Integer num) {\n this.num = num;\n }",
"public intHolder(int number)\n {\n storageInt=number;\n \n }",
"public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }",
"public String getNumber() \n\t{\n\t\treturn this.number;\n\t}",
"public static void SetNewNumber () {\n number = (int)(Math.random() * 9.1);\r\n\r\n // PROMPT THE USER\r\n System.out.println(\"A new number has been chosen.\");\r\n System.out.println();\r\n\r\n // SAVED ME WHEN DEBUGGING\r\n // System.out.println(number);\r\n }",
"public void setNum(int num) {\n\t\tthis.num = num;\n\t}",
"public String getNumber() {\r\n\t\treturn number;\r\n\t}",
"static int addZero(int num, int n) {\n\t\t\t\n\t\t\treturn 0;\n\t\t}",
"@Override\n\tpublic double saveNumber()\n\t{\n\t\treturn num;\n\t}",
"public java.lang.Integer getNum () {\r\n\t\treturn num;\r\n\t}",
"int getNo() {\n\t\treturn no;\n\t}",
"int getNum1();",
"public int getNum() {\n return this.num;\n }",
"void nuevo(int numero);",
"public int getNumero() {\n return numero;\n }",
"public int getNum() {\n\t\treturn num;\n\t}",
"public Factorial(int number) {\n\t\tthis.number = number;\n\t}",
"private void record_number(double number) {\n\t\tcalculate_number = number;\n\t}",
"public Counter() {\r\n value = 0;\r\n }",
"public int getNum();",
"public void setNum (java.lang.Integer num) {\r\n\t\tthis.num = num;\r\n\t}",
"private static void setCounter() {++counter;}",
"void mo107677b(Integer num);",
"private int getMY() {\n\t\treturn 0;\r\n\t}"
] | [
"0.709438",
"0.70010084",
"0.6945177",
"0.6921187",
"0.6896732",
"0.68863595",
"0.6801239",
"0.6741993",
"0.6711298",
"0.6700403",
"0.66929173",
"0.66726977",
"0.66701293",
"0.6664574",
"0.66504157",
"0.6633711",
"0.6629753",
"0.66187906",
"0.66187906",
"0.66187906",
"0.66102",
"0.6593826",
"0.65906304",
"0.65868163",
"0.6585418",
"0.6583548",
"0.65455604",
"0.65313256",
"0.65313256",
"0.65313256",
"0.65313256",
"0.65284806",
"0.6519517",
"0.6507659",
"0.64466465",
"0.64175314",
"0.64000916",
"0.63815755",
"0.636165",
"0.63607025",
"0.63494337",
"0.63482803",
"0.63186175",
"0.6296604",
"0.6276412",
"0.6261885",
"0.62190205",
"0.6202061",
"0.6202061",
"0.6176943",
"0.6162255",
"0.61017644",
"0.61016774",
"0.6088085",
"0.6086272",
"0.6076267",
"0.60677916",
"0.60326624",
"0.60312486",
"0.6029238",
"0.6018693",
"0.60041744",
"0.59972113",
"0.5994089",
"0.5992376",
"0.5975717",
"0.59548146",
"0.5953794",
"0.59535134",
"0.5951868",
"0.5951868",
"0.5951868",
"0.5951868",
"0.5944557",
"0.5920746",
"0.5917641",
"0.5907323",
"0.5907323",
"0.5890575",
"0.5880996",
"0.5879399",
"0.5878723",
"0.5873523",
"0.5868167",
"0.58482397",
"0.58435124",
"0.5832863",
"0.58312935",
"0.58269584",
"0.58216643",
"0.58184516",
"0.5812495",
"0.5810093",
"0.5809258",
"0.580575",
"0.5770394",
"0.57655555",
"0.5749746",
"0.5748305",
"0.57465166",
"0.5743609"
] | 0.0 | -1 |
code for configuring the back button back button returns to submit_claim page | private void configureBackButton(){
Button backButton = (Button) findViewById(R.id.backButton);
backButton.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
//TODO add the code that erases saved login key
//opens login page and closes home page stack
startActivity(new Intent(homePage.this, MainActivity.class));
finish();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void back()\n\t{\n\t\tdriver.findElementById(OR.getProperty(\"BackButton\")).click();\n\t}",
"private void setupBack() {\n\t\tmakeButton(\"Back\", (ActionEvent e) -> {\n\t\t\tchangeView(\"login\");\n\t\t});\n\t}",
"@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}",
"public void click_defineSetupPage_backBtn() throws InterruptedException {\r\n\t\tclickOn(DefineSetup_backBtn);\r\n\t\tThread.sleep(1000);\r\n\t}",
"void onGoBackButtonClick();",
"@Override\n\tpublic void backButton() {\n\n\t}",
"public void goBack() {\n goBackBtn();\n }",
"public void clickBackButton() {\n\t\tbackButton.click();\n\n\t}",
"@Override\n\tpublic void goToBack() {\n\t\tif(uiHomePrestamo!=null){\n\t\tuiHomePrestamo.getHeader().getLblTitulo().setText(constants.prestamos());\n\t\tuiHomePrestamo.getHeader().setVisibleBtnMenu(true);\n\t\tuiHomePrestamo.getContainer().showWidget(1);\n\t\t}else if(uiHomeCobrador!=null){\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tuiHomeCobrador.getContainer().showWidget(2);\n\t\t\tuiHomeCobrador.getUiClienteImpl().cargarClientesAsignados();\n\t\t\tuiHomeCobrador.getUiClienteImpl().reloadTitleCobrador();\n\t\t}\n\t}",
"@Override\r\n public void onBackPressed() {\r\n \t// Handle the back button click event such that if user \r\n \t// is performing an IMCI or CCM assessment then a confirmation dialog \r\n \t// will be displayed to confirm that the user wishes to exit the \r\n \t// patient assessment\r\n \texitAssessmentDialogHandler();\r\n }",
"@Override\n public void onBackPressed() {\n changeForm(R.id.btnSignInForm);\n }",
"private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }",
"public void back() {\n Views.goBack();\n }",
"public void clickbtnBack() {\n\t\tdriver.findElement(btnBack).click();\n\t}",
"public static void clickBackBtn() {\t\n\t\ttry {\n\t\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"backquest\\\"]\")).click();\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Back button doesnt work\");\n\t\t}\n\t}",
"@Secured(\"@\")\n public void doBackPage() {\n infoOrderDetail = false;\n haveDepositPrice = false;\n orderStockTag.resetOrderStock();\n }",
"public void navigateToBack() {\n WebDriverManager.getDriver().navigate().back();\n }",
"@Override\n public void onBackPressed() {\n if(web.canGoBack()){\n web.goBack();\n } else {\n super.onBackPressed();\n }\n }",
"protected void handleBack(ActionEvent event) {\n\t}",
"@Override\r\n\tpublic void beforeNavigateBack(WebDriver arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic void afterNavigateBack(WebDriver arg0) {\n\n\t}",
"@Override\n public void backButton() {\n\n\n }",
"public Finland_HomePage clickbsrBackBtn() throws Throwable {\r\n\t\ttry {\r\n\t\t\tclickBrowserBackButton();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn new Finland_HomePage();\r\n\t}",
"private void backActionPerformed(ActionEvent e) {\r\n ctr_pres.principal();\r\n setVisible(false);\r\n }",
"private void backButtonAction() {\n CurrentUI.changeScene(SceneNames.LOGIN);\n }",
"@Override\n public void onSubmit()\n {\n Page page = ((DccdSession)Session.get()).getRedirectPage(RegistrationPage.class);\n if (page != null)\n {\n \tlogger.debug(\"Back to Page class: \" + page.getClass().getSimpleName());\n \tsetResponsePage(page);\n }\n else\n {\n \t// Homepage seems a good fallback\n \tsetResponsePage(HomePage.class);\n }\n }",
"public void back(){\n\t\tswitch(state){\n\t\tcase LOGINID:\n\t\t\tbreak; //do nothing, already at top menu\n\t\tcase LOGINPIN:\n\t\t\tloginMenu();\n\t\t\tbreak;\n\t\tcase TRANSACTION:\n\t\t\tbreak; //do nothing, user must enter the choice to log out\n\t\tcase DEPOSIT:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase DEPOSITNOTIFICATION:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAW:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase BALANCE:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAWALNOTIFICATION:\n\t\t\tbreak; //do onthing, user must press ok\n\t\t}\n\t\t\n\t\tcurrentInput = \"\";\n\t}",
"void actionBack();",
"public void backbutton(ActionEvent event) throws Exception{\n\t\t\n\t\tcustomermainpage main = new customermainpage();\n\t\tmain.setgui();\n\t}",
"public static void checkAndClickBackButton() {\r\n\t\tcheckNoSuchElementExceptionByID(\"backquest\", \"\\\"Back\\\" button\");\r\n\t\tcheckElementNotInteractableExceptionByID(\"backquest\", \"\\\"Back\\\" button\");\r\n\t}",
"private void returnBack()\n {\n getActivity().onBackPressed();\n }",
"@Override\n\tpublic void beforeNavigateBack(WebDriver arg0) {\n\n\t}",
"public static void navigateBack() {\n\t\tLOG.info(\"Navigate to back page from current page.\");\n\t\tConstants.driver.navigate().back();\n\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tbackButtonHandler();\r\n\t\treturn;\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tif (cmd == ConstantTool.PAY_SUCCESS) {\r\n\t\t\tIntent intent = new Intent(OrderList.this, Homemenu.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tBack();\n\t}",
"@Override\r\n public void afterNavigateBack(final WebDriver arg0) {\n\r\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\t\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\n\t\tnavigatetoAppointmentsListingScreen(\"false\");\n\t}",
"@Override\n public void goBack() {\n\n }",
"private void backPage()\n {\n page--;\n open();\n }",
"@Override\n\tpublic void onBackPressed()\n\t{\n\t}",
"public void handleBackButton(ActionEvent event) throws IOException {\n showUserAccountPage(event);\n }",
"@Override\n\tpublic void onBackPressed() {\n\n\t}",
"@Override\n \tpublic void onBackPressed() {\n \t}",
"@FXML\r\n private void handleBackButton() {\r\n\r\n CommonFunctions.showAdminMenu(backButton);\r\n\r\n }",
"@Override\r\n public void beforeNavigateBack(final WebDriver arg0) {\n\r\n }",
"@Override\n public void handleOnBackPressed() {\n }",
"public void back() {\n driver.navigate().back();\n }",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t}",
"public void onBackPressed() {\n C0486WU wu = this.f2780c;\n if (wu != null) {\n wu.mo1418b();\n }\n finish();\n Share_IP.super.onBackPressed();\n setResult(0, new Intent());\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}",
"private void onBack(McPlayerInterface player, GuiSessionInterface session, ClickGuiInterface gui)\r\n {\r\n session.setNewPage(this.prevPage);\r\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tdoBack();\r\n\t}",
"protected void goBack() {\r\n\t\tfinish();\r\n\t}",
"@Override\n public void onBackPressed() {\n logBackPressed();\n finishOk();\n }",
"@FXML\n public void backButtonPushed(ActionEvent event) throws IOException {\n View.goToView(\"SignUpOptionsPageView.fxml\", event);\n }",
"public void backToHome(){\n logger.debug(\"click on Back to Home button\");\n driver.findElement(oBackToHome).click();\n }",
"Request back();",
"private void configureBackButton() {\n LinearLayout layoutTop = (LinearLayout) findViewById(R.id.title);\n layoutTop.bringToFront();\n\n Button button = (Button) findViewById(R.id.backButton);\n button.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n finish();\n }\n });\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\texitApplication().onClick(null);\n\t\tsuper.onBackPressed();\n\t}",
"private void goBack() {\n Intent intent = new Intent(this, ReformTypeDetailActivity.class);\n intent.putExtra(Key.REFORM_TYPE_ID, mReformTypeId);\n intent.putExtra(Key.REFORM_TYPE_NAME, mReformType.getName());\n startActivity(intent);\n finish();\n }",
"@Override\r\n public void onBackPressed() {\n }",
"@Override\n\tpublic void onBackPressed()\n\t\t{\n\t\tbackPressed();\n\t\t}",
"@Override\n\tpublic void afterNavigateBack(WebDriver driver) {\n\t\t\n\t}",
"default public void clickBack() {\n\t\tclickMenu();\n\t}",
"public void onBackPressed() {\r\n }",
"private void navBack() {\n Intent intent = new Intent(this, standard_home.class);\n startActivity(intent);\n }",
"public static void back() {\n driver.navigate().back();\n }",
"@Override\n // Detect when the back button is pressed\n public void onBackPressed() {\n\n // Let the system handle the back button\n\n super.onBackPressed();\n\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\n\t\t\n\t}",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n if (mFormChanged) {\n saveForm();\n }\n }",
"@Override\n public void handleOnBackPressed() {\n Intent intent = new Intent(context, AdminSessionEdit.class);\n startActivity(intent);\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tcheckSavePwd();\n\t\tsuper.onBackPressed();\n\t}",
"public void back(ActionEvent actionEvent) throws IOException {\n new PageLoader().load(\"Login\");\n }",
"private String doGoBack( HttpServletRequest request )\r\n {\r\n String strJspBack = request.getParameter( StockConstants.MARK_JSP_BACK );\r\n\r\n return StringUtils.isNotBlank( strJspBack ) ? ( AppPathService.getBaseUrl( request ) + strJspBack )\r\n : ( AppPathService.getBaseUrl( request ) + JSP_MANAGE_CATEGORYS );\r\n }",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t}",
"@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t}",
"@Override\n public void handleOnBackPressed() {\n navController.navigateUp();\n }",
"@Override\n public void onBackPressed() {\n exitReveal();\n\n super.onBackPressed();\n }",
"@Override\n\tpublic void onBackPressed() {\n\t\tIntent i = new Intent(this, PayOptions.class);\n\t\tstartActivity(i);\n\t\treturn;\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\treturn;\n\t}",
"@Override\n\tpublic void beforeNavigateBack(WebDriver driver) {\n\t\t\n\t}",
"public Dist_Germany_HomePage clickbsrBackBtn() throws Throwable {\n\t\ttry {\n\t\t\tclickBrowserBackButton();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn new Dist_Germany_HomePage();\n\t}",
"public void navigate_back() throws CheetahException {\n\t\ttry {\n\t\t\tCheetahEngine.getDriverInstance().navigate().back();\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}",
"public void onBackPressed() {\n backbutton();\n }",
"public void back(){\n\t\tif(validaEditText(R.string.Registro_manual_llena_todos_los_campos)){\n\t\t\tif(guardaLasPreferencias()){\n\t\t\t\t\tDialogos.Toast(RegistroContactosEmergenciaActivity.this, getResources().getString(R.string.Registro_manual_datos_guardados), Toast.LENGTH_SHORT);\n\t\t\t\t\tsuper.onBackPressed();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n public void onBackPressed() {\n replaceUseCase(meetingManager);\n replaceUseCase(traderManager);\n super.onBackPressed();\n }"
] | [
"0.72859526",
"0.72294074",
"0.7199831",
"0.7175125",
"0.7059417",
"0.7039439",
"0.69342583",
"0.68973064",
"0.6880644",
"0.6876561",
"0.6870244",
"0.6853894",
"0.68410534",
"0.6837092",
"0.68353105",
"0.67959285",
"0.6795017",
"0.6777359",
"0.67662585",
"0.67655987",
"0.67592925",
"0.6755774",
"0.67525727",
"0.6706841",
"0.66919595",
"0.6687583",
"0.66778886",
"0.6674696",
"0.66653",
"0.66618454",
"0.6658434",
"0.66564983",
"0.6652125",
"0.66439754",
"0.66254276",
"0.66227835",
"0.6616069",
"0.660919",
"0.6607816",
"0.6601258",
"0.6596569",
"0.6585091",
"0.6580836",
"0.6573249",
"0.65619916",
"0.6561472",
"0.6558054",
"0.6556067",
"0.6555446",
"0.6549332",
"0.6549332",
"0.6549332",
"0.6549332",
"0.6547601",
"0.65438956",
"0.65438956",
"0.65430635",
"0.65354836",
"0.65308017",
"0.65141845",
"0.65074396",
"0.65058523",
"0.6502772",
"0.6498496",
"0.64984196",
"0.6492138",
"0.6491497",
"0.6488573",
"0.6485696",
"0.6483067",
"0.64813787",
"0.6480593",
"0.6477309",
"0.6477242",
"0.64749366",
"0.647088",
"0.64335674",
"0.6428536",
"0.6422753",
"0.6407059",
"0.64060384",
"0.64060384",
"0.6399317",
"0.6397063",
"0.6396523",
"0.63964576",
"0.6388752",
"0.63884205",
"0.63812155",
"0.6380982",
"0.63804686",
"0.6377833",
"0.6377833",
"0.6377833",
"0.6377833",
"0.6377833",
"0.6377833",
"0.6377833",
"0.6377833",
"0.6365959"
] | 0.70794064 | 4 |
TODO add the code that erases saved login key opens login page and closes home page stack | @Override
public void onClick(View view){
startActivity(new Intent(homePage.this, MainActivity.class));
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void configureBackButton(){\n Button backButton = (Button) findViewById(R.id.backButton);\n backButton.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View view){\n //TODO add the code that erases saved login key\n\n //opens login page and closes home page stack\n startActivity(new Intent(homePage.this, MainActivity.class));\n finish();\n\n }\n });\n }",
"private void GoToLogin() {\n\t\tstartActivity(new Intent(this, LoginActivity.class));\r\n\t\tapp.user.sessionID = \"\";\r\n\t\tMassVigUtil.setPreferenceStringData(this, \"SESSIONID\", \"\");\r\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tcheckSavePwd();\n\t\tsuper.onBackPressed();\n\t}",
"@Override\n\tpublic void goToLogin() {\n\t\t\n\t}",
"private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }",
"public void logoutpackged() {\n\n editor.remove(IS_LOGIN);\n editor.remove(KEY_NAME);\n editor.remove(KEY_EMAIL);\n editor.remove(KEY_ID);\n// editor.remove(KEY_IMAGEURI);\n editor.remove(PROFILE_IMG_URL);\n editor.remove(PROFILE_IMG_PATH);\n// editor.remove(KEY_LANGUAGE);\n editor.commit();\n\n /* Intent i = new Intent(context, SelectLanguage.class);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n context.startActivity(i);\n ((Activity) context).finish();*/\n\n }",
"public void backToLoginWindow(ActionEvent event) {\n loadLogin();\n // hides current stage (window)\n ((Node) (event.getSource())).getScene().getWindow().hide();\n\n }",
"private void takeUserToLoginScreenOnUnAuth() {\n Intent intent = new Intent(BaseActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"public void back(){\n\t\tswitch(state){\n\t\tcase LOGINID:\n\t\t\tbreak; //do nothing, already at top menu\n\t\tcase LOGINPIN:\n\t\t\tloginMenu();\n\t\t\tbreak;\n\t\tcase TRANSACTION:\n\t\t\tbreak; //do nothing, user must enter the choice to log out\n\t\tcase DEPOSIT:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase DEPOSITNOTIFICATION:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAW:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase BALANCE:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAWALNOTIFICATION:\n\t\t\tbreak; //do onthing, user must press ok\n\t\t}\n\t\t\n\t\tcurrentInput = \"\";\n\t}",
"public void goToLoginPage()\n\t{\n\t\tclickAccountNameIcon();\n\t\tclickSignInLink();\n\t}",
"private void goLoginSignupActivity() {\n Intent intent = new Intent(this, LoginSignupActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n }",
"@Override\r\n\tpublic void onBackPressed() {\r\n\t\tsuper.onBackPressed();\r\n\t\tlogout();\r\n\t}",
"@Override\n public void run(){\n Intent homeIntent = new Intent(MainActivity.this,login_page.class);//splashes to the login page.\n startActivity(homeIntent);\n finish();\n }",
"public void logOut() {\n\t\t// Close all opened windows and start up the App again\n\t\tcurrentUser = null;\n\t\tcurrentContact = null;\n\t\tjava.awt.Window win[] = java.awt.Window.getWindows();\n\t\tfor (int i = 0; i < win.length; i++) {\n\t\t\twin[i].dispose();\n\t\t}\n\t\tApp.main(null);\n\t}",
"@Override\n public void okClick() {\n PreferenceHelper.deleteAll(MainActivity.this);\n clearBackStack();\n pushFragmentDontIgnoreCurrent(new LoginFragment(), BaseActivity.FRAGMENT_JUST_ADD);\n }",
"public void backToLogin(MouseEvent mouseEvent) throws IOException {\n new PageLoader().load(\"Login\");\n }",
"private void loadLogin(){\n }",
"private void returnToLoginActivity() {\n Intent returnToLogin = new Intent(this, Login.class);\n startActivity(returnToLogin);\n finish();\n }",
"@Override\n public void onClick(View v) {\n editor.putString(\"username\", null);\n editor.commit();\n\n //Changing activity back to Login\n Intent i=new Intent(Home.this,LoginActivity.class);\n startActivity(i);\n finish();;\n }",
"public void clearLoginInfo(){\n ProfileSharedPreferencesRepository.getInstance(application).clearLoginInfo();\n }",
"public void returnToLogin() {\n // Ako smo kliknuli na Login, kreiramo Intent za\n // prijelaz na Login aktivnost\n Intent i = new Intent(this, LoginActivity.class);\n // U slucaju povratka na Login zelimo izbrisati \"povijest\" navigiranja,\n // tako da nas \"Back\" gumb ne vrati prethodnu aktivnost\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // Prelazimo na Login aktivnost\n startActivity(i);\n // Zavrsavamo trenutnu aktivnost i oslobadjamo resurse\n finish();\n }",
"@Override\n public void navigateToLogin() {\n startActivity(new Intent(this, LoginActivity.class));\n finish();\n }",
"public void gotoAdminLogin(){ application.gotoAdminLogin(); }",
"private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }",
"void goToLogin() {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.LOGIN));\n }",
"public static void Logout(){\n\t\tloginSystem();\r\n\t\t\r\n\t}",
"@FXML\n\tprivate void handleLogin() {\n\t \n\t\t\t\ttry {\n\t\t\t\t\tmain.showHomePageOverview(username.getText(),password.getText());\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\n\t}",
"private void loadLogin() throws IOException{\n FXMLLoader loginLoader = new FXMLLoader(getClass().getResource(\"/com/slackers/inc/Boundary/FXML/loginregisterform.fxml\"));\n Parent login = loginLoader.load();\n String cssDoc = getClass().getResource(\"/com/slackers/inc/Boundary/CSS/custom.css\").toExternalForm();\n login.getStylesheets().add(cssDoc);\n\n LoginController loginController = loginLoader.getController();\n loginController.setMainController(this);\n\n Stage stage = new Stage();\n stage.setTitle(\"Login or Signup\");\n stage.setScene(new Scene(login));\n stage.showAndWait();\n\n\n if (userController.getUser().getEmail() == null || userController.getUser().getEmail().equals(\"\")\n || userController.getUser().getPassword() == null || userController.getUser().getPassword().equals(\"\")) {\n Platform.exit();\n System.exit(1);\n }\n\n programPref.put(\"email\", userController.getUser().getEmail());\n try {\n programPref.put(\"password\", CryptoTools.encrypt(userController.getUser().getPassword(), programPref));\n } catch (GeneralSecurityException | IOException e) {\n e.printStackTrace();\n Notifications.create().title(\"Username Not Saved\").text(\"Could not save username and password for reiterations. Please try again later.\").showError();\n System.out.println(\"Could not save username and password for reiterations\");\n }\n\n }",
"@Override\n public void onClick(View v) {\n SharedPreferences sharedPreferences = getSharedPreferences(Key.KEY_GETSHAREDFEREND, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n\n editor.putBoolean(Key.KEY_LOGIN, false);\n editor.apply();\n // finish();\n\n\n Intent intent = new Intent(AccountActivity.this, SplashActivity.class);\n startActivity(intent);\n\n finish();\n\n\n }",
"private void logout() {\n\t\tgetUI().get().navigate(\"login\");\r\n\t\tgetUI().get().getSession().close();\r\n\t}",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n /*\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n \n \n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n */\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n\n this.setVisible(false);\n }\n\n }",
"public void back(ActionEvent actionEvent) throws IOException {\n new PageLoader().load(\"Login\");\n }",
"private void goToLoginPage() {\n\n startActivity(new Intent(this,LoginActivity.class));\n finish();\n }",
"protected void login() {\n\t\t\r\n\t}",
"public PageBase click_on_login_submit_form_button () {\r\n HomePageClass homePage = new HomePageClass(driver);\r\n\r\n LGN_Login_submitBTN.click();\r\n\r\n WebDriverWait wait = getWait();\r\n wait.until(ExpectedConditions.visibilityOf(homePage.logout));\r\n\r\n return homePage;\r\n\r\n }",
"public void logoutUser() {\n editor.remove(Is_Login).commit();\n editor.remove(Key_Name).commit();\n editor.remove(Key_Email).commit();\n editor.remove(KEY_CUSTOMERGROUP_ID).commit();\n // editor.clear();\n // editor.commit();\n // After logout redirect user to Loing Activity\n\n }",
"public void logout() {\n\t\ttry {\n\t\t\tStage mainStage = (Stage) HomePagePane.getScene().getWindow();\n\t\t\tmainStage.close();\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/application/Main.FXML\"));\n\t\t\tAnchorPane pane = loader.load();\n\t\t\tScene scene = new Scene(pane, 700, 400);\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\tstage.show();\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}",
"private void returnLogin(){\n Intent intent = new Intent(getContext(), MainActivity.class);\n startActivity(intent);\n getFragmentManager().beginTransaction().remove(this).commit();\n }",
"public void swapLoginFX() throws IOException {\r\n hideAllViews();\r\n swapViewFX(\"LogIn\", viewLoginFX);\r\n }",
"private void showLogin() {\n \t\tLogin.actionHandleLogin(this);\n \t}",
"@Override\r\n\tpublic void login() {\n\t\t\r\n\t}",
"private void jPasswordFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPasswordFieldKeyPressed\n if (evt.getKeyCode() == 10) {\n String username = jUserNameField.getText();\n String password = jPasswordField.getText();\n\n if (backend.checkPassword(username, password)) {\n\n Home home1 = new Home(jUserNameField.getText());\n home1.setVisible(true);\n backend.closeDB();\n dispose();\n //need to add the admin page\n } else if (backend.checkAdmin(username)) {\n AdminHome home2 = new AdminHome(jUserNameField.getText());\n home2.setVisible(true);\n backend.closeDB();\n dispose();\n } else {\n errorMsg(\"Fallo al iniciar sesion. Por favor, vuelva a intentarlo.\", \"Ingresar\");\n }\n }\n }",
"private void signOut(){\n LoginSharedPreference.endLoginSession(this);\n Intent intent = new Intent(this,LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"private void backButtonAction() {\n CurrentUI.changeScene(SceneNames.LOGIN);\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Toast.makeText(getApplicationContext(), \"You have successfully logout\",\n Toast.LENGTH_LONG).show();\n SplashActivity.editor.remove(\"loginTest\");\n SplashActivity.editor.commit();\n Intent sendToLoginandRegistration = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(sendToLoginandRegistration);\n }",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n\n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n }\n\n }",
"public void gotoLogin() {\n try {\n LoginController login = (LoginController) replaceSceneContent(\"Login.fxml\");\n login.setApp(this);\n } catch (Exception ex) {\n Logger.getLogger(IndieAirwaysClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void onForgetPwd() {\n Intent intent = new Intent(this, ForgotPasswordActivity.class);\n startActivity(intent);\n finish();\n }",
"public void logout() {\n // Mengambil method clear untuk menghapus data Shared Preference\n editor.clear();\n // Mengeksekusi perintah clear\n editor.commit();\n // Membuat intent untuk berpindah halaman\n Intent intent = new Intent(context, LoginActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n context.startActivity(intent);\n }",
"public void logout() {\n showLoginScreen();\n }",
"public void logout() {\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(AppConfig.SHARED_PREF_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n mCtx.startActivity(new Intent(mCtx, LoginActivity.class));\n }",
"@FXML\r\n private void handleButtonLogOut() {\r\n sessionContent.remove(\"activeId\");\r\n user = null;\r\n MobileApplication.getInstance().switchView(LOGIN_VIEW);\r\n }",
"public static void Login() \r\n\t{\n\t\t\r\n\t}",
"private void logout() {\n ((MyApplication)this.getApplication()).setLoggedIn(false);\n// Intent intent = new Intent(this, StartupActivity.class);\n// startActivity(intent);\n }",
"private void LoginOwner() {\n Transaksi.setEnabled(false);\n Transaksi.setVisible(false);\n }",
"public void clickLogin() {\n\t\tcontinueButton.click();\n\t}",
"@FXML\n private void logOut() throws IOException {\n App.clearManagerStatus();\n App.setRoot(\"/tom/sros/login/logInScreen\");\n }",
"public void clciklogin() {\n\t driver.findElement(loginBtn).click();\r\n\t \r\n\t //Print the web page heading\r\n\t System.out.println(\"The page title is : \" +driver.findElement(By.xpath(\"//*[@id=\\\"app\\\"]//div[@class=\\\"main-header\\\"]\")).getText());\r\n\t \r\n\t //Click on Logout button\r\n\t// driver.findElement(By.id(\"submit\")).click();\r\n\t }",
"public void returnToLogin(View view){\r\n startActivity(new Intent(SignUpActivity.this, LoginActivity.class));\r\n finish();\r\n }",
"@Override\n\t\tpublic void onCancelLogin() {\n\n\t\t}",
"@Override\n\t\tpublic void onCancelLogin() {\n\n\t\t}",
"void loginDone();",
"@Override\n public void onBackPressed() {\n logoutDialog();\n }",
"public void clickGoToLogin(){\n\t\t\n\t\tgoToLoginBtn.click();\n\t\t\n\t}",
"public void logout() {\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n Intent myIntent = new Intent(mCtx, LoginActivity.class);\n myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n mCtx.startActivity(myIntent);\n }",
"public void loginToMain(View v){\n SharedPreferences.Editor editor = login.edit();\n editor.putString(\"LOGIN\", m_loginText.getText().toString());\n editor.commit();\n \n \n \tIntent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n finish();\n }",
"public void onSignInPressed(View view) {\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"public void onSignInPressed(View view) {\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n }",
"private void checkToLogin() {\n Intent intent = new Intent(this, LoginActivity.class);\n startActivityForResult(intent, ConstantValue.LOG_IN_CODE);\n }",
"@Override\n\tpublic void MyBack() {\n\t\tFindPasswordActivity.this.finish();\n\t}",
"private void SignIn() {\n startActivity(new Intent(MainActivity.this, HomeScreenActivityFragments.class));\n finish();\n }",
"public void gotoCoachLogin(){ application.gotoCoachLogin(); }",
"public void clickLogin() {\r\n\t\tdriver.findElement(SignIn).click();\r\n\t\t//SignIn.click();\r\n\t\t//SignIn.click();\r\n\t\t//return new LoginPage();\r\n\t}",
"@Then(\"^user come back to main account page and log out$\")\n public void come_back_main_account_and_log_out() throws Exception{\n userAccountPage.clickBtnBackToAccount();\n userAccountPage.clickBtnLogOut();\n }",
"public void logOutBtn(){\r\n\t\t\r\n\t\ttry{\r\n\t\t\tFXMLLoader loader = new FXMLLoader();\r\n\t\t\t\r\n\t\t\tloader.setLocation(getClass().getResource(\"/view/Login.fxml\"));\r\n\t\t\t\r\n\t\t\tAnchorPane root = (AnchorPane)loader.load();\r\n\t\t\t\r\n\t\t\tStage stage = new Stage();\r\n\t\t\t\r\n\t\t\tScene scene = new Scene(root);\r\n\t\t\t\r\n\t\t\tstage.setScene(scene);\r\n\t\t\tstage.setResizable(false);\r\n\t\t\tstage.setTitle(\"Codeflow\");\r\n\t\t\t\t\t\t\r\n\t\t\tstage.show(); // Pop-up login stage\r\n\t\t\t\r\n\t\t\tLoginController.dashboardStage.close(); // Close dashboard stage\r\n\t\t\t\r\n\t\t} catch (IOException e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n public void run() {\n Intent mainIntent = new Intent(getApplicationContext(), Login_state_checker.class);\n startActivity(mainIntent);\n finish();\n }",
"public void logout() {\r\n SharedPreferences sharedPreferences = ctx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = sharedPreferences.edit();\r\n editor.clear();\r\n editor.apply();\r\n ctx.startActivity(new Intent(ctx, MainActivity.class));\r\n }",
"@FXML private void pwdKeyEntered(KeyEvent keyEvent) {\n pwdClick();\n if(keyEvent.getCode() == KeyCode.ENTER)\n buttonLoginClick();\n }",
"public static void login() {\n\t\trender();\n\t}",
"@Override\n public void afterLogout() {\n setTitle(R.string.login);\n getSupportFragmentManager().popBackStack();\n getSupportFragmentManager().beginTransaction()\n .replace(R.id.containerView, new LoginFragment())\n .commit();\n }",
"@Test(priority = 6)\n\tpublic void loginTest3() throws InterruptedException {\n\t\tHomePage home = new HomePage(this.driver);\n\t\tAssert.assertTrue(home.myAccountElementIsDisplayed());\n\t\thome.navigateToMyAccount();\n\t\tAssert.assertTrue(home.dropBoxMyAccountIsDisplayed());\n\t\tLoginPage login = new LoginPage(this.driver);\n\t\tlogin = home.navigateToLogin();\n\t\tAssert.assertTrue(login.loginPageIsOpen());\n\t\tThread.sleep(2000);\n\t\tlogin.clearField();\n\t\tThread.sleep(2000);\n\t\tlogin.navigateToEmailField(\"[email protected]\");\n\t\tlogin.navigateToPasswordField(\"\");\n\t\tlogin.navigateToLoginBtn();\n\t\tAssert.assertTrue(login.errorDisplayed());\n\t\thome.navigateToReturnHomePage();\n\t}",
"@Override\n public void onClick(View arg0) {\n Intent login = new Intent(getApplicationContext(), LoginActivity.class);\n login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(login);\n finish();\n }",
"public void switchToLogin() {\r\n\t\tlayout.show(this, \"loginPane\");\r\n\t\tloginPane.resetPassFields();\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}",
"@Override\r\n public void onSign(SignEvent event){\n if (event.getAction().equals(SignEvent.Action.SIGNED_IN)) {\r\n //write cookies if keep signed in\r\n if (event.getAccountKey() != null && !event.getAccountKey().isEmpty()) {\r\n cookie.setAccountKey(Shared.MY_SESSION, event.getAccountKey());\r\n }\r\n //already signed in, load workspace\r\n RootPanel.get().clear();\r\n Widget workspace = new Workspace().asWidget();\r\n RootPanel.get().add(workspace); \r\n Info.display(\"Welcome\", \"Signed in as \" + Shared.MY_SESSION.getAccount().getFullName());\r\n }\r\n //process sign_out\r\n if (event.getAction().equals(SignEvent.Action.SIGN_OUT)){\r\n String accountKey = cookie.getAccountKey(Shared.MY_SESSION);\r\n Shared.RPC.signOutAndDetachSession(Shared.MY_SESSION, accountKey, new AsyncCallback<Session>() {\r\n @Override\r\n public void onSuccess(Session s) {\r\n if (s != null) {\r\n Shared.MY_SESSION = s;\r\n //sign out seems OK on server side, dispatch SIGNED_OUT event\r\n Shared.EVENT_BUS.fireEvent(new SignEvent(SignEvent.Action.SIGNED_OUT)); //WARN: don't dispatch SIGN_OUT avoiding deadlock call\r\n } else {\r\n Info.display(\"Error\", \"Account is already signed out or database error\");\r\n }\r\n }\r\n\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n Info.display(\"Error\", caught.getMessage());\r\n }\r\n });\r\n }\r\n //process signed_out\r\n if (event.getAction().equals(SignEvent.Action.SIGNED_OUT)){\r\n //delete cookies\r\n cookie.discardCookie(Shared.MY_SESSION); \r\n //return UI to welcome status\r\n RootPanel.get().clear();\r\n RootPanel.get().add(new LoginPage()); \r\n Info.display(\"See you\", \"You are now signed out!\");\r\n }\r\n }",
"@Test(priority = 7)\n\tpublic void loginTest4() throws InterruptedException {\n\t\tHomePage home = new HomePage(this.driver);\n\t\tAssert.assertTrue(home.myAccountElementIsDisplayed());\n\t\thome.navigateToMyAccount();\n\t\tAssert.assertTrue(home.dropBoxMyAccountIsDisplayed());\n\t\tLoginPage login = new LoginPage(this.driver);\n\t\tlogin = home.navigateToLogin();\n\t\tAssert.assertTrue(login.loginPageIsOpen());\n\t\tThread.sleep(2000);\n\t\tlogin.clearField();\n\t\tThread.sleep(2000);\n\t\tlogin.navigateToEmailField(\"[email protected]\");\n\t\tlogin.navigateToPasswordField(\"\");\n\t\tlogin.navigateToLoginBtn();\n\t\tAssert.assertTrue(login.errorDisplayed());\n\t\thome.navigateToReturnHomePage();\n\t}",
"public void logout() {\n updateToken(\"\");\n startActivity(new Intent(GarageListActivity.this, LoginScreenActivity.class));\n updateToken(\"\");\n finish();\n }",
"@Override\n public void onBackPressed() {\n\n new SendStringToServer(ConnectToServer.getDataOutputStream()).execute(\"logOut\");\n\n editor.putString(LoginActivity.EMAIL, null);\n editor.commit();\n\n super.onBackPressed();\n }",
"@Override\n\tprotected void login() {\n\t\tsuper.login();\n\t}",
"public Page_Home doDefaultLogin() {\n\t\tLogStatus.info(\"Logging in with username :: \\'\" + TestUtils.getValue(\"username\") + \"\\' and password :: \\'\"\n\t\t\t\t+ TestUtils.getValue(\"password\") + \"\\'\");\n\t\tDriverManager.getDriver().findElement(By.name(\"username\")).sendKeys(TestUtils.getValue(\"username\"));\n\t\tDriverManager.getDriver().findElement(By.name(\"password\")).sendKeys(TestUtils.getValue(\"password\"));\n\t\tDriverManager.getDriver().findElement(By.id(\"Registration Desk\")).click();\n\t\tDriverManager.getDriver().findElement(By.id(\"loginButton\")).click();\n\n\t\treturn new Page_Home();\n\n\t}",
"private void logout(){\n ParseUser.logOut();\n removeUserFromPrefs();\n Intent intent = LandingActivity.intent_factory(this);\n startActivity(intent);\n }",
"public void loginMenu(){\n\t\tstate = ATM_State.LOGINID;\n\t\tgui.setDisplay(\"Enter your account ID: \\n\");\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\t Intent intent3=new Intent(LoginActivity.this,MainActivity.class);\n\t\t\tstartActivity(intent3);\n\t\t\t\n\t}",
"public void Logout() {\n \t\t\t\n \t\t}",
"public void SwichLogingPageAndSignIn()\r\n {\r\n WaitTime(2000);\r\n driver.navigate().to(\"https://www.n11.com/giris-yap\");\r\n \r\n driver.findElement(By.cssSelector(\"#email\")).sendKeys(\"[email protected]\");\r\n WaitTime(2000);\r\n driver.findElement(By.cssSelector(\"#password\")).sendKeys(\"nacre123456\");\r\n WaitTime(2000);\r\n driver.findElement(By.cssSelector(\"#loginButton\")).click();\r\n \r\n }",
"public void actionPerformed(ActionEvent e) {\r\n\t\t\t\tint selection=JOptionPane.showConfirmDialog(mainWin,\"Are you sure you want to log out\",\"Choose\",JOptionPane.YES_NO_OPTION);\r\n\t\t\t\tif( selection==JOptionPane.YES_OPTION) {\r\n\t\t\t\t\tmainWin.dispose();\r\n\t\t\t\t\tMainLoginPage returntologin=new MainLoginPage();\r\n\t\t\t\t\treturntologin.display();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}",
"private void signInEvt() {\n // Retrieve Details\n String email = this.view.getWelcomePanel().getSignInPanel().getEmailText().getText().trim();\n String password = new String(this.view.getWelcomePanel().getSignInPanel().getPasswordText().getPassword()).trim();\n if (!email.equals(\"\") && !password.equals(\"\")) {\n if (model.getSudokuDB().checkLogin(email, password)) {\n // Set Player\n Player player = model.getSudokuDB().loadPlayer(email, password);\n if (player != null) {\n model.setPlayer(model.getSudokuDB().loadPlayer(email, password));\n // Clear Fields\n view.getWelcomePanel().getSignInPanel().clear();\n // Show Home Screen\n refreshHomePanel();\n view.getCardLayoutManager().show(view.getContent(), \"home\");\n } else {\n Object[] options = {\"OK\"};\n JOptionPane.showOptionDialog(this, \"An error occured during sign in, please try again.\", \"Sign In Error\", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options, null);\n }\n } else {\n Object[] options = {\"Let me try again\"};\n JOptionPane.showOptionDialog(this, \"The credentials you have provided are invalid, please enter them correctly or create a new account.\", \"Invalid Credentials\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n } else {\n Object[] options = {\"Alright\"};\n JOptionPane.showOptionDialog(this, \"In order to sign in, all fields must be filled out.\", \"Empty Fields\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n }",
"@Override\n public void run() {\n\n Intent intent = new Intent(Launcher.this, Login.class);\n startActivity(intent);\n finish();\n }",
"@Override\n public void onBackPressed()\n {\t\n \t//Return tu login activity\n \tif(mlv.getUsersView())\n \t\tthis.finish();\n \telse\n \t{\n \t\t//Return to users view\n \t\tmlv.activateUsersView(); \t\t\n \t}\n }",
"@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)\n @Override\n public void finish() {\n loginPresenter.toFinish();\n }",
"public void stopLogin(Context context) {\n\t\tm_Login = false;\n\t\tif (context != null) saveMisc(context);\n\t}",
"public abstract void navigateToLogin();"
] | [
"0.7297911",
"0.65950435",
"0.64312124",
"0.6369084",
"0.6341829",
"0.6304316",
"0.6295123",
"0.6272485",
"0.62262183",
"0.6220683",
"0.6191103",
"0.61461914",
"0.6142239",
"0.61388725",
"0.6130377",
"0.61132383",
"0.60819054",
"0.60148317",
"0.6007417",
"0.6002883",
"0.5991871",
"0.5970425",
"0.5955775",
"0.59506476",
"0.59502846",
"0.59449327",
"0.59402174",
"0.5933127",
"0.5931377",
"0.5919858",
"0.5892008",
"0.58796746",
"0.58761644",
"0.586785",
"0.58520633",
"0.58515245",
"0.58218914",
"0.5820547",
"0.5819831",
"0.580847",
"0.58068067",
"0.5802817",
"0.58022445",
"0.5792252",
"0.57878405",
"0.5787509",
"0.5781827",
"0.5778253",
"0.57633644",
"0.5761225",
"0.5759731",
"0.5758671",
"0.57527447",
"0.5750028",
"0.57495517",
"0.5746016",
"0.5743059",
"0.57389736",
"0.573894",
"0.5736244",
"0.5736244",
"0.573459",
"0.57330513",
"0.5727508",
"0.5719848",
"0.5712079",
"0.5707899",
"0.5707899",
"0.57066387",
"0.5706258",
"0.57017374",
"0.57006526",
"0.5694448",
"0.56901175",
"0.5681469",
"0.56812245",
"0.5670157",
"0.5666148",
"0.56625617",
"0.56590986",
"0.56581265",
"0.5657291",
"0.56409454",
"0.5638145",
"0.56375676",
"0.5630034",
"0.56298006",
"0.5622675",
"0.56209755",
"0.56197196",
"0.5618958",
"0.56182474",
"0.5611255",
"0.56102693",
"0.5607298",
"0.5604136",
"0.5601897",
"0.5600887",
"0.560034",
"0.55950767",
"0.55948865"
] | 0.0 | -1 |
Establish a connection to the server | public boolean createConnection() throws CommunicationException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void establishConnection() {\n try {\n PropertiesLoader loader = new PropertiesLoader();\n String sshUser = loader.loadProperty().getProperty(\"sshUser\");\n String sshPassword = loader.loadProperty().getProperty(\"sshPassword\");\n String sshHost = loader.loadProperty().getProperty(\"sshHost\");\n int sshPort = Integer.parseInt(loader.loadProperty().getProperty(\"sshPort\"));\n String remoteHost = loader.loadProperty().getProperty(\"remoteHost\");\n int localPort = Integer.parseInt(loader.loadProperty().getProperty(\"localPort\"));\n int remotePort = Integer.parseInt(loader.loadProperty().getProperty(\"remotePort\"));\n\n String dbUrl = loader.loadProperty().getProperty(\"dbUrl\");\n String dbUser = loader.loadProperty().getProperty(\"dbUser\");\n String dbPassword = loader.loadProperty().getProperty(\"dbPassword\");\n\n DatabaseManager.doSshTunnel(sshUser, sshPassword, sshHost, sshPort, remoteHost, localPort, remotePort);\n connection = DriverManager.getConnection(dbUrl, dbUser, dbPassword);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }",
"public static void doConnect() {\r\n\t\tlogger.info(\"Connecting to server......\");\r\n\t\tChannelFuture future = null;\r\n\t\ttry {\r\n\t\t\tfuture = bootstrap.connect(new InetSocketAddress(host, port));\r\n\t\t\tfuture.addListener(channelFutureListener);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t// future.addListener(channelFutureListener);\r\n\t\t\tlogger.warn(\"Closed connection.\");\r\n\t\t}\r\n\r\n\t}",
"public static void openConnection() {\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\t\tconexion = DriverManager.getConnection(\"jdbc:mysql://192.168.1.51:9090?useTimeone=true&serverTimezone=UTC\",\n\t\t\t\t\t\"remote\", \"Password123\");// credenciales temporales\n\t\t\tSystem.out.print(\"Server Connected\");\n\n\t\t} catch (SQLException | ClassNotFoundException ex) {\n\t\t\tSystem.out.print(\"No se ha podido conectar con mi base de datos\");\n\t\t\tSystem.out.println(ex.getMessage());\n\n\t\t}\n\n\t}",
"public void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(host, port);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error connecting: \" + e.getMessage());\n\t\t}\n\t}",
"public void connectToExternalServer()\n\t{\n\t\tbuildConnectionString(\"10.228.6.204\", \"\", \"ctec\", \"student\");\n\t\tsetupConnection();\n\t\t// createDatabase(\"Kyler\");\n\t}",
"public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }",
"ClientConnection connection();",
"private void connectToServer() {\n\t\ttry {\n\t\t\tsocket = new Socket(InetAddress.getLocalHost(), Server.SERVER_PORT);\n\t\t\tin = new BufferedReader(new InputStreamReader(\n\t\t\tsocket.getInputStream()));\n\t\t\tout = new PrintWriter(socket.getOutputStream());\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot connect to server\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}",
"public void openConnection() {\n System.out.println(\"Opening connection...\");\n\n try {\n String HOST = \"192.168.4.1\";\n int PORT = 2323;\n connectionSocket = new Socket(HOST, PORT);\n connectionSocket.setTcpNoDelay(true);\n\n writer = new BufferedWriter(new OutputStreamWriter(new BufferedOutputStream(connectionSocket.getOutputStream())));\n reader = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));\n\n System.out.println(\"openConnection(): Success\");\n return;\n } catch (UnknownHostException e) {\n System.out.println(\"UnknownHostException at openConnection()\");\n } catch (IOException e) {\n System.out.println(\"IOException at openConnection()\");\n } catch (Exception e) {\n System.out.println(\"Exception at openConnection()\");\n System.out.println(e.toString());\n }\n\n System.out.println(\"Failed to connect\");\n }",
"private void establishConnection() throws UnknownHostException, \n \t\t\t\t\t\t\t\t\t\t IOException {\n \t socket = new Socket(serverIP, serverPort);\n }",
"public void initiateConnection() {\n\t\tif (Settings.getRemoteHostname() != null) {\n\t\t\ttry {\n\t\t\t\toutgoingConnection(new Socket(Settings.getRemoteHostname(), Settings.getRemotePort()));\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.error(\"failed to make connection to \" + Settings.getRemoteHostname() + \":\"\n\t\t\t\t\t\t+ Settings.getRemotePort() + \" :\" + e);\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t}",
"public void Connect() {\n run = new Thread(\"Connect\") {\n @Override\n public void run() {\n running = true;\n try {\n server = new ServerSocket(9080);\n waitingForConnection();\n } catch (IOException ex) {\n Logger.getLogger(Dashboard.class\n .getName()).log(Level.SEVERE, null, ex);\n }\n }\n };\n run.start();\n }",
"private void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(Server.ADDRESS, Server.PORT_NUMBER);\n\t\t\tthis.oos = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tthis.ois = new ObjectInputStream(socket.getInputStream());\n\t\t\tServerListener serverlistener = new ServerListener();\n\t\t\tserverlistener.start();\n\t\t\tRequest request = new Request(RequestCode.START_DOCUMENT_STREAM);\n\t\t\trequest.setUsername(user.getUsername());\n\t\t\toos.writeObject(request);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void establishSocketConnection() {\n\t\ttry {\n\t\t\tsocket = new Socket(serverIP, serverPort);\n\t\t\tlogger.info(\"Connection with JSON-RPC server opened at local endpoint \" + socket.getLocalAddress().getHostAddress() + \":\" + socket.getLocalPort());\n\t\t\t// create a writer to send JSON-RPC requests to the JSON-RPC server\n\t\t\twriter = new OutputStreamWriter(socket.getOutputStream(), \"utf-8\");\n\t\t\t// create a JsonReader object to receive JSON-RPC response\n\t\t\tjsonReader = new JsonReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void getConnection() throws Exception {\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting for new client!\");\n\n\n\n\t\t\tclient = serverSocket.accept();\n\t\t\tis = client.getInputStream();\n\t\t\tisr = new InputStreamReader(is);\n\t\t\tbr = new BufferedReader(isr);\n\t\t\tos = client.getOutputStream();\n\t\t\tosw = new OutputStreamWriter(os);\n\t\t\tpw = new PrintWriter(osw, true);\n\t\t\tsleep(500);\n\t\t\t//clientkey = getClientKey();\n\t\t\tSystem.out.println(\"Client has connected!\");\n\t\t\t\n\t\t\tGetTimestamp(\"Client Publickey is being stored: \" ) ;\n\t\t\t\n\t\t\tpublicKey = getClientPublicKey();\n\t\t\t\n\t\t\tGetTimestamp(\"Client Publickey is stored: \" ) ;\n\t\t\t\n\t\t\tString tosend = encrypt1(getSharedKey(), getClientPublicKey());\n\t\t\t\n\t\t\tGetTimestamp(\"Client sharedkey is being encrypted: \") ;\n\t\t\t\n\t\t\tGetTimestamp(\"Waiting for Authorization Request from Client: \");\n\t\t\t\n\t\t\t//getclientpublickey();\n\t\t\tgetAUTH_REQUEST();\n\t\t\t//getMessage();\n\n\t\t} catch (IOException | InterruptedException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t}",
"public void connect(){\n if (connected) {\n // connection already established\n return;\n }\n // Create connection to Database\n Properties props = new Properties();\n props.setProperty(\"user\", DB_USER);\n props.setProperty(\"password\", DB_PASSWORD);\n //props.setProperty(\"ssl\", \"true\");\n //\"Connecting to database...\"\n try {\n Class.forName(\"org.postgresql.Driver\");\n String connection_string = generateURL();\n dbConnect = DriverManager.getConnection(connection_string, props);\n //\"Connection established\"\n status = \"Connection established\";\n connected = true;\n } catch (SQLException e) {\n //\"Connection failed: SQL error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n } catch (Exception e) {\n //\"Connection failed: unknown error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n }\n }",
"private synchronized void doConnect() {\n try {\n String host = agent.getHost();\n int port = agent.getPort();\n log.fine(\"Connecting to server \" + host + ':' + port);\n socket = new Socket(host, port);\n input = socket.getInputStream();\n output = new OutputStreamWriter(socket.getOutputStream());\n disconnected = false;\n new Thread(this).start();\n\n // Automatically login! -> give an auth to the agent...\n TACMessage msg = new TACMessage(\"auth\");\n msg.setParameter(\"userName\", agent.getUser());\n msg.setParameter(\"userPW\", agent.getPassword());\n msg.setMessageReceiver(agent);\n sendMessage(msg);\n\n } catch (Exception e) {\n disconnected = true;\n log.log(Level.SEVERE, \"connection to server failed:\", e);\n socket = null;\n }\n }",
"public Connection connect() {\n\t\t\n\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Creating connection\");\n\t\treturn connection;\n\n\t}",
"public void connect() throws OOBException {\n \t\tlog.debug(\"enter to connect \");\n \t\tJSch jsch = new JSch();\n \t\ttry {\n\t\t\tjsch.addIdentity(PRIVATE_KEY, PASSPHRASE);\n \t\t\tjsch.setKnownHosts(KNOWN_HOSTS);\n \t\t\tlog.debug(\"user \" + user + \"host : \" + host);\n \t\t\tsession = jsch.getSession(user, host, 22);\n \t\t\tsession.connect();\n \t\t} catch (JSchException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}",
"public static void connect() {\n \t\tconnPool.start();\n \t}",
"public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }",
"void createConnection();",
"public void makeConnection() {\n\t\t// make a socket, output stream, and try connecting to the server\n\t\twhile (!connection) {\n\t\t\ttry {\n\t\t\t\tsocket = new Socket(address, port);\n\t\t\t\toutStream = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t\tconnection = true;\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public static void openConnection() {\n\t\tarcade.startConnection();\n\t}",
"private void connectToServer() throws IOException {\n\t\tna.message(\"Connecting to \" + serverAddress.getHostAddress()\n\t\t\t\t+ \" at port#: \" + portNumber);\n\t\tclientSocket = new Socket(serverAddress, portNumber);\n\t}",
"private void openConnection () {\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(\n\t\t\t\t\tPasswordProtector.HOST,\n\t\t\t\t\tPasswordProtector.USER,\n\t\t\t\t\tPasswordProtector.PASSWORD);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t}\n\t}",
"public boolean connect(){\r\n\r\n\t\t// Connect to server via TCP socket\r\n\t\ttry {\r\n\r\n\t\t\tclient = new Socket(host, port);\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"[EXCEPTION] connecting to server\");\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Connection to server could not be made. Try again later.\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\r\n\t\t// Get input and output Streams\r\n\t\ttry {\r\n\r\n\t\t\tpw = new PrintWriter(client.getOutputStream());\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(client.getInputStream()));\r\n\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"[EXCEPTION] creating streams\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Connection to server SUCESSFULL\");\r\n\t\treturn true;\r\n\t}",
"public static Connection connect(){\n\t\ttry {\n\t\t\tadd = Configure.getADDRESS();\n\t\t\tconn = ConnectionFactory.getConnect(add, Configure.port, \"TCP\");\n\t\t} catch (Exception e) {\n\t\t\tConfigure.logger.error(e.getMessage());\n\t\t\t//System.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\t//System.exit(0);\n\t\t}\n\t\treturn conn;\n\t}",
"public void connectToServer() throws IOException {\n\t\t\tString serverAddress = \"localhost\";\r\n\r\n\t\t\t// Make connection and initialize streams\r\n\t\t\tsocket = new Socket(serverAddress, 9898);\r\n\t\t\tin = new BufferedReader(\r\n\t\t\t\t\tnew InputStreamReader(socket.getInputStream()));\r\n\t\t\tout = new PrintWriter(socket.getOutputStream(), true);\r\n\t\t}",
"protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}",
"public void doConnect() {\n Debug.logInfo(\"Connecting to \" + client.getServerURI() + \" with device name[\" + client.getClientId() + \"]\", MODULE);\n\n IMqttActionListener conListener = new IMqttActionListener() {\n\n public void onSuccess(IMqttToken asyncActionToken) {\n Debug.logInfo(\"Connected.\", MODULE);\n state = CONNECTED;\n carryOn();\n }\n\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n ex = exception;\n state = ERROR;\n Debug.logError(\"connect failed\" + exception.getMessage(), MODULE);\n carryOn();\n }\n\n public void carryOn() {\n synchronized (caller) {\n donext = true;\n caller.notifyAll();\n }\n }\n };\n\n try {\n // Connect using a non-blocking connect\n client.connect(conOpt, \"Connect sample context\", conListener);\n } catch (MqttException e) {\n // If though it is a non-blocking connect an exception can be\n // thrown if validation of parms fails or other checks such\n // as already connected fail.\n state = ERROR;\n donext = true;\n ex = e;\n }\n }",
"public void connect();",
"public void connect();",
"public void connect();",
"public Socket connect() {\n\t\ttry{\n\t\t connection = new Socket(serverAddress, port);\n\t\t System.out.println(\"Connessione aperta\");\n\t\t}\n\t\tcatch(ConnectException e){\n\t\t System.err.println(\"Server non disponibile!\");\n\t\t}\n\t\tcatch(UnknownHostException e1){\n\t\t System.err.println(\"Errore DNS!\");\n\t\t}\t\t\n\t\tcatch(IOException e2){//\n\t\t System.err.println(e2);\n\t\t e2.printStackTrace();\n\t\t}\n\t\treturn connection;\n }",
"public void createConnection() throws ServerUnavailableException {\n clearConnection();\n while (serverSock == null) {\n try {\n // try to open a Socket to the server\n InetAddress addr = InetAddress.getByName(host);\n System.out.println(\"attempting to connect to \" + addr + \":\" + port + \"...\");\n serverSock = new Socket(addr, port);\n in = new BufferedReader(new InputStreamReader(serverSock.getInputStream()));\n out = new BufferedWriter(new OutputStreamWriter(serverSock.getOutputStream()));\n } catch (IOException e) {\n throw new ServerUnavailableException(\"Unable to connect to the server\");\n }\n }\n }",
"public static void connect()\n {\n conn = null;\n try {\n Class.forName(\"org.postgresql.Driver\");\n conn = DriverManager.getConnection(url, user, password);\n System.out.println(\"Connected to Server Successfully.\");\n }catch(Exception e) {\n System.out.println(e.getMessage());\n }\n }",
"public void connect()\r\n\t{\r\n\t\tkonekcija = ConnectionClass.getConnection(adresa, port, imeBaze, korisnickoIme, sifra);\r\n\t\tSystem.out.println(\"Konekcija otvorena: \"+ konekcija.toString());\r\n\t}",
"public void connect() {}",
"void connect() throws UnknownHostException, IOException {\n\t\tif (isConnected()) {\n\t\t\tdisconnect();\n\t\t}\n\t\t\n\t\tif (!ssl) {\n\t\t\tsock = new Socket();\n\t\t} else {\n\t\t\tsock = SSLSocketFactory.getDefault().createSocket();\n\t\t}\n\t\tsock.connect(new InetSocketAddress(host, port));\n\t\t\n\t\tif (sock != null) {\n\t\t\tsock.setKeepAlive(true);\n\t\t\tinStream = new UByteInputStream(new BufferedInputStream(sock.getInputStream(), sock.getReceiveBufferSize()));\n\t\t\tconnected();\n\t\t}\n\t}",
"public void connect()\n\t{\n try{\n \tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n \tconn = DriverManager.getConnection(url,user,pwd);\n \tSystem.out.println(\"Connected...\");\n }\n \n catch(Exception se){\n \tse.printStackTrace();\n }\n\t}",
"private void openConnection(){}",
"private void connect() {\n ftp.connect();\n if (ftp.goodReply()) sendResponse(\"Connected\");\n else sendResponse(\"Could not connect to server\");\n }",
"private void connect() {\n if (this.connection == null && !this.connected) {\n try {\n this.connection = DriverManager.getConnection(this.dbUrl, this.dbUser, this.dbPassword);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }",
"Connection createConnection();",
"public Channel connect() {\n\t\tChannelFuture channel = bootstrap.connect(new InetSocketAddress(host, port));\n\n\t\t// wait for the connection to establish\n\t\tchannel.awaitUninterruptibly();\n\n\t\tif (channel.isDone() && channel.isSuccess()) {\n\t\t\treturn channel.getChannel();\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Not able to establish connection to server\");\n\t\t}\n\t}",
"public Connection connect() {\n conn = null;\n try {\n conn = DriverManager.getConnection(url, user, password);\n System.out.println(\"Connected successfully.\");\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n \n return conn;\n }",
"public void connect() throws Exception\n\t{\n\t\tHostnameVerifier hv = new HostnameVerifier()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic boolean verify(String urlHostName, SSLSession session)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\ttrustAllHttpsCertificates();\n\t\tHttpsURLConnection.setDefaultHostnameVerifier(hv);\n\t\t// These following methods have to be called in this order.\n\t\tinitSvcInstRef();\n\t\tinitVimPort();\n\t\tinitServiceContent();\n\t\tvimPort.login(serviceContent.getSessionManager(), user, password, null);\n\t\tinitPropertyCollector();\n\t\tinitRootFolder();\n\t\tisConnected = true;\n\t}",
"public void connect() throws Exception\n {\n if(connected)\n return;\n connectionSocket = new Socket(address, CommonRegister.DEFAULT_PORT);\n localPeerID = ++localPeerIDCount;\n initListener();\n reader = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));\n writer = new PrintWriter(connectionSocket.getOutputStream(),true);\n connected = true;\n }",
"public void openConnection(){\n\n\t\tString dbIP = getConfig().getString(\"mysql.ip\");\n\t\tString dbDB = getConfig().getString(\"mysql.databaseName\");\n\t\tString dbUN = getConfig().getString(\"mysql.username\");\n\t\tString dbPW = getConfig().getString(\"mysql.password\");\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://\" + dbIP + \"/\" + dbDB, dbUN, dbPW);\n\t\t\tgetLogger().info(\"Connected to databse!\");\n\t\t} catch (SQLException ex) {\n\t\t\t// handle any errors\n\t\t\tgetLogger().info(\"SQLException: \" + ex.getMessage());\n\t\t\tgetLogger().info(\"SQLState: \" + ex.getSQLState());\n\t\t\tgetLogger().info(\"VendorError: \" + ex.getErrorCode());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tgetLogger().info(\"Gabe, you done goof'd!\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void connect() {\n\t\ttry {\n\t\t\tconnection = new Socket(ip, serverPort); // 128.39.83.87 // 127.0.0.1\n\t\t\t\n\t\t\toutput = new BufferedWriter(new OutputStreamWriter(\n connection.getOutputStream()));\n\t\t\tinput = new BufferedReader(new InputStreamReader(\n connection.getInputStream()));\n\t\t\t\n\t\t\tif (hostName.equals(Constants.IDGK + Main.userName))\n\t\t\t\tsendText(\"1\" + Main.userName);\n\t\t\telse\n\t\t\t\tsendText(\"2\" + Main.userName);\n\t\t\t\n\t\t} catch (UnknownHostException e) {\n\t\t\tMain.LOGGER.log(Level.SEVERE, \"Error connecting server\", e);\n\t\t} catch (IOException e) {\n\t\t\tMain.LOGGER.log(Level.WARNING, \"Error making output/input\", e);\n\t\t}\n\t}",
"protected void connectionEstablished() {}",
"public boolean connect(){\n try{\n conn = DriverManager.getConnection(uri, user, password);\n }catch (SQLException sqle){\n DLException dle = new DLException(sqle, \"Unable to conclude this operation\");\n return false;\n }\n return true;\n }",
"public void conectServer() {\n\n\t}",
"private void establishServerConnection() {\n int lb_port = Integer.parseInt(gui.getLBPort_Text().getText());\n gui.getLBPort_Text().setEnabled(false);\n String lb_ip = gui.getLBIP_Text().getText();\n gui.getLBIP_Text().setEnabled(false);\n int server_port = Integer.parseInt(gui.getServerPort_Text().getText());\n gui.getServerPort_Text().setEnabled(false);\n String server_ip = gui.getServerIP_Text().getText();\n gui.getServerIP_Text().setEnabled(false);\n obtainId(server_ip, server_port);\n lbInfo = new ConnectionInfo(lb_ip, lb_port, 3);\n\n if (connection.startServer(server_port)) {\n connectionHandler = new ServerConnections(connection, lbInfo, requestsAnswered, processingRequests, gui.getCompleted_Text(), gui.getProcessing_Text());\n new Thread(connectionHandler).start();\n\n requestServerId();\n scheduler.scheduleAtFixedRate(heartbeat, 10, 10, TimeUnit.SECONDS);\n } else {\n gui.getLBPort_Text().setEnabled(true);\n gui.getLBIP_Text().setEnabled(true);\n gui.getServerPort_Text().setEnabled(true);\n gui.getServerIP_Text().setEnabled(true);\n gui.getButton_Connect().setEnabled(true);\n }\n }",
"protected void startConnect() {\n if (tcp) {\n connection = new TCPConnection(this);\n } else {\n connection = new UDPConnection(this, udpSize);\n }\n connection.connect(remoteAddr, localAddr);\n }",
"private void openConnection () {\n String[] labels = {\"Host :\", \"Port :\"};\n String[] initialValues = {\"localhost\", \"1111\"};\n StandardDialogClient openHandler = new StandardDialogClient () {\n\t@Override\n\tpublic void dialogDismissed (StandardDialog d, int code) {\n\t try {\n\t InputDialog inputD = (InputDialog)d;\n\t if (inputD.wasCancelled ()) return;\n\t String[] results = inputD.getResults ();\n\t String host = results[0];\n\t String port = results[1];\n\t TwGateway connection =\n\t (TwGateway)TwGateway.openConnection (host, port);\n\t // The following call will fail if the G2 is secure.\n\t connection.login();\n\t setConnection (connection);\n\t } catch (Exception e) {\n\t new WarningDialog (null, \"Error During Connect\", true, e.toString (), null).setVisible (true);\n\t }\n\t}\n };\t \n\n new ConnectionInputDialog (getCurrentFrame (), \"Open Connection\",\n\t\t\t\t true, labels, initialValues,\n\t\t\t\t (StandardDialogClient) openHandler).setVisible (true);\n }",
"private void openConnection(String host){\n try {\n this.socket = new Socket(host, PORT);\n this.fromServer = new DataInputStream(socket.getInputStream());\n this.toServer = new DataOutputStream(socket.getOutputStream());\n\n } catch (SecurityException e){\n report(\"Connect is not allowed\");\n } catch (UnknownHostException e) {\n report(\"the ip address is not found.\");\n } catch (IOException e){\n report(\"Can not connect to the server\\\"\"+host+\"\\\"\");\n }\n }",
"public void connect() throws ConnectionFailedException\n {\n isConnected = true;\n }",
"public void connect(HTransportCallback callback, HTransportOptions options){\t\n \t\tif (connection != null && connection.isConnected()) {\n \t\t\tconnection.disconnect();\n \t\t}\n \t\t\n \t\tthis.connectionStatus = ConnectionStatus.CONNECTING;\n \t\t\n \t\tthis.callback = callback;\n \t\tthis.options = options;\n \t\t\n \t\tString serverHost = options.getServerHost();\n \t\tint serverPort = options.getServerPort();\n \t\tString serviceName = options.getJid().getDomain();\n \n \t\t//each time it connect we create a new configuration and connection objects\n \t\t//because smack doesn't allow setting host, or configuration on existing objects\n \t\t//@todo check if config has changed rather than create a new one\n \t\tthis.config = new ConnectionConfiguration(serverHost, serverPort, serviceName);\n //\t\t//patch for android to support security\n //\t\tconfig.setTruststorePath(\"/system/etc/security/cacerts.bks\");\n //\t config.setTruststoreType(\"bks\");\n \n \t // Sets whether the client will use SASL authentication when logging into the server.\n \t //config.setSASLAuthenticationEnabled(true);\n \t\t\t \n \t // Sets the TLS security mode used when making the connection.\n \t //config.setSecurityMode(SecurityMode.required);\n \t \n \t config.setReconnectionAllowed(false);\n \t config.setSendPresence(true);\n \t \n \t //add a timer to monitor connection thread. If it takes too long kill it and return conn timeout\n \t final Timer timer = new Timer();\n \t \n \t try {\n \t \tthis.connection = new XMPPConnection(config);\n \t \n \t\t final HTransportOptions localOptions = options;\n \t\t final HTransportXMPP outerClass = this;\n \t\t \n \t\t //create a thread to connect async\n \t\t this.connectionThread = new Thread(new Runnable() {\n \n \t\t\t\tpublic void run() {\n \t\t\t\t\ttry {\n \t\t\t\t\t\t//launch connection and add connection listener for errors\n \t\t\t\t\t\tconnection.connect();\n \t\t\t\t\t\tconnection.addConnectionListener(outerClass);\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t//try to login and update status\n \t\t\t\t\t\t\tconnection.login(localOptions.getUsername(), localOptions.getPassword(), localOptions.getResource());\n \t\t\t\t\t\t\tupdateStatus(ConnectionStatus.CONNECTED, null, null);\n\t\t\t\t\t\t\tPacketFilter packetFilter = new FromContainsFilter(localOptions.getHserverService());\n \t\t\t\t\t\t\tconnection.addPacketListener(outerClass,packetFilter);\n \t\t\t\t\t\t} catch(Exception e) { //login failed\n \t\t\t\t\t\t\tboolean wasConnected = false;\n \t\t\t\t\t\t\tif (connection.isConnected()) {\n \t\t\t\t\t\t\t\twasConnected = true;\n \t\t\t\t\t\t\t\tconnection.disconnect();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tconnection = null;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t//update status only if connected, because if not, it's a network error not a login error\n \t\t\t\t\t\t\tif(wasConnected) {\n \t\t\t\t\t\t\t\tupdateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.AUTH_FAILED, e.getMessage());\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} catch(Exception e) { //in case connection failed\n \t\t\t\t\t\tconnection = null;\n \t\t\t\t\t\tupdateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.TECH_ERROR , e.getMessage());\n \t\t\t\t\t}\t\n \t\t\t\t\ttimer.cancel();\n \t\t\t\t}\n \t\t\t});\n \t\t this.connectionThread.start(); //start async thread\n \t } catch(Exception e) { //in case thread creation failed or it was interrupted\n \t \tif (connection.isConnected()) {\n \t\t\t\tconnection.disconnect();\n \t\t\t}\n \t \t//e.printStackTrace();\n \t \tthis.connection = null;\n \t \tthis.updateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.TECH_ERROR, e.getMessage());\n \t }\n \t \n \t \n \t //set timer task to add a connection timeout\n \t timer.schedule(new TimerTask() {\n \t\t\t\n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tif (connectionThread != null && connectionThread.isAlive()) {\n \t\t\t\t\tconnectionThread.interrupt();\n \t\t\t\t\tif(connection.isConnected()) {\n \t\t\t\t\t\tconnection.disconnect();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tupdateStatus(ConnectionStatus.DISCONNECTED, ConnectionError.CONN_TIMEOUT, null);\n \t\t\t}\n \t\t}, SmackConfiguration.getPacketReplyTimeout());\n \t}",
"abstract public void openConnection();",
"public void connect() {\n\n\t\ttry {\n\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException ex) {\n\t\t\tSystem.err.println(\"Unable to load MySQL Driver\");\n\t\t\t\n\t\t}\n\n\t\tString jdbcUrl = \"jdbc:mysql://localhost:3306/userinfo?useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false\";\n\t\ttry {\n\t\t\t// DriverManager.registerDriver(new com.mysql.jdbc.Driver());\n\t\t\tConnection con = DriverManager.getConnection(jdbcUrl, \"root\", \"smmk143143\");\n\t\t\tconn = con;\n\t\t\t// Set auto commit as false.\n\t\t\tconn.setAutoCommit(false);\n\t\t\tSystem.out.println(\"接続済み/Connected\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Error Occured\");\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t}\n\t}",
"private void startKlient() {\n\t\tSystem.out.println(\"Trying to connect\");\r\n\t\ttry (Socket serverkontakt = new Socket(\"127.0.0.1\", 8000);\r\n\t\t// Step 2 - obtaining input/output streams\r\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(\r\n\t\t\t\t\t\tserverkontakt.getOutputStream())) {\r\n\t\t\toutput.flush();\r\n\t\t\tSystem.out.println(\"Connected\");\r\n\t\t\tsendObject(output);\r\n\t\t} catch (EOFException eofException) {\r\n\t\t\tSystem.out.println(\"Server closing connection\\n\");\r\n\t\t} catch (IOException ioException) {\r\n\t\t\tSystem.out.println(\"Problem with server connection\\n\");\r\n\t\t}\r\n\t}",
"void connect(ServerEntry server, String name) throws Exception;",
"public synchronized void openConnection() throws MalformedURLException,\n IOException, AuthenticationException {\n\n this.connector = createJMXConnector(connectionConfiguration);\n\n try {\n Activator.getDefault().info(\n \"Connecting to \" + connectionConfiguration);\n connector.connect();\n addConnectionNotificationListener();\n connectionAlreadyClosed = false;\n } catch (IllegalArgumentException ile) {\n Activator.getDefault().info(\"Authentication failed\", ile);\n throw new AuthenticationException();\n } catch (IOException ioe) {\n throw ioe;\n } catch (Throwable e) {\n Activator.getDefault().error(\n \"Unknown exception while opening connection \", e);\n throw new IOException(e.getCause());\n }\n }",
"protected void doOpenConnection() throws Exception {\n connection.open\n (conn_route, request_spec.context, request_spec.params);\n }",
"private void connect() {\n connectionString = \"jdbc:mysql://\" + Config.getInstance().getMySQLServerName() + \":\" + Config.getInstance().getMySQLServerPort() + \"/\" + Config.getInstance().getMySQLDatabaseName();\n\n try {\n Assassin.p.getLogger().info(\"Attempting connection to MySQL...\");\n\n // Force driver to load if not yet loaded\n Class.forName(\"com.mysql.jdbc.Driver\");\n Properties connectionProperties = new Properties();\n connectionProperties.put(\"user\", Config.getInstance().getMySQLUserName());\n connectionProperties.put(\"password\", Config.getInstance().getMySQLUserPassword());\n connectionProperties.put(\"autoReconnect\", \"false\");\n connectionProperties.put(\"maxReconnects\", \"0\");\n connection = DriverManager.getConnection(connectionString, connectionProperties);\n\n Assassin.p.getLogger().info(\"Connection to MySQL was a success!\");\n }\n catch (SQLException ex) {\n connection = null;\n\n if (reconnectAttempt == 0 || reconnectAttempt >= 11) {\n Assassin.p.getLogger().severe(\"Connection to MySQL failed!\");\n printErrors(ex);\n }\n }\n catch (ClassNotFoundException ex) {\n connection = null;\n\n if (reconnectAttempt == 0 || reconnectAttempt >= 11) {\n Assassin.p.getLogger().severe(\"MySQL database driver not found!\");\n }\n }\n }",
"public Socket connect() {\r\n\t\ts = null;\r\n\t\ttry {\r\n\t\t\ts = new Socket(hostName, port);\r\n\t\t\tdos = Utils.deflatedDataOut(s.getOutputStream(), 8);\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\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\treturn s;\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}",
"public void connect() throws IOException {\n socket = new java.net.Socket(IP_SERVER, PORT);\n Logger.getLogger(\"SocketClient\").log(Level.INFO, \"Socket establecido\");\n }",
"public void newConnection(String hostname, int port) throws Exception;",
"private void connectToServer() {\n\t\ttry {\n\n\t\t\tSystem.out.println(\"Attempting connection to server at port: 5555\");\n\t\t\tsocket = new Socket(\"localhost\", 5554);\n\t\t\tSystem.out.println(\"Connected to server at port: 5555\");\n\n\t\t\tobjectOutputStream = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tobjectInputStream = new ObjectInputStream(socket.getInputStream());\n\t\t\t\n\t\t\t// sending client object to server\n\t\t\tobjectOutputStream.writeInt(Main.getUser().getUserId());\n\t\t\tobjectOutputStream.flush();\n\t\t} catch (UnknownHostException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}",
"public void connect() throws IOException;",
"private void getConnection() {\r\n\r\n\t\ttry {\r\n\t\t\tClass.forName(driver);\r\n\t\t\tconn = DriverManager.getConnection(url, id, pw);\r\n\t\t\tSystem.out.println(\"[접속성공]\");\r\n\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tSystem.out.println(\"error: 드라이버 로딩 실패 -\" + e);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"error:\" + e);\r\n\t\t}\r\n\r\n\t}",
"final public void openConnection() throws IOException {\n // Do not do anything if the connection is already open\n if (isConnected())\n return;\n\n // Create the sockets and the data streams\n try {\n clientSocket = new Socket(host, port);\n output = new DataOutputStream(clientSocket.getOutputStream());\n // input =\n // new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), \"Big5_HKSCS\"));\n input = new DataInputStream(clientSocket.getInputStream());\n } catch (IOException ex)\n // All three of the above must be closed when there is a failure\n // to create any of them\n {\n try {\n closeAll();\n } catch (Exception exc) {\n }\n\n throw ex; // Rethrow the exception.\n }\n\n clientReader = new Thread(this); // Create the data reader thread\n readyToStop = false;\n clientReader.start(); // Start the thread\n }",
"public synchronized void startConnection ()\r\n\t{\r\n \t\tsynchronized (this)\r\n \t\t{\r\n \t\t\tif (_roboCOM!=null) return;\r\n\t\t\t\r\n\t\t\tuitoken++;\r\n\t\t\t_roboCOM = new TCPClient (MsgQueue,cm,uitoken);\r\n\r\n\t\t\t// debug parameters\r\n\t\t\t_roboCOM.msgHello=\"Start Connection ACCE\";\r\n\t\t\t\t\t\t\t\r\n\t \t \tnew Thread (_roboCOM).start();\r\n \t\t}\r\n\t}",
"public void makeConnection() {\n\t\ttry {\n\t\t\tif(sock != null) {\n\t\t\t\ttable.printMsg(\"Cannot join a server twice! You've already connected.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsock = new Socket(serverIP, serverPort);\n\t\t\toos = new ObjectOutputStream(sock.getOutputStream());\n\t\t\tois = new ObjectInputStream(sock.getInputStream());\n\t\t\tThread thread = new Thread(new ServerHandler());\n\t\t\tthread.start();\n\t\t} catch(Exception e) {\n\t\t\ttable.printMsg(\"Cannot Join Server.\");\n\t\t\tsock = null;\n\t\t\ttable.repaint();\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public void connect() {\n BotConnector newBot = new BotConnector();\n newBot.setEmail(this.email);\n newBot.setAuthenticationKey(key);\n newBot.setBotName(name);\n newBot.setRoom(room);\n //Start Listener Thread\n this.serverListener = new Thread(newBot, \"serverListener\");\n this.serverListener.start();\n }",
"public Connection getConnection();",
"public Connection getConnection();",
"public Connection getConnection();",
"public void establishConnection() {\r\n\t\t// Load IMAP-Account credentials from the property file\r\n\t\tProperties prop = new Properties();\r\n\t\tInputStream in = this.getClass().getClassLoader().getResourceAsStream(\"server_resources/IMAPAccountCredentials.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tin.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\thost = prop.getProperty(\"imapHost\");\r\n\t\tuser = prop.getProperty(\"imapUsername\");\r\n\t\tpassword = prop.getProperty(\"imapPassword\");\r\n\t\tuseSSL = Boolean.parseBoolean(prop.getProperty(\"useSSL\"));\r\n\r\n\t\t// Create session for account\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(\"mail.imap.host\", host);\r\n\t\tif (useSSL) {\r\n\t\t\tprops.put(\"mail.imap.socketFactory.port\", \"993\");\r\n\t\t\tprops.put(\"mail.imap.socketFactory.class\", \"javax.net.ssl.SSLSocketFactory\");\r\n\t\t\tprops.put(\"mail.imap.auth\", \"true\");\r\n\t\t\tprops.put(\"mail.imap.port\", \"993\");\r\n\t\t}\r\n\t\tSession session = Session.getDefaultInstance(props, new javax.mail.Authenticator() {\r\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\r\n\t\t\t\treturn new PasswordAuthentication(user, password);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfinal URLName unusedUrlName = null;\r\n\t\tif (useSSL) {\r\n\t\t\tstore = new IMAPSSLStore(session, unusedUrlName);\r\n\t\t} else {\r\n\t\t\tstore = new IMAPStore(session, unusedUrlName);\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tstore.connect(host, user, password);\r\n\t\t} catch (MessagingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"private void establishConnection() throws IOException {\n\t\tthis.inReader = new BufferedReader(new InputStreamReader(this.conn.getInputStream()));\n\t\tthis.outWriter = new BufferedWriter(new OutputStreamWriter(this.conn.getOutputStream()));\n\t}",
"public void openConnection(){\r\n try {\r\n Driver dr = new FabricMySQLDriver();\r\n DriverManager.registerDriver(dr);\r\n log.info(\"registrable driver\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n try {\r\n connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\r\n log.info(\"get connection\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }",
"public static void connectToServer() throws IOException {\n displayMessage(\"Attempting connection\\n\");\n\n // create Socket to make connection to server\n client = new Socket(InetAddress.getByName(chatServer), 8888);\n\n // display connection information\n displayMessage(\"Connected to: \" +\n client.getInetAddress().getHostName());\n }",
"public void connect(String host, int port) throws IllegalStateException,\n \t\t\tIOException, JHGDException {\n \t\t// Check if the client is already connected\n \t\tif (connected) {\n \t\t\tthrow new IllegalStateException(\"Client already connected to \"\n \t\t\t\t\t+ host + \" on port \" + port);\n \t\t}\n \n \t\t// Open socket\n \t\topenSocket(host, port);\n \n \t\tString returnMessage = (String) input.readLine();\n \n \t\tif (checkServerResponse(returnMessage) != HGDConsts.SUCCESS) {\n \t\t\tthrow new JHGDException(returnMessage.substring(returnMessage\n \t\t\t\t\t.indexOf('|') + 1));\n \t\t}\n \t\t\n \t\tString protocolVersion = requestProto();\n \t\tif ( !protocolVersion.equalsIgnoreCase(HGDConsts.PROTOCOLVERSION)) {\n \t\t\tthrow new JHGDException(\"Incompatible protocols. Client: \" + HGDConsts.PROTOCOLVERSION + \", Daemon: \" + protocolVersion);\n \t\t}\n \t\t\n \t\t// set the flags\n \t\tthis.connected = true;\n \t\tthis.authenticated = false;\n \t\tthis.host = host;\n \t\tthis.port = port;\n \t\tthis.username = null;\n \t\tthis.password = null;\n \t\t\n \t}",
"public abstract void connect() throws UnknownHostException, IOException;",
"public boolean connect(String connectionInfo, String userName, String password);",
"public void connexion() {\r\n\t\ttry {\r\n\r\n\t\t\tsoapConnFactory = SOAPConnectionFactory.newInstance();\r\n\t\t\tconnection = soapConnFactory.createConnection();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"public static void connectToServer() throws IOException {\n String serverAddress = \"localhost\";\n\n // Make connection and initialize streams\n Socket socket = new Socket(serverAddress, 9898);\n in = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n out = new PrintWriter(socket.getOutputStream(), true);\n\n // Consume the initial welcoming messages from the server\n /*for (int i = 0; i < 3; i++) {\n System.out.println(in.readLine() + \"\\n\");\n }*/\n }",
"public static Connection openConnection() {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tClass.forName(DRIVER);\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn conn;\n\t\t\n\t}",
"private void createConnection() {\n this.callbacks = getCallbacks();\n\n Properties props = new Properties();\n props.putAll(getTestProps());\n props.putAll(getProps());\n this.connection = Connections.create((ConnectionCallbacks) callbacks, props);\n configureConnection(connection);\n }",
"@Override\n public boolean connect() {\n\n if (!isConnected) {\n try {\n\n Socket socket = new Socket(hostName, portNumber);\n out = new PrintWriter(socket.getOutputStream(), true);\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n isConnected = true;\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return isConnected;\n }",
"private void attemptToConnect() {\n LOG.warn(\"Attempting to connect....\");\n \n if (// No connection configuration\n getConnectionConfiguration() == null &&\n (getServerHostname() == null || getServerPort() == 0 ||\n getServiceName() == null || getFromAddress() == null ||\n getPassword() == null || getResource() == null)\n \n ||\n \n // Already logged in.\n getConnection() != null && getConnection().isAuthenticated()) {\n \n return;\n }\n \n try {\n if (getConnectionConfiguration() == null) {\n setConnectionConfiguration(new ConnectionConfiguration(\n getServerHostname(), getServerPort(), getServiceName()));\n }\n\n connect();\n }\n catch (Throwable t) {\n LOG.error(t);\n }\n }",
"private static void setupConnection() {\r\n\t\t\r\n\t\t// Variable used to keep track of if a connection is sucessful\r\n\t\tboolean connectionSuccess;\r\n\t\t\r\n\t\t// Loop until a sucessful connection is made\r\n\t\tdo {\r\n\t\t\tconnectionSuccess = true;\r\n\t\t\t\r\n\t\t\t// Get server info from user\r\n\t\t\tString serverInfo = JOptionPane.showInputDialog(null, \"Please input the server IP and port\"\r\n\t\t\t\t\t+ \" in the form \\\"IP:Port\\\"\", \"Server Connection Details\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\r\n\t\t\t// If the X button or cancel is clicked exit the program\r\n\t\t\tif(serverInfo == null) {\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString[] serverInfoArray = serverInfo.split(\":\", 2);\r\n\t\t\tint port = 0;\r\n\t\t\t\r\n\t\t\t// Check that both the port and IP have been inputted\r\n\t\t\tif(serverInfoArray.length > 1) {\r\n\t\t\t\t\r\n\t\t\t\t// Check that the port inputted is valid\r\n\t\t\t\ttry{\r\n\t\t\t\t\tport = Integer.parseInt(serverInfoArray[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(port > 65536 || port < 0) {\r\n\t\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} catch(NumberFormatException e) {\r\n\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tshowMSG(\"Please input a port number and IP address\");\r\n\t\t\t\tconnectionSuccess = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// After port validation try to connect to the server\r\n\t\t\tif(connectionSuccess == true) {\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsock = new Socket(serverInfoArray[0], port);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Loop until a successful connection to the server is made\r\n\t\t} while(connectionSuccess == false);\r\n\t\t\r\n\t\t\r\n\t\t// Setup buffered reader to read from the server\r\n\t\ttry {\r\n\t\t\tserverReader = new BufferedReader(new InputStreamReader(sock.getInputStream()));\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}",
"public boolean initAndConnectToServer() {\n try {\n mTCPSocket.connect(new InetSocketAddress(mIpAdress, port), 1000);\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n return true;\n }",
"private void connectUsingCertificate() {\n\t\tfinal String METHOD = \"connectUsingCertificate\";\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\t\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\t/* This isn't needed as the production messaging.internetofthings.ibmcloud.com \n\t\t\t * certificate should already be in trust chain.\n\t\t\t * \n\t\t\t * See: \n\t\t\t * http://stackoverflow.com/questions/859111/how-do-i-accept-a-self-signed-certificate-with-a-java-httpsurlconnection\n\t\t\t * https://gerrydevstory.com/2014/05/01/trusting-x509-base64-pem-ssl-certificate-in-java/\n\t\t\t * http://stackoverflow.com/questions/12501117/programmatically-obtain-keystore-from-pem\n\t\t\t * https://gist.github.com/sharonbn/4104301\n\t\t\t * \n\t\t\t * CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\t\t\t * InputStream certFile = AbstractClient.class.getResourceAsStream(\"messaging.pem\");\n\t\t\t * Certificate ca = cf.generateCertificate(certFile);\n\t\t\t *\n\t\t\t * KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t\t * keyStore.load(null, null);\n\t\t\t * keyStore.setCertificateEntry(\"ca\", ca);\n\t\t\t * TrustManager trustManager = TrustManagerUtils.getDefaultTrustManager(keyStore);\n\t\t\t * SSLContext sslContext = SSLContextUtils.createSSLContext(\"TLSv1.2\", null, trustManager);\n\t\t\t * \n\t\t\t */\n\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\t//Validate the availability of Server Certificate\n\t\t\t\n\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tserverCert = trimedValue(options.getProperty(\"Server-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Server Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Client Certificate\n\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tclientCert = trimedValue(options.getProperty(\"Client-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t//Validate the availability of Client Certificate Key\n\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")).contains(\".key\")){\n\t\t\t\t\tclientCertKey = trimedValue(options.getProperty(\"Client-Key\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only Certificate key in .key format is supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Key is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Certificate Password\n\t\t\ttry{\n\t\t\tif (trimedValue(options.getProperty(\"Certificate-Password\")) != null){\n\t\t\t\tcertPassword = trimedValue(options.getProperty(\"Certificate-Password\"));\n\t\t\t\t} else {\n\t\t\t\t\tcertPassword = \"\";\n\t\t\t\t}\n\t\t\t} catch (Exception e){\n\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Certificate Password is missing\", e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(getSocketFactory(serverCert, clientCert, clientCertKey, certPassword));\n\n\t\t} catch (Exception e) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, \"Unable to configure TLSv1.2 connection: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void connecting() {\n\n }",
"private void connect() {\n\t\t//\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(logInfo, user, pwd);\n\t\t\tsmt = conn.createStatement();\n\t\t\tif (conn != null) {\n\t\t\t\tSystem.out.println(\"[System:] Postgres Connection successful\");\n\t\t\t\tstatus = true;\n\t\t\t} else {\n\t\t\t\tSystem.err.println(\"Failed to make connection!\");\n\t\t\t\tstatus = false;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Connection Failed!\");\n\t\t\te.printStackTrace();\n\t\t\tstatus = false;\n\t\t}\n\t\t\n\t}",
"public void connect() throws IOException {\n\t\tsocket = new Socket(host, port);\n\t\tin = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\tout = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));\n\t\tconnected = true;\n\t\texecutor = Executors.newScheduledThreadPool(5);\n\t}",
"public boolean connectTo(Recipient server) {\r\n\t\ttry {\r\n\t\t\tserverConnection = new Server(new NetworkConnection(server,\r\n\t\t\t\t\tresourceManager.getMessageParser(), this));\r\n\t\t\tEventLogger.log(\"Client now connected to server: \"\r\n\t\t\t\t\t+ server.getIPAddressString() + \" on port: \"\r\n\t\t\t\t\t+ server.getPortNumber());\r\n\t\t\tconnected.set(true);\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\tErrorLogger.log(e.getMessage());\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public void connect() {\n synchronized (globalLock) {\n if (isRunning) {\n throw new IllegalStateException(\"WebSocketClient is not reusable\");\n }\n\n this.isRunning = true;\n createAndStartConnectionThread();\n }\n }"
] | [
"0.72269607",
"0.7192324",
"0.70995027",
"0.69298446",
"0.69267154",
"0.6910459",
"0.6906998",
"0.6891465",
"0.68719083",
"0.686514",
"0.685363",
"0.68261755",
"0.6773468",
"0.6741133",
"0.6740053",
"0.67155755",
"0.670801",
"0.66845393",
"0.66841555",
"0.66636217",
"0.6656583",
"0.6655601",
"0.6651748",
"0.662774",
"0.66213715",
"0.66169924",
"0.6564576",
"0.65542",
"0.65435797",
"0.65333235",
"0.6523881",
"0.65112484",
"0.65112484",
"0.65112484",
"0.65101016",
"0.64873236",
"0.6449236",
"0.64488995",
"0.64382195",
"0.64146465",
"0.64073044",
"0.64072794",
"0.6403724",
"0.6399889",
"0.63938224",
"0.638551",
"0.63800746",
"0.6364862",
"0.6361275",
"0.6350206",
"0.6349678",
"0.6343969",
"0.6342615",
"0.6326188",
"0.63186425",
"0.63111764",
"0.6304085",
"0.6301255",
"0.62758213",
"0.6258897",
"0.62387824",
"0.6225818",
"0.6224927",
"0.6223449",
"0.6201959",
"0.6194171",
"0.61895174",
"0.61893886",
"0.6159298",
"0.61404926",
"0.6134535",
"0.61311483",
"0.613031",
"0.6128411",
"0.6120717",
"0.6111765",
"0.6107068",
"0.61055607",
"0.61055607",
"0.61055607",
"0.6097864",
"0.6093669",
"0.6093492",
"0.6079455",
"0.6078072",
"0.60779136",
"0.6071226",
"0.606551",
"0.6061394",
"0.6051433",
"0.6031992",
"0.60316324",
"0.6014376",
"0.6012592",
"0.6006121",
"0.6004842",
"0.6004109",
"0.60020167",
"0.5994706",
"0.59868276",
"0.59824824"
] | 0.0 | -1 |
Terminate the connection to the server | public boolean endConnection() throws CommunicationException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void terminate() {\n config.closeConnection();\n }",
"public void closeConnection(){\r\n\t\t_instance.getServerConnection().logout();\r\n\t}",
"public void disconnect(){\n\n\t\tserverConnection.disconnect();\n\t}",
"private void closeConnection() {\n\t\t\tSystem.out.println(\"\\nTerminating connection \" + myConID + \"\\n\");\n\t\t\ttry {\n\t\t\t\toutput.close(); // close output stream\n\t\t\t\tinput.close(); // close input stream\n\t\t\t\tconnection.close(); // close socket\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"Exception occured in closing connection\"\n\t\t\t\t\t\t+ ioException);\n\t\t\t}\n\t\t}",
"private void shutdown() {\n clientTUI.showMessage(\"Closing the connection...\");\n try {\n in.close();\n out.close();\n serverSock.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void stopConnection() throws IOException {\n in.close();\n out.close();\n clientSocket.close();\n }",
"@Override\n public void closeConnection() {\n\n System.out.println(\"[CLIENT] Closing socket connection...\");\n try {\n socket.close();\n in.close();\n out.close();\n System.out.println(\"[CLIENT] Closed socket connection.\");\n } catch (IOException e) {\n System.out.println(\"[CLIENT] Error occurred when closing socket\");\n }\n System.exit(0);\n\n }",
"public void stop() {\n\t\tgetLogger().debug(\"Waiting 5 seconds for EVCC to process response and close TCP/TLS connection ...\");\n\t\ttry {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\t\t\n\t\tif (!isStopAlreadyInitiated()) {\n\t\t\tgetLogger().debug(\"Closing connection to client ...\");\n\t\t\tsetStopAlreadyInitiated(true);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tgetInStream().close();\n\t\t\t\tgetOutStream().close();\n\t\t\t\t\n\t\t\t\tif (getTcpClientSocket() != null) {\n\t\t\t\t\tgetTcpClientSocket().close();\n\t\t\t\t} else if (getTlsClientSocket() != null) {\n\t\t\t\t\tgetTlsClientSocket().close();\n\t\t\t\t} else {\n\t\t\t\t\tgetLogger().error(\"Neither TCP nor TLS client socket could be closed\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tgetLogger().debug(\"Connection to client closed\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tgetLogger().error(\"Error occurred while trying to close socket to client\", e);\n\t\t\t} \n\t\t}\n\t}",
"@Override\n public void stop() {\n try {\n serverSocket.close();\n }\n catch (IOException e) {\n getExceptionHandler().receivedException(e);\n }\n\n // Close all open connections.\n synchronized (listConnections) {\n for (TcpConnectionHandler tch : listConnections)\n tch.kill();\n listConnections.clear();\n }\n\n // Now close the executor service.\n executorService.shutdown();\n try {\n executorService.awaitTermination(3, TimeUnit.SECONDS);\n }\n catch (InterruptedException e) {\n getExceptionHandler().receivedException(e);\n }\n }",
"public static void disconnect() {\n \t\tconnPool.stop();\n \t}",
"public synchronized void close() {\n\t\t/**\n\t\t * DISCONNECT FROM SERVER\n\t\t */\n\t\tsrvDisconnect();\n\t}",
"private void closeConnection() {\n\t\t_client.getConnectionManager().shutdown();\n\t}",
"public void closeConnection() {\n\t\ttry {\n\t\t\tsocket.close();\n\t\t} catch (IOException e) {\n\t\t\tlogger.warning(\"problem closing socket connection with JSON-RPC server at \" + serverIP + \":\" + serverPort);\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void terminate() {\n\t\tif (socket == null)\n\t\t\tthrow new IllegalStateException();\n\t\ttry {\n\t\t\tsocket.close();\n\t\t} catch (IOException e) {}\n\t}",
"public void terminateSession(){\n\t\t\t\n\t\t\tsendMessage2Client(\"Session Terminated\");\n\t\t\t\n\t\t\tdb.getRecord(keyname).setClientStatus(\"TERMINATED\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tccSocket.close();\n\t\t\t\t\t\t\t\t\n\t\t\t} catch (Exception e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t\tdb.getRecord(keyname).setClientStatus(\"LOST\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"private void closeConnection() {\r\n try {\r\n socket.close();\r\n } catch (IOException ex) {\r\n // Ex on close\r\n }\r\n }",
"public void terminate () {\n active = false;\n try { server_socket.close (); } catch (IOException e) {}\n yield ();\n }",
"public void close()\n {\n try\n {\n System.out.println(\"CLIENT chiude connessione\");\n receiverThread.interrupt();\n socket.close();\n System.exit(0);\n }\n catch (IOException e)\n {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }",
"public void disconnect()\r\n\t{\r\n\t\ttry {\r\n\t\t\tconnection_.close();\r\n\t\t} catch (IOException e) {} // How can closing a connection fail?\r\n\t\t\r\n\t}",
"public void closeConnection() {\n try {\n stdIn.close();\n socketIn.close();\n socketOut.close();\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n }",
"private void closeConnection(){\n report(\"Close connection\");\n try{\n if(socket != null && !socket.isClosed()) {\n report(\"Client: Close socket\");\n socket.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n report(\"End\");\n }",
"@OnClose\n public void end() {\n listener.connectionTerminated();\n Logger.getGlobal().info(\"Connection with \" \n + nickname + \" terminated.\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n }",
"public synchronized void disconnect()\r\n\t\t{\r\n\t\tif (state == RUNNING)\r\n\t\t stop();\r\n\t\tif (state == CLOSING_DOWN)\r\n\t\t {\r\n // Close the server socket\t\t \r\n try {\r\n \t\tserverSocket.close();\r\n \t}\r\n catch (IOException e)\r\n {\r\n }\r\n \r\n \t\t// flag the server as stopped\r\n \t\tstate = STOPPED;\r\n\t\t }\r\n\t\t}",
"public void kill() {\n this.server.stop();\n }",
"private void terminateAllClientConnections() {\n log.info(\"Terminate command received; Closing sockets..\");\n log.info(\"Attempting closing client sockets..\");\n this.socketList.forEach(socket -> {\n try {\n socket.close();\n } catch (Exception e) {\n log.error(\"Error closing client socket address\", socket.getRemoteSocketAddress().toString());\n }\n });\n log.info(\"Attempting closing server listening socket\");\n try {\n this.serverSocket.close();\n this.running.set(false);\n } catch (Exception e) {\n log.error(\"Error closing server socket port\", port);\n }\n }",
"protected void stop() {\n keepGoing = false;\n // connect to myself as Client to exit\n try {\n new Socket(\"localhost\", port);\n } catch(Exception e) {\n // exception handling\n }\n }",
"private void quit() {\n try {\n toServer.writeInt(QUIT);\n doQuit();\n report(\"Client --> server: QUIT \");\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"public synchronized void closeConnection() {\n try {\n connected = false;\n socket.close();\n System.out.println(\"[SERVER] Connection closed with client\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void close() {\n connection.close();\n running = false;\n }",
"public void stopServer() {\n\t\tthis.running=false;\t\t\t\t\t\t\t//the loop of the thread fails\n\t\ttry {\n\t\t\tthis.socket.close();\t\t\t\t\t//closes the socket\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(\"TCPServer : Socket non fermé\");\n\t\t}\n\t}",
"public void serverStop() {\n\t\tJOptionPane.showMessageDialog(dlg, \"与服务器失去连接\");\n\t\tserver = null;\n\t\tconnectAction.setEnabled(false);\n\t\t\n\t}",
"public void shutdown() {\n try {\n \t\n \tserverSocket.close();\n \t\n } catch (Exception e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }",
"public final void exit() {\n if (this.serverSocket instanceof ServerSocket) {\n try {\n this.serverSocket.close();\n } catch (IOException ex) {\n Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"public static void terminate_all_connections()\n\t{\n\t\tNetwork_Control_Message pckt = new Network_Control_Message();\n\t\tpckt.set_terminate(true);\n\t\tsend_queue.add(pckt);\n\t\t\n\t\ttry {\n\t\t\tserver_socket.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not close the ServerSocket.\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}",
"public void quit()throws IOException {\n if(s.isConnected()) {\n reader.close();\n writer.close();\n s.close();\n System.out.println(\"Disconnected from the server.\");\n }\n }",
"public void closeConnection() {\n try {\n socket.close();\n oStream.close();\n } catch (Exception e) { }\n }",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t//pass\r\n\t\t\t}\r\n\t\t}",
"private void exit()\n {\n try\n {\n connect.close();\n }\n catch (javax.jms.JMSException jmse)\n {\n jmse.printStackTrace();\n }\n\n System.exit(0);\n }",
"private void stop() {\n if (client != null) {\n this.client.close();\n }\n }",
"public void cancel() {\n try {\n\n mServerSocket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void stop() {\n\t\ttry {\n\t\t\tif (serverSocket != null)\n\t\t\t\tserverSocket.close();\n\t\t} catch (IOException ioe) {\n\t\t\t// shouldn't happen\n\t\t}\n\t}",
"public void stop() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tif (socket != null) {\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Socket closed.\");\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\n\t\t}\n\t}",
"private void close() {\n\t\ttry {\n\t\t\tsendCommand(\"end\\n\");\n\t\t\tout.close();\n\t\t\tin.close();\n\t\t\tsocket.close();\n\t\t} catch (MossException e) {\n\t\t} catch (IOException e2) {\n\t\t} finally {\n\t\t\tcurrentStage = Stage.DISCONNECTED;\n\t\t}\n\n\t}",
"public void exitClient()\n\t{\n\t\ttry{\n\t\t\tif(sock.isConnected()){\n\t\t\tsock.close();\n\t\t\t//listenerSock.close();\n\t\t\tSystem.out.println(\"restart your client.....\");\n\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t}\n\t}",
"public void stop() {\n tcpServer.stopServer();\n ThreadExecutor.shutdownClient(this.getClass().getName());\n }",
"protected void handleKillThread() {\n \t\ttry {\n \t\t\tif (server != null)\tserver.close();\n \t\t\tif (client != null) client.close();\n \t\t} catch (IOException e) {\n \t\t\thandleError(e.getMessage());\n \t\t}\n \t}",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.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}",
"public void stop() {\n\t\tconnection.stop();\n\t\tdata.disconnectAll();\n\t\tsaveData();\n\t}",
"public synchronized void shutdown() {\n server.stop();\n }",
"private void disconnectFromServer() {\n\t\ttry {\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot disconnect from server\");\n\t\t}\n\t}",
"public void disconnect() {}",
"public void closeConnection() {\n try {\n dis.close();\n dos.close();\n socket.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void Stop() throws IOException {\n DisposeServer();\n }",
"public void disconnect( ) {\n disconnect( \"\" );\n }",
"final public void closeConnection() throws IOException {\n\n readyToStop = true;\n closeAll();\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) {\n Log.e(\"TEST\", \"Could not close the connect socket\", e);\n }\n\n }",
"public void closeSocket () \n {\n try {\n // close the open server socket\n server.close();\n // send it a message to make it stop waiting immediately\n // (not really necessary)\n /*Socket s = new Socket(\"localhost\", thisPort);\n OutputStream os = s.getOutputStream();\n os.write((byte)0);\n os.close();\n s.close();*/\n } catch(Exception ex) { \n LOG.warn(\"Exception while shutting down \"+ this.getClass(), ex);\n }\n \n server = null;\n }",
"public void closeServer()\n\t{\n\t\t//System.out.println(\"*********Beginning Close Operations*********\");\n\n\t\ttry {\n\t\t\t//System.out.println(\"***********Closing client socket*************\");\n\t\t\tthis.closeClientConnection();\n\t\t\tstringFile.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\t\n\t\t\tisRunning = false;\n\t\t//System.out.println(\"Ending server....\");\n\t}",
"public void disconnect() {\n\t\tif (_connection != null) {\n\t\t\ttry {\n\t\t\t\twhile (!_connection.isClosed()) {\n\t\t\t\t\t_connection.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) { /* ignore close errors */\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void terminate();",
"public void destroy(){\n\n if(myConnection !=null){\n\n try{\n myConnection.close();\n }\n catch(Exception e){\n System.out.println(\"failed to destroy\");\n }\n\n\n }\n return;\n }",
"private void endConnection(){\n\t\tif(this.connection != null){\n\t\t\ttry {\n\t\t\t\tthis.connection.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) {\n Log.e(TAG, \"Could not close the connect socket\", e);\n }\n }",
"void shutDownServer() throws Exception;",
"public void shutdown() {\n\t\tserver.stop(0);\n\t}",
"@Override\n\tpublic void stop() throws ConnectException {\n\t\tSystem.out.print(\"Stopping\");\n\t}",
"public void close() {\n try {\n closeConnection(socket);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }",
"public void close()\n {\n getConnectionManager().shutdown();\n }",
"public static void closeConnection() {\n\t\ttry {\n\n\t\t\tconexion.close();\n\t\t\tSystem.out.print(\"Server Disconnected\");\n\t\t} catch (SQLException ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t\tSystem.out.print(\"Error cerrando conexion\");\n\t\t}\n\t}",
"protected void kill() {\n disconnect = true;\n }",
"public void Stop_Connection(){\n keepWalking = false; //gia na stamatisei to chat alliws to thread dn ginete interrupt gt dn stamataei i liturgeia tou.\n Chat_Thread.interrupt();\n try {\n if(oos != null) oos.close();\n if(ois != null) ois.close();\n } catch (IOException ex) {\n Logger.getLogger(ChatWithCC.class.getName()).log(Level.SEVERE, null, ex);\n }\n try {\n if(socket !=null) socket.close();\n } catch (IOException ex) {\n Logger.getLogger(ChatWithCC.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void closeConnection();",
"public void closeConnection() throws Exception {\n\t\ttry {\n\t\t\tclient.close();\n\t\t\tis.close();\n\t\t\tisr.close();\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"Connection is closed\");\n\t\t\tgetConnection();\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\n\t}",
"public void stop() {\n if (server != null) {\n server.shutdown();\n }\n }",
"public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) { }\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) { }\n }",
"public static void disconnect() {\r\n if (isConnected()) {\r\n listener.interrupt();\r\n timerThread.interrupt();\r\n keepAliveThread.interrupt();\r\n db.writeDatabase();\r\n ObjectIO.writeObjectToFile(cmdPath, cmd);\r\n tc.stopCommands();\r\n ObjectIO.writeObjectToFile(tcPath, tc);\r\n try {\r\n irc.close();\r\n }\r\n catch (IOException e) { /* Shouldn't happen */ }\r\n }\r\n irc = null;\r\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException ignored) { }\n }",
"public void stop() {\n server.stop();\n }",
"public void disconnect();",
"public void disconnect();",
"public void disconnect();",
"public void disconnect();",
"void disconnect() throws Exception;",
"private void closeConnection() throws IOException {\n\t\tclientSocket.close();\n\t}",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tmmServerSocket.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}",
"private void closeConnection () {\n setConnection (null);\n }",
"public void terminate() {\n this.terminated = true;\n executor.interrupt();\n this.handler = null;\n this.out = null;\n this.in = null;\n this.logger = null;\n this.buffer = null;\n }",
"public static void stopServer() {\n try {\n clientListener.stopListener();\n server.close();\n connectionList.clear();\n } catch (IOException ex) {\n System.err.println(\"Error closing server: \\\"\" + ex.getMessage() + \"\\\"\");\n }\n System.out.println(\"SERVER SHUT DOWN\");\n }",
"public void halt() {\n closeSocket(sock1);\n closeSocket(sock2);\n }",
"protected final void disconnect() {\n\t\trunning = false;\n\t\ttry {\n\t\t\tif (out != null)\n\t\t\t\tout.close();\n\t\t\tif (in != null)\n\t\t\t\tin.close();\n\t\t\tsocket.close();\n\t\t} catch (IOException e) {e.printStackTrace();}\n\t}",
"public void disconnect ()\n {\n org.omg.CORBA.portable.InputStream $in = null;\n try {\n org.omg.CORBA.portable.OutputStream $out = _request (\"disconnect\", true);\n $in = _invoke ($out);\n return;\n } catch (org.omg.CORBA.portable.ApplicationException $ex) {\n $in = $ex.getInputStream ();\n String _id = $ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException $rm) {\n disconnect ( );\n } finally {\n _releaseReply ($in);\n }\n }",
"@Override\n public void close() {\n logger.info(\"Going to disconnect from the SQL server\");\n JDBCUtils.safeClose(connection);\n connection = null;\n super.close(); // Empty method call\n\n // Stop the container\n logger.info(\"Going to stop the SQL server\");\n postgreSQLContainer.stop();\n }",
"public void terminate () {\n for (int i=0; i<threads; i++) {\n servers[i].terminate ();\n }\n }",
"protected void stop() {\n keepGoing = false;\n try {\n new Socket(\"localhost\", port);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }",
"public void close()\n {\n \tSystem.out.println(\"close\");\n \tsend(\"<message> <disconnect/></message>\");\n \ttry {\n\t\t\tsocket.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 }",
"public static void closeHttpConn(){ \n\t\thttpUrl.disconnect(); \n\t}",
"public void end() {\n \t\ttry {\n \t\t\tnameServerClient.leave();\n \t\t} catch (Exception e) {\n \t\t\t__.fwdAbort__(e);\n \t\t}\n \t}",
"public void close() {\n synchronized(this) {\n for(Enumeration e = connections.elements();e.hasMoreElements();) {\n try {\n ((Socket)e.nextElement()).close();\n } catch(InterruptedIOException ex) {\n Thread.currentThread().interrupt();\n } catch(IOException ex) {\n } catch(RuntimeException ex) {\n }\n }\n }\n\n try {\n serverSocket.close();\n } catch(InterruptedIOException ex) {\n Thread.currentThread().interrupt();\n } catch(IOException ex) {\n } catch(RuntimeException ex) {\n }\n }"
] | [
"0.7824423",
"0.73657155",
"0.72246987",
"0.71948093",
"0.71118265",
"0.7067122",
"0.6991871",
"0.69847125",
"0.6952128",
"0.68771064",
"0.68660796",
"0.6856094",
"0.6851165",
"0.68372047",
"0.68083847",
"0.67907614",
"0.67830336",
"0.6760978",
"0.6753863",
"0.673635",
"0.67358106",
"0.67286086",
"0.67271596",
"0.67189276",
"0.6706882",
"0.66867274",
"0.66754985",
"0.66704357",
"0.66521055",
"0.6640989",
"0.6621075",
"0.66054064",
"0.66052336",
"0.6600884",
"0.65996134",
"0.65975785",
"0.6589927",
"0.6574571",
"0.65684307",
"0.6566032",
"0.6565896",
"0.6559061",
"0.655808",
"0.6556562",
"0.6548235",
"0.65368646",
"0.6531326",
"0.65267193",
"0.65227747",
"0.6521245",
"0.65210634",
"0.651843",
"0.6488887",
"0.6479457",
"0.64657086",
"0.6465182",
"0.64644957",
"0.6464205",
"0.64590156",
"0.6457803",
"0.64498305",
"0.64420414",
"0.64367574",
"0.64359045",
"0.6435553",
"0.6422932",
"0.6415995",
"0.6415401",
"0.64139134",
"0.6413571",
"0.64116824",
"0.64042175",
"0.6399059",
"0.639902",
"0.639827",
"0.6394479",
"0.6394479",
"0.6392001",
"0.6386684",
"0.6383487",
"0.6378556",
"0.6378556",
"0.6378556",
"0.6378556",
"0.63726693",
"0.6370982",
"0.636845",
"0.63683647",
"0.63672376",
"0.63645715",
"0.6358788",
"0.63515514",
"0.6348567",
"0.6347858",
"0.6343792",
"0.6342727",
"0.6341427",
"0.63392234",
"0.6337877",
"0.6335659"
] | 0.6810489 | 14 |
Initialize your data structure here. | public MovingAverage(int size) {
q = new LinkedList();
this.size = size;
sum = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initData() {\n }",
"private void initData() {\n\t}",
"private void initData() {\n\n }",
"public void initData() {\n }",
"public void initData() {\n }",
"@Override\n\tpublic void initData() {\n\n\n\n\t}",
"@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\tpublic void initData() {\n\t\t\n\t}",
"@Override\n protected void initData() {\n }",
"@Override\n protected void initData() {\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\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}",
"private void InitData() {\n\t}",
"@Override\r\n\tpublic void initData() {\n\t}",
"private void initData(){\n\n }",
"public AllOOneDataStructure() {\n map = new HashMap<>();\n vals = new HashMap<>();\n maxKey = minKey = \"\";\n max = min = 0;\n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}",
"public InitialData(){}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"protected @Override\r\n abstract void initData();",
"private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }",
"public DesignADataStructure() {\n arr = new ArrayList<>();\n map = new HashMap<>();\n }",
"public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}",
"public void initialize() {\n // empty for now\n }",
"void initData(){\n }",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void initData(){\r\n \r\n }",
"public void initialize()\n {\n }",
"private void initData() {\n\t\tpages = new ArrayList<WallpaperPage>();\n\n\t}",
"public void init() {\n \n }",
"private void initializeData() {\n posts = new ArrayList<>();\n posts.add(new Posts(\"Emma Wilson\", \"23 years old\", R.drawable.logo));\n posts.add(new Posts(\"Lavery Maiss\", \"25 years old\", R.drawable.star));\n posts.add(new Posts(\"Lillie Watts\", \"35 years old\", R.drawable.profile));\n }",
"public static void init() {\n buildings = new HashMap<Long, JSONObject>();\n arr = new ArrayList();\n buildingOfRoom = new HashMap<Long, Long>();\n }",
"public void init() {\n\t\t}",
"public void InitData() {\n }",
"abstract void initializeNeededData();",
"@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}",
"@Override\n\t\tpublic void init() {\n\t\t}",
"private RandomData() {\n initFields();\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private TigerData() {\n initFields();\n }",
"public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }",
"public void init()\n {\n this.tripDict = new HashMap<String, Set<Trip>>();\n this.routeDict = new HashMap<String, Double>();\n this.tripList = new LinkedList<Trip>();\n this.computeAllPaths();\n this.generateDictionaries();\n }",
"public void init() {\n for (int i = 1; i <= 20; i++) {\n List<Data> dataList = new ArrayList<Data>();\n if (i % 2 == 0 || (1 + i % 10) == _siteIndex) {\n dataList.add(new Data(i, 10 * i));\n _dataMap.put(i, dataList);\n }\n }\n }",
"private void initData() {\n requestServerToGetInformation();\n }",
"private void Initialized_Data() {\n\t\t\r\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}",
"private void initValues() {\n \n }",
"private void init() {\n }",
"public void initialize() {\n grow(0);\n }",
"public void init() {\r\n\r\n\t}",
"private void initialize()\n {\n aggregatedFields = new Fields(fieldToAggregator.keySet());\n }",
"@objid (\"4bb3363c-38e1-48f1-9894-6dceea1f8d66\")\n public void init() {\n }",
"public void initialize() {\n\n fechaDeLaVisita.set(LocalDate.now());\n\n if (medico.get() != null) {\n medico.get().clear();\n } else {\n medico.set(new Medico());\n }\n\n turnoVisita.set(\"\");\n visitaAcompanadaSN.set(false);\n lugarVisita.set(\"\");\n if (causa.get() != null) {\n causa.get().clear();\n } else {\n causa.set(new Causa());\n }\n\n if (promocion.get() != null) {\n promocion.get().clear();\n } else {\n promocion.set(new Promocion());\n }\n\n observacion.set(\"\");\n persistida.set(false);\n persistidoGraf.set(MaterialDesignIcon.SYNC_PROBLEM.graphic());\n\n fechaCreacion.set(LocalDateTime.now());\n\n }",
"protected void initialize() {\n \t\n }",
"public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}",
"private void init() {\n }",
"private void init() {\n }",
"private void init() {\n }",
"private void init() {\n }",
"@Override public void init()\n\t\t{\n\t\t}",
"private void initData() {\n\t\tcomboBoxInit();\n\t\tinitList();\n\t}",
"public DataStructure() {\r\n firstX = null;\r\n lastX = null;\r\n firstY = null;\r\n lastY = null;\r\n size = 0;\r\n }",
"private void initialize() {\n }",
"private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}",
"private void init() {\n\n\t}",
"public void init() {\n\n\t}",
"public void init() {\n\n\t}",
"public void init() {\n\n\t}",
"public void initialize() {\n // TODO\n }",
"public void initialize() {\r\n }",
"@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"private void init()\n\t{\n\t\tif (_invData == null)\n\t\t\t_invData = new InvestigateStore.MappedStores();\n\t}",
"@Override\n\t\tprotected void initialise() {\n\n\t\t}",
"public void init() {\n\t\t\n\t}",
"public void init() {\n\t\n\t}",
"public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }",
"private void initialize() {\n\t\t\n\t}",
"private void initialize() {\n this.pm10Sensors = new ArrayList<>();\n this.tempSensors = new ArrayList<>();\n this.humidSensors = new ArrayList<>();\n }",
"@Override\r\n\tpublic void init() {}",
"public void init() {\n\t\t// Read the data text file and load up the local database\n\t\tinitData();\n\n\t\t// Create the labels and the textbox\n\t\taddNameLabel();\n\t\taddNameBox();\n\t\taddGraphButton();\n\t\taddClearButton();\n\n\t\t// Set up the graph object\n\t\tgraph = new NameSurferGraph();\n\t\tadd(graph);\n\n\t}",
"private void initialData() {\n\n }",
"@Override\r\n\tpublic final void init() {\r\n\r\n\t}",
"public mainData() {\n }",
"private void initStructures() throws RIFCSException {\n initTexts();\n initDates();\n }",
"public void init() {\n initComponents();\n initData();\n }",
"public void init() {\n\t}"
] | [
"0.79946685",
"0.7973242",
"0.7808862",
"0.77763873",
"0.77763873",
"0.7643394",
"0.76371324",
"0.76371324",
"0.76371324",
"0.76371324",
"0.76371324",
"0.76371324",
"0.75553316",
"0.7543321",
"0.7543321",
"0.75426376",
"0.75426376",
"0.75426376",
"0.7532583",
"0.75228804",
"0.75228804",
"0.7515626",
"0.7494068",
"0.7454065",
"0.7388256",
"0.7380365",
"0.7328254",
"0.7311082",
"0.7256176",
"0.7242837",
"0.7242837",
"0.720293",
"0.7202036",
"0.7164401",
"0.7144378",
"0.71355236",
"0.7132754",
"0.7131076",
"0.7101955",
"0.7098935",
"0.70951265",
"0.70578545",
"0.7055706",
"0.70423454",
"0.7021184",
"0.70061564",
"0.6987191",
"0.6979681",
"0.6960125",
"0.6946316",
"0.69393814",
"0.6938019",
"0.6937645",
"0.6935085",
"0.6933533",
"0.692056",
"0.69171643",
"0.6911375",
"0.6903781",
"0.68829435",
"0.6881986",
"0.6879309",
"0.68750894",
"0.6868541",
"0.6867774",
"0.6852462",
"0.6851922",
"0.68477225",
"0.68477225",
"0.68477225",
"0.68477225",
"0.6846597",
"0.6818907",
"0.6808544",
"0.6805373",
"0.6791477",
"0.6787723",
"0.6781544",
"0.6781544",
"0.6781544",
"0.67674476",
"0.676184",
"0.67618203",
"0.67537767",
"0.67537767",
"0.67537767",
"0.6750694",
"0.67330045",
"0.67218685",
"0.6721014",
"0.67197996",
"0.67170006",
"0.67124057",
"0.6708111",
"0.66997004",
"0.66991216",
"0.6692312",
"0.6687212",
"0.66789055",
"0.6668848",
"0.66666573"
] | 0.0 | -1 |
/ Your class should be named Solution. Read input as specified in the question. Print output as specified in the question. | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int row = scan.nextInt();
int col = scan.nextInt();
int[][] myArray = new int[row][col];
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
myArray[i][j] = scan.nextInt();
}
}
int i, j, sum = 0;
for (i = 0; i < row; ++i) {
for (j = 0; j < col; ++j) {
sum = sum + myArray[i][j];
}
System.out.print(sum + " ");
sum = 0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}",
"public static void main(String[] args) {\n\t\t\tSystem.out.println(Solution(5, 83));\n\t\t\t\n\t\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution(0));\n\n\t}",
"private void generateSolution() {\n\t\t// TODO\n\n\t}",
"public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n \tint n = Integer.parseInt(f.readLine());\r\n \t\r\n \tint[] a = new int[n];\r\n \tStringTokenizer st = new StringTokenizer(f.readLine());\r\n \tfor(int i = 0; i < n; i++) a[i] = Integer.parseInt(st.nextToken());\r\n \t\r\n \tSystem.out.println(solution(a));\r\n \r\n //out.close();\r\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] arr = new int[4];\n for (int i = 0; i < 4; i++)\n arr[i] = sc.nextInt();\n \n Q1 q1 = new Q1();\n int[] answer = q1.solution(arr);\n \n for (int i = 0; i < answer.length; i++) {\n System.out.println(answer[i]);\n }\n }",
"public static void main(String[] args) {\n\n Solution2.solution();\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(Arrays.toString(solution(8, 1)));\r\n\t}",
"public static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n\t\tProblemSolver problemSolver = new ProblemSolver();\n\t\tproblemSolver.solveTheProblem(in, out);\t\t\n\t\tout.close();\t\t\n\t}",
"public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }",
"public static void main(String[] args) throws IOException {\n\t\t//Scanner in = new Scanner(System.in);\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tsolve(in, out);\n\t\tout.close();\n\t\tin.close();\t\n\t}",
"public static void main(String[] args) {\n String problem = \"Herman\";\n\n // Assign string type variable to solution string\n String result = solution(problem);\n\n //Print solution result\n System.out.println(result);\n }",
"public static void main(String[] args) {\n System.out.println(Arrays.toString(solution(\"\")));\n System.out.println(Arrays.toString(solution(\"abcdef\")));\n System.out.println(Arrays.toString(solution(\"HelloWorld\")));\n System.out.println(Arrays.toString(solution(\"abcde\")));\n System.out.println(Arrays.toString(solution(\"LovePizza\")));\n\n }",
"private void testSolution(String input, String output) {\n runs++;\n\n // Load the problem & solution\n ProblemSpec problemSpec = Solution.loadProblem(input);\n Solution solution = new Solution(problemSpec);\n\n // Solve and time the solution\n long startTime = System.currentTimeMillis();\n List<State> states = solution.solve();\n long endTime = System.currentTimeMillis();\n durations.put(input, endTime - startTime);\n\n // Output the solution\n Solution.writeSolution(Formatter.format(states), output);\n\n problemSpec = Solution.loadProblem(input, output);\n if (solutionPasses(problemSpec)) {\n passes++;\n }\n\n successes++;\n }",
"public static void main(String[] args) {\n\t\tint [] arr = {4,2,3,5};\r\n\t\tint [] answer = solution(arr);\r\n\t\tfor(int i=0;i<answer.length;i++)\r\n\t\t\tSystem.out.print(answer[i]+\" \");\r\n\t}",
"public static void main(String[] args) {\r\n\t\tSolver m = new Solver();\r\n\t\t\r\n\r\n\r\n\t\ttry {\r\n\t\t\tm.readData(\"data/Test_case_1.in\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tint answer = m.solve(\"data/Test_case_1.in\");\r\n\r\n\t\tSystem.out.println(answer);\r\n\t\t\r\n\r\n\r\n\t}",
"private Solution() { }",
"private Solution() { }",
"public static void main(String[] args) {\n int[] arr = {10, 2, 5, 1, 8, 12};\n System.out.println(solution(arr));\n }",
"public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\ts.solution(2, 4, 2, 1);\n\t}",
"public void findSolution() {\n\n\t\t// TODO\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t\ttry{\r\n\t\t\tScanner sc= new Scanner(new File(inpPath));\t//new File(inpPath)\r\n\t\t\tPrintWriter out = new PrintWriter(new File(outPath));\r\n\t\t\tint cases = sc.nextInt();\r\n\t\t\tfor(int t=1;t<=cases;t++){\r\n\t\t\t\tsolve(t,sc,out);\r\n\t\t\t}\r\n\t\t\tout.flush();\r\n\t\t\tout.close();\r\n\t\t}catch(Exception ex){ex.printStackTrace();}\r\n\t\t\r\n\t}",
"public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input6.txt\"));\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\n\t\t\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tfor(int i = 1; i <= t; i++)\n\t\t\tSystem.out.println(\"Case #\"+i+\": \"+solve(br));\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tint a = 0, b = 0;\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\ta = Integer.parseInt(st.nextToken());\n\t\t\tb = Integer.parseInt(st.nextToken());\n\t\t\tbw.write(solution(a, b) + \"\\n\");\n\t\t}\n\t\tbw.flush();\n\t\tbw.close();\n\t}",
"public interface SASolution extends Solution {\r\n\r\n /**\r\n * Generates a neighbor solution using this solution\r\n *\r\n * @return\r\n */\r\n public SASolution getNeighborSolution();\r\n\r\n /**\r\n * Prints this solution\r\n *\r\n * @return\r\n */\r\n public String getAsString();\r\n\r\n}",
"public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input6.txt\"));\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\n\n\t\tsolve(br);\n\t}",
"Solution(){\n\n n = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n a = new int[n+1];\n\n \n for (int i = 1; i <= n; i++) {\n a[i] = scanner.nextInt();\n }\n Graph graph=new Graph(a);\n for(int i=0;i<n-1;i++) {\n \tint node1=scanner.nextInt();\n \tint node2=scanner.nextInt();\n \tgraph.addEdge(node1, node2);\n \t//System.out.println(node1+\" \"+node2);\n }\n //graph.dump();\n int q=scanner.nextInt();\n while(q-- > 0) {\n \tint u=scanner.nextInt();\n \tint d=scanner.nextInt();\n \tint k=scanner.nextInt();\n \t//System.out.println(\"u:\"+u+\" d:\"+d+\" k:\"+k);\n \tSystem.out.println(graph.DFS(u, d, k));\n }\n scanner.close();\n\t\t\n\t}",
"public static void main(String[] args) {\n\r\n\t\t\r\n\t\tTest01 t = new Test01();\r\n\t\t\r\n\t\t//String st = \"1927\";\r\n\t\t//int in\t= 2;\t// n 개 제거\r\n\r\n\t\tString st = \"1231234\";\r\n\t\tint in\t= 3;\t\r\n\t\t\r\n\t\tString an = t.solution(st, in);\r\n\t\t\r\n\t\tSystem.out.println(an);\r\n\t}",
"public static void main(String[] args) {\n\t\tint A[]={2,1,0,0,0};\r\n\t\tSystem.out.println(solution(A));\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\tint[] A = {51,31,43};\n\t\tSystem.out.println(solution(A));\n\n\t}",
"public static void main(String[] args)\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tStringBuilder answers = new StringBuilder();\n\n\t\tanswers.append(\"PERFECTION OUTPUT\\n\");\n\t\ttry\n\t\t{\n\t\t\tint value;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvalue = in.nextInt();\n\t\t\t\tif (value == 0) break;\n\n\t\t\t\tanswers.append(solve(value));\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tanswers.append(\"END OF OUTPUT\");\n\n\t\tSystem.out.println(answers);\n\t}",
"public static void main(String[] args) {\n InputData inputData = new InputData();\n FindNumberOfSteps findNumberOfSteps = new FindNumberOfSteps();\n PrintResult printResult = new PrintResult();\n printResult.print(findNumberOfSteps.find(inputData.input()));\n }",
"public static void main(String[] args) {\r\n\t\tint N=1;\r\n\t\tint[][] trust = {};\r\n\t\tSolution sol = new Solution();\r\n\t\tSystem.out.println(sol.findJudge(N, trust));\r\n\t}",
"public static void main (String args []) throws IOException\r\n\t{\n\t\tScanner in = new Scanner(new File(\"moo.in\"));\r\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"moo.out\")));\r\n\t\tint n = in.nextInt();\r\n//\t\tSystem.out.println(solve(n,0));\r\n\t\tout.println(solve(n,0));\r\n\t\tout.flush();\r\n\t}",
"public static void main(String[] args) {\n\t\tint arr[] = {9,3,9,3,9,7,9};\n\t\tSolution(arr);\n\t}",
"public static void main(String[] args) \r\n {\r\n // TODO: Read the input from the user and call produceAnswer with an equation\r\n \tScanner in = new Scanner(System.in);\r\n \tString problem = in.nextLine();\r\n \tin.close();\r\n \tSystem.out.printf(\"Result: %s\" , produceAnswer(problem));\r\n }",
"public static void main(String[] args) throws IOException {\n\t\tSalesmanTour ss = new SalesmanTour();\n\t\tss.input();\n\t\tSystem.out.println(ss.solve());\n\t}",
"public static void main(String[] args) {\n\r\n\t\tnew Main().sol();\r\n\t}",
"public static void main(String[] args) throws IOException {\n br = new BufferedReader(new FileReader(\"input.txt\"));\r\n\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n nextInt();\r\n int X = nextInt();\r\n String lString = nextToken();\r\n\r\n StringBuilder s = new StringBuilder();\r\n for (; X > 0; X--) s.append(lString);\r\n char[] arr = s.toString().toCharArray();\r\n String soln = solve(arr) ? \"YES\" : \"NO\";\r\n\r\n System.out.printf(\"Case #%d: %s%n\", t, soln);\r\n }\r\n }",
"public static void main(String[] args) {\n\t\tString[][] relation = {\r\n\t\t\t{\"100\",\"ryan\",\"music\",\"2\"},{\"200\",\"apeach\",\"math\",\"2\"},{\"300\",\"tube\",\"computer\",\"3\"},{\"400\",\"con\",\"computer\",\"4\"},{\"500\",\"muzi\",\"music\",\"3\"},{\"600\",\"apeach\",\"music\",\"2\"}\r\n\t\t};\r\n\r\n\t\tSystem.out.println(solution(relation));\r\n\t}",
"public static void main(String[] args) {\n\t\tint[][] maps = \n\t\t\t{\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,0,1,0,1},\n\t\t\t\t\t{1,0,1,1,1},\n\t\t\t\t\t{1,1,1,0,1},\n\t\t\t\t\t{0,0,0,0,1}\n\t\t\t};\n\t\tSystem.out.println(solution(maps));\n\t}",
"public static void main(String[] args) \n\t{\n\t\tinitialize(\"\");\n\t\t\n\t\t//making instance from file name\n\n\t\tString str = \"A-n32-k5.vrp\";\n\t\tString fileName = \"input//\" + str;\n\t\t\n\t\t\n\t\tInstance problem = new VRPInstance(fileName);\n\t\tSystem.out.println(problem.comment);\n\t\t//solve problem\n\n\t\t//Solver solver2 = new SimpleGreedySolver(problem);\n\t\t//Solver solver2 = new NearestNeighborGreedySolver(problem);\n\t\t//Solver solver = new ClarkeWrightGreedySolver(problem);\n\t\t//Solver solver = new EHSBASolver(problem);\n\t\t//solver2.solve();\n\t\t//solver2.printResult();\n\t\t\n\t\t//solver = new ClarkeWrightGreedySolver(problem);\n\t\tSolver solver3 = new EHSBASolver(problem);\n\t\tsolver3.solve();\n\t\tsolver3.printResult();\n\t\t\n\t\tSystem.out.println(\"finished.\");\n\t\t\n\t\t\n\t\t/*File folder = new File(\"input\");\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\n\t\tfor(int i = 0; i < listOfFiles.length; i++)\n\t\t{\n\t\t\n\t\t\tString str = listOfFiles[i].getName();\n\t\t\tSystem.out.println(str);\n\t\t\tif(listOfFiles[i].isFile() && str.substring(0, 1).equalsIgnoreCase(\"A\"))\n\t\t\t\tfileName = \"input\\\\\" + str;\n\t\t\telse\n\t\t\t\tcontinue;\n\n\t\t\t//fileName = \"input\\\\\" + fileName;\n\t\t\tInstance problem = new VRPInstance(fileName);\n\t\t\tSystem.out.println(problem.comment);\n\t\t\t//solve problem\n\t\n\t\t\t//Solver solver = new SimpleGreedySolver(problem);\n\t\t\t//Solver solver = new NearestNeighborGreedySolver(problem);\n\t\t\tSolver solver = new ClarkeWrightGreedySolver(problem);\n\t\t\t//Solver solver = new EHSBASolver(problem);\n\t\t\tsolver.solve();\n\t\t\tsolver.printResult();\t\n\n\t\t}*/\n\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tint[] number = new int[] {1, 1, 1, 1, 1};\n\t\tint target = 3;\n\t\t\n\t\tSolution s = new Solution();\n\t\tint result = s.solution(number, target);\n\t\tSystem.out.println(result);\n\t}",
"public static void main(String[] args) {\n System.out.println(solution(new int[]{3,1,2,4,3}));\n }",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile (scanner.hasNextLine()) {\n\t\t\tString input = scanner.nextLine();\n\t\t\tSystem.out.println(solve(input));\n\t\t\t\n\t\t}\n\t\t\n\t}",
"private Solution() {\n\n }",
"public static void main(String[] args) {\n\t\tint nums[] = {0, 1, 0, 3, 12};\r\n\t\tsolution(nums);\r\n\t\tfor(int a:nums)\r\n\t\t\tSystem.out.println(a);\r\n\t}",
"public static void main(String args[]) {\n\t List<int[][]> result = solveKT();\n\t for(int [][] sol: result){\n\t\t printSolution(sol);\n\t\t System.out.println();\n\t }\n }",
"public static void main(String[] args) {\n\r\n\t\tSystem.out.println(solution(\"ACACACA\"));\r\n\t}",
"private Solution() {\n }",
"public static void main(String[] args) {\n\t\tint[] A = { 1, 3, 2, 5, 4, 6, 5, 7 };\r\n\t\tint X = 5;\r\n\t\tSystem.out.println(solution(X, A));\r\n\t}",
"public static void main(String[] args) {\n\t\tint A[] = new int[5];\n\t\tA[0]=3;\n\t\tA[1]=1;\n\t\tA[2]=2;\n\t\tA[3]=4;\n\t\tA[4]=3;\n\t\tSolution s = new Solution();\n\t\tSystem.out.println(s.solution(A));\n\t}",
"public static void main(String[] args) throws IOException {\n\t\t\t\r\n\t\t\tint [] numReps= {3,1,2,2,2};\r\n\t\t\tMathModelClass.solveMe(85, 5, 2,numReps, 1);\r\n\t\r\n\t\t}",
"public static void main(String[] args) throws IOException {\n\n String path = \"D:\\\\GitHub\\\\Competetions\\\\CodeJam\\\\Code\\\\src\\\\B12016\\\\\";\n String input = \"bsmall.in\", output = \"bsmall.out\";\n FileInputStream fip = new FileInputStream(path + input);\n FileOutputStream fop = new FileOutputStream(path + output);\n in = fip;\n out = new PrintWriter(fop);\n B a = new B();\n a.solve();\n out.close();\n }",
"public static void main(String []args) throws IOException {\n\tFastScanner in = new FastScanner(System.in);\n\tPrintWriter out = \n\t\tnew PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); \n\tsolve(in, out);\n\tin.close();\n\tout.close();\n }",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"public static void main(String[] args) {\n\n // create initial board from file\n In in = new In(args[0]);\n int N = in.readInt();\n int[][] tiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // check if puzzle is solvable; if so, solve it and output solution\n if (initial.isSolvable()) {\n Solver solver = new Solver(initial);\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n\n // if not, report unsolvable\n else {\n StdOut.println(\"Unsolvable puzzle\");\n }\n}",
"public static void main(String[] args) {\n String str = \"The one-hour drama series Westworld is a dark odyssey about the dawn of artificial consciousness and the evolution of sin. Set at the intersection of the near future and the reimagined past, it explores a world in which every human appetite, no matter how noble or depraved, can be indulged.\";\n\n System.out.println(solution1(str));\n }",
"public static void main(String[] args) {\n\t\tint[] arr= {6,9,5,7,4};\r\n\t\t//int[] arr= {3,9,9,3,5,7,2};\r\n\t\t//int[] arr= {1,5,3,6,7,6,5};\r\n\t\tint[] tmp=solution(arr);\r\n\t\tfor(int i=0;i<tmp.length;i++)\r\n\t\t\tSystem.out.print(tmp[i]+\" \");\r\n\t}",
"public static void main(String[] args) {\n\t\tTreeNode node1 = new TreeNode(1);\r\n\t\tTreeNode node2 = new TreeNode(2);\r\n\t\tTreeNode node3 = new TreeNode(3);\r\n\t\tTreeNode node4 = new TreeNode(4);\r\n\t\tTreeNode node5 = new TreeNode(5);\r\n\t\tTreeNode node6 = new TreeNode(6);\r\n\t\tnode1.left=node2;\r\n\t\tnode1.right=node3;\r\n\t\tnode2.left=node4;\r\n\t\tnode3.left=node5;\r\n\t\tnode3.right=node6;\r\n\t\tSolution s=new Solution();\r\n\t\tString res=s.Serialize(node1);\r\n\t\tSystem.out.println(res);\r\n\t\t\r\n\r\n \r\n\t}",
"public static void main(String[] args) {\n\n\t\tint ar[] = { 7, 5, 4 };\n\n\t\tSystem.out.println(solution(ar));\n\n\t}",
"public static void main(String[] args) {\n\t\tString filename = \"src/y20161B/B-small-practice\";\n\t\t//String filename = \"src/y20161B/B-large-practice\";\n\n\t\tFileInputStream file;\n\t\tint T;\n\n\t\ttry {\n\t\t\tfile = new FileInputStream(filename+\".in\");\n\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(file));\n\n\t\t\tT = Integer.parseInt(in.readLine());\n\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filename+\".out\"));\n\n\t\t\tfor (int i=0; i<T; i++) {\n\t\t\t\tint ind = i+1;\n\t\t\t\t// parser\n\t\t\t\tString buff[] = in.readLine().split(\" \");\n\t\t\t\tString C = buff[0];\n\t\t\t\tString J = buff[1];\n\t\t\t\t\n\t\t\t\t// calcul\n\t\t\t\tString res = solve(C, J);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Result \"+i+\": \"+res);\n\t\t\t\tbw.write(\"Case #\"+ind+\": \"+res+\"\\n\");\n\t\t\t}\n\t\t\tbw.close();\n\n\t\t\tin.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tTwoSumIII_DataStructureDesign result = new TwoSumIII_DataStructureDesign();\n\t\tresult.add(1);\n\t\tresult.add(3);\n\t\tresult.add(5);\n\t\tSystem.out.println(result.find(4));\n\t\tSystem.out.println(result.find(7));\n\t}",
"public static void main(String[] args) {\n\t\tint[] arr = {5,5,3,3,3,2,5};\n\t\tint[] result = solution(arr);\n\t\tfor(int n : result) {\n\t\t\tSystem.out.print(n + \" \");\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tin = new Scanner(new File(\"square.in\"));\n\t\tout = new PrintWriter(new File(\"square.out\"));\n\t\t\n\t\tinit();\n\t\tsolve();\n\t\t\n\t\tin.close();\n\t\tout.close();\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tString task = \"palsquare\"; //XXX change this\n\t\tString path = !TESTING ? task + \".in\"\n\t\t\t\t: System.getProperty(\"user.dir\") + File.separator + \"src\" + File.separator + \"test.in\";\n\t\tInputReader in = new InputReader(new FileInputStream(path));\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(task + \".out\")));\n\t\tsolve(in, out);\n\t\tout.close();\n\t}",
"public static void main(String[] args) {\n\t\tint [] a= {4,3,2,1};\r\n\t\tfor(int i:solution(a)) System.out.println(i);\r\n\t}",
"public static void main(String[] args) {\n\t\tSolution sol = new Solution();\n\t\tsol.test();\n\t}",
"public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\t//char[][] test = {{'O','O','O'},{'O','X','O'},{'O','O','O'}};\n\t\tchar[][] test = {{'X','O','X','X'},{'O','X','O','X'},{'X','O','X','O'},{'O','X','O','X'},{'X','O','X','O'}};\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\ts.solve(test);\n\t\tfor(int i = 0;i < test.length;i++){\n\t\t\tfor(int j = 0;j < test[0].length;j++){\n\t\t\t\tSystem.out.print(test[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void main(String[] args) {\n String name = \"ABAAABB\";\n\n System.out.println(solution(name));\n }",
"public static void main(String[] args) throws Exception {\n\t\tString folderURL = \"C:\\\\Users\\\\Administrator\\\\Google ÔÆ¶ËÓ²ÅÌ\\\\Slides\\\\CS686\\\\A2\\\\SodukoProblem\\\\problems\\\\\";\n\t\tList<String> nameList = Loader.getAllSdURLFromFolder(folderURL);\n\t\tList<Solution> record = new ArrayList<Solution>();\n\t\tfor (String name:nameList)\n\t\t{\n\t\t\t//System.out.println(name);\n\t\t\tBoard board = Loader.loadInitialBoard(name);\n\t\t\tSudokuSolver solver = SudokuSolver.getInstance();\n\t\t\tSolution solution = solver.solve(board);\n\t\t\trecord.add(solution);\n\t\t\tSystem.out.print(solution.initNum+\" \");\n\t\t\tSystem.out.print(solution.cntState+\" \");\n\t\t\t//System.out.println(solution.board);\n\t\t\tSystem.out.println(solution.isFinished?\"Finished\":\"Failed\");\n\t\t\tif (solution.cntState>0)\n\t\t\t{\n\t\t\t\tSystem.out.println(board);\n\t\t\t\tSystem.out.println(solution.board);\n\t\t\t}\n\t\t\t//if (!solution.isFinished) break;\n\t\t}\n\t\t//printStatistics(record);\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\tint[] A = {1};\r\n\t\t\tSystem.out.println(solution(A, 6));\r\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"input/vol2/Problem127.in\"));\n\t\tString line = \"\";\n\t\t\n\t\twhile(true) {\n\t\t\tLinkedList<String> strings = new LinkedList<String>();\n\t\t\tLinkedList<Card> deck = new LinkedList<Card>();\n\t\t\tline = br.readLine().trim();\n\t\t\tif(line.equals(\"#\"))\n\t\t\t\tbreak;\n\t\t\tCollections.addAll(strings, line.split(\" \"));\n\t\t\tline = br.readLine().trim();\n\t\t\tCollections.addAll(strings, line.split(\" \"));\n\t\t\tfor(String str : strings) {\n\t\t\t\tdeck.add(new Card(str));\n\t\t\t}\n\t\t\tTableau solution = new Tableau();\n\t\t\tfor(Card c : deck) {\n\t\t\t\t//System.out.print(\"Adding: \" + c + \" \");\n\t\t\t\tsolution.add(c);\n\t\t\t\t//System.out.println(solution);\n\t\t\t\t//solution.debug();\n\t\t\t}\n\t\t\tSystem.out.println(solution);\n\t\t}\n\t\t//System.out.println(\"Runtime: \" + (System.currentTimeMillis() - startTime) + \"ms\");\n\t}",
"public static void main(String[] args) {\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] blocks = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n blocks[i][j] = in.readInt();\n\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }",
"public static void main(String[] args) {\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] blocks = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n blocks[i][j] = in.readInt();\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }",
"public static void main(String[] args) {\n\t\tint A[]={1,3,1,4,2,3,5,4};\n\t\tint result=solution(5,A);\n\t\tSystem.out.println(result);\n\t}",
"private Solution() {\n //constructor\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tArrayList<Integer> arr = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr.add(sc.nextInt());\n\t\t}\n\t\tint k = sc.nextInt();\n\t\tSolution sol = new Solution();\n\t\tSystem.out.println(sol.solve(arr, k));\n\t\tsc.close();\n\t}",
"@Override\n\tpublic Solution getSolution() {\t\n\t\treturn solution;\n\t}",
"public<P extends Problem, S extends Solution> S solve(P problem, Class<P> problemClass, Class<S> solutionClass);",
"@Override\r\n\tpublic void solve() {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tScanner sc = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsc = new Scanner( new File(\"C:\\\\Users\\\\SRT\\\\algorithms\\\\robot\\\\src\\\\frodo\\\\input2.txt\") );\r\n\t\t} catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tint test_case = sc.nextInt();\r\n\t\t\r\n\t\tint N=0;\r\n\r\n\t\tfor (int tc = 1; tc <= test_case; tc++){\r\n\t\t\t//if(tc ==1 ) {\r\n\t\t\tN = sc.nextInt();\r\n\t\t\tint grid [][] = new int [N][2];\r\n\r\n\t\t\tfor(int row = 0 ; row < grid.length ; row++) {\r\n\t\t\t\tSystem.out.println(\" \");\r\n\t\t\t\tfor(int col=0; col< grid[0].length; col++) {\r\n\t\t\t\t\tgrid[row][col] = sc.nextInt();\r\n\t\t\t\t\tSystem.out.print(\" \"+ grid[row][col]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\t\t\t\t\t\t\t\r\n\t\t\tSystem.out.println(\"#\"+tc+\":\"+getAnswer(N,grid));\r\n\t\t\t//}\t\r\n\t\t}\r\n\t\t\r\n\t}",
"void solve() throws IOException {\n\t\tint n = ni();\n\t\tint[] v = new int[n];\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tv[i] = ni();\n\t\tsolve(v);\n\t\tout.println(result.size());\n\t\tfor (int a : result)\n\t\t\tout.print(a + \" \");\n\t}",
"@Test\n public void testSolution() {\n assertSolution(\"425\", \"input-day01-2018.txt\");\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(solution(people, limit));\n\t}",
"public void displaySolution() {\r\n Problem pb = new Problem(sources, destinations, costMatrix);\r\n pb.printProblem();\r\n Solution sol = new Solution(pb);\r\n sol.computeCost();\r\n }",
"public static void main(String[] args) {\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] tiles = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // Solve the puzzle\n Solver solver = new Solver(initial);\n\n // Print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\" No solution possible \");\n else {\n StdOut.println(\" Minimum number of moves = \" + solver.moves());\n for (Board solutionboard : solver.solution())\n StdOut.println(solutionboard);\n }\n\n }",
"public static void main(String[] args){\n Solution solution = new Solution();\n System.out.println(solution.convertToTitle(27));\n }",
"public void showDisplaySolution(Solution<Position> solution);",
"public static void main(String[] args) {\n\t// write your code here\n int[][] input = new int[3][3];\n input[1][1] = 1;\n\n Solution sol = new Solution();\n sol.printMatrix(input);\n int[][] output = sol.updateMatrix(input);\n sol.printMatrix(output);\n\n }",
"public static void main(String args[]) {\n\t\tint cost[][] = { { 10, 1, 10, 1 }, { 1, 1, 1, 10 }, { 10, 1, 10, 1 }, { 1, 10, 1, 1 } };\n\n\t\tSystem.out.println(solution(cost));\n\t}",
"@Test\n public void testSolution() throws Exception {\n assertEquals(4, new Task5().solution(4, new int[]{1, 2, 3}));\n // 1. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n // 2. 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n // 3. 2, 2, 1, 1, 1, 1, 1, 1, 1, 1\n // 4. 2, 2, 2, 1, 1, 1, 1, 1, 1\n // 5. 2, 2, 2, 2, 1, 1, 1, 1\n // 6. 2, 2, 2, 2, 2, 1, 1\n // 7. 2, 2, 2, 2, 2, 2\n // 8. 5, 1, 1, 1, 1, 1, 1, 1\n // 9. 5, 2, 1, 1, 1, 1, 1\n // 10. 5, 2, 2, 1, 1, 1\n // 11. 5, 2, 2, 2, 1\n // 12. 5, 5, 1, 1\n // 13. 5, 5, 2\n assertEquals(13, new Task5().solution(12, new int[]{1, 2, 5}));\n // 1. 2, 2, 2, 2, 2, 2\n // 2. 5, 5, 2\n assertEquals(2, new Task5().solution(12, new int[]{2, 5}));\n }",
"public static void main(String[] args) {\n int[] grades = {73,67,38,33};\n// for(int grades_i=0; grades_i < n; grades_i++){\n// grades[grades_i] = in.nextInt();\n// }\n int[] result = solve(grades);\n for (int i = 0; i < result.length; i++) {\n System.out.print(result[i] + (i != result.length - 1 ? \"\\n\" : \"\"));\n }\n System.out.println(\"\");\n \n\n }",
"public static void main(String[] args) // solve a slider puzzle (given below)\n {\n In in = new In(args[0]);\n int N = in.readInt();\n int[][] blocks = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n blocks[i][j] = in.readInt();\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n \n \t\n }\n}",
"public static void main(String[] args) {\n Homework1 hw1 = new Homework1();\n\n System.out.println(\"===Problem 1===\");\n hw1.problem1();\n\n System.out.println(\"===Problem 2===\");\n System.out.println(hw1.topInt(1.5));\n System.out.println(hw1.topInt(5.1));\n System.out.println(hw1.topInt(1.0));\n System.out.println(hw1.topInt(-4.2));\n\n\n System.out.println(\"===Problem 3===\");\n hw1.draw4x4('-');\n hw1.draw4x4('4');\n\n System.out.println(\"===Problem 4===\");\n System.out.println(hw1.citationName(\"Alastair\", \"Reynolds\"));\n System.out.println(hw1.citationName(\"Grace\", \"Hopper\"));\n\n System.out.println(\"===Problem 5===\");\n System.out.println(String.valueOf(hw1.min3(1.0, 2.0, 3.0)));\n System.out.println(String.valueOf(hw1.min3(4.0, 3.0, 2.0)));\n System.out.println(String.valueOf(hw1.min3(0.5, 0.1, 0.5)));\n \n System.out.println(\"===Problem 6===\");\n System.out.println(hw1.fibonacci(0));\n System.out.println(hw1.fibonacci(1));\n System.out.println(hw1.fibonacci(2));\n System.out.println(hw1.fibonacci(3));\n System.out.println(hw1.fibonacci(10));\n System.out.println(hw1.fibonacci(25));\n \n \n System.out.println(\"===Problem 7===\");\n //System.out.println(hw1.isPalindrome(\"racecar\"));\n //System.out.println(hw1.isPalindrome(\"cat\"));\n //System.out.println(hw1.isPalindrome(\"hannah\"));\n //System.out.println(hw1.isPalindrome(\"saippuakivikauppias\"));\n }",
"public static void main(String[] args) {\n\n\t\tsolution();\n\n\t\t// int maxDivisor = Divided.getMaxDivisor(1, 3);\n\t\t// System.out.println(\"maxDivisor:\" + maxDivisor);\n\n\t}",
"public static void main(String[] args) throws FileNotFoundException, IOException{\n InputStream inputStream = new FileInputStream(new File(\"./src/B-large.in\"));\n OutputStream outputStream = new FileOutputStream(new File(\"./src/B-large.out\"));\n InputReaderRevengePancakes in = new InputReaderRevengePancakes(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskRevengePancakes solver = new TaskRevengePancakes();\n solver.solve(1, in, out);\n out.close();\n }",
"public static void main(String[] args) {\n\t\tint[] stones = {2, 4, 5, 3, 2, 1, 4, 2, 5, 1};\n\t\tint k = 3;\n\t\tSystem.out.println(solution(stones, k));\n\t}",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(fileName))) {\r\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(outFileName));\r\n\t\t\tString line;\r\n\r\n\t\t\tline = br.readLine();\r\n\t\t\tint testCases = Integer.parseInt(line);\r\n\t\t\tint caseCounter = 1;\r\n\t\t\t\r\n\t\t\t// ---------\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tString[] tmp = line.split(\" \");\r\n\t\t\t\tint buildings = Integer.parseInt(tmp[0]);\r\n\t\t\t\tint ways = Integer.parseInt(tmp[1]);\r\n\t\t\t\tint maxWays = 0;\r\n\t\t\t\tfor(int i = buildings - 2; i > 0; i--) maxWays += i;\r\n\t\t\t\tmaxWays++;\r\n\t\t\t\tif(ways > maxWays){\r\n\t\t\t\t\tSystem.out.println(\"Case #\" + caseCounter + \": IMPOSSIBLE\");\r\n\t\t\t\t\tbw.write(\"Case #\" + caseCounter + \": IMPOSSIBLE\\n\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tString result = solve(buildings, ways);\r\n\t\t\t\t\tSystem.out.println(\"Case #\" + caseCounter + \": \" + result);\r\n\t\t\t\t\tbw.write(\"Case #\" + caseCounter + \": \" + result + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t\t//int input = Integer.parseInt(line);\r\n\t\t\t\t\r\n\t\t\t\tcaseCounter++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// ---------\r\n\t\t\t\r\n\t\t\tbw.close();\r\n\t\t}\r\n\t}"
] | [
"0.76882386",
"0.73668814",
"0.7142821",
"0.70783526",
"0.7006539",
"0.70020896",
"0.69825906",
"0.69812477",
"0.6967007",
"0.69522285",
"0.6945805",
"0.693986",
"0.6850797",
"0.67872095",
"0.6781298",
"0.67670065",
"0.6760525",
"0.67463255",
"0.6735596",
"0.6735596",
"0.6731542",
"0.6716675",
"0.6696097",
"0.66922665",
"0.6679879",
"0.6674942",
"0.665566",
"0.665527",
"0.6642104",
"0.66375786",
"0.6627805",
"0.66061723",
"0.660079",
"0.65861356",
"0.65745175",
"0.653459",
"0.6522322",
"0.6515782",
"0.649353",
"0.64866364",
"0.647805",
"0.6470663",
"0.64616805",
"0.64499253",
"0.6446021",
"0.643903",
"0.64362663",
"0.6425408",
"0.6418075",
"0.6417885",
"0.6417506",
"0.6417489",
"0.6415068",
"0.64108175",
"0.6409856",
"0.6408194",
"0.63998806",
"0.6399709",
"0.6396147",
"0.63956624",
"0.6377078",
"0.6372403",
"0.6370158",
"0.6369848",
"0.63680303",
"0.6366745",
"0.63590544",
"0.6357846",
"0.63531077",
"0.6348297",
"0.63384676",
"0.6335682",
"0.63166565",
"0.6314367",
"0.6298217",
"0.62918216",
"0.629123",
"0.6288251",
"0.62815374",
"0.6276656",
"0.6275042",
"0.6268559",
"0.62670827",
"0.62650704",
"0.6264571",
"0.6257498",
"0.62551737",
"0.6252354",
"0.6246924",
"0.6245932",
"0.6235187",
"0.62341225",
"0.62300503",
"0.6215478",
"0.62058437",
"0.6205428",
"0.62040144",
"0.6193825",
"0.61936903",
"0.61885536",
"0.618467"
] | 0.0 | -1 |
Factory interface implemented by child classes System_Admin and Shopper | public interface Iuser extends Remote{
public String getUsername();
public String getPassword();
public void setPassword(String string);
public void setUsername(String string);
public void getItem(IItem item);
public void purchaseItems();
public int getItemCounter();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract ProductFactory getFactory();",
"public abstract Product productFactory(String type);",
"public interface AbstractFactory {\n /**\n * Create cpu cpu.\n *\n * @return the cpu\n */\n Cpu createCpu();\n\n /**\n * Create main board main board.\n *\n * @return the main board\n */\n MainBoard createMainBoard();\n}",
"AbstractAdminSystemPageModContentFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface Factory {\n Product create();\n}",
"public interface IFactory {\n\t/**\n\t * créer un service transactionel (un proxy de service) gérant les Users\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract IUserService createUserService(ITransactional caller);\n\n\t/**\n\t * créer un dao transactionel dédié à la table utilisateur (un proxy de dao)\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract IUtilisateurDAO createUserDAO(ITransactional caller);\n\n\t/**\n\t * créer un dao transactionel dédié à la table cursus (un proxy de dao)\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract ICursusDAO createCursusDAO(ITransactional caller);\n\n\t/**\n\t * créer un dao transactionel dédié à la table competence (un proxy de dao)\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract ICompetenceDAO createCompetenceDAO(ITransactional caller);\n\n\tpublic abstract INiveauxDAO createNiveauDAO(ITransactional caller);\n\n\tpublic abstract IProfilDAO createProfilDAO(ITransactional caller);\n\n\tpublic abstract IGroupeDAO createGroupeDAO(ITransactional caller);\n\n\tpublic abstract IFenetreDAO createFenetreDAO(ITransactional caller);\n\n\tpublic abstract IFonctionDAO createFonctionDAO(ITransactional caller);\n\n\tpublic abstract INatureDAO createNatureDAO(ITransactional caller);\n\n\tpublic abstract IDroitDAO createDroitDAO(ITransactional caller);\n\n\tpublic abstract ISecurityService createSecurityService(ITransactional caller);\n\n\tpublic abstract IProjectService createProjectService(ITransactional caller);\n\n\tpublic abstract IKeywordDAO createKeywordDAO(ITransactional caller);\n\n\tpublic abstract IStatutDAO createStatutDAO(ITransactional caller);\n\n\tpublic abstract IAdresseDAO createAdresseDAO(ITransactional caller);\n\t\n}",
"public interface ProductFactory {\n Product createProduct();\n}",
"public interface Factory {\r\n}",
"@Override\r\n\tpublic Product factory() {\n\t\treturn new ConcreteProduct2();\r\n\t}",
"public interface IFactory {\n IUser createUser();\n IDepartment createDepartment();\n}",
"public interface IFactory {\n\n public IUser createUser();\n\n public IDepartment addDepartment();\n}",
"public BuiltinFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface IFactory {\n IProductA getProductA();\n IProductB getProductB();\n}",
"public interface DaoFactory {\n\n // ===== Getters =====\n\n /**\n * Give the Author Data Access Object.\n *\n * @return the Author Data Access Object.\n */\n AuthorDao getAuthorDao();\n\n /**\n * Give the Book Data Access Object.\n *\n * @return the Book Data Access Object.\n */\n BookDao getBookDao();\n\n /**\n * Give the BookBorrowed Data Access Object.\n *\n * @return the BookBorrowed Data Access Object.\n */\n BookBorrowedDao getBookBorrowedDao();\n\n /**\n * Give the bookReservation Data Access Object.\n *\n * @return the bookReservation Data Access Object.\n */\n BookReservationDao getBookReservationDao();\n\n /**\n * Give the Genre Data Access Object.\n *\n * @return the Genre Data Access Object.\n */\n GenreDao getGenreDao();\n\n /**\n * Give the Publisher Data Access Object.\n *\n * @return the Publisher Data Access Object.\n */\n PublisherDao getPublisherDao();\n\n /**\n * Give the Stock Data Access Object.\n *\n * @return the Stock Data Access Object.\n */\n StockDao getStockDao();\n\n /**\n * Give the Address Data Access Object.\n *\n * @return the Address Data Access Object.\n */\n AddressDao getAddressDao();\n\n /**\n * Give the Role Data Access Object.\n *\n * @return the Role Data Access Object.\n */\n RoleDao getRoleDao();\n\n /**\n * Give the User Data Access Object.\n *\n * @return the User Data Access Object.\n */\n UserDao getUserDao();\n\n /**\n * Give the UserOptions Data Access Object.\n *\n * @return the UserOptions Data Access Object.\n */\n UserOptionsDao getUserOptionsDao();\n\n // ===== Setters =====\n\n /**\n * Set the Author Data Access Object.\n *\n * @param authorDao the Author Data Access Object.\n */\n void setAuthorDao(final AuthorDao authorDao);\n\n /**\n * Set the Book Data Access Object.\n *\n * @param bookDao the Book Data Access Object.\n */\n void setBookDao(final BookDao bookDao);\n\n /**\n * Set the BookBorrowed Data Access Object.\n *\n * @param bookBorrowedDao the BookBorrowed Data Access Object.\n */\n void setBookBorrowedDao(final BookBorrowedDao bookBorrowedDao);\n\n /**\n * Set the BookReservation Data Access Object.\n *\n * @param bookReservationDao the BookReservation Data Access Object.\n */\n void setBookReservationDao(final BookReservationDao bookReservationDao);\n\n /**\n * Set the Genre Data Access Object.\n *\n * @param genreDao the Genre Data Access Object.\n */\n void setGenreDao(final GenreDao genreDao);\n\n /**\n * Set the Publisher Data Access Object.\n *\n * @param publisherDao the Publisher Data Access Object.\n */\n void setPublisherDao(final PublisherDao publisherDao);\n\n /**\n * Set the Stock Data Access Object.\n *\n * @param stockDao the Stock Data Access Object.\n */\n void setStockDao(final StockDao stockDao);\n\n /**\n * Set the Address Data Access Object.\n *\n * @param addressDao the Address Data Access Object.\n */\n void setAddressDao(final AddressDao addressDao);\n\n /**\n * Set the Role Data Access Object.\n *\n * @param roleDao the Role Data Access Object.\n */\n void setRoleDao(final RoleDao roleDao);\n\n /**\n * Set the User Data Access Object.\n *\n * @param userDao the User Data Access Object.\n */\n void setUserDao(final UserDao userDao);\n\n /**\n * Set the User Data Access Object.\n *\n * @param userOptionsDao\n */\n void setUserOptionsDao(final UserOptionsDao userOptionsDao);\n}",
"public CustomDirectoryFactory(){\n\t\tsuper();\n\t}",
"public interface IOrderFactory{\n\t\n\t/**\n\t * Creates a collection of taxes for US and EU customers\n\t * \n\t * @return the sales tax\n\t */\n\tpublic ISalesTax getTaxObject();\n\t\n\t/**\n\t * Creates the shipping cost for US and EU customers\n\t * \n\t * @return shipping cost\n\t */\n\tpublic IShippingRate getRateObject();\n}",
"public Factory() {\n\t\tsuper();\n\t}",
"IMenuFactory getMenuFactory();",
"public interface IFactory {\n ICustomer getCustomer(CustomerType type);\n IAccount getAccount(Enum type);\n// IEntry getEntry(EntryType type);\n DAO getDAO(Enum type);\n\n}",
"protected ContaCapitalCadastroDaoFactory() {\n\t\t\n\t}",
"private ConcreteFactory() {}",
"SubTitle.Factory getSubTitleFactory();",
"Demo1Factory getDemo1Factory();",
"public PiviFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"@Override\n\tprotected Employee factoryMethod() {\n\t\treturn new Developer();\n\t}",
"public interface DAOFactory {\n public CategoryDAO getCategoryDAO();\n\n public CityDAO getCityDAO();\n\n public DivisionDAO getDivisionDAO();\n\n public InstitutionDAO getInstitutionDAO();\n\n public SchoolDAO getSchoolDAO();\n\n public StudentDAO getStudentDAO();\n\n public TeacherDAO getTeacherDAO();\n}",
"public OBStoreFactory getFactory();",
"public abstract ServiceLocator create(String name,\n ServiceLocator parent,\n ServiceLocatorGenerator generator);",
"public Smart_officeFactoryImpl() {\n\t\tsuper();\n\t}",
"public PedidoFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface AbstractFactory {\n Bmw produceBmw();\n Benz produceBenz();\n}",
"public interface Factory {\n LeiFeng createLeiFeng();\n}",
"public ProyectoFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"public Testing2FactoryImpl() {\n\t\tsuper();\n\t}",
"public interface UnitFactory {\n Gui_Unit createUnit(String name, int team);\n Gui_Unit copy(Gui_Unit guiUnit);\n\n static UnitFactory getUnitFactory(UnitClassNames name){\n UnitFactory factory = null;\n\n switch (name){\n case ARTILLERY:{\n factory = new ArtilleryFactory();\n break;\n }\n case VEHICLE:{\n factory = new VehicleFactory();\n break;\n }\n case LIGHT_INFANTRY:{\n factory = new LightInfantryFactory();\n break;\n }\n case MELEE_INFANTRY:{\n factory = new MeleeInfantryFactory();\n break;\n }\n case HEAVY_INFANTRY:{\n factory = new HeavyInfantryFactory();\n break;\n }\n }\n return factory ;\n }\n}",
"public interface RegisterAdminService {\n\n\tHashMap<String, Item> INVENTORY = new HashMap<String, Item>();\n\tHashMap<String, Special> SPECIALS = new HashMap<String, Special>();\n\tHashMap<String, Markdown> MARKDOWNS = new HashMap<String, Markdown>();\n\n\t/**\n\t * Creates a new {@link Item} using the item name, item price, and if <code>true</code>\n\t * setting item as charge by weight.\n\t * \n\t * @param itemName\t\t\tname of the item being created.\n\t * @param itemPrice\t\t\tdefault price of the item.\n\t * @param isChargeByWeight\t<code>true</code> if the item will need to be scaled\n\t * \t\t\t\t\t\t\twhen completing the {@link CartItem} creation.\n\t */\n\tvoid createItem(String itemName, String itemPrice, boolean isChargeByWeight);\n\n\t/**\n\t * Gets item from <code>INVENTORY</code>. Used whenever we need to verify that an item\n\t * exists in inventory. Returns the item by using the <code>itemName</code> as the key\n\t * in the map.\n\t * \n\t * @param itemName\t\t\tname of the item to search for.\n\t * @return\t\t\t\t\t{@link Item}\n\t */\n\tItem getItem(String itemName);\n\n\t/**\n\t * Creates a new {@link Special} of type {@link BuyNForX} using the special name, minimum\n\t * quantity of items required to buy, and the price amount for the group.\n\t * \n\t * @param specialName\t\tidentifying name of the special.\n\t * @param buyQtyRequirement\tminimum quantity of items needed in cart\n\t * \t\t\t\t\t\t\tbefore Special applies. \n\t * @param discountPrice \tprice to return for group of items purchased.\n\t */\n\tvoid createSpecialBuyNForX(String specialName, int buyQtyRequirement, String discountPrice);\n\n\t/**\n\t * Creates a new {@link Special} of type {@link BuyNGetMatXPercentOff} using the special name, minimum\n\t * quantity of items required to buy, number of items to receive at discounted percentage \n\t * and the discount percentage.\n\t * \n\t * @param specialName\t\tidentifying name of the special.\n\t * @param buyQtyRequirement\tminimum quantity of items needed in cart\n\t * \t\t\t\t\t\t\tbefore Special applies. \n\t * @param receiveQtyItems\tnumber of items to receive at discounted rate.\n\t * @param percentOff\t\tdiscount percentage entered as a whole number.\n\t * \t\t\t\t\t\t\t<strong>Example:</strong> 50% is entered as\n\t * \t\t\t\t\t\t\t50 or 50.0.\n\t */\n\tvoid createSpecialBuyNGetMAtXPercentOff(String specialName, int buyQtyRequirement, \n\t\t\tint receiveQtyItems, double percentOff); \n\t\n\t/**\n\t * Gets special from <code>SPECIALS</code> using name of the special \n\t * as a key for the object map.\n\t * \n\t * @param specialName\t\tname of the special to search for.\n\t * @return\t\t\t\t\t{@link Special}\n\t * @see \t\t\t\t\tSpecial\n\t * @see\t\t\t\t\t\tBuyNGetMatXPercentOff\n\t * @see\t\t\t\t\t\tBuyNForX\n\t */\n\tSpecial getSpecial(String specialName);\n\n\t/**\n\t * Creates a new {@link Markdown} using a mark down description and price.\n\t * \n\t * @param description\t\tdescription of the markdown for reference.\n\t * @param markdownAmount\trepresents the amount to subtract from the default price.\n\t */\n\tvoid createMarkdown(String description, String markdownAmount);\n\n\t/**\n\t * Gets mark-down from <code>MARKDOWNS</code> using the name of the mark-down\n\t * as a key for the object map.\n\t * \n\t * @param markdownDescription\tname of the mark-down to search for.\n\t * @return\t\t\t\t\t\t{@link Markdown}\n\t * @see \t\t\t\t\t\tMarkdown\n\t */\n\tMarkdown getMarkdown(String markdownDescription);\n\n\t/**\n\t * Gets the inventory collection for referencing items within \n\t * the collection.\n\t * \n\t * @return\t\t\t\t\t\tCollection of Items within <code>INVENTORY</code>.\n\t */\n\tCollection<Item> getInventory();\n\n\t/**\n\t * Gets the collection of Specials for referencing the specials stored.\n\t * \n\t * @return\t\t\t\t\tCollection of Specials which can be any type of \n\t * \t\t\t\t\t\t\t{@link Special} such as,{@link BuyNGetMatXPercentOff} \n\t * \t\t\t\t\t\t\tor {@link BuyNForX}.\n\t */\n\tCollection<? extends Special> getSpecials();\n\n\t/**\n\t * Gets the collection of Markdowns for referencing the markdowns available for\n\t * use.\n\t * \n\t * @return\t\t\t\tCollection of Markdowns.\n\t */\n\tCollection<Markdown> getMarkdowns();\n\n\t/**\n\t * Updates {@link Item}'s default price or adds {@link Markdown} or \n\t * assigns {@link Special}. <code>itemName</code> is required.\n\t * \n\t * @param itemName\t\t\t\tname of item to search for.\n\t * @param newDefaultPrice\t\tassignment of new default price.\n\t * @param markdownDescription\tname of mark-down to search for and apply.\n\t * @param specialName\t\t\tname of special to search for and apply.\n\t */\n\tvoid updateItem(String itemName, String newDefaultPrice, String markdownDescription\n\t\t\t, String specialName);\n\n\t/**\n\t * Adds a limit to {@limit Special} using the <code>specialName</code>\n\t * to search for the special and uses <code>limitQty</code> to assign\n\t * the limit quantity.\n\t * \n\t * @param specialName\t\t\tname of special to search for.\n\t * @param limitQty\t\t\t\tamount to set limit to\n\t */\n\tvoid addLimitToSpecial(String specialName, int limitQty);\n\n\n}",
"@Override\r\n\tprotected MenuManager createMenuManager() {\r\n\t\tMenuManager menuManager = new MenuManager(\"menu\");\r\n\t\treturn menuManager;\r\n\t}",
"public borFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface Creator {\n public abstract Item factoryMethod();\n public abstract Item factoryMethod(String name);\n public abstract Item factoryMethod(String name, List<Flower> flowerList);\n}",
"public CommandsFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"PlanningFactory getFactory();",
"EzlemurFactory getEzlemurFactory();",
"public interface RepositoryFactory extends EFactory {\n /**\n * The singleton instance of the factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n RepositoryFactory eINSTANCE = io.fixprotocol._2020.orchestra.repository.impl.RepositoryFactoryImpl.init();\n\n /**\n * Returns a new object of class '<em>Action Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Action Type</em>'.\n * @generated\n */\n ActionType createActionType();\n\n /**\n * Returns a new object of class '<em>Actors Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Actors Type</em>'.\n * @generated\n */\n ActorsType createActorsType();\n\n /**\n * Returns a new object of class '<em>Actor Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Actor Type</em>'.\n * @generated\n */\n ActorType createActorType();\n\n /**\n * Returns a new object of class '<em>Annotation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Annotation</em>'.\n * @generated\n */\n Annotation createAnnotation();\n\n /**\n * Returns a new object of class '<em>Appinfo</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Appinfo</em>'.\n * @generated\n */\n Appinfo createAppinfo();\n\n /**\n * Returns a new object of class '<em>Block Assignment Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Block Assignment Type</em>'.\n * @generated\n */\n BlockAssignmentType createBlockAssignmentType();\n\n /**\n * Returns a new object of class '<em>Categories Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Categories Type</em>'.\n * @generated\n */\n CategoriesType createCategoriesType();\n\n /**\n * Returns a new object of class '<em>Category Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Category Type</em>'.\n * @generated\n */\n CategoryType createCategoryType();\n\n /**\n * Returns a new object of class '<em>Code Sets Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Code Sets Type</em>'.\n * @generated\n */\n CodeSetsType createCodeSetsType();\n\n /**\n * Returns a new object of class '<em>Code Set Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Code Set Type</em>'.\n * @generated\n */\n CodeSetType createCodeSetType();\n\n /**\n * Returns a new object of class '<em>Code Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Code Type</em>'.\n * @generated\n */\n CodeType createCodeType();\n\n /**\n * Returns a new object of class '<em>Component Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Component Ref Type</em>'.\n * @generated\n */\n ComponentRefType createComponentRefType();\n\n /**\n * Returns a new object of class '<em>Component Rule Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Component Rule Type</em>'.\n * @generated\n */\n ComponentRuleType createComponentRuleType();\n\n /**\n * Returns a new object of class '<em>Components Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Components Type</em>'.\n * @generated\n */\n ComponentsType createComponentsType();\n\n /**\n * Returns a new object of class '<em>Component Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Component Type</em>'.\n * @generated\n */\n ComponentType createComponentType();\n\n /**\n * Returns a new object of class '<em>Concepts Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Concepts Type</em>'.\n * @generated\n */\n ConceptsType createConceptsType();\n\n /**\n * Returns a new object of class '<em>Concept Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Concept Type</em>'.\n * @generated\n */\n ConceptType createConceptType();\n\n /**\n * Returns a new object of class '<em>Datatypes Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Datatypes Type</em>'.\n * @generated\n */\n DatatypesType createDatatypesType();\n\n /**\n * Returns a new object of class '<em>Datatype Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Datatype Type</em>'.\n * @generated\n */\n DatatypeType createDatatypeType();\n\n /**\n * Returns a new object of class '<em>Documentation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Documentation</em>'.\n * @generated\n */\n Documentation createDocumentation();\n\n /**\n * Returns a new object of class '<em>Document Root</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Document Root</em>'.\n * @generated\n */\n DocumentRoot createDocumentRoot();\n\n /**\n * Returns a new object of class '<em>Extension Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Extension Type</em>'.\n * @generated\n */\n ExtensionType createExtensionType();\n\n /**\n * Returns a new object of class '<em>Field Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Ref Type</em>'.\n * @generated\n */\n FieldRefType createFieldRefType();\n\n /**\n * Returns a new object of class '<em>Field Rule Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Rule Type</em>'.\n * @generated\n */\n FieldRuleType createFieldRuleType();\n\n /**\n * Returns a new object of class '<em>Fields Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Fields Type</em>'.\n * @generated\n */\n FieldsType createFieldsType();\n\n /**\n * Returns a new object of class '<em>Field Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Type</em>'.\n * @generated\n */\n FieldType createFieldType();\n\n /**\n * Returns a new object of class '<em>Flow Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Flow Type</em>'.\n * @generated\n */\n FlowType createFlowType();\n\n /**\n * Returns a new object of class '<em>Group Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Group Ref Type</em>'.\n * @generated\n */\n GroupRefType createGroupRefType();\n\n /**\n * Returns a new object of class '<em>Groups Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Groups Type</em>'.\n * @generated\n */\n GroupsType createGroupsType();\n\n /**\n * Returns a new object of class '<em>Group Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Group Type</em>'.\n * @generated\n */\n GroupType createGroupType();\n\n /**\n * Returns a new object of class '<em>Identifiers Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Identifiers Type</em>'.\n * @generated\n */\n IdentifiersType createIdentifiersType();\n\n /**\n * Returns a new object of class '<em>Identifier Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Identifier Type</em>'.\n * @generated\n */\n IdentifierType createIdentifierType();\n\n /**\n * Returns a new object of class '<em>Mapped Datatype</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Mapped Datatype</em>'.\n * @generated\n */\n MappedDatatype createMappedDatatype();\n\n /**\n * Returns a new object of class '<em>Message Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Message Ref Type</em>'.\n * @generated\n */\n MessageRefType createMessageRefType();\n\n /**\n * Returns a new object of class '<em>Messages Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Messages Type</em>'.\n * @generated\n */\n MessagesType createMessagesType();\n\n /**\n * Returns a new object of class '<em>Message Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Message Type</em>'.\n * @generated\n */\n MessageType createMessageType();\n\n /**\n * Returns a new object of class '<em>Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type</em>'.\n * @generated\n */\n RepositoryType createRepositoryType();\n\n /**\n * Returns a new object of class '<em>Responses Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Responses Type</em>'.\n * @generated\n */\n ResponsesType createResponsesType();\n\n /**\n * Returns a new object of class '<em>Response Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Response Type</em>'.\n * @generated\n */\n ResponseType createResponseType();\n\n /**\n * Returns a new object of class '<em>Sections Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Sections Type</em>'.\n * @generated\n */\n SectionsType createSectionsType();\n\n /**\n * Returns a new object of class '<em>Section Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Section Type</em>'.\n * @generated\n */\n SectionType createSectionType();\n\n /**\n * Returns a new object of class '<em>State Machine Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>State Machine Type</em>'.\n * @generated\n */\n StateMachineType createStateMachineType();\n\n /**\n * Returns a new object of class '<em>State Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>State Type</em>'.\n * @generated\n */\n StateType createStateType();\n\n /**\n * Returns a new object of class '<em>Structure Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Structure Type</em>'.\n * @generated\n */\n StructureType createStructureType();\n\n /**\n * Returns a new object of class '<em>Timer Schedule</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Timer Schedule</em>'.\n * @generated\n */\n TimerSchedule createTimerSchedule();\n\n /**\n * Returns a new object of class '<em>Timer Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Timer Type</em>'.\n * @generated\n */\n TimerType createTimerType();\n\n /**\n * Returns a new object of class '<em>Transition Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Transition Type</em>'.\n * @generated\n */\n TransitionType createTransitionType();\n\n /**\n * Returns a new object of class '<em>Trigger Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Trigger Type</em>'.\n * @generated\n */\n TriggerType createTriggerType();\n\n /**\n * Returns a new object of class '<em>Unique Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Unique Type</em>'.\n * @generated\n */\n UniqueType createUniqueType();\n\n /**\n * Returns the package supported by this factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return the package supported by this factory.\n * @generated\n */\n RepositoryPackage getRepositoryPackage();\n\n}",
"UsageevolutionFactory getUsageevolutionFactory();",
"public LanterneFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface DrinksFactory {\n //饮料\n Drinks dBuild();\n\n //面包\n Bread bBuild();\n\n void buyWhat();\n}",
"public CommonsFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface Factory {\n Cup productCup();\n Cover productCover();\n}",
"public interface XxxFactory<T> {\n T createAaXxxProduct();\n T createBbXxxProduct();\n}",
"public interface CourseRegFactory\n{\n\n /**\n * Test the existence of an instance\n * @param name The name of the instance to test the existence of\n * @return \n */\n public boolean exists(String name) throws IOException;\n\n /**\n * Create a new instance\n * @param edma_name The name of the instance to create\n * @param schoolInfo The initial values for the singleton SchoolInfo\n * @return \n */\n public CourseRegInstance newInstance(String edma_name, SchoolInfo schoolInfo) throws IOException;\n\n /**\n * Get an instance from its name\n * @param name The name of the instance to get\n * @return \n */\n public CourseRegInstance getInstance(String name) throws IOException;\n\n /**\n * Delete an instance\n * @param name The name of the instance to delete\n * @return <tt>true</tt> if the instance was deleted\n */\n public boolean deleteInstance(String name) throws IOException;\n\n}",
"public VariabilityFactoryImpl() {\n\t\tsuper();\n\t}",
"public MySqlDaoFactory() {\n creators = new HashMap<>();\n creators.put(Bank.class, new DaoCreator<Connection>() {\n @Override\n public GenericDAO create(Connection connection) {\n return new MySqlBankDao(connection);\n }\n });\n\n creators.put(Deposit.class, new DaoCreator<Connection>() {\n @Override\n public GenericDAO create(Connection connection) {\n return new MySqlDepositDao(connection);\n }\n });\n\n }",
"public Tp2FactoryImpl() {\n\t\tsuper();\n\t}",
"public interface DAOFactory {\n\n /**\n *\n * @param context\n * @return\n */\n public abstract DAO createPersonBeaconDAO(Context context);\n}",
"ImplementationManager createManager();",
"Schueler createSchueler();",
"public static BuiltinFactory init() {\n\t\ttry {\n\t\t\tBuiltinFactory theBuiltinFactory = (BuiltinFactory)EPackage.Registry.INSTANCE.getEFactory(\"http://www.soluvas.com/schema/story.builtin/1.0\"); \n\t\t\tif (theBuiltinFactory != null) {\n\t\t\t\treturn theBuiltinFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new BuiltinFactoryImpl();\n\t}",
"protected AbstractRepositoryHandler(ConfigurationStoreFactory storeFactory) {\n this.store = storeFactory\n .withType(getConfigClass())\n .withName(getType().getName())\n .build();\n }",
"public ComponentsFactory() {\n\t\tsuper();\n\t}",
"public AbstractItemFactory(){\n this.setDefault();\n }",
"public interface ViewCreatorFactory extends Service {\n /**\n * Used to create Views in a space\n */\n interface ViewCreator {\n /**\n * Creates a view\n * @param path\n * @param sql\n * @param sqlContext\n */\n void createView(List<String> path, String sql, List<String> sqlContext, NamespaceAttribute... attributes);\n\n /**\n * Updates a view\n * @param path\n * @param sql\n * @param sqlContext\n * @param attributes\n */\n void updateView(List<String> path, String sql, List<String> sqlContext, NamespaceAttribute... attributes);\n\n /**\n * Drops a view\n * @param path\n */\n void dropView(List<String> path);\n }\n\n /**\n * get a ViewCreator for a particular user\n * @param userName\n * @return the ViewCreator\n */\n ViewCreator get(String userName);\n}",
"public Contexte() {\n FactoryRegistry registry = FactoryRegistry.getRegistry();\n registry.register(\"module\", new ModuleFactory());\n registry.register(\"if\", new ConditionFactory());\n registry.register(\"template\", new TemplateFactory());\n registry.register(\"dump\", new DumpFactory());\n }",
"private EntityFactory() {}",
"private HierarchyFactory ()\n {\n }",
"public interface EnemyShipPartsFactory {\n ESWeapon addESGun();\n ESEngine addESEngine();\n}",
"public abstract ServiceLocator create(String name,\n ServiceLocator parent);",
"private VegetableFactory() {\n }",
"public EsoFactoryImpl()\r\n {\r\n super();\r\n }",
"protected final PoliticianMenuItemFactory getPoliticianMenuItemFactory() {\n\t\treturn politicianMenuItemFactory;\n\t}",
"public interface IShopManagerService {\n\t\n\t// --- returns list of all aids, weapons and armors into database ---\n\tList <Aid> getAllAids();\t\n\tList <Weapon> getAllWeapons();\t\n\tList <Armor> getAllArmors();\n\t// ---\t\n\t\n\t// --- allow to sell/buy items\n\tboolean sellWeaponsForUser(int uid, List<Integer> wIds);\n\tboolean sellArmorsForUser(int uid, List<Integer> arIds);\n\tboolean sellAidsForUser(int uid, List<Integer> aidIds);\n\t\n\tboolean buyWeaponsForUser(int uid, List<Integer> wIds);\n\tboolean buyArmorsForUser(int uid, List<Integer> arIds);\n\tboolean buyAidsForUser(int uid, List<Integer> aidIds);\n\t// ---\n\t\n}",
"public interface RoleTypeFactory {\n\tpublic void initView();\n\tpublic Role checkCredentials(String username, String password, String loginas);\n\t\t\n}",
"public Pack2FactoryImpl() {\n\t\tsuper();\n\t}",
"@Override\n\tpublic IProduct factoryMethod() {\n\t\treturn new Toy();\n\t}",
"public interface RentalFactory {\n\n Rental createRental(String pickUpdate, String returnDate, List<PaymentMethod> paymentMethod);\n\n}",
"public interface DaoFactory {\r\n\r\n\t/**\r\n\t * Returns objects for access to account table.\r\n\t * \r\n\t * @return DAO for account table.\r\n\t */\r\n\tpublic GenericDao<Account> getAccountDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to client table.\r\n\t * \r\n\t * @return DAO for client table.\r\n\t */\r\n\tpublic GenericDao<Client> getClientDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to payment table.\r\n\t * \r\n\t * @return DAO for payment table.\r\n\t */\r\n\tpublic GenericDao<Payment> getPaymentDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to credit card table.\r\n\t * \r\n\t * @return DAO for credit card table.\r\n\t */\r\n\tpublic GenericDao<CreditCard> getCreditCardDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to authorization table.\r\n\t * \r\n\t * @return DAO for authorization table.\r\n\t */\r\n\tpublic GenericDao<Autorization> getAutorizationDao();\r\n\r\n\t/**\r\n\t * This method returns connection for accessing to database.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic Connection getConnection();\r\n\r\n}",
"@Subcomponent.Builder\n interface Factory {\n LoginComponent create();\n }",
"public abstract void create();",
"public interface SpaceinvadersFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tSpaceinvadersFactory eINSTANCE = spaceinvaders.impl.SpaceinvadersFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders createSpacesInvaders();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau</em>'.\n\t * @generated\n\t */\n\tVaisseau createVaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Position</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Position</em>'.\n\t * @generated\n\t */\n\tPosition createPosition();\n\n\t/**\n\t * Returns a new object of class '<em>Position Position</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Position Position</em>'.\n\t * @generated\n\t */\n\tPosition_Position createPosition_Position();\n\n\t/**\n\t * Returns a new object of class '<em>Position abscisse</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Position abscisse</em>'.\n\t * @generated\n\t */\n\tPosition_abscisse createPosition_abscisse();\n\n\t/**\n\t * Returns a new object of class '<em>Position ordonnee</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Position ordonnee</em>'.\n\t * @generated\n\t */\n\tPosition_ordonnee createPosition_ordonnee();\n\n\t/**\n\t * Returns a new object of class '<em>Position changer Abscisse</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Position changer Abscisse</em>'.\n\t * @generated\n\t */\n\tPosition_changerAbscisse createPosition_changerAbscisse();\n\n\t/**\n\t * Returns a new object of class '<em>Position changer Ordonnee</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Position changer Ordonnee</em>'.\n\t * @generated\n\t */\n\tPosition_changerOrdonnee createPosition_changerOrdonnee();\n\n\t/**\n\t * Returns a new object of class '<em>Dimension</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Dimension</em>'.\n\t * @generated\n\t */\n\tDimension createDimension();\n\n\t/**\n\t * Returns a new object of class '<em>Dimension Dimension</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Dimension Dimension</em>'.\n\t * @generated\n\t */\n\tDimension_Dimension createDimension_Dimension();\n\n\t/**\n\t * Returns a new object of class '<em>Dimension longueur</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Dimension longueur</em>'.\n\t * @generated\n\t */\n\tDimension_longueur createDimension_longueur();\n\n\t/**\n\t * Returns a new object of class '<em>Dimension hauteur</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Dimension hauteur</em>'.\n\t * @generated\n\t */\n\tDimension_hauteur createDimension_hauteur();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * @generated\n\t */\n\tVaisseau_Vaisseau createVaisseau_Vaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * @generated\n\t */\n\tVaisseau_Vaisseau createVaisseau_Vaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * @generated\n\t */\n\tVaisseau_Vaisseau createVaisseau_Vaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau Vaisseau</em>'.\n\t * @generated\n\t */\n\tVaisseau_Vaisseau createVaisseau_Vaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau occupe La Position</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau occupe La Position</em>'.\n\t * @generated\n\t */\n\tVaisseau_occupeLaPosition createVaisseau_occupeLaPosition();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau est Ordonnee Couverte</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau est Ordonnee Couverte</em>'.\n\t * @generated\n\t */\n\tVaisseau_estOrdonneeCouverte createVaisseau_estOrdonneeCouverte();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau est Abscisse Couverte</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau est Abscisse Couverte</em>'.\n\t * @generated\n\t */\n\tVaisseau_estAbscisseCouverte createVaisseau_estAbscisseCouverte();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau ordonnee La Plus Basse</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau ordonnee La Plus Basse</em>'.\n\t * @generated\n\t */\n\tVaisseau_ordonneeLaPlusBasse createVaisseau_ordonneeLaPlusBasse();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau ordonnee La Plus Haute</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau ordonnee La Plus Haute</em>'.\n\t * @generated\n\t */\n\tVaisseau_ordonneeLaPlusHaute createVaisseau_ordonneeLaPlusHaute();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau abscisse La Plus ADroite</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau abscisse La Plus ADroite</em>'.\n\t * @generated\n\t */\n\tVaisseau_abscisseLaPlusADroite createVaisseau_abscisseLaPlusADroite();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau abscisse La Plus AGauche</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau abscisse La Plus AGauche</em>'.\n\t * @generated\n\t */\n\tVaisseau_abscisseLaPlusAGauche createVaisseau_abscisseLaPlusAGauche();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau se Deplacer Vers La Droite</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau se Deplacer Vers La Droite</em>'.\n\t * @generated\n\t */\n\tVaisseau_seDeplacerVersLaDroite createVaisseau_seDeplacerVersLaDroite();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau se Deplacer Vers La Gauche</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau se Deplacer Vers La Gauche</em>'.\n\t * @generated\n\t */\n\tVaisseau_seDeplacerVersLaGauche createVaisseau_seDeplacerVersLaGauche();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau positionner</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau positionner</em>'.\n\t * @generated\n\t */\n\tVaisseau_positionner createVaisseau_positionner();\n\n\t/**\n\t * Returns a new object of class '<em>Vaisseau longueur</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Vaisseau longueur</em>'.\n\t * @generated\n\t */\n\tVaisseau_longueur createVaisseau_longueur();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders Spaces Invaders</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders Spaces Invaders</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_SpacesInvaders createSpacesInvaders_SpacesInvaders();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders recuperer Espace Jeu Dans Chaine ASCII</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders recuperer Espace Jeu Dans Chaine ASCII</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_recupererEspaceJeuDansChaineASCII createSpacesInvaders_recupererEspaceJeuDansChaineASCII();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders recuperer Marque De La Position</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders recuperer Marque De La Position</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_recupererMarqueDeLaPosition createSpacesInvaders_recupererMarqueDeLaPosition();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders aUn Vaisseau Qui Occupe La Position</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders aUn Vaisseau Qui Occupe La Position</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_aUnVaisseauQuiOccupeLaPosition createSpacesInvaders_aUnVaisseauQuiOccupeLaPosition();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders aUn Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders aUn Vaisseau</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_aUnVaisseau createSpacesInvaders_aUnVaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders est Dans Espace Jeu</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders est Dans Espace Jeu</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_estDansEspaceJeu createSpacesInvaders_estDansEspaceJeu();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders deplacer Vaisseau Vers La Droite</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders deplacer Vaisseau Vers La Droite</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_deplacerVaisseauVersLaDroite createSpacesInvaders_deplacerVaisseauVersLaDroite();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders deplacer Vaisseau Vers La Gauche</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders deplacer Vaisseau Vers La Gauche</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_deplacerVaisseauVersLaGauche createSpacesInvaders_deplacerVaisseauVersLaGauche();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders positionner Un Nouveau Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders positionner Un Nouveau Vaisseau</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_positionnerUnNouveauVaisseau createSpacesInvaders_positionnerUnNouveauVaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Spaces Invaders positionner Un Nouveau Vaisseau</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Spaces Invaders positionner Un Nouveau Vaisseau</em>'.\n\t * @generated\n\t */\n\tSpacesInvaders_positionnerUnNouveauVaisseau createSpacesInvaders_positionnerUnNouveauVaisseau();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest createSpaceInvaderTest();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test initialisation</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test initialisation</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_initialisation createSpaceInvaderTest_initialisation();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test Au Debut Jeu Space Invader Est Vide</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test Au Debut Jeu Space Invader Est Vide</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_AuDebut_JeuSpaceInvaderEstVide createSpaceInvaderTest_test_AuDebut_JeuSpaceInvaderEstVide();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test un Nouveau Vaisseau Est Correctement Positionne Dans Espace Jeu</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test un Nouveau Vaisseau Est Correctement Positionne Dans Espace Jeu</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_unNouveauVaisseauEstCorrectementPositionneDansEspaceJeu createSpaceInvaderTest_test_unNouveauVaisseauEstCorrectementPositionneDansEspaceJeu();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test Un Nouveau Vaisseau Positionne Hors Espace Jeu Doit Lever Une Exception</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test Un Nouveau Vaisseau Positionne Hors Espace Jeu Doit Lever Une Exception</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLeverUneException createSpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLeverUneException();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test un Nouveau Vaisseau Avec Dimension Est Correctement Positionne Dans Espace Jeu</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test un Nouveau Vaisseau Avec Dimension Est Correctement Positionne Dans Espace Jeu</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_unNouveauVaisseauAvecDimensionEstCorrectementPositionneDansEspaceJeu createSpaceInvaderTest_test_unNouveauVaisseauAvecDimensionEstCorrectementPositionneDansEspaceJeu();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test Un Nouveau Vaisseau Positionne Dans Espace Jeu Mais Avec Dimension Trop Grande Doit Lever Une Exception De Debordement</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test Un Nouveau Vaisseau Positionne Dans Espace Jeu Mais Avec Dimension Trop Grande Doit Lever Une Exception De Debordement</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_UnNouveauVaisseauPositionneDansEspaceJeuMaisAvecDimensionTropGrande_DoitLeverUneExceptionDeDebordement createSpaceInvaderTest_test_UnNouveauVaisseauPositionneDansEspaceJeuMaisAvecDimensionTropGrande_DoitLeverUneExceptionDeDebordement();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test Vaisseau Avance Deplacer Vaisseau Vers La Gauche</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test Vaisseau Avance Deplacer Vaisseau Vers La Gauche</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test Vaisseau Immobile Deplacer Vaisseau Vers La Gauche</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test Vaisseau Immobile Deplacer Vaisseau Vers La Gauche</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_VaisseauImmobile_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauImmobile_DeplacerVaisseauVersLaGauche();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test Vaisseau Avance Deplacer Vaisseau Vers La Droite</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test Vaisseau Avance Deplacer Vaisseau Vers La Droite</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_VaisseauAvance_DeplacerVaisseauVersLaDroite createSpaceInvaderTest_test_VaisseauAvance_DeplacerVaisseauVersLaDroite();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test Vaisseau Immobile Deplacer Vaisseau Vers La Droite</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test Vaisseau Immobile Deplacer Vaisseau Vers La Droite</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_VaisseauImmobile_DeplacerVaisseauVersLaDroite createSpaceInvaderTest_test_VaisseauImmobile_DeplacerVaisseauVersLaDroite();\n\n\t/**\n\t * Returns a new object of class '<em>Space Invader Test test Vaisseau Avance Partiellement Deplacer Vaisseau Vers La Droite</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Space Invader Test test Vaisseau Avance Partiellement Deplacer Vaisseau Vers La Droite</em>'.\n\t * @generated\n\t */\n\tSpaceInvaderTest_test_VaisseauAvancePartiellement_DeplacerVaisseauVersLaDroite createSpaceInvaderTest_test_VaisseauAvancePartiellement_DeplacerVaisseauVersLaDroite();\n\n\t/**\n\t * Returns a new object of class '<em>New Class1</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>New Class1</em>'.\n\t * @generated\n\t */\n\tNewClass1 createNewClass1();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tSpaceinvadersPackage getSpaceinvadersPackage();\n\n}",
"public interface IngestModuleFactory {\n\n /**\n * Gets the display name that identifies the family of ingest modules the\n * factory creates. Autopsy uses this string to identify the module in user\n * interface components and log messages. The module name must be unique. so\n * a brief but distinctive name is recommended.\n *\n * @return The module family display name.\n */\n String getModuleDisplayName();\n\n /**\n * Gets a brief, user-friendly description of the family of ingest modules\n * the factory creates. Autopsy uses this string to describe the module in\n * user interface components.\n *\n * @return The module family description.\n */\n String getModuleDescription();\n\n /**\n * Gets the version number of the family of ingest modules the factory\n * creates.\n *\n * @return The module family version number.\n */\n String getModuleVersionNumber();\n\n /**\n * Queries the factory to determine if it provides a user interface panel to\n * allow a user to change settings that are used by all instances of the\n * family of ingest modules the factory creates. For example, the Autopsy\n * core hash lookup ingest module factory provides a global settings panel\n * to import and create hash databases. The hash databases are then enabled\n * or disabled per ingest job using an ingest job settings panel. If the\n * module family does not have global settings, the factory may extend\n * IngestModuleFactoryAdapter to get an implementation of this method that\n * returns false.\n *\n * @return True if the factory provides a global settings panel.\n */\n boolean hasGlobalSettingsPanel();\n\n /**\n * Gets a user interface panel that allows a user to change settings that\n * are used by all instances of the family of ingest modules the factory\n * creates. For example, the Autopsy core hash lookup ingest module factory\n * provides a global settings panel to import and create hash databases. The\n * imported hash databases are then enabled or disabled per ingest job using\n * ingest an ingest job settings panel. If the module family does not have a\n * global settings, the factory may extend IngestModuleFactoryAdapter to get\n * an implementation of this method that throws an\n * UnsupportedOperationException.\n *\n * @return A global settings panel.\n */\n IngestModuleGlobalSettingsPanel getGlobalSettingsPanel();\n\n /**\n * Gets the default per ingest job settings for instances of the family of\n * ingest modules the factory creates. For example, the Autopsy core hash\n * lookup ingest modules family uses hash databases imported or created\n * using its global settings panel. All of the hash databases are enabled by\n * default for an ingest job. If the module family does not have per ingest\n * job settings, the factory may extend IngestModuleFactoryAdapter to get an\n * implementation of this method that returns an instance of the\n * NoIngestModuleJobSettings class.\n *\n * @return The default ingest job settings.\n */\n IngestModuleIngestJobSettings getDefaultIngestJobSettings();\n\n /**\n * Queries the factory to determine if it provides user a interface panel to\n * allow a user to make per ingest job settings for instances of the family\n * of ingest modules the factory creates. For example, the Autopsy core hash\n * lookup ingest module factory provides an ingest job settings panels to\n * enable or disable hash databases per ingest job. If the module family\n * does not have per ingest job settings, the factory may extend\n * IngestModuleFactoryAdapter to get an implementation of this method that\n * returns false.\n *\n * @return True if the factory provides ingest job settings panels.\n */\n boolean hasIngestJobSettingsPanel();\n\n /**\n * Gets a user interface panel that can be used to set per ingest job\n * settings for instances of the family of ingest modules the factory\n * creates. For example, the core hash lookup ingest module factory provides\n * an ingest job settings panel to enable or disable hash databases per\n * ingest job. If the module family does not have per ingest job settings,\n * the factory may extend IngestModuleFactoryAdapter to get an\n * implementation of this method that throws an\n * UnsupportedOperationException.\n *\n * @param settings Per ingest job settings to initialize the panel.\n *\n * @return An ingest job settings panel.\n */\n IngestModuleIngestJobSettingsPanel getIngestJobSettingsPanel(IngestModuleIngestJobSettings settings);\n\n /**\n * Queries the factory to determine if it is capable of creating data source\n * ingest modules. If the module family does not include data source ingest\n * modules, the factory may extend IngestModuleFactoryAdapter to get an\n * implementation of this method that returns false.\n *\n * @return True if the factory can create data source ingest modules.\n */\n boolean isDataSourceIngestModuleFactory();\n\n /**\n * Creates a data source ingest module instance.\n * <p>\n * Autopsy will generally use the factory to several instances of each type\n * of module for each ingest job it performs. Completing an ingest job\n * entails processing a single data source (e.g., a disk image) and all of\n * the files from the data source, including files extracted from archives\n * and any unallocated space (made to look like a series of files). The data\n * source is passed through one or more pipelines of data source ingest\n * modules. The files are passed through one or more pipelines of file\n * ingest modules.\n * <p>\n * The ingest framework may use multiple threads to complete an ingest job,\n * but it is guaranteed that there will be no more than one module instance\n * per thread. However, if the module instances must share resources, the\n * modules are responsible for synchronizing access to the shared resources\n * and doing reference counting as required to release those resources\n * correctly. Also, more than one ingest job may be in progress at any given\n * time. This must also be taken into consideration when sharing resources\n * between module instances. modules.\n * <p>\n * If the module family does not include data source ingest modules, the\n * factory may extend IngestModuleFactoryAdapter to get an implementation of\n * this method that throws an UnsupportedOperationException.\n *\n * @param settings The settings for the ingest job.\n *\n * @return A data source ingest module instance.\n */\n DataSourceIngestModule createDataSourceIngestModule(IngestModuleIngestJobSettings settings);\n\n /**\n * Queries the factory to determine if it is capable of creating file ingest\n * modules. If the module family does not include file ingest modules, the\n * factory may extend IngestModuleFactoryAdapter to get an implementation of\n * this method that returns false.\n *\n * @return True if the factory can create file ingest modules.\n */\n boolean isFileIngestModuleFactory();\n\n /**\n * Creates a file ingest module instance.\n * <p>\n * Autopsy will generally use the factory to several instances of each type\n * of module for each ingest job it performs. Completing an ingest job\n * entails processing a single data source (e.g., a disk image) and all of\n * the files from the data source, including files extracted from archives\n * and any unallocated space (made to look like a series of files). The data\n * source is passed through one or more pipelines of data source ingest\n * modules. The files are passed through one or more pipelines of file\n * ingest modules.\n * <p>\n * The ingest framework may use multiple threads to complete an ingest job,\n * but it is guaranteed that there will be no more than one module instance\n * per thread. However, if the module instances must share resources, the\n * modules are responsible for synchronizing access to the shared resources\n * and doing reference counting as required to release those resources\n * correctly. Also, more than one ingest job may be in progress at any given\n * time. This must also be taken into consideration when sharing resources\n * between module instances. modules.\n * <p>\n * If the module family does not include file ingest modules, the factory\n * may extend IngestModuleFactoryAdapter to get an implementation of this\n * method that throws an UnsupportedOperationException.\n *\n * @param settings The settings for the ingest job.\n *\n * @return A file ingest module instance.\n */\n FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings);\n}",
"public EcoreFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"StoriesFactory getStoriesFactory();",
"@Override\n protected ObjectFactory initObjectFactory() {\n try {\n BeanManager bm = (BeanManager) new InitialContext().lookup(\"java:comp/BeanManager\");\n Set<Bean<?>> beans = bm.getBeans(CdiObjectFactory.class);\n Bean<CdiObjectFactory> beanType = (Bean<CdiObjectFactory>) beans.iterator().next();\n CreationalContext<CdiObjectFactory> ctx = bm.createCreationalContext(beanType);\n CdiObjectFactory objFactory = (CdiObjectFactory) bm.getReference(beanType, CdiObjectFactory.class, ctx);\n objFactory.init(this);\n return objFactory;\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n }",
"private MultibinderFactory() { }",
"public interface IFactory {\n Operation CreateOperation();\n\n}",
"private OrderFacade(){\n\t\tAbstractDAOFactory f = new MySQLDAOFactory();\n \tthis.odao = f.getOrderDAO();\n\t}",
"public UiFactoryImpl() {\n\t\tsuper();\n\t}",
"public ObjectFactoryMenu() {\n }",
"public EzdmxctrlFactoryImpl() {\n\t\tsuper();\n\t}",
"public ParameterizedInstantiateFactory() {\r\n super();\r\n }",
"public EntityFactoryImpl() {\n\t\tsuper();\n\t}",
"Sticker.Factory getStickerFactory();",
"public interface ApiFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tApiFactory eINSTANCE = work.andycarpenter.webgen.pims.api.impl.ApiFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>API</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>API</em>'.\n\t * @generated\n\t */\n\tAPI createAPI();\n\n\t/**\n\t * Returns a new object of class '<em>Resource</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Resource</em>'.\n\t * @generated\n\t */\n\tResource createResource();\n\n\t/**\n\t * Returns a new object of class '<em>Resource Selection</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Resource Selection</em>'.\n\t * @generated\n\t */\n\tResourceSelection createResourceSelection();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tApiPackage getApiPackage();\n\n}",
"public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }",
"private PerksFactory() {\n\n\t}",
"public AoDai chooseFactory(){\n\t\treturn new ModernAoDai();\n\t}",
"public CoreFactoryImpl() {\n\t\tsuper();\n\t}",
"public interface SOSFactory {\n SOS getSOS();\n}",
"MenuEntry.Factory getMenuEntryFactory();",
"public AutomatizacionrevisionFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"@Test\n public void testFactory() throws SosInjectorConfigurationException{\n PublisherInfo pi = new PublisherInfo();\n pi.setCode(\"test\");\n pi.setCountry(\"test\");\n pi.setEmail(\"[email protected]\");\n pi.setName(\"test\");\n pi.setWebAddress(\"http://test.com\");\n\n SosInjector sosInjector = CnfaicSosInjectorFactory.buildCnfaicSosInjector(\"http://test.com\", null, pi);\n assertNotNull(sosInjector);\n }",
"public interface IAdminDao {\n\n public Admin getAdminByName(String name);\n\n}"
] | [
"0.6694276",
"0.6346458",
"0.63353413",
"0.62848383",
"0.6272549",
"0.6251851",
"0.6229818",
"0.62139666",
"0.6207645",
"0.61815786",
"0.6151189",
"0.61300427",
"0.6129285",
"0.60563284",
"0.6053874",
"0.6040586",
"0.6002199",
"0.598574",
"0.59818065",
"0.5977057",
"0.59693587",
"0.59561896",
"0.595483",
"0.59485555",
"0.5931352",
"0.592235",
"0.59172827",
"0.59099287",
"0.5907545",
"0.5899478",
"0.58818865",
"0.58813995",
"0.5880895",
"0.58807486",
"0.58772624",
"0.58647937",
"0.5864182",
"0.58579624",
"0.58525693",
"0.5851244",
"0.58490616",
"0.58473146",
"0.58424026",
"0.5834099",
"0.5824679",
"0.5807864",
"0.5775591",
"0.57618177",
"0.5752062",
"0.57466704",
"0.5739999",
"0.57332253",
"0.5719355",
"0.57191116",
"0.5701101",
"0.56914",
"0.5679562",
"0.5678753",
"0.5676227",
"0.5672085",
"0.5659576",
"0.56587505",
"0.56502753",
"0.56492394",
"0.5646932",
"0.5646234",
"0.56438804",
"0.5637807",
"0.56323475",
"0.563167",
"0.5631352",
"0.56261307",
"0.56255937",
"0.56221527",
"0.56134176",
"0.56092906",
"0.560873",
"0.56047237",
"0.5596681",
"0.5593007",
"0.55925864",
"0.5591434",
"0.5590206",
"0.55894107",
"0.5585328",
"0.558155",
"0.5580188",
"0.55749303",
"0.5567384",
"0.5563171",
"0.5555813",
"0.554453",
"0.5534799",
"0.5531917",
"0.5528529",
"0.5522277",
"0.5514893",
"0.55059266",
"0.55040693",
"0.55024403",
"0.54970556"
] | 0.0 | -1 |
/ renamed from: Ux | public final MediaFormat mo41565Ux() {
AppMethodBeat.m2504i(12848);
C4990ab.m7416i("MicroMsg.VideoCodecConfig", "targetWidth:" + this.eTi + ", targetHeight:" + this.eTj + ", bitrate:" + this.bitrate + ", frameRate:" + this.eTk + ", colorFormat:" + this.eTl + ", iFrameInterval:" + this.eTm);
MediaFormat createVideoFormat = MediaFormat.createVideoFormat(this.MIME_TYPE, this.eTi, this.eTj);
MediaCodecInfo mediaCodecInfo = this.eTo;
if (mediaCodecInfo == null) {
C25052j.dWJ();
}
C25052j.m39375o(createVideoFormat, "mediaFormat");
mo33813a(mediaCodecInfo, createVideoFormat);
mediaCodecInfo = this.eTo;
if (mediaCodecInfo == null) {
C25052j.dWJ();
}
C25052j.m39376p(mediaCodecInfo, "codecInfo");
C25052j.m39376p(createVideoFormat, "mediaFormat");
try {
if (C1443d.m3068iW(21)) {
CodecCapabilities capabilitiesForType = mediaCodecInfo.getCapabilitiesForType(this.MIME_TYPE);
if (capabilitiesForType != null) {
EncoderCapabilities encoderCapabilities = capabilitiesForType.getEncoderCapabilities();
if (encoderCapabilities != null) {
if (encoderCapabilities.isBitrateModeSupported(1)) {
C4990ab.m7416i(C18579a.TAG, "support vbr bitrate mode");
createVideoFormat.setInteger("bitrate-mode", 1);
} else if (encoderCapabilities.isBitrateModeSupported(2)) {
C4990ab.m7416i(C18579a.TAG, "support cbr bitrate mode");
createVideoFormat.setInteger("bitrate-mode", 2);
} else {
C4990ab.m7416i(C18579a.TAG, "both vbr and cbr bitrate mode not support!");
}
}
}
}
} catch (Exception e) {
C4990ab.m7413e(C18579a.TAG, "trySetBitRateMode error: %s", e.getMessage());
}
createVideoFormat.setInteger(FFmpegMetadataRetriever.METADATA_KEY_VARIANT_BITRATE, this.bitrate);
createVideoFormat.setInteger("frame-rate", this.eTk);
createVideoFormat.setInteger("color-format", this.eTl);
createVideoFormat.setInteger("i-frame-interval", this.eTm);
AppMethodBeat.m2505o(12848);
return createVideoFormat;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void xuat() {\n\n\t}",
"public void mo21879u() {\n }",
"abstract void uminus();",
"public abstract void mo20899UO();",
"protected Item func_146068_u() { return Item.func_150899_d(0); }",
"@Override\n\tpublic void xuat() {\n\t\tsuper.xuat();\n\t}",
"private USI_TRLT() {}",
"Uom getUom();",
"public abstract String mo9239aw();",
"protected void mo6255a() {\n }",
"abstract String mo1748c();",
"@Override\n\tpublic void yürü() {\n\n\t}",
"void mo2508a(bxb bxb);",
"void mo57277b();",
"public final void mo37836u_() {\n }",
"public abstract C0707b mo9237au();",
"public abstract void mo20900UP();",
"public abstract void mo4370a(zzud zzud);",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"public void mo5382o() {\n }",
"public abstract String mo11611b();",
"public abstract String mo9238av();",
"public abstract void mo56925d();",
"java.lang.String getUa();",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public abstract String mo118046b();",
"@Override\n\tprotected void getExras() {\n\n\t}",
"public void mo21780E() {\n }",
"C20241o mo54456u(int i);",
"public abstract String mo41086i();",
"void mo57278c();",
"public abstract void mo2162i();",
"public abstract void mo42330e();",
"void mo1507n();",
"public interface C5906u {\n String getName();\n\n String getValue();\n}",
"public void method_4270() {}",
"public abstract String mo13682d();",
"public void mo21782G() {\n }",
"protected boolean func_70041_e_() { return false; }",
"private void m50366E() {\n }",
"public abstract void mo4378b(int i, zzud zzud);",
"public void mo12628c() {\n }",
"public void mo55254a() {\n }",
"public interface C1803l extends C1813t {\n /* renamed from: b */\n C1803l mo7382b(C2778au auVar);\n\n /* renamed from: f */\n List<C1700ar> mo7233f();\n\n /* renamed from: g */\n C2841w mo7234g();\n\n /* renamed from: q */\n C1800i mo7384q();\n}",
"public final void mo92083O() {\n }",
"public abstract C7982k4<E> m39518y();",
"public abstract void mo6549b();",
"public void mo1405e() {\n }",
"void mo57275a();",
"public void mo3376r() {\n }",
"public void mo38117a() {\n }",
"public void Tyre() {\n\t\t\r\n\t}",
"public abstract String mo41079d();",
"public void mo21793R() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public abstract void mo70713b();",
"public abstract EUT eut();",
"public void mo21825b() {\n }",
"public abstract void mo4364a(int i, zzud zzud);",
"public abstract void mo42331g();",
"@Override\n public void func_104112_b() {\n \n }",
"public final void mo91715d() {\n }",
"public final void mo51373a() {\n }",
"void mo3194r();",
"public void mo21878t() {\n }",
"private void strin() {\n\n\t}",
"public void mo21792Q() {\n }",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n protected void getExras() {\n }",
"public final void mo12688e_() {\n }",
"public void skystonePos6() {\n }",
"void mo56163g();",
"public void mo21779D() {\n }",
"public void mo115190b() {\n }",
"public abstract Object mo26777y();",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public abstract Object mo1185b();",
"public interface C18492a {\n /* renamed from: Pw */\n void mo33731Pw();\n\n /* renamed from: Px */\n void mo33732Px();\n}",
"void mo27575a();",
"public abstract void mo2624j();",
"void mo21074e();",
"public abstract Object mo1771a();",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public void mo21877s() {\n }",
"interface C11601a {\n /* renamed from: tY */\n void mo23327tY(int i);\n }",
"public abstract void mo27385c();",
"public void mo115188a() {\n }",
"void mo80457c();",
"void mo1940i();",
"public abstract String mo9751p();",
"@Override\n\tpublic void anular() {\n\n\t}",
"public void mo21784I() {\n }",
"public abstract void mo42329d();",
"abstract C0451h mo1607e();",
"public abstract String mo8770a();"
] | [
"0.7054415",
"0.6365078",
"0.6262363",
"0.6097347",
"0.6023744",
"0.6014162",
"0.59930533",
"0.578568",
"0.5668617",
"0.5667812",
"0.56495655",
"0.5632418",
"0.5630484",
"0.55850714",
"0.5582077",
"0.5575835",
"0.5547519",
"0.554729",
"0.55384517",
"0.55242044",
"0.5517453",
"0.54574317",
"0.54564756",
"0.54562",
"0.54561925",
"0.54561925",
"0.54561925",
"0.54561925",
"0.54561925",
"0.54561925",
"0.54561925",
"0.5448164",
"0.5447107",
"0.54218054",
"0.54215133",
"0.5420788",
"0.5420488",
"0.5419065",
"0.54161227",
"0.54155445",
"0.54128397",
"0.54127693",
"0.54061973",
"0.53968537",
"0.53847784",
"0.53831613",
"0.538166",
"0.5375352",
"0.5368703",
"0.53597647",
"0.5359294",
"0.5359016",
"0.53580743",
"0.53534895",
"0.5352766",
"0.53501195",
"0.53479826",
"0.5337885",
"0.5336767",
"0.5331443",
"0.5329325",
"0.5327186",
"0.53147024",
"0.53140247",
"0.5311592",
"0.53107584",
"0.530795",
"0.53016776",
"0.52962255",
"0.5288344",
"0.528827",
"0.52869034",
"0.5286215",
"0.5283293",
"0.5281172",
"0.527649",
"0.5276154",
"0.52753454",
"0.527522",
"0.5269031",
"0.52686834",
"0.52659893",
"0.52607745",
"0.52578926",
"0.5257433",
"0.52567947",
"0.5256058",
"0.5253489",
"0.5253396",
"0.5251806",
"0.52514195",
"0.5249919",
"0.52425873",
"0.5240622",
"0.5240088",
"0.52379525",
"0.5237567",
"0.5235877",
"0.5233702",
"0.5232994",
"0.5228657"
] | 0.0 | -1 |
provides implementation for the nondefault method of the interface | @Override
public int method1() {
return 20;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void defaultMethod() {\n I4.super.defaultMethod();\n }",
"public default void defaultMethod(){\r\n System.out.println(\"This is a method from Other Interface and can be overriden.\");\r\n }",
"default void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }",
"public interface A {\n default void oi(){\n System.out.println(\"Dentro do oi de A\");\n }\n}",
"interface Sample {\n\tvoid method(String a);\n\t// New in Java 1.8 - default interface methods\n\tdefault void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}\n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"interface I{\n\n public void m1();\n public void m2();\n default void m3(){\n System.out.println(\"Default methods in interface\");\n }\n}",
"interface A {\n default void m() {\n System.out.println(\"I am default method\");\n }\n}",
"public void interfaceMethod() {\n\t\tSystem.out.println(\"overriden method from interface\");\t\t\r\n\t}",
"@Override\n\tpublic void myMethod() {\n\t\t\n\t}",
"public interface IUserService {\n\n static void test(){\n System.out.println(123);\n }\n\n default void teset1(String name){\n System.out.println(name);\n }\n\n int a = 0;\n\n}",
"default void display1(){\n\t\tSystem.out.println(\"Default Method inside interface\");\n\t}",
"@Override\r\n\tpublic void method() {\n\t\r\n\t}",
"public interface MyInterface2 {\n default void hello(){\n System.out.println(\"hello again\");\n }\n}",
"public Object _get_interface()\n {\n throw new NO_IMPLEMENT(reason);\n }",
"@Override\r\npublic int method() {\n\treturn 0;\r\n}",
"interface TestInterface1\n{\n // default method\n default void show()\n {\n System.out.println(\"Default TestInterface1\");\n }\n \n public static void show2()\n {\n System.out.println(\"Default TestInterface2\");\n }\n}",
"public interface IMy extends IA, IB{\n int a = 10;\n int []b = {1,2,3,4,5,6,7};\n\n void m();\n static void sm(){\n System.out.println(\"hi from static method\");\n }\n default void dm(){\n System.out.println(\"hi from default method\");\n }\n}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public interface InterfaceA {\n\n\tpublic void methodFromInterfaceA();\n\n\t// Before Java 8, the interface only contains method signatures. \n\t// With Java 8 new feature Default Methods or Defender Methods, \n\t// you can include method body within the interface.\n\tdefault void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }\n\t\n\tstatic void someStaticMethod() {\n System.out.println(\"from InterfaceA static method...\");\n }\n\t\n\t/*\n\t * Why do we need to implement a method within the interface?\n\t * \n * Let's say you have an interface which has multiple methods, \n * and multiple classes are implementing this interface. One \n * of the method implementations can be common across the classes, \n * we can make that method as a default method, so that the \n * implementation is common for all classes.\n *\n * How to work with existing interfaces?\n * \n\t * Second scenario where you have already existing application, \n\t * for a new requirement we have to add a method to the existing \n\t * interface. If we add new method then we need to implement it \n\t * through out the implementation classes. By using the Java 8 \n\t * default method we can add a default implementation of that \n\t * method which resolves the problem.\n\t */\n}",
"public abstract void abstractMethodToImplement();",
"public interface InterfaceA {\n\n default String message() {\n return \"Message from Interface A\";\n }\n\n}",
"public interface MyInterface {\n\n String returnString(String string);\n\n default int returnInt() {\n return 105;\n }\n}",
"public interface Defaultable {\n default void notRequired(){\n System.out.println(\"default method\");\n }\n static void staticMethod(){\n System.out.println(\"static method\");\n }\n static Defaultable create(Supplier<Defaultable> supplier){\n return supplier.get();\n }\n}",
"interface Interface1 {\n\n\tdefault void add() {\n\t\tSystem.out.println(\"Interface1 add method\");\n\t}\n\n\tdefault void display() {\n\t\tSystem.out.println(\"Interface1 display\");\n\t}\n\n\t//static methods can be invoked only using InterfaceName.methodName\n\tstatic void print() {\n\t\tSystem.out.println(\"Interface1 print\");\n\t}\n\n\tstatic void printV2() {\n\t\tSystem.out.println(\"Interface1 printV2\");\n\t}\n}",
"@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"public interface a {\n void a();\n }",
"public interface a {\n void a();\n }",
"public interface J {\n\n void f();\n\n default void g() {\n System.out.println(\"This is the default method of J\");\n }\n\n public static void h() {\n System.out.println(\"This is the static method of J\");\n }\n}",
"@Override\n public boolean isInterface() { return false; }",
"@Override\n\tvoid methodabstract() {\n\t\t\n\t}",
"interface DefaultMethod extends SingleMethod {\r\n\tdefault public void myMethod() {\r\n\t\tSystem.out.println(\"from Java 1.8 version can have method with a body\");\r\n}\r\n}",
"@Override\n protected void prot() {\n }",
"abstract void method();",
"public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}",
"interface TakesScreenshot{\n\tString $FILE_EXTENSION=\".png\"; //COMPILER ADDs 'public static final' automatically \t\n\tvoid takesScreenshot();\n\t//added from jdk 1.8\nstatic void takeSelfie() {\n\t\tSystem.out.println(\"I am defined static method of TakesScreenshot interface\");\n\t}\ndefault void takePictures() {\n\t\tSystem.out.println(\"I am default defined method of TakesScreenshot interface\");\n\t}\n}",
"public interface Work {\n default void doWork() {\n }\n}",
"public interface def2 {\n default void go(){\n System.out.println(\"def2\");\n }\n}",
"public interface HasFins{\n // default Methods: Pueden ser implementados en una interface\n // y siguen las mismas reglas sobre overriding\n public default int getNumberOfFins(){\n return 4;\n }\n\n public default double getLongestFinLength(){\n return 20.0;\n }\n\n public default boolean doFinsHaveScales(){\n return true;\n }\n\n //public default boolean doThat(); // Tiene que ser implementado si tiene el modificador default\n\n}",
"@FunctionalInterface\npublic interface ReaderInterface {\n //void read(Book b);\n\n //default void unread(Book b) {}\n\n void unread(Book b);\n default void read(Book b) {}\n\n}",
"public interface IPresenterHienThiSanPhamTheoDanhMuc {\n void LayDanhSachSP_theoMaLoai(int masp,boolean kiemtra);\n}",
"@FunctionalInterface\ninterface Foo {\n //TODO try to comment the next line\n void method(String string);\n\n //TODO try to create another abstract method\n// void method2(String string);\n //TODO try to create a default method\n default void method3(String string)\n {\n System.out.println(string);\n }\n //TODO create another functional interface and try to extend this one\n\n //TODO create an empty interface and extend this one\n}",
"@Override\n\tpublic boolean isImplemented() {\n\t\treturn false;\n\t}",
"public interface zze\n extends IInterface\n{\n\n public abstract void zza(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zza(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzb(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zzb(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzc(zzd zzd, GoogleSignInConfig googlesigninconfig);\n}",
"@Override\n public void matiz() {\n System.out.println(\"New not Abstract method\");\n }",
"public interface Walk {\n\n public default void status() {\n System.out.println(\"Walking\");\n }\n}",
"public interface AbstractC3386kV0 {\n boolean b();\n\n void d();\n\n void dismiss();\n\n ListView f();\n}",
"interface A {\n void a();\n}",
"public interface ITestInterface {\n\t\tdefault public void sayHello() {\n\t\t\tSystem.out.println(\"Hi World!\");\n\t\t}\n\t}",
"public interface test {\n void test();\n}",
"public void myExtraMethod_login() {\n\tSystem.out.println(\"this is my method that i added to this class and not from interface. This is login\");\n}",
"default void printMyName(){ // interfaces can have only 1 method type with body and have default prefix as a keyword\n System.out.println(\"My name is bla bla\");\n }",
"public interface FlyingAnimal extends Animal {\n @Override\n default String identifyMyself(){\n return \"I am an animal and I can fly\";\n }\n}",
"public void method_1()\n {\n System.out.println(\"Interface method.\");\n }",
"public interface Implementor {\n // 实现抽象部分需要的某些具体功能\n void operationImpl();\n}",
"public interface IOverride extends IMeasurement_descriptor{\n\n\tpublic IRI iri();\n\n}",
"private static interface Base {\n\n public void foo();\n }",
"@Override\n\t\tpublic String getMethod() {\n\t\t\treturn null;\n\t\t}",
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"public interface Interface {\n void doSomething();\n void somethingElse(String arg);\n}",
"public interface A {\n void f();\n}",
"interface InterfaceForDisplaying {\n default void displayDefault() {\n System.out.println(\"I'm a default method defined in an interface\");\n }\n\n static void displayStatic() {\n System.out.println(\"I'm a static method defined in an interface\");\n }\n\n void displayAbstract();\n}",
"public void method() {\n\t\t\r\n\t\t\r\n\t\tnew Inter() {\t\t\t\t\t\t\t//实现Inter接口\r\n\t\t\tpublic void print() {\t\t\t\t//重写抽象方法\r\n\t\t\t\tSystem.out.println(\"print\");\r\n\t\t\t}\r\n\t\t}.print();\r\n\t\t\r\n\t\t\r\n\t}",
"public interface SimpleInterface {\n String interfaceMethod(Integer value);\n}",
"public interface C11922a {\n void bvR();\n }",
"public interface EmptyViewMethodAccessor {\n\n\t/**\n\t * Calls upto AdapterView.setEmptyView()\n\t * \n\t * @param emptyView - to set as Empty View\n\t */\n\tpublic void setEmptyViewInternal(View emptyView);\n\n\t/**\n\t * Should call PullToRefreshBase.setEmptyView() which will then\n\t * automatically call through to setEmptyViewInternal()\n\t * \n\t * @param emptyView - to set as Empty View\n\t */\n\tpublic void setEmptyView(View emptyView);\n\n}",
"public interface ICamera {\r\n void takePhoto(); // abstract method\r\n void changeAperture();\r\n\r\n default void takeHdrPhoto() {\r\n System.out.println(\"take 3 photos with different exposures and combine them together\");\r\n }\r\n\r\n default void shootVideo() {\r\n System.out.println(\"shooting a video\");\r\n }\r\n}",
"@Override\npublic void noninvesters() {\n\t\n}",
"public interface Customizable {\n\n /**\n * This method adds based on the parameter passed and the class it is implemented in.\n * @param obj object\n * @return true is added successfully, otherwise false\n */\n boolean add(Object obj);\n\n /**\n * This method removes based on the parameter passed and the class it is implemented in.\n * @param obj object\n * @return true is removed successfully, otherwise false\n */\n boolean remove(Object obj);\n}",
"default String notRequired() {\n return \"Default implementation\";\n }",
"public interface C22486a {\n void bGQ();\n\n void cMy();\n }",
"public interface IPresenterTinTuc {\n void layDanhSachTinTuc(String duongDan);\n TrangTinTuc layDanhSachTinTucLoadMore(String duongDan);\n}",
"interface in12 \n{ \n\tfinal int a = 10; \n\tdefault void display() \n\t{ \n\t\tSystem.out.println(\"hello\"); \n\t} \n\tdefault void display1() \n\t{\t\n\t\tSystem.out.println(\"hello displa1\"); \n\t}\n}",
"default void helloDefault() {\n\t\tSystem.out.println(\"Hello from default method definitions from Java8 within interfaces\");\n\t}",
"public interface b {\n void a();\n }",
"public interface b {\n void a();\n }",
"public void method(){}",
"public interface CoverCreationMethod {\n\n}",
"interface Hi {\n // MUST BE IMPLEMENTED IN IMPLEMENTING CLASS!!\n void Okay(String q);\n}",
"public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }",
"public interface SampleA {\n void operation1();\n void operation2();\n}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tpublic void A() {\n\t\t\n\t}",
"@Override\n\tpublic void A() {\n\t\t\n\t}",
"interface InterfaceOuting {\n abstract String movingActivity();\n abstract String climbingActivity();\n\n default void restingActivity(){\n String rest = \"Napping\";\n displayOuting(rest);\n }\n\n static void displayOuting(String activity){\n System.out.println(\"This outing will involve \" + activity);\n }\n}",
"public interface ITeslaProduct extends IProduct {\n //@Override\n public abstract void makeProduct();\n}",
"interface C34503a {\n void bMl();\n }",
"interface Interface{\n\tObject call(Object value);\n}",
"public interface MethodFactory extends ModuleSupportable\n{\n\t/**\n\tUsed to identify this interface when finding it with the Monitor.\n\t**/\n\tpublic static final String MODULE = \n\t \"com.splicemachine.db.iapi.store.access.conglomerate.MethodFactory\";\n\n\t/**\n\tReturn the default properties for this access method.\n\t**/\n\tProperties defaultProperties();\n\n\t/**\n\tReturn whether this access method implements the implementation\n\ttype given in the argument string.\n\t**/\n\tboolean supportsImplementation(String implementationId);\n\n\t/**\n\tReturn the primary implementation type for this access method.\n\tAlthough an access method may implement more than one implementation\n\ttype, this is the expected one. The access manager will put the\n\tprimary implementation type in a hash table for fast access.\n\t**/\n\tString primaryImplementationType();\n\n\t/**\n\tReturn whether this access method supports the format supplied in\n\tthe argument.\n\t**/\n\tboolean supportsFormat(UUID formatid);\n\n\t/**\n\tReturn the primary format that this access method supports.\n\tAlthough an access method may support more than one format, this\n\tis the usual one. the access manager will put the primary format\n\tin a hash table for fast access to the appropriate method.\n\t**/\n\tUUID primaryFormat();\n}",
"public interface AgreementService {\n default void sign() {\n System.out.println(\"Agreement has been signed\");\n }\n}",
"public void callmetoo(){\r\n\tSystem.out.println(\"This is a concrete method\");\r\n\t}",
"public interface IEstado {\n\n /**\n * Modifica el estado del objeto publicacion\n *\n * @return String\n */\n String ejecutarAccion();\n}",
"@Override\npublic String say_it() {\n\treturn \"hello world\";\n}",
"@Override\r\n\t\tpublic void action()\r\n\t\t{\r\n// throw new UnsupportedOperationException(\"Not supported yet.\");\r\n\t\t}",
"@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.println(\"method one \");\r\n };\r\n \r\n public static void one1()\r\n {\r\n System.out.println(\"method one 1 \");\r\n };\r\n \r\n public default void one2()\r\n \t {\r\n \t System.out.println(\"method one2 \");\r\n };\r\n \r\n }",
"public interface MyInterface {\n void getDate(String name);\n}",
"protected abstract MethodDescription accessorMethod();",
"public Object _get_interface_def()\n {\n // First try to call the delegate implementation class's\n // \"Object get_interface_def(..)\" method (will work for JDK1.2\n // ORBs).\n // Else call the delegate implementation class's\n // \"InterfaceDef get_interface(..)\" method using reflection\n // (will work for pre-JDK1.2 ORBs).\n\n throw new NO_IMPLEMENT(reason);\n }",
"public interface b {\n int a();\n }"
] | [
"0.7249805",
"0.7235305",
"0.718721",
"0.70334166",
"0.7029502",
"0.6939642",
"0.6793762",
"0.6793507",
"0.67568094",
"0.6712841",
"0.6688373",
"0.66684514",
"0.666464",
"0.66397655",
"0.65871805",
"0.6584456",
"0.658187",
"0.6563336",
"0.6538833",
"0.6538833",
"0.65372545",
"0.653616",
"0.6533895",
"0.6514602",
"0.6471755",
"0.6465384",
"0.64634603",
"0.64618075",
"0.64534587",
"0.64534587",
"0.6434993",
"0.643024",
"0.64243877",
"0.6397599",
"0.6389636",
"0.6385032",
"0.6363049",
"0.63603085",
"0.6314138",
"0.6313567",
"0.6306132",
"0.6303541",
"0.6293532",
"0.628198",
"0.62602055",
"0.62580353",
"0.62562484",
"0.6243278",
"0.6232491",
"0.6226178",
"0.6224258",
"0.62069845",
"0.6197428",
"0.6180016",
"0.6169772",
"0.616973",
"0.6155182",
"0.61436045",
"0.61385375",
"0.6133271",
"0.6122477",
"0.6120775",
"0.61206496",
"0.6117818",
"0.61116856",
"0.6108756",
"0.6086825",
"0.60851663",
"0.6078778",
"0.6074188",
"0.60715467",
"0.60705405",
"0.60698414",
"0.60624045",
"0.6059081",
"0.60505354",
"0.6047416",
"0.6047416",
"0.6044459",
"0.60269034",
"0.6025879",
"0.60218865",
"0.6010769",
"0.60080576",
"0.60046506",
"0.60046506",
"0.599877",
"0.5994346",
"0.599379",
"0.5984152",
"0.5979752",
"0.5978625",
"0.5975282",
"0.5971637",
"0.596296",
"0.59590495",
"0.59520817",
"0.59493184",
"0.5949077",
"0.5948995",
"0.59487975"
] | 0.0 | -1 |
Overriding the default method of MyInterface | public String displayGreeting() {
return "Hello from MyClass";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void myMethod() {\n\t\t\n\t}",
"public interface MyInterface2 {\n default void hello(){\n System.out.println(\"hello again\");\n }\n}",
"public default void defaultMethod(){\r\n System.out.println(\"This is a method from Other Interface and can be overriden.\");\r\n }",
"public void interfaceMethod() {\n\t\tSystem.out.println(\"overriden method from interface\");\t\t\r\n\t}",
"@Override\n public void defaultMethod() {\n I4.super.defaultMethod();\n }",
"public interface A {\n default void oi(){\n System.out.println(\"Dentro do oi de A\");\n }\n}",
"default void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }",
"public interface MyInterface {\n\n String returnString(String string);\n\n default int returnInt() {\n return 105;\n }\n}",
"public interface FlyingAnimal extends Animal {\n @Override\n default String identifyMyself(){\n return \"I am an animal and I can fly\";\n }\n}",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"public interface IMy extends IA, IB{\n int a = 10;\n int []b = {1,2,3,4,5,6,7};\n\n void m();\n static void sm(){\n System.out.println(\"hi from static method\");\n }\n default void dm(){\n System.out.println(\"hi from default method\");\n }\n}",
"@Override\n public boolean isInterface() { return false; }",
"public void myMethod(){\n\t\t\tsuper.myMethod();\n\t\t\tSystem.out.println(\"Overriding method\");\n\t\t }",
"public interface MyInterface {\n void getDate(String name);\n}",
"public interface ITestInterface {\n\t\tdefault public void sayHello() {\n\t\t\tSystem.out.println(\"Hi World!\");\n\t\t}\n\t}",
"interface I{\n\n public void m1();\n public void m2();\n default void m3(){\n System.out.println(\"Default methods in interface\");\n }\n}",
"interface Sample {\n\tvoid method(String a);\n\t// New in Java 1.8 - default interface methods\n\tdefault void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}\n }",
"public interface IOverride extends IMeasurement_descriptor{\n\n\tpublic IRI iri();\n\n}",
"default void display1(){\n\t\tSystem.out.println(\"Default Method inside interface\");\n\t}",
"public interface InterfaceA {\n\n default String message() {\n return \"Message from Interface A\";\n }\n\n}",
"public interface MyIView extends BaseIView{\n void onSuccess();\n void onError();\n}",
"@Override\n\tpublic void method4() {\n\t\tSystem.out.println(\"Hello from MyInterface1 method4() \");\n\t}",
"interface InterfaceChild extends InterfaceParent {\n default String introduce() {\n return \"InterfaceChild\";\n }\n}",
"public interface B extends A {\n void b();\n}",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"@Override\n protected void prot() {\n }",
"interface TestInterface1\n{\n // default method\n default void show()\n {\n System.out.println(\"Default TestInterface1\");\n }\n \n public static void show2()\n {\n System.out.println(\"Default TestInterface2\");\n }\n}",
"public interface Interface {\n void doSomething();\n void somethingElse(String arg);\n}",
"private static interface Base {\n\n public void foo();\n }",
"interface I {}",
"@Override\n\tpublic void common() {\n\t\tSystem.out.println(\"hello from common() for MyInterface2,MyInterface1 \");\n\t}",
"public interface Work {\n default void doWork() {\n }\n}",
"@Override\r\n\tpublic void interfaceMethod() {\n\t\tSystem.out.println(\"childClass - interfaceMethod\");\r\n\t\tSystem.out.println(\"Val of variable from interface: \" + DemoInterface.val );\r\n\t}",
"@Override\n\tpublic void myMethod2() {\n\t\t\n\t}",
"interface A {\n default void m() {\n System.out.println(\"I am default method\");\n }\n}",
"public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }",
"@Override\n\tpublic void method1() {\n\t\tSystem.out.println(\"Hello from MyInterface1 method1() x = \"+MyInterface1.X);\n\t}",
"default void printMyName(){ // interfaces can have only 1 method type with body and have default prefix as a keyword\n System.out.println(\"My name is bla bla\");\n }",
"@Override\r\n\tpublic void method() {\n\t\r\n\t}",
"@Override\n\tpublic void hello2() {\n\t\tSystem.out.println(\"hello from MyInterface2 hello2()\");\n\t}",
"@Override\n\tpublic void method3() {\n\t\tSystem.out.println(\"Hello from MyInterface1 method3() \");\n\t}",
"@Override\n\tpublic void hello3() {\n\t\tSystem.out.println(\"hello from MyInterface2 hello3()\");\n\t}",
"public interface BaseView extends IView {\r\n void onSuccess();\r\n\r\n void onFailure();\r\n}",
"public interface MyInterface {\n public void m1();\n public void m2();\n public void m3();\n public void m4();\n\n}",
"public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}",
"@Override\npublic String say_it() {\n\treturn \"hello world\";\n}",
"public interface AbstractC1953c50 {\n}",
"public interface zze\n extends IInterface\n{\n\n public abstract void zza(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zza(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzb(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zzb(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzc(zzd zzd, GoogleSignInConfig googlesigninconfig);\n}",
"abstract void method();",
"public interface SimpleInterface {\n String interfaceMethod(Integer value);\n}",
"public interface a extends IInterface {\n}",
"public interface BaseIView {\n}",
"interface Hi {\n // MUST BE IMPLEMENTED IN IMPLEMENTING CLASS!!\n void Okay(String q);\n}",
"public interface AInterface {\n\n public void say();\n\n}",
"public interface a {\n void a();\n }",
"public interface a {\n void a();\n }",
"public interface AbstractC2502fH1 extends IInterface {\n}",
"public interface Walk {\n\n public default void status() {\n System.out.println(\"Walking\");\n }\n}",
"protected abstract void switchOnCustom();",
"private static interface Derived extends Base {\n\n public void foo();\n }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public Object _get_interface()\n {\n throw new NO_IMPLEMENT(reason);\n }",
"@Override\n\tpublic void some() {\n\t\t\n\t}",
"public interface Extendable {\n void extend();\n}",
"@Override\n\tpublic void method2() {\n\t\tSystem.out.println(\"Hello from MyInterface1 method2() \");\n\t}",
"@Override\n\tpublic void dosomething2() {\n\t\t\n\t}",
"public interface AbstractC7729o0ooOoo {\n void OooO00o();\n}",
"public interface DiscoverIView extends BaseIView {\n\n}",
"interface Interface1 {\n\n\tdefault void add() {\n\t\tSystem.out.println(\"Interface1 add method\");\n\t}\n\n\tdefault void display() {\n\t\tSystem.out.println(\"Interface1 display\");\n\t}\n\n\t//static methods can be invoked only using InterfaceName.methodName\n\tstatic void print() {\n\t\tSystem.out.println(\"Interface1 print\");\n\t}\n\n\tstatic void printV2() {\n\t\tSystem.out.println(\"Interface1 printV2\");\n\t}\n}",
"public interface AbstractC7617o0oOO {\n void OooO00o(View view);\n\n void OooO0O0(View view);\n\n void OooO0OO(View view);\n}",
"public interface HasFins{\n // default Methods: Pueden ser implementados en una interface\n // y siguen las mismas reglas sobre overriding\n public default int getNumberOfFins(){\n return 4;\n }\n\n public default double getLongestFinLength(){\n return 20.0;\n }\n\n public default boolean doFinsHaveScales(){\n return true;\n }\n\n //public default boolean doThat(); // Tiene que ser implementado si tiene el modificador default\n\n}",
"public void myExtraMethod_login() {\n\tSystem.out.println(\"this is my method that i added to this class and not from interface. This is login\");\n}",
"public interface AbstractC14990nD {\n void ACi(View view);\n\n void ACk(View view);\n\n void ACo(View view);\n}",
"interface A {\n void a();\n}",
"@Override\r\npublic int method() {\n\treturn 0;\r\n}",
"@Override\n\tpublic void A() {\n\t\t\n\t}",
"@Override\n\tpublic void A() {\n\t\t\n\t}",
"@Override\n\tvoid methodabstract() {\n\t\t\n\t}",
"public interface IFlyAminal {\n void fly();\n}",
"interface HiPlus extends Hi {\n void Wow(String m);\n}",
"public interface IUserService {\n\n static void test(){\n System.out.println(123);\n }\n\n default void teset1(String name){\n System.out.println(name);\n }\n\n int a = 0;\n\n}",
"public interface C22486a {\n void bGQ();\n\n void cMy();\n }",
"@Override\n public void matiz() {\n System.out.println(\"New not Abstract method\");\n }",
"public interface DefaultStat extends SwitchOptionStatSequence\n{\n}",
"public interface MyAbstractElement extends EObject {\n}",
"public interface IProvider extends BaseProvider{\n}",
"public interface InterfaceReplacement {\n\n /** The ever present clone method\n */\n public Object clone(); \n\n /** This method will insert the given individual into the population\n * by replacing a individual either from the population or the given\n * subset\n * @param indy The individual to insert\n * @param pop The population\n * @param sub The subset\n */\n public void insertIndividual(AbstractEAIndividual indy, Population pop, Population sub);\n}",
"public interface IFruit {\n\n void say();\n}",
"public interface IBaseView {\n\n void showMsg(String msg);\n}",
"public interface InterfaceA {\n\n\tpublic void methodFromInterfaceA();\n\n\t// Before Java 8, the interface only contains method signatures. \n\t// With Java 8 new feature Default Methods or Defender Methods, \n\t// you can include method body within the interface.\n\tdefault void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }\n\t\n\tstatic void someStaticMethod() {\n System.out.println(\"from InterfaceA static method...\");\n }\n\t\n\t/*\n\t * Why do we need to implement a method within the interface?\n\t * \n * Let's say you have an interface which has multiple methods, \n * and multiple classes are implementing this interface. One \n * of the method implementations can be common across the classes, \n * we can make that method as a default method, so that the \n * implementation is common for all classes.\n *\n * How to work with existing interfaces?\n * \n\t * Second scenario where you have already existing application, \n\t * for a new requirement we have to add a method to the existing \n\t * interface. If we add new method then we need to implement it \n\t * through out the implementation classes. By using the Java 8 \n\t * default method we can add a default implementation of that \n\t * method which resolves the problem.\n\t */\n}",
"public interface AbstractC03680oI {\n}",
"public interface InterTest {\n\n default void test(){\n System.out.println(\"哈哈\");\n }\n}",
"@Override\n\tpublic void anular() {\n\n\t}",
"public interface BaseView {\n\n void showTaost(String string);\n\n}",
"public interface AbstractC1509Ys0 extends Q31 {\n Object g(Callback callback);\n}",
"public interface AbstractC1008ba extends JQ {\n void AA9();\n}",
"public interface A {\n void f();\n}",
"public interface IBaseCustomCard {\r\n\r\n public void initActions();\r\n}",
"@Override\n\tpublic void doYouWantTo() {\n\n\t}",
"public interface ITeslaProduct extends IProduct {\n //@Override\n public abstract void makeProduct();\n}"
] | [
"0.7033782",
"0.69619066",
"0.692019",
"0.6892254",
"0.68289286",
"0.6778242",
"0.6765848",
"0.66891307",
"0.65851414",
"0.65763605",
"0.64657754",
"0.64506704",
"0.637864",
"0.6360038",
"0.63535815",
"0.63369447",
"0.6324507",
"0.62997884",
"0.6285899",
"0.62815917",
"0.6238483",
"0.6233182",
"0.6217489",
"0.62173605",
"0.6204705",
"0.6190897",
"0.61653113",
"0.6162453",
"0.6159472",
"0.614315",
"0.61265963",
"0.61205304",
"0.61189127",
"0.6117437",
"0.61105484",
"0.60965765",
"0.6088645",
"0.60846424",
"0.60823745",
"0.6073248",
"0.6072783",
"0.6071239",
"0.60488045",
"0.6036513",
"0.60357785",
"0.60273665",
"0.60068643",
"0.5999809",
"0.59982866",
"0.5994158",
"0.5992168",
"0.5981688",
"0.5974386",
"0.59577733",
"0.59526676",
"0.59526676",
"0.594922",
"0.5940954",
"0.5939151",
"0.5934361",
"0.59316826",
"0.59316826",
"0.59316456",
"0.5919301",
"0.5918509",
"0.5910762",
"0.5908642",
"0.5908536",
"0.5905819",
"0.5898546",
"0.58973795",
"0.58972704",
"0.58957624",
"0.58941007",
"0.588481",
"0.5875843",
"0.58700705",
"0.58700705",
"0.58584726",
"0.584998",
"0.58478266",
"0.584401",
"0.5843382",
"0.58395314",
"0.58394045",
"0.58365244",
"0.5833693",
"0.58273244",
"0.58220994",
"0.5817266",
"0.5816069",
"0.5814394",
"0.58101296",
"0.5807522",
"0.5801554",
"0.5794994",
"0.57944006",
"0.579052",
"0.579027",
"0.5789726",
"0.5788977"
] | 0.0 | -1 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.